jt3d.es.js 5.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867
  1. var __defProp = Object.defineProperty;
  2. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  3. var __publicField = (obj, key, value) => {
  4. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  5. return value;
  6. };
  7. import { getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, ref, readonly, watch, openBlock, createElementBlock, createElementVNode, warn, computed as computed$1, watchEffect, onBeforeUnmount, inject, isRef, shallowRef, onBeforeMount, provide, defineComponent, renderSlot, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, withDirectives, createCommentVNode, Fragment, normalizeClass, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle, vShow, Transition, reactive, onUpdated, cloneVNode, Text as Text$1, Comment as Comment$1, Teleport, onDeactivated, vModelRadio, createTextVNode, toRefs, toHandlers, withKeys, renderList, h, createSlots, toRaw as toRaw$1, triggerRef, resolveComponent, resolveDirective, vModelText, defineCustomElement } from "vue";
  8. const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  9. class Util {
  10. static uuid(prefix = "D") {
  11. let uuid = [];
  12. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  13. uuid[14] = "4";
  14. let r2;
  15. for (let i2 = 0; i2 < 36; i2++) {
  16. if (!uuid[i2]) {
  17. r2 = 0 | Math.random() * 16;
  18. uuid[i2] = CHARS[i2 == 19 ? r2 & 3 | 8 : r2];
  19. }
  20. }
  21. return prefix + "-" + uuid.join("");
  22. }
  23. static merge(dest, ...sources) {
  24. let i2, j, len, src;
  25. for (j = 0, len = sources.length; j < len; j++) {
  26. src = sources[j];
  27. for (i2 in src) {
  28. dest[i2] = src[i2];
  29. }
  30. }
  31. return dest;
  32. }
  33. static trim(str) {
  34. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
  35. }
  36. static splitWords(str) {
  37. return this.trim(str).split(/\s+/);
  38. }
  39. static setOptions(obj, options2) {
  40. if (!obj.hasOwnProperty("options")) {
  41. obj.options = obj.options ? create(obj.options) : {};
  42. }
  43. for (var i2 in options2) {
  44. obj.options[i2] = options2[i2];
  45. }
  46. return obj.options;
  47. }
  48. static checkPosition(position2) {
  49. return position2 && position2.hasOwnProperty("_lng") && position2.hasOwnProperty("_lat") && position2.hasOwnProperty("_alt");
  50. }
  51. static checkPositions(positions) {
  52. return positions && (typeof positions === "string" || Array.isArray(positions));
  53. }
  54. static checkViewer(viewer2) {
  55. return viewer2 && viewer2.delegate && viewer2.canvas;
  56. }
  57. }
  58. class DomUtil {
  59. static get(id) {
  60. return typeof id === "string" ? document.getElementById(id) : id;
  61. }
  62. static getStyle(el, style) {
  63. var value = el.style[style] || el.currentStyle && el.currentStyle[style];
  64. if ((!value || value === "auto") && document.defaultView) {
  65. var css = document.defaultView.getComputedStyle(el, null);
  66. value = css ? css[style] : null;
  67. }
  68. return value === "auto" ? null : value;
  69. }
  70. static create(tagName, className, container) {
  71. var el = document.createElement(tagName);
  72. el.className = className || "";
  73. if (container) {
  74. container.appendChild(el);
  75. }
  76. return el;
  77. }
  78. static remove(el) {
  79. var parent = el.parentNode;
  80. if (parent) {
  81. parent.removeChild(el);
  82. }
  83. }
  84. static empty(el) {
  85. while (el.firstChild) {
  86. el.removeChild(el.firstChild);
  87. }
  88. }
  89. hasClass(el, name) {
  90. if (el.classList !== void 0) {
  91. return el.classList.contains(name);
  92. }
  93. var className = getClass(el);
  94. return className.length > 0 && new RegExp("(^|\\s)" + name + "(\\s|$)").test(className);
  95. }
  96. static addClass(el, name) {
  97. if (el.classList !== void 0) {
  98. let classes = Util.splitWords(name);
  99. for (let i2 = 0, len = classes.length; i2 < len; i2++) {
  100. el.classList.add(classes[i2]);
  101. }
  102. } else if (!this.hasClass(el, name)) {
  103. let className = this.getClass(el);
  104. this.setClass(el, (className ? className + " " : "") + name);
  105. }
  106. }
  107. static removeClass(el, name) {
  108. if (el.classList !== void 0) {
  109. el.classList.remove(name);
  110. } else {
  111. this.setClass(
  112. el,
  113. Util.trim(
  114. (" " + this.getClass(el) + " ").replace(" " + name + " ", " ")
  115. )
  116. );
  117. }
  118. }
  119. static setClass(el, name) {
  120. if (el.className.baseVal === void 0) {
  121. el.className = name;
  122. } else {
  123. el.className.baseVal = name;
  124. }
  125. }
  126. static getClass(el) {
  127. if (el.correspondingElement) {
  128. el = el.correspondingElement;
  129. }
  130. return el.className.baseVal === void 0 ? el.className : el.className.baseVal;
  131. }
  132. static createSvg(width2, height2, path, container) {
  133. let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg:svg");
  134. svg.setAttribute("class", "svg-path");
  135. svg.setAttribute("width", width2);
  136. svg.setAttribute("height", height2);
  137. svg.setAttribute("viewBox", `0 0 ${width2} ${height2}`);
  138. let pathEl = document.createElementNS("http://www.w3.org/2000/svg", "path");
  139. pathEl.setAttribute("d", path);
  140. svg.appendChild(pathEl);
  141. if (container) {
  142. container.appendChild(svg);
  143. }
  144. return svg;
  145. }
  146. }
  147. var StatusBar$1 = "";
  148. class StatusBar {
  149. constructor(viewer2) {
  150. if (!viewer2)
  151. throw new Error("viewer is required!");
  152. this._viewer = viewer2;
  153. this._show = false;
  154. this._handler;
  155. this._posX;
  156. this._posY;
  157. this._posZ;
  158. this._cameraHeight;
  159. this._pitch;
  160. this._heading;
  161. this._scale;
  162. this.initListener();
  163. }
  164. get params() {
  165. return {
  166. posX: this._posX,
  167. posY: this._posY,
  168. posZ: this._posZ,
  169. cameraHeight: this._cameraHeight,
  170. pitch: this._pitch,
  171. heading: this._heading,
  172. scale: this._scale
  173. };
  174. }
  175. get statusDom() {
  176. let innerHtml = `
  177. <span class="status-scale">
  178. \u6BD4\u4F8B\u5C3A\uFF1A
  179. <span class="scale-border">
  180. ${this._scale}
  181. </span>
  182. </span>
  183. <span class="status-position">
  184. <span id="status_spaceInfo">\u7A7A\u95F4\u4FE1\u606F</span>
  185. \u5237\u5E27\u7387\uFF1A<span id="status_ms"></span>|<span id="status_fps"></span>
  186. </span>
  187. `;
  188. return innerHtml;
  189. }
  190. get show() {
  191. return this._show;
  192. }
  193. set show(bool) {
  194. bool ? this.createStatusBar() : this.removeStatusBar();
  195. this._show = bool;
  196. }
  197. initListener() {
  198. const $this = this;
  199. const scene = this._viewer.scene;
  200. this._scaleListener = function() {
  201. let width2 = scene.canvas.clientWidth;
  202. let height2 = scene.canvas.clientHeight;
  203. let left = scene.camera.getPickRay(
  204. new Cesium.Cartesian2(width2 / 2 | 0, height2 - 1)
  205. );
  206. let right = scene.camera.getPickRay(
  207. new Cesium.Cartesian2(1 + width2 / 2 | 0, height2 - 1)
  208. );
  209. let globe = scene.globe;
  210. let leftPosition = globe.pick(left, scene);
  211. let rightPosition = globe.pick(right, scene);
  212. if (leftPosition && rightPosition) {
  213. let geodesic = new Cesium.EllipsoidGeodesic();
  214. let leftCartographic = globe.ellipsoid.cartesianToCartographic(leftPosition);
  215. let rightCartographic = globe.ellipsoid.cartesianToCartographic(rightPosition);
  216. geodesic.setEndPoints(leftCartographic, rightCartographic);
  217. let distance2 = geodesic.surfaceDistance;
  218. let curScaleNum = $this.closest(distance2 / 10);
  219. if (curScaleNum < 1) {
  220. $this._scale = curScaleNum * 1e3 + "m";
  221. } else {
  222. $this._scale = curScaleNum + "km";
  223. }
  224. }
  225. document.getElementsByClassName("scale-border")[0].innerText = $this._scale;
  226. if (document.getElementsByClassName("cesium-performanceDisplay-ms").length > 0) {
  227. document.getElementById("status_ms").innerText = document.getElementsByClassName("cesium-performanceDisplay-ms")[0].innerText;
  228. }
  229. if (document.getElementsByClassName("cesium-performanceDisplay-fps").length > 0) {
  230. document.getElementById("status_fps").innerText = document.getElementsByClassName("cesium-performanceDisplay-fps")[0].innerText;
  231. }
  232. };
  233. }
  234. createStatusBar() {
  235. const _delegate = this._viewer;
  236. this.initHandler(_delegate);
  237. this.initScale(_delegate, true);
  238. this._domContainer = DomUtil.create(
  239. "div",
  240. "lk-status-bar",
  241. document.getElementById(this._viewer._container.id)
  242. );
  243. this._domContainer.innerHTML = this.statusDom;
  244. }
  245. removeStatusBar() {
  246. this.initScale(this._viewer, false);
  247. if (this._handler) {
  248. this._handler.destroy();
  249. }
  250. if (this._domContainer) {
  251. DomUtil.remove(this._domContainer);
  252. }
  253. }
  254. initHandler(viewer2) {
  255. const $this = this;
  256. this._handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  257. const mouseOverHandler = function(movement) {
  258. let loc2 = $this._getScreenClickPositionAndHeight(movement.endPosition);
  259. if (!Cesium.defined(loc2))
  260. return;
  261. if (!loc2.lng)
  262. return;
  263. $this._posX = loc2.lng.toFixed(8);
  264. $this._posY = loc2.lat.toFixed(8);
  265. $this._posZ = loc2.height.toFixed(2);
  266. document.getElementById("status_spaceInfo").innerHTML = `
  267. <span>\u7ECF\u5EA6\uFF1A${$this._posX}</span>
  268. <span>\u7EAC\u5EA6\uFF1A${$this._posY}</span>
  269. <span>\u9AD8\u5EA6\uFF1A${$this._posZ}</span>
  270. `;
  271. };
  272. this._handler.setInputAction(
  273. mouseOverHandler,
  274. Cesium.ScreenSpaceEventType.MOUSE_MOVE
  275. );
  276. }
  277. initScale(viewer2, bool) {
  278. const scene = viewer2.scene;
  279. bool ? scene.postRender.addEventListener(this._scaleListener) : scene.postRender.removeEventListener(this._scaleListener);
  280. }
  281. closest(num) {
  282. const scaleList = [
  283. 1e-3,
  284. 2e-3,
  285. 3e-3,
  286. 5e-3,
  287. 0.01,
  288. 0.015,
  289. 0.02,
  290. 0.025,
  291. 0.03,
  292. 0.035,
  293. 0.04,
  294. 0.045,
  295. 0.05,
  296. 0.06,
  297. 0.07,
  298. 0.08,
  299. 0.09,
  300. 0.1,
  301. 0.12,
  302. 0.15,
  303. 0.2,
  304. 0.25,
  305. 0.3,
  306. 0.5,
  307. 1,
  308. 2,
  309. 3,
  310. 5,
  311. 10,
  312. 15,
  313. 20,
  314. 25,
  315. 30,
  316. 35,
  317. 40,
  318. 45,
  319. 50,
  320. 60,
  321. 70,
  322. 80,
  323. 90,
  324. 100,
  325. 120,
  326. 150,
  327. 200,
  328. 250,
  329. 300,
  330. 500,
  331. 1e3,
  332. 2e3,
  333. 5e3,
  334. 1e4,
  335. 1e5,
  336. 5e5,
  337. 1e6
  338. ];
  339. let ret = scaleList[0];
  340. let distance2 = Math.abs(ret - num);
  341. for (let i2 = 1; i2 < scaleList.length; i2++) {
  342. let newDistance = Math.abs(scaleList[i2] - num);
  343. if (newDistance < distance2) {
  344. distance2 = newDistance;
  345. ret = scaleList[i2];
  346. }
  347. }
  348. return ret;
  349. }
  350. _getScreenClickPositionAndHeight(screenPoint) {
  351. var lng = void 0, lat = void 0, height2 = void 0;
  352. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  353. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  354. if (position2) {
  355. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  356. cartographic = Cesium.Cartographic.fromCartesian(position2);
  357. var feature2 = this._viewer.scene.pick(screenPoint);
  358. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  359. lng = this._arcToDegree(cartographic.longitude);
  360. lat = this._arcToDegree(cartographic.latitude);
  361. height2 = cartographic.height;
  362. } else {
  363. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  364. if (Cesium.defined(cartesian)) {
  365. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  366. if (Cesium.defined(cartographic)) {
  367. lng = this._arcToDegree(cartographic.longitude);
  368. lat = this._arcToDegree(cartographic.latitude);
  369. height2 = cartographic.height;
  370. }
  371. }
  372. }
  373. }
  374. return {
  375. lng,
  376. lat,
  377. height: height2
  378. };
  379. }
  380. _arcToDegree(arc) {
  381. return arc / Math.PI * 180;
  382. }
  383. }
  384. var base = "";
  385. class jtMap3d {
  386. constructor(options2) {
  387. if (!Cesium.defined(options2) || !Cesium.defined(options2.container)) {
  388. throw new Cesium.DeveloperError("options.container is required.");
  389. }
  390. Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNzM5YjQ3MC03YmMxLTRmMjAtOTk4Yi0yNDMyMDZlOTQzYTYiLCJpZCI6NTU5MjAsImlhdCI6MTYyNDI0NTM5NX0.diydVWFzw5C5rQlHaFYkdDJoSorcdex81KpWcntyICo";
  391. this._viewer = this._initMap(options2);
  392. this._imageryLayers = this._viewer.imageryLayers;
  393. this._primitives = this._viewer.scene.primitives;
  394. this._entities = this._viewer.entities;
  395. this._dataSources = this._viewer.dataSources;
  396. this._defaultSkyBox = this._viewer.scene.skyBox;
  397. this.statusBar = new StatusBar(this._viewer);
  398. console.log(Cesium.buildModuleUrl.getCesiumBaseUrl());
  399. }
  400. _initMap(options2) {
  401. let viewer2 = new Cesium.Viewer(options2.container, {
  402. animation: true,
  403. timeline: true,
  404. shadows: false,
  405. shouldAnimate: true,
  406. baseLayerPicker: false,
  407. navigationHelpButton: false,
  408. homeButton: false,
  409. fullscreenButton: false,
  410. sceneModePicker: false,
  411. scene3DOnly: true,
  412. infoBox: false,
  413. clampToGround: true,
  414. geocoder: false,
  415. selectionIndicator: false,
  416. contextOptions: {
  417. webgl: {
  418. alpha: true,
  419. depth: true,
  420. stencil: true,
  421. antialias: true,
  422. premultipliedAlpha: true,
  423. preserveDrawingBuffer: true,
  424. failIfMajorPerformanceCaveat: true
  425. }
  426. }
  427. });
  428. viewer2._cesiumWidget._creditContainer.style.display = "none";
  429. viewer2.scene.globe.show = true;
  430. viewer2.scene.globe.depthTestAgainstTerrain = true;
  431. viewer2.scene.globe.enableLighting = false;
  432. viewer2.scene.requestRenderMode = false;
  433. viewer2.scene.debugShowFramesPerSecond = true;
  434. viewer2.scene.skyAtmosphere.show = false;
  435. viewer2.scene.skyBox.show = true;
  436. viewer2.scene.sun.show = true;
  437. viewer2.scene.moon.show = false;
  438. viewer2.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  439. viewer2.animation.viewModel.dateFormatter = localeDateTimeFormatter;
  440. viewer2.animation.viewModel.timeFormatter = localeTimeFormatter;
  441. viewer2.timeline.makeLabel = localeDateTimeFormatter;
  442. function localeDateTimeFormatter(datetime, viewModel, ignoredate) {
  443. var julianDT = new Cesium.JulianDate();
  444. Cesium.JulianDate.addHours(datetime, 8, julianDT);
  445. var gregorianDT = Cesium.JulianDate.toGregorianDate(julianDT);
  446. var objDT;
  447. if (ignoredate) {
  448. objDT = "";
  449. } else {
  450. objDT = new Date(gregorianDT.year, gregorianDT.month - 1, gregorianDT.day);
  451. objDT = gregorianDT.year + "-" + objDT.toLocaleString("zh-cn", {
  452. month: "short"
  453. }).split("\u6708").join("-") + gregorianDT.day + " ";
  454. if (viewModel || gregorianDT.hour + gregorianDT.minute === 0) {
  455. return objDT;
  456. }
  457. }
  458. let hour, minute, second;
  459. if (gregorianDT.hour < 10) {
  460. hour = `0${gregorianDT.hour}`;
  461. } else {
  462. hour = gregorianDT.hour;
  463. }
  464. if (gregorianDT.minute < 10) {
  465. minute = `0${gregorianDT.minute}`;
  466. } else {
  467. minute = gregorianDT.minute;
  468. }
  469. if (gregorianDT.second < 10) {
  470. second = `0${gregorianDT.second}`;
  471. } else {
  472. second = gregorianDT.second;
  473. }
  474. return objDT + hour + ":" + minute + ":" + second;
  475. }
  476. function localeTimeFormatter(time, viewModel) {
  477. return localeDateTimeFormatter(time, viewModel, true);
  478. }
  479. return viewer2;
  480. }
  481. _setView(options2) {
  482. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  483. throw new Cesium.DeveloperError("longitude and latitude are required.");
  484. }
  485. Cesium.Check.typeOf.number("longitude", options2.longitude);
  486. Cesium.Check.typeOf.number("latitude", options2.latitude);
  487. this._viewer.camera.setView({
  488. destination: Cesium.Cartesian3.fromDegrees(
  489. options2.longitude,
  490. options2.latitude,
  491. options2.height
  492. ),
  493. orientation: {
  494. heading: Cesium.Math.toRadians(Cesium.defaultValue(options2.heading, 0)),
  495. pitch: Cesium.Math.toRadians(Cesium.defaultValue(options2.pitch, -90)),
  496. roll: options2.roll
  497. }
  498. });
  499. }
  500. _getChinaPostion() {
  501. return Cesium.Cartesian3.fromDegrees(116.435314, 40.960521, 1e7);
  502. }
  503. }
  504. Object.assign(jtMap3d.prototype, {
  505. flytoChina() {
  506. this._viewer.camera.flyTo({
  507. destination: this._getChinaPostion(),
  508. duration: 3
  509. });
  510. },
  511. setViewChina: function() {
  512. this._setView({
  513. longitude: 103.84,
  514. latitude: 31.15,
  515. height: 24e6,
  516. heading: 0,
  517. pitch: -90,
  518. roll: 0
  519. });
  520. },
  521. fullMap: function(options2) {
  522. return new Promise((resolve2, reject2) => {
  523. let _self = this;
  524. this._entities.removeById("fullMapRectangle");
  525. options2.isRemove = Cesium.defaultValue(options2.isRemove, true);
  526. options2.duration = Cesium.defaultValue(options2.duration, 3);
  527. options2.heading = Cesium.defaultValue(options2.heading, 0);
  528. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  529. options2.range = Cesium.defaultValue(options2.range, 0);
  530. var rectangle = Cesium.Rectangle.fromDegrees(
  531. options2.west,
  532. options2.south,
  533. options2.east,
  534. options2.north
  535. );
  536. var fullMapEntity = this._entities.add({
  537. id: "fullMapRectangle",
  538. name: "fullMapRectangle",
  539. rectangle: {
  540. coordinates: rectangle,
  541. material: Cesium.Color.GREEN.withAlpha(0),
  542. height: 10,
  543. outline: false
  544. }
  545. });
  546. var flyPromise = this._viewer.flyTo(fullMapEntity, {
  547. duration: options2.duration,
  548. offset: {
  549. heading: Cesium.Math.toRadians(options2.heading),
  550. pitch: Cesium.Math.toRadians(options2.pitch),
  551. range: options2.range
  552. }
  553. });
  554. flyPromise.then(function(flyPromise2) {
  555. if (flyPromise2) {
  556. if (options2.isRemove) {
  557. fullMapEntity && (_self._entities.remove(fullMapEntity), fullMapEntity = null);
  558. }
  559. resolve2(true);
  560. }
  561. }).catch(function(error) {
  562. console.log(error);
  563. });
  564. });
  565. },
  566. setMapNorth() {
  567. let viewer2 = this._viewer;
  568. let pitch = Cesium.Math.toDegrees(viewer2.camera.pitch).toFixed(0);
  569. var center2 = viewer2.camera.pickEllipsoid(new Cesium.Cartesian2(viewer2.canvas.clientWidth / 2, viewer2.canvas.clientHeight / 2));
  570. var curPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(center2);
  571. let centerX = curPosition.longitude * 180 / Math.PI;
  572. let centerY = curPosition.latitude * 180 / Math.PI;
  573. let cameraPointX = viewer2.camera.positionCartographic.longitude * 180 / Math.PI;
  574. let cameraPointY = viewer2.camera.positionCartographic.latitude * 180 / Math.PI;
  575. let cameraPointZ = viewer2.camera.positionCartographic.height.toFixed(0);
  576. var satrt = Cesium.Cartographic.fromDegrees(cameraPointX, cameraPointY, cameraPointZ);
  577. var end = Cesium.Cartographic.fromDegrees(centerX, centerY, 0);
  578. var geodesic = new Cesium.EllipsoidGeodesic();
  579. geodesic.setEndPoints(satrt, end);
  580. var distance2 = geodesic.surfaceDistance;
  581. let range3 = Math.sqrt(Math.pow(distance2, 2) + Math.pow(cameraPointZ - 0, 2));
  582. if (this.centerEntity) {
  583. viewer2.entities.remove(this.centerEntity);
  584. }
  585. this.centerEntity = viewer2.entities.add({
  586. position: Cesium.Cartesian3.fromDegrees(centerX, centerY, 0),
  587. point: {
  588. color: Cesium.Color.RED,
  589. pixelSize: 1
  590. }
  591. });
  592. let offset = new Cesium.HeadingPitchRange(Cesium.Math.toRadians(0), Cesium.Math.toRadians(pitch), range3);
  593. viewer2.zoomTo(this.centerEntity, offset);
  594. },
  595. setMapSpinByPoint(points2, options2) {
  596. let viewer2 = this._viewer;
  597. if (!Cesium.defined(points2)) {
  598. throw new Cesium.DeveloperError("points is required.");
  599. }
  600. options2 = options2 || {};
  601. options2.speed = Cesium.defaultValue(options2.speed, 30);
  602. var position2 = points2;
  603. if (points2 instanceof Cesium.Cartesian3) {
  604. position2 = points2;
  605. } else {
  606. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  607. }
  608. var entity = viewer2.entities.add(
  609. new Cesium.Entity({
  610. point: new Cesium.PointGraphics({
  611. color: new Cesium.Color(1, 1, 0),
  612. pixelSize: 6,
  613. outlineColor: new Cesium.Color(0, 1, 1)
  614. }),
  615. position: position2
  616. })
  617. );
  618. var angle = 360 / options2.speed;
  619. var initialHeading = viewer2.camera.heading;
  620. var pitch = viewer2.camera.pitch;
  621. if (options2.pitch) {
  622. pitch = Cesium.Math.toRadians(options2.pitch);
  623. }
  624. var distance2 = viewer2.camera.positionCartographic.height;
  625. if (options2.height) {
  626. distance2 = options2.height;
  627. }
  628. var startTime = Cesium.JulianDate.fromDate(new Date());
  629. viewer2.clock.startTime = startTime.clone();
  630. viewer2.clock.currentTime = startTime.clone();
  631. viewer2.clock.clockRange = Cesium.ClockRange.CLAMPED;
  632. viewer2.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;
  633. var Exection = function TimeExecution() {
  634. var delTime = Cesium.JulianDate.secondsDifference(viewer2.clock.currentTime, viewer2.clock.startTime);
  635. var heading = Cesium.Math.toRadians(delTime * angle) + initialHeading;
  636. viewer2.scene.camera.setView({
  637. destination: position2,
  638. orientation: {
  639. heading,
  640. pitch
  641. }
  642. });
  643. viewer2.scene.camera.moveBackward(distance2);
  644. if (Cesium.JulianDate.compare(viewer2.clock.currentTime, viewer2.clock.stopTime) >= 0) {
  645. viewer2.clock.onTick.removeEventListener(Exection);
  646. }
  647. var handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  648. handler.setInputAction(function(click) {
  649. viewer2.clock.onTick.removeEventListener(Exection);
  650. viewer2.entities.remove(entity);
  651. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  652. };
  653. viewer2.clock.onTick.addEventListener(Exection);
  654. }
  655. });
  656. const BD_FACTOR = 3.141592653589793 * 3e3 / 180;
  657. const PI = 3.141592653589793;
  658. const RADIUS = 6378245;
  659. const EE = 0.006693421622965943;
  660. class CoordTransform {
  661. static BD09ToGCJ02(lng, lat) {
  662. let x = +lng - 65e-4;
  663. let y = +lat - 6e-3;
  664. let z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * BD_FACTOR);
  665. let theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * BD_FACTOR);
  666. let gg_lng = z * Math.cos(theta);
  667. let gg_lat = z * Math.sin(theta);
  668. return [gg_lng, gg_lat];
  669. }
  670. static GCJ02ToBD09(lng, lat) {
  671. lat = +lat;
  672. lng = +lng;
  673. let z = Math.sqrt(lng * lng + lat * lat) + 2e-5 * Math.sin(lat * BD_FACTOR);
  674. let theta = Math.atan2(lat, lng) + 3e-6 * Math.cos(lng * BD_FACTOR);
  675. let bd_lng = z * Math.cos(theta) + 65e-4;
  676. let bd_lat = z * Math.sin(theta) + 6e-3;
  677. return [bd_lng, bd_lat];
  678. }
  679. static WGS84ToGCJ02(lng, lat) {
  680. lat = +lat;
  681. lng = +lng;
  682. if (this.out_of_china(lng, lat)) {
  683. return [lng, lat];
  684. } else {
  685. let d2 = this.delta(lng, lat);
  686. return [lng + d2[0], lat + d2[1]];
  687. }
  688. }
  689. static GCJ02ToWGS84(lng, lat) {
  690. lat = +lat;
  691. lng = +lng;
  692. if (this.out_of_china(lng, lat)) {
  693. return [lng, lat];
  694. } else {
  695. let d2 = this.delta(lng, lat);
  696. let mgLng = lng + d2[0];
  697. let mgLat = lat + d2[1];
  698. return [lng * 2 - mgLng, lat * 2 - mgLat];
  699. }
  700. }
  701. static delta(lng, lat) {
  702. let dLng = this.transformLng(lng - 105, lat - 35);
  703. let dLat = this.transformLat(lng - 105, lat - 35);
  704. const radLat = lat / 180 * PI;
  705. let magic = Math.sin(radLat);
  706. magic = 1 - EE * magic * magic;
  707. const sqrtMagic = Math.sqrt(magic);
  708. dLng = dLng * 180 / (RADIUS / sqrtMagic * Math.cos(radLat) * PI);
  709. dLat = dLat * 180 / (RADIUS * (1 - EE) / (magic * sqrtMagic) * PI);
  710. return [dLng, dLat];
  711. }
  712. static transformLng(lng, lat) {
  713. lat = +lat;
  714. lng = +lng;
  715. let ret = 300 + lng + 2 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
  716. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  717. ret += (20 * Math.sin(lng * PI) + 40 * Math.sin(lng / 3 * PI)) * 2 / 3;
  718. ret += (150 * Math.sin(lng / 12 * PI) + 300 * Math.sin(lng / 30 * PI)) * 2 / 3;
  719. return ret;
  720. }
  721. static transformLat(lng, lat) {
  722. lat = +lat;
  723. lng = +lng;
  724. let ret = -100 + 2 * lng + 3 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
  725. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  726. ret += (20 * Math.sin(lat * PI) + 40 * Math.sin(lat / 3 * PI)) * 2 / 3;
  727. ret += (160 * Math.sin(lat / 12 * PI) + 320 * Math.sin(lat * PI / 30)) * 2 / 3;
  728. return ret;
  729. }
  730. static out_of_china(lng, lat) {
  731. lat = +lat;
  732. lng = +lng;
  733. return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
  734. }
  735. static getCatesian3FromPX(viewer2, px) {
  736. let picks = viewer2.scene.drillPick(px);
  737. let cartesian = null;
  738. let isOn3dtiles = false, isOnTerrain = false;
  739. for (let i2 in picks) {
  740. let pick = picks[i2];
  741. if (pick && pick.primitive instanceof Cesium.Cesium3DTileFeature || pick && pick.primitive instanceof Cesium.Cesium3DTileset || pick && pick.primitive instanceof Cesium.Model) {
  742. isOn3dtiles = true;
  743. }
  744. if (isOn3dtiles) {
  745. viewer2.scene.pick(px);
  746. cartesian = viewer2.scene.pickPosition(px);
  747. if (cartesian) {
  748. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  749. if (cartographic.height < 0)
  750. cartographic.height = 0;
  751. let lon = Cesium.Math.toDegrees(cartographic.longitude), lat = Cesium.Math.toDegrees(cartographic.latitude), height2 = cartographic.height;
  752. cartesian = this.transformWGS84ToCartesian({
  753. lng: lon,
  754. lat,
  755. alt: height2
  756. });
  757. }
  758. }
  759. }
  760. let boolTerrain = viewer2.terrainProvider instanceof Cesium.EllipsoidTerrainProvider;
  761. if (!isOn3dtiles && !boolTerrain) {
  762. let ray = viewer2.scene.camera.getPickRay(px);
  763. if (!ray)
  764. return null;
  765. cartesian = viewer2.scene.globe.pick(ray, viewer2.scene);
  766. isOnTerrain = true;
  767. }
  768. if (!isOn3dtiles && !isOnTerrain && boolTerrain) {
  769. cartesian = viewer2.scene.camera.pickEllipsoid(
  770. px,
  771. viewer2.scene.globe.ellipsoid
  772. );
  773. }
  774. if (cartesian) {
  775. let position2 = this.transformCartesianToWGS84(cartesian);
  776. if (position2.alt < 0) {
  777. cartesian = this.transformWGS84ToCartesian(position2, 0.1);
  778. }
  779. return cartesian;
  780. }
  781. return false;
  782. }
  783. static transformWGS84ToCartesian(position2, alt) {
  784. return position2 ? Cesium.Cartesian3.fromDegrees(
  785. position2.lng || position2.lon,
  786. position2.lat,
  787. position2.alt = alt || position2.alt,
  788. Cesium.Ellipsoid.WGS84
  789. ) : Cesium.Cartesian3.ZERO;
  790. }
  791. static transformCartesianToWGS84(cartesian) {
  792. let ellipsoid = Cesium.Ellipsoid.WGS84;
  793. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  794. return {
  795. lng: Cesium.Math.toDegrees(cartographic.longitude),
  796. lat: Cesium.Math.toDegrees(cartographic.latitude),
  797. alt: cartographic.height
  798. };
  799. }
  800. static Cartesian3ListToWGS84(cartesianList) {
  801. let ellipsoid = Cesium.Ellipsoid.WGS84;
  802. let result = [];
  803. for (let index2 = 0; index2 < cartesianList.length; index2++) {
  804. const cartesian = cartesianList[index2];
  805. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  806. result.push({
  807. lng: Cesium.Math.toDegrees(cartographic.longitude),
  808. lat: Cesium.Math.toDegrees(cartographic.latitude),
  809. alt: cartographic.height
  810. });
  811. }
  812. return result;
  813. }
  814. static Degrees2DMS(value) {
  815. let degrees = Math.floor(value);
  816. let rem = (value - degrees) * 60;
  817. let minutes = Math.floor(rem);
  818. let _second = (rem - minutes) * 60;
  819. let seconds = Math.round(_second);
  820. var _radians = Cesium.Math.toRadians(value);
  821. var _degrees = Cesium.Math.toDegrees(value);
  822. console.log(_radians);
  823. console.log(_degrees);
  824. let DMS = {
  825. degrees,
  826. minutes,
  827. seconds
  828. };
  829. return DMS;
  830. }
  831. static DMS2Degrees(DMS) {
  832. let _double = parseFloat(DMS.degrees) + parseFloat(DMS.minutes) / 60 + parseFloat(DMS.seconds) / 3600;
  833. return parseFloat(_double).toFixed(6);
  834. }
  835. static _cartesian3ToGeo(position2) {
  836. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  837. return {
  838. longitude: Cesium.Math.toDegrees(g.longitude),
  839. latitude: Cesium.Math.toDegrees(g.latitude),
  840. height: g.height
  841. };
  842. }
  843. static _arcToDegree(arc) {
  844. return arc / Math.PI * 180;
  845. }
  846. static _getScreenClickPositionAndHeight(viewer2, screenPoint) {
  847. this._viewer = viewer2;
  848. var lng = void 0, lat = void 0, height2 = void 0;
  849. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  850. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  851. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  852. var feature2 = this._viewer.scene.pick(screenPoint);
  853. if (feature2 == void 0) {
  854. lng = this._arcToDegree(cartographic.longitude);
  855. lat = this._arcToDegree(cartographic.latitude);
  856. height2 = cartographic.height;
  857. } else {
  858. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  859. if (Cesium.defined(cartesian)) {
  860. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  861. lng = this._arcToDegree(cartographic.longitude);
  862. lat = this._arcToDegree(cartographic.latitude);
  863. height2 = cartographic.height;
  864. }
  865. }
  866. return {
  867. lng,
  868. lat,
  869. height: height2
  870. };
  871. }
  872. static _transfromFromScreenPoint(viewer2, screenPosition) {
  873. let location = this._getScreenClickPositionAndHeight(viewer2, screenPosition);
  874. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  875. return {
  876. gLocation: location,
  877. sLocation: cartesian
  878. };
  879. }
  880. }
  881. class PolylineDirectionMaterialProperty {
  882. constructor(options2) {
  883. this.defaultColor = new Cesium.Color(255 / 255, 0, 0, 0);
  884. options2 = options2 || {};
  885. options2.isImageAlpha = Cesium.defaultValue(options2.isImageAlpha, true);
  886. options2.imgUrl = Cesium.defaultValue(options2.imgUrl, "jt3dSDK/imgs/polylinematerial/spriteline1.png");
  887. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  888. options2.count = Cesium.defaultValue(options2.count, 1);
  889. options2.direction = Cesium.defaultValue(options2.direction, "horizontal");
  890. options2.order = Cesium.defaultValue(options2.order, "-");
  891. if (options2.isImageAlpha) {
  892. options2.color = this.defaultColor;
  893. } else {
  894. if (options2.color instanceof Array) {
  895. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  896. } else if (typeof options2.color === "string") {
  897. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  898. } else {
  899. options2.color = this.defaultColor;
  900. }
  901. }
  902. this._definitionChanged = new Cesium.Event();
  903. this._color = void 0;
  904. this._image = void 0;
  905. this.color = options2.color;
  906. this.image = options2.imgUrl;
  907. this._isImageAlpha = options2.isImageAlpha;
  908. this._duration = options2.duration;
  909. this._count = options2.count;
  910. this._direction = options2.direction;
  911. this._order = options2.order;
  912. this._time = performance.now();
  913. this.addMaterial();
  914. }
  915. addMaterial() {
  916. Cesium.Material.PolylineTrailType = "PolylineTrail";
  917. Cesium.Material.Polylineimage = "images/colors.png";
  918. if (this._direction === "vertical") {
  919. if (this._isImageAlpha) {
  920. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb* 1.5 ;\n return material;\n }";
  921. } else {
  922. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  923. }
  924. } else if (this._direction === "horizontal") {
  925. if (this._isImageAlpha) {
  926. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb * 1.5 ;\n return material;\n }";
  927. } else {
  928. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  929. }
  930. }
  931. Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailType, {
  932. fabric: {
  933. type: Cesium.Material.PolylineTrailType,
  934. uniforms: {
  935. color: new Cesium.Color(1, 0, 0, 0.5),
  936. image: Cesium.Material.Polylineimage,
  937. time: 0,
  938. repeat: new Cesium.Cartesian2(5, 1),
  939. order: "-"
  940. },
  941. source: Cesium.Material.PolylineTrailSource
  942. },
  943. translucent: function(material) {
  944. return true;
  945. }
  946. });
  947. }
  948. }
  949. PolylineDirectionMaterialProperty.prototype.getType = function(time) {
  950. return "PolylineTrail";
  951. };
  952. PolylineDirectionMaterialProperty.prototype.getValue = function(time, result) {
  953. if (!Cesium.defined(result)) {
  954. result = {};
  955. }
  956. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, this.defaultColor, result.color);
  957. result.image = Cesium.Property.getValueOrUndefined(this._image, time);
  958. result.time = (performance.now() - this._time) % this._duration / this._duration;
  959. result.repeat = new Cesium.Cartesian2(this._count, 1);
  960. result.order = this._order;
  961. return result;
  962. };
  963. PolylineDirectionMaterialProperty.prototype.equals = function(other) {
  964. return this === other || other instanceof PolylineDirectionMaterialProperty && Cesium.Property.equals(this._color, other._color);
  965. };
  966. Object.defineProperties(PolylineDirectionMaterialProperty.prototype, {
  967. isConstant: {
  968. get: function() {
  969. return false;
  970. }
  971. },
  972. definitionChanged: {
  973. get: function() {
  974. return this._definitionChanged;
  975. }
  976. },
  977. color: Cesium.createPropertyDescriptor("color"),
  978. image: Cesium.createPropertyDescriptor("image")
  979. });
  980. class WallMaterialProperty$1 {
  981. constructor(viewer2, options2) {
  982. this._viewer = viewer2;
  983. options2 = options2 || {};
  984. this._definitionChanged = new Cesium.Event();
  985. this._color = void 0;
  986. this.color = options2.color || Cesium.Color.BLUE;
  987. this.duration = options2.duration || 1e3;
  988. this.count = options2.duration || 1;
  989. this.direction = options2.duration || "vertical";
  990. this.order = options2.duration || "-";
  991. this.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  992. this._time = new Date().getTime();
  993. this._materialTypeName = "WallMaterial" + this._guid();
  994. this._param = {
  995. color: this.color._value.toCssColorString(),
  996. image: this.trailImage,
  997. duration: this.duration,
  998. count: this.count,
  999. direction: this.direction,
  1000. order: this.order
  1001. };
  1002. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  1003. fabric: {
  1004. type: this._materialTypeName,
  1005. uniforms: {
  1006. time: -20,
  1007. color: new Cesium.Color(1, 0, 0, 0.5),
  1008. image: options2.trailImage
  1009. },
  1010. source: this._getDirectionWallShader(options2.param)
  1011. },
  1012. translucent: function(material) {
  1013. return true;
  1014. }
  1015. });
  1016. }
  1017. _guid() {
  1018. function S4() {
  1019. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1020. }
  1021. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1022. }
  1023. getType(time) {
  1024. return this._materialTypeName;
  1025. }
  1026. getValue(time, result) {
  1027. if (!Cesium.defined(result)) {
  1028. result = {};
  1029. }
  1030. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  1031. result.image = this.trailImage;
  1032. if (this.duration) {
  1033. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  1034. }
  1035. this._viewer.scene.requestRender();
  1036. return result;
  1037. }
  1038. equals(other) {
  1039. return this === other || other instanceof WallMaterialProperty$1 && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  1040. }
  1041. _getDirectionWallShader(options2) {
  1042. let op = Cesium.defaultValue(options2, {});
  1043. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  1044. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  1045. let order = op.order === "+" ? "+" : "-";
  1046. this._param.count = count;
  1047. this._param.direction = direction;
  1048. this._param.order = order;
  1049. let materail = "";
  1050. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  1051. if (direction === "vertical") {
  1052. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  1053. } else if (direction === "horizontal") {
  1054. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  1055. }
  1056. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  1057. return materail;
  1058. }
  1059. }
  1060. Object.defineProperties(WallMaterialProperty$1.prototype, {
  1061. isConstant: {
  1062. get: function() {
  1063. return false;
  1064. }
  1065. },
  1066. definitionChanged: {
  1067. get: function() {
  1068. return this._definitionChanged;
  1069. }
  1070. },
  1071. color: Cesium.createPropertyDescriptor("color")
  1072. });
  1073. var tooltip = "";
  1074. function setSessionid$1(num) {
  1075. let len = num || 32;
  1076. let chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
  1077. let maxPos = chars.length;
  1078. let pwd = "";
  1079. for (let i2 = 0; i2 < len; i2++) {
  1080. pwd += chars.charAt(Math.floor(Math.random() * maxPos));
  1081. }
  1082. return pwd;
  1083. }
  1084. function guid() {
  1085. function S4() {
  1086. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1087. }
  1088. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1089. }
  1090. function getGuid(removeMinus) {
  1091. let d2 = new Date().getTime();
  1092. let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
  1093. const r2 = (d2 + Math.random() * 16) % 16 | 0;
  1094. d2 = Math.floor(d2 / 16);
  1095. return (c === "x" ? r2 : r2 & 3 | 8).toString(16);
  1096. });
  1097. if (removeMinus) {
  1098. uuid = uuid.replace(/-/g, "");
  1099. }
  1100. return uuid;
  1101. }
  1102. function getHeigthByLngLat(viewer2, options2) {
  1103. if (!viewer2)
  1104. throw new Cesium.DeveloperError("no viewer object!");
  1105. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  1106. throw new Cesium.DeveloperError("longitude and latitude are required.");
  1107. }
  1108. options2.level = Cesium.defaultValue(options2.level, 11);
  1109. let positions = Cesium.Cartographic.fromDegrees(options2.longitude, options2.latitude);
  1110. let terrainProvider = viewer2.terrainProvider;
  1111. return new Promise((resolve2, reject2) => {
  1112. new Cesium.sampleTerrain(terrainProvider, options2.level, [positions]).then(function(updatedPositions) {
  1113. if (updatedPositions) {
  1114. resolve2(updatedPositions[0].height);
  1115. }
  1116. });
  1117. });
  1118. }
  1119. function getHeigthByPoints(viewer2, options2) {
  1120. if (!viewer2)
  1121. throw new Cesium.DeveloperError("no viewer object!");
  1122. if (!Cesium.defined(options2)) {
  1123. throw new Cesium.DeveloperError("options is required.");
  1124. }
  1125. options2.level = Cesium.defaultValue(options2.level, 11);
  1126. let positions = [];
  1127. let points2 = options2.points;
  1128. for (let i2 = 0; i2 < points2.length; i2++) {
  1129. let pointX = points2[i2][0];
  1130. let pointY = points2[i2][1];
  1131. positions.push(
  1132. Cesium.Cartographic.fromDegrees(pointX, pointY)
  1133. );
  1134. }
  1135. let terrainProvider = viewer2.terrainProvider;
  1136. return new Promise((resolve2, reject2) => {
  1137. new Cesium.sampleTerrain(terrainProvider, options2.level, positions).then(function(updatedPositions) {
  1138. if (updatedPositions) {
  1139. resolve2(updatedPositions);
  1140. }
  1141. });
  1142. });
  1143. }
  1144. function getHeigthByPointsMostDetailed(viewer2, points2) {
  1145. if (!viewer2)
  1146. throw new Cesium.DeveloperError("no viewer object!");
  1147. if (!Cesium.defined(points2)) {
  1148. throw new Cesium.DeveloperError("points is required.");
  1149. }
  1150. let positions = [];
  1151. for (let i2 = 0; i2 < points2.length; i2++) {
  1152. let pointX = points2[i2][0];
  1153. let pointY = points2[i2][1];
  1154. positions.push(Cesium.Cartographic.fromDegrees(pointX, pointY));
  1155. }
  1156. let terrainProvider = viewer2.terrainProvider;
  1157. return new Promise((resolve2, reject2) => {
  1158. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1159. promise.then(function(updatedPositions) {
  1160. resolve2(updatedPositions);
  1161. });
  1162. });
  1163. }
  1164. function getHeigthByPointMostDetailed(viewer2, points2) {
  1165. if (!viewer2)
  1166. throw new Cesium.DeveloperError("no viewer object!");
  1167. if (!Cesium.defined(points2)) {
  1168. throw new Cesium.DeveloperError("points is required.");
  1169. }
  1170. let positions = Cesium.Cartographic.fromDegrees(points2[0], points2[1]);
  1171. let terrainProvider = viewer2.terrainProvider;
  1172. return new Promise((resolve2, reject2) => {
  1173. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1174. promise.then(function(updatedPositions) {
  1175. resolve2(updatedPositions);
  1176. });
  1177. });
  1178. }
  1179. function createTooltip(frameDiv) {
  1180. var tooltip2 = function(frameDiv2) {
  1181. var div = document.createElement("DIV");
  1182. div.className = "twipsy right";
  1183. var arrow = document.createElement("DIV");
  1184. arrow.className = "twipsy-arrow";
  1185. div.appendChild(arrow);
  1186. var title = document.createElement("DIV");
  1187. title.className = "twipsy-inner";
  1188. div.appendChild(title);
  1189. this._div = div;
  1190. this._title = title;
  1191. frameDiv2.appendChild(div);
  1192. };
  1193. tooltip2.prototype.setVisible = function(visible) {
  1194. this._div.style.display = visible ? "block" : "none";
  1195. };
  1196. tooltip2.prototype.showAt = function(position2, message) {
  1197. if (position2 && message) {
  1198. this.setVisible(true);
  1199. this._title.innerHTML = message;
  1200. this._div.style.left = position2.x + 10 + "px";
  1201. this._div.style.top = position2.y - this._div.clientHeight / 2 + "px";
  1202. }
  1203. };
  1204. return new tooltip2(frameDiv);
  1205. }
  1206. var common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  1207. __proto__: null,
  1208. setSessionid: setSessionid$1,
  1209. guid,
  1210. getGuid,
  1211. getHeigthByLngLat,
  1212. getHeigthByPoints,
  1213. getHeigthByPointsMostDetailed,
  1214. getHeigthByPointMostDetailed,
  1215. createTooltip
  1216. }, Symbol.toStringTag, { value: "Module" }));
  1217. class PointObject {
  1218. constructor(viewer2) {
  1219. if (!viewer2)
  1220. throw new Cesium.DeveloperError("no viewer object!");
  1221. this._viewer = viewer2;
  1222. }
  1223. }
  1224. Object.assign(PointObject.prototype, {
  1225. addLabel(points2, options2) {
  1226. return new Promise((resolve2, reject2) => {
  1227. if (!Cesium.defined(points2)) {
  1228. throw new Cesium.DeveloperError("points is required.");
  1229. }
  1230. let position2;
  1231. if (points2 instanceof Cesium.Cartesian3) {
  1232. position2 = points2;
  1233. } else {
  1234. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1235. }
  1236. options2 = options2 || {};
  1237. options2.id = options2.id || setSessionid$1();
  1238. let label = options2.label || {};
  1239. label.text = Cesium.defaultValue(label.text, "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0");
  1240. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1241. if (label.fillColor instanceof Array) {
  1242. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1243. } else if (typeof label.fillColor === "string") {
  1244. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1245. } else {
  1246. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1247. }
  1248. if (label.outlineColor instanceof Array) {
  1249. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1250. } else if (typeof label.outlineColor === "string") {
  1251. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1252. } else {
  1253. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1254. }
  1255. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1256. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1257. if (label.backgroundColor instanceof Array) {
  1258. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1259. } else if (typeof label.backgroundColor === "string") {
  1260. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1261. } else {
  1262. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1263. }
  1264. if (label.backgroundPadding) {
  1265. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1266. }
  1267. let entity = new Cesium.Entity({
  1268. position: position2,
  1269. label: {
  1270. text: label.text,
  1271. font: label.font,
  1272. fillColor: label.fillColor,
  1273. outlineColor: label.outlineColor,
  1274. outlineWidth: label.outlineWidth,
  1275. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1276. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1277. showBackground: label.showBackground,
  1278. backgroundColor: label.backgroundColor,
  1279. backgroundPadding: label.backgroundPadding,
  1280. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1281. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  1282. }
  1283. });
  1284. if (label.pixelOffset) {
  1285. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1286. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1287. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1288. }
  1289. if (label.scaleByDistance) {
  1290. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1291. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1292. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1293. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1294. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1295. }
  1296. resolve2(entity);
  1297. });
  1298. },
  1299. addPoint(points2, options2) {
  1300. return new Promise((resolve2, reject2) => {
  1301. if (!Cesium.defined(points2)) {
  1302. throw new Cesium.DeveloperError("points is required.");
  1303. }
  1304. let position2;
  1305. if (points2 instanceof Cesium.Cartesian3) {
  1306. position2 = points2;
  1307. } else {
  1308. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1309. }
  1310. options2 = options2 || {};
  1311. options2.id = options2.id || setSessionid$1();
  1312. let point2 = options2.point || {};
  1313. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1314. if (point2.color instanceof Array) {
  1315. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1316. } else if (typeof point2.color === "string") {
  1317. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1318. } else {
  1319. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1320. }
  1321. if (point2.outlineColor instanceof Array) {
  1322. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1323. } else if (typeof point2.outlineColor === "string") {
  1324. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1325. } else {
  1326. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1327. }
  1328. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1329. let entity = new Cesium.Entity({
  1330. position: position2,
  1331. point: {
  1332. pixelSize: point2.pixelSize,
  1333. color: point2.color,
  1334. outlineColor: point2.outlineColor,
  1335. outlineWidth: point2.outlineWidth,
  1336. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1337. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1338. }
  1339. });
  1340. if (options2.label) {
  1341. let label = options2.label || {};
  1342. label.text = Cesium.defaultValue(label.text, "");
  1343. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1344. if (label.fillColor instanceof Array) {
  1345. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1346. } else if (typeof label.fillColor === "string") {
  1347. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1348. } else {
  1349. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1350. }
  1351. if (label.outlineColor instanceof Array) {
  1352. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1353. } else if (typeof label.outlineColor === "string") {
  1354. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1355. } else {
  1356. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1357. }
  1358. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1359. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1360. if (label.backgroundColor instanceof Array) {
  1361. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1362. } else if (typeof label.backgroundColor === "string") {
  1363. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1364. } else {
  1365. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1366. }
  1367. if (label.backgroundPadding) {
  1368. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1369. }
  1370. entity.label = {
  1371. text: label.text,
  1372. font: label.font,
  1373. fillColor: label.fillColor,
  1374. outlineColor: label.outlineColor,
  1375. outlineWidth: label.outlineWidth,
  1376. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1377. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1378. showBackground: label.showBackground,
  1379. backgroundColor: label.backgroundColor,
  1380. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1381. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1382. };
  1383. if (label.pixelOffset) {
  1384. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1385. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1386. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1387. }
  1388. if (label.scaleByDistance) {
  1389. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1390. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1391. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1392. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1393. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1394. }
  1395. }
  1396. resolve2(entity);
  1397. });
  1398. },
  1399. addBillboard(points2, options2) {
  1400. return new Promise((resolve2, reject2) => {
  1401. if (!Cesium.defined(points2)) {
  1402. throw new Cesium.DeveloperError("points is required.");
  1403. }
  1404. let position2;
  1405. if (points2 instanceof Cesium.Cartesian3) {
  1406. position2 = points2;
  1407. } else {
  1408. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1409. }
  1410. options2 = options2 || {};
  1411. options2.id = options2.id || setSessionid$1();
  1412. let billboard = options2.billboard || {};
  1413. billboard.image = billboard.imgUrl || "jt3dSDK/imgs/point/point3.png";
  1414. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1415. let entity = new Cesium.Entity({
  1416. name: "add billboard",
  1417. position: position2,
  1418. billboard: {
  1419. image: billboard.image,
  1420. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1421. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1422. scale: billboard.scale,
  1423. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1424. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1425. }
  1426. });
  1427. if (options2.properties) {
  1428. entity.properties = options2.properties;
  1429. }
  1430. if (billboard.pixelOffset) {
  1431. billboard.pixelOffset.x = Cesium.defaultValue(billboard.pixelOffset.x, 0);
  1432. billboard.pixelOffset.y = Cesium.defaultValue(billboard.pixelOffset.y, 0);
  1433. entity.billboard.pixelOffset = new Cesium.Cartesian2(billboard.pixelOffset.x, billboard.pixelOffset.y);
  1434. }
  1435. if (billboard.scaleByDistance) {
  1436. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  1437. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  1438. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  1439. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  1440. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  1441. }
  1442. if (options2.label) {
  1443. let label = options2.label || {};
  1444. label.text = Cesium.defaultValue(label.text, "");
  1445. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1446. if (label.fillColor instanceof Array) {
  1447. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1448. } else if (typeof label.fillColor === "string") {
  1449. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1450. } else {
  1451. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1452. }
  1453. if (label.outlineColor instanceof Array) {
  1454. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1455. } else if (typeof label.outlineColor === "string") {
  1456. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1457. } else {
  1458. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1459. }
  1460. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1461. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1462. if (label.backgroundColor instanceof Array) {
  1463. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1464. } else if (typeof label.backgroundColor === "string") {
  1465. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1466. } else {
  1467. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1468. }
  1469. if (label.backgroundPadding) {
  1470. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1471. }
  1472. entity.label = {
  1473. text: label.text,
  1474. font: label.font,
  1475. fillColor: label.fillColor,
  1476. outlineColor: label.outlineColor,
  1477. outlineWidth: label.outlineWidth,
  1478. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1479. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1480. showBackground: label.showBackground,
  1481. backgroundColor: label.backgroundColor,
  1482. backgroundPadding: label.backgroundPadding,
  1483. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1484. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1485. };
  1486. if (label.pixelOffset) {
  1487. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1488. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1489. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1490. }
  1491. if (label.scaleByDistance) {
  1492. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1493. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1494. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1495. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1496. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1497. }
  1498. }
  1499. resolve2(entity);
  1500. });
  1501. },
  1502. addModel: function(points2, options2) {
  1503. this._viewer;
  1504. return new Promise((resolve2, reject2) => {
  1505. if (!Cesium.defined(points2)) {
  1506. throw new Cesium.DeveloperError("points is required.");
  1507. }
  1508. let position2;
  1509. if (points2 instanceof Cesium.Cartesian3) {
  1510. position2 = points2;
  1511. } else {
  1512. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1513. }
  1514. options2 = options2 || {};
  1515. options2.id = options2.id || setSessionid$1();
  1516. let model = options2.model || {};
  1517. model.alpha = Cesium.defaultValue(model.alpha, 1);
  1518. model.heading = Cesium.defaultValue(model.heading, 0);
  1519. model.pitch = Cesium.defaultValue(model.pitch, 0);
  1520. model.roll = Cesium.defaultValue(model.roll, 0);
  1521. var heading = Cesium.Math.toRadians(model.heading);
  1522. var pitch = model.pitch;
  1523. var roll = model.roll;
  1524. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1525. let entity = new Cesium.Entity({
  1526. position: position2,
  1527. model: {
  1528. uri: model.url,
  1529. incrementallyLoadTextures: true,
  1530. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1531. colorBlendAmount: 0.1,
  1532. color: Cesium.Color.WHITE.withAlpha(model.alpha),
  1533. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1534. runAnimations: true,
  1535. show: true,
  1536. debugWireframe: false,
  1537. debugShowBoundingVolume: false,
  1538. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1539. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1540. }
  1541. });
  1542. if (model.minimumPixelSize) {
  1543. entity.model.minimumPixelSize = model.minimumPixelSize;
  1544. }
  1545. if (model.maximumScale) {
  1546. entity.model.maximumScale = model.maximumScale;
  1547. }
  1548. if (model.silhouetteColor) {
  1549. if (model.silhouetteColor instanceof Array) {
  1550. entity.model.silhouetteColor = new Cesium.Color(model.silhouetteColor[0] / 255, model.silhouetteColor[1] / 255, model.silhouetteColor[2] / 255, model.silhouetteColor[3]);
  1551. } else if (typeof model.silhouetteColor === "string") {
  1552. entity.model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  1553. }
  1554. }
  1555. model.silhouetteSize = Cesium.defaultValue(model.silhouetteSize, 1);
  1556. resolve2(entity);
  1557. });
  1558. },
  1559. generatePoint(points2, options2) {
  1560. return new Promise((resolve2, reject2) => {
  1561. let _self = this;
  1562. if (!Cesium.defined(points2)) {
  1563. throw new Cesium.DeveloperError("points is required.");
  1564. }
  1565. options2 = options2 || {};
  1566. options2.id = options2.id || setSessionid$1();
  1567. let point2 = options2.point || {};
  1568. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1569. if (point2.color instanceof Array) {
  1570. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1571. } else if (typeof point2.color === "string") {
  1572. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1573. } else {
  1574. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1575. }
  1576. if (point2.outlineColor instanceof Array) {
  1577. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1578. } else if (typeof point2.outlineColor === "string") {
  1579. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1580. } else {
  1581. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1582. }
  1583. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1584. let terrainAltitude = getHeigthByPointsMostDetailed(_self._viewer, [points2]);
  1585. terrainAltitude.then(function(updatedPositions) {
  1586. let position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], updatedPositions[0].height);
  1587. let entity = new Cesium.Entity({
  1588. id: options2.id,
  1589. position: position2,
  1590. point: {
  1591. pixelSize: point2.pixelSize,
  1592. color: point2.color,
  1593. outlineColor: point2.outlineColor,
  1594. outlineWidth: point2.outlineWidth,
  1595. heightReference: Cesium.HeightReference.NONE,
  1596. disableDepthTestDistance: updatedPositions[0].height
  1597. }
  1598. });
  1599. if (options2.label) {
  1600. let label = options2.label || {};
  1601. label.text = Cesium.defaultValue(label.text, "");
  1602. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1603. if (label.fillColor instanceof Array) {
  1604. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1605. } else if (typeof label.fillColor === "string") {
  1606. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1607. } else {
  1608. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1609. }
  1610. if (label.outlineColor instanceof Array) {
  1611. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1612. } else if (typeof label.outlineColor === "string") {
  1613. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1614. } else {
  1615. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1616. }
  1617. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1618. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1619. if (label.backgroundColor instanceof Array) {
  1620. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1621. } else if (typeof label.backgroundColor === "string") {
  1622. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1623. } else {
  1624. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1625. }
  1626. label.scale = Cesium.defaultValue(label.scale, 1);
  1627. entity.label = {
  1628. text: label.text,
  1629. font: label.font,
  1630. fillColor: label.fillColor,
  1631. outlineColor: label.outlineColor,
  1632. outlineWidth: label.outlineWidth,
  1633. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1634. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1635. showBackground: label.showBackground,
  1636. backgroundColor: label.backgroundColor,
  1637. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1638. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1639. scale: label.scale
  1640. };
  1641. if (label.pixelOffset) {
  1642. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1643. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1644. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1645. }
  1646. if (label.scaleByDistance) {
  1647. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1648. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1649. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1650. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1651. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1652. }
  1653. }
  1654. resolve2(entity);
  1655. });
  1656. });
  1657. },
  1658. addBillboardByGeoJson: function(geoJsonUrl, options2) {
  1659. return new Promise((resolve2, reject2) => {
  1660. let viewer2 = this._viewer;
  1661. if (!Cesium.defined(geoJsonUrl)) {
  1662. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1663. }
  1664. options2 = options2 || {};
  1665. options2.id = options2.id || setSessionid$1();
  1666. let billboard = options2.billboard || {};
  1667. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  1668. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1669. let label = options2.label || {};
  1670. label.text = Cesium.defaultValue(label.text, "");
  1671. label.textField = Cesium.defaultValue(label.textField, "");
  1672. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1673. if (label.fillColor instanceof Array) {
  1674. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1675. } else if (typeof label.fillColor === "string") {
  1676. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1677. } else {
  1678. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1679. }
  1680. if (label.outlineColor instanceof Array) {
  1681. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1682. } else if (typeof label.outlineColor === "string") {
  1683. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1684. } else {
  1685. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1686. }
  1687. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1688. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1689. if (label.backgroundColor instanceof Array) {
  1690. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1691. } else if (typeof label.backgroundColor === "string") {
  1692. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1693. } else {
  1694. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1695. }
  1696. label.scale = Cesium.defaultValue(label.scale, 1);
  1697. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  1698. dataSource.load(geoJsonUrl, {
  1699. clampToGround: true
  1700. }).then(function(data) {
  1701. viewer2.dataSources.add(data);
  1702. const entities2 = data.entities.values;
  1703. entities2.forEach((entity) => {
  1704. entity.billboard = {
  1705. image: billboard.imgUrl,
  1706. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1707. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1708. scale: billboard.scale,
  1709. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1710. };
  1711. let labelText = label.text;
  1712. if (entity.properties[label.textField]) {
  1713. labelText = entity.properties[label.textField]._value;
  1714. }
  1715. if (labelText === "") {
  1716. labelText = (i + 1).toString();
  1717. }
  1718. entity.label = {
  1719. text: labelText.toString(),
  1720. font: label.font,
  1721. fillColor: label.fillColor,
  1722. outlineColor: label.outlineColor,
  1723. outlineWidth: label.outlineWidth,
  1724. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1725. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1726. showBackground: label.showBackground,
  1727. backgroundColor: label.backgroundColor,
  1728. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1729. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1730. scale: label.scale
  1731. };
  1732. if (label.scaleByDistance) {
  1733. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1734. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1735. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1736. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1737. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1738. }
  1739. });
  1740. });
  1741. });
  1742. },
  1743. addGltf: function(options2) {
  1744. let viewer2 = this._viewer;
  1745. return new Promise((resolve2, reject2) => {
  1746. if (!Cesium.defined(options2.points)) {
  1747. resolve2("options.points is required.");
  1748. throw new Cesium.DeveloperError("options.points is required.");
  1749. }
  1750. if (!Cesium.defined(options2.url)) {
  1751. resolve2("options.url is required.");
  1752. throw new Cesium.DeveloperError("options.url is required.");
  1753. }
  1754. options2.id = options2.id || setSessionid$1();
  1755. options2.heading = Cesium.defaultValue(options2.heading, 0);
  1756. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  1757. options2.roll = Cesium.defaultValue(options2.roll, 0);
  1758. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  1759. let position2 = void 0;
  1760. if (options2.points instanceof Cesium.Cartesian3) {
  1761. position2 = options2.points;
  1762. } else {
  1763. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1764. }
  1765. var heading = Cesium.Math.toRadians(options2.heading);
  1766. var pitch = options2.pitch;
  1767. var roll = options2.roll;
  1768. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1769. var modelGltf = viewer2.entities.add({
  1770. id: options2.id,
  1771. position: position2,
  1772. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  1773. model: {
  1774. uri: options2.url,
  1775. incrementallyLoadTextures: true,
  1776. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1777. colorBlendAmount: 0.1,
  1778. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  1779. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1780. runAnimations: true,
  1781. show: true,
  1782. debugWireframe: false,
  1783. debugShowBoundingVolume: false
  1784. }
  1785. });
  1786. if (options2.minimumPixelSize) {
  1787. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  1788. }
  1789. if (options2.maximumScale) {
  1790. modelGltf.model.maximumScale = options2.maximumScale;
  1791. }
  1792. if (options2.silhouetteColor) {
  1793. if (options2.silhouetteColor instanceof Array) {
  1794. options2.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  1795. } else if (typeof options2.silhouetteColor === "string") {
  1796. options2.silhouetteColor = new Cesium.Color.fromCssColorString(options2.silhouetteColor);
  1797. } else {
  1798. options2.silhouetteColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1799. }
  1800. }
  1801. window[options2.id] = modelGltf;
  1802. resolve2(options2.id);
  1803. });
  1804. },
  1805. addModelFromGltf(points2, options2) {
  1806. let viewer2 = this._viewer;
  1807. return new Promise((resolve2, reject2) => {
  1808. if (!Cesium.defined(options2.points)) {
  1809. resolve2("options.points is required.");
  1810. throw new Cesium.DeveloperError("options.points is required.");
  1811. }
  1812. if (!Cesium.defined(options2.url)) {
  1813. resolve2("options.url is required.");
  1814. throw new Cesium.DeveloperError("options.url is required.");
  1815. }
  1816. options2.id = options2.id || setSessionid$1();
  1817. options2.scale = Cesium.defaultValue(options2.scale, 1);
  1818. let position2 = void 0;
  1819. if (options2.points instanceof Cesium.Cartesian3) {
  1820. position2 = options2.points;
  1821. } else {
  1822. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1823. }
  1824. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  1825. let model = viewer2.scene.primitives.add(
  1826. Cesium.Model.fromGltf({
  1827. show: true,
  1828. url: options2.url,
  1829. modelMatrix,
  1830. lightColor: new Cesium.Cartesian3(10, 10, 10),
  1831. debugWireframe: false,
  1832. debugShowBoundingVolume: false
  1833. })
  1834. );
  1835. model.readyPromise.then(function() {
  1836. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  1837. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  1838. });
  1839. window[options2.id] = model;
  1840. resolve2(options2.id);
  1841. });
  1842. }
  1843. });
  1844. class PolylineObject {
  1845. constructor(viewer2) {
  1846. if (!viewer2)
  1847. throw new Cesium.DeveloperError("no viewer object!");
  1848. this._viewer = viewer2;
  1849. }
  1850. }
  1851. Object.assign(PolylineObject.prototype, {
  1852. addPolyline: function(points2, options2) {
  1853. this._viewer;
  1854. return new Promise((resolve2, reject2) => {
  1855. if (!Cesium.defined(points2)) {
  1856. throw new Cesium.DeveloperError("points is required.");
  1857. }
  1858. if (points2.length < 2) {
  1859. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1860. }
  1861. let positions;
  1862. if (points2[0] instanceof Cesium.Cartesian3) {
  1863. positions = points2;
  1864. } else {
  1865. positions = points2.map((point2) => {
  1866. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1867. });
  1868. }
  1869. options2 = options2 || {};
  1870. options2 = options2 || {};
  1871. options2.id = options2.id || setSessionid$1();
  1872. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1873. options2.width = Cesium.defaultValue(options2.width, 3);
  1874. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1875. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1876. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1877. let material = new PolylineDirectionMaterialProperty(options2);
  1878. let entity = new Cesium.Entity({
  1879. name: "line",
  1880. polyline: {
  1881. positions,
  1882. width: options2.width,
  1883. material,
  1884. distanceDisplayCondition
  1885. }
  1886. });
  1887. if (options2.clampToGround) {
  1888. entity.polyline.clampToGround = true;
  1889. }
  1890. resolve2(entity);
  1891. });
  1892. },
  1893. drawPolylineByGeoJson: function(geoJsonUrl, options2) {
  1894. return new Promise((resolve2, reject2) => {
  1895. let viewer2 = this._viewer;
  1896. if (!Cesium.defined(geoJsonUrl)) {
  1897. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1898. }
  1899. options2 = options2 || {};
  1900. options2.id = options2.id || setSessionid$1();
  1901. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1902. options2.width = Cesium.defaultValue(options2.width, 3);
  1903. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1904. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1905. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  1906. clampToGround: options2.clampToGround
  1907. });
  1908. promise.then((dataSource) => {
  1909. viewer2.dataSources.add(dataSource);
  1910. dataSource.name = options2.id;
  1911. let entities2 = dataSource.entities.values;
  1912. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1913. let material = new PolylineDirectionMaterialProperty(options2);
  1914. for (var i2 = 0; i2 < entities2.length; i2++) {
  1915. var entity = entities2[i2];
  1916. entity.polyline.distanceDisplayCondition = distanceDisplayCondition;
  1917. entity.polyline.material = material;
  1918. entity.polyline.width = options2.width;
  1919. if (options2.clampToGround) {
  1920. entity.polyline.clampToGround = true;
  1921. }
  1922. }
  1923. resolve2(entities2);
  1924. });
  1925. });
  1926. },
  1927. PolylineLinkPulseMaterialProperty: function(points2, options2) {
  1928. return new Promise((resolve2, reject2) => {
  1929. if (!Cesium.defined(points2)) {
  1930. throw new Cesium.DeveloperError("points is required.");
  1931. }
  1932. if (points2.length < 2) {
  1933. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1934. }
  1935. let positions = points2.map((point2) => {
  1936. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1937. });
  1938. options2 = options2 || {};
  1939. options2.id = options2.id || setSessionid$1();
  1940. options2.width = options2.width || 5;
  1941. let material = new PolylineDirectionMaterialProperty(options2);
  1942. let entity = this._viewer.entities.add({
  1943. id: options2.id,
  1944. name: "Pulse line",
  1945. polyline: {
  1946. positions,
  1947. width: options2.width,
  1948. material,
  1949. clampToGround: true
  1950. }
  1951. });
  1952. resolve2(entity);
  1953. });
  1954. },
  1955. PolylineArrowMaterialProperty: function(points2, options2) {
  1956. return new Promise((resolve2, reject2) => {
  1957. if (!Cesium.defined(points2)) {
  1958. throw new Cesium.DeveloperError("points is required.");
  1959. }
  1960. if (points2.length < 2) {
  1961. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1962. }
  1963. let positions = points2.map((point2) => {
  1964. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1965. });
  1966. options2 = options2 || {};
  1967. options2.id = options2.id || setSessionid$1();
  1968. options2.width = options2.width || 5;
  1969. let material = new PolylineDirectionMaterialProperty(options2);
  1970. let entity = this._viewer.entities.add({
  1971. id: options2.id,
  1972. name: "Pulse line",
  1973. polyline: {
  1974. positions,
  1975. width: options2.width,
  1976. material,
  1977. clampToGround: true
  1978. }
  1979. });
  1980. resolve2(entity);
  1981. });
  1982. },
  1983. drawGlowingLine(points2, options2) {
  1984. return new Promise((resolve2, reject2) => {
  1985. if (!Cesium.defined(points2)) {
  1986. throw new Cesium.DeveloperError("points is required.");
  1987. }
  1988. if (points2.length < 2) {
  1989. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1990. }
  1991. let positions = points2.map((point2) => {
  1992. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1993. });
  1994. options2 = options2 || {};
  1995. options2.id = options2.id || setSessionid$1();
  1996. if (options2.color) {
  1997. if (options2.color instanceof Array) {
  1998. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  1999. } else if (typeof options2.color === "string") {
  2000. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2001. } else {
  2002. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2003. }
  2004. }
  2005. options2.width = options2.width || 5;
  2006. options2.glowPower = options2.glowPower || 0.25;
  2007. options2.taperPower = options2.taperPower || 1;
  2008. let entity = this._viewer.entities.add({
  2009. id: options2.id,
  2010. name: "Glowing blue line on the surface",
  2011. polyline: {
  2012. clampToGround: true,
  2013. positions,
  2014. width: options2.width,
  2015. followSurface: true,
  2016. material: new Cesium.PolylineGlowMaterialProperty({
  2017. color: options2.color,
  2018. glowPower: options2.glowPower,
  2019. taperPower: options2.taperPower
  2020. })
  2021. }
  2022. });
  2023. resolve2(entity);
  2024. });
  2025. },
  2026. drawSpecifyColorLine(points2, options2) {
  2027. return new Promise((resolve2, reject2) => {
  2028. if (!Cesium.defined(points2)) {
  2029. reject2("points is required.");
  2030. }
  2031. if (points2.length < 2) {
  2032. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2033. }
  2034. let positions = points2.map((point2) => {
  2035. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2036. });
  2037. options2 = options2 || {};
  2038. options2.id = options2.id || setSessionid$1();
  2039. if (options2.color) {
  2040. if (options2.color instanceof Array) {
  2041. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2042. } else if (typeof options2.color === "string") {
  2043. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2044. } else {
  2045. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2046. }
  2047. }
  2048. options2.width = options2.width || 5;
  2049. let entity = this._viewer.entities.add({
  2050. id: options2.id,
  2051. name: "Red line on the surface",
  2052. polyline: {
  2053. clampToGround: true,
  2054. positions,
  2055. width: options2.width,
  2056. material: options2.color
  2057. }
  2058. });
  2059. resolve2(entity);
  2060. });
  2061. },
  2062. drawSpecifyColorAndOutlineColorLine(points2, options2) {
  2063. return new Promise((resolve2, reject2) => {
  2064. if (!Cesium.defined(points2)) {
  2065. throw new Cesium.DeveloperError("points is required.");
  2066. }
  2067. if (points2.length < 2) {
  2068. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2069. }
  2070. let positions = points2.map((point2) => {
  2071. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2072. });
  2073. options2 = options2 || {};
  2074. options2.id = options2.id || setSessionid$1();
  2075. if (options2.color) {
  2076. if (options2.color instanceof Array) {
  2077. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2078. } else if (typeof options2.color === "string") {
  2079. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2080. } else {
  2081. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2082. }
  2083. }
  2084. options2.width = options2.width || 5;
  2085. if (options2.outlineColor) {
  2086. if (options2.outlineColor instanceof Array) {
  2087. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  2088. } else if (typeof options2.outlineColor === "string") {
  2089. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  2090. } else {
  2091. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2092. }
  2093. }
  2094. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  2095. let entity = this._viewer.entities.add({
  2096. id: options2.id,
  2097. name: "Orange line with black outline at height and following the surface",
  2098. polyline: {
  2099. clampToGround: true,
  2100. positions,
  2101. width: options2.width,
  2102. material: new Cesium.PolylineOutlineMaterialProperty({
  2103. color: options2.color,
  2104. outlineWidth: options2.outlineWidth,
  2105. outlineColor: options2.outlineColor
  2106. })
  2107. }
  2108. });
  2109. resolve2(entity);
  2110. });
  2111. },
  2112. drawSpecifyColorArrowStaticStateLine(points2, options2) {
  2113. return new Promise((resolve2, reject2) => {
  2114. if (!Cesium.defined(points2)) {
  2115. throw new Cesium.DeveloperError("points is required.");
  2116. }
  2117. if (points2.length < 2) {
  2118. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2119. }
  2120. let positions = points2.map((point2) => {
  2121. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2122. });
  2123. options2 = options2 || {};
  2124. options2.id = options2.id || setSessionid$1();
  2125. if (options2.color) {
  2126. if (options2.color instanceof Array) {
  2127. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2128. } else if (typeof options2.color === "string") {
  2129. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2130. } else {
  2131. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2132. }
  2133. }
  2134. options2.width = options2.width || 5;
  2135. let entity = this._viewer.entities.add({
  2136. id: options2.id,
  2137. name: "Purple straight arrow at height",
  2138. polyline: {
  2139. clampToGround: true,
  2140. positions,
  2141. width: options2.width,
  2142. followSurface: false,
  2143. material: new Cesium.PolylineArrowMaterialProperty(options2.color)
  2144. }
  2145. });
  2146. resolve2(entity);
  2147. });
  2148. },
  2149. drawDashedLine(points2, options2) {
  2150. return new Promise((resolve2, reject2) => {
  2151. if (!Cesium.defined(points2)) {
  2152. throw new Cesium.DeveloperError("points is required.");
  2153. }
  2154. if (points2.length < 2) {
  2155. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2156. }
  2157. let positions = points2.map((point2) => {
  2158. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2159. });
  2160. options2 = options2 || {};
  2161. options2.id = options2.id || setSessionid$1();
  2162. if (options2.color) {
  2163. if (options2.color instanceof Array) {
  2164. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2165. } else if (typeof options2.color === "string") {
  2166. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2167. } else {
  2168. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2169. }
  2170. }
  2171. options2.width = options2.width || 5;
  2172. if (options2.gapColor) {
  2173. if (options2.gapColor instanceof Array) {
  2174. options2.gapColor = new Cesium.Color(options2.gapColor[0] / 255, options2.gapColor[1] / 255, options2.gapColor[2] / 255, options2.gapColor[3]);
  2175. } else if (typeof options2.gapColor === "string") {
  2176. options2.gapColor = new Cesium.Color.fromCssColorString(options2.gapColor);
  2177. } else {
  2178. options2.gapColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2179. }
  2180. }
  2181. options2.dashLength = options2.dashLength || 16;
  2182. options2.dashPattern = options2.dashPattern || 255;
  2183. let entity = this._viewer.entities.add({
  2184. id: options2.id,
  2185. name: "CYAN dashed line",
  2186. polyline: {
  2187. clampToGround: true,
  2188. positions,
  2189. width: options2.width,
  2190. material: new Cesium.PolylineDashMaterialProperty({
  2191. color: options2.color,
  2192. gapColor: options2.gapColor,
  2193. dashLength: options2.dashLength,
  2194. dashPattern: options2.dashPattern
  2195. })
  2196. }
  2197. });
  2198. resolve2(entity);
  2199. });
  2200. }
  2201. });
  2202. function DynamicWallMaterialProperty(options2) {
  2203. this._definitionChanged = new Cesium.Event();
  2204. this._color = void 0;
  2205. this._colorSubscription = void 0;
  2206. this.color = options2.color || Color.BLUE;
  2207. this.duration = options2.duration || 1e3;
  2208. this.trailImage = options2.trailImage;
  2209. this._time = new Date().getTime();
  2210. }
  2211. function _getDirectionWallShader(options2) {
  2212. if (options2 && options2.get) {
  2213. var materail = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;";
  2214. if (options2.direction == "vertical") {
  2215. materail += "vec4 colorImage = texture2D(image, vec2(fract(st.s), fract(float(" + options2.count + ")*st.t" + options2.order + " time)));\n ";
  2216. } else {
  2217. materail += "vec4 colorImage = texture2D(image, vec2(fract(float(" + options2.count + ")*st.s " + options2.order + " time), fract(st.t)));\n ";
  2218. }
  2219. materail += "vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n return material;\n }";
  2220. return materail;
  2221. }
  2222. }
  2223. Object.defineProperties(DynamicWallMaterialProperty.prototype, {
  2224. isConstant: {
  2225. get: function() {
  2226. return false;
  2227. }
  2228. },
  2229. definitionChanged: {
  2230. get: function() {
  2231. return this._definitionChanged;
  2232. }
  2233. },
  2234. color: Cesium.createPropertyDescriptor("color")
  2235. });
  2236. var MaterialType = "wallType" + parseInt(Math.random() * 1e3);
  2237. DynamicWallMaterialProperty.prototype.getType = function(time) {
  2238. return MaterialType;
  2239. };
  2240. DynamicWallMaterialProperty.prototype.getValue = function(time, result) {
  2241. if (!Cesium.defined(result)) {
  2242. result = {};
  2243. }
  2244. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
  2245. result.image = this.trailImage;
  2246. if (this.duration) {
  2247. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  2248. }
  2249. viewer.scene.requestRender();
  2250. return result;
  2251. };
  2252. DynamicWallMaterialProperty.prototype.equals = function(other) {
  2253. return this === other || other instanceof DynamicWallMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2254. };
  2255. Cesium.Material._materialCache.addMaterial(MaterialType, {
  2256. fabric: {
  2257. type: MaterialType,
  2258. uniforms: {
  2259. color: new Cesium.Color(1, 0, 0, 0.5),
  2260. image: Cesium.Material.DefaultImageId,
  2261. time: -20
  2262. },
  2263. source: _getDirectionWallShader({
  2264. get: true,
  2265. count: 3,
  2266. direction: "vertical",
  2267. order: "-"
  2268. })
  2269. },
  2270. translucent: function(material) {
  2271. return true;
  2272. }
  2273. });
  2274. Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
  2275. class WallDiffuseMaterialProperty {
  2276. constructor(options2) {
  2277. this._definitionChanged = new Cesium.Event();
  2278. this._color = void 0;
  2279. this.color = options2.color;
  2280. }
  2281. get isConstant() {
  2282. return false;
  2283. }
  2284. get definitionChanged() {
  2285. return this._definitionChanged;
  2286. }
  2287. getType(time) {
  2288. return Cesium.Material.WallDiffuseMaterialType;
  2289. }
  2290. getValue(time, result) {
  2291. if (!Cesium.defined(result)) {
  2292. result = {};
  2293. }
  2294. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  2295. return result;
  2296. }
  2297. equals(other) {
  2298. return this === other || other instanceof WallDiffuseMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2299. }
  2300. }
  2301. Object.defineProperties(WallDiffuseMaterialProperty.prototype, {
  2302. color: Cesium.createPropertyDescriptor("color")
  2303. });
  2304. Cesium.WallDiffuseMaterialProperty = WallDiffuseMaterialProperty;
  2305. Cesium.Material.WallDiffuseMaterialProperty = "WallDiffuseMaterialProperty";
  2306. Cesium.Material.WallDiffuseMaterialType = "WallDiffuseMaterialType";
  2307. Cesium.Material.WallDiffuseMaterialSource = `
  2308. uniform vec4 color;
  2309. czm_material czm_getMaterial(czm_materialInput materialInput){
  2310. czm_material material = czm_getDefaultMaterial(materialInput);
  2311. vec2 st = materialInput.st;
  2312. material.diffuse = color.rgb * 2.0;
  2313. material.alpha = color.a * (1.0 - fract(st.t)) * 0.8;
  2314. return material;
  2315. }
  2316. `;
  2317. Cesium.Material._materialCache.addMaterial(Cesium.Material.WallDiffuseMaterialType, {
  2318. fabric: {
  2319. type: Cesium.Material.WallDiffuseMaterialType,
  2320. uniforms: {
  2321. color: new Cesium.Color(1, 0, 0, 1)
  2322. },
  2323. source: Cesium.Material.WallDiffuseMaterialSource
  2324. },
  2325. translucent: function(material) {
  2326. return true;
  2327. }
  2328. });
  2329. class WallObject {
  2330. constructor(viewer2) {
  2331. if (!viewer2)
  2332. throw new Cesium.DeveloperError("no viewer object!");
  2333. this._viewer = viewer2;
  2334. }
  2335. }
  2336. Object.assign(WallObject.prototype, {
  2337. drawWallByGeoJson: function(geoJsonUrl, options2) {
  2338. return new Promise((resolve2, reject2) => {
  2339. let _self = this;
  2340. let viewer2 = this._viewer;
  2341. if (!Cesium.defined(geoJsonUrl)) {
  2342. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  2343. }
  2344. options2 = options2 || {};
  2345. options2.id = options2.id || setSessionid$1();
  2346. fetch(geoJsonUrl).then((res) => {
  2347. return res.json();
  2348. }).then((res) => {
  2349. let wall = new Cesium.CustomDataSource(options2.id);
  2350. viewer2.dataSources.add(wall);
  2351. for (var i2 = 0; i2 < res.features.length; i2++) {
  2352. if (res.features[i2].geometry) {
  2353. if (res.features[i2].geometry.type === "MultiLineString") {
  2354. let coordinatesList = res.features[i2].geometry.coordinates;
  2355. for (var j = 0; j < coordinatesList.length; j++) {
  2356. let coordinates = coordinatesList[j];
  2357. let positions = coordinates.map((point2) => {
  2358. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2359. });
  2360. _self.addWall(positions, options2).then((entity) => {
  2361. wall.entities.add(entity);
  2362. });
  2363. }
  2364. } else {
  2365. let coordinates = res.features[i2].geometry.coordinates;
  2366. let positions = coordinates.map((point2) => {
  2367. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2368. });
  2369. _self.addWall(positions, options2).then((entity) => {
  2370. wall.entities.add(entity);
  2371. });
  2372. }
  2373. }
  2374. }
  2375. resolve2(options2.id);
  2376. });
  2377. });
  2378. },
  2379. addWall(points2, options2) {
  2380. return new Promise((resolve2, reject2) => {
  2381. if (!Cesium.defined(points2)) {
  2382. throw new Cesium.DeveloperError("points is required.");
  2383. }
  2384. if (points2.length < 2) {
  2385. reject2("\u5899\u4F53\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2386. }
  2387. let positions;
  2388. if (points2[0] instanceof Cesium.Cartesian3) {
  2389. positions = points2;
  2390. } else {
  2391. positions = points2.map((point2) => {
  2392. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2393. });
  2394. }
  2395. options2 = options2 || {};
  2396. options2.id = options2.id || setSessionid$1();
  2397. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  2398. options2.minimunHeights = options2.minimunHeights !== void 0 && typeof options2.minimunHeights === "number" ? options2.minimunHeights : 0;
  2399. options2.maximumHeights = options2.maximumHeights !== void 0 && typeof options2.maximumHeights === "number" ? options2.maximumHeights : 1e3;
  2400. if (options2.color) {
  2401. if (options2.color instanceof Cesium.Color) {
  2402. options2.color = options2.color;
  2403. } else if (options2.color instanceof Array) {
  2404. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2405. } else if (typeof options2.color === "string") {
  2406. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2407. } else {
  2408. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2409. }
  2410. }
  2411. options2.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  2412. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  2413. options2.count = Cesium.defaultValue(options2.count, 1);
  2414. options2.direction = Cesium.defaultValue(options2.direction, "vertical");
  2415. options2.order = Cesium.defaultValue(options2.order, "-");
  2416. let entity = new Cesium.Entity({
  2417. name: "\u7ACB\u4F53\u5899\u6548\u679C",
  2418. wall: {
  2419. positions,
  2420. maximumHeights: new Array(positions.length).fill(options2.maximumHeights),
  2421. minimunHeights: new Array(positions.length).fill(options2.minimunHeights),
  2422. material: new WallMaterialProperty$1(viewer, {
  2423. trailImage: options2.trailImage,
  2424. color: options2.color,
  2425. duration: options2.duration,
  2426. param: {
  2427. count: options2.count,
  2428. direction: options2.direction,
  2429. order: options2.order
  2430. }
  2431. })
  2432. }
  2433. });
  2434. resolve2(entity);
  2435. });
  2436. }
  2437. });
  2438. class LoadMapData {
  2439. constructor(viewer2) {
  2440. if (!viewer2)
  2441. throw new Cesium.DeveloperError("no viewer object!");
  2442. this._viewer = viewer2;
  2443. this._pointObject = new PointObject(viewer2);
  2444. this._polylineObject = new PolylineObject(viewer2);
  2445. this._wallObject = new WallObject(viewer2);
  2446. }
  2447. _addImageryProvider(id, provider) {
  2448. window[id] = this._viewer.imageryLayers.addImageryProvider(provider);
  2449. }
  2450. _removeImageryProvider(serviceId) {
  2451. this._viewer.imageryLayers.remove(window[serviceId]);
  2452. window[serviceId] = null;
  2453. }
  2454. _addTerrainProvider(provider) {
  2455. this._viewer.terrainProvider = provider;
  2456. }
  2457. _setEllipsoidTerrain() {
  2458. this._viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider({});
  2459. }
  2460. _addScenePrimitives(scenePrimitives) {
  2461. this._viewer.scene.primitives.add(scenePrimitives);
  2462. }
  2463. _removeScenePrimitives(serviceId) {
  2464. this._viewer.scene.primitives.remove(window[serviceId]);
  2465. window[serviceId] = null;
  2466. }
  2467. _guid() {
  2468. function S4() {
  2469. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  2470. }
  2471. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  2472. }
  2473. _transformProjection(provider) {
  2474. let webMercatorTilingScheme = provider.tilingScheme;
  2475. let projection = webMercatorTilingScheme._projection;
  2476. projection.x_project = projection.project;
  2477. projection.project = function(cartographic) {
  2478. let point2;
  2479. return point2 = CoordTransform.WGS84ToGCJ02(
  2480. Cesium.Math.toDegrees(cartographic.longitude),
  2481. Cesium.Math.toDegrees(cartographic.latitude)
  2482. ), projection.x_project(
  2483. new Cesium.Cartographic(
  2484. Cesium.Math.toRadians(point2[0]),
  2485. Cesium.Math.toRadians(point2[1])
  2486. )
  2487. );
  2488. };
  2489. projection.x_unproject = projection.unproject;
  2490. projection.unproject = function(cartesian) {
  2491. let point2, cartographic = projection.x_unproject(cartesian);
  2492. return point2 = CoordTransform.GCJ02ToWGS84(
  2493. Cesium.Math.toDegrees(cartographic.longitude),
  2494. Cesium.Math.toDegrees(cartographic.latitude)
  2495. ), new Cesium.Cartographic(
  2496. Cesium.Math.toRadians(point2[0]),
  2497. Cesium.Math.toRadians(point2[1])
  2498. );
  2499. };
  2500. return provider;
  2501. }
  2502. }
  2503. Object.assign(LoadMapData.prototype, {
  2504. addTerrain(options2) {
  2505. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2506. throw new Cesium.DeveloperError("options.url is required.");
  2507. }
  2508. let _ConstructorOptions = {
  2509. url: options2.url
  2510. };
  2511. if (options2.requestVertexNormals) {
  2512. _ConstructorOptions.requestVertexNormals = options2.requestVertexNormals;
  2513. } else {
  2514. _ConstructorOptions.requestVertexNormals = false;
  2515. }
  2516. if (options2.requestWaterMask) {
  2517. _ConstructorOptions.requestWaterMask = options2.requestWaterMask;
  2518. } else {
  2519. _ConstructorOptions.requestWaterMask = false;
  2520. }
  2521. var terrainProvider = new Cesium.CesiumTerrainProvider(_ConstructorOptions);
  2522. this._addTerrainProvider(terrainProvider);
  2523. this.setTerrainExaggeration(options2);
  2524. },
  2525. addMapboxLayer(options2, callSuccess) {
  2526. if (!Cesium.defined(options2) || !Cesium.defined(options2.styleId)) {
  2527. throw new Cesium.DeveloperError("options.styleId is required.");
  2528. }
  2529. if (!Cesium.defined(options2.accessToken)) {
  2530. throw new Cesium.DeveloperError("options.accessToken is required.");
  2531. }
  2532. options2.id = options2.id || this._guid();
  2533. var imageryProvider = new Cesium.MapboxStyleImageryProvider({
  2534. url: options2.url,
  2535. username: options2.username,
  2536. styleId: options2.styleId,
  2537. accessToken: options2.accessToken,
  2538. scaleFactor: options2.scaleFactor
  2539. });
  2540. this._addImageryProvider(options2.id, imageryProvider);
  2541. this.setLayersStyle({
  2542. serviceId: options2.id,
  2543. alpha: options2.alpha
  2544. });
  2545. if (callSuccess)
  2546. callSuccess(options2.id);
  2547. },
  2548. addUrlTemplateImagery: function(options2, callSuccess) {
  2549. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2550. throw new Cesium.DeveloperError("options.url is required.");
  2551. }
  2552. options2.id = options2.id || this._guid();
  2553. options2.CRS = options2.CRS || "";
  2554. let _ConstructorOptions = {
  2555. url: options2.url
  2556. };
  2557. if (options2.minimumLevel) {
  2558. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2559. }
  2560. if (options2.maximumLevel) {
  2561. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2562. } else {
  2563. _ConstructorOptions.maximumLevel = 18;
  2564. }
  2565. var imageryProvider = new Cesium.UrlTemplateImageryProvider(_ConstructorOptions);
  2566. if (options2.CRS.toUpperCase() === "WGS84") {
  2567. imageryProvider.readyPromise.then(() => {
  2568. this._transformProjection(imageryProvider);
  2569. });
  2570. }
  2571. this._addImageryProvider(options2.id, imageryProvider);
  2572. this.setLayersStyle({
  2573. serviceId: options2.id,
  2574. alpha: options2.alpha
  2575. });
  2576. if (callSuccess)
  2577. callSuccess(options2.id);
  2578. },
  2579. addTileMapServiceImagery: function(options2, callSuccess) {
  2580. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2581. throw new Cesium.DeveloperError("options.url is required.");
  2582. }
  2583. options2.id = options2.id || this._guid();
  2584. let _ConstructorOptions = {
  2585. url: options2.url
  2586. };
  2587. if (options2.minimumLevel) {
  2588. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2589. }
  2590. if (options2.maximumLevel) {
  2591. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2592. } else {
  2593. _ConstructorOptions.maximumLevel = 18;
  2594. }
  2595. var imageryProvider = new Cesium.TileMapServiceImageryProvider(_ConstructorOptions);
  2596. this._addImageryProvider(options2.id, imageryProvider);
  2597. this.setLayersStyle({
  2598. serviceId: options2.id,
  2599. alpha: options2.alpha
  2600. });
  2601. if (callSuccess)
  2602. callSuccess(options2.id);
  2603. },
  2604. addWebMapTileService: function(options2, callSuccess) {
  2605. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2606. throw new Cesium.DeveloperError("options.url is required.");
  2607. }
  2608. if (!Cesium.defined(options2.layers)) {
  2609. throw new Cesium.DeveloperError("options.layers is required.");
  2610. }
  2611. if (!Cesium.defined(options2.style)) {
  2612. throw new Cesium.DeveloperError("options.style is required.");
  2613. }
  2614. if (!Cesium.defined(options2.tileMatrixSetID)) {
  2615. throw new Cesium.DeveloperError("options.tileMatrixSetID is required.");
  2616. }
  2617. options2.id = options2.id || this._guid();
  2618. let _ConstructorOptions = {
  2619. url: options2.url,
  2620. layer: options2.layers,
  2621. style: options2.style,
  2622. tileMatrixSetID: options2.tileMatrixSetID,
  2623. format: Cesium.defaultValue(options2.format, "image/png")
  2624. };
  2625. if (options2.tileMatrixLabels) {
  2626. _ConstructorOptions.tileMatrixLabels = options2.tileMatrixLabels;
  2627. }
  2628. if (options2.minimumLevel) {
  2629. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2630. }
  2631. if (options2.maximumLevel) {
  2632. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2633. } else {
  2634. _ConstructorOptions.maximumLevel = 18;
  2635. }
  2636. let imageryProvider = new Cesium.WebMapTileServiceImageryProvider(_ConstructorOptions);
  2637. this._addImageryProvider(options2.id, imageryProvider);
  2638. this.setLayersStyle({
  2639. serviceId: options2.id,
  2640. alpha: options2.alpha
  2641. });
  2642. if (callSuccess)
  2643. callSuccess(options2.id);
  2644. },
  2645. addWebMapService: function(options2, callSuccess) {
  2646. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2647. throw new Cesium.DeveloperError("options.url is required.");
  2648. }
  2649. if (!Cesium.defined(options2.layers)) {
  2650. throw new Cesium.DeveloperError("options.layers is required.");
  2651. }
  2652. options2.id = options2.id || this._guid();
  2653. let _ConstructorOptions = {
  2654. url: options2.url,
  2655. layers: options2.layers
  2656. };
  2657. if (options2.parameters) {
  2658. _ConstructorOptions.parameters = options2.parameters;
  2659. } else {
  2660. _ConstructorOptions.parameters = {
  2661. service: "WMS",
  2662. transparent: true,
  2663. request: "GetMap",
  2664. format: "image/png"
  2665. };
  2666. }
  2667. if (options2.minimumLevel) {
  2668. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2669. }
  2670. if (options2.maximumLevel) {
  2671. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2672. } else {
  2673. _ConstructorOptions.maximumLevel = 18;
  2674. }
  2675. let imageryProvider = new Cesium.WebMapServiceImageryProvider(_ConstructorOptions);
  2676. this._addImageryProvider(options2.id, imageryProvider);
  2677. this.setLayersStyle({
  2678. serviceId: options2.id,
  2679. alpha: options2.alpha
  2680. });
  2681. if (callSuccess)
  2682. callSuccess(options2.id);
  2683. },
  2684. addArcGisMapServer: function(options2, callSuccess) {
  2685. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2686. throw new Cesium.DeveloperError("options.url is required.");
  2687. }
  2688. options2.id = options2.id || this._guid();
  2689. let _ConstructorOptions = {
  2690. url: options2.url
  2691. };
  2692. if (options2.layers) {
  2693. _ConstructorOptions.layers = options2.layers;
  2694. }
  2695. let imageryProvider = new Cesium.ArcGisMapServerImageryProvider(_ConstructorOptions);
  2696. this._addImageryProvider(options2.id, imageryProvider);
  2697. this.setLayersStyle({
  2698. serviceId: options2.id,
  2699. alpha: options2.alpha
  2700. });
  2701. if (callSuccess)
  2702. callSuccess(options2.id);
  2703. },
  2704. addCesium3DTileset: function(options2, callSuccess) {
  2705. let _self = this;
  2706. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2707. throw new Cesium.DeveloperError("options.url is required.");
  2708. }
  2709. options2.id = options2.id || this._guid();
  2710. let _ConstructorOptions = {
  2711. url: options2.url,
  2712. skipLevelOfDetail: true
  2713. };
  2714. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2715. tileSetModel.readyPromise.then((tileset) => {
  2716. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2717. window[options2.id] = tileset;
  2718. _self._addScenePrimitives(tileset);
  2719. _self.set3DTilePosition({
  2720. serviceId: options2.id,
  2721. height: options2.height
  2722. });
  2723. _self.set3DTileStyle({
  2724. serviceId: options2.id,
  2725. alpha: options2.alpha
  2726. });
  2727. if (callSuccess)
  2728. callSuccess(options2.id);
  2729. }).catch(function(error) {
  2730. console.log(error);
  2731. });
  2732. },
  2733. addCesium3DTilesetBm: function(options2, callSuccess) {
  2734. let _self = this;
  2735. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2736. throw new Cesium.DeveloperError("options.url is required.");
  2737. }
  2738. options2.id = options2.id || this._guid();
  2739. let _ConstructorOptions = {
  2740. url: options2.url,
  2741. skipLevelOfDetail: true
  2742. };
  2743. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2744. tileSetModel.readyPromise.then((tileset) => {
  2745. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2746. window[options2.id] = tileset;
  2747. _self._addScenePrimitives(tileset);
  2748. _self.set3DTileBMStyle({
  2749. serviceId: options2.id,
  2750. color: options2.color
  2751. });
  2752. if (callSuccess)
  2753. callSuccess(options2.id);
  2754. }).catch(function(error) {
  2755. console.log(error);
  2756. });
  2757. },
  2758. addPolygonImageMaterial: function(options2, callSuccess) {
  2759. if (!Cesium.defined(options2.points)) {
  2760. throw new Cesium.DeveloperError("options.points is required.");
  2761. }
  2762. if (options2.points.length < 3) {
  2763. reject("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  2764. }
  2765. let positions = [];
  2766. if (options2.points instanceof Cesium.Cartesian3) {
  2767. positions = options2.points;
  2768. } else {
  2769. positions = options2.points.map((point2) => {
  2770. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2771. });
  2772. }
  2773. options2.id = options2.id || this._guid();
  2774. options2.alpha = options2.alpha || 1;
  2775. this.classificationType = Cesium.ClassificationType.BOTH;
  2776. if (options2.classificationType === "Terrain") {
  2777. this.classificationType = Cesium.ClassificationType.TERRAIN;
  2778. } else if (options2.classificationType === "3DTiles") {
  2779. this.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
  2780. }
  2781. if (options2.url) {
  2782. if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(this._viewer.scene)) {
  2783. window.alert("Terrain Entity materials are not supported on this platform");
  2784. }
  2785. this.material = new Cesium.ImageMaterialProperty({
  2786. image: options2.url,
  2787. repeat: Cesium.Cartesian2(1, 1),
  2788. transparent: true,
  2789. color: Cesium.Color.WHITE.withAlpha(options2.alpha)
  2790. });
  2791. } else {
  2792. this.material = Cesium.Color.RED.withAlpha(options2.alpha);
  2793. }
  2794. window[options2.id] = this._viewer.entities.add({
  2795. id: options2.id,
  2796. polygon: {
  2797. hierarchy: positions,
  2798. material: this.material,
  2799. classificationType: this.classificationType
  2800. }
  2801. });
  2802. if (callSuccess)
  2803. callSuccess(options2.id);
  2804. },
  2805. addEntitiesGltf: function(options2, callSuccess) {
  2806. let viewer2 = this._viewer;
  2807. if (!Cesium.defined(options2.points)) {
  2808. resolve("options.points is required.");
  2809. throw new Cesium.DeveloperError("options.points is required.");
  2810. }
  2811. if (!Cesium.defined(options2.url)) {
  2812. resolve("options.url is required.");
  2813. throw new Cesium.DeveloperError("options.url is required.");
  2814. }
  2815. options2.id = options2.id || this._guid();
  2816. options2.heading = Cesium.defaultValue(options2.heading, 0);
  2817. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  2818. options2.roll = Cesium.defaultValue(options2.roll, 0);
  2819. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  2820. let position2 = void 0;
  2821. if (options2.points instanceof Cesium.Cartesian3) {
  2822. position2 = options2.points;
  2823. } else {
  2824. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2825. }
  2826. var heading = Cesium.Math.toRadians(options2.heading);
  2827. var pitch = options2.pitch;
  2828. var roll = options2.roll;
  2829. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  2830. var modelGltf = viewer2.entities.add({
  2831. id: options2.id,
  2832. position: position2,
  2833. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  2834. model: {
  2835. uri: options2.url,
  2836. incrementallyLoadTextures: true,
  2837. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  2838. colorBlendAmount: 0.1,
  2839. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  2840. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  2841. runAnimations: true,
  2842. show: true,
  2843. debugWireframe: false,
  2844. debugShowBoundingVolume: false
  2845. }
  2846. });
  2847. if (options2.minimumPixelSize) {
  2848. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  2849. }
  2850. if (options2.maximumScale) {
  2851. modelGltf.model.maximumScale = options2.maximumScale;
  2852. }
  2853. if (options2.silhouetteColor) {
  2854. modelGltf.model.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  2855. }
  2856. window[options2.id] = modelGltf;
  2857. if (callSuccess)
  2858. callSuccess(options2.id);
  2859. },
  2860. addScenePrimitivesGltf(options2, callSuccess) {
  2861. let viewer2 = this._viewer;
  2862. if (!Cesium.defined(options2.points)) {
  2863. resolve("options.points is required.");
  2864. throw new Cesium.DeveloperError("options.points is required.");
  2865. }
  2866. if (!Cesium.defined(options2.url)) {
  2867. resolve("options.url is required.");
  2868. throw new Cesium.DeveloperError("options.url is required.");
  2869. }
  2870. options2.id = options2.id || this._guid();
  2871. options2.scale = Cesium.defaultValue(options2.scale, 1);
  2872. let position2 = void 0;
  2873. if (options2.points instanceof Cesium.Cartesian3) {
  2874. position2 = options2.points;
  2875. } else {
  2876. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2877. }
  2878. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  2879. let model = viewer2.scene.primitives.add(
  2880. Cesium.Model.fromGltf({
  2881. show: true,
  2882. url: options2.url,
  2883. modelMatrix,
  2884. lightColor: new Cesium.Cartesian3(10, 10, 10),
  2885. scale: options2.scale,
  2886. debugWireframe: false,
  2887. debugShowBoundingVolume: false
  2888. })
  2889. );
  2890. model.readyPromise.then(function() {
  2891. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  2892. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  2893. });
  2894. window[options2.id] = model;
  2895. if (callSuccess)
  2896. callSuccess(options2.id);
  2897. },
  2898. addPolylineByGeoJson(options2, callSuccess) {
  2899. let _self = this;
  2900. this._viewer;
  2901. if (!Cesium.defined(options2.url)) {
  2902. resolve("options.url is required.");
  2903. throw new Cesium.DeveloperError("options.url is required.");
  2904. }
  2905. options2 = options2 || {};
  2906. options2.id = options2.id || this._guid();
  2907. let promise = Cesium.GeoJsonDataSource.load(options2.url, {
  2908. clampToGround: options2.clampToGround
  2909. });
  2910. promise.then((dataSource) => {
  2911. _self._viewer.dataSources.add(dataSource);
  2912. dataSource.name = options2.id;
  2913. let entities2 = dataSource.entities.values;
  2914. let material = new PolylineDirectionMaterialProperty(options2);
  2915. for (var i2 = 0; i2 < entities2.length; i2++) {
  2916. var entity = entities2[i2];
  2917. entity.polyline.material = material;
  2918. entity.polyline.width = options2.width;
  2919. if (options2.clampToGround) {
  2920. entity.polyline.clampToGround = true;
  2921. }
  2922. }
  2923. if (callSuccess)
  2924. callSuccess(options2.id);
  2925. });
  2926. },
  2927. addPolylineByJson(options2, callSuccess) {
  2928. let _self = this;
  2929. let viewer2 = this._viewer;
  2930. if (!Cesium.defined(options2.url)) {
  2931. resolve("options.url is required.");
  2932. throw new Cesium.DeveloperError("options.url is required.");
  2933. }
  2934. options2 = options2 || {};
  2935. options2.id = options2.id || this._guid();
  2936. fetch(options2.url).then((res) => {
  2937. return res.json();
  2938. }).then((res) => {
  2939. let dataSource = new Cesium.CustomDataSource(options2.id);
  2940. viewer2.dataSources.add(dataSource);
  2941. for (var i2 = 0; i2 < res.features.length; i2++) {
  2942. if (res.features[i2].geometry) {
  2943. if (res.features[i2].geometry.type === "MultiLineString") {
  2944. let coordinatesList = res.features[i2].geometry.coordinates;
  2945. for (var j = 0; j < coordinatesList.length; j++) {
  2946. let coordinates = coordinatesList[j];
  2947. let positions = coordinates.map((point2) => {
  2948. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2949. });
  2950. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  2951. dataSource.entities.add(entity);
  2952. });
  2953. }
  2954. } else {
  2955. let coordinates = res.features[i2].geometry.coordinates;
  2956. let positions = coordinates.map((point2) => {
  2957. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2958. });
  2959. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  2960. dataSource.entities.add(entity);
  2961. });
  2962. }
  2963. }
  2964. }
  2965. if (callSuccess)
  2966. callSuccess(options2.id);
  2967. });
  2968. },
  2969. addBillboardByGeoJson(options2, callSuccess) {
  2970. let viewer2 = this._viewer;
  2971. if (!Cesium.defined(options2.url)) {
  2972. resolve("options.url is required.");
  2973. throw new Cesium.DeveloperError("options.url is required.");
  2974. }
  2975. options2 = options2 || {};
  2976. options2.id = options2.id || this._guid();
  2977. let billboard = options2.billboard || {};
  2978. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  2979. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  2980. billboard.pixelOffset = Cesium.defaultValue(billboard.pixelOffset, 0);
  2981. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  2982. dataSource.load(options2.url, {
  2983. clampToGround: true
  2984. }).then(function(data) {
  2985. viewer2.dataSources.add(data);
  2986. const entities2 = data.entities.values;
  2987. entities2.forEach((entity) => {
  2988. entity.billboard = {
  2989. image: billboard.imgUrl,
  2990. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  2991. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  2992. scale: billboard.scale,
  2993. pixelOffset: new Cesium.Cartesian2(0, billboard.pixelOffset),
  2994. disableDepthTestDistance: Number.POSITIVE_INFINITY
  2995. };
  2996. if (billboard.scaleByDistance) {
  2997. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  2998. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  2999. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  3000. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  3001. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  3002. }
  3003. if (options2.label) {
  3004. let label = options2.label || {};
  3005. label.text = Cesium.defaultValue(label.text, "");
  3006. label.textField = Cesium.defaultValue(label.textField, "");
  3007. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  3008. if (label.fillColor instanceof Array) {
  3009. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  3010. } else if (typeof options2.color === "string") {
  3011. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  3012. } else {
  3013. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  3014. }
  3015. if (label.outlineColor instanceof Array) {
  3016. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  3017. } else if (label.outlineColor instanceof String) {
  3018. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  3019. } else {
  3020. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3021. }
  3022. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  3023. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  3024. if (label.backgroundColor instanceof Array) {
  3025. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  3026. } else if (label.backgroundColor instanceof String) {
  3027. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  3028. } else {
  3029. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3030. }
  3031. label.pixelOffset = Cesium.defaultValue(label.pixelOffset, 0);
  3032. label.scale = Cesium.defaultValue(label.scale, 1);
  3033. label.near = Cesium.defaultValue(label.near, 150);
  3034. label.nearValue = Cesium.defaultValue(label.nearValue, 1);
  3035. label.far = Cesium.defaultValue(label.far, 2400);
  3036. label.farValue = Cesium.defaultValue(label.farValue, 0);
  3037. let labelText = label.text;
  3038. if (entity.properties[label.textField]) {
  3039. labelText = entity.properties[label.textField]._value;
  3040. }
  3041. if (labelText === "") {
  3042. labelText = (i + 1).toString();
  3043. }
  3044. entity.label = {
  3045. text: labelText.toString(),
  3046. font: label.font,
  3047. fillColor: label.fillColor,
  3048. outlineColor: label.outlineColor,
  3049. outlineWidth: label.outlineWidth,
  3050. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  3051. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  3052. showBackground: label.showBackground,
  3053. backgroundColor: label.backgroundColor,
  3054. backgroundPadding: new Cesium.Cartesian2(6, 6),
  3055. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  3056. pixelOffset: new Cesium.Cartesian2(0, label.pixelOffset),
  3057. scale: label.scale
  3058. };
  3059. if (label.scaleByDistance) {
  3060. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  3061. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  3062. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  3063. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  3064. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  3065. }
  3066. }
  3067. });
  3068. if (callSuccess)
  3069. callSuccess(options2.id);
  3070. });
  3071. },
  3072. addBillboardByJson(options2, callSuccess) {
  3073. let _self = this;
  3074. let viewer2 = this._viewer;
  3075. if (!Cesium.defined(options2.url)) {
  3076. resolve("options.url is required.");
  3077. throw new Cesium.DeveloperError("options.url is required.");
  3078. }
  3079. options2 = options2 || {};
  3080. let id = options2.id || this._guid();
  3081. fetch(options2.url).then((res) => {
  3082. return res.json();
  3083. }).then((res) => {
  3084. let dataSource = new Cesium.CustomDataSource(options2.id);
  3085. viewer2.dataSources.add(dataSource);
  3086. let promiseList = [];
  3087. for (var i2 = 0; i2 < res.features.length; i2++) {
  3088. let geometry2 = res.features[i2].geometry;
  3089. let properties = res.features[i2].properties;
  3090. if (geometry2) {
  3091. if (properties) {
  3092. options2.properties = properties;
  3093. if (options2.label) {
  3094. let label = options2.label || {};
  3095. if (properties[label.textField]) {
  3096. options2.label.text = properties[label.textField];
  3097. }
  3098. }
  3099. }
  3100. if (geometry2.type === "MultiPoint") {
  3101. let coordinatesList = geometry2.coordinates;
  3102. for (var j = 0; j < coordinatesList.length; j++) {
  3103. let coordinates = coordinatesList[j];
  3104. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3105. let result = _self._pointObject.addBillboard(position2, options2);
  3106. promiseList.push(result);
  3107. }
  3108. } else {
  3109. let coordinates = geometry2.coordinates;
  3110. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3111. let result = _self._pointObject.addBillboard(position2, options2);
  3112. promiseList.push(result);
  3113. }
  3114. }
  3115. }
  3116. Promise.all(promiseList).then((itemList) => {
  3117. console.log("itemList", itemList);
  3118. itemList.forEach((item, index2) => {
  3119. dataSource.entities.add(item);
  3120. });
  3121. if (callSuccess)
  3122. callSuccess(id);
  3123. });
  3124. });
  3125. },
  3126. addWallByJson(options2, callSuccess) {
  3127. let _self = this;
  3128. let viewer2 = this._viewer;
  3129. if (!Cesium.defined(options2.url)) {
  3130. resolve("options.url is required.");
  3131. throw new Cesium.DeveloperError("options.url is required.");
  3132. }
  3133. options2 = options2 || {};
  3134. options2.id = options2.id || setSessionid();
  3135. fetch(options2.url).then((res) => {
  3136. return res.json();
  3137. }).then((res) => {
  3138. let dataSource = new Cesium.CustomDataSource(options2.id);
  3139. viewer2.dataSources.add(dataSource);
  3140. for (var i2 = 0; i2 < res.features.length; i2++) {
  3141. if (res.features[i2].geometry) {
  3142. if (res.features[i2].geometry.type === "MultiLineString") {
  3143. let coordinatesList = res.features[i2].geometry.coordinates;
  3144. for (var j = 0; j < coordinatesList.length; j++) {
  3145. let coordinates = coordinatesList[j];
  3146. let positions = coordinates.map((point2) => {
  3147. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3148. });
  3149. _self._wallObject.addWall(positions, options2).then((entity) => {
  3150. dataSource.entities.add(entity);
  3151. });
  3152. }
  3153. } else {
  3154. let coordinates = res.features[i2].geometry.coordinates;
  3155. let positions = coordinates.map((point2) => {
  3156. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3157. });
  3158. _self._wallObject.addWall(positions, options2).then((entity) => {
  3159. dataSource.entities.add(entity);
  3160. });
  3161. }
  3162. }
  3163. }
  3164. if (callSuccess)
  3165. callSuccess(options2.id);
  3166. });
  3167. }
  3168. });
  3169. Object.assign(LoadMapData.prototype, {
  3170. set3DTileStyle(options2) {
  3171. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3172. throw new Cesium.DeveloperError("options.serviceId is required.");
  3173. }
  3174. if (Cesium.defined(options2.alpha)) {
  3175. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3176. }
  3177. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3178. let tileset = window[options2.serviceId];
  3179. tileset.style = new Cesium.Cesium3DTileStyle({
  3180. color: "color('rgba(255,255,255," + options2.alpha + ")')"
  3181. });
  3182. },
  3183. set3DTileBMStyle: function(options2) {
  3184. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3185. throw new Cesium.DeveloperError("options.serviceId is required.");
  3186. }
  3187. options2.color = options2.color ? "vec4(" + options2.color[0] + "/255, " + options2.color[1] + "/255, " + options2.color[2] + "/255, " + options2.color[3] + ")" : "vec4(0.0, 0.58, 0.86, 1.0)";
  3188. let tileset = window[options2.serviceId];
  3189. tileset.readyPromise.then((tileset2) => {
  3190. tileset2.boundingSphere.radius;
  3191. if (tileset2.boundingSphere.radius > 1e4) {
  3192. tileset2.boundingSphere.radius / 10;
  3193. }
  3194. tileset2.style = new Cesium.Cesium3DTileStyle({
  3195. color: options2.color
  3196. });
  3197. tileset2.tileVisible.addEventListener((tile) => {
  3198. let content = tile.content;
  3199. let featuresLength = content.featuresLength;
  3200. for (let i2 = 0; i2 < featuresLength; i2 += 2) {
  3201. const feature2 = content.getFeature(i2);
  3202. const model = feature2.content._model;
  3203. if (model && model._sourcePrograms && model._rendererResources) {
  3204. Object.keys(model._sourcePrograms).forEach((key) => {
  3205. const program = model._sourcePrograms[key];
  3206. const fragmentShader = model._rendererResources.sourceShaders[program.fragmentShader];
  3207. let vPosition = "";
  3208. if (fragmentShader.indexOf(" v_positionEC;") !== -1) {
  3209. vPosition = "v_positionEC";
  3210. } else if (fragmentShader.indexOf(" v_pos;") !== -1) {
  3211. vPosition = "v_pos";
  3212. }
  3213. const color2 = `vec4(${feature2.color.toString()})`;
  3214. model._rendererResources.sourceShaders[program.fragmentShader] = `
  3215. varying vec3 ${vPosition};
  3216. void main(void){
  3217. vec4 v_helsing_position = czm_inverseModelView * vec4(${vPosition},1);
  3218. float _baseHeight = -30.0;
  3219. float vtxf_height = v_helsing_position.z - _baseHeight;
  3220. float stc_pl = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;
  3221. float stc_sd = vtxf_height / 30.0 + sin(stc_pl) * 0.1;
  3222. gl_FragColor = ${color2};
  3223. gl_FragColor *= vec4(stc_sd, stc_sd, stc_sd, 1.0);
  3224. /* \u626B\u63CF\u7EBF */
  3225. float glowRange = 80.0;
  3226. float stc_a13 = fract(czm_frameNumber / 460.0);
  3227. float stc_h = clamp(v_helsing_position.z / glowRange, 0.0, 1.0);
  3228. stc_a13 = abs(stc_a13 - 0.5) * 1.0;
  3229. float stc_diff = step(0.003, abs(stc_h - stc_a13));
  3230. gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - stc_diff);
  3231. }
  3232. `;
  3233. });
  3234. model._shouldRegenerateShaders = true;
  3235. }
  3236. }
  3237. });
  3238. });
  3239. this._viewer.scene.requestRender();
  3240. },
  3241. set3DTilePosition: function(options2) {
  3242. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3243. throw new Cesium.DeveloperError("options.serviceId is required.");
  3244. }
  3245. options2.height = Cesium.defaultValue(options2.height, 0);
  3246. let boundingSphere = window[options2.serviceId].boundingSphere;
  3247. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  3248. let left = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, options2.height);
  3249. let right = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0);
  3250. let translation = Cesium.Cartesian3.subtract(left, right, new Cesium.Cartesian3());
  3251. window[options2.serviceId].modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  3252. this._viewer.scene.requestRender();
  3253. },
  3254. setLayersStyle(options2) {
  3255. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3256. throw new Cesium.DeveloperError("options.serviceId is required.");
  3257. }
  3258. let layer = window[options2.serviceId];
  3259. if (Cesium.defined(options2.alpha)) {
  3260. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3261. }
  3262. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3263. layer.alpha = options2.alpha;
  3264. if (Cesium.defined(options2.brightness)) {
  3265. Cesium.Check.typeOf.number("brightness", options2.brightness);
  3266. }
  3267. options2.brightness = Cesium.defaultValue(options2.brightness, 1);
  3268. layer.brightness = options2.brightness;
  3269. if (Cesium.defined(options2.contrast)) {
  3270. Cesium.Check.typeOf.number("contrast", options2.contrast);
  3271. }
  3272. options2.contrast = Cesium.defaultValue(options2.contrast, 1);
  3273. layer.contrast = options2.contrast;
  3274. if (Cesium.defined(options2.gamma)) {
  3275. Cesium.Check.typeOf.number("gamma", options2.gamma);
  3276. }
  3277. options2.gamma = Cesium.defaultValue(options2.gamma, 1);
  3278. layer.gamma = options2.gamma;
  3279. if (Cesium.defined(options2.hue)) {
  3280. Cesium.Check.typeOf.number("hue", options2.hue);
  3281. }
  3282. options2.hue = Cesium.defaultValue(options2.hue, 0);
  3283. layer.hue = options2.hue;
  3284. if (Cesium.defined(options2.saturation)) {
  3285. Cesium.Check.typeOf.number("saturation", options2.saturation);
  3286. }
  3287. options2.saturation = Cesium.defaultValue(options2.saturation, 1);
  3288. layer.saturation = options2.saturation;
  3289. },
  3290. setPolygonImageMaterial(options2) {
  3291. if (Cesium.defined(options2.alpha)) {
  3292. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3293. }
  3294. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3295. let entity = window[options2.serviceId];
  3296. entity.polygon.material.color._value.alpha = options2.alpha;
  3297. },
  3298. setModelStyle(options2) {
  3299. if (Cesium.defined(options2.alpha)) {
  3300. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3301. }
  3302. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3303. let entity = window[options2.serviceId];
  3304. if (entity.model) {
  3305. entity.model.color._value.alpha = options2.alpha;
  3306. } else {
  3307. entity.color._value.alpha = options2.alpha;
  3308. }
  3309. },
  3310. setTerrainExaggeration(options2) {
  3311. if (Cesium.defined(options2.terrainExaggeration)) {
  3312. Cesium.Check.typeOf.number("terrainExaggeration", options2.terrainExaggeration);
  3313. }
  3314. options2.terrainExaggeration = Cesium.defaultValue(options2.terrainExaggeration, 1);
  3315. this._viewer.scene.globe.terrainExaggeration = options2.terrainExaggeration;
  3316. }
  3317. });
  3318. Object.assign(LoadMapData.prototype, {
  3319. removeImageryProvider(options2) {
  3320. return new Promise((resolve2, reject2) => {
  3321. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3322. throw new Cesium.DeveloperError("options.serviceId is required.");
  3323. }
  3324. this._removeImageryProvider(options2.serviceId);
  3325. resolve2(true);
  3326. });
  3327. },
  3328. removeTerrain() {
  3329. return new Promise((resolve2, reject2) => {
  3330. this._setEllipsoidTerrain();
  3331. resolve2(true);
  3332. });
  3333. },
  3334. removeScenePrimitives(options2) {
  3335. return new Promise((resolve2, reject2) => {
  3336. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3337. throw new Cesium.DeveloperError("options.serviceId is required.");
  3338. }
  3339. this._removeScenePrimitives(options2.serviceId);
  3340. resolve2(true);
  3341. });
  3342. },
  3343. removeEntity(options2) {
  3344. return new Promise((resolve2, reject2) => {
  3345. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3346. throw new Cesium.DeveloperError("options.serviceId is required.");
  3347. }
  3348. this._viewer.entities.remove(window[options2.serviceId]);
  3349. window[options2.serviceId] = null;
  3350. resolve2(true);
  3351. });
  3352. },
  3353. removeDataSources(options2) {
  3354. let viewer2 = this._viewer;
  3355. return new Promise((resolve2, reject2) => {
  3356. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3357. throw new Cesium.DeveloperError("options.serviceId is required.");
  3358. }
  3359. let list = viewer2.dataSources.getByName(options2.serviceId);
  3360. list.forEach((res, index2) => {
  3361. viewer2.dataSources.remove(res);
  3362. if (index2 === list.length - 1) {
  3363. resolve2(true);
  3364. }
  3365. });
  3366. });
  3367. }
  3368. });
  3369. Date.prototype.Format = function(fmt) {
  3370. var o = {
  3371. "M+": this.getMonth() + 1,
  3372. "d+": this.getDate(),
  3373. "h+": this.getHours(),
  3374. "m+": this.getMinutes(),
  3375. "s+": this.getSeconds(),
  3376. "q+": Math.floor((this.getMonth() + 3) / 3),
  3377. "S": this.getMilliseconds()
  3378. };
  3379. if (/(y+)/.test(fmt))
  3380. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  3381. for (var k in o)
  3382. if (new RegExp("(" + k + ")").test(fmt))
  3383. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
  3384. return fmt;
  3385. };
  3386. class CrImageServerLayer {
  3387. constructor({
  3388. viewer: viewer2,
  3389. url,
  3390. opacity = 0.75,
  3391. show = true
  3392. } = {}) {
  3393. this._viewer = viewer2;
  3394. this._url = url;
  3395. this._opacity = opacity;
  3396. this._renderName = this._guid();
  3397. let dataSource = new Cesium.CustomDataSource(this._renderName);
  3398. this._viewer.dataSources.add(dataSource);
  3399. this._entities = dataSource.entities;
  3400. this._renderEntities = /* @__PURE__ */ new Map();
  3401. this._isUpdateTile = show;
  3402. this._isDebug = false;
  3403. this._init();
  3404. }
  3405. _init() {
  3406. let _self = this;
  3407. this._provider = new Cesium.ArcGisMapServerImageryProvider({
  3408. url: _self._url
  3409. });
  3410. this._provider.readyPromise.then(function(result) {
  3411. _self._rectangle = _self._provider.rectangle;
  3412. if (_self._isDebug)
  3413. _self._printDebug();
  3414. _self._viewer.scene.postRender.addEventListener(() => {
  3415. if (_self._isUpdateTile) {
  3416. _self._isUpdateTile = false;
  3417. _self._renderTiles();
  3418. }
  3419. });
  3420. });
  3421. }
  3422. _guid() {
  3423. function S4() {
  3424. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  3425. }
  3426. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  3427. }
  3428. _printDebug() {
  3429. this._provider.tilingScheme;
  3430. let tiling84 = new Cesium.GeographicTilingScheme();
  3431. this._drawDebugRectangle(this._rectangle, Cesium.Color.GREEN);
  3432. tiling84.tileXYToRectangle(1696, 312, 10);
  3433. }
  3434. _drawDebugRectangle(rectangle, color2) {
  3435. let positions = this._calculateRectangleOutlineCoordinates(rectangle);
  3436. let rectEntity = new Cesium.Entity({
  3437. name: this._renderName,
  3438. polyline: {
  3439. positions,
  3440. material: color2,
  3441. width: 10,
  3442. clampToGround: true
  3443. }
  3444. });
  3445. this._entities.add(rectEntity);
  3446. }
  3447. _console(...rest) {
  3448. if (this._isDebug)
  3449. console.log("===" + new Date().Format("yyyy-MM-dd HH:mm:ss") + ">>>", rest);
  3450. }
  3451. _renderTiles() {
  3452. let _self = this;
  3453. let tilesToRender = this._viewer.scene.globe._surface._tilesToRender;
  3454. if (tilesToRender === void 0 || tilesToRender.length === 0) {
  3455. this._isUpdateTile = true;
  3456. return;
  3457. } else {
  3458. new Promise((resolve2, reject2) => {
  3459. tilesToRender.sort(function(obj1, obj2) {
  3460. let level1 = parseInt(obj1.level);
  3461. let level2 = parseInt(obj2.level);
  3462. return level1 - level2;
  3463. });
  3464. resolve2(tilesToRender);
  3465. }).then((tiles) => {
  3466. _self._asyncProjectionTiles(tiles);
  3467. });
  3468. }
  3469. }
  3470. _createKey(x, y, level) {
  3471. let key = `${this._renderName}_${x}_${y}_${level}`;
  3472. return key;
  3473. }
  3474. _asyncProjectionTiles(tiles) {
  3475. let renderTiles = [];
  3476. for (let tile of tiles) {
  3477. let proTiles = this._projectionTile(tile);
  3478. for (let proTile of proTiles) {
  3479. let key = this._createKey(proTile.x, proTile.y, proTile.level);
  3480. let subTile = renderTiles.find((obj) => {
  3481. return obj.x === proTile.x && obj.y === proTile.y;
  3482. });
  3483. if (subTile === void 0) {
  3484. let isExists = false;
  3485. for (let eTile of renderTiles) {
  3486. if (Cesium.Rectangle.intersection(eTile.rectangle, proTile.rectangle)) {
  3487. eTile.childTiles.push(key);
  3488. isExists = true;
  3489. break;
  3490. }
  3491. }
  3492. if (!isExists) {
  3493. renderTiles.push({
  3494. key,
  3495. x: proTile.x,
  3496. y: proTile.y,
  3497. level: proTile.level,
  3498. rectangle: proTile.rectangle,
  3499. childTiles: []
  3500. });
  3501. }
  3502. }
  3503. }
  3504. }
  3505. let i2 = renderTiles.length;
  3506. let appendTiles = [];
  3507. while (i2--) {
  3508. let findTile = renderTiles[i2];
  3509. if (findTile.childTiles.length >= 1) {
  3510. let tiles2 = this._createFourTiles(findTile);
  3511. for (let tile of tiles2) {
  3512. appendTiles.push(tile);
  3513. }
  3514. renderTiles.splice(i2, 1);
  3515. }
  3516. }
  3517. for (let appendTile of appendTiles) {
  3518. renderTiles.push(appendTile);
  3519. }
  3520. renderTiles.sort(function(obj1, obj2) {
  3521. let level1 = parseInt(obj1.level);
  3522. let level2 = parseInt(obj2.level);
  3523. return level1 - level2;
  3524. });
  3525. this._renderTilesToViewer(renderTiles);
  3526. }
  3527. _createTileByRectangleAndLevel(rectangle, level) {
  3528. let center2 = Cesium.Rectangle.center(rectangle);
  3529. let nLevel = parseInt(level) + 1;
  3530. let query = this._provider.tilingScheme.positionToTileXY(center2, nLevel);
  3531. if (query === void 0)
  3532. return void 0;
  3533. return {
  3534. key: this._createKey(query.x, query.y, nLevel),
  3535. x: query.x,
  3536. y: query.y,
  3537. level: nLevel,
  3538. rectangle,
  3539. childTiles: []
  3540. };
  3541. }
  3542. _createFourTiles(tile) {
  3543. let rects = [];
  3544. let results = [];
  3545. let rectangle = tile.rectangle;
  3546. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0, 0.5, 0.5));
  3547. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0, 1, 0.5));
  3548. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0.5, 0.5, 1));
  3549. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0.5, 1, 1));
  3550. for (let rect of rects) {
  3551. if (Cesium.Rectangle.intersection(rect, this._rectangle)) {
  3552. let newTile = this._createTileByRectangleAndLevel(rect, tile.level);
  3553. if (newTile !== void 0)
  3554. results.push(newTile);
  3555. }
  3556. }
  3557. return results;
  3558. }
  3559. _renderTilesToViewer(tiles) {
  3560. let _self = this;
  3561. let deleteKeys = [];
  3562. for (let [key, tile] of this._renderEntities) {
  3563. let findTile = tiles.find((obj) => {
  3564. return obj.key === key;
  3565. });
  3566. if (findTile === void 0) {
  3567. deleteKeys.push(key);
  3568. }
  3569. }
  3570. for (let key of deleteKeys) {
  3571. this._renderEntities.delete(key);
  3572. this._entities.removeById(key);
  3573. }
  3574. for (let tile of tiles) {
  3575. if (!this._renderEntities.has(tile.key)) {
  3576. let entity = this._renderSimpleTileToViewer(tile);
  3577. this._renderEntities.set(tile.key, entity);
  3578. let workBlob = new Blob([`(${downloadWorker.toString()})()`]);
  3579. let worker = new Worker(URL.createObjectURL(workBlob));
  3580. worker.postMessage({
  3581. key: tile.key,
  3582. url: this._url,
  3583. x: tile.x,
  3584. y: tile.y,
  3585. level: tile.level
  3586. });
  3587. worker.onmessage = function(event2) {
  3588. _self._console(`render x:${event2.data.x} y:${event2.data.y} level:${event2.data.level}`);
  3589. let renderEntity = _self._entities.getById(event2.data.key);
  3590. if (renderEntity !== void 0) {
  3591. event2.data.key;
  3592. const canvas = _self._createCanvas(event2.data, event2.data.image, _self._isDebug);
  3593. renderEntity.rectangle.material = canvas;
  3594. }
  3595. worker.terminate();
  3596. };
  3597. }
  3598. }
  3599. this._isUpdateTile = true;
  3600. }
  3601. _renderSimpleTileToViewer(tile) {
  3602. const canvas = this._createCanvas(tile, void 0, this._isDebug);
  3603. let bjPositions = this._calculateRectangleOutlineCoordinates(tile.rectangle);
  3604. let tileEntity = new Cesium.Entity({
  3605. name: this._renderName,
  3606. id: tile.key,
  3607. rectangle: {
  3608. coordinates: tile.rectangle,
  3609. material: canvas
  3610. },
  3611. polyline: {
  3612. positions: bjPositions,
  3613. material: Cesium.Color.YELLOW.withAlpha(this._isDebug ? 1 : 0),
  3614. width: 1,
  3615. clampToGround: true
  3616. }
  3617. });
  3618. return this._entities.add(tileEntity);
  3619. }
  3620. _createCanvas(tile, image, islabel) {
  3621. let provider = this._provider;
  3622. const canvas = document.createElement("canvas");
  3623. canvas.width = provider.tileWidth;
  3624. canvas.height = provider.tileHeight;
  3625. const context = canvas.getContext("2d");
  3626. if (image !== void 0) {
  3627. context.globalAlpha = this._opacity;
  3628. context.drawImage(event.data.image, 0, 0, canvas.width, canvas.height);
  3629. }
  3630. if (islabel !== void 0 && islabel === true) {
  3631. context.globalAlpha = 1;
  3632. context.font = "20px Arial";
  3633. context.textAlign = "center";
  3634. context.fillStyle = "rgba(255,255,0)";
  3635. context.strokeStyle = "rgba(255,255,255,1)";
  3636. context.lineWidth = 2;
  3637. context.strokeText(`L: ${tile.level}`, 126, 86);
  3638. context.fillText(`L: ${tile.level}`, 126, 86);
  3639. context.strokeText(`X: ${tile.x}`, 126, 136);
  3640. context.fillText(`X: ${tile.x}`, 126, 136);
  3641. context.strokeText(`Y: ${tile.y}`, 126, 186);
  3642. context.fillText(`Y: ${tile.y}`, 126, 186);
  3643. }
  3644. return canvas;
  3645. }
  3646. _projectionTile(tile) {
  3647. let rectangle = tile._rectangle;
  3648. let imageryLevel = parseInt(tile.level);
  3649. let mercatorTilingScheme = this._provider.tilingScheme;
  3650. let res = [];
  3651. let interRectangle = Cesium.Rectangle.intersection(rectangle, this._rectangle);
  3652. if (interRectangle === void 0)
  3653. return res;
  3654. let northwestTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3655. Cesium.Rectangle.northwest(rectangle),
  3656. imageryLevel
  3657. );
  3658. let southeastTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3659. Cesium.Rectangle.southeast(rectangle),
  3660. imageryLevel
  3661. );
  3662. if (northwestTileCoordinates !== void 0 && southeastTileCoordinates !== void 0) {
  3663. for (let i2 = northwestTileCoordinates.x; i2 <= southeastTileCoordinates.x; i2++) {
  3664. for (let j = northwestTileCoordinates.y; j <= southeastTileCoordinates.y; j++) {
  3665. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(i2, j, imageryLevel);
  3666. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3667. res.push({
  3668. x: i2,
  3669. y: j,
  3670. level: imageryLevel,
  3671. rectangle: _webRectangle
  3672. });
  3673. }
  3674. }
  3675. }
  3676. } else if (northwestTileCoordinates !== void 0) {
  3677. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3678. northwestTileCoordinates.x,
  3679. northwestTileCoordinates.y,
  3680. imageryLevel
  3681. );
  3682. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3683. res.push({
  3684. x: northwestTileCoordinates.x,
  3685. y: northwestTileCoordinates.y,
  3686. level: imageryLevel,
  3687. rectangle: _webRectangle
  3688. });
  3689. }
  3690. } else if (southeastTileCoordinates !== void 0) {
  3691. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3692. southeastTileCoordinates.x,
  3693. southeastTileCoordinates.y,
  3694. imageryLevel
  3695. );
  3696. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3697. res.push({
  3698. x: southeastTileCoordinates.x,
  3699. y: southeastTileCoordinates.y,
  3700. level: imageryLevel,
  3701. rectangle: _webRectangle
  3702. });
  3703. }
  3704. }
  3705. return res;
  3706. }
  3707. _calculateRectangleOutlineCoordinates(rectangle) {
  3708. let south_east = Cesium.Rectangle.southeast(rectangle);
  3709. let se2 = Cesium.Cartographic.toCartesian(south_east);
  3710. let south_west = Cesium.Rectangle.southwest(rectangle);
  3711. let sw = Cesium.Cartographic.toCartesian(south_west);
  3712. let north_east = Cesium.Rectangle.northeast(rectangle);
  3713. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  3714. let north_west = Cesium.Rectangle.northwest(rectangle);
  3715. let nw = Cesium.Cartographic.toCartesian(north_west);
  3716. return [sw, se2, ne2, nw, sw];
  3717. }
  3718. _removeEntityByName(entityName) {
  3719. var entities2 = this._entities;
  3720. if (!entities2 || !entities2.values)
  3721. return;
  3722. var delEntitys = [];
  3723. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  3724. if (entities2.values[i2].name == entityName) {
  3725. delEntitys.push(entities2.values[i2]);
  3726. }
  3727. }
  3728. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  3729. entities2.remove(delEntitys[i2]);
  3730. }
  3731. }
  3732. }
  3733. Object.assign(CrImageServerLayer.prototype, {
  3734. hide: function() {
  3735. this._console("\u9690\u85CF");
  3736. this._isUpdateTile = false;
  3737. this._removeEntityByName(this._renderName);
  3738. this._renderEntities.clear();
  3739. },
  3740. show: function() {
  3741. this._console("\u663E\u793A");
  3742. this._isUpdateTile = true;
  3743. },
  3744. setOpacity: function(opacity) {
  3745. if (opacity === void 0 || typeof opacity !== "number")
  3746. return;
  3747. if (opacity >= 1)
  3748. this._opacity = 1;
  3749. if (opacity <= 0)
  3750. this._opacity = 0;
  3751. this._opacity = parseFloat(opacity);
  3752. }
  3753. });
  3754. function downloadWorker() {
  3755. onmessage = function(event2) {
  3756. let data = event2.data;
  3757. let url = data.url + "/tile/" + data.level + "/" + data.y + "/" + data.x;
  3758. let xhr = new XMLHttpRequest();
  3759. xhr.open("get", url, true);
  3760. xhr.responseType = "blob";
  3761. xhr.onload = function() {
  3762. if (this.status === 200) {
  3763. var blob = this.response;
  3764. var bmpPromise = createImageBitmap(blob, {
  3765. imageOrientation: "none",
  3766. premultiplyAlpha: "none",
  3767. colorSpaceConversion: "default"
  3768. });
  3769. bmpPromise.then(function(image) {
  3770. let outObj = {
  3771. key: data.key,
  3772. x: data.x,
  3773. y: data.y,
  3774. level: data.level,
  3775. image
  3776. };
  3777. postMessage(outObj);
  3778. });
  3779. } else {
  3780. console.log("===>>>", url + " Not found");
  3781. }
  3782. };
  3783. xhr.send();
  3784. };
  3785. }
  3786. class LocateUtil {
  3787. constructor(viewer2) {
  3788. if (!viewer2)
  3789. throw new Cesium.DeveloperError("no viewer object!");
  3790. this._viewer = viewer2;
  3791. this._locationEntity = null;
  3792. }
  3793. }
  3794. Object.assign(LocateUtil.prototype, {
  3795. flyToPoint: function(options2) {
  3796. return new Promise((resolve2, reject2) => {
  3797. if (!Cesium.defined(options2) || !Cesium.defined(options2.longitude) || !Cesium.defined(options2.latitude)) {
  3798. throw new Cesium.DeveloperError("options.longitude and options.latitude are required.");
  3799. }
  3800. options2.height = Cesium.defaultValue(options2.height, 0);
  3801. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3802. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3803. options2.range = Cesium.defaultValue(options2.range, 0);
  3804. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3805. var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(options2.longitude, options2.latitude, options2.height), 0);
  3806. this._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3807. duration: options2.duration,
  3808. complete: function() {
  3809. resolve2(true);
  3810. },
  3811. offset: {
  3812. heading: Cesium.Math.toRadians(options2.heading),
  3813. pitch: Cesium.Math.toRadians(options2.pitch),
  3814. range: options2.range
  3815. }
  3816. });
  3817. });
  3818. },
  3819. flyToEntityByPoints: function(points2, type2, options2) {
  3820. return new Promise((resolve2, reject2) => {
  3821. let _self = this;
  3822. options2 = options2 || {};
  3823. if (points2 === void 0 || points2.length === void 0) {
  3824. reject2("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  3825. return;
  3826. }
  3827. let pointsArray = points2.map((point2) => {
  3828. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3829. });
  3830. if (_self._locationEntity) {
  3831. _self._viewer.entities.remove(_self._locationEntity);
  3832. }
  3833. switch (type2) {
  3834. case "point":
  3835. _self._locationEntity = _self._viewer.entities.add({
  3836. position: pointsArray[0],
  3837. point: {
  3838. pixelSize: 1
  3839. }
  3840. });
  3841. break;
  3842. case "polyline":
  3843. if (pointsArray.length < 2) {
  3844. reject2("\u7EBF\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  3845. } else {
  3846. _self._locationEntity = _self._viewer.entities.add({
  3847. polyline: {
  3848. positions: pointsArray,
  3849. clampToGround: true,
  3850. material: new Cesium.Color(255, 0, 0, 0.5),
  3851. width: 1
  3852. }
  3853. });
  3854. }
  3855. break;
  3856. case "polygon":
  3857. if (pointsArray.length < 3) {
  3858. reject2("\u9762\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  3859. } else {
  3860. _self._locationEntity = _self._viewer.entities.add({
  3861. polygon: {
  3862. hierarchy: {
  3863. positions: pointsArray
  3864. },
  3865. material: new Cesium.Color(255, 0, 0, 0.5),
  3866. outline: true
  3867. }
  3868. });
  3869. }
  3870. break;
  3871. default:
  3872. reject2("\u5750\u6807\u5F02\u5E38\uFF01");
  3873. break;
  3874. }
  3875. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3876. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3877. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3878. options2.range = Cesium.defaultValue(options2.range, 0);
  3879. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3880. duration: options2.duration,
  3881. offset: {
  3882. heading: Cesium.Math.toRadians(options2.heading),
  3883. pitch: Cesium.Math.toRadians(options2.pitch),
  3884. range: options2.range
  3885. }
  3886. });
  3887. flyPromise.then(function(flag) {
  3888. if (flag) {
  3889. resolve2(_self._locationEntity);
  3890. }
  3891. });
  3892. });
  3893. },
  3894. flyToEntity: function(entity, options2) {
  3895. return new Promise((resolve2, reject2) => {
  3896. let _self = this;
  3897. options2 = options2 || {};
  3898. if (_self._locationEntity) {
  3899. _self._viewer.entities.remove(_self._locationEntity);
  3900. }
  3901. _self._locationEntity = entity;
  3902. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3903. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3904. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3905. options2.range = Cesium.defaultValue(options2.range, 0);
  3906. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3907. duration: options2.duration,
  3908. offset: {
  3909. heading: Cesium.Math.toRadians(options2.heading),
  3910. pitch: Cesium.Math.toRadians(options2.pitch),
  3911. range: options2.range
  3912. }
  3913. });
  3914. flyPromise.then(function(flag) {
  3915. if (flag) {
  3916. resolve2(_self._locationEntity);
  3917. }
  3918. });
  3919. });
  3920. },
  3921. zoomToTilesets(tileset, options2) {
  3922. return new Promise((resolve2, reject2) => {
  3923. let _self = this;
  3924. if (!Cesium.defined(tileset)) {
  3925. throw new Cesium.DeveloperError("tileset is required.");
  3926. }
  3927. options2 = options2 || {};
  3928. options2.heading = Cesium.defaultValue(options2.heading, 120);
  3929. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  3930. options2.range = Cesium.defaultValue(options2.range, 450);
  3931. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3932. let boundingSphere = tileset.boundingSphere;
  3933. _self._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3934. duration: options2.duration,
  3935. complete: function() {
  3936. resolve2(true);
  3937. },
  3938. offset: {
  3939. heading: Cesium.Math.toRadians(options2.heading),
  3940. pitch: Cesium.Math.toRadians(options2.pitch),
  3941. range: options2.range
  3942. }
  3943. });
  3944. });
  3945. },
  3946. flyToTileset(tileset, options2) {
  3947. return new Promise((resolve2, reject2) => {
  3948. let _self = this;
  3949. if (!Cesium.defined(tileset)) {
  3950. throw new Cesium.DeveloperError("tileset is required.");
  3951. }
  3952. options2 = options2 || {};
  3953. options2.heading = Cesium.defaultValue(options2.heading, 120);
  3954. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  3955. options2.range = Cesium.defaultValue(options2.range, 450);
  3956. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3957. let flyPromise = _self._viewer.flyTo(tileset, {
  3958. duration: options2.duration,
  3959. offset: {
  3960. heading: Cesium.Math.toRadians(options2.heading),
  3961. pitch: Cesium.Math.toRadians(options2.pitch),
  3962. range: options2.range
  3963. }
  3964. });
  3965. flyPromise.then(function(flag) {
  3966. if (flag) {
  3967. resolve2(true);
  3968. }
  3969. });
  3970. });
  3971. }
  3972. });
  3973. const CreateRemindertip = function(arr, position2, show) {
  3974. let tooltip2 = document.getElementById("toolTip");
  3975. let style, _x, _y, _color;
  3976. if (arr && typeof arr === "object") {
  3977. style = arr;
  3978. }
  3979. if (style && style.origin) {
  3980. style.origin === "center" && (_x = 15, _y = -12);
  3981. style.origin === "top" && (_x = 15, _y = -44);
  3982. style.origin === "bottom" && (_x = 15, _y = 20);
  3983. } else {
  3984. _x = 15, _y = 20;
  3985. }
  3986. if (style && style.color) {
  3987. style.color === "white" && (_color = "background: rgba(255, 255, 255, 0.8);color: black;");
  3988. style.color === "black" && (_color = "background: rgba(0, 0, 0, 0.65);color: white;");
  3989. style.color === "yellow" && (_color = "color: black;background-color: #ffcc33;border: 1px solid white;");
  3990. } else {
  3991. _color = "background: rgba(0, 0, 0, 0.65);color: white;";
  3992. }
  3993. if (!tooltip2) {
  3994. const viewerDom = document.getElementsByClassName("cesium-viewer")[0];
  3995. let elementbottom = document.createElement("div");
  3996. viewerDom.append(elementbottom);
  3997. let html = '<div id="toolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;' + _color + '"></div>';
  3998. viewerDom.insertAdjacentHTML("beforeend", html);
  3999. tooltip2 = document.getElementById("toolTip");
  4000. }
  4001. if (show) {
  4002. tooltip2.innerHTML = arr;
  4003. tooltip2.style.left = position2.x + _x + "px";
  4004. tooltip2.style.top = position2.y + _y + "px";
  4005. tooltip2.style.display = "block";
  4006. } else {
  4007. tooltip2.style.display = "none";
  4008. }
  4009. return {
  4010. tooltip: tooltip2,
  4011. style,
  4012. showAt: function(position3, text) {
  4013. this.tooltip.innerHTML = text;
  4014. if (this.style && this.style.origin) {
  4015. this.style.origin === "center" && (_x = 15, _y = -this.tooltip.offsetHeight / 2);
  4016. this.style.origin === "top" && (_x = 15, _y = -this.tooltip.offsetHeight - 20);
  4017. this.style.origin === "bottom" && (_x = 15, _y = 20);
  4018. } else {
  4019. _x = 15, _y = -this.tooltip.offsetHeight / 2;
  4020. }
  4021. this.tooltip.style.left = position3.x + _x + "px";
  4022. this.tooltip.style.top = position3.y + _y + "px";
  4023. this.tooltip.style.display = "block";
  4024. },
  4025. show: function(show2) {
  4026. if (show2) {
  4027. this.tooltip.style.display = "block";
  4028. } else {
  4029. this.tooltip.style.display = "none";
  4030. }
  4031. }
  4032. };
  4033. };
  4034. class SightLine {
  4035. constructor(viewer2) {
  4036. if (!viewer2)
  4037. throw new Cesium.DeveloperError("no viewer object!");
  4038. this._viewer = viewer2;
  4039. this._resultObject = {
  4040. viewPoint: void 0,
  4041. targetPoints: [],
  4042. targetPoint: void 0,
  4043. objectExclude: [],
  4044. entities: []
  4045. };
  4046. }
  4047. _distance(point1, point2) {
  4048. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  4049. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  4050. let geodesic = new Cesium.EllipsoidGeodesic();
  4051. geodesic.setEndPoints(point1cartographic, point2cartographic);
  4052. let s = geodesic.surfaceDistance;
  4053. s = Math.sqrt(
  4054. Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2)
  4055. );
  4056. return s;
  4057. }
  4058. _checkAppOrWeb() {
  4059. if (window.navigator.userAgent.match(
  4060. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  4061. )) {
  4062. return SightLine.RuntimeEnvironment.App;
  4063. } else {
  4064. return SightLine.RuntimeEnvironment.Web;
  4065. }
  4066. }
  4067. _isRuntimeApp() {
  4068. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.App) {
  4069. return true;
  4070. }
  4071. return false;
  4072. }
  4073. _isRuntimeWeb() {
  4074. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.Web) {
  4075. return true;
  4076. }
  4077. return false;
  4078. }
  4079. _createOperationMainDom() {
  4080. let buttonDiv = document.createElement("div");
  4081. buttonDiv.id = "drawButtonDiv";
  4082. buttonDiv.style.width = "80px";
  4083. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  4084. buttonDiv.style.borderRadius = "5px";
  4085. buttonDiv.style.display = "flex";
  4086. buttonDiv.style.flexDirection = "column";
  4087. buttonDiv.style.padding = "8px";
  4088. buttonDiv.style.justifyContent = "center";
  4089. buttonDiv.style.position = "absolute";
  4090. buttonDiv.style.bottom = "150px";
  4091. buttonDiv.style.right = "10px";
  4092. let btnCompletion = document.createElement("button");
  4093. btnCompletion.id = "btnDrawComplete";
  4094. btnCompletion.style.height = "30px";
  4095. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  4096. btnCompletion.style.color = "rgb(255, 255, 255)";
  4097. btnCompletion.style.border = "0px solid red";
  4098. btnCompletion.style.borderRadius = "5px";
  4099. btnCompletion.innerHTML = "\u5B8C\u6210";
  4100. btnCompletion.style.fontSize = "13px";
  4101. btnCompletion.style.cursor = "pointer";
  4102. buttonDiv.appendChild(btnCompletion);
  4103. document.body.appendChild(buttonDiv);
  4104. }
  4105. _showTooltipMessage(message) {
  4106. let msgMainDom = document.getElementById("messageMainDom");
  4107. if (msgMainDom !== null && msgMainDom !== void 0) {
  4108. document.body.removeChild(msgMainDom);
  4109. }
  4110. msgMainDom = document.createElement("div");
  4111. msgMainDom.style.width = "30%";
  4112. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  4113. msgMainDom.style.height = "45px";
  4114. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  4115. msgMainDom.style.borderRadius = "8px";
  4116. msgMainDom.style.display = "flex";
  4117. msgMainDom.style.alignItems = "center";
  4118. msgMainDom.style.paddingLeft = "10px";
  4119. msgMainDom.style.color = "rgb(91, 188, 48)";
  4120. msgMainDom.style.fontSize = "14px";
  4121. msgMainDom.style.fontWeight = "600";
  4122. msgMainDom.style.position = "absolute";
  4123. msgMainDom.style.left = "35%";
  4124. msgMainDom.style.transition = "transform 1s";
  4125. msgMainDom.style.transform = "translateY(-90px)";
  4126. msgMainDom.style.top = "0px";
  4127. msgMainDom.style.zIndex = 1e3;
  4128. document.body.appendChild(msgMainDom);
  4129. let strHtml = "";
  4130. strHtml += "<div style='";
  4131. strHtml += "background-color: rgb(88, 185, 45);";
  4132. strHtml += "color: rgb(255, 255, 255);";
  4133. strHtml += "height: 24px;";
  4134. strHtml += "width: 24px;";
  4135. strHtml += "border-radius: 20px;";
  4136. strHtml += "display: flex;";
  4137. strHtml += "justify-content: center;";
  4138. strHtml += "align-items: center;";
  4139. strHtml += "font-size: 14px;";
  4140. strHtml += "margin-right: 18px;";
  4141. strHtml += "'>&#10003</div>";
  4142. strHtml += "<div>" + message + "</div>";
  4143. msgMainDom.innerHTML = strHtml;
  4144. msgMainDom.addEventListener("transitionend", function() {
  4145. setTimeout(function() {
  4146. document.body.removeChild(msgMainDom);
  4147. }, 1e3);
  4148. }, false);
  4149. setTimeout(function() {
  4150. msgMainDom.style.transform = "translateY(50px)";
  4151. }, 100);
  4152. }
  4153. }
  4154. Object.assign(SightLine.prototype, {
  4155. startSightLine() {
  4156. let _self = this;
  4157. _self.clearAll();
  4158. let toolTip = "\u5DE6\u952E\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4159. if (this._isRuntimeApp()) {
  4160. toolTip = "\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4161. _self._showTooltipMessage(toolTip);
  4162. }
  4163. _self.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  4164. _self.handler.setInputAction((event2) => {
  4165. let loc2 = CoordTransform._transfromFromScreenPoint(_self._viewer, event2.position);
  4166. toolTip = "\u5DE6\u952E\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u901A\u89C6\u5206\u6790";
  4167. if (this._isRuntimeApp()) {
  4168. toolTip = "\u518D\u6B21\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9";
  4169. _self._showTooltipMessage(toolTip);
  4170. }
  4171. if (!Cesium.defined(loc2.sLocation))
  4172. return;
  4173. let cartesian = loc2.sLocation;
  4174. if (!_self._resultObject.viewPoint) {
  4175. _self._resultObject.viewPoint = cartesian;
  4176. let pointEntity = _self._viewer.entities.add({
  4177. position: cartesian,
  4178. point: {
  4179. color: Cesium.Color.YELLOW,
  4180. pixelSize: 5
  4181. },
  4182. label: {
  4183. text: "\u89C2\u5BDF\u4F4D\u7F6E",
  4184. font: "12px sans-serif",
  4185. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4186. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4187. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4188. outlineWidth: 1,
  4189. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4190. pixelOffset: new Cesium.Cartesian2(0, -28),
  4191. showBackground: true,
  4192. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4193. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4194. }
  4195. });
  4196. _self._resultObject.objectExclude.push(pointEntity);
  4197. _self._resultObject.entities.push(pointEntity);
  4198. } else {
  4199. _self._resultObject.targetPoint = cartesian;
  4200. let pointEntity = _self._viewer.entities.add({
  4201. position: cartesian,
  4202. point: {
  4203. color: Cesium.Color.YELLOW,
  4204. pixelSize: 5
  4205. },
  4206. label: {
  4207. text: "\u76EE\u6807\u4F4D\u7F6E",
  4208. font: "12px sans-serif",
  4209. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4210. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4211. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4212. outlineWidth: 1,
  4213. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4214. pixelOffset: new Cesium.Cartesian2(0, -28),
  4215. showBackground: true,
  4216. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4217. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4218. }
  4219. });
  4220. _self._resultObject.objectExclude.push(pointEntity);
  4221. _self._resultObject.entities.push(pointEntity);
  4222. let direction = Cesium.Cartesian3.normalize(
  4223. Cesium.Cartesian3.subtract(
  4224. _self._resultObject.targetPoint,
  4225. _self._resultObject.viewPoint,
  4226. new Cesium.Cartesian3()
  4227. ),
  4228. new Cesium.Cartesian3()
  4229. );
  4230. let ray = new Cesium.Ray(_self._resultObject.viewPoint, direction);
  4231. let result = _self._viewer.scene.pickFromRay(ray, _self._resultObject.objectExclude);
  4232. if (result) {
  4233. let dis0 = _self._distance(
  4234. _self._resultObject.viewPoint,
  4235. _self._resultObject.targetPoint
  4236. );
  4237. let dis1 = _self._distance(
  4238. _self._resultObject.viewPoint,
  4239. result.position
  4240. );
  4241. let dis2 = _self._distance(
  4242. result.position,
  4243. _self._resultObject.targetPoint
  4244. );
  4245. console.log(dis0, dis1, dis2);
  4246. if (dis0 > dis1) {
  4247. let _poly0 = _self._viewer.entities.add({
  4248. polyline: {
  4249. positions: [_self._resultObject.viewPoint, result.position],
  4250. material: Cesium.Color.GREEN,
  4251. width: 3
  4252. }
  4253. });
  4254. _self._resultObject.entities.push(_poly0);
  4255. let _poly1 = _self._viewer.entities.add({
  4256. polyline: {
  4257. positions: [result.position, _self._resultObject.targetPoint],
  4258. material: Cesium.Color.RED,
  4259. width: 3
  4260. }
  4261. });
  4262. _self._resultObject.entities.push(_poly1);
  4263. _self._resultObject.targetPoints.push({
  4264. targetPoint: cartesian,
  4265. visual: false,
  4266. distance: [dis0, dis1, dis2]
  4267. });
  4268. } else {
  4269. let _poly2 = _self._viewer.entities.add({
  4270. polyline: {
  4271. positions: [
  4272. _self._resultObject.viewPoint,
  4273. _self._resultObject.targetPoint
  4274. ],
  4275. material: Cesium.Color.GREEN,
  4276. width: 3
  4277. }
  4278. });
  4279. _self._resultObject.entities.push(_poly2);
  4280. _self._resultObject.targetPoints.push({
  4281. targetPoint: cartesian,
  4282. visual: true,
  4283. distance: [dis0, dis1, dis2]
  4284. });
  4285. }
  4286. }
  4287. }
  4288. if (_self._resultObject.objectExclude.length === 2) {
  4289. if (this._isRuntimeApp()) {
  4290. _self._createOperationMainDom();
  4291. document.getElementById("btnDrawComplete").onclick = () => {
  4292. CreateRemindertip(toolTip, event2.endPosition, false);
  4293. _self.handler.destroy();
  4294. let buttonDiv = document.getElementById("drawButtonDiv");
  4295. if (buttonDiv) {
  4296. document.body.removeChild(buttonDiv);
  4297. }
  4298. };
  4299. }
  4300. }
  4301. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  4302. _self.handler.setInputAction(function(move) {
  4303. if (_self._isRuntimeApp())
  4304. return;
  4305. CreateRemindertip(toolTip, move.endPosition, true);
  4306. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  4307. _self.handler.setInputAction((event2) => {
  4308. CreateRemindertip(toolTip, event2.endPosition, false);
  4309. _self.handler.destroy();
  4310. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  4311. },
  4312. clearAll() {
  4313. this._resultObject.entities.forEach((element) => {
  4314. this._viewer.entities.remove(element);
  4315. });
  4316. this._resultObject = {
  4317. viewPoint: void 0,
  4318. targetPoints: [],
  4319. targetPoint: void 0,
  4320. objectExclude: [],
  4321. entities: []
  4322. };
  4323. if (this.handler) {
  4324. this.handler.destroy();
  4325. }
  4326. let buttonDiv = document.getElementById("drawButtonDiv");
  4327. if (buttonDiv) {
  4328. document.body.removeChild(buttonDiv);
  4329. }
  4330. }
  4331. });
  4332. SightLine.RuntimeEnvironment = Object.freeze({
  4333. App: "app",
  4334. Web: "web"
  4335. });
  4336. /*!
  4337. * author: [object Object]
  4338. * @sakitam-gis/kriging v0.1.0
  4339. * build-time: 2019-7-6 20:41
  4340. * LICENSE: MIT
  4341. * (c) 2019-2019 https://github.com/sakitam-gis/kriging.js
  4342. */
  4343. function max(source) {
  4344. return Math.max.apply(null, source);
  4345. }
  4346. function min(source) {
  4347. return Math.min.apply(null, source);
  4348. }
  4349. function rep(source, n) {
  4350. var array = [];
  4351. for (var i2 = 0; i2 < n; i2++) {
  4352. array.push(source);
  4353. }
  4354. return array;
  4355. }
  4356. function pip(source, x, y) {
  4357. var i2 = 0;
  4358. var j = source.length - 1;
  4359. var c = false;
  4360. var length = source.length;
  4361. for (; i2 < length; j = i2++) {
  4362. if (source[i2][1] > y !== source[j][1] > y && x < (source[j][0] - source[i2][0]) * (y - source[i2][1]) / (source[j][1] - source[i2][1]) + source[i2][0]) {
  4363. c = !c;
  4364. }
  4365. }
  4366. return c;
  4367. }
  4368. function matrixDiag(c, n) {
  4369. var i2 = 0;
  4370. var Z2 = rep(0, n * n);
  4371. for (; i2 < n; i2++) {
  4372. Z2[i2 * n + i2] = c;
  4373. }
  4374. return Z2;
  4375. }
  4376. function matrixTranspose(X2, n, m) {
  4377. var i2 = 0;
  4378. var j;
  4379. var Z2 = Array(m * n);
  4380. for (; i2 < n; i2++) {
  4381. j = 0;
  4382. for (; j < m; j++) {
  4383. Z2[j * n + i2] = X2[i2 * m + j];
  4384. }
  4385. }
  4386. return Z2;
  4387. }
  4388. function matrixAdd(X2, Y, n, m) {
  4389. var i2 = 0;
  4390. var j;
  4391. var Z2 = Array(n * m);
  4392. for (; i2 < n; i2++) {
  4393. j = 0;
  4394. for (; j < m; j++) {
  4395. Z2[i2 * m + j] = X2[i2 * m + j] + Y[i2 * m + j];
  4396. }
  4397. }
  4398. return Z2;
  4399. }
  4400. function matrixMultiply(X2, Y, n, m, p) {
  4401. var i2 = 0;
  4402. var j;
  4403. var k;
  4404. var Z2 = Array(n * p);
  4405. for (; i2 < n; i2++) {
  4406. j = 0;
  4407. for (; j < p; j++) {
  4408. Z2[i2 * p + j] = 0;
  4409. k = 0;
  4410. for (; k < m; k++) {
  4411. Z2[i2 * p + j] += X2[i2 * m + k] * Y[k * p + j];
  4412. }
  4413. }
  4414. }
  4415. return Z2;
  4416. }
  4417. function matrixChol(X2, n) {
  4418. var i2;
  4419. var j;
  4420. var k;
  4421. var p = Array(n);
  4422. for (i2 = 0; i2 < n; i2++)
  4423. p[i2] = X2[i2 * n + i2];
  4424. for (i2 = 0; i2 < n; i2++) {
  4425. for (j = 0; j < i2; j++)
  4426. p[i2] -= X2[i2 * n + j] * X2[i2 * n + j];
  4427. if (p[i2] <= 0)
  4428. return false;
  4429. p[i2] = Math.sqrt(p[i2]);
  4430. for (j = i2 + 1; j < n; j++) {
  4431. for (k = 0; k < i2; k++)
  4432. X2[j * n + i2] -= X2[j * n + k] * X2[i2 * n + k];
  4433. X2[j * n + i2] /= p[i2];
  4434. }
  4435. }
  4436. for (i2 = 0; i2 < n; i2++)
  4437. X2[i2 * n + i2] = p[i2];
  4438. return true;
  4439. }
  4440. function matrixChol2inv(X2, n) {
  4441. var i2;
  4442. var j;
  4443. var k;
  4444. var sum;
  4445. for (i2 = 0; i2 < n; i2++) {
  4446. X2[i2 * n + i2] = 1 / X2[i2 * n + i2];
  4447. for (j = i2 + 1; j < n; j++) {
  4448. sum = 0;
  4449. for (k = i2; k < j; k++)
  4450. sum -= X2[j * n + k] * X2[k * n + i2];
  4451. X2[j * n + i2] = sum / X2[j * n + j];
  4452. }
  4453. }
  4454. for (i2 = 0; i2 < n; i2++)
  4455. for (j = i2 + 1; j < n; j++)
  4456. X2[i2 * n + j] = 0;
  4457. for (i2 = 0; i2 < n; i2++) {
  4458. X2[i2 * n + i2] *= X2[i2 * n + i2];
  4459. for (k = i2 + 1; k < n; k++)
  4460. X2[i2 * n + i2] += X2[k * n + i2] * X2[k * n + i2];
  4461. for (j = i2 + 1; j < n; j++)
  4462. for (k = j; k < n; k++)
  4463. X2[i2 * n + j] += X2[k * n + i2] * X2[k * n + j];
  4464. }
  4465. for (i2 = 0; i2 < n; i2++)
  4466. for (j = 0; j < i2; j++)
  4467. X2[i2 * n + j] = X2[j * n + i2];
  4468. }
  4469. function matrixSolve(X2, n) {
  4470. var m = n;
  4471. var b = Array(n * n);
  4472. var indxc = Array(n);
  4473. var indxr = Array(n);
  4474. var ipiv = Array(n);
  4475. var i2;
  4476. var icol = 0;
  4477. var irow = 0;
  4478. var j;
  4479. var k;
  4480. var l;
  4481. var ll;
  4482. var big;
  4483. var dum;
  4484. var pivinv;
  4485. var temp;
  4486. for (i2 = 0; i2 < n; i2++) {
  4487. for (j = 0; j < n; j++) {
  4488. if (i2 === j)
  4489. b[i2 * n + j] = 1;
  4490. else
  4491. b[i2 * n + j] = 0;
  4492. }
  4493. }
  4494. for (j = 0; j < n; j++)
  4495. ipiv[j] = 0;
  4496. for (i2 = 0; i2 < n; i2++) {
  4497. big = 0;
  4498. for (j = 0; j < n; j++) {
  4499. if (ipiv[j] !== 1) {
  4500. for (k = 0; k < n; k++) {
  4501. if (ipiv[k] === 0) {
  4502. if (Math.abs(X2[j * n + k]) >= big) {
  4503. big = Math.abs(X2[j * n + k]);
  4504. irow = j;
  4505. icol = k;
  4506. }
  4507. }
  4508. }
  4509. }
  4510. }
  4511. ++ipiv[icol];
  4512. if (irow !== icol) {
  4513. for (l = 0; l < n; l++) {
  4514. temp = X2[irow * n + l];
  4515. X2[irow * n + l] = X2[icol * n + l];
  4516. X2[icol * n + l] = temp;
  4517. }
  4518. for (l = 0; l < m; l++) {
  4519. temp = b[irow * n + l];
  4520. b[irow * n + l] = b[icol * n + l];
  4521. b[icol * n + l] = temp;
  4522. }
  4523. }
  4524. indxr[i2] = irow;
  4525. indxc[i2] = icol;
  4526. if (X2[icol * n + icol] === 0)
  4527. return false;
  4528. pivinv = 1 / X2[icol * n + icol];
  4529. X2[icol * n + icol] = 1;
  4530. for (l = 0; l < n; l++)
  4531. X2[icol * n + l] *= pivinv;
  4532. for (l = 0; l < m; l++)
  4533. b[icol * n + l] *= pivinv;
  4534. for (ll = 0; ll < n; ll++) {
  4535. if (ll !== icol) {
  4536. dum = X2[ll * n + icol];
  4537. X2[ll * n + icol] = 0;
  4538. for (l = 0; l < n; l++)
  4539. X2[ll * n + l] -= X2[icol * n + l] * dum;
  4540. for (l = 0; l < m; l++)
  4541. b[ll * n + l] -= b[icol * n + l] * dum;
  4542. }
  4543. }
  4544. }
  4545. for (l = n - 1; l >= 0; l--) {
  4546. if (indxr[l] !== indxc[l]) {
  4547. for (k = 0; k < n; k++) {
  4548. temp = X2[k * n + indxr[l]];
  4549. X2[k * n + indxr[l]] = X2[k * n + indxc[l]];
  4550. X2[k * n + indxc[l]] = temp;
  4551. }
  4552. }
  4553. }
  4554. return true;
  4555. }
  4556. function variogramGaussian(h2, nugget, range3, sill, A) {
  4557. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * Math.pow(h2 / range3, 2)));
  4558. }
  4559. function variogramExponential(h2, nugget, range3, sill, A) {
  4560. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * (h2 / range3)));
  4561. }
  4562. function variogramSpherical(h2, nugget, range3, sill) {
  4563. if (h2 > range3)
  4564. return nugget + (sill - nugget) / range3;
  4565. return nugget + (sill - nugget) / range3 * (1.5 * (h2 / range3) - 0.5 * Math.pow(h2 / range3, 3));
  4566. }
  4567. function train(t2, x, y, model, sigma2, alpha) {
  4568. var variogram = {
  4569. t: t2,
  4570. x,
  4571. y,
  4572. nugget: 0,
  4573. range: 0,
  4574. sill: 0,
  4575. A: 1 / 3,
  4576. n: 0,
  4577. model: variogramExponential,
  4578. K: [],
  4579. M: []
  4580. };
  4581. switch (model) {
  4582. case "gaussian":
  4583. variogram.model = variogramGaussian;
  4584. break;
  4585. case "exponential":
  4586. variogram.model = variogramExponential;
  4587. break;
  4588. case "spherical":
  4589. variogram.model = variogramSpherical;
  4590. break;
  4591. default:
  4592. variogram.model = variogramExponential;
  4593. }
  4594. var i2;
  4595. var j;
  4596. var k;
  4597. var l;
  4598. var n = t2.length;
  4599. var distance2 = Array((n * n - n) / 2);
  4600. for (i2 = 0, k = 0; i2 < n; i2++) {
  4601. for (j = 0; j < i2; j++, k++) {
  4602. distance2[k] = Array(2);
  4603. distance2[k][0] = Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5);
  4604. distance2[k][1] = Math.abs(t2[i2] - t2[j]);
  4605. }
  4606. }
  4607. distance2.sort(function(a, b) {
  4608. return a[0] - b[0];
  4609. });
  4610. variogram.range = distance2[(n * n - n) / 2 - 1][0];
  4611. var lags = (n * n - n) / 2 > 30 ? 30 : (n * n - n) / 2;
  4612. var tolerance = variogram.range / lags;
  4613. var lag = rep(0, lags);
  4614. var semi = rep(0, lags);
  4615. if (lags < 30) {
  4616. for (l = 0; l < lags; l++) {
  4617. lag[l] = distance2[l][0];
  4618. semi[l] = distance2[l][1];
  4619. }
  4620. } else {
  4621. for (i2 = 0, j = 0, k = 0, l = 0; i2 < lags && j < (n * n - n) / 2; i2++, k = 0) {
  4622. while (distance2[j][0] <= (i2 + 1) * tolerance) {
  4623. lag[l] += distance2[j][0];
  4624. semi[l] += distance2[j][1];
  4625. j++;
  4626. k++;
  4627. if (j >= (n * n - n) / 2)
  4628. break;
  4629. }
  4630. if (k > 0) {
  4631. lag[l] /= k;
  4632. semi[l] /= k;
  4633. l++;
  4634. }
  4635. }
  4636. if (l < 2)
  4637. return variogram;
  4638. }
  4639. n = l;
  4640. variogram.range = lag[n - 1] - lag[0];
  4641. var X2 = rep(1, 2 * n);
  4642. var Y = Array(n);
  4643. var A = variogram.A;
  4644. for (i2 = 0; i2 < n; i2++) {
  4645. switch (model) {
  4646. case "gaussian":
  4647. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * Math.pow(lag[i2] / variogram.range, 2));
  4648. break;
  4649. case "exponential":
  4650. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * lag[i2] / variogram.range);
  4651. break;
  4652. case "spherical":
  4653. X2[i2 * 2 + 1] = 1.5 * (lag[i2] / variogram.range) - 0.5 * Math.pow(lag[i2] / variogram.range, 3);
  4654. break;
  4655. }
  4656. Y[i2] = semi[i2];
  4657. }
  4658. var Xt2 = matrixTranspose(X2, n, 2);
  4659. var Z2 = matrixMultiply(Xt2, X2, 2, n, 2);
  4660. Z2 = matrixAdd(Z2, matrixDiag(1 / alpha, 2), 2, 2);
  4661. var cloneZ = Z2.slice(0);
  4662. if (matrixChol(Z2, 2)) {
  4663. matrixChol2inv(Z2, 2);
  4664. } else {
  4665. matrixSolve(cloneZ, 2);
  4666. Z2 = cloneZ;
  4667. }
  4668. var W2 = matrixMultiply(matrixMultiply(Z2, Xt2, 2, 2, n), Y, 2, n, 1);
  4669. variogram.nugget = W2[0];
  4670. variogram.sill = W2[1] * variogram.range + variogram.nugget;
  4671. variogram.n = x.length;
  4672. n = x.length;
  4673. var K2 = Array(n * n);
  4674. for (i2 = 0; i2 < n; i2++) {
  4675. for (j = 0; j < i2; j++) {
  4676. K2[i2 * n + j] = variogram.model(Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4677. K2[j * n + i2] = K2[i2 * n + j];
  4678. }
  4679. K2[i2 * n + i2] = variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4680. }
  4681. var C2 = matrixAdd(K2, matrixDiag(sigma2, n), n, n);
  4682. var cloneC = C2.slice(0);
  4683. if (matrixChol(C2, n)) {
  4684. matrixChol2inv(C2, n);
  4685. } else {
  4686. matrixSolve(cloneC, n);
  4687. C2 = cloneC;
  4688. }
  4689. var K1 = C2.slice(0);
  4690. var M = matrixMultiply(C2, t2, n, n, 1);
  4691. variogram.K = K1;
  4692. variogram.M = M;
  4693. return variogram;
  4694. }
  4695. function predict(x, y, variogram) {
  4696. var i2;
  4697. var k = Array(variogram.n);
  4698. for (i2 = 0; i2 < variogram.n; i2++) {
  4699. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4700. }
  4701. return matrixMultiply(k, variogram.M, 1, variogram.n, 1)[0];
  4702. }
  4703. function variance(x, y, variogram) {
  4704. var i2;
  4705. var k = Array(variogram.n);
  4706. for (i2 = 0; i2 < variogram.n; i2++) {
  4707. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4708. }
  4709. var val = matrixMultiply(matrixMultiply(k, variogram.K, 1, variogram.n, variogram.n), k, 1, variogram.n, 1)[0];
  4710. return variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A) + val;
  4711. }
  4712. function grid(polygons2, variogram, width2) {
  4713. var i2;
  4714. var j;
  4715. var k;
  4716. var n = polygons2.length;
  4717. if (n === 0)
  4718. return;
  4719. var xlim = [polygons2[0][0][0], polygons2[0][0][0]];
  4720. var ylim = [polygons2[0][0][1], polygons2[0][0][1]];
  4721. for (i2 = 0; i2 < n; i2++) {
  4722. for (j = 0; j < polygons2[i2].length; j++) {
  4723. if (polygons2[i2][j][0] < xlim[0])
  4724. xlim[0] = polygons2[i2][j][0];
  4725. if (polygons2[i2][j][0] > xlim[1])
  4726. xlim[1] = polygons2[i2][j][0];
  4727. if (polygons2[i2][j][1] < ylim[0])
  4728. ylim[0] = polygons2[i2][j][1];
  4729. if (polygons2[i2][j][1] > ylim[1])
  4730. ylim[1] = polygons2[i2][j][1];
  4731. }
  4732. }
  4733. var xtarget;
  4734. var ytarget;
  4735. var a = Array(2);
  4736. var b = Array(2);
  4737. var lxlim = Array(2);
  4738. var lylim = Array(2);
  4739. var x = Math.ceil((xlim[1] - xlim[0]) / width2);
  4740. var y = Math.ceil((ylim[1] - ylim[0]) / width2);
  4741. var A = Array(x + 1);
  4742. for (i2 = 0; i2 <= x; i2++)
  4743. A[i2] = Array(y + 1);
  4744. for (i2 = 0; i2 < n; i2++) {
  4745. lxlim[0] = polygons2[i2][0][0];
  4746. lxlim[1] = lxlim[0];
  4747. lylim[0] = polygons2[i2][0][1];
  4748. lylim[1] = lylim[0];
  4749. for (j = 1; j < polygons2[i2].length; j++) {
  4750. if (polygons2[i2][j][0] < lxlim[0])
  4751. lxlim[0] = polygons2[i2][j][0];
  4752. if (polygons2[i2][j][0] > lxlim[1])
  4753. lxlim[1] = polygons2[i2][j][0];
  4754. if (polygons2[i2][j][1] < lylim[0])
  4755. lylim[0] = polygons2[i2][j][1];
  4756. if (polygons2[i2][j][1] > lylim[1])
  4757. lylim[1] = polygons2[i2][j][1];
  4758. }
  4759. a[0] = Math.floor((lxlim[0] - (lxlim[0] - xlim[0]) % width2 - xlim[0]) / width2);
  4760. a[1] = Math.ceil((lxlim[1] - (lxlim[1] - xlim[1]) % width2 - xlim[0]) / width2);
  4761. b[0] = Math.floor((lylim[0] - (lylim[0] - ylim[0]) % width2 - ylim[0]) / width2);
  4762. b[1] = Math.ceil((lylim[1] - (lylim[1] - ylim[1]) % width2 - ylim[0]) / width2);
  4763. for (j = a[0]; j <= a[1]; j++) {
  4764. for (k = b[0]; k <= b[1]; k++) {
  4765. xtarget = xlim[0] + j * width2;
  4766. ytarget = ylim[0] + k * width2;
  4767. if (pip(polygons2[i2], xtarget, ytarget)) {
  4768. A[j][k] = predict(xtarget, ytarget, variogram);
  4769. }
  4770. }
  4771. }
  4772. }
  4773. return {
  4774. xlim,
  4775. ylim,
  4776. width: width2,
  4777. data: A,
  4778. zlim: [min(variogram.t), max(variogram.t)]
  4779. };
  4780. }
  4781. function plot(canvas, grid2, xlim, ylim, colors) {
  4782. var ctx = canvas.getContext("2d");
  4783. var data = grid2.data, zlim = grid2.zlim, width2 = grid2.width;
  4784. if (ctx) {
  4785. ctx.clearRect(0, 0, canvas.width, canvas.height);
  4786. var range3 = [xlim[1] - xlim[0], ylim[1] - ylim[0], zlim[1] - zlim[0]];
  4787. var i2 = void 0;
  4788. var j = void 0;
  4789. var x = void 0;
  4790. var y = void 0;
  4791. var z = void 0;
  4792. var n = data.length;
  4793. var m = data[0].length;
  4794. var wx = Math.ceil(width2 * canvas.width / (xlim[1] - xlim[0]));
  4795. var wy = Math.ceil(width2 * canvas.height / (ylim[1] - ylim[0]));
  4796. for (i2 = 0; i2 < n; i2++) {
  4797. for (j = 0; j < m; j++) {
  4798. if (data[i2][j] === void 0)
  4799. continue;
  4800. x = canvas.width * (i2 * width2 + grid2.xlim[0] - xlim[0]) / range3[0];
  4801. y = canvas.height * (1 - (j * width2 + grid2.ylim[0] - ylim[0]) / range3[1]);
  4802. z = (data[i2][j] - zlim[0]) / range3[2];
  4803. if (z < 0)
  4804. z = 0;
  4805. if (z > 1)
  4806. z = 1;
  4807. ctx.fillStyle = colors[Math.floor((colors.length - 1) * z)];
  4808. ctx.fillRect(Math.round(x - wx / 2), Math.round(y - wy / 2), wx, wy);
  4809. }
  4810. }
  4811. }
  4812. }
  4813. var index = {
  4814. train,
  4815. predict,
  4816. variance,
  4817. grid,
  4818. plot,
  4819. max,
  4820. min,
  4821. pip,
  4822. rep,
  4823. matrixDiag,
  4824. matrixTranspose,
  4825. matrixAdd,
  4826. matrixMultiply,
  4827. matrixChol,
  4828. matrixChol2inv,
  4829. matrixSolve,
  4830. variogramGaussian,
  4831. variogramExponential,
  4832. variogramSpherical
  4833. };
  4834. var earthRadius = 63710088e-1;
  4835. var factors = {
  4836. centimeters: earthRadius * 100,
  4837. centimetres: earthRadius * 100,
  4838. degrees: earthRadius / 111325,
  4839. feet: earthRadius * 3.28084,
  4840. inches: earthRadius * 39.37,
  4841. kilometers: earthRadius / 1e3,
  4842. kilometres: earthRadius / 1e3,
  4843. meters: earthRadius,
  4844. metres: earthRadius,
  4845. miles: earthRadius / 1609.344,
  4846. millimeters: earthRadius * 1e3,
  4847. millimetres: earthRadius * 1e3,
  4848. nauticalmiles: earthRadius / 1852,
  4849. radians: 1,
  4850. yards: earthRadius * 1.0936
  4851. };
  4852. var unitsFactors = {
  4853. centimeters: 100,
  4854. centimetres: 100,
  4855. degrees: 1 / 111325,
  4856. feet: 3.28084,
  4857. inches: 39.37,
  4858. kilometers: 1 / 1e3,
  4859. kilometres: 1 / 1e3,
  4860. meters: 1,
  4861. metres: 1,
  4862. miles: 1 / 1609.344,
  4863. millimeters: 1e3,
  4864. millimetres: 1e3,
  4865. nauticalmiles: 1 / 1852,
  4866. radians: 1 / earthRadius,
  4867. yards: 1.0936133
  4868. };
  4869. var areaFactors = {
  4870. acres: 247105e-9,
  4871. centimeters: 1e4,
  4872. centimetres: 1e4,
  4873. feet: 10.763910417,
  4874. hectares: 1e-4,
  4875. inches: 1550.003100006,
  4876. kilometers: 1e-6,
  4877. kilometres: 1e-6,
  4878. meters: 1,
  4879. metres: 1,
  4880. miles: 386e-9,
  4881. millimeters: 1e6,
  4882. millimetres: 1e6,
  4883. yards: 1.195990046
  4884. };
  4885. function feature(geom, properties, options2) {
  4886. if (options2 === void 0) {
  4887. options2 = {};
  4888. }
  4889. var feat = { type: "Feature" };
  4890. if (options2.id === 0 || options2.id) {
  4891. feat.id = options2.id;
  4892. }
  4893. if (options2.bbox) {
  4894. feat.bbox = options2.bbox;
  4895. }
  4896. feat.properties = properties || {};
  4897. feat.geometry = geom;
  4898. return feat;
  4899. }
  4900. function geometry(type2, coordinates, _options) {
  4901. switch (type2) {
  4902. case "Point":
  4903. return point(coordinates).geometry;
  4904. case "LineString":
  4905. return lineString(coordinates).geometry;
  4906. case "Polygon":
  4907. return polygon(coordinates).geometry;
  4908. case "MultiPoint":
  4909. return multiPoint(coordinates).geometry;
  4910. case "MultiLineString":
  4911. return multiLineString(coordinates).geometry;
  4912. case "MultiPolygon":
  4913. return multiPolygon(coordinates).geometry;
  4914. default:
  4915. throw new Error(type2 + " is invalid");
  4916. }
  4917. }
  4918. function point(coordinates, properties, options2) {
  4919. if (options2 === void 0) {
  4920. options2 = {};
  4921. }
  4922. if (!coordinates) {
  4923. throw new Error("coordinates is required");
  4924. }
  4925. if (!Array.isArray(coordinates)) {
  4926. throw new Error("coordinates must be an Array");
  4927. }
  4928. if (coordinates.length < 2) {
  4929. throw new Error("coordinates must be at least 2 numbers long");
  4930. }
  4931. if (!isNumber$1(coordinates[0]) || !isNumber$1(coordinates[1])) {
  4932. throw new Error("coordinates must contain numbers");
  4933. }
  4934. var geom = {
  4935. type: "Point",
  4936. coordinates
  4937. };
  4938. return feature(geom, properties, options2);
  4939. }
  4940. function points(coordinates, properties, options2) {
  4941. if (options2 === void 0) {
  4942. options2 = {};
  4943. }
  4944. return featureCollection$1(coordinates.map(function(coords) {
  4945. return point(coords, properties);
  4946. }), options2);
  4947. }
  4948. function polygon(coordinates, properties, options2) {
  4949. if (options2 === void 0) {
  4950. options2 = {};
  4951. }
  4952. for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
  4953. var ring = coordinates_1[_i];
  4954. if (ring.length < 4) {
  4955. throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
  4956. }
  4957. for (var j = 0; j < ring[ring.length - 1].length; j++) {
  4958. if (ring[ring.length - 1][j] !== ring[0][j]) {
  4959. throw new Error("First and last Position are not equivalent.");
  4960. }
  4961. }
  4962. }
  4963. var geom = {
  4964. type: "Polygon",
  4965. coordinates
  4966. };
  4967. return feature(geom, properties, options2);
  4968. }
  4969. function polygons(coordinates, properties, options2) {
  4970. if (options2 === void 0) {
  4971. options2 = {};
  4972. }
  4973. return featureCollection$1(coordinates.map(function(coords) {
  4974. return polygon(coords, properties);
  4975. }), options2);
  4976. }
  4977. function lineString(coordinates, properties, options2) {
  4978. if (options2 === void 0) {
  4979. options2 = {};
  4980. }
  4981. if (coordinates.length < 2) {
  4982. throw new Error("coordinates must be an array of two or more positions");
  4983. }
  4984. var geom = {
  4985. type: "LineString",
  4986. coordinates
  4987. };
  4988. return feature(geom, properties, options2);
  4989. }
  4990. function lineStrings(coordinates, properties, options2) {
  4991. if (options2 === void 0) {
  4992. options2 = {};
  4993. }
  4994. return featureCollection$1(coordinates.map(function(coords) {
  4995. return lineString(coords, properties);
  4996. }), options2);
  4997. }
  4998. function featureCollection$1(features, options2) {
  4999. if (options2 === void 0) {
  5000. options2 = {};
  5001. }
  5002. var fc = { type: "FeatureCollection" };
  5003. if (options2.id) {
  5004. fc.id = options2.id;
  5005. }
  5006. if (options2.bbox) {
  5007. fc.bbox = options2.bbox;
  5008. }
  5009. fc.features = features;
  5010. return fc;
  5011. }
  5012. function multiLineString(coordinates, properties, options2) {
  5013. if (options2 === void 0) {
  5014. options2 = {};
  5015. }
  5016. var geom = {
  5017. type: "MultiLineString",
  5018. coordinates
  5019. };
  5020. return feature(geom, properties, options2);
  5021. }
  5022. function multiPoint(coordinates, properties, options2) {
  5023. if (options2 === void 0) {
  5024. options2 = {};
  5025. }
  5026. var geom = {
  5027. type: "MultiPoint",
  5028. coordinates
  5029. };
  5030. return feature(geom, properties, options2);
  5031. }
  5032. function multiPolygon(coordinates, properties, options2) {
  5033. if (options2 === void 0) {
  5034. options2 = {};
  5035. }
  5036. var geom = {
  5037. type: "MultiPolygon",
  5038. coordinates
  5039. };
  5040. return feature(geom, properties, options2);
  5041. }
  5042. function geometryCollection(geometries, properties, options2) {
  5043. if (options2 === void 0) {
  5044. options2 = {};
  5045. }
  5046. var geom = {
  5047. type: "GeometryCollection",
  5048. geometries
  5049. };
  5050. return feature(geom, properties, options2);
  5051. }
  5052. function round(num, precision) {
  5053. if (precision === void 0) {
  5054. precision = 0;
  5055. }
  5056. if (precision && !(precision >= 0)) {
  5057. throw new Error("precision must be a positive number");
  5058. }
  5059. var multiplier = Math.pow(10, precision || 0);
  5060. return Math.round(num * multiplier) / multiplier;
  5061. }
  5062. function radiansToLength(radians, units) {
  5063. if (units === void 0) {
  5064. units = "kilometers";
  5065. }
  5066. var factor = factors[units];
  5067. if (!factor) {
  5068. throw new Error(units + " units is invalid");
  5069. }
  5070. return radians * factor;
  5071. }
  5072. function lengthToRadians(distance2, units) {
  5073. if (units === void 0) {
  5074. units = "kilometers";
  5075. }
  5076. var factor = factors[units];
  5077. if (!factor) {
  5078. throw new Error(units + " units is invalid");
  5079. }
  5080. return distance2 / factor;
  5081. }
  5082. function lengthToDegrees(distance2, units) {
  5083. return radiansToDegrees(lengthToRadians(distance2, units));
  5084. }
  5085. function bearingToAzimuth(bearing2) {
  5086. var angle = bearing2 % 360;
  5087. if (angle < 0) {
  5088. angle += 360;
  5089. }
  5090. return angle;
  5091. }
  5092. function radiansToDegrees(radians) {
  5093. var degrees = radians % (2 * Math.PI);
  5094. return degrees * 180 / Math.PI;
  5095. }
  5096. function degreesToRadians(degrees) {
  5097. var radians = degrees % 360;
  5098. return radians * Math.PI / 180;
  5099. }
  5100. function convertLength(length, originalUnit, finalUnit) {
  5101. if (originalUnit === void 0) {
  5102. originalUnit = "kilometers";
  5103. }
  5104. if (finalUnit === void 0) {
  5105. finalUnit = "kilometers";
  5106. }
  5107. if (!(length >= 0)) {
  5108. throw new Error("length must be a positive number");
  5109. }
  5110. return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);
  5111. }
  5112. function convertArea(area, originalUnit, finalUnit) {
  5113. if (originalUnit === void 0) {
  5114. originalUnit = "meters";
  5115. }
  5116. if (finalUnit === void 0) {
  5117. finalUnit = "kilometers";
  5118. }
  5119. if (!(area >= 0)) {
  5120. throw new Error("area must be a positive number");
  5121. }
  5122. var startFactor = areaFactors[originalUnit];
  5123. if (!startFactor) {
  5124. throw new Error("invalid original units");
  5125. }
  5126. var finalFactor = areaFactors[finalUnit];
  5127. if (!finalFactor) {
  5128. throw new Error("invalid final units");
  5129. }
  5130. return area / startFactor * finalFactor;
  5131. }
  5132. function isNumber$1(num) {
  5133. return !isNaN(num) && num !== null && !Array.isArray(num);
  5134. }
  5135. function isObject$6(input) {
  5136. return !!input && input.constructor === Object;
  5137. }
  5138. function validateBBox(bbox2) {
  5139. if (!bbox2) {
  5140. throw new Error("bbox is required");
  5141. }
  5142. if (!Array.isArray(bbox2)) {
  5143. throw new Error("bbox must be an Array");
  5144. }
  5145. if (bbox2.length !== 4 && bbox2.length !== 6) {
  5146. throw new Error("bbox must be an Array of 4 or 6 numbers");
  5147. }
  5148. bbox2.forEach(function(num) {
  5149. if (!isNumber$1(num)) {
  5150. throw new Error("bbox must only contain numbers");
  5151. }
  5152. });
  5153. }
  5154. function validateId(id) {
  5155. if (!id) {
  5156. throw new Error("id is required");
  5157. }
  5158. if (["string", "number"].indexOf(typeof id) === -1) {
  5159. throw new Error("id must be a number or a string");
  5160. }
  5161. }
  5162. var es$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5163. __proto__: null,
  5164. earthRadius,
  5165. factors,
  5166. unitsFactors,
  5167. areaFactors,
  5168. feature,
  5169. geometry,
  5170. point,
  5171. points,
  5172. polygon,
  5173. polygons,
  5174. lineString,
  5175. lineStrings,
  5176. featureCollection: featureCollection$1,
  5177. multiLineString,
  5178. multiPoint,
  5179. multiPolygon,
  5180. geometryCollection,
  5181. round,
  5182. radiansToLength,
  5183. lengthToRadians,
  5184. lengthToDegrees,
  5185. bearingToAzimuth,
  5186. radiansToDegrees,
  5187. degreesToRadians,
  5188. convertLength,
  5189. convertArea,
  5190. isNumber: isNumber$1,
  5191. isObject: isObject$6,
  5192. validateBBox,
  5193. validateId
  5194. }, Symbol.toStringTag, { value: "Module" }));
  5195. function coordEach(geojson, callback2, excludeWrapCoord) {
  5196. if (geojson === null)
  5197. return;
  5198. var j, k, l, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5199. for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
  5200. geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
  5201. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5202. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5203. for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
  5204. var multiFeatureIndex = 0;
  5205. var geometryIndex = 0;
  5206. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
  5207. if (geometry2 === null)
  5208. continue;
  5209. coords = geometry2.coordinates;
  5210. var geomType = geometry2.type;
  5211. wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
  5212. switch (geomType) {
  5213. case null:
  5214. break;
  5215. case "Point":
  5216. if (callback2(
  5217. coords,
  5218. coordIndex,
  5219. featureIndex,
  5220. multiFeatureIndex,
  5221. geometryIndex
  5222. ) === false)
  5223. return false;
  5224. coordIndex++;
  5225. multiFeatureIndex++;
  5226. break;
  5227. case "LineString":
  5228. case "MultiPoint":
  5229. for (j = 0; j < coords.length; j++) {
  5230. if (callback2(
  5231. coords[j],
  5232. coordIndex,
  5233. featureIndex,
  5234. multiFeatureIndex,
  5235. geometryIndex
  5236. ) === false)
  5237. return false;
  5238. coordIndex++;
  5239. if (geomType === "MultiPoint")
  5240. multiFeatureIndex++;
  5241. }
  5242. if (geomType === "LineString")
  5243. multiFeatureIndex++;
  5244. break;
  5245. case "Polygon":
  5246. case "MultiLineString":
  5247. for (j = 0; j < coords.length; j++) {
  5248. for (k = 0; k < coords[j].length - wrapShrink; k++) {
  5249. if (callback2(
  5250. coords[j][k],
  5251. coordIndex,
  5252. featureIndex,
  5253. multiFeatureIndex,
  5254. geometryIndex
  5255. ) === false)
  5256. return false;
  5257. coordIndex++;
  5258. }
  5259. if (geomType === "MultiLineString")
  5260. multiFeatureIndex++;
  5261. if (geomType === "Polygon")
  5262. geometryIndex++;
  5263. }
  5264. if (geomType === "Polygon")
  5265. multiFeatureIndex++;
  5266. break;
  5267. case "MultiPolygon":
  5268. for (j = 0; j < coords.length; j++) {
  5269. geometryIndex = 0;
  5270. for (k = 0; k < coords[j].length; k++) {
  5271. for (l = 0; l < coords[j][k].length - wrapShrink; l++) {
  5272. if (callback2(
  5273. coords[j][k][l],
  5274. coordIndex,
  5275. featureIndex,
  5276. multiFeatureIndex,
  5277. geometryIndex
  5278. ) === false)
  5279. return false;
  5280. coordIndex++;
  5281. }
  5282. geometryIndex++;
  5283. }
  5284. multiFeatureIndex++;
  5285. }
  5286. break;
  5287. case "GeometryCollection":
  5288. for (j = 0; j < geometry2.geometries.length; j++)
  5289. if (coordEach(geometry2.geometries[j], callback2, excludeWrapCoord) === false)
  5290. return false;
  5291. break;
  5292. default:
  5293. throw new Error("Unknown Geometry Type");
  5294. }
  5295. }
  5296. }
  5297. }
  5298. function coordReduce(geojson, callback2, initialValue, excludeWrapCoord) {
  5299. var previousValue = initialValue;
  5300. coordEach(
  5301. geojson,
  5302. function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
  5303. if (coordIndex === 0 && initialValue === void 0)
  5304. previousValue = currentCoord;
  5305. else
  5306. previousValue = callback2(
  5307. previousValue,
  5308. currentCoord,
  5309. coordIndex,
  5310. featureIndex,
  5311. multiFeatureIndex,
  5312. geometryIndex
  5313. );
  5314. },
  5315. excludeWrapCoord
  5316. );
  5317. return previousValue;
  5318. }
  5319. function propEach(geojson, callback2) {
  5320. var i2;
  5321. switch (geojson.type) {
  5322. case "FeatureCollection":
  5323. for (i2 = 0; i2 < geojson.features.length; i2++) {
  5324. if (callback2(geojson.features[i2].properties, i2) === false)
  5325. break;
  5326. }
  5327. break;
  5328. case "Feature":
  5329. callback2(geojson.properties, 0);
  5330. break;
  5331. }
  5332. }
  5333. function propReduce(geojson, callback2, initialValue) {
  5334. var previousValue = initialValue;
  5335. propEach(geojson, function(currentProperties, featureIndex) {
  5336. if (featureIndex === 0 && initialValue === void 0)
  5337. previousValue = currentProperties;
  5338. else
  5339. previousValue = callback2(previousValue, currentProperties, featureIndex);
  5340. });
  5341. return previousValue;
  5342. }
  5343. function featureEach$1(geojson, callback2) {
  5344. if (geojson.type === "Feature") {
  5345. callback2(geojson, 0);
  5346. } else if (geojson.type === "FeatureCollection") {
  5347. for (var i2 = 0; i2 < geojson.features.length; i2++) {
  5348. if (callback2(geojson.features[i2], i2) === false)
  5349. break;
  5350. }
  5351. }
  5352. }
  5353. function featureReduce(geojson, callback2, initialValue) {
  5354. var previousValue = initialValue;
  5355. featureEach$1(geojson, function(currentFeature, featureIndex) {
  5356. if (featureIndex === 0 && initialValue === void 0)
  5357. previousValue = currentFeature;
  5358. else
  5359. previousValue = callback2(previousValue, currentFeature, featureIndex);
  5360. });
  5361. return previousValue;
  5362. }
  5363. function coordAll(geojson) {
  5364. var coords = [];
  5365. coordEach(geojson, function(coord) {
  5366. coords.push(coord);
  5367. });
  5368. return coords;
  5369. }
  5370. function geomEach(geojson, callback2) {
  5371. var i2, j, g, geometry2, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId, featureIndex = 0, isFeatureCollection = geojson.type === "FeatureCollection", isFeature = geojson.type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5372. for (i2 = 0; i2 < stop; i2++) {
  5373. geometryMaybeCollection = isFeatureCollection ? geojson.features[i2].geometry : isFeature ? geojson.geometry : geojson;
  5374. featureProperties = isFeatureCollection ? geojson.features[i2].properties : isFeature ? geojson.properties : {};
  5375. featureBBox = isFeatureCollection ? geojson.features[i2].bbox : isFeature ? geojson.bbox : void 0;
  5376. featureId = isFeatureCollection ? geojson.features[i2].id : isFeature ? geojson.id : void 0;
  5377. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5378. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5379. for (g = 0; g < stopG; g++) {
  5380. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[g] : geometryMaybeCollection;
  5381. if (geometry2 === null) {
  5382. if (callback2(
  5383. null,
  5384. featureIndex,
  5385. featureProperties,
  5386. featureBBox,
  5387. featureId
  5388. ) === false)
  5389. return false;
  5390. continue;
  5391. }
  5392. switch (geometry2.type) {
  5393. case "Point":
  5394. case "LineString":
  5395. case "MultiPoint":
  5396. case "Polygon":
  5397. case "MultiLineString":
  5398. case "MultiPolygon": {
  5399. if (callback2(
  5400. geometry2,
  5401. featureIndex,
  5402. featureProperties,
  5403. featureBBox,
  5404. featureId
  5405. ) === false)
  5406. return false;
  5407. break;
  5408. }
  5409. case "GeometryCollection": {
  5410. for (j = 0; j < geometry2.geometries.length; j++) {
  5411. if (callback2(
  5412. geometry2.geometries[j],
  5413. featureIndex,
  5414. featureProperties,
  5415. featureBBox,
  5416. featureId
  5417. ) === false)
  5418. return false;
  5419. }
  5420. break;
  5421. }
  5422. default:
  5423. throw new Error("Unknown Geometry Type");
  5424. }
  5425. }
  5426. featureIndex++;
  5427. }
  5428. }
  5429. function geomReduce(geojson, callback2, initialValue) {
  5430. var previousValue = initialValue;
  5431. geomEach(
  5432. geojson,
  5433. function(currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {
  5434. if (featureIndex === 0 && initialValue === void 0)
  5435. previousValue = currentGeometry;
  5436. else
  5437. previousValue = callback2(
  5438. previousValue,
  5439. currentGeometry,
  5440. featureIndex,
  5441. featureProperties,
  5442. featureBBox,
  5443. featureId
  5444. );
  5445. }
  5446. );
  5447. return previousValue;
  5448. }
  5449. function flattenEach(geojson, callback2) {
  5450. geomEach(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
  5451. var type2 = geometry2 === null ? null : geometry2.type;
  5452. switch (type2) {
  5453. case null:
  5454. case "Point":
  5455. case "LineString":
  5456. case "Polygon":
  5457. if (callback2(
  5458. feature(geometry2, properties, { bbox: bbox2, id }),
  5459. featureIndex,
  5460. 0
  5461. ) === false)
  5462. return false;
  5463. return;
  5464. }
  5465. var geomType;
  5466. switch (type2) {
  5467. case "MultiPoint":
  5468. geomType = "Point";
  5469. break;
  5470. case "MultiLineString":
  5471. geomType = "LineString";
  5472. break;
  5473. case "MultiPolygon":
  5474. geomType = "Polygon";
  5475. break;
  5476. }
  5477. for (var multiFeatureIndex = 0; multiFeatureIndex < geometry2.coordinates.length; multiFeatureIndex++) {
  5478. var coordinate = geometry2.coordinates[multiFeatureIndex];
  5479. var geom = {
  5480. type: geomType,
  5481. coordinates: coordinate
  5482. };
  5483. if (callback2(feature(geom, properties), featureIndex, multiFeatureIndex) === false)
  5484. return false;
  5485. }
  5486. });
  5487. }
  5488. function flattenReduce(geojson, callback2, initialValue) {
  5489. var previousValue = initialValue;
  5490. flattenEach(
  5491. geojson,
  5492. function(currentFeature, featureIndex, multiFeatureIndex) {
  5493. if (featureIndex === 0 && multiFeatureIndex === 0 && initialValue === void 0)
  5494. previousValue = currentFeature;
  5495. else
  5496. previousValue = callback2(
  5497. previousValue,
  5498. currentFeature,
  5499. featureIndex,
  5500. multiFeatureIndex
  5501. );
  5502. }
  5503. );
  5504. return previousValue;
  5505. }
  5506. function segmentEach(geojson, callback2) {
  5507. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5508. var segmentIndex = 0;
  5509. if (!feature2.geometry)
  5510. return;
  5511. var type2 = feature2.geometry.type;
  5512. if (type2 === "Point" || type2 === "MultiPoint")
  5513. return;
  5514. var previousCoords;
  5515. var previousFeatureIndex = 0;
  5516. var previousMultiIndex = 0;
  5517. var prevGeomIndex = 0;
  5518. if (coordEach(
  5519. feature2,
  5520. function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
  5521. if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
  5522. previousCoords = currentCoord;
  5523. previousFeatureIndex = featureIndex;
  5524. previousMultiIndex = multiPartIndexCoord;
  5525. prevGeomIndex = geometryIndex;
  5526. segmentIndex = 0;
  5527. return;
  5528. }
  5529. var currentSegment = lineString(
  5530. [previousCoords, currentCoord],
  5531. feature2.properties
  5532. );
  5533. if (callback2(
  5534. currentSegment,
  5535. featureIndex,
  5536. multiFeatureIndex,
  5537. geometryIndex,
  5538. segmentIndex
  5539. ) === false)
  5540. return false;
  5541. segmentIndex++;
  5542. previousCoords = currentCoord;
  5543. }
  5544. ) === false)
  5545. return false;
  5546. });
  5547. }
  5548. function segmentReduce(geojson, callback2, initialValue) {
  5549. var previousValue = initialValue;
  5550. var started = false;
  5551. segmentEach(
  5552. geojson,
  5553. function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {
  5554. if (started === false && initialValue === void 0)
  5555. previousValue = currentSegment;
  5556. else
  5557. previousValue = callback2(
  5558. previousValue,
  5559. currentSegment,
  5560. featureIndex,
  5561. multiFeatureIndex,
  5562. geometryIndex,
  5563. segmentIndex
  5564. );
  5565. started = true;
  5566. }
  5567. );
  5568. return previousValue;
  5569. }
  5570. function lineEach(geojson, callback2) {
  5571. if (!geojson)
  5572. throw new Error("geojson is required");
  5573. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5574. if (feature2.geometry === null)
  5575. return;
  5576. var type2 = feature2.geometry.type;
  5577. var coords = feature2.geometry.coordinates;
  5578. switch (type2) {
  5579. case "LineString":
  5580. if (callback2(feature2, featureIndex, multiFeatureIndex, 0, 0) === false)
  5581. return false;
  5582. break;
  5583. case "Polygon":
  5584. for (var geometryIndex = 0; geometryIndex < coords.length; geometryIndex++) {
  5585. if (callback2(
  5586. lineString(coords[geometryIndex], feature2.properties),
  5587. featureIndex,
  5588. multiFeatureIndex,
  5589. geometryIndex
  5590. ) === false)
  5591. return false;
  5592. }
  5593. break;
  5594. }
  5595. });
  5596. }
  5597. function lineReduce(geojson, callback2, initialValue) {
  5598. var previousValue = initialValue;
  5599. lineEach(
  5600. geojson,
  5601. function(currentLine, featureIndex, multiFeatureIndex, geometryIndex) {
  5602. if (featureIndex === 0 && initialValue === void 0)
  5603. previousValue = currentLine;
  5604. else
  5605. previousValue = callback2(
  5606. previousValue,
  5607. currentLine,
  5608. featureIndex,
  5609. multiFeatureIndex,
  5610. geometryIndex
  5611. );
  5612. }
  5613. );
  5614. return previousValue;
  5615. }
  5616. function findSegment(geojson, options2) {
  5617. options2 = options2 || {};
  5618. if (!isObject$6(options2))
  5619. throw new Error("options is invalid");
  5620. var featureIndex = options2.featureIndex || 0;
  5621. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5622. var geometryIndex = options2.geometryIndex || 0;
  5623. var segmentIndex = options2.segmentIndex || 0;
  5624. var properties = options2.properties;
  5625. var geometry2;
  5626. switch (geojson.type) {
  5627. case "FeatureCollection":
  5628. if (featureIndex < 0)
  5629. featureIndex = geojson.features.length + featureIndex;
  5630. properties = properties || geojson.features[featureIndex].properties;
  5631. geometry2 = geojson.features[featureIndex].geometry;
  5632. break;
  5633. case "Feature":
  5634. properties = properties || geojson.properties;
  5635. geometry2 = geojson.geometry;
  5636. break;
  5637. case "Point":
  5638. case "MultiPoint":
  5639. return null;
  5640. case "LineString":
  5641. case "Polygon":
  5642. case "MultiLineString":
  5643. case "MultiPolygon":
  5644. geometry2 = geojson;
  5645. break;
  5646. default:
  5647. throw new Error("geojson is invalid");
  5648. }
  5649. if (geometry2 === null)
  5650. return null;
  5651. var coords = geometry2.coordinates;
  5652. switch (geometry2.type) {
  5653. case "Point":
  5654. case "MultiPoint":
  5655. return null;
  5656. case "LineString":
  5657. if (segmentIndex < 0)
  5658. segmentIndex = coords.length + segmentIndex - 1;
  5659. return lineString(
  5660. [coords[segmentIndex], coords[segmentIndex + 1]],
  5661. properties,
  5662. options2
  5663. );
  5664. case "Polygon":
  5665. if (geometryIndex < 0)
  5666. geometryIndex = coords.length + geometryIndex;
  5667. if (segmentIndex < 0)
  5668. segmentIndex = coords[geometryIndex].length + segmentIndex - 1;
  5669. return lineString(
  5670. [
  5671. coords[geometryIndex][segmentIndex],
  5672. coords[geometryIndex][segmentIndex + 1]
  5673. ],
  5674. properties,
  5675. options2
  5676. );
  5677. case "MultiLineString":
  5678. if (multiFeatureIndex < 0)
  5679. multiFeatureIndex = coords.length + multiFeatureIndex;
  5680. if (segmentIndex < 0)
  5681. segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;
  5682. return lineString(
  5683. [
  5684. coords[multiFeatureIndex][segmentIndex],
  5685. coords[multiFeatureIndex][segmentIndex + 1]
  5686. ],
  5687. properties,
  5688. options2
  5689. );
  5690. case "MultiPolygon":
  5691. if (multiFeatureIndex < 0)
  5692. multiFeatureIndex = coords.length + multiFeatureIndex;
  5693. if (geometryIndex < 0)
  5694. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5695. if (segmentIndex < 0)
  5696. segmentIndex = coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;
  5697. return lineString(
  5698. [
  5699. coords[multiFeatureIndex][geometryIndex][segmentIndex],
  5700. coords[multiFeatureIndex][geometryIndex][segmentIndex + 1]
  5701. ],
  5702. properties,
  5703. options2
  5704. );
  5705. }
  5706. throw new Error("geojson is invalid");
  5707. }
  5708. function findPoint(geojson, options2) {
  5709. options2 = options2 || {};
  5710. if (!isObject$6(options2))
  5711. throw new Error("options is invalid");
  5712. var featureIndex = options2.featureIndex || 0;
  5713. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5714. var geometryIndex = options2.geometryIndex || 0;
  5715. var coordIndex = options2.coordIndex || 0;
  5716. var properties = options2.properties;
  5717. var geometry2;
  5718. switch (geojson.type) {
  5719. case "FeatureCollection":
  5720. if (featureIndex < 0)
  5721. featureIndex = geojson.features.length + featureIndex;
  5722. properties = properties || geojson.features[featureIndex].properties;
  5723. geometry2 = geojson.features[featureIndex].geometry;
  5724. break;
  5725. case "Feature":
  5726. properties = properties || geojson.properties;
  5727. geometry2 = geojson.geometry;
  5728. break;
  5729. case "Point":
  5730. case "MultiPoint":
  5731. return null;
  5732. case "LineString":
  5733. case "Polygon":
  5734. case "MultiLineString":
  5735. case "MultiPolygon":
  5736. geometry2 = geojson;
  5737. break;
  5738. default:
  5739. throw new Error("geojson is invalid");
  5740. }
  5741. if (geometry2 === null)
  5742. return null;
  5743. var coords = geometry2.coordinates;
  5744. switch (geometry2.type) {
  5745. case "Point":
  5746. return point(coords, properties, options2);
  5747. case "MultiPoint":
  5748. if (multiFeatureIndex < 0)
  5749. multiFeatureIndex = coords.length + multiFeatureIndex;
  5750. return point(coords[multiFeatureIndex], properties, options2);
  5751. case "LineString":
  5752. if (coordIndex < 0)
  5753. coordIndex = coords.length + coordIndex;
  5754. return point(coords[coordIndex], properties, options2);
  5755. case "Polygon":
  5756. if (geometryIndex < 0)
  5757. geometryIndex = coords.length + geometryIndex;
  5758. if (coordIndex < 0)
  5759. coordIndex = coords[geometryIndex].length + coordIndex;
  5760. return point(coords[geometryIndex][coordIndex], properties, options2);
  5761. case "MultiLineString":
  5762. if (multiFeatureIndex < 0)
  5763. multiFeatureIndex = coords.length + multiFeatureIndex;
  5764. if (coordIndex < 0)
  5765. coordIndex = coords[multiFeatureIndex].length + coordIndex;
  5766. return point(coords[multiFeatureIndex][coordIndex], properties, options2);
  5767. case "MultiPolygon":
  5768. if (multiFeatureIndex < 0)
  5769. multiFeatureIndex = coords.length + multiFeatureIndex;
  5770. if (geometryIndex < 0)
  5771. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5772. if (coordIndex < 0)
  5773. coordIndex = coords[multiFeatureIndex][geometryIndex].length - coordIndex;
  5774. return point(
  5775. coords[multiFeatureIndex][geometryIndex][coordIndex],
  5776. properties,
  5777. options2
  5778. );
  5779. }
  5780. throw new Error("geojson is invalid");
  5781. }
  5782. var es$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5783. __proto__: null,
  5784. coordAll,
  5785. coordEach,
  5786. coordReduce,
  5787. featureEach: featureEach$1,
  5788. featureReduce,
  5789. findPoint,
  5790. findSegment,
  5791. flattenEach,
  5792. flattenReduce,
  5793. geomEach,
  5794. geomReduce,
  5795. lineEach,
  5796. lineReduce,
  5797. propEach,
  5798. propReduce,
  5799. segmentEach,
  5800. segmentReduce
  5801. }, Symbol.toStringTag, { value: "Module" }));
  5802. function bbox$1(geojson) {
  5803. var result = [Infinity, Infinity, -Infinity, -Infinity];
  5804. coordEach(geojson, function(coord) {
  5805. if (result[0] > coord[0]) {
  5806. result[0] = coord[0];
  5807. }
  5808. if (result[1] > coord[1]) {
  5809. result[1] = coord[1];
  5810. }
  5811. if (result[2] < coord[0]) {
  5812. result[2] = coord[0];
  5813. }
  5814. if (result[3] < coord[1]) {
  5815. result[3] = coord[1];
  5816. }
  5817. });
  5818. return result;
  5819. }
  5820. bbox$1["default"] = bbox$1;
  5821. var es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5822. __proto__: null,
  5823. "default": bbox$1
  5824. }, Symbol.toStringTag, { value: "Module" }));
  5825. function getCoord(coord) {
  5826. if (!coord) {
  5827. throw new Error("coord is required");
  5828. }
  5829. if (!Array.isArray(coord)) {
  5830. if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
  5831. return coord.geometry.coordinates;
  5832. }
  5833. if (coord.type === "Point") {
  5834. return coord.coordinates;
  5835. }
  5836. }
  5837. if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
  5838. return coord;
  5839. }
  5840. throw new Error("coord must be GeoJSON Point or an Array of numbers");
  5841. }
  5842. function getCoords(coords) {
  5843. if (Array.isArray(coords)) {
  5844. return coords;
  5845. }
  5846. if (coords.type === "Feature") {
  5847. if (coords.geometry !== null) {
  5848. return coords.geometry.coordinates;
  5849. }
  5850. } else {
  5851. if (coords.coordinates) {
  5852. return coords.coordinates;
  5853. }
  5854. }
  5855. throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
  5856. }
  5857. function getGeom(geojson) {
  5858. if (geojson.type === "Feature") {
  5859. return geojson.geometry;
  5860. }
  5861. return geojson;
  5862. }
  5863. function getType(geojson, _name) {
  5864. if (geojson.type === "FeatureCollection") {
  5865. return "FeatureCollection";
  5866. }
  5867. if (geojson.type === "GeometryCollection") {
  5868. return "GeometryCollection";
  5869. }
  5870. if (geojson.type === "Feature" && geojson.geometry !== null) {
  5871. return geojson.geometry.type;
  5872. }
  5873. return geojson.type;
  5874. }
  5875. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  5876. function getDefaultExportFromCjs(x) {
  5877. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  5878. }
  5879. function getAugmentedNamespace(n) {
  5880. if (n.__esModule)
  5881. return n;
  5882. var a = Object.defineProperty({}, "__esModule", { value: true });
  5883. Object.keys(n).forEach(function(k) {
  5884. var d2 = Object.getOwnPropertyDescriptor(n, k);
  5885. Object.defineProperty(a, k, d2.get ? d2 : {
  5886. enumerable: true,
  5887. get: function() {
  5888. return n[k];
  5889. }
  5890. });
  5891. });
  5892. return a;
  5893. }
  5894. var concaveman$2 = { exports: {} };
  5895. var rbush_min$1 = { exports: {} };
  5896. (function(module2, exports2) {
  5897. !function(t2, i2) {
  5898. module2.exports = i2();
  5899. }(commonjsGlobal, function() {
  5900. function t2(t3, r3, e2, a2, h3) {
  5901. !function t4(n2, r4, e3, a3, h4) {
  5902. for (; a3 > e3; ) {
  5903. if (a3 - e3 > 600) {
  5904. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  5905. t4(n2, r4, m2, c2, h4);
  5906. }
  5907. var p2 = n2[r4], d3 = e3, x = a3;
  5908. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  5909. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  5910. d3++;
  5911. for (; h4(n2[x], p2) > 0; )
  5912. x--;
  5913. }
  5914. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  5915. }
  5916. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  5917. }
  5918. function i2(t3, i3, n2) {
  5919. var r3 = t3[i3];
  5920. t3[i3] = t3[n2], t3[n2] = r3;
  5921. }
  5922. function n(t3, i3) {
  5923. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  5924. }
  5925. var r2 = function(t3) {
  5926. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  5927. };
  5928. function e(t3, i3, n2) {
  5929. if (!n2)
  5930. return i3.indexOf(t3);
  5931. for (var r3 = 0; r3 < i3.length; r3++)
  5932. if (n2(t3, i3[r3]))
  5933. return r3;
  5934. return -1;
  5935. }
  5936. function a(t3, i3) {
  5937. h2(t3, 0, t3.children.length, i3, t3);
  5938. }
  5939. function h2(t3, i3, n2, r3, e2) {
  5940. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  5941. for (var a2 = i3; a2 < n2; a2++) {
  5942. var h3 = t3.children[a2];
  5943. o(e2, t3.leaf ? r3(h3) : h3);
  5944. }
  5945. return e2;
  5946. }
  5947. function o(t3, i3) {
  5948. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  5949. }
  5950. function s(t3, i3) {
  5951. return t3.minX - i3.minX;
  5952. }
  5953. function l(t3, i3) {
  5954. return t3.minY - i3.minY;
  5955. }
  5956. function f(t3) {
  5957. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  5958. }
  5959. function u(t3) {
  5960. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  5961. }
  5962. function m(t3, i3) {
  5963. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  5964. }
  5965. function c(t3, i3) {
  5966. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  5967. }
  5968. function p(t3) {
  5969. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  5970. }
  5971. function d2(i3, n2, r3, e2, a2) {
  5972. for (var h3 = [n2, r3]; h3.length; )
  5973. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  5974. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  5975. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  5976. }
  5977. }
  5978. return r2.prototype.all = function() {
  5979. return this._all(this.data, []);
  5980. }, r2.prototype.search = function(t3) {
  5981. var i3 = this.data, n2 = [];
  5982. if (!c(t3, i3))
  5983. return n2;
  5984. for (var r3 = this.toBBox, e2 = []; i3; ) {
  5985. for (var a2 = 0; a2 < i3.children.length; a2++) {
  5986. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  5987. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  5988. }
  5989. i3 = e2.pop();
  5990. }
  5991. return n2;
  5992. }, r2.prototype.collides = function(t3) {
  5993. var i3 = this.data;
  5994. if (!c(t3, i3))
  5995. return false;
  5996. for (var n2 = []; i3; ) {
  5997. for (var r3 = 0; r3 < i3.children.length; r3++) {
  5998. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  5999. if (c(t3, a2)) {
  6000. if (i3.leaf || m(t3, a2))
  6001. return true;
  6002. n2.push(e2);
  6003. }
  6004. }
  6005. i3 = n2.pop();
  6006. }
  6007. return false;
  6008. }, r2.prototype.load = function(t3) {
  6009. if (!t3 || !t3.length)
  6010. return this;
  6011. if (t3.length < this._minEntries) {
  6012. for (var i3 = 0; i3 < t3.length; i3++)
  6013. this.insert(t3[i3]);
  6014. return this;
  6015. }
  6016. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  6017. if (this.data.children.length)
  6018. if (this.data.height === n2.height)
  6019. this._splitRoot(this.data, n2);
  6020. else {
  6021. if (this.data.height < n2.height) {
  6022. var r3 = this.data;
  6023. this.data = n2, n2 = r3;
  6024. }
  6025. this._insert(n2, this.data.height - n2.height - 1, true);
  6026. }
  6027. else
  6028. this.data = n2;
  6029. return this;
  6030. }, r2.prototype.insert = function(t3) {
  6031. return t3 && this._insert(t3, this.data.height - 1), this;
  6032. }, r2.prototype.clear = function() {
  6033. return this.data = p([]), this;
  6034. }, r2.prototype.remove = function(t3, i3) {
  6035. if (!t3)
  6036. return this;
  6037. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  6038. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  6039. var f2 = e(t3, h3.children, i3);
  6040. if (-1 !== f2)
  6041. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  6042. }
  6043. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  6044. }
  6045. return this;
  6046. }, r2.prototype.toBBox = function(t3) {
  6047. return t3;
  6048. }, r2.prototype.compareMinX = function(t3, i3) {
  6049. return t3.minX - i3.minX;
  6050. }, r2.prototype.compareMinY = function(t3, i3) {
  6051. return t3.minY - i3.minY;
  6052. }, r2.prototype.toJSON = function() {
  6053. return this.data;
  6054. }, r2.prototype.fromJSON = function(t3) {
  6055. return this.data = t3, this;
  6056. }, r2.prototype._all = function(t3, i3) {
  6057. for (var n2 = []; t3; )
  6058. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  6059. return i3;
  6060. }, r2.prototype._build = function(t3, i3, n2, r3) {
  6061. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  6062. if (h3 <= o2)
  6063. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  6064. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  6065. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  6066. d2(t3, i3, n2, l2, this.compareMinX);
  6067. for (var f2 = i3; f2 <= n2; f2 += l2) {
  6068. var u2 = Math.min(f2 + l2 - 1, n2);
  6069. d2(t3, f2, u2, s2, this.compareMinY);
  6070. for (var m2 = f2; m2 <= u2; m2 += s2) {
  6071. var c2 = Math.min(m2 + s2 - 1, u2);
  6072. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  6073. }
  6074. }
  6075. return a(e2, this.toBBox), e2;
  6076. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  6077. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  6078. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  6079. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  6080. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  6081. }
  6082. i3 = h3 || i3.children[0];
  6083. }
  6084. var m2, c2;
  6085. return i3;
  6086. }, r2.prototype._insert = function(t3, i3, n2) {
  6087. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  6088. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  6089. this._split(e2, i3), i3--;
  6090. this._adjustParentBBoxes(r3, e2, i3);
  6091. }, r2.prototype._split = function(t3, i3) {
  6092. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  6093. this._chooseSplitAxis(n2, e2, r3);
  6094. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  6095. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  6096. }, r2.prototype._splitRoot = function(t3, i3) {
  6097. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  6098. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  6099. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  6100. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  6101. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  6102. }
  6103. return r3 || n2 - i3;
  6104. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  6105. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  6106. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  6107. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  6108. t3.children.sort(r3);
  6109. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  6110. var m2 = t3.children[f2];
  6111. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  6112. }
  6113. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  6114. var p2 = t3.children[c2];
  6115. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  6116. }
  6117. return l2;
  6118. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  6119. for (var r3 = n2; r3 >= 0; r3--)
  6120. o(i3[r3], t3);
  6121. }, r2.prototype._condense = function(t3) {
  6122. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  6123. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  6124. }, r2;
  6125. });
  6126. })(rbush_min$1);
  6127. class TinyQueue {
  6128. constructor(data = [], compare = defaultCompare) {
  6129. this.data = data;
  6130. this.length = this.data.length;
  6131. this.compare = compare;
  6132. if (this.length > 0) {
  6133. for (let i2 = (this.length >> 1) - 1; i2 >= 0; i2--)
  6134. this._down(i2);
  6135. }
  6136. }
  6137. push(item) {
  6138. this.data.push(item);
  6139. this.length++;
  6140. this._up(this.length - 1);
  6141. }
  6142. pop() {
  6143. if (this.length === 0)
  6144. return void 0;
  6145. const top = this.data[0];
  6146. const bottom = this.data.pop();
  6147. this.length--;
  6148. if (this.length > 0) {
  6149. this.data[0] = bottom;
  6150. this._down(0);
  6151. }
  6152. return top;
  6153. }
  6154. peek() {
  6155. return this.data[0];
  6156. }
  6157. _up(pos) {
  6158. const { data, compare } = this;
  6159. const item = data[pos];
  6160. while (pos > 0) {
  6161. const parent = pos - 1 >> 1;
  6162. const current = data[parent];
  6163. if (compare(item, current) >= 0)
  6164. break;
  6165. data[pos] = current;
  6166. pos = parent;
  6167. }
  6168. data[pos] = item;
  6169. }
  6170. _down(pos) {
  6171. const { data, compare } = this;
  6172. const halfLength = this.length >> 1;
  6173. const item = data[pos];
  6174. while (pos < halfLength) {
  6175. let left = (pos << 1) + 1;
  6176. let best = data[left];
  6177. const right = left + 1;
  6178. if (right < this.length && compare(data[right], best) < 0) {
  6179. left = right;
  6180. best = data[right];
  6181. }
  6182. if (compare(best, item) >= 0)
  6183. break;
  6184. data[pos] = best;
  6185. pos = left;
  6186. }
  6187. data[pos] = item;
  6188. }
  6189. }
  6190. function defaultCompare(a, b) {
  6191. return a < b ? -1 : a > b ? 1 : 0;
  6192. }
  6193. var tinyqueue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  6194. __proto__: null,
  6195. "default": TinyQueue
  6196. }, Symbol.toStringTag, { value: "Module" }));
  6197. var require$$1$2 = /* @__PURE__ */ getAugmentedNamespace(tinyqueue);
  6198. var pointInPolygon$1 = { exports: {} };
  6199. var flat = function pointInPolygonFlat(point2, vs, start2, end) {
  6200. var x = point2[0], y = point2[1];
  6201. var inside2 = false;
  6202. if (start2 === void 0)
  6203. start2 = 0;
  6204. if (end === void 0)
  6205. end = vs.length;
  6206. var len = (end - start2) / 2;
  6207. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6208. var xi = vs[start2 + i2 * 2 + 0], yi = vs[start2 + i2 * 2 + 1];
  6209. var xj = vs[start2 + j * 2 + 0], yj = vs[start2 + j * 2 + 1];
  6210. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6211. if (intersect)
  6212. inside2 = !inside2;
  6213. }
  6214. return inside2;
  6215. };
  6216. var nested = function pointInPolygonNested(point2, vs, start2, end) {
  6217. var x = point2[0], y = point2[1];
  6218. var inside2 = false;
  6219. if (start2 === void 0)
  6220. start2 = 0;
  6221. if (end === void 0)
  6222. end = vs.length;
  6223. var len = end - start2;
  6224. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6225. var xi = vs[i2 + start2][0], yi = vs[i2 + start2][1];
  6226. var xj = vs[j + start2][0], yj = vs[j + start2][1];
  6227. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6228. if (intersect)
  6229. inside2 = !inside2;
  6230. }
  6231. return inside2;
  6232. };
  6233. var pointInPolygonFlat2 = flat;
  6234. var pointInPolygonNested2 = nested;
  6235. pointInPolygon$1.exports = function pointInPolygon(point2, vs, start2, end) {
  6236. if (vs.length > 0 && Array.isArray(vs[0])) {
  6237. return pointInPolygonNested2(point2, vs, start2, end);
  6238. } else {
  6239. return pointInPolygonFlat2(point2, vs, start2, end);
  6240. }
  6241. };
  6242. pointInPolygon$1.exports.nested = pointInPolygonNested2;
  6243. pointInPolygon$1.exports.flat = pointInPolygonFlat2;
  6244. var orient2d_min = { exports: {} };
  6245. (function(module2, exports2) {
  6246. !function(t2, e) {
  6247. e(exports2);
  6248. }(commonjsGlobal, function(t2) {
  6249. const e = 134217729, n = 33306690738754706e-32;
  6250. function r2(t3, e2, n2, r3, o2) {
  6251. let f2, i3, u2, c2, s2 = e2[0], a2 = r3[0], d3 = 0, l2 = 0;
  6252. a2 > s2 == a2 > -s2 ? (f2 = s2, s2 = e2[++d3]) : (f2 = a2, a2 = r3[++l2]);
  6253. let p = 0;
  6254. if (d3 < t3 && l2 < n2)
  6255. for (a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = s2 + f2) - s2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = a2 + f2) - a2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2); d3 < t3 && l2 < n2; )
  6256. a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6257. for (; d3 < t3; )
  6258. u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6259. for (; l2 < n2; )
  6260. u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6261. return 0 === f2 && 0 !== p || (o2[p++] = f2), p;
  6262. }
  6263. function o(t3) {
  6264. return new Float64Array(t3);
  6265. }
  6266. const f = 33306690738754716e-32, i2 = 22204460492503146e-32, u = 11093356479670487e-47, c = o(4), s = o(8), a = o(12), d2 = o(16), l = o(4);
  6267. t2.orient2d = function(t3, o2, p, b, y, h2) {
  6268. const M = (o2 - h2) * (p - y), x = (t3 - y) * (b - h2), j = M - x;
  6269. if (0 === M || 0 === x || M > 0 != x > 0)
  6270. return j;
  6271. const m = Math.abs(M + x);
  6272. return Math.abs(j) >= f * m ? j : -function(t4, o3, f2, p2, b2, y2, h3) {
  6273. let M2, x2, j2, m2, _, v, w, A, F, O, P2, g, k, q2, z, B2, C2, D;
  6274. const E2 = t4 - b2, G2 = f2 - b2, H2 = o3 - y2, I2 = p2 - y2;
  6275. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = E2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = H2 * G2) - w * F - A * F - w * O))), c[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), c[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, c[2] = g - (D - _) + (P2 - _), c[3] = D;
  6276. let J2 = function(t5, e2) {
  6277. let n2 = e2[0];
  6278. for (let r3 = 1; r3 < t5; r3++)
  6279. n2 += e2[r3];
  6280. return n2;
  6281. }(4, c), K2 = i2 * h3;
  6282. if (J2 >= K2 || -J2 >= K2)
  6283. return J2;
  6284. if (M2 = t4 - (E2 + (_ = t4 - E2)) + (_ - b2), j2 = f2 - (G2 + (_ = f2 - G2)) + (_ - b2), x2 = o3 - (H2 + (_ = o3 - H2)) + (_ - y2), m2 = p2 - (I2 + (_ = p2 - I2)) + (_ - y2), 0 === M2 && 0 === x2 && 0 === j2 && 0 === m2)
  6285. return J2;
  6286. if (K2 = u * h3 + n * Math.abs(J2), (J2 += E2 * m2 + I2 * M2 - (H2 * j2 + G2 * x2)) >= K2 || -J2 >= K2)
  6287. return J2;
  6288. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = M2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = x2 * G2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6289. const L = r2(4, c, 4, l, s);
  6290. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = E2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = H2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6291. const N2 = r2(L, s, 4, l, a);
  6292. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = M2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = x2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6293. const Q2 = r2(N2, a, 4, l, d2);
  6294. return d2[Q2 - 1];
  6295. }(t3, o2, p, b, y, h2, m);
  6296. }, t2.orient2dfast = function(t3, e2, n2, r3, o2, f2) {
  6297. return (e2 - f2) * (n2 - o2) - (t3 - o2) * (r3 - f2);
  6298. }, Object.defineProperty(t2, "__esModule", { value: true });
  6299. });
  6300. })(orient2d_min, orient2d_min.exports);
  6301. var RBush = rbush_min$1.exports;
  6302. var Queue = require$$1$2;
  6303. var pointInPolygon2 = pointInPolygon$1.exports;
  6304. var orient = orient2d_min.exports.orient2d;
  6305. if (Queue.default) {
  6306. Queue = Queue.default;
  6307. }
  6308. concaveman$2.exports = concaveman;
  6309. concaveman$2.exports.default = concaveman;
  6310. function concaveman(points2, concavity, lengthThreshold) {
  6311. concavity = Math.max(0, concavity === void 0 ? 2 : concavity);
  6312. lengthThreshold = lengthThreshold || 0;
  6313. var hull = fastConvexHull(points2);
  6314. var tree = new RBush(16);
  6315. tree.toBBox = function(a2) {
  6316. return {
  6317. minX: a2[0],
  6318. minY: a2[1],
  6319. maxX: a2[0],
  6320. maxY: a2[1]
  6321. };
  6322. };
  6323. tree.compareMinX = function(a2, b2) {
  6324. return a2[0] - b2[0];
  6325. };
  6326. tree.compareMinY = function(a2, b2) {
  6327. return a2[1] - b2[1];
  6328. };
  6329. tree.load(points2);
  6330. var queue = [];
  6331. for (var i2 = 0, last; i2 < hull.length; i2++) {
  6332. var p = hull[i2];
  6333. tree.remove(p);
  6334. last = insertNode(p, last);
  6335. queue.push(last);
  6336. }
  6337. var segTree = new RBush(16);
  6338. for (i2 = 0; i2 < queue.length; i2++)
  6339. segTree.insert(updateBBox(queue[i2]));
  6340. var sqConcavity = concavity * concavity;
  6341. var sqLenThreshold = lengthThreshold * lengthThreshold;
  6342. while (queue.length) {
  6343. var node = queue.shift();
  6344. var a = node.p;
  6345. var b = node.next.p;
  6346. var sqLen = getSqDist(a, b);
  6347. if (sqLen < sqLenThreshold)
  6348. continue;
  6349. var maxSqLen = sqLen / sqConcavity;
  6350. p = findCandidate(tree, node.prev.p, a, b, node.next.next.p, maxSqLen, segTree);
  6351. if (p && Math.min(getSqDist(p, a), getSqDist(p, b)) <= maxSqLen) {
  6352. queue.push(node);
  6353. queue.push(insertNode(p, node));
  6354. tree.remove(p);
  6355. segTree.remove(node);
  6356. segTree.insert(updateBBox(node));
  6357. segTree.insert(updateBBox(node.next));
  6358. }
  6359. }
  6360. node = last;
  6361. var concave = [];
  6362. do {
  6363. concave.push(node.p);
  6364. node = node.next;
  6365. } while (node !== last);
  6366. concave.push(node.p);
  6367. return concave;
  6368. }
  6369. function findCandidate(tree, a, b, c, d2, maxDist, segTree) {
  6370. var queue = new Queue([], compareDist);
  6371. var node = tree.data;
  6372. while (node) {
  6373. for (var i2 = 0; i2 < node.children.length; i2++) {
  6374. var child = node.children[i2];
  6375. var dist = node.leaf ? sqSegDist(child, b, c) : sqSegBoxDist(b, c, child);
  6376. if (dist > maxDist)
  6377. continue;
  6378. queue.push({
  6379. node: child,
  6380. dist
  6381. });
  6382. }
  6383. while (queue.length && !queue.peek().node.children) {
  6384. var item = queue.pop();
  6385. var p = item.node;
  6386. var d0 = sqSegDist(p, a, b);
  6387. var d1 = sqSegDist(p, c, d2);
  6388. if (item.dist < d0 && item.dist < d1 && noIntersections(b, p, segTree) && noIntersections(c, p, segTree))
  6389. return p;
  6390. }
  6391. node = queue.pop();
  6392. if (node)
  6393. node = node.node;
  6394. }
  6395. return null;
  6396. }
  6397. function compareDist(a, b) {
  6398. return a.dist - b.dist;
  6399. }
  6400. function sqSegBoxDist(a, b, bbox2) {
  6401. if (inside(a, bbox2) || inside(b, bbox2))
  6402. return 0;
  6403. var d1 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.maxX, bbox2.minY);
  6404. if (d1 === 0)
  6405. return 0;
  6406. var d2 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.minX, bbox2.maxY);
  6407. if (d2 === 0)
  6408. return 0;
  6409. var d3 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.maxX, bbox2.minY, bbox2.maxX, bbox2.maxY);
  6410. if (d3 === 0)
  6411. return 0;
  6412. var d4 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.maxY, bbox2.maxX, bbox2.maxY);
  6413. if (d4 === 0)
  6414. return 0;
  6415. return Math.min(d1, d2, d3, d4);
  6416. }
  6417. function inside(a, bbox2) {
  6418. return a[0] >= bbox2.minX && a[0] <= bbox2.maxX && a[1] >= bbox2.minY && a[1] <= bbox2.maxY;
  6419. }
  6420. function noIntersections(a, b, segTree) {
  6421. var minX = Math.min(a[0], b[0]);
  6422. var minY = Math.min(a[1], b[1]);
  6423. var maxX = Math.max(a[0], b[0]);
  6424. var maxY = Math.max(a[1], b[1]);
  6425. var edges = segTree.search({ minX, minY, maxX, maxY });
  6426. for (var i2 = 0; i2 < edges.length; i2++) {
  6427. if (intersects$1(edges[i2].p, edges[i2].next.p, a, b))
  6428. return false;
  6429. }
  6430. return true;
  6431. }
  6432. function cross(p1, p2, p3) {
  6433. return orient(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
  6434. }
  6435. function intersects$1(p1, q1, p2, q2) {
  6436. return p1 !== q2 && q1 !== p2 && cross(p1, q1, p2) > 0 !== cross(p1, q1, q2) > 0 && cross(p2, q2, p1) > 0 !== cross(p2, q2, q1) > 0;
  6437. }
  6438. function updateBBox(node) {
  6439. var p1 = node.p;
  6440. var p2 = node.next.p;
  6441. node.minX = Math.min(p1[0], p2[0]);
  6442. node.minY = Math.min(p1[1], p2[1]);
  6443. node.maxX = Math.max(p1[0], p2[0]);
  6444. node.maxY = Math.max(p1[1], p2[1]);
  6445. return node;
  6446. }
  6447. function fastConvexHull(points2) {
  6448. var left = points2[0];
  6449. var top = points2[0];
  6450. var right = points2[0];
  6451. var bottom = points2[0];
  6452. for (var i2 = 0; i2 < points2.length; i2++) {
  6453. var p = points2[i2];
  6454. if (p[0] < left[0])
  6455. left = p;
  6456. if (p[0] > right[0])
  6457. right = p;
  6458. if (p[1] < top[1])
  6459. top = p;
  6460. if (p[1] > bottom[1])
  6461. bottom = p;
  6462. }
  6463. var cull = [left, top, right, bottom];
  6464. var filtered = cull.slice();
  6465. for (i2 = 0; i2 < points2.length; i2++) {
  6466. if (!pointInPolygon2(points2[i2], cull))
  6467. filtered.push(points2[i2]);
  6468. }
  6469. return convexHull(filtered);
  6470. }
  6471. function insertNode(p, prev) {
  6472. var node = {
  6473. p,
  6474. prev: null,
  6475. next: null,
  6476. minX: 0,
  6477. minY: 0,
  6478. maxX: 0,
  6479. maxY: 0
  6480. };
  6481. if (!prev) {
  6482. node.prev = node;
  6483. node.next = node;
  6484. } else {
  6485. node.next = prev.next;
  6486. node.prev = prev;
  6487. prev.next.prev = node;
  6488. prev.next = node;
  6489. }
  6490. return node;
  6491. }
  6492. function getSqDist(p1, p2) {
  6493. var dx = p1[0] - p2[0], dy = p1[1] - p2[1];
  6494. return dx * dx + dy * dy;
  6495. }
  6496. function sqSegDist(p, p1, p2) {
  6497. var x = p1[0], y = p1[1], dx = p2[0] - x, dy = p2[1] - y;
  6498. if (dx !== 0 || dy !== 0) {
  6499. var t2 = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
  6500. if (t2 > 1) {
  6501. x = p2[0];
  6502. y = p2[1];
  6503. } else if (t2 > 0) {
  6504. x += dx * t2;
  6505. y += dy * t2;
  6506. }
  6507. }
  6508. dx = p[0] - x;
  6509. dy = p[1] - y;
  6510. return dx * dx + dy * dy;
  6511. }
  6512. function sqSegSegDist(x0, y0, x1, y1, x2, y2, x3, y3) {
  6513. var ux = x1 - x0;
  6514. var uy = y1 - y0;
  6515. var vx = x3 - x2;
  6516. var vy = y3 - y2;
  6517. var wx = x0 - x2;
  6518. var wy = y0 - y2;
  6519. var a = ux * ux + uy * uy;
  6520. var b = ux * vx + uy * vy;
  6521. var c = vx * vx + vy * vy;
  6522. var d2 = ux * wx + uy * wy;
  6523. var e = vx * wx + vy * wy;
  6524. var D = a * c - b * b;
  6525. var sc, sN, tc, tN;
  6526. var sD = D;
  6527. var tD = D;
  6528. if (D === 0) {
  6529. sN = 0;
  6530. sD = 1;
  6531. tN = e;
  6532. tD = c;
  6533. } else {
  6534. sN = b * e - c * d2;
  6535. tN = a * e - b * d2;
  6536. if (sN < 0) {
  6537. sN = 0;
  6538. tN = e;
  6539. tD = c;
  6540. } else if (sN > sD) {
  6541. sN = sD;
  6542. tN = e + b;
  6543. tD = c;
  6544. }
  6545. }
  6546. if (tN < 0) {
  6547. tN = 0;
  6548. if (-d2 < 0)
  6549. sN = 0;
  6550. else if (-d2 > a)
  6551. sN = sD;
  6552. else {
  6553. sN = -d2;
  6554. sD = a;
  6555. }
  6556. } else if (tN > tD) {
  6557. tN = tD;
  6558. if (-d2 + b < 0)
  6559. sN = 0;
  6560. else if (-d2 + b > a)
  6561. sN = sD;
  6562. else {
  6563. sN = -d2 + b;
  6564. sD = a;
  6565. }
  6566. }
  6567. sc = sN === 0 ? 0 : sN / sD;
  6568. tc = tN === 0 ? 0 : tN / tD;
  6569. var cx = (1 - sc) * x0 + sc * x1;
  6570. var cy = (1 - sc) * y0 + sc * y1;
  6571. var cx2 = (1 - tc) * x2 + tc * x3;
  6572. var cy2 = (1 - tc) * y2 + tc * y3;
  6573. var dx = cx2 - cx;
  6574. var dy = cy2 - cy;
  6575. return dx * dx + dy * dy;
  6576. }
  6577. function compareByX(a, b) {
  6578. return a[0] === b[0] ? a[1] - b[1] : a[0] - b[0];
  6579. }
  6580. function convexHull(points2) {
  6581. points2.sort(compareByX);
  6582. var lower = [];
  6583. for (var i2 = 0; i2 < points2.length; i2++) {
  6584. while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points2[i2]) <= 0) {
  6585. lower.pop();
  6586. }
  6587. lower.push(points2[i2]);
  6588. }
  6589. var upper = [];
  6590. for (var ii = points2.length - 1; ii >= 0; ii--) {
  6591. while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points2[ii]) <= 0) {
  6592. upper.pop();
  6593. }
  6594. upper.push(points2[ii]);
  6595. }
  6596. upper.pop();
  6597. lower.pop();
  6598. return lower.concat(upper);
  6599. }
  6600. var concaveman$1 = concaveman$2.exports;
  6601. function convex(geojson, options2) {
  6602. if (options2 === void 0) {
  6603. options2 = {};
  6604. }
  6605. options2.concavity = options2.concavity || Infinity;
  6606. var points2 = [];
  6607. coordEach(geojson, function(coord) {
  6608. points2.push([coord[0], coord[1]]);
  6609. });
  6610. if (!points2.length) {
  6611. return null;
  6612. }
  6613. var convexHull2 = concaveman$1(points2, options2.concavity);
  6614. if (convexHull2.length > 3) {
  6615. return polygon([convexHull2]);
  6616. }
  6617. return null;
  6618. }
  6619. function booleanPointInPolygon(point2, polygon2, options2) {
  6620. if (options2 === void 0) {
  6621. options2 = {};
  6622. }
  6623. if (!point2) {
  6624. throw new Error("point is required");
  6625. }
  6626. if (!polygon2) {
  6627. throw new Error("polygon is required");
  6628. }
  6629. var pt2 = getCoord(point2);
  6630. var geom = getGeom(polygon2);
  6631. var type2 = geom.type;
  6632. var bbox2 = polygon2.bbox;
  6633. var polys = geom.coordinates;
  6634. if (bbox2 && inBBox(pt2, bbox2) === false) {
  6635. return false;
  6636. }
  6637. if (type2 === "Polygon") {
  6638. polys = [polys];
  6639. }
  6640. var insidePoly = false;
  6641. for (var i2 = 0; i2 < polys.length && !insidePoly; i2++) {
  6642. if (inRing(pt2, polys[i2][0], options2.ignoreBoundary)) {
  6643. var inHole = false;
  6644. var k = 1;
  6645. while (k < polys[i2].length && !inHole) {
  6646. if (inRing(pt2, polys[i2][k], !options2.ignoreBoundary)) {
  6647. inHole = true;
  6648. }
  6649. k++;
  6650. }
  6651. if (!inHole) {
  6652. insidePoly = true;
  6653. }
  6654. }
  6655. }
  6656. return insidePoly;
  6657. }
  6658. function inRing(pt2, ring, ignoreBoundary) {
  6659. var isInside = false;
  6660. if (ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1]) {
  6661. ring = ring.slice(0, ring.length - 1);
  6662. }
  6663. for (var i2 = 0, j = ring.length - 1; i2 < ring.length; j = i2++) {
  6664. var xi = ring[i2][0];
  6665. var yi = ring[i2][1];
  6666. var xj = ring[j][0];
  6667. var yj = ring[j][1];
  6668. var onBoundary = pt2[1] * (xi - xj) + yi * (xj - pt2[0]) + yj * (pt2[0] - xi) === 0 && (xi - pt2[0]) * (xj - pt2[0]) <= 0 && (yi - pt2[1]) * (yj - pt2[1]) <= 0;
  6669. if (onBoundary) {
  6670. return !ignoreBoundary;
  6671. }
  6672. var intersect = yi > pt2[1] !== yj > pt2[1] && pt2[0] < (xj - xi) * (pt2[1] - yi) / (yj - yi) + xi;
  6673. if (intersect) {
  6674. isInside = !isInside;
  6675. }
  6676. }
  6677. return isInside;
  6678. }
  6679. function inBBox(pt2, bbox2) {
  6680. return bbox2[0] <= pt2[0] && bbox2[1] <= pt2[1] && bbox2[2] >= pt2[0] && bbox2[3] >= pt2[1];
  6681. }
  6682. function distance(from3, to, options2) {
  6683. if (options2 === void 0) {
  6684. options2 = {};
  6685. }
  6686. var coordinates1 = getCoord(from3);
  6687. var coordinates2 = getCoord(to);
  6688. var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);
  6689. var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);
  6690. var lat1 = degreesToRadians(coordinates1[1]);
  6691. var lat2 = degreesToRadians(coordinates2[1]);
  6692. var a = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
  6693. return radiansToLength(2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), options2.units);
  6694. }
  6695. function bboxPolygon(bbox2, options2) {
  6696. if (options2 === void 0) {
  6697. options2 = {};
  6698. }
  6699. var west = Number(bbox2[0]);
  6700. var south = Number(bbox2[1]);
  6701. var east = Number(bbox2[2]);
  6702. var north = Number(bbox2[3]);
  6703. if (bbox2.length === 6) {
  6704. throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
  6705. }
  6706. var lowLeft = [west, south];
  6707. var topLeft = [west, north];
  6708. var topRight = [east, north];
  6709. var lowRight = [east, south];
  6710. return polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options2.properties, { bbox: bbox2, id: options2.id });
  6711. }
  6712. function destination(origin, distance2, bearing2, options2) {
  6713. if (options2 === void 0) {
  6714. options2 = {};
  6715. }
  6716. var coordinates1 = getCoord(origin);
  6717. var longitude1 = degreesToRadians(coordinates1[0]);
  6718. var latitude1 = degreesToRadians(coordinates1[1]);
  6719. var bearingRad = degreesToRadians(bearing2);
  6720. var radians = lengthToRadians(distance2, options2.units);
  6721. var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) + Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));
  6722. var longitude2 = longitude1 + Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));
  6723. var lng = radiansToDegrees(longitude2);
  6724. var lat = radiansToDegrees(latitude2);
  6725. return point([lng, lat], options2.properties);
  6726. }
  6727. function bearing(start2, end, options2) {
  6728. if (options2 === void 0) {
  6729. options2 = {};
  6730. }
  6731. if (options2.final === true) {
  6732. return calculateFinalBearing(start2, end);
  6733. }
  6734. var coordinates1 = getCoord(start2);
  6735. var coordinates2 = getCoord(end);
  6736. var lon1 = degreesToRadians(coordinates1[0]);
  6737. var lon2 = degreesToRadians(coordinates2[0]);
  6738. var lat1 = degreesToRadians(coordinates1[1]);
  6739. var lat2 = degreesToRadians(coordinates2[1]);
  6740. var a = Math.sin(lon2 - lon1) * Math.cos(lat2);
  6741. var b = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);
  6742. return radiansToDegrees(Math.atan2(a, b));
  6743. }
  6744. function calculateFinalBearing(start2, end) {
  6745. var bear = bearing(end, start2);
  6746. bear = (bear + 180) % 360;
  6747. return bear;
  6748. }
  6749. function midpoint(point1, point2) {
  6750. var dist = distance(point1, point2);
  6751. var heading = bearing(point1, point2);
  6752. var midpoint2 = destination(point1, dist / 2, heading);
  6753. return midpoint2;
  6754. }
  6755. function center(geojson, options2) {
  6756. if (options2 === void 0) {
  6757. options2 = {};
  6758. }
  6759. var ext = bbox$1(geojson);
  6760. var x = (ext[0] + ext[2]) / 2;
  6761. var y = (ext[1] + ext[3]) / 2;
  6762. return point([x, y], options2.properties, options2);
  6763. }
  6764. function centroid(geojson, options2) {
  6765. if (options2 === void 0) {
  6766. options2 = {};
  6767. }
  6768. var xSum = 0;
  6769. var ySum = 0;
  6770. var len = 0;
  6771. coordEach(geojson, function(coord) {
  6772. xSum += coord[0];
  6773. ySum += coord[1];
  6774. len++;
  6775. }, true);
  6776. return point([xSum / len, ySum / len], options2.properties);
  6777. }
  6778. function centerOfMass(geojson, options2) {
  6779. if (options2 === void 0) {
  6780. options2 = {};
  6781. }
  6782. switch (getType(geojson)) {
  6783. case "Point":
  6784. return point(getCoord(geojson), options2.properties);
  6785. case "Polygon":
  6786. var coords = [];
  6787. coordEach(geojson, function(coord) {
  6788. coords.push(coord);
  6789. });
  6790. var centre = centroid(geojson, { properties: options2.properties });
  6791. var translation = centre.geometry.coordinates;
  6792. var sx = 0;
  6793. var sy = 0;
  6794. var sArea = 0;
  6795. var i2, pi, pj, xi, xj, yi, yj, a;
  6796. var neutralizedPoints = coords.map(function(point2) {
  6797. return [point2[0] - translation[0], point2[1] - translation[1]];
  6798. });
  6799. for (i2 = 0; i2 < coords.length - 1; i2++) {
  6800. pi = neutralizedPoints[i2];
  6801. xi = pi[0];
  6802. yi = pi[1];
  6803. pj = neutralizedPoints[i2 + 1];
  6804. xj = pj[0];
  6805. yj = pj[1];
  6806. a = xi * yj - xj * yi;
  6807. sArea += a;
  6808. sx += (xi + xj) * a;
  6809. sy += (yi + yj) * a;
  6810. }
  6811. if (sArea === 0) {
  6812. return centre;
  6813. } else {
  6814. var area = sArea * 0.5;
  6815. var areaFactor = 1 / (6 * area);
  6816. return point([translation[0] + areaFactor * sx, translation[1] + areaFactor * sy], options2.properties);
  6817. }
  6818. default:
  6819. var hull = convex(geojson);
  6820. if (hull)
  6821. return centerOfMass(hull, { properties: options2.properties });
  6822. else
  6823. return centroid(geojson, { properties: options2.properties });
  6824. }
  6825. }
  6826. function lineSegment(geojson) {
  6827. if (!geojson) {
  6828. throw new Error("geojson is required");
  6829. }
  6830. var results = [];
  6831. flattenEach(geojson, function(feature2) {
  6832. lineSegmentFeature(feature2, results);
  6833. });
  6834. return featureCollection$1(results);
  6835. }
  6836. function lineSegmentFeature(geojson, results) {
  6837. var coords = [];
  6838. var geometry2 = geojson.geometry;
  6839. if (geometry2 !== null) {
  6840. switch (geometry2.type) {
  6841. case "Polygon":
  6842. coords = getCoords(geometry2);
  6843. break;
  6844. case "LineString":
  6845. coords = [getCoords(geometry2)];
  6846. }
  6847. coords.forEach(function(coord) {
  6848. var segments = createSegments(coord, geojson.properties);
  6849. segments.forEach(function(segment) {
  6850. segment.id = results.length;
  6851. results.push(segment);
  6852. });
  6853. });
  6854. }
  6855. }
  6856. function createSegments(coords, properties) {
  6857. var segments = [];
  6858. coords.reduce(function(previousCoords, currentCoords) {
  6859. var segment = lineString([previousCoords, currentCoords], properties);
  6860. segment.bbox = bbox(previousCoords, currentCoords);
  6861. segments.push(segment);
  6862. return currentCoords;
  6863. });
  6864. return segments;
  6865. }
  6866. function bbox(coords1, coords2) {
  6867. var x1 = coords1[0];
  6868. var y1 = coords1[1];
  6869. var x2 = coords2[0];
  6870. var y2 = coords2[1];
  6871. var west = x1 < x2 ? x1 : x2;
  6872. var south = y1 < y2 ? y1 : y2;
  6873. var east = x1 > x2 ? x1 : x2;
  6874. var north = y1 > y2 ? y1 : y2;
  6875. return [west, south, east, north];
  6876. }
  6877. var geojsonRbush$1 = { exports: {} };
  6878. var rbush_min = { exports: {} };
  6879. (function(module2, exports2) {
  6880. !function(t2, i2) {
  6881. module2.exports = i2();
  6882. }(commonjsGlobal, function() {
  6883. function t2(t3, r3, e2, a2, h3) {
  6884. !function t4(n2, r4, e3, a3, h4) {
  6885. for (; a3 > e3; ) {
  6886. if (a3 - e3 > 600) {
  6887. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  6888. t4(n2, r4, m2, c2, h4);
  6889. }
  6890. var p2 = n2[r4], d3 = e3, x = a3;
  6891. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  6892. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  6893. d3++;
  6894. for (; h4(n2[x], p2) > 0; )
  6895. x--;
  6896. }
  6897. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  6898. }
  6899. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  6900. }
  6901. function i2(t3, i3, n2) {
  6902. var r3 = t3[i3];
  6903. t3[i3] = t3[n2], t3[n2] = r3;
  6904. }
  6905. function n(t3, i3) {
  6906. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  6907. }
  6908. var r2 = function(t3) {
  6909. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  6910. };
  6911. function e(t3, i3, n2) {
  6912. if (!n2)
  6913. return i3.indexOf(t3);
  6914. for (var r3 = 0; r3 < i3.length; r3++)
  6915. if (n2(t3, i3[r3]))
  6916. return r3;
  6917. return -1;
  6918. }
  6919. function a(t3, i3) {
  6920. h2(t3, 0, t3.children.length, i3, t3);
  6921. }
  6922. function h2(t3, i3, n2, r3, e2) {
  6923. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  6924. for (var a2 = i3; a2 < n2; a2++) {
  6925. var h3 = t3.children[a2];
  6926. o(e2, t3.leaf ? r3(h3) : h3);
  6927. }
  6928. return e2;
  6929. }
  6930. function o(t3, i3) {
  6931. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  6932. }
  6933. function s(t3, i3) {
  6934. return t3.minX - i3.minX;
  6935. }
  6936. function l(t3, i3) {
  6937. return t3.minY - i3.minY;
  6938. }
  6939. function f(t3) {
  6940. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  6941. }
  6942. function u(t3) {
  6943. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  6944. }
  6945. function m(t3, i3) {
  6946. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  6947. }
  6948. function c(t3, i3) {
  6949. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  6950. }
  6951. function p(t3) {
  6952. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  6953. }
  6954. function d2(i3, n2, r3, e2, a2) {
  6955. for (var h3 = [n2, r3]; h3.length; )
  6956. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  6957. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  6958. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  6959. }
  6960. }
  6961. return r2.prototype.all = function() {
  6962. return this._all(this.data, []);
  6963. }, r2.prototype.search = function(t3) {
  6964. var i3 = this.data, n2 = [];
  6965. if (!c(t3, i3))
  6966. return n2;
  6967. for (var r3 = this.toBBox, e2 = []; i3; ) {
  6968. for (var a2 = 0; a2 < i3.children.length; a2++) {
  6969. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  6970. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  6971. }
  6972. i3 = e2.pop();
  6973. }
  6974. return n2;
  6975. }, r2.prototype.collides = function(t3) {
  6976. var i3 = this.data;
  6977. if (!c(t3, i3))
  6978. return false;
  6979. for (var n2 = []; i3; ) {
  6980. for (var r3 = 0; r3 < i3.children.length; r3++) {
  6981. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  6982. if (c(t3, a2)) {
  6983. if (i3.leaf || m(t3, a2))
  6984. return true;
  6985. n2.push(e2);
  6986. }
  6987. }
  6988. i3 = n2.pop();
  6989. }
  6990. return false;
  6991. }, r2.prototype.load = function(t3) {
  6992. if (!t3 || !t3.length)
  6993. return this;
  6994. if (t3.length < this._minEntries) {
  6995. for (var i3 = 0; i3 < t3.length; i3++)
  6996. this.insert(t3[i3]);
  6997. return this;
  6998. }
  6999. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  7000. if (this.data.children.length)
  7001. if (this.data.height === n2.height)
  7002. this._splitRoot(this.data, n2);
  7003. else {
  7004. if (this.data.height < n2.height) {
  7005. var r3 = this.data;
  7006. this.data = n2, n2 = r3;
  7007. }
  7008. this._insert(n2, this.data.height - n2.height - 1, true);
  7009. }
  7010. else
  7011. this.data = n2;
  7012. return this;
  7013. }, r2.prototype.insert = function(t3) {
  7014. return t3 && this._insert(t3, this.data.height - 1), this;
  7015. }, r2.prototype.clear = function() {
  7016. return this.data = p([]), this;
  7017. }, r2.prototype.remove = function(t3, i3) {
  7018. if (!t3)
  7019. return this;
  7020. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  7021. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  7022. var f2 = e(t3, h3.children, i3);
  7023. if (-1 !== f2)
  7024. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  7025. }
  7026. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  7027. }
  7028. return this;
  7029. }, r2.prototype.toBBox = function(t3) {
  7030. return t3;
  7031. }, r2.prototype.compareMinX = function(t3, i3) {
  7032. return t3.minX - i3.minX;
  7033. }, r2.prototype.compareMinY = function(t3, i3) {
  7034. return t3.minY - i3.minY;
  7035. }, r2.prototype.toJSON = function() {
  7036. return this.data;
  7037. }, r2.prototype.fromJSON = function(t3) {
  7038. return this.data = t3, this;
  7039. }, r2.prototype._all = function(t3, i3) {
  7040. for (var n2 = []; t3; )
  7041. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  7042. return i3;
  7043. }, r2.prototype._build = function(t3, i3, n2, r3) {
  7044. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  7045. if (h3 <= o2)
  7046. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  7047. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  7048. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  7049. d2(t3, i3, n2, l2, this.compareMinX);
  7050. for (var f2 = i3; f2 <= n2; f2 += l2) {
  7051. var u2 = Math.min(f2 + l2 - 1, n2);
  7052. d2(t3, f2, u2, s2, this.compareMinY);
  7053. for (var m2 = f2; m2 <= u2; m2 += s2) {
  7054. var c2 = Math.min(m2 + s2 - 1, u2);
  7055. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  7056. }
  7057. }
  7058. return a(e2, this.toBBox), e2;
  7059. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  7060. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  7061. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  7062. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  7063. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  7064. }
  7065. i3 = h3 || i3.children[0];
  7066. }
  7067. var m2, c2;
  7068. return i3;
  7069. }, r2.prototype._insert = function(t3, i3, n2) {
  7070. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  7071. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  7072. this._split(e2, i3), i3--;
  7073. this._adjustParentBBoxes(r3, e2, i3);
  7074. }, r2.prototype._split = function(t3, i3) {
  7075. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  7076. this._chooseSplitAxis(n2, e2, r3);
  7077. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  7078. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  7079. }, r2.prototype._splitRoot = function(t3, i3) {
  7080. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  7081. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  7082. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  7083. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  7084. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  7085. }
  7086. return r3 || n2 - i3;
  7087. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  7088. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  7089. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  7090. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  7091. t3.children.sort(r3);
  7092. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  7093. var m2 = t3.children[f2];
  7094. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  7095. }
  7096. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  7097. var p2 = t3.children[c2];
  7098. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  7099. }
  7100. return l2;
  7101. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  7102. for (var r3 = n2; r3 >= 0; r3--)
  7103. o(i3[r3], t3);
  7104. }, r2.prototype._condense = function(t3) {
  7105. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  7106. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  7107. }, r2;
  7108. });
  7109. })(rbush_min);
  7110. var require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(es$2);
  7111. var require$$2 = /* @__PURE__ */ getAugmentedNamespace(es$1);
  7112. var require$$3 = /* @__PURE__ */ getAugmentedNamespace(es);
  7113. var rbush = rbush_min.exports;
  7114. var helpers = require$$1$1;
  7115. var meta = require$$2;
  7116. var turfBBox = require$$3.default;
  7117. var featureEach = meta.featureEach;
  7118. meta.coordEach;
  7119. helpers.polygon;
  7120. var featureCollection = helpers.featureCollection;
  7121. function geojsonRbush(maxEntries) {
  7122. var tree = new rbush(maxEntries);
  7123. tree.insert = function(feature2) {
  7124. if (feature2.type !== "Feature")
  7125. throw new Error("invalid feature");
  7126. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7127. return rbush.prototype.insert.call(this, feature2);
  7128. };
  7129. tree.load = function(features) {
  7130. var load = [];
  7131. if (Array.isArray(features)) {
  7132. features.forEach(function(feature2) {
  7133. if (feature2.type !== "Feature")
  7134. throw new Error("invalid features");
  7135. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7136. load.push(feature2);
  7137. });
  7138. } else {
  7139. featureEach(features, function(feature2) {
  7140. if (feature2.type !== "Feature")
  7141. throw new Error("invalid features");
  7142. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7143. load.push(feature2);
  7144. });
  7145. }
  7146. return rbush.prototype.load.call(this, load);
  7147. };
  7148. tree.remove = function(feature2, equals) {
  7149. if (feature2.type !== "Feature")
  7150. throw new Error("invalid feature");
  7151. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7152. return rbush.prototype.remove.call(this, feature2, equals);
  7153. };
  7154. tree.clear = function() {
  7155. return rbush.prototype.clear.call(this);
  7156. };
  7157. tree.search = function(geojson) {
  7158. var features = rbush.prototype.search.call(this, this.toBBox(geojson));
  7159. return featureCollection(features);
  7160. };
  7161. tree.collides = function(geojson) {
  7162. return rbush.prototype.collides.call(this, this.toBBox(geojson));
  7163. };
  7164. tree.all = function() {
  7165. var features = rbush.prototype.all.call(this);
  7166. return featureCollection(features);
  7167. };
  7168. tree.toJSON = function() {
  7169. return rbush.prototype.toJSON.call(this);
  7170. };
  7171. tree.fromJSON = function(json) {
  7172. return rbush.prototype.fromJSON.call(this, json);
  7173. };
  7174. tree.toBBox = function(geojson) {
  7175. var bbox2;
  7176. if (geojson.bbox)
  7177. bbox2 = geojson.bbox;
  7178. else if (Array.isArray(geojson) && geojson.length === 4)
  7179. bbox2 = geojson;
  7180. else if (Array.isArray(geojson) && geojson.length === 6)
  7181. bbox2 = [geojson[0], geojson[1], geojson[3], geojson[4]];
  7182. else if (geojson.type === "Feature")
  7183. bbox2 = turfBBox(geojson);
  7184. else if (geojson.type === "FeatureCollection")
  7185. bbox2 = turfBBox(geojson);
  7186. else
  7187. throw new Error("invalid geojson");
  7188. return {
  7189. minX: bbox2[0],
  7190. minY: bbox2[1],
  7191. maxX: bbox2[2],
  7192. maxY: bbox2[3]
  7193. };
  7194. };
  7195. return tree;
  7196. }
  7197. geojsonRbush$1.exports = geojsonRbush;
  7198. geojsonRbush$1.exports.default = geojsonRbush;
  7199. var rbush$1 = geojsonRbush$1.exports;
  7200. function lineIntersect(line1, line2) {
  7201. var unique = {};
  7202. var results = [];
  7203. if (line1.type === "LineString") {
  7204. line1 = feature(line1);
  7205. }
  7206. if (line2.type === "LineString") {
  7207. line2 = feature(line2);
  7208. }
  7209. if (line1.type === "Feature" && line2.type === "Feature" && line1.geometry !== null && line2.geometry !== null && line1.geometry.type === "LineString" && line2.geometry.type === "LineString" && line1.geometry.coordinates.length === 2 && line2.geometry.coordinates.length === 2) {
  7210. var intersect = intersects(line1, line2);
  7211. if (intersect) {
  7212. results.push(intersect);
  7213. }
  7214. return featureCollection$1(results);
  7215. }
  7216. var tree = rbush$1();
  7217. tree.load(lineSegment(line2));
  7218. featureEach$1(lineSegment(line1), function(segment) {
  7219. featureEach$1(tree.search(segment), function(match) {
  7220. var intersect2 = intersects(segment, match);
  7221. if (intersect2) {
  7222. var key = getCoords(intersect2).join(",");
  7223. if (!unique[key]) {
  7224. unique[key] = true;
  7225. results.push(intersect2);
  7226. }
  7227. }
  7228. });
  7229. });
  7230. return featureCollection$1(results);
  7231. }
  7232. function intersects(line1, line2) {
  7233. var coords1 = getCoords(line1);
  7234. var coords2 = getCoords(line2);
  7235. if (coords1.length !== 2) {
  7236. throw new Error("<intersects> line1 must only contain 2 coordinates");
  7237. }
  7238. if (coords2.length !== 2) {
  7239. throw new Error("<intersects> line2 must only contain 2 coordinates");
  7240. }
  7241. var x1 = coords1[0][0];
  7242. var y1 = coords1[0][1];
  7243. var x2 = coords1[1][0];
  7244. var y2 = coords1[1][1];
  7245. var x3 = coords2[0][0];
  7246. var y3 = coords2[0][1];
  7247. var x4 = coords2[1][0];
  7248. var y4 = coords2[1][1];
  7249. var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  7250. var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
  7251. var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
  7252. if (denom === 0) {
  7253. if (numeA === 0 && numeB === 0) {
  7254. return null;
  7255. }
  7256. return null;
  7257. }
  7258. var uA = numeA / denom;
  7259. var uB = numeB / denom;
  7260. if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
  7261. var x = x1 + uA * (x2 - x1);
  7262. var y = y1 + uA * (y2 - y1);
  7263. return point([x, y]);
  7264. }
  7265. return null;
  7266. }
  7267. function booleanPointOnLine(pt2, line, options2) {
  7268. if (options2 === void 0) {
  7269. options2 = {};
  7270. }
  7271. var ptCoords = getCoord(pt2);
  7272. var lineCoords = getCoords(line);
  7273. for (var i2 = 0; i2 < lineCoords.length - 1; i2++) {
  7274. var ignoreBoundary = false;
  7275. if (options2.ignoreEndVertices) {
  7276. if (i2 === 0) {
  7277. ignoreBoundary = "start";
  7278. }
  7279. if (i2 === lineCoords.length - 2) {
  7280. ignoreBoundary = "end";
  7281. }
  7282. if (i2 === 0 && i2 + 1 === lineCoords.length - 1) {
  7283. ignoreBoundary = "both";
  7284. }
  7285. }
  7286. if (isPointOnLineSegment$1(lineCoords[i2], lineCoords[i2 + 1], ptCoords, ignoreBoundary, typeof options2.epsilon === "undefined" ? null : options2.epsilon)) {
  7287. return true;
  7288. }
  7289. }
  7290. return false;
  7291. }
  7292. function isPointOnLineSegment$1(lineSegmentStart, lineSegmentEnd, pt2, excludeBoundary, epsilon) {
  7293. var x = pt2[0];
  7294. var y = pt2[1];
  7295. var x1 = lineSegmentStart[0];
  7296. var y1 = lineSegmentStart[1];
  7297. var x2 = lineSegmentEnd[0];
  7298. var y2 = lineSegmentEnd[1];
  7299. var dxc = pt2[0] - x1;
  7300. var dyc = pt2[1] - y1;
  7301. var dxl = x2 - x1;
  7302. var dyl = y2 - y1;
  7303. var cross2 = dxc * dyl - dyc * dxl;
  7304. if (epsilon !== null) {
  7305. if (Math.abs(cross2) > epsilon) {
  7306. return false;
  7307. }
  7308. } else if (cross2 !== 0) {
  7309. return false;
  7310. }
  7311. if (!excludeBoundary) {
  7312. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7313. return dxl > 0 ? x1 <= x && x <= x2 : x2 <= x && x <= x1;
  7314. }
  7315. return dyl > 0 ? y1 <= y && y <= y2 : y2 <= y && y <= y1;
  7316. } else if (excludeBoundary === "start") {
  7317. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7318. return dxl > 0 ? x1 < x && x <= x2 : x2 <= x && x < x1;
  7319. }
  7320. return dyl > 0 ? y1 < y && y <= y2 : y2 <= y && y < y1;
  7321. } else if (excludeBoundary === "end") {
  7322. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7323. return dxl > 0 ? x1 <= x && x < x2 : x2 < x && x <= x1;
  7324. }
  7325. return dyl > 0 ? y1 <= y && y < y2 : y2 < y && y <= y1;
  7326. } else if (excludeBoundary === "both") {
  7327. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7328. return dxl > 0 ? x1 < x && x < x2 : x2 < x && x < x1;
  7329. }
  7330. return dyl > 0 ? y1 < y && y < y2 : y2 < y && y < y1;
  7331. }
  7332. return false;
  7333. }
  7334. function booleanWithin(feature1, feature2) {
  7335. var geom1 = getGeom(feature1);
  7336. var geom2 = getGeom(feature2);
  7337. var type1 = geom1.type;
  7338. var type2 = geom2.type;
  7339. switch (type1) {
  7340. case "Point":
  7341. switch (type2) {
  7342. case "MultiPoint":
  7343. return isPointInMultiPoint(geom1, geom2);
  7344. case "LineString":
  7345. return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });
  7346. case "Polygon":
  7347. case "MultiPolygon":
  7348. return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });
  7349. default:
  7350. throw new Error("feature2 " + type2 + " geometry not supported");
  7351. }
  7352. case "MultiPoint":
  7353. switch (type2) {
  7354. case "MultiPoint":
  7355. return isMultiPointInMultiPoint(geom1, geom2);
  7356. case "LineString":
  7357. return isMultiPointOnLine(geom1, geom2);
  7358. case "Polygon":
  7359. case "MultiPolygon":
  7360. return isMultiPointInPoly(geom1, geom2);
  7361. default:
  7362. throw new Error("feature2 " + type2 + " geometry not supported");
  7363. }
  7364. case "LineString":
  7365. switch (type2) {
  7366. case "LineString":
  7367. return isLineOnLine$1(geom1, geom2);
  7368. case "Polygon":
  7369. case "MultiPolygon":
  7370. return isLineInPoly$1(geom1, geom2);
  7371. default:
  7372. throw new Error("feature2 " + type2 + " geometry not supported");
  7373. }
  7374. case "Polygon":
  7375. switch (type2) {
  7376. case "Polygon":
  7377. case "MultiPolygon":
  7378. return isPolyInPoly$1(geom1, geom2);
  7379. default:
  7380. throw new Error("feature2 " + type2 + " geometry not supported");
  7381. }
  7382. default:
  7383. throw new Error("feature1 " + type1 + " geometry not supported");
  7384. }
  7385. }
  7386. function isPointInMultiPoint(point2, multiPoint2) {
  7387. var i2;
  7388. var output = false;
  7389. for (i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7390. if (compareCoords$1(multiPoint2.coordinates[i2], point2.coordinates)) {
  7391. output = true;
  7392. break;
  7393. }
  7394. }
  7395. return output;
  7396. }
  7397. function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
  7398. for (var i2 = 0; i2 < multiPoint1.coordinates.length; i2++) {
  7399. var anyMatch = false;
  7400. for (var i22 = 0; i22 < multiPoint2.coordinates.length; i22++) {
  7401. if (compareCoords$1(multiPoint1.coordinates[i2], multiPoint2.coordinates[i22])) {
  7402. anyMatch = true;
  7403. }
  7404. }
  7405. if (!anyMatch) {
  7406. return false;
  7407. }
  7408. }
  7409. return true;
  7410. }
  7411. function isMultiPointOnLine(multiPoint2, lineString2) {
  7412. var foundInsidePoint = false;
  7413. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7414. if (!booleanPointOnLine(multiPoint2.coordinates[i2], lineString2)) {
  7415. return false;
  7416. }
  7417. if (!foundInsidePoint) {
  7418. foundInsidePoint = booleanPointOnLine(multiPoint2.coordinates[i2], lineString2, { ignoreEndVertices: true });
  7419. }
  7420. }
  7421. return foundInsidePoint;
  7422. }
  7423. function isMultiPointInPoly(multiPoint2, polygon2) {
  7424. var output = true;
  7425. var isInside = false;
  7426. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7427. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2);
  7428. if (!isInside) {
  7429. output = false;
  7430. break;
  7431. }
  7432. {
  7433. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2, {
  7434. ignoreBoundary: true
  7435. });
  7436. }
  7437. }
  7438. return output && isInside;
  7439. }
  7440. function isLineOnLine$1(lineString1, lineString2) {
  7441. for (var i2 = 0; i2 < lineString1.coordinates.length; i2++) {
  7442. if (!booleanPointOnLine(lineString1.coordinates[i2], lineString2)) {
  7443. return false;
  7444. }
  7445. }
  7446. return true;
  7447. }
  7448. function isLineInPoly$1(linestring, polygon2) {
  7449. var polyBbox = bbox$1(polygon2);
  7450. var lineBbox = bbox$1(linestring);
  7451. if (!doBBoxOverlap(polyBbox, lineBbox)) {
  7452. return false;
  7453. }
  7454. var foundInsidePoint = false;
  7455. for (var i2 = 0; i2 < linestring.coordinates.length - 1; i2++) {
  7456. if (!booleanPointInPolygon(linestring.coordinates[i2], polygon2)) {
  7457. return false;
  7458. }
  7459. if (!foundInsidePoint) {
  7460. foundInsidePoint = booleanPointInPolygon(linestring.coordinates[i2], polygon2, { ignoreBoundary: true });
  7461. }
  7462. if (!foundInsidePoint) {
  7463. var midpoint2 = getMidpoint(linestring.coordinates[i2], linestring.coordinates[i2 + 1]);
  7464. foundInsidePoint = booleanPointInPolygon(midpoint2, polygon2, {
  7465. ignoreBoundary: true
  7466. });
  7467. }
  7468. }
  7469. return foundInsidePoint;
  7470. }
  7471. function isPolyInPoly$1(geometry1, geometry2) {
  7472. var poly1Bbox = bbox$1(geometry1);
  7473. var poly2Bbox = bbox$1(geometry2);
  7474. if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {
  7475. return false;
  7476. }
  7477. for (var i2 = 0; i2 < geometry1.coordinates[0].length; i2++) {
  7478. if (!booleanPointInPolygon(geometry1.coordinates[0][i2], geometry2)) {
  7479. return false;
  7480. }
  7481. }
  7482. return true;
  7483. }
  7484. function doBBoxOverlap(bbox1, bbox2) {
  7485. if (bbox1[0] > bbox2[0])
  7486. return false;
  7487. if (bbox1[2] < bbox2[2])
  7488. return false;
  7489. if (bbox1[1] > bbox2[1])
  7490. return false;
  7491. if (bbox1[3] < bbox2[3])
  7492. return false;
  7493. return true;
  7494. }
  7495. function compareCoords$1(pair1, pair2) {
  7496. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7497. }
  7498. function getMidpoint(pair1, pair2) {
  7499. return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
  7500. }
  7501. function pointGrid(bbox2, cellSide, options2) {
  7502. if (options2 === void 0) {
  7503. options2 = {};
  7504. }
  7505. if (options2.mask && !options2.units)
  7506. options2.units = "kilometers";
  7507. var results = [];
  7508. var west = bbox2[0];
  7509. var south = bbox2[1];
  7510. var east = bbox2[2];
  7511. var north = bbox2[3];
  7512. var xFraction = cellSide / distance([west, south], [east, south], options2);
  7513. var cellWidth = xFraction * (east - west);
  7514. var yFraction = cellSide / distance([west, south], [west, north], options2);
  7515. var cellHeight = yFraction * (north - south);
  7516. var bboxWidth = east - west;
  7517. var bboxHeight = north - south;
  7518. var columns = Math.floor(bboxWidth / cellWidth);
  7519. var rows = Math.floor(bboxHeight / cellHeight);
  7520. var deltaX = (bboxWidth - columns * cellWidth) / 2;
  7521. var deltaY = (bboxHeight - rows * cellHeight) / 2;
  7522. var currentX = west + deltaX;
  7523. while (currentX <= east) {
  7524. var currentY = south + deltaY;
  7525. while (currentY <= north) {
  7526. var cellPt = point([currentX, currentY], options2.properties);
  7527. if (options2.mask) {
  7528. if (booleanWithin(cellPt, options2.mask))
  7529. results.push(cellPt);
  7530. } else {
  7531. results.push(cellPt);
  7532. }
  7533. currentY += cellHeight;
  7534. }
  7535. currentX += cellWidth;
  7536. }
  7537. return featureCollection$1(results);
  7538. }
  7539. function polygonToLine(poly, options2) {
  7540. if (options2 === void 0) {
  7541. options2 = {};
  7542. }
  7543. var geom = getGeom(poly);
  7544. if (!options2.properties && poly.type === "Feature") {
  7545. options2.properties = poly.properties;
  7546. }
  7547. switch (geom.type) {
  7548. case "Polygon":
  7549. return polygonToLine$1(geom, options2);
  7550. case "MultiPolygon":
  7551. return multiPolygonToLine(geom, options2);
  7552. default:
  7553. throw new Error("invalid poly");
  7554. }
  7555. }
  7556. function polygonToLine$1(poly, options2) {
  7557. if (options2 === void 0) {
  7558. options2 = {};
  7559. }
  7560. var geom = getGeom(poly);
  7561. var coords = geom.coordinates;
  7562. var properties = options2.properties ? options2.properties : poly.type === "Feature" ? poly.properties : {};
  7563. return coordsToLine(coords, properties);
  7564. }
  7565. function multiPolygonToLine(multiPoly, options2) {
  7566. if (options2 === void 0) {
  7567. options2 = {};
  7568. }
  7569. var geom = getGeom(multiPoly);
  7570. var coords = geom.coordinates;
  7571. var properties = options2.properties ? options2.properties : multiPoly.type === "Feature" ? multiPoly.properties : {};
  7572. var lines = [];
  7573. coords.forEach(function(coord) {
  7574. lines.push(coordsToLine(coord, properties));
  7575. });
  7576. return featureCollection$1(lines);
  7577. }
  7578. function coordsToLine(coords, properties) {
  7579. if (coords.length > 1) {
  7580. return multiLineString(coords, properties);
  7581. }
  7582. return lineString(coords[0], properties);
  7583. }
  7584. function booleanClockwise(line) {
  7585. var ring = getCoords(line);
  7586. var sum = 0;
  7587. var i2 = 1;
  7588. var prev;
  7589. var cur;
  7590. while (i2 < ring.length) {
  7591. prev = cur || ring[0];
  7592. cur = ring[i2];
  7593. sum += (cur[0] - prev[0]) * (cur[1] + prev[1]);
  7594. i2++;
  7595. }
  7596. return sum > 0;
  7597. }
  7598. function booleanDisjoint(feature1, feature2) {
  7599. var bool = true;
  7600. flattenEach(feature1, function(flatten1) {
  7601. flattenEach(feature2, function(flatten22) {
  7602. if (bool === false) {
  7603. return false;
  7604. }
  7605. bool = disjoint(flatten1.geometry, flatten22.geometry);
  7606. });
  7607. });
  7608. return bool;
  7609. }
  7610. function disjoint(geom1, geom2) {
  7611. switch (geom1.type) {
  7612. case "Point":
  7613. switch (geom2.type) {
  7614. case "Point":
  7615. return !compareCoords(geom1.coordinates, geom2.coordinates);
  7616. case "LineString":
  7617. return !isPointOnLine(geom2, geom1);
  7618. case "Polygon":
  7619. return !booleanPointInPolygon(geom1, geom2);
  7620. }
  7621. break;
  7622. case "LineString":
  7623. switch (geom2.type) {
  7624. case "Point":
  7625. return !isPointOnLine(geom1, geom2);
  7626. case "LineString":
  7627. return !isLineOnLine(geom1, geom2);
  7628. case "Polygon":
  7629. return !isLineInPoly(geom2, geom1);
  7630. }
  7631. break;
  7632. case "Polygon":
  7633. switch (geom2.type) {
  7634. case "Point":
  7635. return !booleanPointInPolygon(geom2, geom1);
  7636. case "LineString":
  7637. return !isLineInPoly(geom1, geom2);
  7638. case "Polygon":
  7639. return !isPolyInPoly(geom2, geom1);
  7640. }
  7641. }
  7642. return false;
  7643. }
  7644. function isPointOnLine(lineString2, pt2) {
  7645. for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
  7646. if (isPointOnLineSegment(lineString2.coordinates[i2], lineString2.coordinates[i2 + 1], pt2.coordinates)) {
  7647. return true;
  7648. }
  7649. }
  7650. return false;
  7651. }
  7652. function isLineOnLine(lineString1, lineString2) {
  7653. var doLinesIntersect = lineIntersect(lineString1, lineString2);
  7654. if (doLinesIntersect.features.length > 0) {
  7655. return true;
  7656. }
  7657. return false;
  7658. }
  7659. function isLineInPoly(polygon2, lineString2) {
  7660. for (var _i = 0, _a2 = lineString2.coordinates; _i < _a2.length; _i++) {
  7661. var coord = _a2[_i];
  7662. if (booleanPointInPolygon(coord, polygon2)) {
  7663. return true;
  7664. }
  7665. }
  7666. var doLinesIntersect = lineIntersect(lineString2, polygonToLine(polygon2));
  7667. if (doLinesIntersect.features.length > 0) {
  7668. return true;
  7669. }
  7670. return false;
  7671. }
  7672. function isPolyInPoly(feature1, feature2) {
  7673. for (var _i = 0, _a2 = feature1.coordinates[0]; _i < _a2.length; _i++) {
  7674. var coord1 = _a2[_i];
  7675. if (booleanPointInPolygon(coord1, feature2)) {
  7676. return true;
  7677. }
  7678. }
  7679. for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {
  7680. var coord2 = _c[_b];
  7681. if (booleanPointInPolygon(coord2, feature1)) {
  7682. return true;
  7683. }
  7684. }
  7685. var doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
  7686. if (doLinesIntersect.features.length > 0) {
  7687. return true;
  7688. }
  7689. return false;
  7690. }
  7691. function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt2) {
  7692. var dxc = pt2[0] - lineSegmentStart[0];
  7693. var dyc = pt2[1] - lineSegmentStart[1];
  7694. var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
  7695. var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
  7696. var cross2 = dxc * dyl - dyc * dxl;
  7697. if (cross2 !== 0) {
  7698. return false;
  7699. }
  7700. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7701. if (dxl > 0) {
  7702. return lineSegmentStart[0] <= pt2[0] && pt2[0] <= lineSegmentEnd[0];
  7703. } else {
  7704. return lineSegmentEnd[0] <= pt2[0] && pt2[0] <= lineSegmentStart[0];
  7705. }
  7706. } else if (dyl > 0) {
  7707. return lineSegmentStart[1] <= pt2[1] && pt2[1] <= lineSegmentEnd[1];
  7708. } else {
  7709. return lineSegmentEnd[1] <= pt2[1] && pt2[1] <= lineSegmentStart[1];
  7710. }
  7711. }
  7712. function compareCoords(pair1, pair2) {
  7713. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7714. }
  7715. function booleanIntersects(feature1, feature2) {
  7716. var bool = false;
  7717. flattenEach(feature1, function(flatten1) {
  7718. flattenEach(feature2, function(flatten22) {
  7719. if (bool === true) {
  7720. return true;
  7721. }
  7722. bool = !booleanDisjoint(flatten1.geometry, flatten22.geometry);
  7723. });
  7724. });
  7725. return bool;
  7726. }
  7727. function rectangleGrid(bbox2, cellWidth, cellHeight, options2) {
  7728. if (options2 === void 0) {
  7729. options2 = {};
  7730. }
  7731. var results = [];
  7732. var west = bbox2[0];
  7733. var south = bbox2[1];
  7734. var east = bbox2[2];
  7735. var north = bbox2[3];
  7736. var xFraction = cellWidth / distance([west, south], [east, south], options2);
  7737. var cellWidthDeg = xFraction * (east - west);
  7738. var yFraction = cellHeight / distance([west, south], [west, north], options2);
  7739. var cellHeightDeg = yFraction * (north - south);
  7740. var bboxWidth = east - west;
  7741. var bboxHeight = north - south;
  7742. var columns = Math.floor(bboxWidth / cellWidthDeg);
  7743. var rows = Math.floor(bboxHeight / cellHeightDeg);
  7744. var deltaX = (bboxWidth - columns * cellWidthDeg) / 2;
  7745. var deltaY = (bboxHeight - rows * cellHeightDeg) / 2;
  7746. var currentX = west + deltaX;
  7747. for (var column = 0; column < columns; column++) {
  7748. var currentY = south + deltaY;
  7749. for (var row = 0; row < rows; row++) {
  7750. var cellPoly = polygon([
  7751. [
  7752. [currentX, currentY],
  7753. [currentX, currentY + cellHeightDeg],
  7754. [currentX + cellWidthDeg, currentY + cellHeightDeg],
  7755. [currentX + cellWidthDeg, currentY],
  7756. [currentX, currentY]
  7757. ]
  7758. ], options2.properties);
  7759. if (options2.mask) {
  7760. if (booleanIntersects(options2.mask, cellPoly)) {
  7761. results.push(cellPoly);
  7762. }
  7763. } else {
  7764. results.push(cellPoly);
  7765. }
  7766. currentY += cellHeightDeg;
  7767. }
  7768. currentX += cellWidthDeg;
  7769. }
  7770. return featureCollection$1(results);
  7771. }
  7772. function squareGrid(bbox2, cellSide, options2) {
  7773. if (options2 === void 0) {
  7774. options2 = {};
  7775. }
  7776. return rectangleGrid(bbox2, cellSide, cellSide, options2);
  7777. }
  7778. class ViewShed {
  7779. constructor(viewer2) {
  7780. if (!viewer2)
  7781. throw new Cesium.DeveloperError("no viewer object!");
  7782. this.viewer = viewer2;
  7783. this.handler = void 0;
  7784. this.lightCamera;
  7785. this.pyramid;
  7786. this.frustumPrimitive;
  7787. this.viewershedPolygon;
  7788. }
  7789. initHandler() {
  7790. if (this.handler) {
  7791. this.handler.destroy();
  7792. this.handler = void 0;
  7793. }
  7794. let canvas = document.getElementById("canvasMap");
  7795. if (canvas == null) {
  7796. canvas = document.createElement("canvas");
  7797. canvas.id = "canvasMap";
  7798. canvas.style.display = "none";
  7799. canvas.style.top = "0px";
  7800. canvas.style.position = "absolute";
  7801. document.body.append(canvas);
  7802. }
  7803. this.canvasEle = canvas;
  7804. }
  7805. ReturnDistance(pos0, pos1) {
  7806. let point1cartographic = Cesium.Cartographic.fromCartesian(pos0);
  7807. let point2cartographic = Cesium.Cartographic.fromCartesian(pos1);
  7808. let geodesic = new Cesium.EllipsoidGeodesic();
  7809. geodesic.setEndPoints(point1cartographic, point2cartographic);
  7810. let s = geodesic.surfaceDistance;
  7811. return s;
  7812. }
  7813. getHeight(x, y, objectsToExclude) {
  7814. let endCartographic = Cesium.Cartographic.fromDegrees(x, y);
  7815. let endHeight = this.viewer.scene.sampleHeight(
  7816. endCartographic,
  7817. objectsToExclude
  7818. );
  7819. return endHeight;
  7820. }
  7821. cartesian3ToDegree(Cartesian32) {
  7822. let _ellipsoid = this.viewer.scene.globe.ellipsoid;
  7823. let _cartographic = _ellipsoid.cartesianToCartographic(Cartesian32);
  7824. let _lat = Cesium.Math.toDegrees(_cartographic.latitude);
  7825. let _lng = Cesium.Math.toDegrees(_cartographic.longitude);
  7826. let _alt = _cartographic.height;
  7827. return [_lng, _lat, _alt];
  7828. }
  7829. getAngle(lng1, lat1, lng2, lat2) {
  7830. let dRotateAngle = Math.atan2(Math.abs(lng1 - lng2), Math.abs(lat1 - lat2));
  7831. if (lng2 >= lng1) {
  7832. dRotateAngle = lat2 < lat1 ? Math.PI - dRotateAngle : dRotateAngle;
  7833. } else {
  7834. dRotateAngle = lat2 >= lat1 ? 2 * Math.PI - dRotateAngle : Math.PI + dRotateAngle;
  7835. }
  7836. dRotateAngle = dRotateAngle * 180 / Math.PI;
  7837. return dRotateAngle;
  7838. }
  7839. getPitch(pointA, pointB) {
  7840. let transfrom = Cesium.Transforms.eastNorthUpToFixedFrame(pointA);
  7841. const vector = Cesium.Cartesian3.subtract(
  7842. pointB,
  7843. pointA,
  7844. new Cesium.Cartesian3()
  7845. );
  7846. let direction = Cesium.Matrix4.multiplyByPointAsVector(
  7847. Cesium.Matrix4.inverse(transfrom, transfrom),
  7848. vector,
  7849. vector
  7850. );
  7851. Cesium.Cartesian3.normalize(direction, direction);
  7852. return Cesium.Math.PI_OVER_TWO - Cesium.Math.acosClamped(direction.z);
  7853. }
  7854. updateViewShed() {
  7855. this.clear();
  7856. this.setLightCamera();
  7857. this.addVisualPyramid();
  7858. this.createFrustum();
  7859. }
  7860. clear() {
  7861. if (this.pyramid) {
  7862. this.viewer.entities.removeById(this.pyramid.id);
  7863. this.pyramid = void 0;
  7864. }
  7865. if (this.frustumPrimitive) {
  7866. this.viewer.scene.primitives.remove(this.frustumPrimitive);
  7867. this.frustumPrimitive = void 0;
  7868. }
  7869. if (this.debugModelMatrixPrimitive) {
  7870. this.viewer.scene.primitives.remove(this.debugModelMatrixPrimitive);
  7871. this.debugModelMatrixPrimitive = void 0;
  7872. }
  7873. }
  7874. addVisualPyramid() {
  7875. let options2 = this.ViewShedOptions;
  7876. let position2 = options2.viewPosition;
  7877. let visualRange = Number(options2.visualRange);
  7878. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  7879. this.debugModelMatrixPrimitive = this.viewer.scene.primitives.add(
  7880. new Cesium.DebugModelMatrixPrimitive({
  7881. modelMatrix: transform3,
  7882. length: 5
  7883. })
  7884. );
  7885. const halfClock = options2.horizontalViewAngle / 2;
  7886. const halfCone = options2.verticalViewAngle / 2;
  7887. const pitch = Cesium.Math.toDegrees(options2.pitch);
  7888. const ellipsoid = new Cesium.EllipsoidGraphics({
  7889. radii: new Cesium.Cartesian3(visualRange, visualRange, visualRange),
  7890. minimumClock: Cesium.Math.toRadians(90 - options2.direction - halfClock),
  7891. maximumClock: Cesium.Math.toRadians(90 - options2.direction + halfClock),
  7892. minimumCone: Cesium.Math.toRadians(90 - pitch - halfCone),
  7893. maximumCone: Cesium.Math.toRadians(90 - pitch + halfCone),
  7894. fill: false,
  7895. outline: true,
  7896. subdivisions: 256,
  7897. stackPartitions: 64,
  7898. slicePartitions: 64,
  7899. outlineColor: Cesium.Color.YELLOWGREEN.withAlpha(0.5)
  7900. });
  7901. const pyramidEntity = new Cesium.Entity({
  7902. position: position2,
  7903. ellipsoid
  7904. });
  7905. this.pyramid = this.viewer.entities.add(pyramidEntity);
  7906. }
  7907. setLightCamera() {
  7908. if (!this.lightCamera) {
  7909. this.lightCamera = new Cesium.Camera(this.viewer.scene);
  7910. }
  7911. let options2 = this.ViewShedOptions;
  7912. let visualRange = Number(options2.visualRange);
  7913. this.lightCamera.position = options2.viewPosition;
  7914. this.lightCamera.frustum.near = 0.1;
  7915. this.lightCamera.frustum.far = visualRange;
  7916. const hr = Cesium.Math.toRadians(options2.horizontalViewAngle);
  7917. const vr = Cesium.Math.toRadians(options2.verticalViewAngle);
  7918. this.lightCamera.frustum.aspectRatio = visualRange * Math.tan(hr / 2) * 2 / (visualRange * Math.tan(vr / 2) * 2);
  7919. this.lightCamera.frustum.fov = hr > vr ? hr : vr;
  7920. this.lightCamera.setView({
  7921. destination: options2.viewPosition,
  7922. orientation: {
  7923. heading: Cesium.Math.toRadians(options2.direction || 0),
  7924. pitch: options2.pitch || 0,
  7925. roll: 0
  7926. }
  7927. });
  7928. }
  7929. createFrustum() {
  7930. const scratchRight = new Cesium.Cartesian3();
  7931. const scratchRotation = new Cesium.Matrix3();
  7932. const scratchOrientation = new Cesium.Quaternion();
  7933. const direction = this.lightCamera.directionWC;
  7934. const up = this.lightCamera.upWC;
  7935. let right = this.lightCamera.rightWC;
  7936. right = Cesium.Cartesian3.negate(right, scratchRight);
  7937. let rotation = scratchRotation;
  7938. Cesium.Matrix3.setColumn(rotation, 0, right, rotation);
  7939. Cesium.Matrix3.setColumn(rotation, 1, up, rotation);
  7940. Cesium.Matrix3.setColumn(rotation, 2, direction, rotation);
  7941. let orientation = Cesium.Quaternion.fromRotationMatrix(
  7942. rotation,
  7943. scratchOrientation
  7944. );
  7945. let instanceOutline = new Cesium.GeometryInstance({
  7946. geometry: new Cesium.FrustumOutlineGeometry({
  7947. frustum: this.lightCamera.frustum,
  7948. origin: this.ViewShedOptions.viewPosition,
  7949. orientation
  7950. }),
  7951. id: "\u89C6\u690E\u4F53\u8F6E\u5ED3\u7EBF" + Math.random().toString(36).substr(2),
  7952. attributes: {
  7953. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  7954. new Cesium.Color(0, 1, 0, 1)
  7955. ),
  7956. show: new Cesium.ShowGeometryInstanceAttribute(true)
  7957. }
  7958. });
  7959. this.frustumPrimitive = this.viewer.scene.primitives.add(
  7960. new Cesium.Primitive({
  7961. geometryInstances: instanceOutline,
  7962. appearance: new Cesium.PerInstanceColorAppearance({
  7963. flat: true,
  7964. translucent: false,
  7965. closed: true
  7966. })
  7967. })
  7968. );
  7969. }
  7970. addViewershedPolygon(positionArr) {
  7971. let polygon2 = new Cesium.PolygonGeometry({
  7972. polygonHierarchy: new Cesium.PolygonHierarchy(
  7973. Cesium.Cartesian3.fromDegreesArray(positionArr)
  7974. ),
  7975. height: 0,
  7976. extrudedHeight: 0,
  7977. vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
  7978. stRotation: 0,
  7979. ellipsoid: Cesium.Ellipsoid.WGS84,
  7980. granularity: Cesium.Math.RADIANS_PER_DEGREE,
  7981. perPositionHeight: false,
  7982. closeTop: true,
  7983. closeBottom: true,
  7984. arcType: Cesium.ArcType.GEODESIC
  7985. });
  7986. let polygonInstance = new Cesium.GeometryInstance({
  7987. geometry: polygon2,
  7988. name: "ViewershedPolygon",
  7989. attributes: {
  7990. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  7991. Cesium.Color.BLUE.withAlpha(0.6)
  7992. ),
  7993. show: new Cesium.ShowGeometryInstanceAttribute(true)
  7994. }
  7995. });
  7996. this.viewershedPolygon = this.viewer.scene.primitives.add(
  7997. new Cesium.GroundPrimitive({
  7998. geometryInstances: polygonInstance,
  7999. appearance: new Cesium.EllipsoidSurfaceAppearance({
  8000. aboveGround: true,
  8001. material: new Cesium.Material({
  8002. fabric: {
  8003. type: "Image",
  8004. uniforms: {
  8005. image: this.returnImgae()
  8006. }
  8007. }
  8008. })
  8009. })
  8010. })
  8011. );
  8012. }
  8013. drawViewershed(precision) {
  8014. const pos = this.cartesian3ToDegree(this.ViewShedOptions.viewPosition);
  8015. const radius = this.ViewShedOptions.visualRange;
  8016. const direction = this.ViewShedOptions.direction;
  8017. let boundary = this.computeBoundaryOptions(pos, radius, direction);
  8018. const bbox2 = boundary.bbox;
  8019. let mask = polygon([boundary.boundaryPoints]);
  8020. const dis = this.ViewShedOptions.visualRange / (precision * 1e3);
  8021. let gridPoints = pointGrid(bbox2, dis, {
  8022. mask
  8023. });
  8024. console.log(this.ViewShedOptions.visualRange, precision, dis);
  8025. let pointsResult = this.createTargetPoints(gridPoints, dis, pos);
  8026. let variogram = index.train(
  8027. pointsResult.values,
  8028. pointsResult.lngs,
  8029. pointsResult.lats,
  8030. "exponential",
  8031. 0,
  8032. 100
  8033. );
  8034. let grid2 = index.grid([boundary.boundaryPoints], variogram, dis / 1e3);
  8035. const colors = [
  8036. "#ff000080",
  8037. "#ff000080",
  8038. "#ff000080",
  8039. "#ff000080",
  8040. "#ff000080",
  8041. "#ff000080",
  8042. "#00ff0080",
  8043. "#00ff0080",
  8044. "#00ff0080",
  8045. "#00ff0080",
  8046. "#00ff0080",
  8047. "#00ff0080"
  8048. ];
  8049. this.canvasEle.width = 3840;
  8050. this.canvasEle.height = 2160;
  8051. index.plot(
  8052. this.canvasEle,
  8053. grid2,
  8054. [bbox2[0], bbox2[2]],
  8055. [bbox2[1], bbox2[3]],
  8056. colors
  8057. );
  8058. this.addViewershedPolygon(boundary.positionArr);
  8059. }
  8060. computeBoundaryOptions(pos, radius, angle) {
  8061. let Ea = 6378137;
  8062. let Eb = 6356725;
  8063. const lng = pos[0], lat = pos[1];
  8064. const bbox2 = [lng, lat, lng, lat];
  8065. let positionArr = [];
  8066. let boundaryPoints = [];
  8067. positionArr.push(lng, lat);
  8068. boundaryPoints.push([lng, lat]);
  8069. let start2 = angle + 45 > 360 ? angle - 45 - 360 : angle - 45;
  8070. let end = start2 + 90;
  8071. for (let i2 = start2; i2 <= end; i2++) {
  8072. let dx = radius * Math.sin(i2 * Math.PI / 180);
  8073. let dy = radius * Math.cos(i2 * Math.PI / 180);
  8074. let ec = Eb + (Ea - Eb) * (90 - lat) / 90;
  8075. let ed = ec * Math.cos(lat * Math.PI / 180);
  8076. let BJD = lng + dx / ed * 180 / Math.PI;
  8077. let BWD = lat + dy / ec * 180 / Math.PI;
  8078. positionArr.push(BJD, BWD);
  8079. boundaryPoints.push([BJD, BWD]);
  8080. this.refreshBBox(bbox2, BJD, BWD);
  8081. }
  8082. boundaryPoints.push([lng, lat]);
  8083. return {
  8084. positionArr,
  8085. boundaryPoints,
  8086. bbox: bbox2
  8087. };
  8088. }
  8089. refreshBBox(result, x, y) {
  8090. result[0] = x < result[0] ? x : result[0];
  8091. result[1] = y < result[1] ? y : result[1];
  8092. result[2] = x > result[2] ? x : result[2];
  8093. result[3] = y > result[3] ? y : result[3];
  8094. }
  8095. createTargetPoints(gridPoints, step, sourcePos) {
  8096. let positionArr = [];
  8097. let objectsToExclude = [
  8098. this.frustumPrimitive,
  8099. this.pyramid,
  8100. this.debugModelMatrixPrimitive
  8101. ];
  8102. let values3 = [], lngs = [], lats = [];
  8103. let height2 = this.getHeight(sourcePos[0], sourcePos[1], objectsToExclude);
  8104. positionArr.push({
  8105. x: sourcePos[0],
  8106. y: sourcePos[1],
  8107. z: height2
  8108. });
  8109. let viewPoint = this.ViewShedOptions.viewPosition;
  8110. for (let index2 = 0; index2 < gridPoints.features.length; index2++) {
  8111. const feature2 = gridPoints.features[index2];
  8112. const coords = feature2.geometry.coordinates;
  8113. const x = coords[0], y = coords[1];
  8114. let h2 = this.getHeight(x, y, objectsToExclude);
  8115. let endPoint = Cesium.Cartesian3.fromDegrees(x, y, h2);
  8116. let direction = Cesium.Cartesian3.normalize(
  8117. Cesium.Cartesian3.subtract(
  8118. endPoint,
  8119. viewPoint,
  8120. new Cesium.Cartesian3()
  8121. ),
  8122. new Cesium.Cartesian3()
  8123. );
  8124. let ray = new Cesium.Ray(viewPoint, direction);
  8125. let result = this.viewer.scene.pickFromRay(ray, objectsToExclude);
  8126. if (result) {
  8127. let buffer = this.ReturnDistance(endPoint, result.position);
  8128. if (buffer > step) {
  8129. values3.push(0);
  8130. } else {
  8131. values3.push(1);
  8132. }
  8133. lngs.push(x);
  8134. lats.push(y);
  8135. }
  8136. }
  8137. return {
  8138. values: values3,
  8139. lngs,
  8140. lats
  8141. };
  8142. }
  8143. returnImgae() {
  8144. return this.canvasEle.toDataURL("image/png");
  8145. }
  8146. }
  8147. Object.assign(ViewShed.prototype, {
  8148. createViewshed: function(precision) {
  8149. let _self = this;
  8150. let scene = _self.viewer.scene;
  8151. _self.initHandler();
  8152. _self.clearAll();
  8153. let count = 0;
  8154. let toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u8D77\u70B9";
  8155. _self.handler = new Cesium.ScreenSpaceEventHandler(_self.viewer.canvas);
  8156. _self.handler.setInputAction((event2) => {
  8157. count++;
  8158. if (count === 1) {
  8159. toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u7EC8\u70B9";
  8160. let earthPosition = scene.pickPosition(event2.position);
  8161. let pos = _self.cartesian3ToDegree(earthPosition);
  8162. _self.handler.setInputAction(function(move) {
  8163. CreateRemindertip(toolTip, move.endPosition, true);
  8164. let newPosition = scene.pickPosition(move.endPosition);
  8165. if (Cesium.defined(newPosition)) {
  8166. let pos1 = _self.cartesian3ToDegree(newPosition);
  8167. let distance2 = Cesium.Cartesian3.distance(newPosition, earthPosition);
  8168. let angle = _self.getAngle(pos[0], pos[1], pos1[0], pos1[1]);
  8169. let pitch = _self.getPitch(earthPosition, newPosition);
  8170. _self.ViewShedOptions = {
  8171. viewPosition: earthPosition,
  8172. endPosition: newPosition,
  8173. direction: angle,
  8174. pitch,
  8175. horizontalViewAngle: 90,
  8176. verticalViewAngle: 60,
  8177. visibleAreaColor: Cesium.Color.GREEN,
  8178. invisibleAreaColor: Cesium.Color.RED,
  8179. visualRange: distance2
  8180. };
  8181. _self.updateViewShed();
  8182. }
  8183. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8184. }
  8185. if (count === 2) {
  8186. _self.initHandler();
  8187. _self.drawViewershed(precision);
  8188. CreateRemindertip(toolTip, event2.endPosition, false);
  8189. }
  8190. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  8191. _self.handler.setInputAction(function(move) {
  8192. CreateRemindertip(toolTip, move.endPosition, true);
  8193. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8194. },
  8195. clearAll: function() {
  8196. this.clear();
  8197. if (this.viewershedPolygon) {
  8198. this.viewer.scene.primitives.remove(this.viewershedPolygon);
  8199. this.viewershedPolygon = void 0;
  8200. }
  8201. }
  8202. });
  8203. class SunshineShadow {
  8204. constructor(viewer2) {
  8205. if (!viewer2)
  8206. throw new Cesium.DeveloperError("no viewer object!");
  8207. this._viewer = viewer2;
  8208. this._stopTime = null;
  8209. }
  8210. }
  8211. Object.assign(SunshineShadow.prototype, {
  8212. startSunShine(options2) {
  8213. options2 = options2 || {};
  8214. if (!Cesium.defined(options2.startTime)) {
  8215. options2.startTime = new Date().getTime();
  8216. }
  8217. if (!Cesium.defined(options2.stopTime)) {
  8218. options2.stopTime = new Date().getTime() + 1e3;
  8219. }
  8220. if (!Cesium.defined(options2.speed)) {
  8221. options2.speed = 1600;
  8222. }
  8223. if (this._stopTime) {
  8224. this._viewer.clock.shouldAnimate = true;
  8225. this._viewer.clock.currentTime = this._stopTime;
  8226. } else {
  8227. this._viewer.scene.globe.enableLighting = true;
  8228. this._viewer.shadows = true;
  8229. this._viewer.clock.startTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8230. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8231. this._viewer.clock.stopTime = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8232. console.log(this._viewer.clock.currentTime);
  8233. this._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  8234. this._viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER;
  8235. this._viewer.clock.multiplier = options2.speed;
  8236. this._viewer.clock.canAnimate = true;
  8237. this._viewer.clock.shouldAnimate = true;
  8238. }
  8239. },
  8240. stopSunShine() {
  8241. this._stopTime = this._viewer.clock.currentTime;
  8242. console.log(this._viewer.clock.currentTime);
  8243. this._viewer.clock.shouldAnimate = false;
  8244. },
  8245. removeSunShine() {
  8246. if (this._stopTime) {
  8247. this._viewer.clock.shouldAnimate = true;
  8248. this._viewer.clock.currentTime = this._stopTime;
  8249. console.log(this._viewer.clock.currentTime);
  8250. }
  8251. this._viewer.scene.globe.enableLighting = false;
  8252. this._viewer.shadows = false;
  8253. this._stopTime = null;
  8254. }
  8255. });
  8256. Object.assign(SunshineShadow.prototype, {
  8257. start(options2) {
  8258. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8259. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "block";
  8260. }
  8261. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8262. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "block";
  8263. }
  8264. this._viewer.shadows = true;
  8265. options2 = options2 || {};
  8266. if (!Cesium.defined(options2.startTime)) {
  8267. options2.startTime = new Date(new Date().toLocaleDateString()).getTime();
  8268. console.log("\u5F53\u5929\u51CC\u66680\u70B9", new Date(new Date().toLocaleDateString()));
  8269. }
  8270. if (!Cesium.defined(options2.stopTime)) {
  8271. options2.stopTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1e3 - 1;
  8272. console.log("\u5F53\u592923\u70B959\u520659\u79D2", new Date(new Date(new Date().toLocaleDateString()).getTime() + 4 * 60 * 60 * 1e3));
  8273. }
  8274. if (!Cesium.defined(options2.speed)) {
  8275. options2.speed = 1600;
  8276. }
  8277. let start2 = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8278. let stop = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8279. viewer.timeline.zoomTo(start2, stop);
  8280. let clock2 = viewer.clock;
  8281. clock2.shouldAnimate = false;
  8282. clock2.startTime = start2;
  8283. clock2.stopTime = stop;
  8284. clock2.currentTime = start2;
  8285. clock2.clockRange = Cesium.ClockRange.UNBOUNDED;
  8286. clock2.multiplier = options2.speed;
  8287. },
  8288. remove() {
  8289. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8290. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "none";
  8291. }
  8292. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8293. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "none";
  8294. }
  8295. this._viewer.shadows = false;
  8296. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(new Date().getTime()));
  8297. this._viewer.clock.shouldAnimate = false;
  8298. }
  8299. });
  8300. class Profile {
  8301. constructor(viewer2) {
  8302. if (!viewer2)
  8303. throw new Cesium.DeveloperError("no viewer object!");
  8304. this._viewer = viewer2;
  8305. this._profileEntities = [];
  8306. }
  8307. _interPoints(positions, objectsToExclude) {
  8308. let positionsCartographic = [];
  8309. let terrainSamplePositions = [];
  8310. for (let index2 = 0; index2 < positions.length; index2++) {
  8311. const element = positions[index2];
  8312. let ellipsoid = this._viewer.scene.globe.ellipsoid;
  8313. let cartographic = ellipsoid.cartesianToCartographic(element);
  8314. positionsCartographic.push(cartographic);
  8315. }
  8316. for (let i2 = 0; i2 < positionsCartographic.length; i2++) {
  8317. const m_Cartographic0 = positionsCartographic[i2];
  8318. const m_Cartographic1 = positionsCartographic[i2 + 1];
  8319. if (m_Cartographic1) {
  8320. let a = Math.abs(m_Cartographic0.longitude - m_Cartographic1.longitude) * 1e7;
  8321. let b = Math.abs(m_Cartographic0.latitude - m_Cartographic1.latitude) * 1e7;
  8322. if (a > b)
  8323. b = a;
  8324. let length = parseInt(b / 2);
  8325. if (length > 1e3)
  8326. length = 1e3;
  8327. if (length < 2)
  8328. length = 2;
  8329. for (let j = 0; j < length; j++) {
  8330. terrainSamplePositions.push(
  8331. new Cesium.Cartographic(
  8332. Cesium.Math.lerp(
  8333. m_Cartographic0.longitude,
  8334. m_Cartographic1.longitude,
  8335. j / (length - 1)
  8336. ),
  8337. Cesium.Math.lerp(
  8338. m_Cartographic0.latitude,
  8339. m_Cartographic1.latitude,
  8340. j / (length - 1)
  8341. )
  8342. )
  8343. );
  8344. }
  8345. terrainSamplePositions.pop();
  8346. } else {
  8347. terrainSamplePositions.push(m_Cartographic0);
  8348. }
  8349. }
  8350. let positions_Inter = [];
  8351. let distance2 = 0;
  8352. for (let n = 0; n < terrainSamplePositions.length; n++) {
  8353. let curCartographic = terrainSamplePositions[n];
  8354. let height2 = this._viewer.scene.sampleHeight(curCartographic, objectsToExclude);
  8355. const lon = curCartographic.longitude / Math.PI * 180;
  8356. const lat = curCartographic.latitude / Math.PI * 180;
  8357. let point2 = Cesium.Cartesian3.fromDegrees(lon, lat, height2);
  8358. let preCartographic = terrainSamplePositions[n - 1];
  8359. if (preCartographic) {
  8360. const lon1 = preCartographic.longitude / Math.PI * 180;
  8361. const lat1 = preCartographic.latitude / Math.PI * 180;
  8362. let point1 = Cesium.Cartesian3.fromDegrees(lon1, lat1, height2);
  8363. let curDis = Cesium.Cartesian3.distance(point1, point2);
  8364. distance2 += curDis;
  8365. }
  8366. positions_Inter.push({
  8367. position: {
  8368. lon,
  8369. lat,
  8370. height: height2
  8371. },
  8372. distance: distance2
  8373. });
  8374. }
  8375. return positions_Inter;
  8376. }
  8377. }
  8378. Object.assign(Profile.prototype, {
  8379. startProfileAnalysis(points2, entity) {
  8380. return new Promise((resolve2, reject2) => {
  8381. let _self = this;
  8382. let positions = points2.map((point2) => {
  8383. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8384. });
  8385. _self.removeProfileAnalysis();
  8386. entity.clampToGround = true;
  8387. console.log(positions);
  8388. let pointsList = _self._interPoints(positions, [entity]);
  8389. console.log(pointsList);
  8390. resolve2(pointsList);
  8391. });
  8392. },
  8393. removeProfileAnalysis() {
  8394. let _self = this;
  8395. if (_self._profileEntities && _self._profileEntities.length > 0) {
  8396. _self._profileEntities.forEach((element) => {
  8397. _self._viewer.entities.remove(element);
  8398. });
  8399. }
  8400. _self._profileEntities = [];
  8401. }
  8402. });
  8403. class CutFill {
  8404. constructor(viewer2) {
  8405. if (!viewer2)
  8406. throw new Cesium.DeveloperError("no viewer object!");
  8407. this._viewer = viewer2;
  8408. this.delEntitys = [];
  8409. this.maxHeigh = -1e6;
  8410. }
  8411. _VolumeAnalysis(options2) {
  8412. let _self = this;
  8413. let cutArea = 0, cutVolume = 0, fillArea = 0, fillVolume = 0;
  8414. const indices = options2.geom.indices;
  8415. const positions = options2.geom.attributes.position.values;
  8416. for (let index2 = 0; index2 < indices.length; index2 += 3) {
  8417. const pos0 = _self._returnPosition(positions, indices[index2]);
  8418. const pos1 = _self._returnPosition(positions, indices[index2 + 1]);
  8419. const pos2 = _self._returnPosition(positions, indices[index2 + 2]);
  8420. let _entities = _self._viewer.entities.add({
  8421. name: "\u4E09\u89D2\u9762",
  8422. polygon: {
  8423. hierarchy: [pos0.heightPos, pos1.heightPos, pos2.heightPos],
  8424. perPositionHeight: true,
  8425. material: Cesium.Color.fromRandom(),
  8426. extrudedHeight: options2.height,
  8427. outline: true,
  8428. outlineColor: Cesium.Color.BLACK
  8429. }
  8430. });
  8431. _self.delEntitys.push(_entities);
  8432. const area = _self._computeArea4Triangle(
  8433. pos0.noHeightPos,
  8434. pos1.noHeightPos,
  8435. pos2.noHeightPos
  8436. );
  8437. const height2 = (pos0.height + pos1.height + pos2.height) / 3;
  8438. if (height2 < options2.height) {
  8439. fillArea += area;
  8440. const volume = area * (options2.height - height2);
  8441. fillVolume += volume;
  8442. } else {
  8443. cutArea += area;
  8444. const volume = area * (height2 - options2.height);
  8445. cutVolume += volume;
  8446. }
  8447. }
  8448. let allArea = cutArea + fillArea;
  8449. allArea = allArea.toFixed(2);
  8450. cutArea = cutArea.toFixed(2);
  8451. cutVolume = cutVolume.toFixed(2);
  8452. fillArea = fillArea.toFixed(2);
  8453. fillVolume = fillVolume.toFixed(2);
  8454. let result = {
  8455. allArea,
  8456. cutArea,
  8457. cutVolume,
  8458. fillArea,
  8459. fillVolume
  8460. };
  8461. return result;
  8462. }
  8463. _computeArea4Triangle(pos1, pos2, pos3) {
  8464. let a = Cesium.Cartesian3.distance(pos1, pos2);
  8465. let b = Cesium.Cartesian3.distance(pos2, pos3);
  8466. let c = Cesium.Cartesian3.distance(pos3, pos1);
  8467. let S = (a + b + c) / 2;
  8468. return Math.sqrt(S * (S - a) * (S - b) * (S - c));
  8469. }
  8470. _returnPosition(positions, index2) {
  8471. let cartesian = new Cesium.Cartesian3(
  8472. positions[index2 * 3],
  8473. positions[index2 * 3 + 1],
  8474. positions[index2 * 3 + 2]
  8475. );
  8476. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  8477. let height2 = this._viewer.scene.sampleHeightSupported ? this._viewer.scene.sampleHeight(cartographic) : this._viewer.scene.globe.getHeight(cartographic);
  8478. if (height2 > this.maxHeigh) {
  8479. this.maxHeigh = height2;
  8480. }
  8481. return {
  8482. heightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height2),
  8483. noHeightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0),
  8484. height: height2
  8485. };
  8486. }
  8487. }
  8488. Object.assign(CutFill.prototype, {
  8489. createPolygonGeo(points2, options2) {
  8490. return new Promise((resolve2, reject2) => {
  8491. let _self = this;
  8492. options2 = options2 || {};
  8493. options2.precision = Cesium.defaultValue(options2.precision, 256);
  8494. options2.height = Cesium.defaultValue(options2.height, 10);
  8495. _self.remove();
  8496. let positions = [];
  8497. for (let i2 = 0; i2 < points2.length; i2++) {
  8498. if (points2[i2] instanceof Cesium.Cartesian3) {
  8499. positions.push(points2[i2]);
  8500. } else {
  8501. positions.push(Cesium.Cartesian3.fromDegrees(points2[i2][0], points2[i2][1], points2[i2][1] || 0));
  8502. }
  8503. }
  8504. let granularity = Math.PI / Math.pow(2, 11);
  8505. granularity = granularity / options2.precision;
  8506. let polygonGeometry = new Cesium.PolygonGeometry.fromPositions({
  8507. positions,
  8508. vertexFormat: Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,
  8509. granularity
  8510. });
  8511. options2.geom = new Cesium.PolygonGeometry.createGeometry(polygonGeometry);
  8512. let result = _self._VolumeAnalysis(options2);
  8513. _self._viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0.9);
  8514. _self._viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
  8515. _self._viewer.scene.globe.translucency.enabled = true;
  8516. resolve2(result);
  8517. });
  8518. },
  8519. remove() {
  8520. for (var i2 = 0; i2 < this.delEntitys.length; i2++) {
  8521. this._viewer.entities.remove(this.delEntitys[i2]);
  8522. }
  8523. this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
  8524. this._viewer.scene.globe.translucency.enabled = false;
  8525. }
  8526. });
  8527. class HeightLimit {
  8528. constructor(viewer2) {
  8529. if (!viewer2)
  8530. throw new Cesium.DeveloperError("no viewer object!");
  8531. this._viewer = viewer2;
  8532. this.targetY = 0;
  8533. }
  8534. _setPolygon(options2) {
  8535. let _self = this;
  8536. _self.HiePolygon = _self._viewer.entities.add({
  8537. polygon: {
  8538. hierarchy: new Cesium.PolygonHierarchy(_self.data),
  8539. material: _self._handleColor("#FFF8DC", options2.alpha),
  8540. height: new Cesium.CallbackProperty(_self._createPolygonUpdateFunction(), false),
  8541. perPositionHeight: false,
  8542. outline: true,
  8543. outlineColor: _self._handleColor("red", options2.alpha),
  8544. outlineWidth: 1
  8545. }
  8546. });
  8547. }
  8548. _createPolygonUpdateFunction() {
  8549. let _self = this;
  8550. return function() {
  8551. return _self.targetY;
  8552. };
  8553. }
  8554. _handleColor(color2, alpha) {
  8555. return Cesium.Color.fromCssColorString(color2).withAlpha(alpha || 1);
  8556. }
  8557. _getMinHeight(points2) {
  8558. let height2 = 0;
  8559. points2.map((point2) => {
  8560. let _height = point2[2] || 0;
  8561. height2 = _height;
  8562. if (_height < height2) {
  8563. height2 = _height;
  8564. }
  8565. });
  8566. return height2;
  8567. }
  8568. }
  8569. Object.assign(HeightLimit.prototype, {
  8570. addPrimitive(points2, options2) {
  8571. this.removePrimitive();
  8572. options2 = options2 || {};
  8573. options2.height = Cesium.defaultValue(options2.height, 50);
  8574. options2.baseHeight = Cesium.defaultValue(options2.baseHeight, 50);
  8575. options2.color = Cesium.defaultValue(options2.color, "red");
  8576. options2.alpha = Cesium.defaultValue(options2.alpha, 0.6);
  8577. let positions = points2.map((point2) => {
  8578. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8579. });
  8580. let _self = this;
  8581. _self.data = positions;
  8582. _self.baseHeight = options2.baseHeight;
  8583. _self.targetY = options2.baseHeight + options2.height;
  8584. let polygonInstance = new Cesium.GeometryInstance({
  8585. geometry: new Cesium.PolygonGeometry({
  8586. polygonHierarchy: new Cesium.PolygonHierarchy(_self.data),
  8587. height: _self.baseHeight,
  8588. extrudedHeight: _self.baseHeight + 3e3
  8589. }),
  8590. attributes: {
  8591. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  8592. Cesium.Color.fromCssColorString(options2.color).withAlpha(options2.alpha)
  8593. ),
  8594. show: new Cesium.ShowGeometryInstanceAttribute(true)
  8595. }
  8596. });
  8597. _self.limitHeightPrimitive = _self._viewer.scene.primitives.add(
  8598. new Cesium.ClassificationPrimitive({
  8599. geometryInstances: polygonInstance,
  8600. releaseGeometryInstances: false,
  8601. classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
  8602. })
  8603. );
  8604. _self._setPolygon(options2);
  8605. },
  8606. removePrimitive() {
  8607. if (this.HiePolygon) {
  8608. this._viewer.entities.remove(this.HiePolygon);
  8609. }
  8610. if (this.limitHeightPrimitive) {
  8611. this._viewer.scene.primitives.remove(this.limitHeightPrimitive);
  8612. }
  8613. },
  8614. changeHeight(height2) {
  8615. if (!this.limitHeightPrimitive)
  8616. return;
  8617. this.targetY = this.baseHeight + height2;
  8618. let cartographic = Cesium.Cartographic.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);
  8619. let surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight);
  8620. let offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight + height2);
  8621. let translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  8622. this.limitHeightPrimitive._primitive.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  8623. }
  8624. });
  8625. class Cutting {
  8626. constructor(viewer2) {
  8627. if (!viewer2)
  8628. throw new Cesium.DeveloperError("no viewer object!");
  8629. this._viewer = viewer2;
  8630. this._camera = this._viewer.camera;
  8631. this._scene = this._viewer.scene;
  8632. this.targetY = 0;
  8633. this._mouseHandler();
  8634. }
  8635. _mouseHandler() {
  8636. let _self = this;
  8637. let viewer2 = _self._viewer;
  8638. let scene = _self._scene;
  8639. let selectedPlane;
  8640. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8641. downHandler.setInputAction(function(movement) {
  8642. let pickedObject = scene.pick(movement.position);
  8643. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8644. selectedPlane = pickedObject.id.plane;
  8645. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8646. selectedPlane.outlineColor = Cesium.Color.RED;
  8647. scene.screenSpaceCameraController.enableInputs = false;
  8648. }
  8649. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8650. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8651. upHandler.setInputAction(function() {
  8652. if (Cesium.defined(selectedPlane)) {
  8653. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8654. selectedPlane.outlineColor = Cesium.Color.RED;
  8655. selectedPlane = void 0;
  8656. }
  8657. scene.screenSpaceCameraController.enableInputs = true;
  8658. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  8659. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8660. moveHandler.setInputAction(function(movement) {
  8661. if (Cesium.defined(selectedPlane)) {
  8662. let deltaY = movement.startPosition.y - movement.endPosition.y;
  8663. _self.targetY += deltaY;
  8664. }
  8665. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8666. }
  8667. _createPlaneUpdateFunction(plane) {
  8668. let _self = this;
  8669. return function() {
  8670. plane.distance = _self.targetY;
  8671. return plane;
  8672. };
  8673. }
  8674. _createPlane(p1, p2, inverseTransform) {
  8675. let _self = this;
  8676. let p1C3 = _self._getOriginCoordinateSystemPoint(p1, inverseTransform);
  8677. let p2C3 = _self._getOriginCoordinateSystemPoint(p2, inverseTransform);
  8678. let up = new Cesium.Cartesian3(0, 0, 10);
  8679. let right = Cesium.Cartesian3.subtract(p2C3, p1C3, new Cesium.Cartesian3());
  8680. let normal = Cesium.Cartesian3.cross(right, up, new Cesium.Cartesian3());
  8681. normal = Cesium.Cartesian3.normalize(normal, normal);
  8682. let planeTmp = Cesium.Plane.fromPointNormal(p1C3, normal);
  8683. return Cesium.ClippingPlane.fromPlane(planeTmp);
  8684. }
  8685. _getOriginCoordinateSystemPoint(point2, inverseTransform) {
  8686. let val = Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  8687. return Cesium.Matrix4.multiplyByPoint(
  8688. inverseTransform,
  8689. val,
  8690. new Cesium.Cartesian3(0, 0, 0)
  8691. );
  8692. }
  8693. _getInverseTransform(tileSet) {
  8694. let transform3;
  8695. const tmp = tileSet.root.transform;
  8696. if (tmp && tmp.equals(Cesium.Matrix4.IDENTITY) || !tmp) {
  8697. transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(tileSet.boundingSphere.center);
  8698. } else {
  8699. transform3 = Cesium.Matrix4.fromArray(tileSet.root.transform);
  8700. }
  8701. return Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8702. }
  8703. _isDirRes(polygon2, isClockwise) {
  8704. var lineStringList = [];
  8705. polygon2.forEach((p) => {
  8706. lineStringList.push([p.lng, p.lat]);
  8707. });
  8708. var clockwiseRing = lineString(lineStringList);
  8709. let isR = booleanClockwise(clockwiseRing);
  8710. var points2 = [];
  8711. if (isClockwise) {
  8712. if (!isR) {
  8713. points2 = polygon2;
  8714. } else {
  8715. var count = 0;
  8716. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8717. points2[count] = polygon2[ii];
  8718. count++;
  8719. }
  8720. }
  8721. } else {
  8722. if (isR) {
  8723. points2 = polygon2;
  8724. } else {
  8725. var count = 0;
  8726. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8727. points2[count] = polygon2[ii];
  8728. count++;
  8729. }
  8730. }
  8731. }
  8732. return points2;
  8733. }
  8734. }
  8735. Object.assign(Cutting.prototype, {
  8736. activate(tileset) {
  8737. let _self = this;
  8738. let viewer2 = _self._viewer;
  8739. let inverseTransform = _self._getInverseTransform(tileset);
  8740. const clippingPlanes1 = [];
  8741. clippingPlanes1.push(_self._createPlane([121.55814450142213, 37.39658788787028], [121.65814450142213, 37.49658788787028], inverseTransform));
  8742. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8743. planes: [
  8744. new Cesium.ClippingPlane(
  8745. new Cesium.Cartesian3(0, 1, 0),
  8746. -10
  8747. )
  8748. ],
  8749. edgeWidth: 1
  8750. });
  8751. _self.tileset = tileset;
  8752. tileset.clippingPlanes = clippingPlanes;
  8753. tileset.debugShowBoundingVolume = false;
  8754. return tileset.readyPromise.then(function() {
  8755. let boundingSphere = tileset.boundingSphere;
  8756. let radius = boundingSphere.radius;
  8757. viewer2.zoomTo(
  8758. tileset,
  8759. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 5)
  8760. );
  8761. if (!Cesium.Matrix4.equals(
  8762. tileset.root.transform,
  8763. Cesium.Matrix4.IDENTITY
  8764. )) {
  8765. const transformCenter = Cesium.Matrix4.getTranslation(tileset.root.transform, new Cesium.Cartesian3());
  8766. const transformCartographic = Cesium.Cartographic.fromCartesian(transformCenter);
  8767. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);
  8768. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  8769. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  8770. }
  8771. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8772. const plane = clippingPlanes.get(i2);
  8773. viewer2.entities.add({
  8774. position: boundingSphere.center,
  8775. plane: {
  8776. dimensions: new Cesium.Cartesian2(
  8777. radius / 10,
  8778. radius / 10
  8779. ),
  8780. material: Cesium.Color.WHITE.withAlpha(0.1),
  8781. plane: new Cesium.CallbackProperty(
  8782. _self._createPlaneUpdateFunction(plane),
  8783. false
  8784. ),
  8785. outline: true,
  8786. outlineColor: Cesium.Color.WHITE
  8787. }
  8788. });
  8789. }
  8790. return tileset;
  8791. });
  8792. },
  8793. addTiles(my3dtiles, pointsArray) {
  8794. let _self = this;
  8795. let viewer2 = _self._viewer;
  8796. let tileset = my3dtiles;
  8797. _self.polygon = pointsArray;
  8798. _self.tileset = tileset;
  8799. return tileset.readyPromise.then(function() {
  8800. let inverseTransform = _self._getInverseTransform(tileset);
  8801. _self.polygon = _self._isDirRes(_self.polygon, false);
  8802. const clippingPlanes1 = [];
  8803. for (let i2 = 0; i2 < _self.polygon.length; i2++) {
  8804. if (i2 === _self.polygon.length - 1) {
  8805. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[0], inverseTransform));
  8806. } else {
  8807. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform));
  8808. }
  8809. }
  8810. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8811. planes: clippingPlanes1,
  8812. edgeWidth: 1,
  8813. edgeColor: Cesium.Color.RED,
  8814. unionClippingRegions: false
  8815. });
  8816. _self.clippingPlanes = clippingPlanes;
  8817. tileset.clippingPlanes = clippingPlanes;
  8818. tileset.debugShowBoundingVolume = false;
  8819. let boundingSphere = tileset.boundingSphere;
  8820. let radius = boundingSphere.radius;
  8821. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8822. let plane = clippingPlanes.get(i2);
  8823. viewer2.entities.add({
  8824. position: boundingSphere.center,
  8825. plane: {
  8826. dimensions: new Cesium.Cartesian2(
  8827. radius / 10,
  8828. radius / 10
  8829. ),
  8830. material: Cesium.Color.RED.withAlpha(0.1),
  8831. plane: new Cesium.CallbackProperty(
  8832. _self._createPlaneUpdateFunction(plane),
  8833. false
  8834. ),
  8835. outline: true,
  8836. outlineColor: Cesium.Color.RED
  8837. }
  8838. });
  8839. }
  8840. return tileset;
  8841. });
  8842. },
  8843. addTiles2(my3dtiles, pointsArray) {
  8844. let _self = this;
  8845. _self._viewer;
  8846. let tileset = my3dtiles;
  8847. _self.polygon = pointsArray;
  8848. _self.tileset = tileset;
  8849. Cesium.Matrix4.fromArray(
  8850. [
  8851. 1,
  8852. 5551115123125783e-31,
  8853. 5898416033378595e-24,
  8854. 0,
  8855. -6106226635438361e-31,
  8856. 1,
  8857. -11355608731111744e-24,
  8858. 0,
  8859. -5898416061134171e-24,
  8860. 11355608731111744e-24,
  8861. 0.9999999999999999,
  8862. 0,
  8863. 9.912469893228263,
  8864. -19.08345020748675,
  8865. -14.613607150502503,
  8866. 1
  8867. ]
  8868. );
  8869. let transform3 = Cesium.Matrix4.fromArray(
  8870. [
  8871. -0.8874246461620654,
  8872. -0.46095281470464317,
  8873. 0,
  8874. 0,
  8875. 0.2602796082288922,
  8876. -0.5010893346724129,
  8877. 0.8253266045740758,
  8878. 0,
  8879. -0.3804366214290463,
  8880. 0.7324151700322881,
  8881. 0.5646556435405804,
  8882. 0,
  8883. -2429070591483741e-9,
  8884. 467643767731705e-8,
  8885. 3581165448379543e-9,
  8886. 1
  8887. ]
  8888. );
  8889. let inverseTransform = Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8890. let clippingPlanes1 = [];
  8891. for (let i2 = 0; i2 < _self.polygon.length - 1; i2++) {
  8892. let plane = _self.createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform);
  8893. clippingPlanes1.push(plane);
  8894. }
  8895. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8896. planes: clippingPlanes1,
  8897. edgeWidth: 1,
  8898. edgeColor: Cesium.Color.RED,
  8899. unionClippingRegions: false
  8900. });
  8901. _self.clippingPlanes = clippingPlanes;
  8902. return tileset.readyPromise.then(function() {
  8903. tileset.clippingPlanes = clippingPlanes;
  8904. tileset.debugShowBoundingVolume = false;
  8905. let boundingSphere = tileset.boundingSphere;
  8906. boundingSphere.radius;
  8907. return tileset;
  8908. });
  8909. },
  8910. toggleClipping() {
  8911. let _self = this;
  8912. _self.tileset = null;
  8913. }
  8914. });
  8915. class GeologyClipPlan {
  8916. constructor(viewer2) {
  8917. if (!viewer2)
  8918. throw new Cesium.DeveloperError("no viewer object!");
  8919. this._viewer = viewer2;
  8920. this._camera = this._viewer.camera;
  8921. this._scene = this._viewer.scene;
  8922. this.tileset = void 0;
  8923. this.targetY = 0;
  8924. this.planeEntities = [];
  8925. this._mouseHandler();
  8926. }
  8927. _mouseHandler() {
  8928. let _self = this;
  8929. let viewer2 = _self._viewer;
  8930. let scene = _self._scene;
  8931. let selectedPlane;
  8932. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8933. downHandler.setInputAction(function(movement) {
  8934. let pickedObject = scene.pick(movement.position);
  8935. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8936. selectedPlane = pickedObject.id.plane;
  8937. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8938. selectedPlane.outlineColor = Cesium.Color.RED;
  8939. scene.screenSpaceCameraController.enableInputs = false;
  8940. }
  8941. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8942. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8943. upHandler.setInputAction(function() {
  8944. if (Cesium.defined(selectedPlane)) {
  8945. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8946. selectedPlane.outlineColor = Cesium.Color.RED;
  8947. selectedPlane = void 0;
  8948. }
  8949. scene.screenSpaceCameraController.enableInputs = true;
  8950. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  8951. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8952. moveHandler.setInputAction(function(movement) {
  8953. if (Cesium.defined(selectedPlane)) {
  8954. let deltaY = movement.startPosition.y - movement.endPosition.y;
  8955. _self.targetY += deltaY;
  8956. }
  8957. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8958. }
  8959. _createPlaneUpdateFunction(plane) {
  8960. let _self = this;
  8961. return function() {
  8962. plane.distance = _self.targetY;
  8963. return plane;
  8964. };
  8965. }
  8966. }
  8967. Object.assign(GeologyClipPlan.prototype, {
  8968. activate(tileset, options2) {
  8969. let _self = this;
  8970. let viewer2 = _self._viewer;
  8971. let distance2 = 1e5;
  8972. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8973. planes: [
  8974. new Cesium.ClippingPlane(
  8975. new Cesium.Cartesian3(0, 0, -1),
  8976. distance2
  8977. )
  8978. ],
  8979. edgeWidth: 1
  8980. });
  8981. _self.tileset = tileset;
  8982. tileset.clippingPlanes = clippingPlanes;
  8983. tileset.debugShowBoundingVolume = false;
  8984. return tileset.readyPromise.then(function() {
  8985. let boundingSphere = tileset.boundingSphere;
  8986. let radius = boundingSphere.radius;
  8987. if (!Cesium.Matrix4.equals(
  8988. tileset.root.transform,
  8989. Cesium.Matrix4.IDENTITY
  8990. )) {
  8991. const transformCenter = Cesium.Matrix4.getTranslation(
  8992. tileset.root.transform,
  8993. new Cesium.Cartesian3()
  8994. );
  8995. const transformCartographic = Cesium.Cartographic.fromCartesian(
  8996. transformCenter
  8997. );
  8998. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(
  8999. tileset.boundingSphere.center
  9000. );
  9001. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  9002. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  9003. }
  9004. viewer2.zoomTo(
  9005. tileset,
  9006. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 10)
  9007. );
  9008. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  9009. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  9010. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  9011. cartographic.height;
  9012. var Cartesian33 = Cesium.Cartesian3.fromDegrees(lng, lat, 105);
  9013. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  9014. let plane = clippingPlanes.get(i2);
  9015. let planeEntity = viewer2.entities.add({
  9016. position: Cartesian33,
  9017. plane: {
  9018. dimensions: new Cesium.Cartesian2(
  9019. radius / 10,
  9020. radius / 20
  9021. ),
  9022. material: Cesium.Color.RED.withAlpha(0.1),
  9023. plane: new Cesium.CallbackProperty(
  9024. _self._createPlaneUpdateFunction(plane),
  9025. false
  9026. ),
  9027. outline: true,
  9028. outlineColor: Cesium.Color.RED
  9029. }
  9030. });
  9031. _self.planeEntities.push(planeEntity);
  9032. }
  9033. return tileset;
  9034. });
  9035. },
  9036. toggleClipping() {
  9037. let _self = this;
  9038. for (let i2 = 0; i2 < _self.planeEntities.length; i2++) {
  9039. _self._viewer.entities.remove(_self.planeEntities[i2]);
  9040. }
  9041. _self.planeEntities = [];
  9042. _self.targetY = 0;
  9043. let boundingSphere = _self.tileset.boundingSphere;
  9044. _self._camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(Cesium.Math.toRadians(120), Cesium.Math.toRadians(-10), boundingSphere.radius * 2.5));
  9045. _self._camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  9046. },
  9047. reset() {
  9048. this.planeEntities = [];
  9049. this.targetY = 0;
  9050. }
  9051. });
  9052. let SpatialAnalysis = {
  9053. SightLine,
  9054. ViewShed,
  9055. SunshineShadow,
  9056. Profile,
  9057. CutFill,
  9058. HeightLimit,
  9059. Cutting,
  9060. GeologyClipPlan
  9061. };
  9062. class TerrainExcavation {
  9063. constructor(viewer2) {
  9064. if (!viewer2)
  9065. throw new Error("no viewer object!");
  9066. this.viewer = viewer2;
  9067. }
  9068. prepareWell(activePoints) {
  9069. let pointLength = activePoints.length;
  9070. let heightDiff = this.excavateMinHeight - this.height;
  9071. let no_height_top = [], bottom_pos = [], lerp_pos = [];
  9072. for (let l = 0; l < pointLength; l++) {
  9073. let u = l == pointLength - 1 ? 0 : l + 1;
  9074. let point0 = [
  9075. Cesium.Cartographic.fromCartesian(activePoints[l]).longitude,
  9076. Cesium.Cartographic.fromCartesian(activePoints[l]).latitude
  9077. ];
  9078. let point1 = [
  9079. Cesium.Cartographic.fromCartesian(activePoints[u]).longitude,
  9080. Cesium.Cartographic.fromCartesian(activePoints[u]).latitude
  9081. ];
  9082. if (0 == l) {
  9083. lerp_pos.push(new Cesium.Cartographic(point0[0], point0[1]));
  9084. bottom_pos.push(
  9085. Cesium.Cartesian3.fromRadians(point0[0], point0[1], heightDiff)
  9086. );
  9087. no_height_top.push(
  9088. Cesium.Cartesian3.fromRadians(point0[0], point0[1], 0)
  9089. );
  9090. }
  9091. for (let p = 1; p <= this.splitNum; p++) {
  9092. let m = Cesium.Math.lerp(point0[0], point1[0], p / this.splitNum);
  9093. let g = Cesium.Math.lerp(point0[1], point1[1], p / this.splitNum);
  9094. l == pointLength - 1 && p == this.splitNum || (lerp_pos.push(new Cesium.Cartographic(m, g)), bottom_pos.push(Cesium.Cartesian3.fromRadians(m, g, heightDiff)), no_height_top.push(Cesium.Cartesian3.fromRadians(m, g, 0)));
  9095. }
  9096. }
  9097. this.wellData = {
  9098. lerp_pos,
  9099. bottom_pos,
  9100. no_height_top
  9101. };
  9102. }
  9103. createWell(wallData) {
  9104. let $this = this;
  9105. if (this.viewer.terrainProvider._layers) {
  9106. this.createBottomSurface(wallData.bottom_pos);
  9107. let positions = Cesium.sampleTerrainMostDetailed(
  9108. this.viewer.terrainProvider,
  9109. wallData.lerp_pos
  9110. );
  9111. positions.then(function(pos) {
  9112. let positionList = [];
  9113. for (let index2 = 0; index2 < pos.length; index2++) {
  9114. const element = pos[index2];
  9115. let curPos = Cesium.Cartesian3.fromRadians(
  9116. element.longitude,
  9117. element.latitude,
  9118. element.height
  9119. );
  9120. positionList.push(curPos);
  9121. }
  9122. $this.createWellWall(wallData.bottom_pos, positionList);
  9123. });
  9124. } else {
  9125. this.createBottomSurface(wallData.bottom_pos);
  9126. this.createWellWall(wallData.bottom_pos, wallData.no_height_top);
  9127. }
  9128. }
  9129. ellipsoidToDegree(pos) {
  9130. let cartesian3 = new Cesium.Cartesian3(pos.x, pos.y, pos.z);
  9131. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian3);
  9132. return {
  9133. longitude: Cesium.Math.toDegrees(cartographic.longitude),
  9134. latitude: Cesium.Math.toDegrees(cartographic.latitude),
  9135. altitude: cartographic.height
  9136. };
  9137. }
  9138. createBottomSurface(points2) {
  9139. if (points2.length) {
  9140. let minHeight = this.getMinHeight(points2);
  9141. let positions = [];
  9142. for (let i2 = 0; i2 < points2.length; i2++) {
  9143. let curPoint = this.ellipsoidToDegree(points2[i2]);
  9144. positions.push(curPoint.longitude, curPoint.latitude, minHeight);
  9145. }
  9146. let polygon2 = new Cesium.PolygonGeometry({
  9147. polygonHierarchy: new Cesium.PolygonHierarchy(
  9148. Cesium.Cartesian3.fromDegreesArrayHeights(positions)
  9149. ),
  9150. perPositionHeight: true
  9151. });
  9152. let material = new Cesium.Material({
  9153. fabric: {
  9154. type: "Image",
  9155. uniforms: {
  9156. image: this.bottomImg
  9157. }
  9158. }
  9159. });
  9160. let appearance = new Cesium.MaterialAppearance({
  9161. translucent: false,
  9162. flat: true,
  9163. material
  9164. });
  9165. this.bottomSurface = new Cesium.Primitive({
  9166. geometryInstances: new Cesium.GeometryInstance({
  9167. geometry: Cesium.PolygonGeometry.createGeometry(polygon2)
  9168. }),
  9169. appearance,
  9170. asynchronous: false
  9171. });
  9172. this.viewer.scene.primitives.add(this.bottomSurface);
  9173. }
  9174. }
  9175. createWellWall(bottomPos, positionList) {
  9176. let minHeight = this.getMinHeight(bottomPos);
  9177. let maxHeights = [], minHeights = [];
  9178. for (let i2 = 0; i2 < positionList.length; i2++) {
  9179. maxHeights.push(this.ellipsoidToDegree(positionList[i2]).altitude);
  9180. minHeights.push(minHeight);
  9181. }
  9182. let wall = new Cesium.WallGeometry({
  9183. positions: positionList,
  9184. maximumHeights: maxHeights,
  9185. minimumHeights: minHeights
  9186. });
  9187. let geometry2 = Cesium.WallGeometry.createGeometry(wall);
  9188. let material = new Cesium.Material({
  9189. fabric: {
  9190. type: "Image",
  9191. uniforms: {
  9192. image: this.wallImg
  9193. }
  9194. }
  9195. });
  9196. let appearance = new Cesium.MaterialAppearance({
  9197. translucent: false,
  9198. flat: true,
  9199. material
  9200. });
  9201. this.wellWall = new Cesium.Primitive({
  9202. geometryInstances: new Cesium.GeometryInstance({
  9203. geometry: geometry2,
  9204. attributes: {
  9205. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9206. Cesium.Color.GREY
  9207. )
  9208. },
  9209. id: "PitWall"
  9210. }),
  9211. appearance,
  9212. asynchronous: false
  9213. });
  9214. this.viewer.scene.primitives.add(this.wellWall);
  9215. }
  9216. getMinHeight(points2) {
  9217. let minHeight = 5e6;
  9218. let minPoint = null;
  9219. for (let i2 = 0; i2 < points2.length; i2++) {
  9220. let height2 = points2[i2]["z"];
  9221. if (height2 < minHeight) {
  9222. minHeight = height2;
  9223. minPoint = this.ellipsoidToDegree(points2[i2]);
  9224. }
  9225. }
  9226. return minPoint.altitude;
  9227. }
  9228. switchExcavate(show) {
  9229. if (show) {
  9230. this.viewer.scene.globe.material = null;
  9231. this.wellWall.show = true;
  9232. this.bottomSurface.show = true;
  9233. } else {
  9234. this.viewer.scene.globe.material = null;
  9235. this.wellWall.show = false;
  9236. this.bottomSurface.show = false;
  9237. }
  9238. }
  9239. updateExcavateDepth(height2) {
  9240. this.viewer.scene.primitives.remove(this.bottomSurface);
  9241. this.viewer.scene.primitives.remove(this.wellWall);
  9242. console.log(this.wellData, this.excavateMinHeight);
  9243. let lerp_pos = this.wellData.lerp_pos;
  9244. let posList = [];
  9245. for (let n = 0; n < lerp_pos.length; n++) {
  9246. posList.push(
  9247. Cesium.Cartesian3.fromRadians(
  9248. lerp_pos[n].longitude,
  9249. lerp_pos[n].latitude,
  9250. this.excavateMinHeight - height2
  9251. )
  9252. );
  9253. }
  9254. this.wellData.bottom_pos = posList;
  9255. this.createWell(this.wellData);
  9256. }
  9257. }
  9258. Object.defineProperties(TerrainExcavation.prototype, {
  9259. show: {
  9260. get: function() {
  9261. return this._show;
  9262. },
  9263. set: function(e) {
  9264. this._show = e;
  9265. this.switchExcavate(e);
  9266. }
  9267. },
  9268. height: {
  9269. get: function() {
  9270. return this._height;
  9271. },
  9272. set: function(e) {
  9273. this._height = e;
  9274. this.updateExcavateDepth(e);
  9275. }
  9276. }
  9277. });
  9278. Object.assign(TerrainExcavation.prototype, {
  9279. add(activePoints, options2) {
  9280. options2 = options2 || {};
  9281. this._height = options2.excavateDepth || 10;
  9282. this.bottomImg = options2.bottomImg || "jt3dSDK/imgs/polygon/ground.png";
  9283. this.wallImg = options2.wallImg || "jt3dSDK/imgs/polygon/ground.png";
  9284. this.splitNum = Cesium.defaultValue(options2.splitNum, 50);
  9285. activePoints = activePoints.map((point2) => {
  9286. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9287. });
  9288. let viewer2 = this.viewer;
  9289. this.clear();
  9290. let clippingPlanesList = [];
  9291. let car3Difference = Cesium.Cartesian3.subtract(
  9292. activePoints[0],
  9293. activePoints[1],
  9294. new Cesium.Cartesian3()
  9295. );
  9296. let boolDiff = car3Difference.x > 0;
  9297. this.excavateMinHeight = 999999999;
  9298. for (let index2 = 0; index2 < activePoints.length; ++index2) {
  9299. let s = (index2 + 1) % activePoints.length;
  9300. let curMidPoint = Cesium.Cartesian3.midpoint(
  9301. activePoints[index2],
  9302. activePoints[s],
  9303. new Cesium.Cartesian3()
  9304. );
  9305. let cartographic = Cesium.Cartographic.fromCartesian(activePoints[index2]);
  9306. let curHeight = viewer2.scene.globe.getHeight(cartographic) || cartographic.height;
  9307. console.log(curHeight);
  9308. if (curHeight < this.excavateMinHeight) {
  9309. this.excavateMinHeight = curHeight;
  9310. }
  9311. let curMidPointNormal = Cesium.Cartesian3.normalize(
  9312. curMidPoint,
  9313. new Cesium.Cartesian3()
  9314. );
  9315. let curMidPointDifference = boolDiff ? Cesium.Cartesian3.subtract(
  9316. activePoints[index2],
  9317. curMidPoint,
  9318. new Cesium.Cartesian3()
  9319. ) : Cesium.Cartesian3.subtract(
  9320. activePoints[s],
  9321. curMidPoint,
  9322. new Cesium.Cartesian3()
  9323. );
  9324. curMidPointDifference = Cesium.Cartesian3.normalize(
  9325. curMidPointDifference,
  9326. curMidPointDifference
  9327. );
  9328. let curMidPointCross = Cesium.Cartesian3.cross(
  9329. curMidPointDifference,
  9330. curMidPointNormal,
  9331. new Cesium.Cartesian3()
  9332. );
  9333. curMidPointCross = Cesium.Cartesian3.normalize(
  9334. curMidPointCross,
  9335. curMidPointCross
  9336. );
  9337. let plane = new Cesium.Plane(curMidPointCross, 0);
  9338. let distance2 = Cesium.Plane.getPointDistance(plane, curMidPoint);
  9339. clippingPlanesList.push(
  9340. new Cesium.ClippingPlane(curMidPointCross, distance2)
  9341. );
  9342. }
  9343. this.viewer.scene.globe.clippingPlanes = new Cesium.ClippingPlaneCollection({
  9344. planes: clippingPlanesList,
  9345. edgeWidth: 1,
  9346. edgeColor: Cesium.Color.WHITE,
  9347. enabled: true
  9348. });
  9349. this.prepareWell(activePoints);
  9350. this.createWell(this.wellData);
  9351. },
  9352. clear() {
  9353. if (this.viewer.scene.globe.clippingPlanes) {
  9354. this.viewer.scene.globe.clippingPlanes.removeAll();
  9355. this.viewer.scene.primitives.remove(this.bottomSurface);
  9356. this.viewer.scene.primitives.remove(this.wellWall);
  9357. this.viewer.scene.render();
  9358. }
  9359. }
  9360. });
  9361. class SlopeAspect {
  9362. constructor(viewer2) {
  9363. if (!viewer2)
  9364. throw new Cesium.DeveloperError("no viewer object!");
  9365. this._viewer = viewer2;
  9366. this.result = [];
  9367. this.handler = void 0;
  9368. this.toolTip = "";
  9369. }
  9370. _openTip() {
  9371. let _self = this;
  9372. this.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  9373. this.handler.setInputAction(function(movement) {
  9374. let endPos = movement.endPosition;
  9375. var pick = _self._viewer.scene.pick(endPos);
  9376. if (pick && pick.id && pick.id.type === "SlopeAspect") {
  9377. _self.toolTip = pick.id.value.toFixed(2);
  9378. CreateRemindertip(_self.toolTip, endPos, true);
  9379. } else {
  9380. _self.toolTip = "";
  9381. CreateRemindertip(_self.toolTip, endPos, false);
  9382. }
  9383. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  9384. }
  9385. _createEllipse(gridSquare) {
  9386. let _self = this;
  9387. let boxResults = [];
  9388. for (let index2 = 0; index2 < gridSquare.features.length; index2++) {
  9389. const feature2 = gridSquare.features[index2];
  9390. const coordinates = feature2.geometry.coordinates[0];
  9391. const centerdegree = [
  9392. (coordinates[0][0] + coordinates[2][0]) / 2,
  9393. (coordinates[0][1] + coordinates[2][1]) / 2
  9394. ];
  9395. let centerCartographic = Cesium.Cartographic.fromDegrees(
  9396. centerdegree[0],
  9397. centerdegree[1]
  9398. );
  9399. boxResults.push(centerCartographic);
  9400. for (let i2 = 0; i2 < coordinates.length; i2++) {
  9401. const coord = coordinates[i2];
  9402. let cartographic = Cesium.Cartographic.fromDegrees(coord[0], coord[1]);
  9403. boxResults.push(cartographic);
  9404. const coord1 = coordinates[i2 + 1];
  9405. if (coord1) {
  9406. let newCoord = [(coord[0] + coord1[0]) / 2, (coord[1] + coord1[1]) / 2];
  9407. let newCartographic = Cesium.Cartographic.fromDegrees(newCoord[0], newCoord[1]);
  9408. boxResults.push(newCartographic);
  9409. }
  9410. }
  9411. }
  9412. Cesium.sampleTerrainMostDetailed(
  9413. _self._viewer.scene.terrainProvider,
  9414. boxResults
  9415. ).then((updatePositions) => {
  9416. let arrr = [];
  9417. let ellipseResults = updatePositions.reduce(function(pre, item, index2, updatePositions2) {
  9418. var begin = index2 * 10;
  9419. var end = begin + 10;
  9420. var res = updatePositions2.slice(begin, end);
  9421. if (res.length != 0) {
  9422. arrr[index2] = res;
  9423. }
  9424. return arrr;
  9425. }, []);
  9426. _self._calculateSlope(ellipseResults);
  9427. _self._openTip();
  9428. });
  9429. }
  9430. _createPolygonInsrance(points2, color2) {
  9431. let positions = [];
  9432. for (let index2 = 1; index2 < points2.length - 1; index2++) {
  9433. const element = points2[index2];
  9434. positions.push(Cesium.Cartographic.toCartesian(element));
  9435. }
  9436. let polygon2 = new Cesium.PolygonGeometry({
  9437. polygonHierarchy: new Cesium.PolygonHierarchy(positions)
  9438. });
  9439. let polygonInstance = new Cesium.GeometryInstance({
  9440. geometry: polygon2,
  9441. attributes: {
  9442. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9443. Cesium.Color.fromCssColorString(color2)
  9444. ),
  9445. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9446. }
  9447. });
  9448. return polygonInstance;
  9449. }
  9450. _createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope) {
  9451. let cartographic_0 = new Cesium.Cartographic(
  9452. (targetPoint.longitude + center2.longitude) / 2,
  9453. (targetPoint.latitude + center2.latitude) / 2,
  9454. (targetPoint.height + center2.height) / 2
  9455. );
  9456. let cartographic_1 = new Cesium.Cartographic(
  9457. (diagonalPoint.longitude + center2.longitude) / 2,
  9458. (diagonalPoint.latitude + center2.latitude) / 2,
  9459. (diagonalPoint.height + center2.height) / 2
  9460. );
  9461. let positions1 = heightDifference > 0 ? [
  9462. Cesium.Cartographic.toCartesian(cartographic_0),
  9463. Cesium.Cartographic.toCartesian(cartographic_1)
  9464. ] : [
  9465. Cesium.Cartographic.toCartesian(cartographic_1),
  9466. Cesium.Cartographic.toCartesian(cartographic_0)
  9467. ];
  9468. const instance = new Cesium.GeometryInstance({
  9469. id: {
  9470. type: "SlopeAspect",
  9471. value: curSlope
  9472. },
  9473. geometry: new Cesium.GroundPolylineGeometry({
  9474. positions: positions1,
  9475. width: this.arrowWidth
  9476. }),
  9477. attributes: {
  9478. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9479. Cesium.Color.BLUE.withAlpha(0.6)
  9480. ),
  9481. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9482. }
  9483. });
  9484. return instance;
  9485. }
  9486. _calculateSlope(ellipseResults) {
  9487. let _self = this;
  9488. let instances = [];
  9489. let polygonInstance = [];
  9490. for (let index2 = 0; index2 < ellipseResults.length; index2++) {
  9491. const ellipse = ellipseResults[index2];
  9492. const center2 = ellipse[0];
  9493. let heightDifference = 0;
  9494. let maxIndex = 0;
  9495. for (let i2 = 1; i2 < ellipse.length - 1; i2++) {
  9496. const point2 = ellipse[i2];
  9497. let curHD = point2.height - center2.height;
  9498. if (Math.abs(curHD) > heightDifference) {
  9499. heightDifference = curHD;
  9500. maxIndex = i2;
  9501. }
  9502. }
  9503. let pos0 = new Cesium.Cartographic(center2.longitude, center2.latitude, 0);
  9504. let pos1 = new Cesium.Cartographic(
  9505. ellipse[maxIndex].longitude,
  9506. ellipse[maxIndex].latitude,
  9507. 0
  9508. );
  9509. let distance2 = Cesium.Cartesian3.distance(
  9510. Cesium.Cartographic.toCartesian(pos0),
  9511. Cesium.Cartographic.toCartesian(pos1)
  9512. );
  9513. let curSlope = Math.abs(heightDifference / distance2);
  9514. let curColor = _self._calculateSlopeColor(curSlope, 0.4);
  9515. const curPolygonInstance = _self._createPolygonInsrance(ellipse, curColor);
  9516. polygonInstance.push(curPolygonInstance);
  9517. let diagonalPoint = maxIndex > 4 ? ellipse[maxIndex - 4] : ellipse[maxIndex + 4];
  9518. let targetPoint = ellipse[maxIndex];
  9519. const arrowInstance = _self._createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope);
  9520. instances.push(arrowInstance);
  9521. }
  9522. const mapPrimitive = _self._viewer.scene.primitives.add(
  9523. new Cesium.GroundPrimitive({
  9524. geometryInstances: polygonInstance,
  9525. appearance: new Cesium.PerInstanceColorAppearance({
  9526. translucent: true,
  9527. closed: false
  9528. })
  9529. })
  9530. );
  9531. const arrowPrimitive = _self._viewer.scene.primitives.add(
  9532. new Cesium.GroundPolylinePrimitive({
  9533. geometryInstances: instances,
  9534. appearance: new Cesium.PolylineMaterialAppearance({
  9535. material: new Cesium.Material({
  9536. fabric: {
  9537. type: "PolylineArrow",
  9538. uniforms: {
  9539. color: new Cesium.Color(1, 1, 0, 0.8)
  9540. }
  9541. }
  9542. })
  9543. })
  9544. })
  9545. );
  9546. _self.result.push(arrowPrimitive, mapPrimitive);
  9547. }
  9548. _calculateSlopeColor(value, alpha) {
  9549. if (value < 0.00872686779075879) {
  9550. return "rgba(85,182,43," + alpha + ")";
  9551. } else if (value < 0.03492076949174773) {
  9552. return "rgba(135,211,43," + alpha + ")";
  9553. } else if (value < 0.08748866352592401) {
  9554. return "rgba(204,244,44," + alpha + ")";
  9555. } else if (value < 0.2679491924311227) {
  9556. return "rgba(245,233,44," + alpha + ")";
  9557. } else if (value < 0.7002075382097097) {
  9558. return "rgba(255,138,43," + alpha + ")";
  9559. } else if (value < 1.4281480067421144) {
  9560. return "rgba(255,84,43," + alpha + ")";
  9561. } else {
  9562. return "rgba(255,32,43," + alpha + ")";
  9563. }
  9564. }
  9565. }
  9566. Object.assign(SlopeAspect.prototype, {
  9567. createNew4Distance(points2, polygon$1, options2) {
  9568. let _self = this;
  9569. options2 = options2 || {};
  9570. options2.distance = options2.distance || 0.1;
  9571. let width2 = options2.distance * 200 > 35 ? 35 : options2.distance * 200;
  9572. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9573. let positions = points2.map((point2) => {
  9574. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9575. });
  9576. _self.clearAll();
  9577. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9578. let boundary = [];
  9579. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9580. for (let index2 = 0; index2 < degrees.length; index2++) {
  9581. const element = degrees[index2];
  9582. const x = element.lng;
  9583. const y = element.lat;
  9584. boundary.push([x, y]);
  9585. minX = x < minX ? x : minX;
  9586. minY = y < minY ? y : minY;
  9587. maxX = x > maxX ? x : maxX;
  9588. maxY = y > maxY ? y : maxY;
  9589. }
  9590. boundary.push(boundary[0]);
  9591. let bbox2 = [minX, minY, maxX, maxY];
  9592. polygon([boundary]);
  9593. let gridSquare = squareGrid(bbox2, options2.distance, {});
  9594. _self._createEllipse(gridSquare);
  9595. },
  9596. createNew4Num(points2, polygon$1, options2) {
  9597. let _self = this;
  9598. options2 = options2 || {};
  9599. options2.num = Cesium.defaultValue(options2.num, 10);
  9600. let positions = points2.map((point2) => {
  9601. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9602. });
  9603. _self.clearAll();
  9604. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9605. let boundary = [];
  9606. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9607. for (let index2 = 0; index2 < degrees.length; index2++) {
  9608. const element = degrees[index2];
  9609. const x = element.lng;
  9610. const y = element.lat;
  9611. boundary.push([x, y]);
  9612. minX = x < minX ? x : minX;
  9613. minY = y < minY ? y : minY;
  9614. maxX = x > maxX ? x : maxX;
  9615. maxY = y > maxY ? y : maxY;
  9616. }
  9617. boundary.push(boundary[0]);
  9618. let bbox2 = [minX, minY, maxX, maxY];
  9619. let a = maxX - minX;
  9620. let b = maxY - minY;
  9621. b = b > a ? b : a;
  9622. const step = b / options2.num;
  9623. let width2 = step * 2e3 > 35 ? 35 : step * 2e3;
  9624. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9625. polygon([boundary]);
  9626. let gridSquare = squareGrid(bbox2, step, {
  9627. units: "degrees"
  9628. });
  9629. _self._createEllipse(gridSquare);
  9630. },
  9631. clearAll() {
  9632. this.result.forEach((element) => {
  9633. this._viewer.scene.primitives.remove(element);
  9634. });
  9635. this.result = [];
  9636. if (this.handler) {
  9637. this.handler.destroy();
  9638. this.handler = void 0;
  9639. }
  9640. }
  9641. });
  9642. let TerrainAnalysis = {
  9643. TerrainExcavation,
  9644. SlopeAspect
  9645. };
  9646. class Weather {
  9647. constructor(viewer2) {
  9648. if (!viewer2)
  9649. throw new Cesium.DeveloperError("no viewer object!");
  9650. this._viewer = viewer2;
  9651. }
  9652. _initRain() {
  9653. this.rainStage = new Cesium.PostProcessStage({
  9654. name: "jt_rain",
  9655. fragmentShader: this._rain(),
  9656. uniforms: {
  9657. tiltAngle: () => {
  9658. return this.tiltAngle;
  9659. },
  9660. rainSize: () => {
  9661. return this.rainSize;
  9662. },
  9663. rainSpeed: () => {
  9664. return this.rainSpeed;
  9665. }
  9666. }
  9667. });
  9668. this._viewer.scene.postProcessStages.add(this.rainStage);
  9669. }
  9670. _initSnow() {
  9671. this.snowStage = new Cesium.PostProcessStage({
  9672. name: "jt_snow",
  9673. fragmentShader: this._snow(),
  9674. uniforms: {
  9675. snowSize: () => {
  9676. return this.snowSize;
  9677. },
  9678. snowSpeed: () => {
  9679. return this.snowSpeed;
  9680. }
  9681. }
  9682. });
  9683. this._viewer.scene.postProcessStages.add(this.snowStage);
  9684. }
  9685. _initFog() {
  9686. this.fogStage = new Cesium.PostProcessStage({
  9687. name: "jt_fog",
  9688. fragmentShader: this._fog(),
  9689. uniforms: {
  9690. visibility: () => {
  9691. return this.visibility;
  9692. },
  9693. fogColor: () => {
  9694. return this.color;
  9695. }
  9696. }
  9697. });
  9698. this._viewer.scene.postProcessStages.add(this.fogStage);
  9699. }
  9700. _rain() {
  9701. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainSpeed;\n float hash(float x) {\n return fract(sin(x * 133.3) * 13.13);\n }\n void main(void) {\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n vec3 c = vec3(.6, .7, .8);\n float a = tiltAngle;\n float si = sin(a), co = cos(a);\n uv *= mat2(co, -si, si, co);\n uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\n float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\n float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\n c *= v * b;\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\n }\n ";
  9702. }
  9703. _snow() {
  9704. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSpeed;\n uniform float snowSize;\n float snow(vec2 uv,float scale)\n {\n float time=czm_frameNumber/snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution=czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c=0.;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor=mix(texture2D(colorTexture,v_textureCoordinates),vec4(finalColor,1),.5);\n }\n ";
  9705. }
  9706. _fog() {
  9707. return "uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates; \n void main(void) \n { \n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates); \n float depth = czm_readDepth(depthTexture, v_textureCoordinates); \n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates); \n float f = visibility * (depthcolor.r - 0.3) / 0.2; \n if (f < 0.0) f = 0.0; \n else if (f > 1.0) f = 1.0; \n gl_FragColor = mix(origcolor, fogColor, f); \n }\n";
  9708. }
  9709. _removeSnow() {
  9710. if (!this._viewer || !this.snowStage)
  9711. return;
  9712. this._viewer.scene.postProcessStages.remove(this.snowStage);
  9713. delete this.snowSize;
  9714. delete this.snowSpeed;
  9715. }
  9716. _removeRain() {
  9717. if (!this._viewer || !this.rainStage)
  9718. return;
  9719. this._viewer.scene.postProcessStages.remove(this.rainStage);
  9720. delete this.tiltAngle;
  9721. delete this.rainSize;
  9722. delete this.rainSpeed;
  9723. }
  9724. _removeFog() {
  9725. if (!this._viewer || !this.fogStage)
  9726. return;
  9727. this._viewer.scene.postProcessStages.remove(this.fogStage);
  9728. delete this.visibility;
  9729. delete this.color;
  9730. }
  9731. }
  9732. Object.assign(Weather.prototype, {
  9733. addRainEffect(options2) {
  9734. options2 = options2 || {};
  9735. this.tiltAngle = Cesium.defaultValue(options2.tiltAngle, -0.6);
  9736. this.rainSize = Cesium.defaultValue(options2.rainSize, 0.3);
  9737. this.rainSpeed = Cesium.defaultValue(options2.rainSpeed, 60);
  9738. this._initRain();
  9739. },
  9740. addSnowEffect(options2) {
  9741. options2 = options2 || {};
  9742. this.snowSize = Cesium.defaultValue(options2.snowSize, 0.02);
  9743. this.snowSpeed = Cesium.defaultValue(options2.snowSpeed, 60);
  9744. this._initSnow();
  9745. },
  9746. addFogEffect(options2) {
  9747. options2 = options2 || {};
  9748. this.visibility = Cesium.defaultValue(options2.visibility, 0.1);
  9749. this.color = Cesium.defaultValue(options2.color, new Cesium.Color(0.8, 0.8, 0.8, 0.5));
  9750. this._show = Cesium.defaultValue(options2.show, true);
  9751. this._initFog();
  9752. },
  9753. removeEffect() {
  9754. if (this.snowStage) {
  9755. this._removeSnow();
  9756. }
  9757. if (this.rainStage) {
  9758. this._removeRain();
  9759. }
  9760. if (this.fogStage) {
  9761. this._removeFog();
  9762. }
  9763. }
  9764. });
  9765. const BoxGeometry = Cesium.BoxGeometry;
  9766. const Cartesian3 = Cesium.Cartesian3;
  9767. const defaultValue = Cesium.defaultValue;
  9768. const defined = Cesium.defined;
  9769. const destroyObject = Cesium.destroyObject;
  9770. const DeveloperError$1 = Cesium.DeveloperError;
  9771. const GeometryPipeline = Cesium.GeometryPipeline;
  9772. const Matrix3 = Cesium.Matrix3;
  9773. const Matrix4 = Cesium.Matrix4;
  9774. const Transforms = Cesium.Transforms;
  9775. const VertexFormat = Cesium.VertexFormat;
  9776. const BufferUsage = Cesium.BufferUsage;
  9777. const CubeMap = Cesium.CubeMap;
  9778. const DrawCommand = Cesium.DrawCommand;
  9779. const loadCubeMap = Cesium.loadCubeMap;
  9780. const RenderState = Cesium.RenderState;
  9781. const VertexArray = Cesium.VertexArray;
  9782. const BlendingState = Cesium.BlendingState;
  9783. const SceneMode = Cesium.SceneMode;
  9784. const ShaderProgram = Cesium.ShaderProgram;
  9785. const ShaderSource = Cesium.ShaderSource;
  9786. const SkyBoxFS = "uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n ";
  9787. const SkyBoxVS = "attribute vec3 position;\n varying vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ";
  9788. if (!Cesium.defined(Cesium.Matrix4.getRotation)) {
  9789. Cesium.Matrix4.getRotation = Cesium.Matrix4.getMatrix3;
  9790. }
  9791. class SkyBoxOnGround {
  9792. constructor(options2) {
  9793. this.sources = options2.sources;
  9794. this._sources = void 0;
  9795. this.show = defaultValue(options2.show, true);
  9796. this._command = new DrawCommand({
  9797. modelMatrix: Matrix4.clone(Matrix4.IDENTITY),
  9798. owner: this
  9799. });
  9800. this._cubeMap = void 0;
  9801. this._attributeLocations = void 0;
  9802. this._useHdr = void 0;
  9803. }
  9804. }
  9805. const skyboxMatrix3 = new Matrix3();
  9806. SkyBoxOnGround.prototype.update = function(frameState, useHdr) {
  9807. const that = this;
  9808. if (!this.show) {
  9809. return void 0;
  9810. }
  9811. if (frameState.mode !== SceneMode.SCENE3D && frameState.mode !== SceneMode.MORPHING) {
  9812. return void 0;
  9813. }
  9814. if (!frameState.passes.render) {
  9815. return void 0;
  9816. }
  9817. const context = frameState.context;
  9818. if (this._sources !== this.sources) {
  9819. this._sources = this.sources;
  9820. const sources = this.sources;
  9821. if (!defined(sources.positiveX) || !defined(sources.negativeX) || !defined(sources.positiveY) || !defined(sources.negativeY) || !defined(sources.positiveZ) || !defined(sources.negativeZ)) {
  9822. throw new DeveloperError$1(
  9823. "this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  9824. );
  9825. }
  9826. if (typeof sources.positiveX !== typeof sources.negativeX || typeof sources.positiveX !== typeof sources.positiveY || typeof sources.positiveX !== typeof sources.negativeY || typeof sources.positiveX !== typeof sources.positiveZ || typeof sources.positiveX !== typeof sources.negativeZ) {
  9827. throw new DeveloperError$1(
  9828. "this.sources properties must all be the same type."
  9829. );
  9830. }
  9831. if (typeof sources.positiveX === "string") {
  9832. loadCubeMap(context, this._sources).then(function(cubeMap) {
  9833. that._cubeMap = that._cubeMap && that._cubeMap.destroy();
  9834. that._cubeMap = cubeMap;
  9835. });
  9836. } else {
  9837. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9838. this._cubeMap = new CubeMap({
  9839. context,
  9840. source: sources
  9841. });
  9842. }
  9843. }
  9844. const command = this._command;
  9845. command.modelMatrix = Transforms.eastNorthUpToFixedFrame(
  9846. frameState.camera._positionWC
  9847. );
  9848. if (!defined(command.vertexArray)) {
  9849. command.uniformMap = {
  9850. u_cubeMap: function() {
  9851. return that._cubeMap;
  9852. },
  9853. u_rotateMatrix: function() {
  9854. return Matrix4.getRotation(command.modelMatrix, skyboxMatrix3);
  9855. }
  9856. };
  9857. const geometry2 = BoxGeometry.createGeometry(
  9858. BoxGeometry.fromDimensions({
  9859. dimensions: new Cartesian3(2, 2, 2),
  9860. vertexFormat: VertexFormat.POSITION_ONLY
  9861. })
  9862. );
  9863. const attributeLocations = this._attributeLocations = GeometryPipeline.createAttributeLocations(
  9864. geometry2
  9865. );
  9866. command.vertexArray = VertexArray.fromGeometry({
  9867. context,
  9868. geometry: geometry2,
  9869. attributeLocations,
  9870. bufferUsage: BufferUsage._DRAW
  9871. });
  9872. command.renderState = RenderState.fromCache({
  9873. blending: BlendingState.ALPHA_BLEND
  9874. });
  9875. }
  9876. if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {
  9877. const fs = new ShaderSource({
  9878. defines: [useHdr ? "HDR" : ""],
  9879. sources: [SkyBoxFS]
  9880. });
  9881. command.shaderProgram = ShaderProgram.fromCache({
  9882. context,
  9883. vertexShaderSource: SkyBoxVS,
  9884. fragmentShaderSource: fs,
  9885. attributeLocations: this._attributeLocations
  9886. });
  9887. this._useHdr = useHdr;
  9888. }
  9889. if (!defined(this._cubeMap)) {
  9890. return void 0;
  9891. }
  9892. return command;
  9893. };
  9894. SkyBoxOnGround.prototype.isDestroyed = function() {
  9895. return false;
  9896. };
  9897. SkyBoxOnGround.prototype.destroy = function() {
  9898. const command = this._command;
  9899. command.vertexArray = command.vertexArray && command.vertexArray.destroy();
  9900. command.shaderProgram = command.shaderProgram && command.shaderProgram.destroy();
  9901. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9902. return destroyObject(this);
  9903. };
  9904. class SkyBox {
  9905. constructor(viewer2) {
  9906. if (!viewer2)
  9907. throw new Cesium.DeveloperError("no viewer object!");
  9908. this._viewer = viewer2;
  9909. this._farSkyBox = viewer2.scene.skyBox;
  9910. }
  9911. }
  9912. Object.assign(SkyBox.prototype, {
  9913. setGroundSkyBox(options2) {
  9914. options2 = options2 || {};
  9915. options2.height = options2.height || 2e5;
  9916. options2.type = options2.type || "\u84DD\u5929";
  9917. if (!options2.sources) {
  9918. switch (options2.type) {
  9919. case "\u665A\u971E":
  9920. options2.sources = {
  9921. positiveX: "jt3dSDK/imgs/skybox/01/px.png",
  9922. negativeX: "jt3dSDK/imgs/skybox/01/nx.png",
  9923. positiveY: "jt3dSDK/imgs/skybox/01/py.png",
  9924. negativeY: "jt3dSDK/imgs/skybox/01/ny.png",
  9925. positiveZ: "jt3dSDK/imgs/skybox/01/pz.png",
  9926. negativeZ: "jt3dSDK/imgs/skybox/01/nz.png"
  9927. };
  9928. break;
  9929. case "\u9634\u5929":
  9930. options2.sources = {
  9931. positiveX: "jt3dSDK/imgs/skybox/02/px.jpg",
  9932. negativeX: "jt3dSDK/imgs/skybox/02/nx.jpg",
  9933. positiveY: "jt3dSDK/imgs/skybox/02/py.jpg",
  9934. negativeY: "jt3dSDK/imgs/skybox/02/ny.jpg",
  9935. positiveZ: "jt3dSDK/imgs/skybox/02/pz.jpg",
  9936. negativeZ: "jt3dSDK/imgs/skybox/02/nz.jpg"
  9937. };
  9938. break;
  9939. case "\u84DD\u5929":
  9940. options2.sources = {
  9941. positiveX: "jt3dSDK/imgs/skybox/03/px.jpg",
  9942. negativeX: "jt3dSDK/imgs/skybox/03/nx.jpg",
  9943. positiveY: "jt3dSDK/imgs/skybox/03/py.jpg",
  9944. negativeY: "jt3dSDK/imgs/skybox/03/ny.jpg",
  9945. positiveZ: "jt3dSDK/imgs/skybox/03/pz.jpg",
  9946. negativeZ: "jt3dSDK/imgs/skybox/03/nz.jpg"
  9947. };
  9948. break;
  9949. case "\u7D2B\u8272\u661F\u7A7A":
  9950. options2.sources = {
  9951. positiveX: "jt3dSDK/imgs/skybox/04/px.jpg",
  9952. negativeX: "jt3dSDK/imgs/skybox/04/nx.jpg",
  9953. positiveY: "jt3dSDK/imgs/skybox/04/py.jpg",
  9954. negativeY: "jt3dSDK/imgs/skybox/04/ny.jpg",
  9955. positiveZ: "jt3dSDK/imgs/skybox/04/pz.jpg",
  9956. negativeZ: "jt3dSDK/imgs/skybox/04/nz.jpg"
  9957. };
  9958. break;
  9959. case "\u84DD\u8272\u661F\u7A7A":
  9960. options2.sources = {
  9961. positiveX: "jt3dSDK/imgs/skybox/05/px.jpg",
  9962. negativeX: "jt3dSDK/imgs/skybox/05/nx.jpg",
  9963. positiveY: "jt3dSDK/imgs/skybox/05/py.jpg",
  9964. negativeY: "jt3dSDK/imgs/skybox/05/ny.jpg",
  9965. positiveZ: "jt3dSDK/imgs/skybox/05/pz.jpg",
  9966. negativeZ: "jt3dSDK/imgs/skybox/05/nz.jpg"
  9967. };
  9968. break;
  9969. }
  9970. } else if (!Cesium.defined(options2.sources.positiveX) || !Cesium.defined(options2.sources.negativeX) || !Cesium.defined(options2.sources.positiveY) || !Cesium.defined(options2.sources.negativeY) || !Cesium.defined(options2.sources.positiveZ) || !Cesium.defined(options2.sources.negativeZ)) {
  9971. throw new Cesium.DeveloperError(
  9972. "options.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  9973. );
  9974. }
  9975. let _self = this;
  9976. let groundSkyBox = new SkyBoxOnGround({
  9977. sources: options2.sources,
  9978. show: true
  9979. });
  9980. _self._viewer.scene.postRender.addEventListener(() => {
  9981. var e = _self._viewer.camera.position;
  9982. if (Cesium.Cartographic.fromCartesian(e).height < options2.height) {
  9983. _self._viewer.scene.skyBox = groundSkyBox;
  9984. } else {
  9985. _self._viewer.scene.skyBox = _self._defaultSkyBox;
  9986. }
  9987. });
  9988. }
  9989. });
  9990. class ParticleSystem {
  9991. constructor(viewer2) {
  9992. if (!viewer2)
  9993. throw new DeveloperError("no viewer object!");
  9994. this.viewer = viewer2;
  9995. }
  9996. }
  9997. Object.assign(ParticleSystem.prototype, {
  9998. createParticleFire: function(coordinates) {
  9999. this.viewer.clock.shouldAnimate = true;
  10000. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  10001. var entity = this.viewer.entities.add({
  10002. position: position2
  10003. });
  10004. function computeModelMatrix(entity2, time) {
  10005. var position3 = Cesium.Property.getValueOrUndefined(entity2.position);
  10006. var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position3);
  10007. return modelMatrix;
  10008. }
  10009. var viewModel = {
  10010. startScale: 3,
  10011. endScale: 1.5,
  10012. minimumParticleLife: 1.5,
  10013. maximumParticleLife: 1.8,
  10014. minimumSpeed: 7,
  10015. maximumSpeed: 9,
  10016. particleSize: 2,
  10017. emissionRate: 200
  10018. };
  10019. var primitive = this.viewer.scene.primitives.add(
  10020. new Cesium.ParticleSystem({
  10021. image: "jt3dSDK/imgs/particlesystem/fire.png",
  10022. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10023. startColor: new Cesium.Color(1, 1, 1, 1),
  10024. endColor: new Cesium.Color(0.5, 0, 0, 0),
  10025. startScale: viewModel.startScale,
  10026. endScale: viewModel.endScale,
  10027. minimumParticleLife: viewModel.minimumParticleLife,
  10028. maximumParticleLife: viewModel.maximumParticleLife,
  10029. minimumSpeed: viewModel.minimumSpeed,
  10030. maximumSpeed: viewModel.maximumSpeed,
  10031. emissionRate: viewModel.emissionRate,
  10032. lifetime: 16,
  10033. loop: true,
  10034. sizeInMeters: true,
  10035. emitter: new Cesium.ConeEmitter(Cesium.Math.toRadians(45)),
  10036. modelMatrix: computeModelMatrix(entity, Cesium.JulianDate.now())
  10037. })
  10038. );
  10039. entity.remove = function() {
  10040. viewer.entities.remove(entity);
  10041. viewer.scene.primitives.remove(primitive);
  10042. };
  10043. return entity;
  10044. },
  10045. createParticleWater: function(coordinates) {
  10046. let viewer2 = this.viewer;
  10047. this.viewer.clock.shouldAnimate = true;
  10048. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  10049. var entity = this.viewer.entities.add({
  10050. position: position2
  10051. });
  10052. function computeModelMatrix(entity2, time) {
  10053. return entity2.computeModelMatrix(time, new Cesium.Matrix4());
  10054. }
  10055. function computeEmitterModelMatrix() {
  10056. let hpr = Cesium.HeadingPitchRoll.fromDegrees(viewModel.heading, viewModel.pitch, viewModel.roll);
  10057. let trs = new Cesium.TranslationRotationScale();
  10058. trs.translation = Cesium.Cartesian3.fromElements(0, 0, 1);
  10059. trs.rotation = Cesium.Quaternion.fromHeadingPitchRoll(hpr);
  10060. let Matrix42 = Cesium.Matrix4.fromTranslationRotationScale(trs);
  10061. return Matrix42;
  10062. }
  10063. function updateCallback(p, dt2) {
  10064. var gravityScratch = new Cesium.Cartesian3();
  10065. var position3 = p.position;
  10066. Cesium.Cartesian3.normalize(position3, gravityScratch);
  10067. Cesium.Cartesian3.multiplyByScalar(gravityScratch, viewModel.gravity * dt2, gravityScratch);
  10068. p.velocity = Cesium.Cartesian3.add(p.velocity, gravityScratch, p.velocity);
  10069. }
  10070. function update(scene, time) {
  10071. waterParticleSystem.modelMatrix = computeModelMatrix(entity, time);
  10072. waterParticleSystem.emitterModelMatrix = computeEmitterModelMatrix();
  10073. }
  10074. viewer2.scene.preUpdate.addEventListener(update);
  10075. var viewModel = {
  10076. startScale: 1,
  10077. endScale: 7,
  10078. minimumParticleLife: 6,
  10079. maximumParticleLife: 7,
  10080. minimumSpeed: 9,
  10081. maximumSpeed: 9.5,
  10082. particleSize: 1,
  10083. emissionRate: 60,
  10084. gravity: -4,
  10085. heading: 110,
  10086. pitch: 30,
  10087. roll: 0
  10088. };
  10089. var waterParticleSystem = new Cesium.ParticleSystem({
  10090. image: "jt3dSDK/imgs/particlesystem/water.png",
  10091. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10092. startColor: new Cesium.Color(1, 1, 1, 0.6),
  10093. endColor: new Cesium.Color(0.8, 0.86, 1, 0.4),
  10094. startScale: viewModel.startScale,
  10095. endScale: viewModel.endScale,
  10096. minimumParticleLife: viewModel.minimumParticleLife,
  10097. maximumParticleLife: viewModel.maximumParticleLife,
  10098. minimumSpeed: viewModel.minimumSpeed,
  10099. maximumSpeed: viewModel.maximumSpeed,
  10100. emissionRate: viewModel.emissionRate,
  10101. sizeInMeters: true,
  10102. emitter: new Cesium.CircleEmitter(0.2),
  10103. modelMatrix: computeModelMatrix(entity),
  10104. emitterModelMatrix: computeEmitterModelMatrix(),
  10105. updateCallback
  10106. });
  10107. viewer2.scene.primitives.add(waterParticleSystem);
  10108. entity.remove = function() {
  10109. viewer2.entities.remove(entity);
  10110. viewer2.scene.primitives.remove(waterParticleSystem);
  10111. };
  10112. return entity;
  10113. }
  10114. });
  10115. let SceneEffects = {
  10116. Weather,
  10117. SkyBox,
  10118. ParticleSystem
  10119. };
  10120. class ImageLayerSplit {
  10121. constructor(viewer2) {
  10122. if (!viewer2)
  10123. throw new Cesium.DeveloperError("no viewer object!");
  10124. this._viewer = viewer2;
  10125. }
  10126. }
  10127. Object.assign(ImageLayerSplit.prototype, {
  10128. initSplit() {
  10129. let _self = this;
  10130. this.viewer = this._viewer;
  10131. let sliderDiv = document.getElementById("image_slider");
  10132. if (sliderDiv == null) {
  10133. sliderDiv = document.createElement("div");
  10134. sliderDiv.id = "image_slider";
  10135. sliderDiv.style.position = "absolute";
  10136. sliderDiv.style.left = "50%";
  10137. sliderDiv.style.top = "0px";
  10138. sliderDiv.style.backgroundColor = "#d3d3d3";
  10139. sliderDiv.style.width = "5px";
  10140. sliderDiv.style.height = "100%";
  10141. sliderDiv.style.zIndex = "9999";
  10142. sliderDiv.onmouseover = function() {
  10143. this.style.cursor = "ew-resize";
  10144. };
  10145. document.body.appendChild(sliderDiv);
  10146. }
  10147. this.slider = sliderDiv;
  10148. viewer.scene.splitPosition = this.slider.offsetLeft / this.slider.parentElement.offsetWidth;
  10149. if (this.handler) {
  10150. this.handler.destroy();
  10151. this.handler = null;
  10152. }
  10153. this.handler = new Cesium.ScreenSpaceEventHandler(this.slider);
  10154. var moveActive = false;
  10155. function move(movement) {
  10156. if (!moveActive) {
  10157. return;
  10158. }
  10159. var relativeOffset = movement.endPosition.x;
  10160. var splitPosition = (_self.slider.offsetLeft + relativeOffset) / _self.slider.parentElement.offsetWidth;
  10161. _self.slider.style.left = `${100 * splitPosition}%`;
  10162. viewer.scene.splitPosition = splitPosition;
  10163. }
  10164. this.handler.setInputAction(function() {
  10165. moveActive = true;
  10166. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  10167. this.handler.setInputAction(function() {
  10168. moveActive = true;
  10169. }, Cesium.ScreenSpaceEventType.PINCH_START);
  10170. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10171. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);
  10172. this.handler.setInputAction(function() {
  10173. moveActive = false;
  10174. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  10175. this.handler.setInputAction(function() {
  10176. moveActive = false;
  10177. }, Cesium.ScreenSpaceEventType.PINCH_END);
  10178. },
  10179. addSplitLayer(earthAtLeft, earthAtRight) {
  10180. if (this.earthAtLeft) {
  10181. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10182. }
  10183. if (this.earthAtRight) {
  10184. this._viewer.imageryLayers.remove(this.earthAtRight);
  10185. }
  10186. this.earthAtLeft = earthAtLeft;
  10187. this.earthAtRight = earthAtRight;
  10188. this.earthAtLeft.splitDirection = Cesium.SplitDirection.LEFT;
  10189. this.earthAtRight.splitDirection = Cesium.SplitDirection.RIGHT;
  10190. },
  10191. removeSplitLayer() {
  10192. document.body.removeChild(this.slider);
  10193. if (this.earthAtLeft) {
  10194. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10195. }
  10196. if (this.earthAtRight) {
  10197. this._viewer.imageryLayers.remove(this.earthAtRight);
  10198. }
  10199. }
  10200. });
  10201. class ViewerSplitScreen {
  10202. constructor() {
  10203. }
  10204. }
  10205. Object.assign(ViewerSplitScreen.prototype, {
  10206. initHandler(viewer1, viewer2) {
  10207. var _self = this;
  10208. if (_self.handler1 && _self.handler1.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)) {
  10209. return;
  10210. }
  10211. _self.handler1 = new Cesium.ScreenSpaceEventHandler(viewer1.scene.canvas);
  10212. _self.handler2 = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  10213. _self.handler1.setInputAction(function(movement) {
  10214. var _camerca = viewer1.camera;
  10215. viewer2.camera.setView({
  10216. destination: _camerca.position,
  10217. orientation: {
  10218. direction: _camerca._direction,
  10219. up: _camerca.up,
  10220. heading: _camerca.heading,
  10221. pitch: _camerca.pitch,
  10222. roll: _camerca.roll
  10223. }
  10224. });
  10225. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10226. _self.handler1.setInputAction(function(movement) {
  10227. var _camerca = viewer1.camera;
  10228. viewer2.camera.setView({
  10229. destination: _camerca.position,
  10230. orientation: {
  10231. direction: _camerca._direction,
  10232. up: _camerca.up,
  10233. heading: _camerca.heading,
  10234. pitch: _camerca.pitch,
  10235. roll: _camerca.roll
  10236. }
  10237. });
  10238. }, Cesium.ScreenSpaceEventType.WHEEL);
  10239. _self.handler2.setInputAction(function(movement) {
  10240. var _camerca = viewer2.camera;
  10241. viewer1.camera.setView({
  10242. destination: _camerca.position,
  10243. orientation: {
  10244. direction: _camerca._direction,
  10245. up: _camerca.up,
  10246. heading: _camerca.heading,
  10247. pitch: _camerca.pitch,
  10248. roll: _camerca.roll
  10249. }
  10250. });
  10251. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10252. _self.handler2.setInputAction(function(movement) {
  10253. var _camerca = viewer2.camera;
  10254. viewer1.camera.setView({
  10255. destination: _camerca.position,
  10256. orientation: {
  10257. direction: _camerca._direction,
  10258. up: _camerca.up,
  10259. heading: _camerca.heading,
  10260. pitch: _camerca.pitch,
  10261. roll: _camerca.roll
  10262. }
  10263. });
  10264. }, Cesium.ScreenSpaceEventType.WHEEL);
  10265. },
  10266. clearHandler() {
  10267. var _self = this;
  10268. if (_self.handler1) {
  10269. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10270. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10271. }
  10272. if (_self.handler2) {
  10273. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10274. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10275. }
  10276. }
  10277. });
  10278. let SceneControl = {
  10279. ImageLayerSplit,
  10280. ViewerSplitScreen
  10281. };
  10282. class TrackRoam {
  10283. constructor(viewer2) {
  10284. if (!viewer2)
  10285. throw new Cesium.DeveloperError("no viewer object!");
  10286. this._viewer = viewer2;
  10287. this._draw3DObj = null;
  10288. }
  10289. _startFly(pathsData, options2) {
  10290. var _self = this;
  10291. options2 = options2 || {};
  10292. options2.time = Cesium.defaultValue(options2.time, 360);
  10293. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10294. options2.height = Cesium.defaultValue(options2.height, 5);
  10295. options2.role = Cesium.defaultValue(options2.role, 1);
  10296. this.url = options2.modelUrl;
  10297. this.time = options2.time;
  10298. this.isPathShow = options2.isPathShow;
  10299. this.height = options2.height;
  10300. this.role = options2.role;
  10301. _self.clearFlyPaths();
  10302. _self._viewer.camera.setView({
  10303. destination: pathsData.position,
  10304. orientation: pathsData.orientation
  10305. });
  10306. setTimeout(function() {
  10307. executeFly3D();
  10308. }, 200);
  10309. function executeFly3D() {
  10310. if (pathsData && pathsData.geometry) {
  10311. var positionA = pathsData.geometry.coordinates;
  10312. let positions = positionA.map((point2) => {
  10313. return Cesium.Cartesian3.fromDegrees(point2.lng, point2.lat, point2.height);
  10314. });
  10315. let distance2 = [];
  10316. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10317. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10318. distance2.push(dis);
  10319. }
  10320. let times = [Cesium.JulianDate.fromDate(new Date())];
  10321. times.push(Cesium.JulianDate.addSeconds(times[0], _self.time, new Cesium.JulianDate()));
  10322. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10323. let s = Cesium.JulianDate.addSeconds(times[i2], _self.time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10324. times.push(s);
  10325. }
  10326. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10327. oriSamples.addSamples(times, positions);
  10328. let startTime = times[0];
  10329. let stopTime = times[times.length - 1];
  10330. _self._viewer.clock.startTime = startTime.clone();
  10331. _self._viewer.clock.stopTime = stopTime.clone();
  10332. _self._viewer.clock.currentTime = startTime.clone();
  10333. _self._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10334. _self._viewer.clock.multiplier = 10;
  10335. let timeOfResolution = 6;
  10336. let samplesNum = Math.floor(
  10337. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10338. );
  10339. let sampledPositions = [];
  10340. let sampledTimes = [];
  10341. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10342. let sampleTime = Cesium.JulianDate.addSeconds(
  10343. startTime,
  10344. i2 * timeOfResolution,
  10345. new Cesium.JulianDate()
  10346. );
  10347. let tmpPos = oriSamples.getValue(sampleTime);
  10348. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10349. sampledTimes.push(sampleTime);
  10350. }
  10351. Cesium.sampleTerrainMostDetailed(
  10352. _self._viewer.terrainProvider,
  10353. sampledPositions
  10354. ).then(() => {
  10355. let carPositionProperty = new Cesium.SampledPositionProperty();
  10356. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10357. sampledPositions[i2].height = sampledPositions[i2].height + _self.height;
  10358. }
  10359. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10360. carPositionProperty.addSample(
  10361. sampledTimes[i2],
  10362. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10363. );
  10364. }
  10365. var position2 = carPositionProperty;
  10366. _self.entityFly = _self._viewer.entities.add({
  10367. availability: new Cesium.TimeIntervalCollection([
  10368. new Cesium.TimeInterval({
  10369. start: startTime,
  10370. stop: stopTime
  10371. })
  10372. ]),
  10373. position: position2,
  10374. orientation: new Cesium.VelocityOrientationProperty(position2),
  10375. point: {
  10376. color: Cesium.Color.RED,
  10377. outlineColor: Cesium.Color.WHITE,
  10378. outlineWidth: 2,
  10379. pixelSize: 10
  10380. },
  10381. path: {
  10382. show: _self.isPathShow,
  10383. resolution: 1,
  10384. material: new Cesium.PolylineGlowMaterialProperty({
  10385. glowPower: 0.1,
  10386. color: Cesium.Color.YELLOW
  10387. }),
  10388. width: 10
  10389. }
  10390. });
  10391. if (_self.role == 0)
  10392. ;
  10393. else if (_self.role == 1) {
  10394. _self._viewer.trackedEntity = _self.entityFly;
  10395. } else if (_self.role == 2) {
  10396. _self._viewer.trackedEntity = _self.entityFly;
  10397. let exection = function TimeExecution() {
  10398. if (_self._viewer.clock.shouldAnimate === true) {
  10399. let center2 = _self.entity.position.getValue(
  10400. _self._viewer.clock.currentTime
  10401. );
  10402. let orientation = _self.entity.orientation.getValue(
  10403. _self._viewer.clock.currentTime
  10404. );
  10405. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10406. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10407. _self._viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(-50, 0, 250));
  10408. }
  10409. };
  10410. _self._viewer.clock.onTick.addEventListener(exection);
  10411. } else if (_self.role == 3) {
  10412. _self._viewer.trackedEntity = _self.entityFly;
  10413. let exection = function TimeExecution() {
  10414. if (_self._viewer.clock.shouldAnimate === true) {
  10415. let center2 = _self.entity.position.getValue(
  10416. _self._viewer.clock.currentTime
  10417. );
  10418. _self._viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10419. }
  10420. };
  10421. _self._viewer.clock.onTick.addEventListener(exection);
  10422. }
  10423. });
  10424. } else {
  10425. return;
  10426. }
  10427. }
  10428. }
  10429. }
  10430. Object.assign(TrackRoam.prototype, {
  10431. drawFlyPaths(coordinates, options2) {
  10432. return new Promise((resolve2, reject2) => {
  10433. let _self = this;
  10434. _self.clearFlyPaths();
  10435. let position2 = _self._viewer.camera.position;
  10436. let heading = _self._viewer.camera.heading;
  10437. let pitch = _self._viewer.camera.pitch;
  10438. let roll = _self._viewer.camera.roll;
  10439. var pathsData = {
  10440. "orientation": {
  10441. "heading": heading,
  10442. "pitch": pitch,
  10443. "roll": roll
  10444. },
  10445. "position": position2,
  10446. "clampToGround": true,
  10447. "geometry": {
  10448. "type": "LineString",
  10449. "coordinates": coordinates
  10450. }
  10451. };
  10452. _self._draw3DObj = pathsData;
  10453. resolve2(true);
  10454. });
  10455. },
  10456. clearFlyPaths() {
  10457. this._draw3DObj = null;
  10458. this._viewer.trackedEntity = void 0;
  10459. this._viewer.entities.remove(this.entityFly);
  10460. },
  10461. startFly(options2, callError) {
  10462. if (this._draw3DObj) {
  10463. this._startFly(this._draw3DObj, options2);
  10464. } else {
  10465. if (callError)
  10466. callError("\u6F2B\u6E38\u8DEF\u7EBF\u4E0D\u5B58\u5728");
  10467. }
  10468. },
  10469. pauseFly() {
  10470. var clockViewModel = this._viewer.clockViewModel;
  10471. if (clockViewModel.shouldAnimate) {
  10472. clockViewModel.shouldAnimate = false;
  10473. } else if (this._viewer.clockViewModel.canAnimate) {
  10474. clockViewModel.shouldAnimate = true;
  10475. }
  10476. },
  10477. forwardFly() {
  10478. var clockViewModel = this._viewer.clockViewModel;
  10479. var multiplier = clockViewModel.multiplier;
  10480. if (multiplier < 0) {
  10481. clockViewModel.multiplier = -multiplier;
  10482. }
  10483. clockViewModel.shouldAnimate = true;
  10484. },
  10485. backwardsFly() {
  10486. var clockViewModel = this._viewer.clockViewModel;
  10487. var multiplier = clockViewModel.multiplier;
  10488. if (multiplier > 0) {
  10489. clockViewModel.multiplier = -multiplier;
  10490. }
  10491. clockViewModel.shouldAnimate = true;
  10492. },
  10493. outFly() {
  10494. var start2 = Cesium.JulianDate.fromDate(new Date());
  10495. this._viewer.clock.startTime = start2.clone();
  10496. var stop = Cesium.JulianDate.addSeconds(start2, 3e8, new Cesium.JulianDate());
  10497. this._viewer.clock.stopTime = stop.clone();
  10498. this.clearFlyPaths();
  10499. }
  10500. });
  10501. class Roaming {
  10502. constructor(viewer2, positions, options2) {
  10503. if (!viewer2)
  10504. throw new Cesium.DeveloperError("no viewer object!");
  10505. if (!positions)
  10506. throw new Cesium.DeveloperError("no positions Array!");
  10507. this.viewer = viewer2;
  10508. this.entity = void 0;
  10509. options2 = options2 || {};
  10510. options2.time = Cesium.defaultValue(options2.time, 360);
  10511. options2.speed = Cesium.defaultValue(options2.speed, 10);
  10512. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10513. options2.height = Cesium.defaultValue(options2.height, 5);
  10514. options2.role = Cesium.defaultValue(options2.role, 1);
  10515. options2.followedX = Cesium.defaultValue(options2.followedX, 50);
  10516. options2.followedZ = Cesium.defaultValue(options2.followedZ, 10);
  10517. this.time = options2.time;
  10518. this.speed = options2.speed;
  10519. this.isPathShow = options2.isPathShow;
  10520. this.height = options2.height;
  10521. this.role = options2.role;
  10522. this.followedX = options2.followedX;
  10523. this.followedZ = options2.followedZ;
  10524. this.model = options2.model;
  10525. this.billboard = options2.billboard;
  10526. this.point = options2.point;
  10527. this.label = options2.label;
  10528. this.property = this.ComputeRoamingLineProperty(positions, this.time);
  10529. }
  10530. ComputeRoamingLineProperty(Lines, time) {
  10531. let positions = [];
  10532. if (Lines[0] instanceof Cesium.Cartesian3) {
  10533. positions = Lines;
  10534. } else {
  10535. positions = Lines.map((point2) => {
  10536. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10537. });
  10538. }
  10539. let distance2 = [];
  10540. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10541. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10542. distance2.push(dis);
  10543. }
  10544. let times = [Cesium.JulianDate.fromDate(new Date())];
  10545. times.push(Cesium.JulianDate.addSeconds(times[0], time, new Cesium.JulianDate()));
  10546. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10547. let s = Cesium.JulianDate.addSeconds(times[i2], time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10548. times.push(s);
  10549. }
  10550. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10551. oriSamples.addSamples(times, positions);
  10552. let startTime = times[0];
  10553. let stopTime = times[times.length - 1];
  10554. this.viewer.clock.startTime = startTime.clone();
  10555. this.viewer.clock.stopTime = stopTime.clone();
  10556. this.viewer.clock.currentTime = startTime.clone();
  10557. this.viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10558. this.viewer.clock.multiplier = this.speed;
  10559. let timeOfResolution = 6;
  10560. let samplesNum = Math.floor(
  10561. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10562. );
  10563. let sampledPositions = [];
  10564. let sampledTimes = [];
  10565. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10566. let sampleTime = Cesium.JulianDate.addSeconds(
  10567. startTime,
  10568. i2 * timeOfResolution,
  10569. new Cesium.JulianDate()
  10570. );
  10571. let tmpPos = oriSamples.getValue(sampleTime);
  10572. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10573. sampledTimes.push(sampleTime);
  10574. }
  10575. Cesium.sampleTerrainMostDetailed(
  10576. this.viewer.terrainProvider,
  10577. sampledPositions
  10578. ).then((updatedPositions) => {
  10579. let carPositionProperty = new Cesium.SampledPositionProperty();
  10580. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10581. sampledPositions[i2].height = sampledPositions[i2].height + this.height;
  10582. }
  10583. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10584. carPositionProperty.addSample(
  10585. sampledTimes[i2],
  10586. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10587. );
  10588. }
  10589. var position2 = carPositionProperty;
  10590. this.InitRoaming(position2, startTime, stopTime, this.isPathShow);
  10591. });
  10592. }
  10593. InitRoaming(position2, start2, stop, isPathShow) {
  10594. this.entity = this.viewer.entities.add({
  10595. availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
  10596. start: start2,
  10597. stop
  10598. })]),
  10599. position: position2,
  10600. orientation: new Cesium.VelocityOrientationProperty(position2),
  10601. path: {
  10602. resolution: 1,
  10603. material: new Cesium.PolylineGlowMaterialProperty({
  10604. glowPower: 0.1,
  10605. color: Cesium.Color.YELLOW
  10606. }),
  10607. width: 10,
  10608. show: isPathShow
  10609. }
  10610. });
  10611. if (this.model) {
  10612. let model = this.model;
  10613. this.entity.model = {
  10614. uri: model.url,
  10615. minimumPixelSize: 64,
  10616. maximumSize: 128,
  10617. maximumScale: 200,
  10618. show: true,
  10619. silhouetteColor: Cesium.Color.WHITE,
  10620. debugWireframe: false,
  10621. debugShowBoundingVolume: false,
  10622. scale: 20,
  10623. runAnimations: true
  10624. };
  10625. } else if (this.billboard) {
  10626. let billboard = this.billboard;
  10627. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  10628. this.entity.billboard = {
  10629. image: billboard.imgUrl,
  10630. show: true,
  10631. width: 30,
  10632. scale: 1,
  10633. height: 30,
  10634. pixelOffset: new Cesium.Cartesian2(0, -14)
  10635. };
  10636. } else {
  10637. let point2 = {};
  10638. if (this.point) {
  10639. point2 = this.point;
  10640. }
  10641. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  10642. if (point2.color) {
  10643. if (point2.color instanceof Array) {
  10644. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  10645. } else if (typeof point2.color === "string") {
  10646. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  10647. } else {
  10648. point2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  10649. }
  10650. }
  10651. if (point2.outlineColor) {
  10652. if (point2.outlineColor instanceof Array) {
  10653. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  10654. } else if (typeof point2.outlineColor === "string") {
  10655. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  10656. } else {
  10657. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10658. }
  10659. }
  10660. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 2);
  10661. this.entity.point = point2;
  10662. }
  10663. if (this.label) {
  10664. let label = this.label;
  10665. label.text = Cesium.defaultValue(label.text, "");
  10666. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  10667. if (label.fillColor) {
  10668. if (label.fillColor instanceof Array) {
  10669. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  10670. } else if (typeof label.fillColor === "string") {
  10671. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  10672. } else {
  10673. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10674. }
  10675. }
  10676. if (label.outlineColor) {
  10677. if (label.outlineColor instanceof Array) {
  10678. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  10679. } else if (typeof label.outlineColor === "string") {
  10680. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  10681. } else {
  10682. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10683. }
  10684. }
  10685. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  10686. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  10687. if (label.backgroundColor) {
  10688. if (label.backgroundColor instanceof Array) {
  10689. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  10690. } else if (typeof label.backgroundColor === "string") {
  10691. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  10692. } else {
  10693. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10694. }
  10695. }
  10696. label.pixelOffset = Cesium.defaultValue(label.pixelOffset, 0);
  10697. label.scale = Cesium.defaultValue(label.scale, 1);
  10698. label.near = Cesium.defaultValue(label.near, 150);
  10699. label.nearValue = Cesium.defaultValue(label.nearValue, 1);
  10700. label.far = Cesium.defaultValue(label.far, 2400);
  10701. label.farValue = Cesium.defaultValue(label.farValue, 0);
  10702. this.entity.label = {
  10703. text: label.text,
  10704. font: label.font,
  10705. fillColor: label.fillColor,
  10706. outlineColor: label.outlineColor,
  10707. outlineWidth: label.outlineWidth,
  10708. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  10709. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  10710. showBackground: label.showBackground,
  10711. backgroundColor: label.backgroundColor,
  10712. backgroundPadding: new Cesium.Cartesian2(6, 6),
  10713. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  10714. pixelOffset: new Cesium.Cartesian2(0, label.pixelOffset),
  10715. scale: label.scale
  10716. };
  10717. }
  10718. this.entity.position.setInterpolationOptions({
  10719. interpolationDegree: 5,
  10720. interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
  10721. });
  10722. this.initRole(this.role);
  10723. }
  10724. initRole(role) {
  10725. let _self = this;
  10726. if (role == 0) {
  10727. this.viewer.trackedEntity = void 0;
  10728. let len = _self.viewer.clock.onTick.numberOfListeners;
  10729. for (let i2 = 0; i2 < len; i2++) {
  10730. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10731. }
  10732. } else if (role == 1) {
  10733. this.viewer.trackedEntity = this.entity;
  10734. let len = _self.viewer.clock.onTick.numberOfListeners;
  10735. for (let i2 = 0; i2 < len; i2++) {
  10736. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10737. }
  10738. } else if (role == 2) {
  10739. this.viewer.trackedEntity = this.entity;
  10740. let exection = function TimeExecution() {
  10741. if (_self.viewer.clock.shouldAnimate === true) {
  10742. let center2 = _self.entity.position.getValue(
  10743. _self.viewer.clock.currentTime
  10744. );
  10745. let orientation = _self.entity.orientation.getValue(
  10746. _self.viewer.clock.currentTime
  10747. );
  10748. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10749. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10750. var transformX = _self.followedX || 50;
  10751. var transformZ = _self.followedZ || 10;
  10752. _self.viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(transformX, 0, transformZ));
  10753. }
  10754. };
  10755. this.viewer.clock.onTick.addEventListener(exection);
  10756. } else if (role == 3) {
  10757. this.viewer.trackedEntity = this.entity;
  10758. let exection = function TimeExecution() {
  10759. if (_self.viewer.clock.shouldAnimate === true) {
  10760. let center2 = _self.entity.position.getValue(
  10761. _self.viewer.clock.currentTime
  10762. );
  10763. _self.viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10764. }
  10765. };
  10766. this.viewer.clock.onTick.addEventListener(exection);
  10767. }
  10768. }
  10769. PauseOrContinue(state) {
  10770. this.viewer.clock.shouldAnimate = state;
  10771. }
  10772. forwardFly() {
  10773. var multiplier = this.viewer.clock.multiplier;
  10774. if (multiplier < 0) {
  10775. this.viewer.clock.multiplier = -multiplier;
  10776. }
  10777. this.viewer.clock.shouldAnimate = true;
  10778. }
  10779. backwardsFly() {
  10780. var multiplier = this.viewer.clock.multiplier;
  10781. if (multiplier > 0) {
  10782. this.viewer.clock.multiplier = -multiplier;
  10783. }
  10784. this.viewer.clock.shouldAnimate = true;
  10785. }
  10786. ChangeRoamingSpeed(value) {
  10787. this.viewer.clock.multiplier = value;
  10788. }
  10789. EndRoaming() {
  10790. if (this.entity !== void 0) {
  10791. this.viewer.entities.remove(this.entity);
  10792. }
  10793. this.viewer.trackedEntity = void 0;
  10794. this.viewer.clock.shouldAnimate = false;
  10795. let len = this.viewer.clock.onTick.numberOfListeners;
  10796. for (let i2 = 0; i2 < len; i2++) {
  10797. this.viewer.clock.onTick.removeEventListener(this.viewer.clock.onTick._listeners[i2]);
  10798. }
  10799. }
  10800. }
  10801. class PolygonObject {
  10802. constructor(viewer2) {
  10803. if (!viewer2)
  10804. throw new Cesium.DeveloperError("no viewer object!");
  10805. this._viewer = viewer2;
  10806. this._drawEntities = [];
  10807. this._polygonEntity = null;
  10808. }
  10809. }
  10810. Object.assign(PolygonObject.prototype, {
  10811. drawPolygonByGeoJson(geoJsonUrl, options2) {
  10812. return new Promise((resolve2, reject2) => {
  10813. let _self = this;
  10814. if (!Cesium.defined(geoJsonUrl)) {
  10815. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  10816. }
  10817. options2 = options2 || {};
  10818. options2.id = options2.id || setSessionid$1();
  10819. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  10820. options2.color = Cesium.defaultValue(options2.color, "#FF0000");
  10821. options2.outlineColor = Cesium.defaultValue(options2.outlineColor, "#FFFF00");
  10822. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10823. options2.extrudedHeight = Cesium.defaultValue(options2.extrudedHeight, 0);
  10824. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  10825. clampToGround: true,
  10826. stroke: Cesium.Color.WHITE,
  10827. strokeWidth: 3,
  10828. fill: Cesium.Color.RED.withAlpha(0.5)
  10829. });
  10830. promise.then((dataSource) => {
  10831. _self._viewer.dataSources.add(dataSource);
  10832. dataSource.name = options2.id;
  10833. let entities2 = dataSource.entities.values;
  10834. for (let index2 = 0; index2 < entities2.length; index2++) {
  10835. let entity = entities2[index2];
  10836. entity.polygon.material = new Cesium.Color.fromCssColorString(color).withAlpha(0.1);
  10837. entity.polygon.extrudedHeight = options2.extrudedHeight;
  10838. entity.polygon.fill = false;
  10839. entity.polygon.outline = false;
  10840. entity.polygon.outlineWidth = options2.outlineWidth;
  10841. entity.polygon.outlineColor = options2.outlineColor;
  10842. entity.polyline = {
  10843. positions: entity.polygon.hierarchy._value.positions,
  10844. width: entity.polygon.outlineWidth,
  10845. material: new Cesium.Color.fromCssColorString(color).withAlpha(0.1)
  10846. };
  10847. if (options2.clampToGround) {
  10848. entity.polyline.clampToGround = true;
  10849. }
  10850. }
  10851. resolve2(entities2);
  10852. });
  10853. });
  10854. },
  10855. generatePolygonByPoints(points2, options2) {
  10856. return new Promise((resolve2, reject2) => {
  10857. let _self = this;
  10858. if (!Cesium.defined(points2)) {
  10859. throw new Cesium.DeveloperError("points is required.");
  10860. }
  10861. if (points2.length < 3) {
  10862. reject2("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  10863. }
  10864. let positions = points2.map((point2) => {
  10865. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10866. });
  10867. options2 = options2 || {};
  10868. options2.id = options2.id || setSessionid$1();
  10869. options2.fill = options2.fill || true;
  10870. if (options2.color) {
  10871. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  10872. } else {
  10873. options2.color = new Cesium.Color.fromCssColorString("#ff0000");
  10874. }
  10875. options2.outline = options2.outline || false;
  10876. if (options2.outlineColor) {
  10877. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  10878. } else {
  10879. options2.outlineColor = new Cesium.Color.fromCssColorString("#000");
  10880. }
  10881. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10882. let entity = new Cesium.Entity({
  10883. id: options2.id,
  10884. name: "Generate surfaces based on coordinate points",
  10885. polygon: {
  10886. hierarchy: positions,
  10887. material: options2.color,
  10888. fill: options2.fill,
  10889. outline: options2.outline,
  10890. outlineWidth: options2.outlineWidth,
  10891. outlineColor: options2.outlineColor
  10892. }
  10893. });
  10894. if (options2.outline) {
  10895. entity.polyline = {
  10896. positions: entity.polygon.hierarchy._value.positions,
  10897. width: options2.outlineWidth,
  10898. material: options2.outlineColor,
  10899. clampToGround: true
  10900. };
  10901. }
  10902. _self._viewer.entities.add(entity);
  10903. resolve2(entity);
  10904. });
  10905. }
  10906. });
  10907. class CircleMaterialProperty$1 {
  10908. constructor(options2) {
  10909. this._viewer = options2.viewer;
  10910. this._definitionChanged = new Cesium.Event();
  10911. this._color = void 0;
  10912. this.color = options2.color || Cesium.Color.BLUE;
  10913. this.count = options2.count || 1;
  10914. this.duration = options2.duration || 1e3;
  10915. this._time = new Date().getTime();
  10916. this._materialTypeName = "jtCircleMaterial";
  10917. this._param = {
  10918. color: this.color._value.toCssColorString(),
  10919. duration: this.duration,
  10920. count: this.count
  10921. };
  10922. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  10923. fabric: {
  10924. type: this._materialTypeName,
  10925. uniforms: {
  10926. time: 0,
  10927. color: new Cesium.Color(1, 0, 0, 0.5),
  10928. count: 1
  10929. },
  10930. source: this._getCircleMaterial()
  10931. },
  10932. translucent: function(material) {
  10933. return true;
  10934. }
  10935. });
  10936. }
  10937. _getCircleMaterial() {
  10938. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  10939. return circleMaterial;
  10940. }
  10941. }
  10942. Object.assign(CircleMaterialProperty$1.prototype, {
  10943. getType: function(time) {
  10944. return this._materialTypeName;
  10945. },
  10946. getValue: function(time, result) {
  10947. if (!Cesium.defined(result)) {
  10948. result = {};
  10949. }
  10950. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  10951. result.count = this.count;
  10952. if (this.duration) {
  10953. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  10954. }
  10955. this._viewer.scene.requestRender();
  10956. return result;
  10957. },
  10958. equals: function(other) {
  10959. return this === other || other instanceof CircleMaterialProperty$1 && Cesium.Property.equals(this._color, other._color);
  10960. }
  10961. });
  10962. Object.defineProperties(CircleMaterialProperty$1.prototype, {
  10963. isConstant: {
  10964. get: function() {
  10965. return false;
  10966. }
  10967. },
  10968. definitionChanged: {
  10969. get: function() {
  10970. return this._definitionChanged;
  10971. }
  10972. },
  10973. color: Cesium.createPropertyDescriptor("color")
  10974. });
  10975. class CircleRippleMaterialProperty {
  10976. constructor(options2) {
  10977. this._definitionChanged = new Cesium.Event();
  10978. this._color = void 0;
  10979. this._speed = void 0;
  10980. this.color = options2.color;
  10981. this.speed = options2.speed;
  10982. this.count = options2.count;
  10983. this.gradient = options2.gradient;
  10984. }
  10985. get isConstant() {
  10986. return false;
  10987. }
  10988. get definitionChanged() {
  10989. return this._definitionChanged;
  10990. }
  10991. getType(time) {
  10992. return Cesium.Material.CircleRippleMaterialType;
  10993. }
  10994. getValue(time, result) {
  10995. if (!Cesium.defined(result)) {
  10996. result = {};
  10997. }
  10998. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  10999. result.speed = Cesium.Property.getValueOrDefault(this._speed, time, 10, result.speed);
  11000. result.count = this.count;
  11001. result.gradient = this.gradient;
  11002. return result;
  11003. }
  11004. equals(other) {
  11005. return this === other || other instanceof CircleRippleMaterialProperty && Cesium.Property.equals(this._color, other._color) && Cesium.Property.equals(this._speed, other._speed) && Cesium.Property.equals(this.count, other.count) && Cesium.Property.equals(this.gradient, other.gradient);
  11006. }
  11007. }
  11008. Object.defineProperties(CircleRippleMaterialProperty.prototype, {
  11009. color: Cesium.createPropertyDescriptor("color"),
  11010. speed: Cesium.createPropertyDescriptor("speed"),
  11011. count: Cesium.createPropertyDescriptor("count"),
  11012. gradient: Cesium.createPropertyDescriptor("gradient")
  11013. });
  11014. Cesium.CircleRippleMaterialProperty = CircleRippleMaterialProperty;
  11015. Cesium.Material.CircleRippleMaterialProperty = "CircleRippleMaterialProperty";
  11016. Cesium.Material.CircleRippleMaterialType = "CircleRippleMaterialType";
  11017. Cesium.Material.CircleRippleMaterialSource = `
  11018. uniform vec4 color;
  11019. uniform float speed;
  11020. uniform float count;
  11021. uniform float gradient;
  11022. czm_material czm_getMaterial(czm_materialInput materialInput)
  11023. {
  11024. czm_material material = czm_getDefaultMaterial(materialInput);
  11025. material.diffuse = 1.5 * color.rgb;
  11026. vec2 st = materialInput.st;
  11027. float dis = distance(st, vec2(0.5, 0.5));
  11028. float per = fract(czm_frameNumber * speed / 1000.0);
  11029. if(count == 1.0){
  11030. if(dis > per * 0.5){
  11031. discard;
  11032. }else {
  11033. material.alpha = color.a * dis / per / 2.0;
  11034. }
  11035. } else {
  11036. vec3 str = materialInput.str;
  11037. if(abs(str.z) > 0.001){
  11038. discard;
  11039. }
  11040. if(dis > 0.5){
  11041. discard;
  11042. } else {
  11043. float perDis = 0.5 / count;
  11044. float disNum;
  11045. float bl = 0.0;
  11046. for(int i = 0; i <= 999; i++){
  11047. if(float(i) <= count){
  11048. disNum = perDis * float(i) - dis + per / count;
  11049. if(disNum > 0.0){
  11050. if(disNum < perDis){
  11051. bl = 1.0 - disNum / perDis;
  11052. }
  11053. else if(disNum - perDis < perDis){
  11054. bl = 1.0 - abs(1.0 - disNum / perDis);
  11055. }
  11056. material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));
  11057. }
  11058. }
  11059. }
  11060. }
  11061. }
  11062. return material;
  11063. }
  11064. `;
  11065. Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleRippleMaterialType, {
  11066. fabric: {
  11067. type: Cesium.Material.CircleRippleMaterialType,
  11068. uniforms: {
  11069. color: new Cesium.Color(1, 0, 0, 1),
  11070. speed: 3,
  11071. count: 4,
  11072. gradient: 0.2
  11073. },
  11074. source: Cesium.Material.CircleRippleMaterialSource
  11075. },
  11076. translucent: function(material) {
  11077. return true;
  11078. }
  11079. });
  11080. class CircleObject {
  11081. constructor(viewer2) {
  11082. if (!viewer2)
  11083. throw new Cesium.DeveloperError("no viewer object!");
  11084. this._viewer = viewer2;
  11085. }
  11086. }
  11087. Object.assign(CircleObject.prototype, {
  11088. drawCircle: function(centerPoint, radius, options2) {
  11089. return new Promise((resolve2, reject2) => {
  11090. let viewer2 = this._viewer;
  11091. if (!Cesium.defined(centerPoint)) {
  11092. throw new Cesium.DeveloperError("centerPoint is required.");
  11093. }
  11094. if (!Cesium.defined(radius)) {
  11095. throw new Cesium.DeveloperError("radius is required.");
  11096. }
  11097. let position2;
  11098. if (centerPoint instanceof Cesium.Cartesian3) {
  11099. position2 = centerPoint;
  11100. } else {
  11101. position2 = Cesium.Cartesian3.fromDegrees(centerPoint[0], centerPoint[1], centerPoint[2] || 0);
  11102. }
  11103. if (typeof radius === "number" && radius > 0) {
  11104. radius = radius;
  11105. } else {
  11106. radius = 100;
  11107. }
  11108. options2 = options2 || {};
  11109. options2.id = options2.id || setSessionid$1();
  11110. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  11111. options2.CircleType = Cesium.defaultValue(options2.CircleType, "ColorCircle");
  11112. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  11113. options2.count = Cesium.defaultValue(options2.count, 1);
  11114. if (options2.color) {
  11115. if (options2.color instanceof Array) {
  11116. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  11117. } else if (typeof options2.color === "string") {
  11118. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  11119. } else {
  11120. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  11121. }
  11122. }
  11123. if (options2.outlineColor) {
  11124. if (options2.outlineColor instanceof Array) {
  11125. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  11126. } else if (typeof options2.outlineColor === "string") {
  11127. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  11128. } else {
  11129. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  11130. }
  11131. }
  11132. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 0);
  11133. let polygonMaterial = options2.color;
  11134. options2.outlineColor;
  11135. if (options2.CircleType === "DynamicCircle") {
  11136. polygonMaterial = new Cesium.CircleRippleMaterialProperty({
  11137. color: options2.color,
  11138. speed: options2.duration / 1e3,
  11139. count: options2.count,
  11140. gradient: 0.2
  11141. });
  11142. }
  11143. let entity = new Cesium.Entity({
  11144. id: options2.id,
  11145. position: position2,
  11146. ellipse: {
  11147. semiMinorAxis: radius,
  11148. semiMajorAxis: radius,
  11149. material: polygonMaterial,
  11150. outline: true,
  11151. outlineColor: options2.outlineColor,
  11152. outlineWidth: options2.outlineWidth
  11153. }
  11154. });
  11155. let flyEntity = viewer2.entities.add(entity);
  11156. resolve2(entity, flyEntity);
  11157. });
  11158. }
  11159. });
  11160. Cesium.Primitive.prototype.setUseGeometry = function(geometry2) {
  11161. this._useGeometry = geometry2;
  11162. };
  11163. Cesium.Primitive.prototype.getUseGeometry = function() {
  11164. return this._useGeometry;
  11165. };
  11166. class SketchViewModel {
  11167. constructor(viewer2, options2) {
  11168. this._viewer = viewer2;
  11169. this._init(options2);
  11170. }
  11171. _init(options2) {
  11172. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  11173. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  11174. this._entities = this._viewer.entities;
  11175. this._pointEntitys = [];
  11176. this._sketchPointImage = void 0;
  11177. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  11178. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  11179. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  11180. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  11181. this._sketchEntityName = "sketchEntity";
  11182. this._sketchTempPoints = [];
  11183. this._sketchPoints = [];
  11184. this._sketchOutputPoints = [];
  11185. this._sketchTempPolyline = void 0;
  11186. this._sketchPolyline = void 0;
  11187. this._sketchTempPolygon = void 0;
  11188. this._sketchPolygon = void 0;
  11189. this._sketchTempAltituePolyline = void 0;
  11190. this._sketchAltitudePolyline = void 0;
  11191. this._sketchAltitudeInitHeight = 0;
  11192. this._sketchTempSpatialPolyline = void 0;
  11193. this._sketchSpatialPolyline = void 0;
  11194. this._sketchTempCircle = void 0;
  11195. this._sketchCircle = void 0;
  11196. this._sketchTempRectangle = void 0;
  11197. this._sketchRectangle = void 0;
  11198. this._sketchTempTriangleAltitudePolyline = void 0;
  11199. this._sketchTriangleAltituePolyline = void 0;
  11200. this._sketchTempSpatialTriangle = void 0;
  11201. this._sketchSpatialTriangle = void 0;
  11202. this._lineLabel = void 0;
  11203. this._polygonLabel = void 0;
  11204. options2 = options2 || {};
  11205. if (options2.isDrawPoint) {
  11206. this._isDrawPoint = options2.isDrawPoint;
  11207. } else {
  11208. this._isDrawPoint = false;
  11209. }
  11210. if (options2.isRetainDrawPoint) {
  11211. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  11212. } else {
  11213. this._isRetainDrawPoint = false;
  11214. }
  11215. this._param = {
  11216. moveLineWidth: 2,
  11217. lineWidth: 2,
  11218. moveAltitudeLineWidth: 2,
  11219. altitudeLineWidth: 2,
  11220. spatialLineWidth: 2,
  11221. moveEllipseColor: [0, 255, 0, 0.5],
  11222. moveEllipseOutline: true,
  11223. moveEllipseOutlineColor: [255, 0, 0, 0.5],
  11224. moveEllipseOutlineWidth: 1,
  11225. spatialLineWidth: 2,
  11226. ellipseColor: [0, 0, 255, 0.5],
  11227. ellipseOutline: true,
  11228. ellipseOutlineColor: [255, 0, 0, 0.5],
  11229. ellipseOutlineWidth: 1
  11230. };
  11231. this._setMoveLineStyle(void 0);
  11232. this._setLineStyle(void 0);
  11233. this._setMovePolygonStyle(void 0);
  11234. this._setPolygonStyle(void 0);
  11235. this._setMoveAltitudeLineStyle(void 0);
  11236. this._setAltitudeLineStyle(void 0);
  11237. this._setMoveEllipseStyle(void 0);
  11238. this._setEllipseStyle(void 0);
  11239. this._setSpatialLineStyle(void 0);
  11240. if (options2 && options2.iconType) {
  11241. switch (options2.iconType) {
  11242. case SketchViewModel.SketchIconType.Normal:
  11243. this._sketchPointImage = this._iconNormal;
  11244. break;
  11245. case SketchViewModel.SketchIconType.Blue:
  11246. this._sketchPointImage = this._iconBlue;
  11247. break;
  11248. case SketchViewModel.SketchIconType.Green:
  11249. this._sketchPointImage = this._iconGreen;
  11250. break;
  11251. case SketchViewModel.SketchIconType.Violet:
  11252. this._sketchPointImage = this._iconViolet;
  11253. break;
  11254. default:
  11255. this._sketchPointImage = this._iconNormal;
  11256. break;
  11257. }
  11258. } else {
  11259. this._sketchPointImage = this._iconNormal;
  11260. }
  11261. }
  11262. _arcToDegree(arc) {
  11263. return arc / Math.PI * 180;
  11264. }
  11265. _toColor(red, green, blue, alpha) {
  11266. let normalColor = new Cesium.Color(0, 0, 0, 1);
  11267. if (typeof red != "number")
  11268. return normalColor;
  11269. if (typeof green != "number")
  11270. return normalColor;
  11271. if (typeof blue != "number")
  11272. return normalColor;
  11273. if (typeof alpha != "number")
  11274. return normalColor;
  11275. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  11276. return normalColor;
  11277. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  11278. }
  11279. _toColorFromArray(array) {
  11280. if (!array || array.length === void 0 || array.length === 0)
  11281. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  11282. let r2 = 255, g = 255, b = 255, a = 1;
  11283. if (array.length === 1) {
  11284. r2 = parseInt(array[0]);
  11285. } else if (array.length === 2) {
  11286. r2 = parseInt(array[0]);
  11287. g = parseInt(array[1]);
  11288. } else if (array.length === 3) {
  11289. r2 = parseInt(array[0]);
  11290. g = parseInt(array[1]);
  11291. b = parseInt(array[2]);
  11292. } else if (array.length >= 4) {
  11293. r2 = parseInt(array[0]);
  11294. g = parseInt(array[1]);
  11295. b = parseInt(array[2]);
  11296. a = parseFloat(array[3]);
  11297. }
  11298. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  11299. }
  11300. _updateScene() {
  11301. this._viewer.scene.requestRender();
  11302. }
  11303. _getScreenClickPosition(screenPosition) {
  11304. let resCartesian = void 0;
  11305. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  11306. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11307. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11308. if (Cesium.defined(position2)) {
  11309. resCartesian = {
  11310. x: position2.x,
  11311. y: position2.y,
  11312. z: position2.z
  11313. };
  11314. }
  11315. return resCartesian;
  11316. }
  11317. _getScreenClickPositionAndHeight(screenPoint) {
  11318. var lng = void 0, lat = void 0, height2 = void 0;
  11319. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  11320. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11321. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11322. var feature2 = this._viewer.scene.pick(screenPoint);
  11323. if (feature2 == void 0) {
  11324. lng = this._arcToDegree(cartographic.longitude);
  11325. lat = this._arcToDegree(cartographic.latitude);
  11326. height2 = cartographic.height;
  11327. } else {
  11328. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  11329. if (Cesium.defined(cartesian)) {
  11330. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  11331. lng = this._arcToDegree(cartographic.longitude);
  11332. lat = this._arcToDegree(cartographic.latitude);
  11333. height2 = cartographic.height;
  11334. }
  11335. }
  11336. return {
  11337. lng,
  11338. lat,
  11339. height: height2
  11340. };
  11341. }
  11342. _transfromFromScreenPoint(screenPosition) {
  11343. let location = this._getScreenClickPositionAndHeight(screenPosition);
  11344. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  11345. return {
  11346. gLocation: location,
  11347. sLocation: cartesian
  11348. };
  11349. }
  11350. _removeEntityByName(entityName) {
  11351. var entities2 = this._entities;
  11352. if (!entities2 || !entities2.values)
  11353. return;
  11354. var delEntitys = [];
  11355. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  11356. if (entities2.values[i2].name == entityName) {
  11357. delEntitys.push(entities2.values[i2]);
  11358. }
  11359. }
  11360. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  11361. entities2.remove(delEntitys[i2]);
  11362. }
  11363. this._updateScene();
  11364. }
  11365. _removeEntityByObject(objEntity) {
  11366. if (!Cesium.defined(objEntity))
  11367. return;
  11368. this._entities.remove(objEntity);
  11369. }
  11370. _createPoint(coord, label) {
  11371. let _self = this;
  11372. let entity = new Cesium.Entity({
  11373. name: _self._sketchEntityName + "_Point",
  11374. position: coord,
  11375. billboard: {
  11376. image: _self._sketchPointImage,
  11377. horizontalOrigin: Cesium.HorizontalOrigin.center,
  11378. verticalOrigin: Cesium.VerticalOrigin.bottom,
  11379. scale: 0.5,
  11380. pixelOffset: new Cesium.Cartesian2(0, -11),
  11381. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11382. }
  11383. });
  11384. if (label) {
  11385. entity.label = {
  11386. text: label,
  11387. font: "12px sans-serif",
  11388. fillColor: this._toColor(255, 255, 255, 1),
  11389. outlineColor: this._toColor(0, 154, 94, 1),
  11390. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  11391. outlineWidth: 1,
  11392. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  11393. pixelOffset: new Cesium.Cartesian2(0, -28),
  11394. showBackground: true,
  11395. backgroundColor: this._toColor(0, 0, 0, 0.6),
  11396. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11397. };
  11398. }
  11399. this._entities.add(entity);
  11400. this._pointEntitys.push(entity);
  11401. this._updateScene();
  11402. }
  11403. _removePointEntitys() {
  11404. this._removeEntityByName(this._sketchEntityName + "_Point");
  11405. this._pointEntitys = [];
  11406. }
  11407. _createTempPolyline() {
  11408. let _self = this;
  11409. if (!Cesium.defined(this._sketchTempPolyline)) {
  11410. this._sketchTempPolyline = new Cesium.Entity({
  11411. name: _self._sketchEntityName,
  11412. polyline: {
  11413. show: true,
  11414. positions: new Cesium.CallbackProperty(function() {
  11415. return _self._sketchTempPoints;
  11416. }, false),
  11417. material: _self._tempLineMaterial,
  11418. width: _self._param.moveLineWidth,
  11419. clampToGround: true
  11420. }
  11421. });
  11422. this._entities.add(this._sketchTempPolyline);
  11423. this._updateScene();
  11424. }
  11425. }
  11426. _createPolyline() {
  11427. let _self = this;
  11428. if (!Cesium.defined(this._sketchPolyline)) {
  11429. this._sketchPolyline = new Cesium.Entity({
  11430. name: _self._sketchEntityName,
  11431. polyline: {
  11432. show: true,
  11433. positions: _self._sketchPoints,
  11434. material: _self._lineMaterial,
  11435. width: _self._param.lineWidth,
  11436. clampToGround: true
  11437. }
  11438. });
  11439. this._entities.add(this._sketchPolyline);
  11440. this._updateScene();
  11441. }
  11442. }
  11443. _createTempSpatialPolyline() {
  11444. let _self = this;
  11445. if (!Cesium.defined(this._sketchTempSpatialPolyline)) {
  11446. this._sketchTempSpatialPolyline = new Cesium.Entity({
  11447. name: _self._sketchEntityName,
  11448. polyline: {
  11449. show: true,
  11450. positions: new Cesium.CallbackProperty(function() {
  11451. return _self._sketchTempPoints;
  11452. }, false),
  11453. material: _self._tempLineMaterial,
  11454. width: _self._param.moveLineWidth,
  11455. clampToGround: false
  11456. }
  11457. });
  11458. this._entities.add(this._sketchTempSpatialPolyline);
  11459. this._updateScene();
  11460. }
  11461. }
  11462. _createSpatialPolyline() {
  11463. let _self = this;
  11464. if (!Cesium.defined(this._sketchSpatialPolyline)) {
  11465. this._sketchSpatialPolyline = new Cesium.Entity({
  11466. name: _self._sketchEntityName,
  11467. polyline: {
  11468. show: true,
  11469. positions: _self._sketchPoints,
  11470. material: _self._spatialLineMaterial,
  11471. width: _self._param.spatialLineWidth,
  11472. clampToGround: false
  11473. }
  11474. });
  11475. this._entities.add(this._sketchSpatialPolyline);
  11476. this._updateScene();
  11477. }
  11478. }
  11479. _createTempPolygon() {
  11480. let _self = this;
  11481. if (!Cesium.defined(this._sketchTempPolygon)) {
  11482. this._sketchTempPolygon = new Cesium.Entity({
  11483. name: _self._sketchEntityName,
  11484. polygon: {
  11485. show: true,
  11486. hierarchy: new Cesium.CallbackProperty(function() {
  11487. return {
  11488. positions: _self._sketchTempPoints
  11489. };
  11490. }, false),
  11491. material: _self._tempPolygonMaterial,
  11492. classificationType: Cesium.ClassificationType.BOTH
  11493. }
  11494. });
  11495. this._entities.add(this._sketchTempPolygon);
  11496. this._updateScene();
  11497. }
  11498. }
  11499. _createPolygon() {
  11500. let _self = this;
  11501. if (!Cesium.defined(this._sketchPolygon)) {
  11502. this._sketchPoints.push(this._sketchPoints[0]);
  11503. this._sketchPolygon = new Cesium.Entity({
  11504. name: _self._sketchEntityName,
  11505. polygon: {
  11506. show: true,
  11507. hierarchy: {
  11508. positions: _self._sketchPoints
  11509. },
  11510. material: _self._polygonMaterial,
  11511. classificationType: Cesium.ClassificationType.BOTH
  11512. },
  11513. polyline: {
  11514. show: true,
  11515. positions: _self._sketchPoints,
  11516. material: _self._lineMaterial,
  11517. width: _self._param.lineWidth,
  11518. clampToGround: true
  11519. }
  11520. });
  11521. this._entities.add(this._sketchPolygon);
  11522. this._updateScene();
  11523. }
  11524. }
  11525. _createPolygonBody(options2) {
  11526. let _self = this;
  11527. let appendHeight = parseFloat(100);
  11528. if (options2 && options2.height && typeof options2.height === "number")
  11529. appendHeight = parseFloat(options2.height);
  11530. let wallColor = [255, 255, 0, 1];
  11531. let polygonColor = [0, 0, 255, 0.65];
  11532. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  11533. polygonColor = this._checkColorAndAlpha(options2.color);
  11534. if (!Cesium.defined(this._sketchPolygon)) {
  11535. let shaderSource = "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n material.diffuse = color.rgb;\n material.alpha = color.a;\n return material;\n}";
  11536. let wallMaterial = new Cesium.Material({
  11537. fabric: {
  11538. type: "wallMaterial",
  11539. uniforms: {
  11540. color: _self._toColorFromArray(wallColor),
  11541. speed: 100
  11542. },
  11543. source: shaderSource
  11544. }
  11545. });
  11546. new Cesium.MaterialAppearance({
  11547. material: wallMaterial
  11548. });
  11549. let polygonAppearance = new Cesium.MaterialAppearance({
  11550. material: new Cesium.Material({
  11551. fabric: {
  11552. type: "Color",
  11553. uniforms: {
  11554. color: _self._toColorFromArray(polygonColor)
  11555. }
  11556. }
  11557. })
  11558. });
  11559. let wallMinimumHeights = [];
  11560. let wallMaximumHeights = [];
  11561. for (let i2 = 0; i2 < _self._sketchOutputPoints.length; i2++) {
  11562. let height3 = parseFloat(_self._sketchOutputPoints[i2].height);
  11563. wallMinimumHeights.push(height3);
  11564. wallMaximumHeights.push(height3 + appendHeight);
  11565. }
  11566. let height2 = parseFloat(_self._sketchOutputPoints[0].height);
  11567. wallMinimumHeights.push(height2);
  11568. wallMaximumHeights.push(height2 + appendHeight);
  11569. let tempPoints = [];
  11570. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  11571. tempPoints.push(_self._sketchPoints[i2]);
  11572. }
  11573. tempPoints.push(_self._sketchPoints[0]);
  11574. new Cesium.WallGeometry({
  11575. positions: tempPoints,
  11576. maximumHeights: wallMaximumHeights,
  11577. minimumHeights: wallMinimumHeights
  11578. });
  11579. let polygonGeometry = new Cesium.PolygonGeometry({
  11580. polygonHierarchy: new Cesium.PolygonHierarchy(tempPoints),
  11581. perPositionHeight: true,
  11582. extrudedHeight: Math.max.apply(null, wallMaximumHeights)
  11583. });
  11584. let polygonPrimitive = new Cesium.Primitive({
  11585. geometryInstances: new Cesium.GeometryInstance({
  11586. geometry: polygonGeometry
  11587. }),
  11588. appearance: polygonAppearance,
  11589. releaseGeometryInstances: false
  11590. });
  11591. polygonPrimitive.setUseGeometry({
  11592. cPoints: _self._sketchPoints,
  11593. gPoints: _self._sketchOutputPoints,
  11594. height: appendHeight,
  11595. color: polygonColor
  11596. });
  11597. this._viewer.scene.primitives.add(polygonPrimitive);
  11598. }
  11599. }
  11600. _callUpdaeEllipseCenterPosition() {
  11601. let _self = this;
  11602. return function() {
  11603. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11604. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11605. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11606. return _self._sketchEllipseCenterPosition;
  11607. };
  11608. }
  11609. _callUpdateAltitudePolylinePositions() {
  11610. let _self = this;
  11611. return function() {
  11612. _self._sketchAltitudePolylinePostions = [];
  11613. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  11614. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11615. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11616. let point_temp = Cesium.Cartesian3.fromDegrees(
  11617. Cesium.Math.toDegrees(
  11618. point1cartographic.longitude
  11619. ),
  11620. Cesium.Math.toDegrees(point1cartographic.latitude),
  11621. point2cartographic.height
  11622. );
  11623. _self._sketchAltitudePolylinePostions.push(point_temp);
  11624. return _self._sketchAltitudePolylinePostions;
  11625. };
  11626. }
  11627. _callUpdateEllipseMinorAxis() {
  11628. let _self = this;
  11629. return function() {
  11630. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11631. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11632. let geodesic = new Cesium.EllipsoidGeodesic();
  11633. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11634. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11635. if (_self._sketchEllipseRadius <= 0)
  11636. _self._sketchEllipseRadius = 1;
  11637. return _self._sketchEllipseRadius;
  11638. };
  11639. }
  11640. _callUpdateEllipseHeight() {
  11641. let _self = this;
  11642. return function() {
  11643. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11644. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11645. let height_temp = cartographic1.height - cartographic.height;
  11646. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  11647. return _self._sketchEllipseHeight;
  11648. };
  11649. }
  11650. _createTempAltitudePolyline() {
  11651. let _self = this;
  11652. if (!Cesium.defined(this._sketchTempAltituePolyline)) {
  11653. this._sketchTempAltituePolyline = new Cesium.Entity({
  11654. name: _self._sketchEntityName,
  11655. position: new Cesium.CallbackProperty(
  11656. _self._callUpdaeEllipseCenterPosition(),
  11657. false
  11658. ),
  11659. polyline: {
  11660. show: true,
  11661. positions: new Cesium.CallbackProperty(
  11662. _self._callUpdateAltitudePolylinePositions(),
  11663. false
  11664. ),
  11665. material: _self._tempAlititudeLineMaterial,
  11666. width: _self._param.moveAltitudeLineWidth,
  11667. clampToGround: false
  11668. },
  11669. ellipse: {
  11670. show: true,
  11671. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11672. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11673. height: new Cesium.CallbackProperty(_self._callUpdateEllipseHeight(), false),
  11674. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  11675. outline: _self._param.moveEllipseOutline,
  11676. outlineWidth: _self._param.moveEllipseOutlineWidth,
  11677. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  11678. }
  11679. });
  11680. _self._entities.add(_self._sketchTempAltituePolyline);
  11681. }
  11682. }
  11683. _createAltitudePolyline() {
  11684. let _self = this;
  11685. if (!Cesium.defined(this._sketchAltitudePolyline)) {
  11686. this._sketchAltitudePolyline = new Cesium.Entity({
  11687. name: _self._sketchEntityName,
  11688. position: _self._sketchEllipseCenterPosition,
  11689. polyline: {
  11690. show: true,
  11691. positions: _self._sketchAltitudePolylinePostions,
  11692. material: _self._altitudeLineMaterial,
  11693. width: _self._param.altitudeLineWidth,
  11694. clampToGround: false
  11695. },
  11696. ellipse: {
  11697. show: true,
  11698. semiMinorAxis: _self._sketchEllipseRadius,
  11699. semiMajorAxis: _self._sketchEllipseRadius,
  11700. height: _self._sketchEllipseHeight,
  11701. material: _self._toColorFromArray(_self._param.ellipseColor),
  11702. outline: _self._param.ellipseOutline,
  11703. outlineWidth: _self._param.ellipseOutlineWidth,
  11704. outlineColor: _self._toColorFromArray(_self._param.ellipseOutlineColor)
  11705. }
  11706. });
  11707. _self._entities.add(_self._sketchAltitudePolyline);
  11708. }
  11709. }
  11710. _callEllipseOutlineCoordinate() {
  11711. let _self = this;
  11712. return function() {
  11713. let positionCenter = _self._sketchEllipseCenterPosition;
  11714. let positionRotate = _self._sketchTempPoints[1];
  11715. _self._ellipseOutlineCoordinates = [];
  11716. for (let angle = 5; angle < 360; ) {
  11717. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  11718. _self._ellipseOutlineCoordinates.push(newPosition);
  11719. angle = angle + 5;
  11720. }
  11721. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  11722. return _self._ellipseOutlineCoordinates;
  11723. };
  11724. }
  11725. _createTempCircle(centerPosition) {
  11726. let _self = this;
  11727. if (!Cesium.defined(this._sketchTempCircle)) {
  11728. _self._sketchEllipseCenterPosition = centerPosition.clone();
  11729. this._sketchTempCircle = new Cesium.Entity({
  11730. name: _self._sketchEntityName,
  11731. position: centerPosition,
  11732. polyline: {
  11733. show: true,
  11734. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(), false),
  11735. material: _self._tempLineMaterial,
  11736. width: _self._param.moveLineWidth,
  11737. clampToGround: true
  11738. },
  11739. ellipse: {
  11740. show: true,
  11741. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11742. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11743. material: _self._tempPolygonMaterial,
  11744. classificationType: Cesium.ClassificationType.BOTH
  11745. }
  11746. });
  11747. _self._entities.add(_self._sketchTempCircle);
  11748. }
  11749. }
  11750. _rotatedPointByAngle(position_A, position_B, angle) {
  11751. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  11752. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  11753. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  11754. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  11755. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  11756. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  11757. var new_z = localPosition_A.z;
  11758. return Cesium.Matrix4.multiplyByPoint(
  11759. localToWorld_Matrix,
  11760. new Cesium.Cartesian3(new_x, new_y, new_z),
  11761. new Cesium.Cartesian3()
  11762. );
  11763. }
  11764. _createCircle() {
  11765. let _self = this;
  11766. if (!Cesium.defined(this._sketchCircle)) {
  11767. this._sketchCircle = new Cesium.Entity({
  11768. name: _self._sketchEntityName,
  11769. position: _self._sketchEllipseCenterPosition,
  11770. polyline: {
  11771. show: true,
  11772. positions: _self._ellipseOutlineCoordinates,
  11773. material: _self._lineMaterial,
  11774. width: _self._param.lineWidth,
  11775. clampToGround: true
  11776. },
  11777. ellipse: {
  11778. show: true,
  11779. semiMinorAxis: _self._sketchEllipseRadius,
  11780. semiMajorAxis: _self._sketchEllipseRadius,
  11781. material: _self._polygonMaterial,
  11782. classificationType: Cesium.ClassificationType.BOTH
  11783. }
  11784. });
  11785. _self._entities.add(_self._sketchCircle);
  11786. }
  11787. }
  11788. _callUpdateRectangleCoordinates() {
  11789. let _self = this;
  11790. return function() {
  11791. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  11792. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  11793. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  11794. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  11795. _self._rectangleCoordinates = [0, 0, 1, 1];
  11796. if (lng0 < lng1) {
  11797. _self._rectangleCoordinates[0] = lng0;
  11798. _self._rectangleCoordinates[2] = lng1;
  11799. } else {
  11800. _self._rectangleCoordinates[0] = lng1;
  11801. _self._rectangleCoordinates[2] = lng0;
  11802. }
  11803. if (lat0 < lat1) {
  11804. _self._rectangleCoordinates[1] = lat0;
  11805. _self._rectangleCoordinates[3] = lat1;
  11806. } else {
  11807. _self._rectangleCoordinates[1] = lat1;
  11808. _self._rectangleCoordinates[3] = lat0;
  11809. }
  11810. let rectangle = Cesium.Rectangle.fromDegrees(
  11811. _self._rectangleCoordinates[0],
  11812. _self._rectangleCoordinates[1],
  11813. _self._rectangleCoordinates[2],
  11814. _self._rectangleCoordinates[3]
  11815. );
  11816. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  11817. _self._rectangleOutlineCoordinates = res.cPoints;
  11818. _self._sketchOutputPoints = res.gPoints;
  11819. return rectangle;
  11820. };
  11821. }
  11822. _calculateRectangleOutlineCoordinates(rectangle) {
  11823. let south_east = Cesium.Rectangle.southeast(rectangle);
  11824. let se2 = Cesium.Cartographic.toCartesian(south_east);
  11825. let south_west = Cesium.Rectangle.southwest(rectangle);
  11826. let sw = Cesium.Cartographic.toCartesian(south_west);
  11827. let north_east = Cesium.Rectangle.northeast(rectangle);
  11828. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  11829. let north_west = Cesium.Rectangle.northwest(rectangle);
  11830. let nw = Cesium.Cartographic.toCartesian(north_west);
  11831. let gPoints = [];
  11832. gPoints.push({
  11833. lng: Cesium.Math.toDegrees(south_west.longitude),
  11834. lat: Cesium.Math.toDegrees(south_west.latitude),
  11835. height: south_west.height
  11836. });
  11837. gPoints.push({
  11838. lng: Cesium.Math.toDegrees(south_east.longitude),
  11839. lat: Cesium.Math.toDegrees(south_east.latitude),
  11840. height: south_east.height
  11841. });
  11842. gPoints.push({
  11843. lng: Cesium.Math.toDegrees(north_east.longitude),
  11844. lat: Cesium.Math.toDegrees(north_east.latitude),
  11845. height: north_east.height
  11846. });
  11847. gPoints.push({
  11848. lng: Cesium.Math.toDegrees(north_west.longitude),
  11849. lat: Cesium.Math.toDegrees(north_west.latitude),
  11850. height: north_west.height
  11851. });
  11852. gPoints.push({
  11853. lng: Cesium.Math.toDegrees(south_west.longitude),
  11854. lat: Cesium.Math.toDegrees(south_west.latitude),
  11855. height: south_west.height
  11856. });
  11857. return {
  11858. cPoints: [sw, se2, ne2, nw, sw],
  11859. gPoints
  11860. };
  11861. }
  11862. _callUpdateRectangleOutlineCoordinates() {
  11863. let _self = this;
  11864. return function() {
  11865. return _self._rectangleOutlineCoordinates;
  11866. };
  11867. }
  11868. _createTempRectangle() {
  11869. let _self = this;
  11870. if (!Cesium.defined(this._sketchTempRectangle)) {
  11871. this._sketchTempRectangle = new Cesium.Entity({
  11872. name: _self._sketchEntityName,
  11873. polyline: {
  11874. show: true,
  11875. positions: new Cesium.CallbackProperty(_self._callUpdateRectangleOutlineCoordinates(), false),
  11876. material: _self._tempLineMaterial,
  11877. width: _self._param.moveLineWidth,
  11878. clampToGround: true
  11879. },
  11880. rectangle: {
  11881. show: true,
  11882. coordinates: new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(), false),
  11883. material: _self._tempPolygonMaterial,
  11884. classificationType: Cesium.ClassificationType.BOTH
  11885. }
  11886. });
  11887. _self._entities.add(_self._sketchTempRectangle);
  11888. }
  11889. }
  11890. _createRectangle() {
  11891. let _self = this;
  11892. if (!Cesium.defined(this._sketchRectangle)) {
  11893. this._sketchRectangle = new Cesium.Entity({
  11894. name: _self._sketchEntityName,
  11895. polyline: {
  11896. show: true,
  11897. positions: _self._rectangleOutlineCoordinates,
  11898. material: _self._lineMaterial,
  11899. width: _self._param.lineWidth,
  11900. clampToGround: true
  11901. },
  11902. rectangle: {
  11903. show: true,
  11904. coordinates: Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]),
  11905. material: _self._polygonMaterial,
  11906. classificationType: Cesium.ClassificationType.BOTH
  11907. }
  11908. });
  11909. _self._entities.add(_self._sketchRectangle);
  11910. }
  11911. }
  11912. _callUpdaeTriangleEllipseCenterPosition() {
  11913. let _self = this;
  11914. return function() {
  11915. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11916. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11917. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11918. return _self._sketchEllipseCenterPosition;
  11919. };
  11920. }
  11921. _callUpdateTriangleAltitudePolylinePositions() {
  11922. let _self = this;
  11923. return function() {
  11924. _self._sketchAltitudePolylinePostions = [];
  11925. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[1]);
  11926. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11927. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11928. let point_temp = Cesium.Cartesian3.fromDegrees(
  11929. Cesium.Math.toDegrees(
  11930. point1cartographic.longitude
  11931. ),
  11932. Cesium.Math.toDegrees(point1cartographic.latitude),
  11933. point2cartographic.height
  11934. );
  11935. _self._sketchAltitudePolylinePostions.push(point_temp);
  11936. return _self._sketchAltitudePolylinePostions;
  11937. };
  11938. }
  11939. _callUpdateTriangleEllipseMinorAxis() {
  11940. let _self = this;
  11941. return function() {
  11942. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11943. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11944. let geodesic = new Cesium.EllipsoidGeodesic();
  11945. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11946. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11947. if (_self._sketchEllipseRadius <= 0)
  11948. _self._sketchEllipseRadius = 1;
  11949. return _self._sketchEllipseRadius;
  11950. };
  11951. }
  11952. _callUpdateTriangleEllipseHeight() {
  11953. let _self = this;
  11954. return function() {
  11955. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11956. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11957. let height_temp = cartographic1.height - cartographic.height;
  11958. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  11959. return _self._sketchEllipseHeight;
  11960. };
  11961. }
  11962. _callUpdateTriangleSpatialPolylinePositions() {
  11963. let _self = this;
  11964. return function() {
  11965. _self._sketchTriangleSpatialPolylinePositions = [];
  11966. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchTempPoints[0]);
  11967. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchEllipseCenterPosition);
  11968. return _self._sketchTriangleSpatialPolylinePositions;
  11969. };
  11970. }
  11971. _createTriangleSpatialPolyline() {
  11972. let _self = this;
  11973. this._sketchSpatialPolyline = new Cesium.Entity({
  11974. name: _self._sketchEntityName,
  11975. polyline: {
  11976. show: true,
  11977. positions: _self._sketchTriangleSpatialPolylinePositions,
  11978. material: _self._spatialLineMaterial,
  11979. width: _self._param.spatialLineWidth,
  11980. clampToGround: false
  11981. }
  11982. });
  11983. this._entities.add(this._sketchSpatialPolyline);
  11984. }
  11985. _createTempTriangleAltitudePolylineAndSpatialPolyline() {
  11986. let _self = this;
  11987. if (!Cesium.defined(this._sketchTempTriangleAltitudePolyline) && !Cesium.defined(this._sketchTempSpatialPolyline)) {
  11988. this._sketchTempTriangleAltitudePolyline = new Cesium.Entity({
  11989. name: _self._sketchEntityName,
  11990. position: new Cesium.CallbackProperty(
  11991. _self._callUpdaeTriangleEllipseCenterPosition(),
  11992. false
  11993. ),
  11994. polyline: {
  11995. show: true,
  11996. positions: new Cesium.CallbackProperty(
  11997. _self._callUpdateTriangleAltitudePolylinePositions(),
  11998. false
  11999. ),
  12000. material: _self._tempAlititudeLineMaterial,
  12001. width: _self._param.moveAltitudeLineWidth,
  12002. clampToGround: false
  12003. },
  12004. ellipse: {
  12005. show: true,
  12006. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  12007. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  12008. height: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseHeight(), false),
  12009. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  12010. outline: _self._param.moveEllipseOutline,
  12011. outlineWidth: _self._param.moveEllipseOutlineWidth,
  12012. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  12013. }
  12014. });
  12015. _self._entities.add(_self._sketchTempTriangleAltitudePolyline);
  12016. _self._sketchTempSpatialPolyline = new Cesium.Entity({
  12017. name: _self._sketchEntityName,
  12018. polyline: {
  12019. show: true,
  12020. positions: new Cesium.CallbackProperty(_self._callUpdateTriangleSpatialPolylinePositions(), false),
  12021. material: _self._tempLineMaterial,
  12022. width: _self._param.moveLineWidth,
  12023. clampToGround: false
  12024. }
  12025. });
  12026. _self._entities.add(_self._sketchTempSpatialPolyline);
  12027. }
  12028. }
  12029. _createTempSpatialTriangle() {
  12030. let _self = this;
  12031. if (!Cesium.defined(this._sketchTempSpatialTriangle)) {
  12032. this._sketchTempSpatialTriangle = new Cesium.Entity({
  12033. name: _self._sketchEntityName,
  12034. polyline: {
  12035. show: true,
  12036. positions: new Cesium.CallbackProperty(function() {
  12037. _self._sketchSpatialTrianglePositions = [];
  12038. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12039. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12040. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12041. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12042. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12043. _self._sketchSpatialTrianglePositions.push(point_temp);
  12044. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12045. return _self._sketchSpatialTrianglePositions;
  12046. }, false),
  12047. material: _self._tempLineMaterial,
  12048. width: _self._param.moveLineWidth,
  12049. clampToGround: false
  12050. }
  12051. });
  12052. this._entities.add(this._sketchTempSpatialTriangle);
  12053. this._updateScene();
  12054. }
  12055. }
  12056. _createSpatialTriangle() {
  12057. let _self = this;
  12058. if (!Cesium.defined(this._sketchSpatialTriangle)) {
  12059. this._sketchSpatialTriangle = new Cesium.Entity({
  12060. name: _self._sketchEntityName,
  12061. polyline: {
  12062. show: true,
  12063. positions: _self._sketchSpatialTrianglePositions,
  12064. material: _self._lineMaterial,
  12065. width: _self._param.lineWidth,
  12066. clampToGround: false
  12067. }
  12068. });
  12069. this._entities.add(this._sketchSpatialTriangle);
  12070. this._updateScene();
  12071. }
  12072. }
  12073. _setMoveLineStyle(options2) {
  12074. let _self = this;
  12075. let color2 = [255, 255, 255, 1];
  12076. let lineWidth = 3;
  12077. let isOutline = false;
  12078. let power = 0.2;
  12079. let outlineColor = [255, 0, 0, 1];
  12080. let outlineWidth = 1;
  12081. if (options2 && options2.color && options2.color.length === 4)
  12082. color2 = options2.color;
  12083. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12084. isOutline = options2.outline;
  12085. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12086. outlineColor = options2.outlineColor;
  12087. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12088. outlineWidth = options2.outlineWidth;
  12089. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12090. lineWidth = options2.lineWidth;
  12091. if (options2 && options2.power)
  12092. power = options2.power;
  12093. if (isOutline) {
  12094. this._tempLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12095. color: _self._toColorFromArray(color2),
  12096. outlineColor: _self._toColorFromArray(outlineColor),
  12097. outlineWidth
  12098. });
  12099. } else {
  12100. if (power === void 0) {
  12101. this._tempLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12102. color: _self._toColorFromArray(color2)
  12103. });
  12104. } else {
  12105. this._tempLineMaterial = new Cesium.PolylineGlowMaterialProperty({
  12106. color: _self._toColorFromArray(color2),
  12107. glowPower: power
  12108. });
  12109. }
  12110. }
  12111. this._param.moveLineWidth = lineWidth;
  12112. }
  12113. _setLineStyle(options2) {
  12114. let _self = this;
  12115. let color2 = [255, 255, 255, 1];
  12116. let lineWidth = 2;
  12117. let outlineColor = [0, 255, 0, 0.6];
  12118. let outlineWidth = 1;
  12119. if (options2 && options2.color && options2.color.length === 4)
  12120. color2 = options2.color;
  12121. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12122. outlineColor = options2.outlineColor;
  12123. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12124. outlineWidth = options2.outlineWidth;
  12125. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12126. lineWidth = options2.lineWidth;
  12127. this._lineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12128. color: _self._toColorFromArray(color2),
  12129. outlineColor: _self._toColorFromArray(outlineColor),
  12130. outlineWidth
  12131. });
  12132. this._param.lineWidth = lineWidth;
  12133. }
  12134. _setSpatialLineStyle(options2) {
  12135. let _self = this;
  12136. let color2 = [255, 255, 0, 1];
  12137. let lineWidth = 2;
  12138. let outlineColor = [255, 255, 255, 1];
  12139. let outlineWidth = 1;
  12140. if (options2 && options2.color && options2.color.length === 4)
  12141. color2 = options2.color;
  12142. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12143. outlineColor = options2.outlineColor;
  12144. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12145. outlineWidth = options2.outlineWidth;
  12146. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12147. lineWidth = options2.lineWidth;
  12148. this._spatialLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12149. color: _self._toColorFromArray(color2),
  12150. outlineColor: _self._toColorFromArray(outlineColor),
  12151. outlineWidth
  12152. });
  12153. this._param.spatialLineWidth = lineWidth;
  12154. }
  12155. _setMovePolygonStyle(options2) {
  12156. let polygonColor = [255, 0, 0, 0.3];
  12157. if (options2 && options2.color && options2.color.length === 4)
  12158. polygonColor = options2.color;
  12159. this._tempPolygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12160. }
  12161. _setPolygonStyle(options2) {
  12162. let polygonColor = [0, 0, 255, 0.3];
  12163. if (options2 && options2.color && options2.color.length === 4)
  12164. polygonColor = options2.color;
  12165. this._polygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12166. }
  12167. _setMoveAltitudeLineStyle(options2) {
  12168. let _self = this;
  12169. let color2 = [255, 255, 255, 1];
  12170. let lineWidth = 2;
  12171. let isOutline = true;
  12172. let outlineColor = [255, 255, 0, 1];
  12173. let outlineWidth = 1;
  12174. if (options2 && options2.color && options2.color.length === 4)
  12175. color2 = options2.color;
  12176. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12177. isOutline = options2.outline;
  12178. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12179. outlineColor = options2.outlineColor;
  12180. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12181. outlineWidth = options2.outlineWidth;
  12182. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12183. lineWidth = options2.lineWidth;
  12184. if (isOutline) {
  12185. this._tempAlititudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12186. color: _self._toColorFromArray(color2),
  12187. outlineColor: _self._toColorFromArray(outlineColor),
  12188. outlineWidth
  12189. });
  12190. } else {
  12191. this._tempAlititudeLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12192. color: _self._toColorFromArray(color2)
  12193. });
  12194. }
  12195. this._param.moveAltitudeLineWidth = lineWidth;
  12196. }
  12197. _setAltitudeLineStyle(options2) {
  12198. let _self = this;
  12199. let color2 = [255, 255, 255, 1];
  12200. let lineWidth = 2;
  12201. let outlineColor = [0, 0, 255, 1];
  12202. let outlineWidth = 1;
  12203. if (options2 && options2.color && options2.color.length === 4)
  12204. color2 = options2.color;
  12205. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12206. outlineColor = options2.outlineColor;
  12207. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12208. outlineWidth = options2.outlineWidth;
  12209. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12210. lineWidth = options2.lineWidth;
  12211. this._altitudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12212. color: _self._toColorFromArray(color2),
  12213. outlineColor: _self._toColorFromArray(outlineColor),
  12214. outlineWidth
  12215. });
  12216. this._param.altitudeLineWidth = lineWidth;
  12217. }
  12218. _setMoveEllipseStyle(options2) {
  12219. if (options2 && options2.color && options2.color.length === 4)
  12220. this._param.moveEllipseColor = options2.color;
  12221. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12222. this._param.moveEllipseOutlineWidth = options2.outlineWidth;
  12223. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12224. this._param.moveEllipseOutline = options2.outline;
  12225. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12226. this._param.moveEllipseOutlineColor = options2.outlineColor;
  12227. }
  12228. _setEllipseStyle(options2) {
  12229. if (options2 && options2.color && options2.color.length === 4)
  12230. this._param.ellipseColor = options2.color;
  12231. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12232. this._param.ellipseOutlineWidth = options2.outlineWidth;
  12233. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12234. this._param.ellipseOutline = options2.outline;
  12235. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12236. this._param.ellipseOutlineColor = options2.outlineColor;
  12237. }
  12238. _clear(isAll) {
  12239. if (isAll != void 0 && isAll === true) {
  12240. this._removeEntityByName(this._sketchEntityName);
  12241. this._removePointEntitys();
  12242. }
  12243. this._sketchTempPoints = [];
  12244. this._sketchPoints = [];
  12245. this._sketchOutputPoints = [];
  12246. this._sketchTempPolyline = void 0;
  12247. this._sketchPolyline = void 0;
  12248. this._sketchTempPolygon = void 0;
  12249. this._sketchPolygon = void 0;
  12250. this._sketchTempAltituePolyline = void 0;
  12251. this._sketchAltitudePolyline = void 0;
  12252. this._sketchTempSpatialPolyline = void 0;
  12253. this._sketchSpatialPolyline = void 0;
  12254. this._sketchTempCircle = void 0;
  12255. this._sketchCircle = void 0;
  12256. this._sketchTempRectangle = void 0;
  12257. this._sketchRectangle = void 0;
  12258. this._sketchTempTriangleAltitudePolyline = void 0;
  12259. this._sketchTriangleAltituePolyline = void 0;
  12260. this._sketchTempSpatialTriangle = void 0;
  12261. this._sketchSpatialTriangle = void 0;
  12262. }
  12263. _checkAppOrWeb() {
  12264. if (window.navigator.userAgent.match(
  12265. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  12266. )) {
  12267. return SketchViewModel.RuntimeEnvironment.App;
  12268. } else {
  12269. return SketchViewModel.RuntimeEnvironment.Web;
  12270. }
  12271. }
  12272. _isRuntimeApp() {
  12273. if (this._checkAppOrWeb() === SketchViewModel.RuntimeEnvironment.App) {
  12274. return true;
  12275. }
  12276. return false;
  12277. }
  12278. }
  12279. Object.assign(SketchViewModel.prototype, {
  12280. setMoveLineStyle: function(options2) {
  12281. this._setMoveLineStyle(options2);
  12282. },
  12283. setLineStyle: function(options2) {
  12284. this._setLineStyle(options2);
  12285. },
  12286. setSpatialLineStyle: function() {
  12287. this._setSpatialLineStyle(options);
  12288. },
  12289. setMovePolygonStyle: function(options2) {
  12290. this._setMovePolygonStyle(options2);
  12291. },
  12292. setPolygonStyle: function(options2) {
  12293. this._setPolygonStyle(options2);
  12294. },
  12295. setMoveAltitudeLineStyle: function(options2) {
  12296. this._setMoveAltitudeLineStyle(options2);
  12297. },
  12298. setAltitudeLineStyle: function(options2) {
  12299. this._setAltitudeLineStyle(options2);
  12300. },
  12301. setMoveEllipseStyle: function(options2) {
  12302. this._setMoveEllipseStyle(options2);
  12303. },
  12304. setEllipseStyle: function(options2) {
  12305. this._setEllipseStyle(options2);
  12306. },
  12307. setLabel: function(options2) {
  12308. if (!options2) {
  12309. options2 = {
  12310. lineLabel: void 0,
  12311. polygonLabel: void 0
  12312. };
  12313. }
  12314. if (options2.lineLabel)
  12315. this._lineLabel = options2.lineLabel;
  12316. if (options2.polygonLabel)
  12317. this._lineLabel = options2.polygonLabel;
  12318. }
  12319. });
  12320. Object.assign(SketchViewModel.prototype, {
  12321. _registerLeftClickEvent: function(handler, callChange) {
  12322. let _self = this;
  12323. if (!handler)
  12324. return;
  12325. handler.setInputAction(function(event2) {
  12326. _self._lock = true;
  12327. if (_self._timer != null)
  12328. clearTimeout(_self._timer);
  12329. _self._timer = setTimeout(function() {
  12330. if (callChange)
  12331. callChange(event2);
  12332. _self._lock = false;
  12333. }, 200);
  12334. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12335. },
  12336. _registerLeftDoubleClickEvent: function(handler, callChange) {
  12337. let _self = this;
  12338. if (!handler)
  12339. return;
  12340. handler.setInputAction(function(event2) {
  12341. if (_self._timer != null)
  12342. clearTimeout(_self._timer);
  12343. _self._lock = false;
  12344. if (callChange)
  12345. callChange(event2);
  12346. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  12347. },
  12348. _registerMouseMoveEvent: function(handler, callChange) {
  12349. let _self = this;
  12350. if (!handler)
  12351. return;
  12352. handler.setInputAction(function(event2) {
  12353. if (_self._lock === void 0 || _self._lock === false) {
  12354. if (callChange)
  12355. callChange(event2);
  12356. }
  12357. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12358. },
  12359. _registerRightClickEvent: function(handler, callChange) {
  12360. if (!handler)
  12361. return;
  12362. handler.setInputAction(function(event2) {
  12363. if (callChange)
  12364. callChange(event2);
  12365. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12366. },
  12367. _clearEvent: function(handler) {
  12368. if (!handler)
  12369. return;
  12370. handler.destroy();
  12371. handler = null;
  12372. }
  12373. });
  12374. Object.assign(SketchViewModel.prototype, {
  12375. _sketchDrawPoint(handler, options2) {
  12376. let _self = this;
  12377. this._registerLeftClickEvent(handler, function(event2) {
  12378. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12379. if (!Cesium.defined(loc2.sLocation))
  12380. return;
  12381. if (_self._isDrawPoint) {
  12382. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12383. }
  12384. _self._clearEvent(handler);
  12385. if (options2.onComplete)
  12386. options2.onComplete(loc2.sLocation, loc2.gLocation);
  12387. });
  12388. },
  12389. _sketchDrawMultiplePoint(handler, options2) {
  12390. let _self = this;
  12391. this._registerLeftClickEvent(handler, function(event2) {
  12392. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12393. if (!Cesium.defined(loc2.sLocation))
  12394. return;
  12395. if (_self._isDrawPoint) {
  12396. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12397. }
  12398. _self._sketchPoints.push(loc2.sLocation);
  12399. _self._sketchOutputPoints.push(loc2.gLocation);
  12400. if (options2.onAdded)
  12401. options2.onAdded(loc2.sLocation, loc2.gLocation);
  12402. });
  12403. this._registerRightClickEvent(handler, function(event2) {
  12404. if (_self._sketchPoints.length > 0) {
  12405. _self._sketchPoints.pop();
  12406. _self._sketchOutputPoints.pop();
  12407. if (options2.onUndo)
  12408. options2.onUndo();
  12409. }
  12410. });
  12411. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12412. _self._clearEvent();
  12413. if (options2.onComplete)
  12414. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12415. });
  12416. },
  12417. _sketchDrawPolyline(handler, options2) {
  12418. let _self = this;
  12419. this._registerLeftClickEvent(handler, function(event2) {
  12420. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12421. if (!Cesium.defined(loc2.sLocation))
  12422. return;
  12423. if (_self._isDrawPoint) {
  12424. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12425. }
  12426. if (_self._sketchTempPoints.length === 0) {
  12427. _self._createTempPolyline();
  12428. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12429. }
  12430. _self._sketchTempPoints.push(loc2.sLocation);
  12431. _self._sketchPoints.push(loc2.sLocation.clone());
  12432. _self._sketchOutputPoints.push(loc2.gLocation);
  12433. if (options2.onAdded)
  12434. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12435. });
  12436. this._registerMouseMoveEvent(handler, function(event2) {
  12437. if (_self._isRuntimeApp())
  12438. return;
  12439. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12440. if (!Cesium.defined(loc2.sLocation))
  12441. return;
  12442. if (Cesium.defined(_self._sketchTempPolyline)) {
  12443. _self._sketchTempPoints.pop();
  12444. _self._sketchTempPoints.push(loc2.sLocation);
  12445. if (options2.onMoving)
  12446. options2.onMoving(loc2.sLocation);
  12447. }
  12448. });
  12449. this._registerRightClickEvent(handler, function(event2) {
  12450. if (_self._sketchTempPoints.length > 2) {
  12451. _self._sketchPoints.pop();
  12452. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12453. if (_self._isDrawPoint) {
  12454. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12455. _self._entities.remove(lastPointEntity);
  12456. _self._pointEntitys.pop();
  12457. }
  12458. if (options2.onUndo)
  12459. options2.onUndo();
  12460. }
  12461. });
  12462. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12463. if (_self._isRuntimeApp())
  12464. return;
  12465. if (_self._sketchPoints.length < 2) {
  12466. if (options2.onError)
  12467. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12468. return;
  12469. }
  12470. _self._removeEntityByObject(_self._sketchTempPolyline);
  12471. _self._createPolyline();
  12472. if (!_self._isRetainDrawPoint)
  12473. _self._removePointEntitys();
  12474. _self._clearEvent(handler);
  12475. if (options2.onComplete)
  12476. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12477. });
  12478. },
  12479. _sketchDrawSpatialPolyline(handler, options2) {
  12480. let _self = this;
  12481. this._registerLeftClickEvent(handler, function(event2) {
  12482. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12483. if (!Cesium.defined(loc2.sLocation))
  12484. return;
  12485. if (_self._isDrawPoint) {
  12486. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12487. }
  12488. if (_self._sketchTempPoints.length === 0) {
  12489. _self._createTempSpatialPolyline();
  12490. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12491. }
  12492. _self._sketchTempPoints.push(loc2.sLocation);
  12493. _self._sketchPoints.push(loc2.sLocation.clone());
  12494. _self._sketchOutputPoints.push(loc2.gLocation);
  12495. if (options2.onAdded)
  12496. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12497. });
  12498. this._registerMouseMoveEvent(handler, function(event2) {
  12499. if (_self._isRuntimeApp())
  12500. return;
  12501. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12502. if (!Cesium.defined(loc2.sLocation))
  12503. return;
  12504. if (Cesium.defined(_self._sketchTempSpatialPolyline)) {
  12505. _self._sketchTempPoints.pop();
  12506. _self._sketchTempPoints.push(loc2.sLocation);
  12507. if (options2.onMoving)
  12508. options2.onMoving(loc2.sLocation);
  12509. }
  12510. });
  12511. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12512. if (_self._isRuntimeApp())
  12513. return;
  12514. if (_self._sketchPoints.length < 2) {
  12515. if (options2.onError)
  12516. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12517. return;
  12518. }
  12519. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12520. _self._createSpatialPolyline();
  12521. _self._removePointEntitys();
  12522. _self._clearEvent(handler);
  12523. if (options2.onComplete)
  12524. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12525. });
  12526. this._registerRightClickEvent(handler, function(event2) {
  12527. if (_self._sketchTempPoints.length > 2) {
  12528. _self._sketchPoints.pop();
  12529. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12530. if (options2.onUndo)
  12531. options2.onUndo();
  12532. }
  12533. });
  12534. },
  12535. _sketchDrawPolygon(handler, options2) {
  12536. let _self = this;
  12537. this._registerLeftClickEvent(handler, function(event2) {
  12538. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12539. if (!Cesium.defined(loc2.sLocation))
  12540. return;
  12541. if (_self._isDrawPoint) {
  12542. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12543. }
  12544. if (_self._sketchTempPoints.length === 0) {
  12545. _self._createTempPolygon();
  12546. _self._createTempPolyline();
  12547. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12548. }
  12549. _self._sketchTempPoints.push(loc2.sLocation);
  12550. _self._sketchPoints.push(loc2.sLocation.clone());
  12551. _self._sketchOutputPoints.push(loc2.gLocation);
  12552. if (options2.onAdded)
  12553. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12554. });
  12555. this._registerMouseMoveEvent(handler, function(event2) {
  12556. if (_self._isRuntimeApp())
  12557. return;
  12558. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12559. if (!Cesium.defined(loc2.sLocation))
  12560. return;
  12561. if (Cesium.defined(_self._sketchTempPolygon)) {
  12562. _self._sketchTempPoints.pop();
  12563. _self._sketchTempPoints.push(loc2.sLocation);
  12564. if (options2.onMoving)
  12565. options2.onMoving(loc2.sLocation);
  12566. }
  12567. });
  12568. this._registerRightClickEvent(handler, function(event2) {
  12569. if (_self._sketchTempPoints.length > 2) {
  12570. _self._sketchPoints.pop();
  12571. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12572. if (_self._isDrawPoint) {
  12573. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12574. _self._entities.remove(lastPointEntity);
  12575. _self._pointEntitys.pop();
  12576. }
  12577. if (options2.onUndo)
  12578. options2.onUndo();
  12579. }
  12580. });
  12581. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12582. if (_self._isRuntimeApp())
  12583. return;
  12584. if (_self._sketchPoints.length < 3) {
  12585. if (options2.onError)
  12586. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12587. return;
  12588. }
  12589. _self._removeEntityByObject(_self._sketchTempPolygon);
  12590. _self._removeEntityByObject(_self._sketchTempPolyline);
  12591. _self._createPolygon();
  12592. if (!_self._isRetainDrawPoint)
  12593. _self._removePointEntitys();
  12594. _self._clearEvent(handler);
  12595. if (options2.onComplete)
  12596. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12597. });
  12598. },
  12599. _sketchDrawCircle: function(handler, options2) {
  12600. let _self = this;
  12601. this._registerLeftClickEvent(handler, function(event2) {
  12602. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12603. if (!Cesium.defined(loc2.sLocation))
  12604. return;
  12605. if (_self._sketchTempPoints.length === 0) {
  12606. if (_self._isDrawPoint) {
  12607. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12608. }
  12609. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12610. _self._sketchTempPoints.push(loc2.sLocation);
  12611. _self._sketchPoints.push(loc2.sLocation.clone());
  12612. _self._sketchOutputPoints.push(loc2.gLocation);
  12613. _self._createTempCircle(loc2.sLocation);
  12614. if (options2.onAdded)
  12615. options2.onAdded(loc2.sLocation);
  12616. } else {
  12617. if (_self._isRuntimeApp()) {
  12618. _self._sketchTempPoints.pop();
  12619. _self._sketchTempPoints.push(loc2.sLocation);
  12620. let positionCenter = _self._sketchEllipseCenterPosition;
  12621. let positionRotate = _self._sketchTempPoints[1];
  12622. _self._ellipseOutlineCoordinates = [];
  12623. for (let angle = 5; angle < 360; ) {
  12624. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  12625. _self._ellipseOutlineCoordinates.push(newPosition);
  12626. angle = angle + 5;
  12627. }
  12628. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  12629. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12630. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12631. let geodesic = new Cesium.EllipsoidGeodesic();
  12632. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12633. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12634. if (_self._sketchEllipseRadius <= 0)
  12635. _self._sketchEllipseRadius = 1;
  12636. }
  12637. _self._removePointEntitys();
  12638. _self._removeEntityByObject(_self._sketchTempCircle);
  12639. _self._createCircle();
  12640. _self._clearEvent(handler);
  12641. if (options2.onComplete)
  12642. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  12643. }
  12644. });
  12645. this._registerMouseMoveEvent(handler, function(event2) {
  12646. if (_self._isRuntimeApp())
  12647. return;
  12648. if (!Cesium.defined(_self._sketchTempCircle))
  12649. return;
  12650. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12651. if (cartesian == void 0)
  12652. return;
  12653. _self._sketchTempPoints.pop();
  12654. _self._sketchTempPoints.push(cartesian);
  12655. });
  12656. },
  12657. _sketchDrawHeightPolyline: function(handler, options2) {
  12658. let _self = this;
  12659. this._registerLeftClickEvent(handler, function(event2) {
  12660. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12661. if (!Cesium.defined(loc2.sLocation))
  12662. return;
  12663. if (_self._sketchTempPoints.length === 0) {
  12664. if (_self._isDrawPoint) {
  12665. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12666. }
  12667. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12668. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12669. _self._sketchTempPoints.push(loc2.sLocation);
  12670. _self._sketchPoints.push(loc2.sLocation.clone());
  12671. if (options2.onAdded)
  12672. options2.onAdded(loc2.sLocation);
  12673. } else {
  12674. if (_self._isRuntimeApp()) {
  12675. _self._sketchTempPoints.pop();
  12676. _self._sketchTempPoints.push(loc2.sLocation);
  12677. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12678. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12679. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12680. _self._sketchAltitudePolylinePostions = [];
  12681. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  12682. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12683. _self._sketchAltitudePolylinePostions.push(point_temp);
  12684. let geodesic = new Cesium.EllipsoidGeodesic();
  12685. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12686. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12687. if (_self._sketchEllipseRadius <= 0)
  12688. _self._sketchEllipseRadius = 1;
  12689. let height_temp = point2cartographic.height - point1cartographic.height;
  12690. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  12691. }
  12692. _self._removePointEntitys();
  12693. _self._removeEntityByObject(_self._sketchTempAltituePolyline);
  12694. _self._createAltitudePolyline();
  12695. _self._clearEvent(handler);
  12696. if (options2.onComplete) {
  12697. options2.onComplete(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12698. }
  12699. }
  12700. });
  12701. this._registerMouseMoveEvent(handler, function(event2) {
  12702. if (_self._isRuntimeApp())
  12703. return;
  12704. if (_self._sketchTempPoints == void 0 || _self._sketchTempPoints.length == 0)
  12705. return;
  12706. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12707. if (cartesian == void 0)
  12708. return;
  12709. if (_self._sketchTempPoints.length >= 2) {
  12710. if (!Cesium.defined(_self._sketchTempAltituePolyline)) {
  12711. _self._createTempAltitudePolyline();
  12712. } else {
  12713. _self._sketchTempPoints.pop();
  12714. _self._sketchTempPoints.push(cartesian);
  12715. }
  12716. if (options2.onMoving) {
  12717. options2.onMoving(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12718. }
  12719. }
  12720. });
  12721. },
  12722. _sketchDrawRectangle: function(handler, options2) {
  12723. let _self = this;
  12724. this._registerLeftClickEvent(handler, function(event2) {
  12725. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12726. if (!Cesium.defined(loc2.sLocation))
  12727. return;
  12728. if (_self._sketchTempPoints.length === 0) {
  12729. if (_self._isDrawPoint) {
  12730. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12731. }
  12732. _self._sketchTempPoints.push(loc2.gLocation);
  12733. _self._sketchTempPoints.push(loc2.gLocation);
  12734. _self._sketchPoints.push(loc2.gLocation);
  12735. _self._createTempRectangle();
  12736. if (options2.onAdded)
  12737. options2.onAdded(loc2.sLocation);
  12738. } else {
  12739. if (_self._isRuntimeApp()) {
  12740. _self._sketchTempPoints.pop();
  12741. _self._sketchTempPoints.push(loc2.gLocation);
  12742. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  12743. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  12744. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  12745. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  12746. _self._rectangleCoordinates = [0, 0, 1, 1];
  12747. if (lng0 < lng1) {
  12748. _self._rectangleCoordinates[0] = lng0;
  12749. _self._rectangleCoordinates[2] = lng1;
  12750. } else {
  12751. _self._rectangleCoordinates[0] = lng1;
  12752. _self._rectangleCoordinates[2] = lng0;
  12753. }
  12754. if (lat0 < lat1) {
  12755. _self._rectangleCoordinates[1] = lat0;
  12756. _self._rectangleCoordinates[3] = lat1;
  12757. } else {
  12758. _self._rectangleCoordinates[1] = lat1;
  12759. _self._rectangleCoordinates[3] = lat0;
  12760. }
  12761. let rectangle = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  12762. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  12763. _self._rectangleOutlineCoordinates = res.cPoints;
  12764. _self._sketchOutputPoints = res.gPoints;
  12765. }
  12766. _self._removePointEntitys();
  12767. _self._removeEntityByObject(_self._sketchTempRectangle);
  12768. _self._createRectangle();
  12769. handler.destroy();
  12770. handler = null;
  12771. if (options2.onComplete)
  12772. options2.onComplete(_self._sketchOutputPoints);
  12773. }
  12774. });
  12775. this._registerMouseMoveEvent(handler, function(event2) {
  12776. if (_self._isRuntimeApp())
  12777. return;
  12778. if (!Cesium.defined(_self._sketchTempRectangle))
  12779. return;
  12780. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12781. if (!Cesium.defined(loc2.sLocation))
  12782. return;
  12783. _self._sketchTempPoints.pop();
  12784. _self._sketchTempPoints.push(loc2.gLocation);
  12785. });
  12786. },
  12787. _sketchDrawTriangle: function(handler, options2) {
  12788. let _self = this;
  12789. handler.setInputAction(function(event2) {
  12790. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12791. return;
  12792. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12793. if (!Cesium.defined(loc2.sLocation))
  12794. return;
  12795. if (_self._sketchPoints.length == 0) {
  12796. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12797. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12798. _self._sketchTempPoints.push(loc2.sLocation);
  12799. _self._sketchPoints.push(loc2.sLocation);
  12800. _self._createTempPolyline();
  12801. } else if (_self._sketchPoints.length === 1) {
  12802. _self._createPoint(loc2.sLocation, "\u9AD8\u5EA6\u8D77\u70B9");
  12803. _self._entities.remove(_self._sketchTempPolyline);
  12804. _self._sketchPoints.push(loc2.sLocation);
  12805. _self._createPolyline();
  12806. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12807. _self._sketchPoints.push(loc2.sLocation);
  12808. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12809. _self._createTempTriangleAltitudePolylineAndSpatialPolyline();
  12810. }
  12811. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12812. handler.setInputAction(function(event2) {
  12813. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12814. return;
  12815. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12816. if (cartesian == void 0)
  12817. return;
  12818. _self._sketchTempPoints.pop();
  12819. _self._sketchTempPoints.push(cartesian);
  12820. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12821. handler.setInputAction(function(event2) {
  12822. if (_self._sketchPoints.length < 2) {
  12823. if (options2.onError)
  12824. options2.onError("\u7ED8\u5236\u56FE\u5F62\u4E0D\u5B8C\u6574\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12825. return;
  12826. }
  12827. _self._removePointEntitys();
  12828. _self._removeEntityByObject(_self._sketchTempTriangleAltitudePolyline);
  12829. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12830. _self._createAltitudePolyline();
  12831. _self._createTriangleSpatialPolyline();
  12832. handler.destroy();
  12833. handler = null;
  12834. options2.onComplete(
  12835. _self._sketchPoints,
  12836. _self._sketchTriangleSpatialPolylinePositions,
  12837. _self._sketchAltitudePolylinePostions,
  12838. _self._sketchEllipseCenterPosition
  12839. );
  12840. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12841. },
  12842. _sketchDrawPolygonBody(handler, options2) {
  12843. let _self = this;
  12844. this._registerLeftClickEvent(handler, function(event2) {
  12845. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12846. if (!Cesium.defined(loc2.sLocation))
  12847. return;
  12848. if (_self._isDrawPoint) {
  12849. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12850. }
  12851. if (_self._sketchTempPoints.length === 0) {
  12852. _self._createTempPolygon();
  12853. _self._createTempPolyline();
  12854. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12855. }
  12856. _self._sketchTempPoints.push(loc2.sLocation);
  12857. _self._sketchPoints.push(loc2.sLocation.clone());
  12858. _self._sketchOutputPoints.push(loc2.gLocation);
  12859. if (options2.onAdded)
  12860. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12861. });
  12862. this._registerMouseMoveEvent(handler, function(event2) {
  12863. if (_self._isRuntimeApp())
  12864. return;
  12865. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12866. if (!Cesium.defined(loc2.sLocation))
  12867. return;
  12868. if (Cesium.defined(_self._sketchTempPolygon)) {
  12869. _self._sketchTempPoints.pop();
  12870. _self._sketchTempPoints.push(loc2.sLocation);
  12871. if (options2.onMoving)
  12872. options2.onMoving(loc2.sLocation);
  12873. }
  12874. });
  12875. this._registerRightClickEvent(handler, function(event2) {
  12876. if (_self._sketchTempPoints.length > 2) {
  12877. _self._sketchPoints.pop();
  12878. _self._sketchOutputPoints.pop();
  12879. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12880. if (options2.onUndo)
  12881. options2.onUndo(_self._sketchPoints);
  12882. }
  12883. });
  12884. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12885. if (_self._isRuntimeApp())
  12886. return;
  12887. if (_self._sketchPoints.length < 3) {
  12888. if (options2.onError)
  12889. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12890. return;
  12891. }
  12892. _self._removeEntityByObject(_self._sketchTempPolygon);
  12893. _self._removeEntityByObject(_self._sketchTempPolyline);
  12894. _self._createPolygonBody({
  12895. height: 30,
  12896. color: [255, 255, 0, 0.9]
  12897. });
  12898. _self._removePointEntitys();
  12899. _self._clearEvent(handler);
  12900. if (options2.onComplete)
  12901. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12902. });
  12903. },
  12904. _sketchDrawTriangleA: function(handler, options2) {
  12905. let _self = this;
  12906. this._registerLeftClickEvent(handler, function(event2) {
  12907. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12908. return;
  12909. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12910. if (!Cesium.defined(loc2.sLocation))
  12911. return;
  12912. if (_self._sketchPoints.length == 0) {
  12913. if (_self._isDrawPoint) {
  12914. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12915. }
  12916. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12917. _self._sketchTempPoints.push(loc2.sLocation);
  12918. _self._sketchPoints.push(loc2.sLocation);
  12919. _self._createTempSpatialTriangle();
  12920. if (options2.onAdded)
  12921. options2.onAdded(loc2.sLocation);
  12922. } else if (_self._sketchPoints.length > 0) {
  12923. if (_self._isRuntimeApp()) {
  12924. _self._sketchTempPoints.pop();
  12925. _self._sketchTempPoints.push(loc2.sLocation);
  12926. _self._sketchSpatialTrianglePositions = [];
  12927. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12928. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12929. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12930. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12931. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12932. _self._sketchSpatialTrianglePositions.push(point_temp);
  12933. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12934. }
  12935. _self._removePointEntitys();
  12936. _self._removeEntityByObject(_self._sketchTempSpatialTriangle);
  12937. _self._createSpatialTriangle();
  12938. _self._clearEvent(handler);
  12939. if (options2.onComplete)
  12940. options2.onComplete(_self._sketchSpatialTrianglePositions);
  12941. }
  12942. });
  12943. this._registerMouseMoveEvent(handler, function(event2) {
  12944. if (_self._isRuntimeApp())
  12945. return;
  12946. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12947. return;
  12948. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12949. if (cartesian == void 0)
  12950. return;
  12951. _self._sketchTempPoints.pop();
  12952. _self._sketchTempPoints.push(cartesian);
  12953. if (options2.onMoving)
  12954. options2.onMoving(cartesian);
  12955. });
  12956. },
  12957. sketchTools: function(toolsType, options2) {
  12958. let _self = this;
  12959. this._clear();
  12960. _self._sketchEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  12961. switch (toolsType) {
  12962. case SketchViewModel.SketchType.Point:
  12963. _self._sketchDrawPoint(_self._sketchEventHandler, options2);
  12964. break;
  12965. case SketchViewModel.SketchType.Line:
  12966. _self._sketchDrawPolyline(_self._sketchEventHandler, options2);
  12967. break;
  12968. case SketchViewModel.SketchType.Polygon:
  12969. _self._sketchDrawPolygon(_self._sketchEventHandler, options2);
  12970. break;
  12971. case SketchViewModel.SketchType.Height:
  12972. _self._sketchDrawHeightPolyline(_self._sketchEventHandler, options2);
  12973. break;
  12974. case SketchViewModel.SketchType.Spatial:
  12975. _self._sketchDrawSpatialPolyline(_self._sketchEventHandler, options2);
  12976. break;
  12977. case SketchViewModel.SketchType.Circle:
  12978. _self._sketchDrawCircle(_self._sketchEventHandler, options2);
  12979. break;
  12980. case SketchViewModel.SketchType.Rectangle:
  12981. _self._sketchDrawRectangle(_self._sketchEventHandler, options2);
  12982. break;
  12983. case SketchViewModel.SketchType.Triangle:
  12984. _self._sketchDrawTriangleA(_self._sketchEventHandler, options2);
  12985. break;
  12986. case SketchViewModel.SketchType.PolygonBody:
  12987. _self._sketchDrawPolygonBody(_self._sketchEventHandler, options2);
  12988. break;
  12989. case SketchViewModel.SketchType.MultiplePoint:
  12990. _self._sketchDrawMultiplePoint(_self._sketchEventHandler, options2);
  12991. break;
  12992. }
  12993. },
  12994. sketchDrawFeacture: function(points2, type2, options2) {
  12995. let _self = this;
  12996. if (points2 === void 0 || points2.length === void 0 || points2.length < 2) {
  12997. if (options2 && options2.onError)
  12998. options2.onError("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  12999. return;
  13000. }
  13001. this._sketchPoints = [];
  13002. for (let i2 = 0; i2 < points2.length; ) {
  13003. this._sketchPoints.push(Cesium.Cartesian3.fromDegrees(points2[i2], points2[i2 + 1], points2[i2 + 2]));
  13004. i2 = i2 + 3;
  13005. }
  13006. switch (type2) {
  13007. case SketchViewModel.SketchType.DrawPoint:
  13008. _self._createPoint(_self._sketchPoints[0], _self._lineLabel);
  13009. if (options2 && options2.onComplete)
  13010. options2.onComplete(_self._pointEntitys);
  13011. break;
  13012. case SketchViewModel.SketchType.DrawMultiplePoint:
  13013. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  13014. _self._createPoint(_self._sketchPoints[i2], _self._lineLabel);
  13015. }
  13016. if (options2 && options2.onComplete)
  13017. options2.onComplete(_self._pointEntitys);
  13018. break;
  13019. case SketchViewModel.SketchType.DrawPolyline:
  13020. if (_self._sketchPoints.length < 2) {
  13021. if (options2 && options2.onError)
  13022. options2.onError("\u70B9\u6570\u5C11\u4E8E2\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13023. } else {
  13024. _self._createPolyline();
  13025. if (options2 && options2.onComplete)
  13026. options2.onComplete(_self._sketchPolyline);
  13027. }
  13028. break;
  13029. case SketchViewModel.SketchType.DrawPolygon:
  13030. if (_self._sketchPoints.length < 3) {
  13031. if (options2 && options2.onError)
  13032. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13033. } else {
  13034. _self._createPolygon();
  13035. if (options2 && options2.onComplete)
  13036. options2.onComplete(_self._sketchPolygon);
  13037. }
  13038. break;
  13039. default:
  13040. if (options2 && options2.onError)
  13041. options2.onError("\u7ED8\u5236\u7C7B\u578B\u5F02\u5E38\uFF01");
  13042. break;
  13043. }
  13044. },
  13045. sketchClear: function() {
  13046. this._clear(true);
  13047. this._clearEvent(this._sketchEventHandler);
  13048. },
  13049. sketchInit: function() {
  13050. this._clear(false);
  13051. }
  13052. });
  13053. Object.assign(SketchViewModel.prototype, {
  13054. _checkColor: function(color2) {
  13055. if (color2 === void 0 || color2 === null)
  13056. return false;
  13057. if (typeof color2 != "number")
  13058. return false;
  13059. let intColor = parseInt(color2);
  13060. if (intColor < 0 || intColor > 255)
  13061. return false;
  13062. return true;
  13063. },
  13064. _checkAlpha: function(alpha) {
  13065. if (alpha === void 0 || alpha === null)
  13066. return false;
  13067. if (typeof alpha != "number")
  13068. return false;
  13069. let floatAlpha = parseFloat(alpha);
  13070. if (floatAlpha < 0 || floatAlpha > 1)
  13071. return false;
  13072. return true;
  13073. },
  13074. _checkColorAndAlpha: function(colorAndAlpah) {
  13075. let setColor = void 0;
  13076. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  13077. return void 0;
  13078. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  13079. setColor = [colorAndAlpah[0], 0, 0, 1];
  13080. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13081. colorAndAlpah[1]
  13082. )) {
  13083. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  13084. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13085. colorAndAlpah[1]
  13086. ) && this._checkColor(colorAndAlpah[2])) {
  13087. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  13088. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13089. colorAndAlpah[1]
  13090. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  13091. colorAndAlpah[3]
  13092. )) {
  13093. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  13094. }
  13095. return setColor;
  13096. },
  13097. sketchEditPickPolygonBody: function(options2) {
  13098. let _self = this;
  13099. let primitive = _self._sketchPickPolygonBody;
  13100. if (primitive === void 0) {
  13101. if (options2.onComplete)
  13102. options2.onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13103. return;
  13104. }
  13105. let color2 = primitive._useGeometry.color;
  13106. let height2 = primitive._useGeometry.height;
  13107. this._sketchPoints = primitive._useGeometry.cPoints;
  13108. this._sketchOutputPoints = primitive._useGeometry.gPoints;
  13109. if (options2 && options2.height && typeof options2.height === "number")
  13110. height2 = parseInt(options2.height);
  13111. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  13112. color2 = this._checkColorAndAlpha(options2.color);
  13113. this._viewer.scene.primitives.remove(primitive);
  13114. this._createPolygonBody({
  13115. color: color2,
  13116. height: height2
  13117. });
  13118. if (options2.onComplete)
  13119. options2.onComplete(void 0);
  13120. },
  13121. sketchRemovePickPolygonBody: function(onComplete) {
  13122. let _self = this;
  13123. let primitive = _self._sketchPickPolygonBody;
  13124. if (primitive === void 0) {
  13125. if (onComplete)
  13126. onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13127. return;
  13128. }
  13129. this._viewer.scene.primitives.remove(primitive);
  13130. if (onComplete)
  13131. onComplete(void 0);
  13132. },
  13133. sketchPick: function(onComplete) {
  13134. let _self = this;
  13135. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  13136. handler.setInputAction(function(event2) {
  13137. let pickObj = _self._viewer.scene.pick(event2.position);
  13138. if (pickObj && pickObj.primitive && pickObj.primitive._useGeometry != void 0) {
  13139. _self._sketchPickPolygonBody = pickObj.primitive;
  13140. if (onComplete)
  13141. onComplete({
  13142. color: pickObj.primitive._useGeometry.color,
  13143. height: pickObj.primitive._useGeometry.height
  13144. });
  13145. } else {
  13146. _self._sketchPickPolygonBody = void 0;
  13147. if (onComplete)
  13148. onComplete(void 0);
  13149. }
  13150. handler.destroy();
  13151. handler = null;
  13152. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  13153. }
  13154. });
  13155. SketchViewModel.SketchType = Object.freeze({
  13156. Point: "point",
  13157. MultiplePoint: "multiplePoint",
  13158. Line: "line",
  13159. Polygon: "polygon",
  13160. Height: "height",
  13161. Spatial: "spatial",
  13162. Circle: "circle",
  13163. Rectangle: "rectangle",
  13164. Triangle: "triangle",
  13165. PolygonBody: "polygonBody",
  13166. DrawPoint: "drawPoint",
  13167. DrawMultiplePoint: "drawMultiplePoint",
  13168. DrawPolyline: "drawPolyline",
  13169. DrawPolygon: "drawPolygon"
  13170. });
  13171. SketchViewModel.SketchIconType = Object.freeze({
  13172. Normal: "normal",
  13173. Blue: "blue",
  13174. Green: "green",
  13175. Violet: "violter"
  13176. });
  13177. SketchViewModel.RuntimeEnvironment = Object.freeze({
  13178. App: "app",
  13179. Web: "web"
  13180. });
  13181. class CommonTools {
  13182. constructor(viewer2, options2) {
  13183. this._viewer = viewer2;
  13184. options2 = options2 || {};
  13185. if (options2.isDrawPoint) {
  13186. this._isDrawPoint = options2.isDrawPoint;
  13187. } else {
  13188. this._isDrawPoint = false;
  13189. }
  13190. if (options2.isRetainDrawPoint) {
  13191. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  13192. } else {
  13193. this._isRetainDrawPoint = false;
  13194. }
  13195. if (options2.isClear) {
  13196. this._isClear = options2.isClear;
  13197. } else {
  13198. this._isClear = false;
  13199. }
  13200. this._sketchViewModel = new SketchViewModel(viewer2, {
  13201. iconType: SketchViewModel.SketchIconType.Blue,
  13202. isDrawPoint: this._isDrawPoint,
  13203. isRetainDrawPoint: this._isRetainDrawPoint
  13204. });
  13205. let buttonDiv = document.getElementById("drawButtonDiv");
  13206. if (buttonDiv) {
  13207. document.body.removeChild(buttonDiv);
  13208. }
  13209. this._init();
  13210. }
  13211. _init() {
  13212. this._measureEntityName = "MeasureEntity";
  13213. this._entities = this._viewer.entities;
  13214. this._measurePointImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  13215. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  13216. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  13217. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  13218. this._measureTempPoints = [];
  13219. }
  13220. _updateScene() {
  13221. this._viewer.scene.requestRender();
  13222. }
  13223. _removeEntityByName(entityName) {
  13224. let entities2 = this._entities;
  13225. if (!entities2 || !entities2.values)
  13226. return;
  13227. let delEntitys = [];
  13228. for (let i2 = 0; i2 < entities2.values.length; i2++) {
  13229. if (entities2.values[i2].name == entityName) {
  13230. delEntitys.push(entities2.values[i2]);
  13231. }
  13232. }
  13233. for (let i2 = 0; i2 < delEntitys.length; i2++) {
  13234. entities2.remove(delEntitys[i2]);
  13235. }
  13236. this._updateScene();
  13237. }
  13238. _clear(isAll) {
  13239. if (isAll != void 0 && isAll === true) {
  13240. this._removeEntityByName(this._measureEntityName);
  13241. if (this._sketchViewModel != void 0) {
  13242. this._sketchViewModel.sketchClear();
  13243. }
  13244. }
  13245. this._measureTempPoints = [];
  13246. this._altitudeDynamicLabel = void 0;
  13247. this._tooltipRemove();
  13248. let buttonDiv = document.getElementById("drawButtonDiv");
  13249. if (buttonDiv) {
  13250. document.body.removeChild(buttonDiv);
  13251. }
  13252. }
  13253. _toColor(red, green, blue, alpha) {
  13254. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  13255. }
  13256. _cartesianToGeography(cartesian) {
  13257. let ellipsoid = Cesium.Ellipsoid.WGS84;
  13258. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  13259. let latitude = Cesium.Math.toDegrees(cartographic.latitude);
  13260. let longitude = Cesium.Math.toDegrees(cartographic.longitude);
  13261. let altitude = cartographic.height;
  13262. return {
  13263. lon: longitude,
  13264. lat: latitude,
  13265. hei: altitude
  13266. };
  13267. }
  13268. _createPoint(coord, label) {
  13269. let _self = this;
  13270. let entity = new Cesium.Entity({
  13271. name: _self._measureEntityName,
  13272. position: coord,
  13273. billboard: {
  13274. image: _self._iconBlue,
  13275. horizontalOrigin: Cesium.HorizontalOrigin.center,
  13276. verticalOrigin: Cesium.VerticalOrigin.bottom,
  13277. scale: 0.5,
  13278. pixelOffset: new Cesium.Cartesian2(0, -11),
  13279. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13280. }
  13281. });
  13282. if (label) {
  13283. entity.label = {
  13284. text: label,
  13285. font: "30px SimHei",
  13286. scale: 0.5,
  13287. fillColor: this._toColor(255, 255, 255, 1),
  13288. outlineColor: this._toColor(14, 30, 79, 1),
  13289. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13290. outlineWidth: 2,
  13291. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13292. showBackground: true,
  13293. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13294. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13295. pixelOffset: new Cesium.Cartesian2(0, -28)
  13296. };
  13297. }
  13298. this._entities.add(entity);
  13299. this._updateScene();
  13300. return entity;
  13301. }
  13302. _createLabel(coord, label) {
  13303. let _self = this;
  13304. let entity = new Cesium.Entity({
  13305. name: _self._measureEntityName,
  13306. position: coord,
  13307. label: {
  13308. text: label,
  13309. font: "30px SimHei",
  13310. scale: 0.5,
  13311. fillColor: this._toColor(255, 255, 255, 1),
  13312. outlineColor: this._toColor(14, 30, 79, 1),
  13313. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13314. outlineWidth: 2,
  13315. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13316. showBackground: true,
  13317. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13318. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13319. pixelOffset: new Cesium.Cartesian2(0, -14)
  13320. }
  13321. });
  13322. this._entities.add(entity);
  13323. this._updateScene();
  13324. }
  13325. _createAltitudeDynamicLabel() {
  13326. let _self = this;
  13327. this._altitudeDynamicLabel = new Cesium.Entity({
  13328. name: _self._measureEntityName,
  13329. position: new Cesium.CallbackProperty(function() {
  13330. return _self._altitudeLabelPosition;
  13331. }, false),
  13332. label: {
  13333. text: new Cesium.CallbackProperty(function() {
  13334. return _self._altitudeLabelText;
  13335. }, false),
  13336. font: "12px sans-serif",
  13337. fillColor: this._toColor(255, 255, 255, 1),
  13338. outlineColor: this._toColor(0, 154, 94, 1),
  13339. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13340. outlineWidth: 1,
  13341. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13342. pixelOffset: new Cesium.Cartesian2(0, -28),
  13343. showBackground: true,
  13344. backgroundColor: this._toColor(0, 0, 0, 0.6),
  13345. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13346. }
  13347. });
  13348. this._entities.add(this._altitudeDynamicLabel);
  13349. this._updateScene();
  13350. }
  13351. _measureDistance(positions) {
  13352. let distance2 = 0;
  13353. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13354. let point1cartographic = Cesium.Cartographic.fromCartesian(positions[i2]);
  13355. let point2cartographic = Cesium.Cartographic.fromCartesian(positions[i2 + 1]);
  13356. let geodesic = new Cesium.EllipsoidGeodesic();
  13357. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13358. let s = geodesic.surfaceDistance;
  13359. s = Math.sqrt(Math.pow(s, 2) + Math.pow(
  13360. point2cartographic.height - point1cartographic.height,
  13361. 2
  13362. ));
  13363. distance2 = distance2 + s;
  13364. }
  13365. if (distance2 < 1e3)
  13366. return distance2.toFixed(2) + "\u7C73";
  13367. else
  13368. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13369. }
  13370. _measureSpaceDistance(positions) {
  13371. let distance2 = 0;
  13372. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13373. let point1 = positions[i2];
  13374. let point2 = positions[i2 + 1];
  13375. let sx = Math.abs(point1.x - point2.x);
  13376. let sy = Math.abs(point1.y - point2.y);
  13377. let sz = Math.abs(point1.z - point2.z);
  13378. let s = Math.sqrt(Math.pow(sx, 2) + Math.pow(sy, 2) + Math.pow(sz, 2));
  13379. distance2 = distance2 + s;
  13380. }
  13381. if (distance2 < 1e3)
  13382. return distance2.toFixed(2) + "\u7C73";
  13383. else
  13384. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13385. }
  13386. _measureAreaBearing(from3, to) {
  13387. let radiansPerDegree = Math.PI / 180;
  13388. let degreesPerRadian = 180 / Math.PI;
  13389. let lat1 = from3.lat * radiansPerDegree;
  13390. let lon1 = from3.lon * radiansPerDegree;
  13391. let lat2 = to.lat * radiansPerDegree;
  13392. let lon2 = to.lon * radiansPerDegree;
  13393. let angle = -Math.atan2(Math.sin(lon1 - lon2) * Math.cos(lat2), Math.cos(lat1) * Math.sin(
  13394. lat2
  13395. ) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2));
  13396. if (angle < 0) {
  13397. angle += Math.PI * 2;
  13398. }
  13399. angle = angle * degreesPerRadian;
  13400. return angle;
  13401. }
  13402. _calculateAreaAngle(p1, p2, p3) {
  13403. let bearing21 = this._measureAreaBearing(p2, p1);
  13404. let bearing23 = this._measureAreaBearing(p2, p3);
  13405. let angle = bearing21 - bearing23;
  13406. if (angle < 0) {
  13407. angle += 360;
  13408. }
  13409. return angle;
  13410. }
  13411. _calculateDistance(point1, point2) {
  13412. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  13413. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  13414. let geodesic = new Cesium.EllipsoidGeodesic();
  13415. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13416. let s = geodesic.surfaceDistance;
  13417. s = Math.sqrt(Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2));
  13418. return s;
  13419. }
  13420. _measureArea(points2, cartesianPoints) {
  13421. let self2 = this;
  13422. let res = 0;
  13423. for (let i2 = 0; i2 < points2.length - 2; i2++) {
  13424. let j = (i2 + 1) % points2.length;
  13425. let k = (i2 + 2) % points2.length;
  13426. let totalAngle = self2._calculateAreaAngle(points2[i2], points2[j], points2[k]);
  13427. let dis_temp1 = self2._calculateDistance(cartesianPoints[i2], cartesianPoints[j]);
  13428. let dis_temp2 = self2._calculateDistance(cartesianPoints[j], cartesianPoints[k]);
  13429. res += dis_temp1 * dis_temp2 * Math.abs(Math.sin(totalAngle));
  13430. }
  13431. return res;
  13432. }
  13433. _calculatePolylineAltitudeHeight(points2) {
  13434. if (points2 === void 0 || points2.length < 2)
  13435. return -1;
  13436. let cartographic = Cesium.Cartographic.fromCartesian(points2[0]);
  13437. let cartographic1 = Cesium.Cartographic.fromCartesian(points2[1]);
  13438. let height_temp = cartographic1.height - cartographic.height;
  13439. return Math.abs(height_temp).toFixed(2) + "\u7C73";
  13440. }
  13441. _setMousePointerStyle() {
  13442. document.querySelector("body").style.cursor = "crosshair";
  13443. }
  13444. _initMousePointerStyle() {
  13445. document.querySelector("body").style.cursor = "default";
  13446. }
  13447. _checkAppOrWeb() {
  13448. if (window.navigator.userAgent.match(
  13449. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  13450. )) {
  13451. return CommonTools.RuntimeEnvironment.App;
  13452. } else {
  13453. return CommonTools.RuntimeEnvironment.Web;
  13454. }
  13455. }
  13456. _isRuntimeApp() {
  13457. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.App) {
  13458. return true;
  13459. }
  13460. return false;
  13461. }
  13462. _isRuntimeWeb() {
  13463. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.Web) {
  13464. return true;
  13465. }
  13466. return false;
  13467. }
  13468. _createOperationMainDom() {
  13469. let buttonDiv = document.createElement("div");
  13470. buttonDiv.id = "drawButtonDiv";
  13471. buttonDiv.style.width = "80px";
  13472. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  13473. buttonDiv.style.borderRadius = "5px";
  13474. buttonDiv.style.display = "flex";
  13475. buttonDiv.style.flexDirection = "column";
  13476. buttonDiv.style.padding = "8px";
  13477. buttonDiv.style.justifyContent = "center";
  13478. buttonDiv.style.position = "absolute";
  13479. buttonDiv.style.bottom = "150px";
  13480. buttonDiv.style.right = "10px";
  13481. let btnUndo = document.createElement("button");
  13482. btnUndo.id = "btnDrawBackout";
  13483. btnUndo.style.height = "30px";
  13484. btnUndo.style.marginBottom = "8px";
  13485. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  13486. btnUndo.style.color = "rgb(255, 255, 255)";
  13487. btnUndo.style.border = "0px solid red";
  13488. btnUndo.style.borderRadius = "5px";
  13489. btnUndo.innerHTML = "\u56DE\u9000";
  13490. btnUndo.style.fontSize = "13px";
  13491. btnUndo.style.cursor = "pointer";
  13492. buttonDiv.appendChild(btnUndo);
  13493. let btnCompletion = document.createElement("button");
  13494. btnCompletion.id = "btnDrawComplete";
  13495. btnCompletion.style.height = "30px";
  13496. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  13497. btnCompletion.style.color = "rgb(255, 255, 255)";
  13498. btnCompletion.style.border = "0px solid red";
  13499. btnCompletion.style.borderRadius = "5px";
  13500. btnCompletion.innerHTML = "\u5B8C\u6210";
  13501. btnCompletion.style.fontSize = "13px";
  13502. btnCompletion.style.cursor = "pointer";
  13503. buttonDiv.appendChild(btnCompletion);
  13504. document.body.appendChild(buttonDiv);
  13505. }
  13506. _showTooltipMessage(message) {
  13507. let msgMainDom = document.getElementById("messageMainDom");
  13508. if (msgMainDom !== null && msgMainDom !== void 0) {
  13509. document.body.removeChild(msgMainDom);
  13510. }
  13511. msgMainDom = document.createElement("div");
  13512. msgMainDom.style.width = "30%";
  13513. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  13514. msgMainDom.style.height = "45px";
  13515. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  13516. msgMainDom.style.borderRadius = "8px";
  13517. msgMainDom.style.display = "flex";
  13518. msgMainDom.style.alignItems = "center";
  13519. msgMainDom.style.paddingLeft = "10px";
  13520. msgMainDom.style.color = "rgb(91, 188, 48)";
  13521. msgMainDom.style.fontSize = "14px";
  13522. msgMainDom.style.fontWeight = "600";
  13523. msgMainDom.style.position = "absolute";
  13524. msgMainDom.style.left = "35%";
  13525. msgMainDom.style.transition = "transform 1s";
  13526. msgMainDom.style.transform = "translateY(-90px)";
  13527. msgMainDom.style.top = "0px";
  13528. msgMainDom.style.zIndex = 1e3;
  13529. document.body.appendChild(msgMainDom);
  13530. let strHtml = "";
  13531. strHtml += "<div style='";
  13532. strHtml += "background-color: rgb(88, 185, 45);";
  13533. strHtml += "color: rgb(255, 255, 255);";
  13534. strHtml += "height: 24px;";
  13535. strHtml += "width: 24px;";
  13536. strHtml += "border-radius: 20px;";
  13537. strHtml += "display: flex;";
  13538. strHtml += "justify-content: center;";
  13539. strHtml += "align-items: center;";
  13540. strHtml += "font-size: 14px;";
  13541. strHtml += "margin-right: 18px;";
  13542. strHtml += "'>&#10003</div>";
  13543. strHtml += "<div>" + message + "</div>";
  13544. msgMainDom.innerHTML = strHtml;
  13545. msgMainDom.addEventListener("transitionend", function() {
  13546. setTimeout(function() {
  13547. document.body.removeChild(msgMainDom);
  13548. }, 1e3);
  13549. }, false);
  13550. setTimeout(function() {
  13551. msgMainDom.style.transform = "translateY(50px)";
  13552. }, 100);
  13553. }
  13554. }
  13555. Object.assign(CommonTools.prototype, {
  13556. _tooltipInit: function(text) {
  13557. this._tooltipId = "tooltipJt";
  13558. let tooltipObj = document.getElementById(this._tooltipId);
  13559. if (tooltipObj === null) {
  13560. tooltipObj = document.createElement("div");
  13561. tooltipObj.id = this._tooltipId;
  13562. document.body.appendChild(tooltipObj);
  13563. let divStyle = "";
  13564. divStyle += "top: 30px;";
  13565. divStyle += "left: 30px;";
  13566. divStyle += "position: absolute;";
  13567. divStyle += "display: flex;";
  13568. divStyle += "align-items: center;";
  13569. divStyle += "width: 12x0px;";
  13570. divStyle += "height: auto;";
  13571. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  13572. divStyle += "border-radius: 5px;";
  13573. divStyle += "color: rgb(255, 255, 255);";
  13574. divStyle += "font-size: 12px;";
  13575. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  13576. divStyle += "padding: 8px;";
  13577. divStyle += "border:solid 1px rgb(255,0,0);";
  13578. tooltipObj.setAttribute("style", divStyle);
  13579. }
  13580. if (text != void 0)
  13581. tooltipObj.innerHTML = text;
  13582. document.onmousemove = function(event2) {
  13583. tooltipObj.style.left = event2.clientX + 10 + "px";
  13584. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  13585. };
  13586. },
  13587. _tooltipRemove: function() {
  13588. let tooltipObj = document.getElementById(this._tooltipId);
  13589. if (tooltipObj != null) {
  13590. document.body.removeChild(tooltipObj);
  13591. }
  13592. },
  13593. _tooltipSetText: function(text) {
  13594. let tooltipObj = document.getElementById(this._tooltipId);
  13595. if (tooltipObj != null) {
  13596. tooltipObj.innerHTML = text;
  13597. }
  13598. }
  13599. });
  13600. Object.assign(CommonTools.prototype, {
  13601. clear: function() {
  13602. this._clear(true);
  13603. this._initMousePointerStyle();
  13604. }
  13605. });
  13606. Object.assign(CommonTools.prototype, {
  13607. measureLength: function(callError) {
  13608. let _self = this;
  13609. this._tempEntitys = [];
  13610. this._clear(this._isClear);
  13611. this._setMousePointerStyle();
  13612. if (this._isRuntimeApp()) {
  13613. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13614. } else {
  13615. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13616. }
  13617. if (this._isRuntimeWeb()) {
  13618. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13619. onAdded: function(cPoints, gPoints) {
  13620. if (cPoints.length === 1) {
  13621. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13622. } else {
  13623. let distince = _self._measureDistance(cPoints);
  13624. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13625. distince += " +" + _self._measureDistance(tempPoints);
  13626. _self._tempEntitys.push(_self._createPoint(
  13627. cPoints[cPoints.length - 1],
  13628. distince
  13629. ));
  13630. }
  13631. },
  13632. onUndo: function() {
  13633. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13634. _self._tempEntitys.pop();
  13635. },
  13636. onMoving: function(cPoint, scPoint) {
  13637. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13638. },
  13639. onError: function(error) {
  13640. if (callError)
  13641. callError(error);
  13642. },
  13643. onComplete: function(cPoints, gPoints) {
  13644. _self._initMousePointerStyle();
  13645. _self._tooltipRemove();
  13646. }
  13647. });
  13648. } else {
  13649. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13650. onAdded: function(cPoints, gPoints) {
  13651. if (cPoints.length === 1) {
  13652. _self._tooltipRemove();
  13653. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13654. let buttonDiv = document.getElementById("drawButtonDiv");
  13655. if (buttonDiv == null) {
  13656. _self._createOperationMainDom();
  13657. document.getElementById("btnDrawBackout").onclick = () => {
  13658. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13659. _self._sketchViewModel._sketchPoints.pop();
  13660. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13661. if (_self._sketchViewModel._isDrawPoint) {
  13662. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13663. _self._sketchViewModel._entities.remove(lastPointEntity);
  13664. _self._sketchViewModel._pointEntitys.pop();
  13665. }
  13666. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13667. _self._tempEntitys.pop();
  13668. }
  13669. };
  13670. document.getElementById("btnDrawComplete").onclick = () => {
  13671. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13672. if (callError)
  13673. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13674. return;
  13675. }
  13676. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13677. _self._sketchViewModel._createPolyline();
  13678. if (!_self._sketchViewModel._isRetainDrawPoint)
  13679. _self._sketchViewModel._removePointEntitys();
  13680. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13681. _self._initMousePointerStyle();
  13682. _self._tooltipRemove();
  13683. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13684. if (buttonDiv2) {
  13685. document.body.removeChild(buttonDiv2);
  13686. }
  13687. };
  13688. }
  13689. } else {
  13690. let distince = _self._measureDistance(cPoints);
  13691. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13692. distince += " +" + _self._measureDistance(tempPoints);
  13693. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13694. }
  13695. }
  13696. });
  13697. }
  13698. },
  13699. measureSpatialLength: function(callError) {
  13700. let _self = this;
  13701. this._clear(this._isClear);
  13702. this._setMousePointerStyle();
  13703. if (this._isRuntimeApp()) {
  13704. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13705. } else {
  13706. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13707. }
  13708. this._tempEntitys = [];
  13709. if (this._isRuntimeWeb()) {
  13710. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13711. onAdded: function(cPoints, gPoints) {
  13712. if (cPoints.length === 1) {
  13713. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13714. } else {
  13715. let distince = _self._measureSpaceDistance(cPoints);
  13716. _self._tempEntitys.push(_self._createPoint(
  13717. cPoints[cPoints.length - 1],
  13718. distince
  13719. ));
  13720. }
  13721. },
  13722. onUndo: function() {
  13723. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13724. _self._tempEntitys.pop();
  13725. },
  13726. onMoving: function(cPoint, scPoint) {
  13727. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13728. },
  13729. onError: function(error) {
  13730. if (callError)
  13731. callError(error);
  13732. },
  13733. onComplete: function(cPoints, gPoints) {
  13734. _self._initMousePointerStyle();
  13735. _self._tooltipRemove();
  13736. }
  13737. });
  13738. } else {
  13739. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13740. onAdded: function(cPoints, gPoints) {
  13741. if (cPoints.length === 1) {
  13742. _self._tooltipRemove();
  13743. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13744. let buttonDiv = document.getElementById("drawButtonDiv");
  13745. if (buttonDiv == null) {
  13746. _self._createOperationMainDom();
  13747. document.getElementById("btnDrawBackout").onclick = () => {
  13748. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13749. _self._sketchViewModel._sketchPoints.pop();
  13750. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13751. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13752. _self._tempEntitys.pop();
  13753. }
  13754. };
  13755. document.getElementById("btnDrawComplete").onclick = () => {
  13756. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13757. if (callError)
  13758. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13759. return;
  13760. }
  13761. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempSpatialPolyline);
  13762. _self._sketchViewModel._createSpatialPolyline();
  13763. _self._sketchViewModel._removePointEntitys();
  13764. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13765. _self._initMousePointerStyle();
  13766. _self._tooltipRemove();
  13767. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13768. if (buttonDiv2) {
  13769. document.body.removeChild(buttonDiv2);
  13770. }
  13771. };
  13772. }
  13773. } else {
  13774. let distince = _self._measureSpaceDistance(cPoints);
  13775. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13776. }
  13777. }
  13778. });
  13779. }
  13780. },
  13781. measureArea: function(callError) {
  13782. let _self = this;
  13783. this._clear(this._isClear);
  13784. this._setMousePointerStyle();
  13785. if (this._isRuntimeApp()) {
  13786. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13787. } else {
  13788. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13789. }
  13790. var _areaLabel = "";
  13791. if (this._isRuntimeWeb()) {
  13792. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13793. onAdded: function(cPoints, gPoints) {
  13794. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13795. if (cPoints.length === 1) {
  13796. _areaLabel = "\u8D77\u70B9";
  13797. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13798. var lable = _areaLabel;
  13799. return lable;
  13800. }, false));
  13801. } else if (cPoints.length >= 3) {
  13802. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13803. if (area > 1e5) {
  13804. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13805. } else {
  13806. _areaLabel = area.toFixed(2) + "m\xB2";
  13807. }
  13808. }
  13809. },
  13810. onUndo: function() {
  13811. _self._measureTempPoints.pop();
  13812. if (_self._measureTempPoints.length === 1)
  13813. _self._areaLabel = "\u8D77\u70B9";
  13814. },
  13815. onMoving: function(cPoint, scPoint) {
  13816. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13817. },
  13818. onError: function(error) {
  13819. if (callError)
  13820. callError(error);
  13821. },
  13822. onComplete: function(cPoints, gPoints) {
  13823. _self._initMousePointerStyle();
  13824. _self._tooltipRemove();
  13825. }
  13826. });
  13827. } else {
  13828. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13829. onAdded: function(cPoints, gPoints) {
  13830. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13831. if (cPoints.length === 1) {
  13832. _self._tooltipRemove();
  13833. _areaLabel = "\u8D77\u70B9";
  13834. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13835. var lable = _areaLabel;
  13836. return lable;
  13837. }, false));
  13838. let buttonDiv = document.getElementById("drawButtonDiv");
  13839. if (buttonDiv == null) {
  13840. _self._createOperationMainDom();
  13841. document.getElementById("btnDrawBackout").onclick = () => {
  13842. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13843. _self._sketchViewModel._sketchPoints.pop();
  13844. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13845. if (_self._sketchViewModel._isDrawPoint) {
  13846. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13847. _self._entities.remove(lastPointEntity);
  13848. _self._sketchViewModel._pointEntitys.pop();
  13849. }
  13850. _self._measureTempPoints.pop();
  13851. if (_self._measureTempPoints.length === 1)
  13852. _self._areaLabel = "\u8D77\u70B9";
  13853. }
  13854. };
  13855. document.getElementById("btnDrawComplete").onclick = () => {
  13856. if (_self._sketchViewModel._sketchPoints.length < 3) {
  13857. if (callError)
  13858. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13859. return;
  13860. }
  13861. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  13862. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13863. _self._sketchViewModel._createPolygon();
  13864. if (!_self._sketchViewModel._isRetainDrawPoint)
  13865. _self._sketchViewModel._removePointEntitys();
  13866. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13867. _self._initMousePointerStyle();
  13868. _self._tooltipRemove();
  13869. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13870. if (buttonDiv2) {
  13871. document.body.removeChild(buttonDiv2);
  13872. }
  13873. };
  13874. }
  13875. } else if (cPoints.length >= 3) {
  13876. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13877. if (area > 1e5) {
  13878. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13879. } else {
  13880. _areaLabel = area.toFixed(2) + "m\xB2";
  13881. }
  13882. }
  13883. }
  13884. });
  13885. }
  13886. },
  13887. measureHeight: function(callError) {
  13888. let _self = this;
  13889. this._clear(this._isClear);
  13890. this._setMousePointerStyle();
  13891. if (this._isRuntimeApp()) {
  13892. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13893. } else {
  13894. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13895. }
  13896. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Height, {
  13897. onAdded: function(cPoint) {
  13898. if (_self._isRuntimeApp()) {
  13899. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13900. } else {
  13901. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13902. }
  13903. },
  13904. onMoving: function(cPoints, centerPoint) {
  13905. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13906. _self._altitudeLabelPosition = centerPoint;
  13907. _self._altitudeLabelText = height2;
  13908. if (_self._altitudeDynamicLabel === void 0) {
  13909. _self._createAltitudeDynamicLabel();
  13910. }
  13911. },
  13912. onError: function(error) {
  13913. if (callError)
  13914. callError(error);
  13915. },
  13916. onComplete: function(cPoints, centerPoint) {
  13917. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13918. _self._entities.remove(_self._altitudeDynamicLabel);
  13919. _self._createLabel(centerPoint, height2);
  13920. _self._initMousePointerStyle();
  13921. _self._tooltipRemove();
  13922. }
  13923. });
  13924. },
  13925. measureTriangle: function(callError) {
  13926. let _self = this;
  13927. this._clear(this._isClear);
  13928. this._setMousePointerStyle();
  13929. if (this._isRuntimeApp()) {
  13930. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13931. } else {
  13932. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13933. }
  13934. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Triangle, {
  13935. onAdded: function(cPoint) {
  13936. if (_self._isRuntimeApp()) {
  13937. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13938. } else {
  13939. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13940. }
  13941. },
  13942. onMoving: function(cPoint) {
  13943. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13944. },
  13945. onError: function(error) {
  13946. if (callError)
  13947. callError(error);
  13948. },
  13949. onComplete: function(positions) {
  13950. _self._initMousePointerStyle();
  13951. _self._tooltipRemove();
  13952. let sPoints = [positions[0], positions[1]];
  13953. let sDistince = _self._measureSpaceDistance(sPoints);
  13954. let hPoints = [positions[1], positions[2]];
  13955. let hDistince = _self._measureSpaceDistance(hPoints);
  13956. let hePoints = [positions[2], positions[0]];
  13957. let height2 = _self._calculatePolylineAltitudeHeight(hePoints);
  13958. _self._createLabel(positions[0], "\u659C\u8DDD:" + sDistince);
  13959. _self._createLabel(positions[1], "\u5E73\u8DDD:" + hDistince);
  13960. _self._createLabel(positions[2], "\u9AD8\u5EA6:" + height2);
  13961. }
  13962. });
  13963. }
  13964. });
  13965. Object.assign(CommonTools.prototype, {
  13966. queryByPoint: function(callComplete) {
  13967. let _self = this;
  13968. this._setMousePointerStyle();
  13969. this._clear(this._isClear);
  13970. if (this._isRuntimeApp()) {
  13971. this._showTooltipMessage("\u70B9\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  13972. } else {
  13973. this._tooltipInit("\u5355\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  13974. }
  13975. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Point, {
  13976. onComplete: function(cPoint, gPoint) {
  13977. _self._initMousePointerStyle();
  13978. _self._tooltipRemove();
  13979. _self._createPoint(cPoint);
  13980. let coordinates = gPoint.lng + "," + gPoint.lat;
  13981. if (callComplete)
  13982. callComplete(coordinates);
  13983. }
  13984. });
  13985. },
  13986. queryByMultiplePoint: function(callComplete) {
  13987. let _self = this;
  13988. this._setMousePointerStyle();
  13989. this._clear(this._isClear);
  13990. this._tooltipInit("\u70B9\u51FB\u4F4D\u7F6E\u7ED8\u5236<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13991. this._tempEntitys = [];
  13992. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.MultiplePoint, {
  13993. onAdded: function(cPoint, gPoint) {
  13994. let res = gPoint.lng.toFixed(6) + "," + gPoint.lat.toFixed(6);
  13995. _self._tempEntitys.push(_self._createPoint(cPoint, res));
  13996. },
  13997. onUndo: function() {
  13998. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13999. _self._tempEntitys.pop();
  14000. },
  14001. onComplete: function(cPoints, gPoints) {
  14002. _self._initMousePointerStyle();
  14003. _self._tooltipRemove();
  14004. let res = [];
  14005. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14006. res.push(gPoints[i2].lng);
  14007. res.push(gPoints[i2].lat);
  14008. }
  14009. if (callComplete)
  14010. callComplete(res);
  14011. }
  14012. });
  14013. },
  14014. queryByLine: function(callComplete, callError) {
  14015. let _self = this;
  14016. this._clear(this._isClear);
  14017. this._setMousePointerStyle();
  14018. if (this._isRuntimeApp()) {
  14019. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14020. } else {
  14021. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14022. }
  14023. if (this._isRuntimeWeb()) {
  14024. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14025. onAdded: function(cPoints, gPoints) {
  14026. },
  14027. onMoving: function(cPoint, scPoint) {
  14028. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14029. },
  14030. onError: function(error) {
  14031. if (callError)
  14032. callError(error);
  14033. },
  14034. onComplete: function(cPoints, gPoints) {
  14035. _self._initMousePointerStyle();
  14036. _self._tooltipRemove();
  14037. let coordinates = void 0;
  14038. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14039. let point2 = gPoints[i2];
  14040. if (coordinates === void 0)
  14041. coordinates = point2.lng + "," + point2.lat;
  14042. else
  14043. coordinates += "," + point2.lng + "," + point2.lat;
  14044. }
  14045. if (callComplete)
  14046. callComplete(coordinates);
  14047. }
  14048. });
  14049. } else {
  14050. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14051. onAdded: function(cPoints, gPoints) {
  14052. if (cPoints.length === 1) {
  14053. _self._tooltipRemove();
  14054. let buttonDiv = document.getElementById("drawButtonDiv");
  14055. if (buttonDiv == null) {
  14056. _self._createOperationMainDom();
  14057. document.getElementById("btnDrawBackout").onclick = () => {
  14058. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14059. _self._sketchViewModel._sketchPoints.pop();
  14060. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14061. if (_self._sketchViewModel._isDrawPoint) {
  14062. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14063. _self._sketchViewModel._entities.remove(lastPointEntity);
  14064. _self._sketchViewModel._pointEntitys.pop();
  14065. }
  14066. }
  14067. };
  14068. document.getElementById("btnDrawComplete").onclick = () => {
  14069. if (_self._sketchViewModel._sketchPoints.length < 2) {
  14070. if (callError)
  14071. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14072. return;
  14073. }
  14074. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14075. _self._sketchViewModel._createPolyline();
  14076. if (!_self._sketchViewModel._isRetainDrawPoint)
  14077. _self._sketchViewModel._removePointEntitys();
  14078. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14079. _self._initMousePointerStyle();
  14080. _self._tooltipRemove();
  14081. let coordinates = void 0;
  14082. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14083. let point2 = gPoints[i2];
  14084. if (coordinates === void 0)
  14085. coordinates = point2.lng + "," + point2.lat;
  14086. else
  14087. coordinates += "," + point2.lng + "," + point2.lat;
  14088. }
  14089. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14090. if (buttonDiv2) {
  14091. document.body.removeChild(buttonDiv2);
  14092. }
  14093. if (callComplete)
  14094. callComplete(coordinates);
  14095. };
  14096. }
  14097. }
  14098. }
  14099. });
  14100. }
  14101. },
  14102. queryByPolygon: function(callComplete, callError) {
  14103. let _self = this;
  14104. this._clear(this._isClear);
  14105. this._setMousePointerStyle();
  14106. if (this._isRuntimeApp()) {
  14107. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14108. } else {
  14109. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14110. }
  14111. if (this._isRuntimeWeb()) {
  14112. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14113. onMoving: function(cPoint, scPoint) {
  14114. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14115. },
  14116. onError: function(error) {
  14117. if (callError)
  14118. callError(error);
  14119. },
  14120. onComplete: function(cPoints, gPoints) {
  14121. _self._initMousePointerStyle();
  14122. _self._tooltipRemove();
  14123. let coordinates = void 0;
  14124. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14125. let point2 = gPoints[i2];
  14126. if (coordinates === void 0)
  14127. coordinates = point2.lng + "," + point2.lat;
  14128. else
  14129. coordinates += "," + point2.lng + "," + point2.lat;
  14130. }
  14131. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14132. if (callComplete)
  14133. callComplete(coordinates);
  14134. }
  14135. });
  14136. } else {
  14137. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14138. onAdded: function(cPoints, gPoints) {
  14139. if (cPoints.length === 1) {
  14140. _self._tooltipRemove();
  14141. let buttonDiv = document.getElementById("drawButtonDiv");
  14142. if (buttonDiv == null) {
  14143. _self._createOperationMainDom();
  14144. document.getElementById("btnDrawBackout").onclick = () => {
  14145. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14146. _self._sketchViewModel._sketchPoints.pop();
  14147. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14148. if (_self._sketchViewModel._isDrawPoint) {
  14149. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14150. _self._entities.remove(lastPointEntity);
  14151. _self._sketchViewModel._pointEntitys.pop();
  14152. }
  14153. }
  14154. };
  14155. document.getElementById("btnDrawComplete").onclick = () => {
  14156. if (_self._sketchViewModel._sketchPoints.length < 3) {
  14157. if (callError)
  14158. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14159. return;
  14160. }
  14161. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  14162. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14163. _self._sketchViewModel._createPolygon();
  14164. if (!_self._sketchViewModel._isRetainDrawPoint)
  14165. _self._sketchViewModel._removePointEntitys();
  14166. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14167. _self._initMousePointerStyle();
  14168. _self._tooltipRemove();
  14169. let coordinates = void 0;
  14170. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14171. let point2 = gPoints[i2];
  14172. if (coordinates === void 0)
  14173. coordinates = point2.lng + "," + point2.lat;
  14174. else
  14175. coordinates += "," + point2.lng + "," + point2.lat;
  14176. }
  14177. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14178. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14179. if (buttonDiv2) {
  14180. document.body.removeChild(buttonDiv2);
  14181. }
  14182. if (callComplete)
  14183. callComplete(coordinates);
  14184. };
  14185. }
  14186. }
  14187. }
  14188. });
  14189. }
  14190. },
  14191. queryByCircle: function(callComplete) {
  14192. let _self = this;
  14193. this._clear(this._isClear);
  14194. this._setMousePointerStyle();
  14195. if (this._isRuntimeApp()) {
  14196. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14197. } else {
  14198. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14199. }
  14200. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Circle, {
  14201. onAdded: function(center2) {
  14202. if (_self._isRuntimeApp()) {
  14203. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14204. } else {
  14205. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14206. }
  14207. },
  14208. onComplete: function(center2, radius) {
  14209. _self._initMousePointerStyle();
  14210. _self._tooltipRemove();
  14211. if (callComplete)
  14212. callComplete(center2.lng + "," + center2.lat, radius);
  14213. }
  14214. });
  14215. },
  14216. queryByRectangle: function(callComplete) {
  14217. let _self = this;
  14218. this._clear(this._isClear);
  14219. this._setMousePointerStyle();
  14220. if (this._isRuntimeApp()) {
  14221. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14222. } else {
  14223. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14224. }
  14225. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Rectangle, {
  14226. onAdded: function(center2) {
  14227. if (_self._isRuntimeApp()) {
  14228. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14229. } else {
  14230. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14231. }
  14232. },
  14233. onComplete: function(gPoints) {
  14234. _self._initMousePointerStyle();
  14235. _self._tooltipRemove();
  14236. let coordinates = void 0;
  14237. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14238. let point2 = gPoints[i2];
  14239. if (coordinates === void 0)
  14240. coordinates = point2.lng + "," + point2.lat;
  14241. else
  14242. coordinates += "," + point2.lng + "," + point2.lat;
  14243. }
  14244. if (callComplete)
  14245. callComplete(coordinates);
  14246. }
  14247. });
  14248. }
  14249. });
  14250. Object.assign(CommonTools.prototype, {
  14251. drawPolygonBody: function(callComplete) {
  14252. let _self = this;
  14253. this._clear(this._isClear);
  14254. this._setMousePointerStyle();
  14255. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14256. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.PolygonBody, {
  14257. onAdded: function(cPoints, gPoints) {
  14258. if (cPoints.length === 0) {
  14259. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14260. } else if (cPoints.length < 3) {
  14261. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14262. } else {
  14263. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14264. }
  14265. },
  14266. onUndo: function(cPoints) {
  14267. if (cPoints.length === 0) {
  14268. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14269. } else if (cPoints.length < 3) {
  14270. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14271. } else {
  14272. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14273. }
  14274. },
  14275. onComplete: function(cPoints, gPoints) {
  14276. _self._initMousePointerStyle();
  14277. _self._tooltipRemove();
  14278. if (callComplete)
  14279. callComplete();
  14280. }
  14281. });
  14282. },
  14283. drawPointFeacture: function(points2, options2) {
  14284. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPoint, options2);
  14285. },
  14286. drawMultiplePointFeacture: function(points2, options2) {
  14287. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawMultiplePoint, options2);
  14288. },
  14289. drawPolylineFeacture: function(points2, options2) {
  14290. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolyline, options2);
  14291. },
  14292. drawPolygonFeacture: function(points2, options2) {
  14293. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolygon, options2);
  14294. }
  14295. });
  14296. Object.assign(CommonTools.prototype, {
  14297. tooltipInit: function(text) {
  14298. this._tooltipInit(text);
  14299. },
  14300. tooltipRemove: function() {
  14301. this._tooltipRemove();
  14302. },
  14303. tooltipSetText: function(text) {
  14304. this._tooltipSetText(text);
  14305. }
  14306. });
  14307. Object.assign(CommonTools.prototype, {
  14308. pickPolygonBody: function(callComplete) {
  14309. this._sketchViewModel.sketchPick(function(options2) {
  14310. if (options2 === void 0) {
  14311. if (callComplete)
  14312. callComplete(void 0);
  14313. } else {
  14314. if (callComplete)
  14315. callComplete({
  14316. color: options2.color,
  14317. height: options2.height
  14318. });
  14319. }
  14320. });
  14321. },
  14322. setPolygonBody: function(options2) {
  14323. this._sketchViewModel.sketchEditPickPolygonBody({
  14324. color: options2.color,
  14325. height: options2.height,
  14326. onComplete: options2.onComplete
  14327. });
  14328. },
  14329. removePolygonBody: function(onComplete) {
  14330. this._sketchViewModel.sketchRemovePickPolygonBody(onComplete);
  14331. }
  14332. });
  14333. CommonTools.RuntimeEnvironment = Object.freeze({
  14334. App: "app",
  14335. Web: "web"
  14336. });
  14337. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  14338. const handleEvent = (event2) => {
  14339. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event2);
  14340. if (checkForDefaultPrevented === false || !shouldPrevent) {
  14341. return oursHandler == null ? void 0 : oursHandler(event2);
  14342. }
  14343. };
  14344. return handleEvent;
  14345. };
  14346. var _a;
  14347. const isClient = typeof window !== "undefined";
  14348. const isString$1 = (val) => typeof val === "string";
  14349. const noop$3 = () => {
  14350. };
  14351. const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
  14352. function resolveUnref(r2) {
  14353. return typeof r2 === "function" ? r2() : unref(r2);
  14354. }
  14355. function identity(arg) {
  14356. return arg;
  14357. }
  14358. function tryOnScopeDispose(fn2) {
  14359. if (getCurrentScope()) {
  14360. onScopeDispose(fn2);
  14361. return true;
  14362. }
  14363. return false;
  14364. }
  14365. function tryOnMounted(fn2, sync = true) {
  14366. if (getCurrentInstance())
  14367. onMounted(fn2);
  14368. else if (sync)
  14369. fn2();
  14370. else
  14371. nextTick(fn2);
  14372. }
  14373. function useTimeoutFn(cb, interval, options2 = {}) {
  14374. const {
  14375. immediate = true
  14376. } = options2;
  14377. const isPending = ref(false);
  14378. let timer = null;
  14379. function clear() {
  14380. if (timer) {
  14381. clearTimeout(timer);
  14382. timer = null;
  14383. }
  14384. }
  14385. function stop() {
  14386. isPending.value = false;
  14387. clear();
  14388. }
  14389. function start2(...args) {
  14390. clear();
  14391. isPending.value = true;
  14392. timer = setTimeout(() => {
  14393. isPending.value = false;
  14394. timer = null;
  14395. cb(...args);
  14396. }, resolveUnref(interval));
  14397. }
  14398. if (immediate) {
  14399. isPending.value = true;
  14400. if (isClient)
  14401. start2();
  14402. }
  14403. tryOnScopeDispose(stop);
  14404. return {
  14405. isPending: readonly(isPending),
  14406. start: start2,
  14407. stop
  14408. };
  14409. }
  14410. function unrefElement(elRef) {
  14411. var _a2;
  14412. const plain = resolveUnref(elRef);
  14413. return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
  14414. }
  14415. const defaultWindow = isClient ? window : void 0;
  14416. function useEventListener(...args) {
  14417. let target;
  14418. let events;
  14419. let listeners;
  14420. let options2;
  14421. if (isString$1(args[0]) || Array.isArray(args[0])) {
  14422. [events, listeners, options2] = args;
  14423. target = defaultWindow;
  14424. } else {
  14425. [target, events, listeners, options2] = args;
  14426. }
  14427. if (!target)
  14428. return noop$3;
  14429. if (!Array.isArray(events))
  14430. events = [events];
  14431. if (!Array.isArray(listeners))
  14432. listeners = [listeners];
  14433. const cleanups = [];
  14434. const cleanup = () => {
  14435. cleanups.forEach((fn2) => fn2());
  14436. cleanups.length = 0;
  14437. };
  14438. const register = (el, event2, listener, options22) => {
  14439. el.addEventListener(event2, listener, options22);
  14440. return () => el.removeEventListener(event2, listener, options22);
  14441. };
  14442. const stopWatch = watch(() => [unrefElement(target), resolveUnref(options2)], ([el, options22]) => {
  14443. cleanup();
  14444. if (!el)
  14445. return;
  14446. cleanups.push(...events.flatMap((event2) => {
  14447. return listeners.map((listener) => register(el, event2, listener, options22));
  14448. }));
  14449. }, { immediate: true, flush: "post" });
  14450. const stop = () => {
  14451. stopWatch();
  14452. cleanup();
  14453. };
  14454. tryOnScopeDispose(stop);
  14455. return stop;
  14456. }
  14457. let _iOSWorkaround = false;
  14458. function onClickOutside(target, handler, options2 = {}) {
  14459. const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options2;
  14460. if (!window2)
  14461. return;
  14462. if (isIOS && !_iOSWorkaround) {
  14463. _iOSWorkaround = true;
  14464. Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$3));
  14465. }
  14466. let shouldListen = true;
  14467. const shouldIgnore = (event2) => {
  14468. return ignore.some((target2) => {
  14469. if (typeof target2 === "string") {
  14470. return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event2.target || event2.composedPath().includes(el));
  14471. } else {
  14472. const el = unrefElement(target2);
  14473. return el && (event2.target === el || event2.composedPath().includes(el));
  14474. }
  14475. });
  14476. };
  14477. const listener = (event2) => {
  14478. const el = unrefElement(target);
  14479. if (!el || el === event2.target || event2.composedPath().includes(el))
  14480. return;
  14481. if (event2.detail === 0)
  14482. shouldListen = !shouldIgnore(event2);
  14483. if (!shouldListen) {
  14484. shouldListen = true;
  14485. return;
  14486. }
  14487. handler(event2);
  14488. };
  14489. const cleanup = [
  14490. useEventListener(window2, "click", listener, { passive: true, capture }),
  14491. useEventListener(window2, "pointerdown", (e) => {
  14492. const el = unrefElement(target);
  14493. if (el)
  14494. shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
  14495. }, { passive: true }),
  14496. detectIframe && useEventListener(window2, "blur", (event2) => {
  14497. var _a2;
  14498. const el = unrefElement(target);
  14499. if (((_a2 = window2.document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
  14500. handler(event2);
  14501. })
  14502. ].filter(Boolean);
  14503. const stop = () => cleanup.forEach((fn2) => fn2());
  14504. return stop;
  14505. }
  14506. function useSupported(callback2, sync = false) {
  14507. const isSupported = ref();
  14508. const update = () => isSupported.value = Boolean(callback2());
  14509. update();
  14510. tryOnMounted(update, sync);
  14511. return isSupported;
  14512. }
  14513. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  14514. const globalKey = "__vueuse_ssr_handlers__";
  14515. _global[globalKey] = _global[globalKey] || {};
  14516. _global[globalKey];
  14517. var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
  14518. var __hasOwnProp$g = Object.prototype.hasOwnProperty;
  14519. var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
  14520. var __objRest$2 = (source, exclude) => {
  14521. var target = {};
  14522. for (var prop in source)
  14523. if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
  14524. target[prop] = source[prop];
  14525. if (source != null && __getOwnPropSymbols$g)
  14526. for (var prop of __getOwnPropSymbols$g(source)) {
  14527. if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
  14528. target[prop] = source[prop];
  14529. }
  14530. return target;
  14531. };
  14532. function useResizeObserver(target, callback2, options2 = {}) {
  14533. const _a2 = options2, { window: window2 = defaultWindow } = _a2, observerOptions = __objRest$2(_a2, ["window"]);
  14534. let observer;
  14535. const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
  14536. const cleanup = () => {
  14537. if (observer) {
  14538. observer.disconnect();
  14539. observer = void 0;
  14540. }
  14541. };
  14542. const stopWatch = watch(() => unrefElement(target), (el) => {
  14543. cleanup();
  14544. if (isSupported.value && window2 && el) {
  14545. observer = new ResizeObserver(callback2);
  14546. observer.observe(el, observerOptions);
  14547. }
  14548. }, { immediate: true, flush: "post" });
  14549. const stop = () => {
  14550. cleanup();
  14551. stopWatch();
  14552. };
  14553. tryOnScopeDispose(stop);
  14554. return {
  14555. isSupported,
  14556. stop
  14557. };
  14558. }
  14559. var SwipeDirection;
  14560. (function(SwipeDirection2) {
  14561. SwipeDirection2["UP"] = "UP";
  14562. SwipeDirection2["RIGHT"] = "RIGHT";
  14563. SwipeDirection2["DOWN"] = "DOWN";
  14564. SwipeDirection2["LEFT"] = "LEFT";
  14565. SwipeDirection2["NONE"] = "NONE";
  14566. })(SwipeDirection || (SwipeDirection = {}));
  14567. var __defProp2 = Object.defineProperty;
  14568. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  14569. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14570. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  14571. var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  14572. var __spreadValues = (a, b) => {
  14573. for (var prop in b || (b = {}))
  14574. if (__hasOwnProp.call(b, prop))
  14575. __defNormalProp2(a, prop, b[prop]);
  14576. if (__getOwnPropSymbols)
  14577. for (var prop of __getOwnPropSymbols(b)) {
  14578. if (__propIsEnum.call(b, prop))
  14579. __defNormalProp2(a, prop, b[prop]);
  14580. }
  14581. return a;
  14582. };
  14583. const _TransitionPresets = {
  14584. easeInSine: [0.12, 0, 0.39, 0],
  14585. easeOutSine: [0.61, 1, 0.88, 1],
  14586. easeInOutSine: [0.37, 0, 0.63, 1],
  14587. easeInQuad: [0.11, 0, 0.5, 0],
  14588. easeOutQuad: [0.5, 1, 0.89, 1],
  14589. easeInOutQuad: [0.45, 0, 0.55, 1],
  14590. easeInCubic: [0.32, 0, 0.67, 0],
  14591. easeOutCubic: [0.33, 1, 0.68, 1],
  14592. easeInOutCubic: [0.65, 0, 0.35, 1],
  14593. easeInQuart: [0.5, 0, 0.75, 0],
  14594. easeOutQuart: [0.25, 1, 0.5, 1],
  14595. easeInOutQuart: [0.76, 0, 0.24, 1],
  14596. easeInQuint: [0.64, 0, 0.78, 0],
  14597. easeOutQuint: [0.22, 1, 0.36, 1],
  14598. easeInOutQuint: [0.83, 0, 0.17, 1],
  14599. easeInExpo: [0.7, 0, 0.84, 0],
  14600. easeOutExpo: [0.16, 1, 0.3, 1],
  14601. easeInOutExpo: [0.87, 0, 0.13, 1],
  14602. easeInCirc: [0.55, 0, 1, 0.45],
  14603. easeOutCirc: [0, 0.55, 0.45, 1],
  14604. easeInOutCirc: [0.85, 0, 0.15, 1],
  14605. easeInBack: [0.36, 0, 0.66, -0.56],
  14606. easeOutBack: [0.34, 1.56, 0.64, 1],
  14607. easeInOutBack: [0.68, -0.6, 0.32, 1.6]
  14608. };
  14609. __spreadValues({
  14610. linear: identity
  14611. }, _TransitionPresets);
  14612. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  14613. const getClientXY = (event2) => {
  14614. let clientX;
  14615. let clientY;
  14616. if (event2.type === "touchend") {
  14617. clientY = event2.changedTouches[0].clientY;
  14618. clientX = event2.changedTouches[0].clientX;
  14619. } else if (event2.type.startsWith("touch")) {
  14620. clientY = event2.touches[0].clientY;
  14621. clientX = event2.touches[0].clientX;
  14622. } else {
  14623. clientY = event2.clientY;
  14624. clientX = event2.clientX;
  14625. }
  14626. return {
  14627. clientX,
  14628. clientY
  14629. };
  14630. };
  14631. const NOOP = () => {
  14632. };
  14633. const hasOwnProperty$9 = Object.prototype.hasOwnProperty;
  14634. const hasOwn = (val, key) => hasOwnProperty$9.call(val, key);
  14635. const isArray$2 = Array.isArray;
  14636. const isFunction$3 = (val) => typeof val === "function";
  14637. const isString = (val) => typeof val === "string";
  14638. const isObject$5 = (val) => val !== null && typeof val === "object";
  14639. const isPromise$2 = (val) => {
  14640. return isObject$5(val) && isFunction$3(val.then) && isFunction$3(val.catch);
  14641. };
  14642. const objectToString$1 = Object.prototype.toString;
  14643. const toTypeString = (value) => objectToString$1.call(value);
  14644. const toRawType = (value) => {
  14645. return toTypeString(value).slice(8, -1);
  14646. };
  14647. const cacheStringFunction = (fn2) => {
  14648. const cache = /* @__PURE__ */ Object.create(null);
  14649. return (str) => {
  14650. const hit = cache[str];
  14651. return hit || (cache[str] = fn2(str));
  14652. };
  14653. };
  14654. const camelizeRE = /-(\w)/g;
  14655. const camelize = cacheStringFunction((str) => {
  14656. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  14657. });
  14658. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  14659. var freeGlobal$1 = freeGlobal;
  14660. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  14661. var root = freeGlobal$1 || freeSelf || Function("return this")();
  14662. var root$1 = root;
  14663. var Symbol$1 = root$1.Symbol;
  14664. var Symbol$2 = Symbol$1;
  14665. var objectProto$b = Object.prototype;
  14666. var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
  14667. var nativeObjectToString$1 = objectProto$b.toString;
  14668. var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14669. function getRawTag(value) {
  14670. var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  14671. try {
  14672. value[symToStringTag$1] = void 0;
  14673. var unmasked = true;
  14674. } catch (e) {
  14675. }
  14676. var result = nativeObjectToString$1.call(value);
  14677. if (unmasked) {
  14678. if (isOwn) {
  14679. value[symToStringTag$1] = tag;
  14680. } else {
  14681. delete value[symToStringTag$1];
  14682. }
  14683. }
  14684. return result;
  14685. }
  14686. var objectProto$a = Object.prototype;
  14687. var nativeObjectToString = objectProto$a.toString;
  14688. function objectToString(value) {
  14689. return nativeObjectToString.call(value);
  14690. }
  14691. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  14692. var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14693. function baseGetTag(value) {
  14694. if (value == null) {
  14695. return value === void 0 ? undefinedTag : nullTag;
  14696. }
  14697. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  14698. }
  14699. function isObjectLike(value) {
  14700. return value != null && typeof value == "object";
  14701. }
  14702. var symbolTag$1 = "[object Symbol]";
  14703. function isSymbol(value) {
  14704. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
  14705. }
  14706. function arrayMap(array, iteratee) {
  14707. var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
  14708. while (++index2 < length) {
  14709. result[index2] = iteratee(array[index2], index2, array);
  14710. }
  14711. return result;
  14712. }
  14713. var isArray = Array.isArray;
  14714. var isArray$1 = isArray;
  14715. var INFINITY$1 = 1 / 0;
  14716. var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
  14717. function baseToString(value) {
  14718. if (typeof value == "string") {
  14719. return value;
  14720. }
  14721. if (isArray$1(value)) {
  14722. return arrayMap(value, baseToString) + "";
  14723. }
  14724. if (isSymbol(value)) {
  14725. return symbolToString ? symbolToString.call(value) : "";
  14726. }
  14727. var result = value + "";
  14728. return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
  14729. }
  14730. var reWhitespace = /\s/;
  14731. function trimmedEndIndex(string) {
  14732. var index2 = string.length;
  14733. while (index2-- && reWhitespace.test(string.charAt(index2))) {
  14734. }
  14735. return index2;
  14736. }
  14737. var reTrimStart = /^\s+/;
  14738. function baseTrim(string) {
  14739. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  14740. }
  14741. function isObject$4(value) {
  14742. var type2 = typeof value;
  14743. return value != null && (type2 == "object" || type2 == "function");
  14744. }
  14745. var NAN = 0 / 0;
  14746. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  14747. var reIsBinary = /^0b[01]+$/i;
  14748. var reIsOctal = /^0o[0-7]+$/i;
  14749. var freeParseInt = parseInt;
  14750. function toNumber(value) {
  14751. if (typeof value == "number") {
  14752. return value;
  14753. }
  14754. if (isSymbol(value)) {
  14755. return NAN;
  14756. }
  14757. if (isObject$4(value)) {
  14758. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  14759. value = isObject$4(other) ? other + "" : other;
  14760. }
  14761. if (typeof value != "string") {
  14762. return value === 0 ? value : +value;
  14763. }
  14764. value = baseTrim(value);
  14765. var isBinary = reIsBinary.test(value);
  14766. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  14767. }
  14768. var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  14769. function isFunction$2(value) {
  14770. if (!isObject$4(value)) {
  14771. return false;
  14772. }
  14773. var tag = baseGetTag(value);
  14774. return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
  14775. }
  14776. var coreJsData = root$1["__core-js_shared__"];
  14777. var coreJsData$1 = coreJsData;
  14778. var maskSrcKey = function() {
  14779. var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
  14780. return uid ? "Symbol(src)_1." + uid : "";
  14781. }();
  14782. function isMasked(func) {
  14783. return !!maskSrcKey && maskSrcKey in func;
  14784. }
  14785. var funcProto$1 = Function.prototype;
  14786. var funcToString$1 = funcProto$1.toString;
  14787. function toSource(func) {
  14788. if (func != null) {
  14789. try {
  14790. return funcToString$1.call(func);
  14791. } catch (e) {
  14792. }
  14793. try {
  14794. return func + "";
  14795. } catch (e) {
  14796. }
  14797. }
  14798. return "";
  14799. }
  14800. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  14801. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  14802. var funcProto = Function.prototype, objectProto$9 = Object.prototype;
  14803. var funcToString = funcProto.toString;
  14804. var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
  14805. var reIsNative = RegExp(
  14806. "^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  14807. );
  14808. function baseIsNative(value) {
  14809. if (!isObject$4(value) || isMasked(value)) {
  14810. return false;
  14811. }
  14812. var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
  14813. return pattern.test(toSource(value));
  14814. }
  14815. function getValue(object, key) {
  14816. return object == null ? void 0 : object[key];
  14817. }
  14818. function getNative(object, key) {
  14819. var value = getValue(object, key);
  14820. return baseIsNative(value) ? value : void 0;
  14821. }
  14822. var WeakMap$1 = getNative(root$1, "WeakMap");
  14823. var WeakMap$2 = WeakMap$1;
  14824. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  14825. var reIsUint = /^(?:0|[1-9]\d*)$/;
  14826. function isIndex(value, length) {
  14827. var type2 = typeof value;
  14828. length = length == null ? MAX_SAFE_INTEGER$1 : length;
  14829. return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  14830. }
  14831. function eq(value, other) {
  14832. return value === other || value !== value && other !== other;
  14833. }
  14834. var MAX_SAFE_INTEGER = 9007199254740991;
  14835. function isLength(value) {
  14836. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  14837. }
  14838. function isArrayLike(value) {
  14839. return value != null && isLength(value.length) && !isFunction$2(value);
  14840. }
  14841. var objectProto$8 = Object.prototype;
  14842. function isPrototype(value) {
  14843. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$8;
  14844. return value === proto;
  14845. }
  14846. function baseTimes(n, iteratee) {
  14847. var index2 = -1, result = Array(n);
  14848. while (++index2 < n) {
  14849. result[index2] = iteratee(index2);
  14850. }
  14851. return result;
  14852. }
  14853. var argsTag$2 = "[object Arguments]";
  14854. function baseIsArguments(value) {
  14855. return isObjectLike(value) && baseGetTag(value) == argsTag$2;
  14856. }
  14857. var objectProto$7 = Object.prototype;
  14858. var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
  14859. var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
  14860. var isArguments = baseIsArguments(function() {
  14861. return arguments;
  14862. }()) ? baseIsArguments : function(value) {
  14863. return isObjectLike(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  14864. };
  14865. var isArguments$1 = isArguments;
  14866. function stubFalse() {
  14867. return false;
  14868. }
  14869. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  14870. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  14871. var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
  14872. var Buffer$1 = moduleExports$1 ? root$1.Buffer : void 0;
  14873. var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
  14874. var isBuffer = nativeIsBuffer || stubFalse;
  14875. var isBuffer$1 = isBuffer;
  14876. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
  14877. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  14878. var typedArrayTags = {};
  14879. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  14880. typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
  14881. function baseIsTypedArray(value) {
  14882. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  14883. }
  14884. function baseUnary(func) {
  14885. return function(value) {
  14886. return func(value);
  14887. };
  14888. }
  14889. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  14890. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  14891. var moduleExports = freeModule && freeModule.exports === freeExports;
  14892. var freeProcess = moduleExports && freeGlobal$1.process;
  14893. var nodeUtil = function() {
  14894. try {
  14895. var types = freeModule && freeModule.require && freeModule.require("util").types;
  14896. if (types) {
  14897. return types;
  14898. }
  14899. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  14900. } catch (e) {
  14901. }
  14902. }();
  14903. var nodeUtil$1 = nodeUtil;
  14904. var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
  14905. var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  14906. var isTypedArray$3 = isTypedArray$2;
  14907. var objectProto$6 = Object.prototype;
  14908. var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
  14909. function arrayLikeKeys(value, inherited) {
  14910. var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$3(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  14911. for (var key in value) {
  14912. if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
  14913. result.push(key);
  14914. }
  14915. }
  14916. return result;
  14917. }
  14918. function overArg(func, transform3) {
  14919. return function(arg) {
  14920. return func(transform3(arg));
  14921. };
  14922. }
  14923. var nativeKeys = overArg(Object.keys, Object);
  14924. var nativeKeys$1 = nativeKeys;
  14925. var objectProto$5 = Object.prototype;
  14926. var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
  14927. function baseKeys(object) {
  14928. if (!isPrototype(object)) {
  14929. return nativeKeys$1(object);
  14930. }
  14931. var result = [];
  14932. for (var key in Object(object)) {
  14933. if (hasOwnProperty$4.call(object, key) && key != "constructor") {
  14934. result.push(key);
  14935. }
  14936. }
  14937. return result;
  14938. }
  14939. function keys$2(object) {
  14940. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14941. }
  14942. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
  14943. function isKey(value, object) {
  14944. if (isArray$1(value)) {
  14945. return false;
  14946. }
  14947. var type2 = typeof value;
  14948. if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol(value)) {
  14949. return true;
  14950. }
  14951. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  14952. }
  14953. var nativeCreate = getNative(Object, "create");
  14954. var nativeCreate$1 = nativeCreate;
  14955. function hashClear() {
  14956. this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
  14957. this.size = 0;
  14958. }
  14959. function hashDelete(key) {
  14960. var result = this.has(key) && delete this.__data__[key];
  14961. this.size -= result ? 1 : 0;
  14962. return result;
  14963. }
  14964. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  14965. var objectProto$4 = Object.prototype;
  14966. var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
  14967. function hashGet(key) {
  14968. var data = this.__data__;
  14969. if (nativeCreate$1) {
  14970. var result = data[key];
  14971. return result === HASH_UNDEFINED$2 ? void 0 : result;
  14972. }
  14973. return hasOwnProperty$3.call(data, key) ? data[key] : void 0;
  14974. }
  14975. var objectProto$3 = Object.prototype;
  14976. var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
  14977. function hashHas(key) {
  14978. var data = this.__data__;
  14979. return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$2.call(data, key);
  14980. }
  14981. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  14982. function hashSet(key, value) {
  14983. var data = this.__data__;
  14984. this.size += this.has(key) ? 0 : 1;
  14985. data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
  14986. return this;
  14987. }
  14988. function Hash(entries) {
  14989. var index2 = -1, length = entries == null ? 0 : entries.length;
  14990. this.clear();
  14991. while (++index2 < length) {
  14992. var entry = entries[index2];
  14993. this.set(entry[0], entry[1]);
  14994. }
  14995. }
  14996. Hash.prototype.clear = hashClear;
  14997. Hash.prototype["delete"] = hashDelete;
  14998. Hash.prototype.get = hashGet;
  14999. Hash.prototype.has = hashHas;
  15000. Hash.prototype.set = hashSet;
  15001. function listCacheClear() {
  15002. this.__data__ = [];
  15003. this.size = 0;
  15004. }
  15005. function assocIndexOf(array, key) {
  15006. var length = array.length;
  15007. while (length--) {
  15008. if (eq(array[length][0], key)) {
  15009. return length;
  15010. }
  15011. }
  15012. return -1;
  15013. }
  15014. var arrayProto = Array.prototype;
  15015. var splice = arrayProto.splice;
  15016. function listCacheDelete(key) {
  15017. var data = this.__data__, index2 = assocIndexOf(data, key);
  15018. if (index2 < 0) {
  15019. return false;
  15020. }
  15021. var lastIndex = data.length - 1;
  15022. if (index2 == lastIndex) {
  15023. data.pop();
  15024. } else {
  15025. splice.call(data, index2, 1);
  15026. }
  15027. --this.size;
  15028. return true;
  15029. }
  15030. function listCacheGet(key) {
  15031. var data = this.__data__, index2 = assocIndexOf(data, key);
  15032. return index2 < 0 ? void 0 : data[index2][1];
  15033. }
  15034. function listCacheHas(key) {
  15035. return assocIndexOf(this.__data__, key) > -1;
  15036. }
  15037. function listCacheSet(key, value) {
  15038. var data = this.__data__, index2 = assocIndexOf(data, key);
  15039. if (index2 < 0) {
  15040. ++this.size;
  15041. data.push([key, value]);
  15042. } else {
  15043. data[index2][1] = value;
  15044. }
  15045. return this;
  15046. }
  15047. function ListCache(entries) {
  15048. var index2 = -1, length = entries == null ? 0 : entries.length;
  15049. this.clear();
  15050. while (++index2 < length) {
  15051. var entry = entries[index2];
  15052. this.set(entry[0], entry[1]);
  15053. }
  15054. }
  15055. ListCache.prototype.clear = listCacheClear;
  15056. ListCache.prototype["delete"] = listCacheDelete;
  15057. ListCache.prototype.get = listCacheGet;
  15058. ListCache.prototype.has = listCacheHas;
  15059. ListCache.prototype.set = listCacheSet;
  15060. var Map$2 = getNative(root$1, "Map");
  15061. var Map$3 = Map$2;
  15062. function mapCacheClear() {
  15063. this.size = 0;
  15064. this.__data__ = {
  15065. "hash": new Hash(),
  15066. "map": new (Map$3 || ListCache)(),
  15067. "string": new Hash()
  15068. };
  15069. }
  15070. function isKeyable(value) {
  15071. var type2 = typeof value;
  15072. return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
  15073. }
  15074. function getMapData(map, key) {
  15075. var data = map.__data__;
  15076. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  15077. }
  15078. function mapCacheDelete(key) {
  15079. var result = getMapData(this, key)["delete"](key);
  15080. this.size -= result ? 1 : 0;
  15081. return result;
  15082. }
  15083. function mapCacheGet(key) {
  15084. return getMapData(this, key).get(key);
  15085. }
  15086. function mapCacheHas(key) {
  15087. return getMapData(this, key).has(key);
  15088. }
  15089. function mapCacheSet(key, value) {
  15090. var data = getMapData(this, key), size = data.size;
  15091. data.set(key, value);
  15092. this.size += data.size == size ? 0 : 1;
  15093. return this;
  15094. }
  15095. function MapCache(entries) {
  15096. var index2 = -1, length = entries == null ? 0 : entries.length;
  15097. this.clear();
  15098. while (++index2 < length) {
  15099. var entry = entries[index2];
  15100. this.set(entry[0], entry[1]);
  15101. }
  15102. }
  15103. MapCache.prototype.clear = mapCacheClear;
  15104. MapCache.prototype["delete"] = mapCacheDelete;
  15105. MapCache.prototype.get = mapCacheGet;
  15106. MapCache.prototype.has = mapCacheHas;
  15107. MapCache.prototype.set = mapCacheSet;
  15108. var FUNC_ERROR_TEXT$1 = "Expected a function";
  15109. function memoize(func, resolver) {
  15110. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  15111. throw new TypeError(FUNC_ERROR_TEXT$1);
  15112. }
  15113. var memoized = function() {
  15114. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  15115. if (cache.has(key)) {
  15116. return cache.get(key);
  15117. }
  15118. var result = func.apply(this, args);
  15119. memoized.cache = cache.set(key, result) || cache;
  15120. return result;
  15121. };
  15122. memoized.cache = new (memoize.Cache || MapCache)();
  15123. return memoized;
  15124. }
  15125. memoize.Cache = MapCache;
  15126. var MAX_MEMOIZE_SIZE = 500;
  15127. function memoizeCapped(func) {
  15128. var result = memoize(func, function(key) {
  15129. if (cache.size === MAX_MEMOIZE_SIZE) {
  15130. cache.clear();
  15131. }
  15132. return key;
  15133. });
  15134. var cache = result.cache;
  15135. return result;
  15136. }
  15137. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  15138. var reEscapeChar = /\\(\\)?/g;
  15139. var stringToPath = memoizeCapped(function(string) {
  15140. var result = [];
  15141. if (string.charCodeAt(0) === 46) {
  15142. result.push("");
  15143. }
  15144. string.replace(rePropName, function(match, number, quote, subString) {
  15145. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  15146. });
  15147. return result;
  15148. });
  15149. var stringToPath$1 = stringToPath;
  15150. function toString$3(value) {
  15151. return value == null ? "" : baseToString(value);
  15152. }
  15153. function castPath(value, object) {
  15154. if (isArray$1(value)) {
  15155. return value;
  15156. }
  15157. return isKey(value, object) ? [value] : stringToPath$1(toString$3(value));
  15158. }
  15159. var INFINITY = 1 / 0;
  15160. function toKey(value) {
  15161. if (typeof value == "string" || isSymbol(value)) {
  15162. return value;
  15163. }
  15164. var result = value + "";
  15165. return result == "0" && 1 / value == -INFINITY ? "-0" : result;
  15166. }
  15167. function baseGet(object, path) {
  15168. path = castPath(path, object);
  15169. var index2 = 0, length = path.length;
  15170. while (object != null && index2 < length) {
  15171. object = object[toKey(path[index2++])];
  15172. }
  15173. return index2 && index2 == length ? object : void 0;
  15174. }
  15175. function get$2(object, path, defaultValue2) {
  15176. var result = object == null ? void 0 : baseGet(object, path);
  15177. return result === void 0 ? defaultValue2 : result;
  15178. }
  15179. function arrayPush(array, values3) {
  15180. var index2 = -1, length = values3.length, offset = array.length;
  15181. while (++index2 < length) {
  15182. array[offset + index2] = values3[index2];
  15183. }
  15184. return array;
  15185. }
  15186. function castArray() {
  15187. if (!arguments.length) {
  15188. return [];
  15189. }
  15190. var value = arguments[0];
  15191. return isArray$1(value) ? value : [value];
  15192. }
  15193. function stackClear() {
  15194. this.__data__ = new ListCache();
  15195. this.size = 0;
  15196. }
  15197. function stackDelete(key) {
  15198. var data = this.__data__, result = data["delete"](key);
  15199. this.size = data.size;
  15200. return result;
  15201. }
  15202. function stackGet(key) {
  15203. return this.__data__.get(key);
  15204. }
  15205. function stackHas(key) {
  15206. return this.__data__.has(key);
  15207. }
  15208. var LARGE_ARRAY_SIZE = 200;
  15209. function stackSet(key, value) {
  15210. var data = this.__data__;
  15211. if (data instanceof ListCache) {
  15212. var pairs = data.__data__;
  15213. if (!Map$3 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  15214. pairs.push([key, value]);
  15215. this.size = ++data.size;
  15216. return this;
  15217. }
  15218. data = this.__data__ = new MapCache(pairs);
  15219. }
  15220. data.set(key, value);
  15221. this.size = data.size;
  15222. return this;
  15223. }
  15224. function Stack(entries) {
  15225. var data = this.__data__ = new ListCache(entries);
  15226. this.size = data.size;
  15227. }
  15228. Stack.prototype.clear = stackClear;
  15229. Stack.prototype["delete"] = stackDelete;
  15230. Stack.prototype.get = stackGet;
  15231. Stack.prototype.has = stackHas;
  15232. Stack.prototype.set = stackSet;
  15233. function arrayFilter(array, predicate) {
  15234. var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  15235. while (++index2 < length) {
  15236. var value = array[index2];
  15237. if (predicate(value, index2, array)) {
  15238. result[resIndex++] = value;
  15239. }
  15240. }
  15241. return result;
  15242. }
  15243. function stubArray() {
  15244. return [];
  15245. }
  15246. var objectProto$2 = Object.prototype;
  15247. var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
  15248. var nativeGetSymbols = Object.getOwnPropertySymbols;
  15249. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  15250. if (object == null) {
  15251. return [];
  15252. }
  15253. object = Object(object);
  15254. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  15255. return propertyIsEnumerable.call(object, symbol);
  15256. });
  15257. };
  15258. var getSymbols$1 = getSymbols;
  15259. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  15260. var result = keysFunc(object);
  15261. return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
  15262. }
  15263. function getAllKeys(object) {
  15264. return baseGetAllKeys(object, keys$2, getSymbols$1);
  15265. }
  15266. var DataView$1 = getNative(root$1, "DataView");
  15267. var DataView$2 = DataView$1;
  15268. var Promise$1 = getNative(root$1, "Promise");
  15269. var Promise$2 = Promise$1;
  15270. var Set$2 = getNative(root$1, "Set");
  15271. var Set$3 = Set$2;
  15272. var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
  15273. var dataViewTag$1 = "[object DataView]";
  15274. var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$3), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$3), weakMapCtorString = toSource(WeakMap$2);
  15275. var getTag = baseGetTag;
  15276. if (DataView$2 && getTag(new DataView$2(new ArrayBuffer(1))) != dataViewTag$1 || Map$3 && getTag(new Map$3()) != mapTag$1 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$3 && getTag(new Set$3()) != setTag$1 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag) {
  15277. getTag = function(value) {
  15278. var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  15279. if (ctorString) {
  15280. switch (ctorString) {
  15281. case dataViewCtorString:
  15282. return dataViewTag$1;
  15283. case mapCtorString:
  15284. return mapTag$1;
  15285. case promiseCtorString:
  15286. return promiseTag;
  15287. case setCtorString:
  15288. return setTag$1;
  15289. case weakMapCtorString:
  15290. return weakMapTag;
  15291. }
  15292. }
  15293. return result;
  15294. };
  15295. }
  15296. var getTag$1 = getTag;
  15297. var Uint8Array$1 = root$1.Uint8Array;
  15298. var Uint8Array$2 = Uint8Array$1;
  15299. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  15300. function setCacheAdd(value) {
  15301. this.__data__.set(value, HASH_UNDEFINED);
  15302. return this;
  15303. }
  15304. function setCacheHas(value) {
  15305. return this.__data__.has(value);
  15306. }
  15307. function SetCache(values3) {
  15308. var index2 = -1, length = values3 == null ? 0 : values3.length;
  15309. this.__data__ = new MapCache();
  15310. while (++index2 < length) {
  15311. this.add(values3[index2]);
  15312. }
  15313. }
  15314. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  15315. SetCache.prototype.has = setCacheHas;
  15316. function arraySome(array, predicate) {
  15317. var index2 = -1, length = array == null ? 0 : array.length;
  15318. while (++index2 < length) {
  15319. if (predicate(array[index2], index2, array)) {
  15320. return true;
  15321. }
  15322. }
  15323. return false;
  15324. }
  15325. function cacheHas(cache, key) {
  15326. return cache.has(key);
  15327. }
  15328. var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  15329. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  15330. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
  15331. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  15332. return false;
  15333. }
  15334. var arrStacked = stack.get(array);
  15335. var othStacked = stack.get(other);
  15336. if (arrStacked && othStacked) {
  15337. return arrStacked == other && othStacked == array;
  15338. }
  15339. var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
  15340. stack.set(array, other);
  15341. stack.set(other, array);
  15342. while (++index2 < arrLength) {
  15343. var arrValue = array[index2], othValue = other[index2];
  15344. if (customizer) {
  15345. var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
  15346. }
  15347. if (compared !== void 0) {
  15348. if (compared) {
  15349. continue;
  15350. }
  15351. result = false;
  15352. break;
  15353. }
  15354. if (seen) {
  15355. if (!arraySome(other, function(othValue2, othIndex) {
  15356. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  15357. return seen.push(othIndex);
  15358. }
  15359. })) {
  15360. result = false;
  15361. break;
  15362. }
  15363. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  15364. result = false;
  15365. break;
  15366. }
  15367. }
  15368. stack["delete"](array);
  15369. stack["delete"](other);
  15370. return result;
  15371. }
  15372. function mapToArray(map) {
  15373. var index2 = -1, result = Array(map.size);
  15374. map.forEach(function(value, key) {
  15375. result[++index2] = [key, value];
  15376. });
  15377. return result;
  15378. }
  15379. function setToArray(set4) {
  15380. var index2 = -1, result = Array(set4.size);
  15381. set4.forEach(function(value) {
  15382. result[++index2] = value;
  15383. });
  15384. return result;
  15385. }
  15386. var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
  15387. var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
  15388. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
  15389. var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  15390. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  15391. switch (tag) {
  15392. case dataViewTag:
  15393. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  15394. return false;
  15395. }
  15396. object = object.buffer;
  15397. other = other.buffer;
  15398. case arrayBufferTag:
  15399. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object), new Uint8Array$2(other))) {
  15400. return false;
  15401. }
  15402. return true;
  15403. case boolTag:
  15404. case dateTag:
  15405. case numberTag:
  15406. return eq(+object, +other);
  15407. case errorTag:
  15408. return object.name == other.name && object.message == other.message;
  15409. case regexpTag:
  15410. case stringTag:
  15411. return object == other + "";
  15412. case mapTag:
  15413. var convert = mapToArray;
  15414. case setTag:
  15415. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
  15416. convert || (convert = setToArray);
  15417. if (object.size != other.size && !isPartial) {
  15418. return false;
  15419. }
  15420. var stacked = stack.get(object);
  15421. if (stacked) {
  15422. return stacked == other;
  15423. }
  15424. bitmask |= COMPARE_UNORDERED_FLAG;
  15425. stack.set(object, other);
  15426. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  15427. stack["delete"](object);
  15428. return result;
  15429. case symbolTag:
  15430. if (symbolValueOf) {
  15431. return symbolValueOf.call(object) == symbolValueOf.call(other);
  15432. }
  15433. }
  15434. return false;
  15435. }
  15436. var COMPARE_PARTIAL_FLAG$1 = 1;
  15437. var objectProto$1 = Object.prototype;
  15438. var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
  15439. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  15440. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  15441. if (objLength != othLength && !isPartial) {
  15442. return false;
  15443. }
  15444. var index2 = objLength;
  15445. while (index2--) {
  15446. var key = objProps[index2];
  15447. if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
  15448. return false;
  15449. }
  15450. }
  15451. var objStacked = stack.get(object);
  15452. var othStacked = stack.get(other);
  15453. if (objStacked && othStacked) {
  15454. return objStacked == other && othStacked == object;
  15455. }
  15456. var result = true;
  15457. stack.set(object, other);
  15458. stack.set(other, object);
  15459. var skipCtor = isPartial;
  15460. while (++index2 < objLength) {
  15461. key = objProps[index2];
  15462. var objValue = object[key], othValue = other[key];
  15463. if (customizer) {
  15464. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  15465. }
  15466. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  15467. result = false;
  15468. break;
  15469. }
  15470. skipCtor || (skipCtor = key == "constructor");
  15471. }
  15472. if (result && !skipCtor) {
  15473. var objCtor = object.constructor, othCtor = other.constructor;
  15474. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  15475. result = false;
  15476. }
  15477. }
  15478. stack["delete"](object);
  15479. stack["delete"](other);
  15480. return result;
  15481. }
  15482. var COMPARE_PARTIAL_FLAG = 1;
  15483. var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  15484. var objectProto = Object.prototype;
  15485. var hasOwnProperty = objectProto.hasOwnProperty;
  15486. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  15487. var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
  15488. objTag = objTag == argsTag ? objectTag : objTag;
  15489. othTag = othTag == argsTag ? objectTag : othTag;
  15490. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  15491. if (isSameTag && isBuffer$1(object)) {
  15492. if (!isBuffer$1(other)) {
  15493. return false;
  15494. }
  15495. objIsArr = true;
  15496. objIsObj = false;
  15497. }
  15498. if (isSameTag && !objIsObj) {
  15499. stack || (stack = new Stack());
  15500. return objIsArr || isTypedArray$3(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  15501. }
  15502. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  15503. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  15504. if (objIsWrapped || othIsWrapped) {
  15505. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  15506. stack || (stack = new Stack());
  15507. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  15508. }
  15509. }
  15510. if (!isSameTag) {
  15511. return false;
  15512. }
  15513. stack || (stack = new Stack());
  15514. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  15515. }
  15516. function baseIsEqual(value, other, bitmask, customizer, stack) {
  15517. if (value === other) {
  15518. return true;
  15519. }
  15520. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  15521. return value !== value && other !== other;
  15522. }
  15523. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  15524. }
  15525. var now = function() {
  15526. return root$1.Date.now();
  15527. };
  15528. var now$1 = now;
  15529. var FUNC_ERROR_TEXT = "Expected a function";
  15530. var nativeMax = Math.max, nativeMin = Math.min;
  15531. function debounce$2(func, wait, options2) {
  15532. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  15533. if (typeof func != "function") {
  15534. throw new TypeError(FUNC_ERROR_TEXT);
  15535. }
  15536. wait = toNumber(wait) || 0;
  15537. if (isObject$4(options2)) {
  15538. leading = !!options2.leading;
  15539. maxing = "maxWait" in options2;
  15540. maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
  15541. trailing = "trailing" in options2 ? !!options2.trailing : trailing;
  15542. }
  15543. function invokeFunc(time) {
  15544. var args = lastArgs, thisArg = lastThis;
  15545. lastArgs = lastThis = void 0;
  15546. lastInvokeTime = time;
  15547. result = func.apply(thisArg, args);
  15548. return result;
  15549. }
  15550. function leadingEdge(time) {
  15551. lastInvokeTime = time;
  15552. timerId = setTimeout(timerExpired, wait);
  15553. return leading ? invokeFunc(time) : result;
  15554. }
  15555. function remainingWait(time) {
  15556. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  15557. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  15558. }
  15559. function shouldInvoke(time) {
  15560. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  15561. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  15562. }
  15563. function timerExpired() {
  15564. var time = now$1();
  15565. if (shouldInvoke(time)) {
  15566. return trailingEdge(time);
  15567. }
  15568. timerId = setTimeout(timerExpired, remainingWait(time));
  15569. }
  15570. function trailingEdge(time) {
  15571. timerId = void 0;
  15572. if (trailing && lastArgs) {
  15573. return invokeFunc(time);
  15574. }
  15575. lastArgs = lastThis = void 0;
  15576. return result;
  15577. }
  15578. function cancel() {
  15579. if (timerId !== void 0) {
  15580. clearTimeout(timerId);
  15581. }
  15582. lastInvokeTime = 0;
  15583. lastArgs = lastCallTime = lastThis = timerId = void 0;
  15584. }
  15585. function flush() {
  15586. return timerId === void 0 ? result : trailingEdge(now$1());
  15587. }
  15588. function debounced() {
  15589. var time = now$1(), isInvoking = shouldInvoke(time);
  15590. lastArgs = arguments;
  15591. lastThis = this;
  15592. lastCallTime = time;
  15593. if (isInvoking) {
  15594. if (timerId === void 0) {
  15595. return leadingEdge(lastCallTime);
  15596. }
  15597. if (maxing) {
  15598. clearTimeout(timerId);
  15599. timerId = setTimeout(timerExpired, wait);
  15600. return invokeFunc(lastCallTime);
  15601. }
  15602. }
  15603. if (timerId === void 0) {
  15604. timerId = setTimeout(timerExpired, wait);
  15605. }
  15606. return result;
  15607. }
  15608. debounced.cancel = cancel;
  15609. debounced.flush = flush;
  15610. return debounced;
  15611. }
  15612. function fromPairs(pairs) {
  15613. var index2 = -1, length = pairs == null ? 0 : pairs.length, result = {};
  15614. while (++index2 < length) {
  15615. var pair = pairs[index2];
  15616. result[pair[0]] = pair[1];
  15617. }
  15618. return result;
  15619. }
  15620. function isEqual(value, other) {
  15621. return baseIsEqual(value, other);
  15622. }
  15623. function isNil(value) {
  15624. return value == null;
  15625. }
  15626. function isUndefined$1(value) {
  15627. return value === void 0;
  15628. }
  15629. const isUndefined = (val) => val === void 0;
  15630. const isBoolean = (val) => typeof val === "boolean";
  15631. const isNumber = (val) => typeof val === "number";
  15632. const isElement = (e) => {
  15633. if (typeof Element === "undefined")
  15634. return false;
  15635. return e instanceof Element;
  15636. };
  15637. const isStringNumber = (val) => {
  15638. if (!isString(val)) {
  15639. return false;
  15640. }
  15641. return !Number.isNaN(Number(val));
  15642. };
  15643. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  15644. const keysOf = (arr) => Object.keys(arr);
  15645. class ElementPlusError extends Error {
  15646. constructor(m) {
  15647. super(m);
  15648. this.name = "ElementPlusError";
  15649. }
  15650. }
  15651. function throwError(scope, m) {
  15652. throw new ElementPlusError(`[${scope}] ${m}`);
  15653. }
  15654. function debugWarn(scope, message) {
  15655. }
  15656. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  15657. const hasClass$2 = (el, cls) => {
  15658. if (!el || !cls)
  15659. return false;
  15660. if (cls.includes(" "))
  15661. throw new Error("className should not contain space.");
  15662. return el.classList.contains(cls);
  15663. };
  15664. const addClass$2 = (el, cls) => {
  15665. if (!el || !cls.trim())
  15666. return;
  15667. el.classList.add(...classNameToArray(cls));
  15668. };
  15669. const removeClass$2 = (el, cls) => {
  15670. if (!el || !cls.trim())
  15671. return;
  15672. el.classList.remove(...classNameToArray(cls));
  15673. };
  15674. const getStyle = (element, styleName) => {
  15675. var _a2;
  15676. if (!isClient || !element || !styleName)
  15677. return "";
  15678. let key = camelize(styleName);
  15679. if (key === "float")
  15680. key = "cssFloat";
  15681. try {
  15682. const style = element.style[key];
  15683. if (style)
  15684. return style;
  15685. const computed2 = (_a2 = document.defaultView) == null ? void 0 : _a2.getComputedStyle(element, "");
  15686. return computed2 ? computed2[key] : "";
  15687. } catch (e) {
  15688. return element.style[key];
  15689. }
  15690. };
  15691. function addUnit(value, defaultUnit = "px") {
  15692. if (!value)
  15693. return "";
  15694. if (isNumber(value) || isStringNumber(value)) {
  15695. return `${value}${defaultUnit}`;
  15696. } else if (isString(value)) {
  15697. return value;
  15698. }
  15699. }
  15700. let scrollBarWidth;
  15701. const getScrollBarWidth = (namespace) => {
  15702. var _a2;
  15703. if (!isClient)
  15704. return 0;
  15705. if (scrollBarWidth !== void 0)
  15706. return scrollBarWidth;
  15707. const outer = document.createElement("div");
  15708. outer.className = `${namespace}-scrollbar__wrap`;
  15709. outer.style.visibility = "hidden";
  15710. outer.style.width = "100px";
  15711. outer.style.position = "absolute";
  15712. outer.style.top = "-9999px";
  15713. document.body.appendChild(outer);
  15714. const widthNoScroll = outer.offsetWidth;
  15715. outer.style.overflow = "scroll";
  15716. const inner = document.createElement("div");
  15717. inner.style.width = "100%";
  15718. outer.appendChild(inner);
  15719. const widthWithScroll = inner.offsetWidth;
  15720. (_a2 = outer.parentNode) == null ? void 0 : _a2.removeChild(outer);
  15721. scrollBarWidth = widthNoScroll - widthWithScroll;
  15722. return scrollBarWidth;
  15723. };
  15724. function scrollIntoView(container, selected) {
  15725. if (!isClient)
  15726. return;
  15727. if (!selected) {
  15728. container.scrollTop = 0;
  15729. return;
  15730. }
  15731. const offsetParents = [];
  15732. let pointer = selected.offsetParent;
  15733. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  15734. offsetParents.push(pointer);
  15735. pointer = pointer.offsetParent;
  15736. }
  15737. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  15738. const bottom = top + selected.offsetHeight;
  15739. const viewRectTop = container.scrollTop;
  15740. const viewRectBottom = viewRectTop + container.clientHeight;
  15741. if (top < viewRectTop) {
  15742. container.scrollTop = top;
  15743. } else if (bottom > viewRectBottom) {
  15744. container.scrollTop = bottom - container.clientHeight;
  15745. }
  15746. }
  15747. /*! Element Plus Icons Vue v2.1.0 */
  15748. var export_helper_default = (sfc, props) => {
  15749. let target = sfc.__vccOpts || sfc;
  15750. for (let [key, val] of props)
  15751. target[key] = val;
  15752. return target;
  15753. };
  15754. var arrow_down_vue_vue_type_script_lang_default = {
  15755. name: "ArrowDown"
  15756. };
  15757. var _hoisted_16$2 = {
  15758. xmlns: "http://www.w3.org/2000/svg",
  15759. viewBox: "0 0 1024 1024"
  15760. }, _hoisted_26$2 = /* @__PURE__ */ createElementVNode(
  15761. "path",
  15762. {
  15763. fill: "currentColor",
  15764. d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
  15765. },
  15766. null,
  15767. -1
  15768. ), _hoisted_36$2 = [
  15769. _hoisted_26$2
  15770. ];
  15771. function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
  15772. return openBlock(), createElementBlock("svg", _hoisted_16$2, _hoisted_36$2);
  15773. }
  15774. var arrow_down_default = /* @__PURE__ */ export_helper_default(arrow_down_vue_vue_type_script_lang_default, [["render", _sfc_render6], ["__file", "arrow-down.vue"]]);
  15775. var arrow_right_vue_vue_type_script_lang_default = {
  15776. name: "ArrowRight"
  15777. };
  15778. var _hoisted_110 = {
  15779. xmlns: "http://www.w3.org/2000/svg",
  15780. viewBox: "0 0 1024 1024"
  15781. }, _hoisted_210 = /* @__PURE__ */ createElementVNode(
  15782. "path",
  15783. {
  15784. fill: "currentColor",
  15785. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
  15786. },
  15787. null,
  15788. -1
  15789. ), _hoisted_310 = [
  15790. _hoisted_210
  15791. ];
  15792. function _sfc_render10(_ctx, _cache, $props, $setup, $data, $options) {
  15793. return openBlock(), createElementBlock("svg", _hoisted_110, _hoisted_310);
  15794. }
  15795. var arrow_right_default = /* @__PURE__ */ export_helper_default(arrow_right_vue_vue_type_script_lang_default, [["render", _sfc_render10], ["__file", "arrow-right.vue"]]);
  15796. var arrow_up_vue_vue_type_script_lang_default = {
  15797. name: "ArrowUp"
  15798. };
  15799. var _hoisted_112 = {
  15800. xmlns: "http://www.w3.org/2000/svg",
  15801. viewBox: "0 0 1024 1024"
  15802. }, _hoisted_212 = /* @__PURE__ */ createElementVNode(
  15803. "path",
  15804. {
  15805. fill: "currentColor",
  15806. d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0z"
  15807. },
  15808. null,
  15809. -1
  15810. ), _hoisted_312 = [
  15811. _hoisted_212
  15812. ];
  15813. function _sfc_render12(_ctx, _cache, $props, $setup, $data, $options) {
  15814. return openBlock(), createElementBlock("svg", _hoisted_112, _hoisted_312);
  15815. }
  15816. var arrow_up_default = /* @__PURE__ */ export_helper_default(arrow_up_vue_vue_type_script_lang_default, [["render", _sfc_render12], ["__file", "arrow-up.vue"]]);
  15817. var circle_check_vue_vue_type_script_lang_default = {
  15818. name: "CircleCheck"
  15819. };
  15820. var _hoisted_149 = {
  15821. xmlns: "http://www.w3.org/2000/svg",
  15822. viewBox: "0 0 1024 1024"
  15823. }, _hoisted_249 = /* @__PURE__ */ createElementVNode(
  15824. "path",
  15825. {
  15826. fill: "currentColor",
  15827. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15828. },
  15829. null,
  15830. -1
  15831. ), _hoisted_348 = /* @__PURE__ */ createElementVNode(
  15832. "path",
  15833. {
  15834. fill: "currentColor",
  15835. d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
  15836. },
  15837. null,
  15838. -1
  15839. ), _hoisted_415 = [
  15840. _hoisted_249,
  15841. _hoisted_348
  15842. ];
  15843. function _sfc_render49(_ctx, _cache, $props, $setup, $data, $options) {
  15844. return openBlock(), createElementBlock("svg", _hoisted_149, _hoisted_415);
  15845. }
  15846. var circle_check_default = /* @__PURE__ */ export_helper_default(circle_check_vue_vue_type_script_lang_default, [["render", _sfc_render49], ["__file", "circle-check.vue"]]);
  15847. var circle_close_vue_vue_type_script_lang_default = {
  15848. name: "CircleClose"
  15849. };
  15850. var _hoisted_151 = {
  15851. xmlns: "http://www.w3.org/2000/svg",
  15852. viewBox: "0 0 1024 1024"
  15853. }, _hoisted_251 = /* @__PURE__ */ createElementVNode(
  15854. "path",
  15855. {
  15856. fill: "currentColor",
  15857. d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"
  15858. },
  15859. null,
  15860. -1
  15861. ), _hoisted_350 = /* @__PURE__ */ createElementVNode(
  15862. "path",
  15863. {
  15864. fill: "currentColor",
  15865. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15866. },
  15867. null,
  15868. -1
  15869. ), _hoisted_416 = [
  15870. _hoisted_251,
  15871. _hoisted_350
  15872. ];
  15873. function _sfc_render51(_ctx, _cache, $props, $setup, $data, $options) {
  15874. return openBlock(), createElementBlock("svg", _hoisted_151, _hoisted_416);
  15875. }
  15876. var circle_close_default = /* @__PURE__ */ export_helper_default(circle_close_vue_vue_type_script_lang_default, [["render", _sfc_render51], ["__file", "circle-close.vue"]]);
  15877. var close_vue_vue_type_script_lang_default = {
  15878. name: "Close"
  15879. };
  15880. var _hoisted_156 = {
  15881. xmlns: "http://www.w3.org/2000/svg",
  15882. viewBox: "0 0 1024 1024"
  15883. }, _hoisted_256 = /* @__PURE__ */ createElementVNode(
  15884. "path",
  15885. {
  15886. fill: "currentColor",
  15887. d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
  15888. },
  15889. null,
  15890. -1
  15891. ), _hoisted_355 = [
  15892. _hoisted_256
  15893. ];
  15894. function _sfc_render56(_ctx, _cache, $props, $setup, $data, $options) {
  15895. return openBlock(), createElementBlock("svg", _hoisted_156, _hoisted_355);
  15896. }
  15897. var close_default = /* @__PURE__ */ export_helper_default(close_vue_vue_type_script_lang_default, [["render", _sfc_render56], ["__file", "close.vue"]]);
  15898. var delete_vue_vue_type_script_lang_default = {
  15899. name: "Delete"
  15900. };
  15901. var _hoisted_180 = {
  15902. xmlns: "http://www.w3.org/2000/svg",
  15903. viewBox: "0 0 1024 1024"
  15904. }, _hoisted_280 = /* @__PURE__ */ createElementVNode(
  15905. "path",
  15906. {
  15907. fill: "currentColor",
  15908. d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
  15909. },
  15910. null,
  15911. -1
  15912. ), _hoisted_379 = [
  15913. _hoisted_280
  15914. ];
  15915. function _sfc_render80(_ctx, _cache, $props, $setup, $data, $options) {
  15916. return openBlock(), createElementBlock("svg", _hoisted_180, _hoisted_379);
  15917. }
  15918. var delete_default = /* @__PURE__ */ export_helper_default(delete_vue_vue_type_script_lang_default, [["render", _sfc_render80], ["__file", "delete.vue"]]);
  15919. var edit_vue_vue_type_script_lang_default = {
  15920. name: "Edit"
  15921. };
  15922. var _hoisted_194 = {
  15923. xmlns: "http://www.w3.org/2000/svg",
  15924. viewBox: "0 0 1024 1024"
  15925. }, _hoisted_294 = /* @__PURE__ */ createElementVNode(
  15926. "path",
  15927. {
  15928. fill: "currentColor",
  15929. d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z"
  15930. },
  15931. null,
  15932. -1
  15933. ), _hoisted_393 = /* @__PURE__ */ createElementVNode(
  15934. "path",
  15935. {
  15936. fill: "currentColor",
  15937. d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
  15938. },
  15939. null,
  15940. -1
  15941. ), _hoisted_431 = [
  15942. _hoisted_294,
  15943. _hoisted_393
  15944. ];
  15945. function _sfc_render94(_ctx, _cache, $props, $setup, $data, $options) {
  15946. return openBlock(), createElementBlock("svg", _hoisted_194, _hoisted_431);
  15947. }
  15948. var edit_default = /* @__PURE__ */ export_helper_default(edit_vue_vue_type_script_lang_default, [["render", _sfc_render94], ["__file", "edit.vue"]]);
  15949. var hide_vue_vue_type_script_lang_default = {
  15950. name: "Hide"
  15951. };
  15952. var _hoisted_1133 = {
  15953. xmlns: "http://www.w3.org/2000/svg",
  15954. viewBox: "0 0 1024 1024"
  15955. }, _hoisted_2133 = /* @__PURE__ */ createElementVNode(
  15956. "path",
  15957. {
  15958. fill: "currentColor",
  15959. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
  15960. },
  15961. null,
  15962. -1
  15963. ), _hoisted_3132 = /* @__PURE__ */ createElementVNode(
  15964. "path",
  15965. {
  15966. fill: "currentColor",
  15967. d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
  15968. },
  15969. null,
  15970. -1
  15971. ), _hoisted_438 = [
  15972. _hoisted_2133,
  15973. _hoisted_3132
  15974. ];
  15975. function _sfc_render133(_ctx, _cache, $props, $setup, $data, $options) {
  15976. return openBlock(), createElementBlock("svg", _hoisted_1133, _hoisted_438);
  15977. }
  15978. var hide_default = /* @__PURE__ */ export_helper_default(hide_vue_vue_type_script_lang_default, [["render", _sfc_render133], ["__file", "hide.vue"]]);
  15979. var loading_vue_vue_type_script_lang_default = {
  15980. name: "Loading"
  15981. };
  15982. var _hoisted_1150 = {
  15983. xmlns: "http://www.w3.org/2000/svg",
  15984. viewBox: "0 0 1024 1024"
  15985. }, _hoisted_2150 = /* @__PURE__ */ createElementVNode(
  15986. "path",
  15987. {
  15988. fill: "currentColor",
  15989. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
  15990. },
  15991. null,
  15992. -1
  15993. ), _hoisted_3149 = [
  15994. _hoisted_2150
  15995. ];
  15996. function _sfc_render150(_ctx, _cache, $props, $setup, $data, $options) {
  15997. return openBlock(), createElementBlock("svg", _hoisted_1150, _hoisted_3149);
  15998. }
  15999. var loading_default = /* @__PURE__ */ export_helper_default(loading_vue_vue_type_script_lang_default, [["render", _sfc_render150], ["__file", "loading.vue"]]);
  16000. var minus_vue_vue_type_script_lang_default = {
  16001. name: "Minus"
  16002. };
  16003. var _hoisted_1169 = {
  16004. xmlns: "http://www.w3.org/2000/svg",
  16005. viewBox: "0 0 1024 1024"
  16006. }, _hoisted_2169 = /* @__PURE__ */ createElementVNode(
  16007. "path",
  16008. {
  16009. fill: "currentColor",
  16010. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"
  16011. },
  16012. null,
  16013. -1
  16014. ), _hoisted_3168 = [
  16015. _hoisted_2169
  16016. ];
  16017. function _sfc_render169(_ctx, _cache, $props, $setup, $data, $options) {
  16018. return openBlock(), createElementBlock("svg", _hoisted_1169, _hoisted_3168);
  16019. }
  16020. var minus_default = /* @__PURE__ */ export_helper_default(minus_vue_vue_type_script_lang_default, [["render", _sfc_render169], ["__file", "minus.vue"]]);
  16021. var plus_vue_vue_type_script_lang_default = {
  16022. name: "Plus"
  16023. };
  16024. var _hoisted_1201 = {
  16025. xmlns: "http://www.w3.org/2000/svg",
  16026. viewBox: "0 0 1024 1024"
  16027. }, _hoisted_2201 = /* @__PURE__ */ createElementVNode(
  16028. "path",
  16029. {
  16030. fill: "currentColor",
  16031. d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"
  16032. },
  16033. null,
  16034. -1
  16035. ), _hoisted_3200 = [
  16036. _hoisted_2201
  16037. ];
  16038. function _sfc_render201(_ctx, _cache, $props, $setup, $data, $options) {
  16039. return openBlock(), createElementBlock("svg", _hoisted_1201, _hoisted_3200);
  16040. }
  16041. var plus_default = /* @__PURE__ */ export_helper_default(plus_vue_vue_type_script_lang_default, [["render", _sfc_render201], ["__file", "plus.vue"]]);
  16042. var setting_vue_vue_type_script_lang_default = {
  16043. name: "Setting"
  16044. };
  16045. var _hoisted_1231 = {
  16046. xmlns: "http://www.w3.org/2000/svg",
  16047. viewBox: "0 0 1024 1024"
  16048. }, _hoisted_2231 = /* @__PURE__ */ createElementVNode(
  16049. "path",
  16050. {
  16051. fill: "currentColor",
  16052. d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357.12 357.12 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a351.616 351.616 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357.12 357.12 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294.113 294.113 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293.12 293.12 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294.113 294.113 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288.282 288.282 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293.12 293.12 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a287.616 287.616 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384zm0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256z"
  16053. },
  16054. null,
  16055. -1
  16056. ), _hoisted_3230 = [
  16057. _hoisted_2231
  16058. ];
  16059. function _sfc_render231(_ctx, _cache, $props, $setup, $data, $options) {
  16060. return openBlock(), createElementBlock("svg", _hoisted_1231, _hoisted_3230);
  16061. }
  16062. var setting_default = /* @__PURE__ */ export_helper_default(setting_vue_vue_type_script_lang_default, [["render", _sfc_render231], ["__file", "setting.vue"]]);
  16063. var view_vue_vue_type_script_lang_default = {
  16064. name: "View"
  16065. };
  16066. var _hoisted_1283 = {
  16067. xmlns: "http://www.w3.org/2000/svg",
  16068. viewBox: "0 0 1024 1024"
  16069. }, _hoisted_2283 = /* @__PURE__ */ createElementVNode(
  16070. "path",
  16071. {
  16072. fill: "currentColor",
  16073. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
  16074. },
  16075. null,
  16076. -1
  16077. ), _hoisted_3282 = [
  16078. _hoisted_2283
  16079. ];
  16080. function _sfc_render283(_ctx, _cache, $props, $setup, $data, $options) {
  16081. return openBlock(), createElementBlock("svg", _hoisted_1283, _hoisted_3282);
  16082. }
  16083. var view_default = /* @__PURE__ */ export_helper_default(view_vue_vue_type_script_lang_default, [["render", _sfc_render283], ["__file", "view.vue"]]);
  16084. const epPropKey = "__epPropKey";
  16085. const definePropType = (val) => val;
  16086. const isEpProp = (val) => isObject$5(val) && !!val[epPropKey];
  16087. const buildProp = (prop, key) => {
  16088. if (!isObject$5(prop) || isEpProp(prop))
  16089. return prop;
  16090. const { values: values3, required, default: defaultValue2, type: type2, validator } = prop;
  16091. const _validator = values3 || validator ? (val) => {
  16092. let valid = false;
  16093. let allowedValues = [];
  16094. if (values3) {
  16095. allowedValues = Array.from(values3);
  16096. if (hasOwn(prop, "default")) {
  16097. allowedValues.push(defaultValue2);
  16098. }
  16099. valid || (valid = allowedValues.includes(val));
  16100. }
  16101. if (validator)
  16102. valid || (valid = validator(val));
  16103. if (!valid && allowedValues.length > 0) {
  16104. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  16105. warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  16106. }
  16107. return valid;
  16108. } : void 0;
  16109. const epProp = {
  16110. type: type2,
  16111. required: !!required,
  16112. validator: _validator,
  16113. [epPropKey]: true
  16114. };
  16115. if (hasOwn(prop, "default"))
  16116. epProp.default = defaultValue2;
  16117. return epProp;
  16118. };
  16119. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
  16120. key,
  16121. buildProp(option, key)
  16122. ]));
  16123. const iconPropType = definePropType([
  16124. String,
  16125. Object,
  16126. Function
  16127. ]);
  16128. const CloseComponents = {
  16129. Close: close_default
  16130. };
  16131. const ValidateComponentsMap = {
  16132. validating: loading_default,
  16133. success: circle_check_default,
  16134. error: circle_close_default
  16135. };
  16136. const withInstall = (main, extra) => {
  16137. main.install = (app) => {
  16138. for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
  16139. app.component(comp.name, comp);
  16140. }
  16141. };
  16142. if (extra) {
  16143. for (const [key, comp] of Object.entries(extra)) {
  16144. main[key] = comp;
  16145. }
  16146. }
  16147. return main;
  16148. };
  16149. const withNoopInstall = (component) => {
  16150. component.install = NOOP;
  16151. return component;
  16152. };
  16153. const composeRefs = (...refs) => {
  16154. return (el) => {
  16155. refs.forEach((ref2) => {
  16156. if (isFunction$3(ref2)) {
  16157. ref2(el);
  16158. } else {
  16159. ref2.value = el;
  16160. }
  16161. });
  16162. };
  16163. };
  16164. const EVENT_CODE = {
  16165. tab: "Tab",
  16166. enter: "Enter",
  16167. space: "Space",
  16168. left: "ArrowLeft",
  16169. up: "ArrowUp",
  16170. right: "ArrowRight",
  16171. down: "ArrowDown",
  16172. esc: "Escape",
  16173. delete: "Delete",
  16174. backspace: "Backspace",
  16175. numpadEnter: "NumpadEnter",
  16176. pageUp: "PageUp",
  16177. pageDown: "PageDown",
  16178. home: "Home",
  16179. end: "End"
  16180. };
  16181. const UPDATE_MODEL_EVENT = "update:modelValue";
  16182. const CHANGE_EVENT = "change";
  16183. const INPUT_EVENT = "input";
  16184. const componentSizes = ["", "default", "small", "large"];
  16185. const componentSizeMap = {
  16186. large: 40,
  16187. default: 32,
  16188. small: 24
  16189. };
  16190. const getComponentSize = (size) => {
  16191. return componentSizeMap[size || "default"];
  16192. };
  16193. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  16194. var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
  16195. PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
  16196. PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
  16197. PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
  16198. PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
  16199. PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
  16200. PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  16201. PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  16202. PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  16203. PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  16204. PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
  16205. PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  16206. PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
  16207. PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
  16208. return PatchFlags2;
  16209. })(PatchFlags || {});
  16210. const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
  16211. const generateId = () => Math.floor(Math.random() * 1e4);
  16212. const mutable = (val) => val;
  16213. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  16214. const LISTENER_PREFIX = /^on[A-Z]/;
  16215. const useAttrs = (params = {}) => {
  16216. const { excludeListeners = false, excludeKeys } = params;
  16217. const allExcludeKeys = computed$1(() => {
  16218. return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
  16219. });
  16220. const instance = getCurrentInstance();
  16221. if (!instance) {
  16222. return computed$1(() => ({}));
  16223. }
  16224. return computed$1(() => {
  16225. var _a2;
  16226. return fromPairs(Object.entries((_a2 = instance.proxy) == null ? void 0 : _a2.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
  16227. });
  16228. };
  16229. const useDeprecated = ({ from: from3, replacement, scope, version: version2, ref: ref2, type: type2 = "API" }, condition) => {
  16230. watch(() => unref(condition), (val) => {
  16231. }, {
  16232. immediate: true
  16233. });
  16234. };
  16235. const useDraggable = (targetRef, dragRef, draggable2) => {
  16236. let transform3 = {
  16237. offsetX: 0,
  16238. offsetY: 0
  16239. };
  16240. const onMousedown = (e) => {
  16241. const downX = e.clientX;
  16242. const downY = e.clientY;
  16243. const { offsetX, offsetY } = transform3;
  16244. const targetRect = targetRef.value.getBoundingClientRect();
  16245. const targetLeft = targetRect.left;
  16246. const targetTop = targetRect.top;
  16247. const targetWidth = targetRect.width;
  16248. const targetHeight = targetRect.height;
  16249. const clientWidth = document.documentElement.clientWidth;
  16250. const clientHeight = document.documentElement.clientHeight;
  16251. const minLeft = -targetLeft + offsetX;
  16252. const minTop = -targetTop + offsetY;
  16253. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  16254. const maxTop = clientHeight - targetTop - targetHeight + offsetY;
  16255. const onMousemove = (e2) => {
  16256. const moveX = Math.min(Math.max(offsetX + e2.clientX - downX, minLeft), maxLeft);
  16257. const moveY = Math.min(Math.max(offsetY + e2.clientY - downY, minTop), maxTop);
  16258. transform3 = {
  16259. offsetX: moveX,
  16260. offsetY: moveY
  16261. };
  16262. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  16263. };
  16264. const onMouseup = () => {
  16265. document.removeEventListener("mousemove", onMousemove);
  16266. document.removeEventListener("mouseup", onMouseup);
  16267. };
  16268. document.addEventListener("mousemove", onMousemove);
  16269. document.addEventListener("mouseup", onMouseup);
  16270. };
  16271. const onDraggable = () => {
  16272. if (dragRef.value && targetRef.value) {
  16273. dragRef.value.addEventListener("mousedown", onMousedown);
  16274. }
  16275. };
  16276. const offDraggable = () => {
  16277. if (dragRef.value && targetRef.value) {
  16278. dragRef.value.removeEventListener("mousedown", onMousedown);
  16279. }
  16280. };
  16281. onMounted(() => {
  16282. watchEffect(() => {
  16283. if (draggable2.value) {
  16284. onDraggable();
  16285. } else {
  16286. offDraggable();
  16287. }
  16288. });
  16289. });
  16290. onBeforeUnmount(() => {
  16291. offDraggable();
  16292. });
  16293. };
  16294. const useFocus = (el) => {
  16295. return {
  16296. focus: () => {
  16297. var _a2, _b;
  16298. (_b = (_a2 = el.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  16299. }
  16300. };
  16301. };
  16302. var English = {
  16303. name: "en",
  16304. el: {
  16305. colorpicker: {
  16306. confirm: "OK",
  16307. clear: "Clear",
  16308. defaultLabel: "color picker",
  16309. description: "current color is {color}. press enter to select a new color."
  16310. },
  16311. datepicker: {
  16312. now: "Now",
  16313. today: "Today",
  16314. cancel: "Cancel",
  16315. clear: "Clear",
  16316. confirm: "OK",
  16317. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  16318. monthTablePrompt: "Use the arrow keys and enter to select the month",
  16319. yearTablePrompt: "Use the arrow keys and enter to select the year",
  16320. selectedDate: "Selected date",
  16321. selectDate: "Select date",
  16322. selectTime: "Select time",
  16323. startDate: "Start Date",
  16324. startTime: "Start Time",
  16325. endDate: "End Date",
  16326. endTime: "End Time",
  16327. prevYear: "Previous Year",
  16328. nextYear: "Next Year",
  16329. prevMonth: "Previous Month",
  16330. nextMonth: "Next Month",
  16331. year: "",
  16332. month1: "January",
  16333. month2: "February",
  16334. month3: "March",
  16335. month4: "April",
  16336. month5: "May",
  16337. month6: "June",
  16338. month7: "July",
  16339. month8: "August",
  16340. month9: "September",
  16341. month10: "October",
  16342. month11: "November",
  16343. month12: "December",
  16344. week: "week",
  16345. weeks: {
  16346. sun: "Sun",
  16347. mon: "Mon",
  16348. tue: "Tue",
  16349. wed: "Wed",
  16350. thu: "Thu",
  16351. fri: "Fri",
  16352. sat: "Sat"
  16353. },
  16354. weeksFull: {
  16355. sun: "Sunday",
  16356. mon: "Monday",
  16357. tue: "Tuesday",
  16358. wed: "Wednesday",
  16359. thu: "Thursday",
  16360. fri: "Friday",
  16361. sat: "Saturday"
  16362. },
  16363. months: {
  16364. jan: "Jan",
  16365. feb: "Feb",
  16366. mar: "Mar",
  16367. apr: "Apr",
  16368. may: "May",
  16369. jun: "Jun",
  16370. jul: "Jul",
  16371. aug: "Aug",
  16372. sep: "Sep",
  16373. oct: "Oct",
  16374. nov: "Nov",
  16375. dec: "Dec"
  16376. }
  16377. },
  16378. inputNumber: {
  16379. decrease: "decrease number",
  16380. increase: "increase number"
  16381. },
  16382. select: {
  16383. loading: "Loading",
  16384. noMatch: "No matching data",
  16385. noData: "No data",
  16386. placeholder: "Select"
  16387. },
  16388. dropdown: {
  16389. toggleDropdown: "Toggle Dropdown"
  16390. },
  16391. cascader: {
  16392. noMatch: "No matching data",
  16393. loading: "Loading",
  16394. placeholder: "Select",
  16395. noData: "No data"
  16396. },
  16397. pagination: {
  16398. goto: "Go to",
  16399. pagesize: "/page",
  16400. total: "Total {total}",
  16401. pageClassifier: "",
  16402. page: "Page",
  16403. prev: "Go to previous page",
  16404. next: "Go to next page",
  16405. currentPage: "page {pager}",
  16406. prevPages: "Previous {pager} pages",
  16407. nextPages: "Next {pager} pages",
  16408. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  16409. },
  16410. dialog: {
  16411. close: "Close this dialog"
  16412. },
  16413. drawer: {
  16414. close: "Close this dialog"
  16415. },
  16416. messagebox: {
  16417. title: "Message",
  16418. confirm: "OK",
  16419. cancel: "Cancel",
  16420. error: "Illegal input",
  16421. close: "Close this dialog"
  16422. },
  16423. upload: {
  16424. deleteTip: "press delete to remove",
  16425. delete: "Delete",
  16426. preview: "Preview",
  16427. continue: "Continue"
  16428. },
  16429. slider: {
  16430. defaultLabel: "slider between {min} and {max}",
  16431. defaultRangeStartLabel: "pick start value",
  16432. defaultRangeEndLabel: "pick end value"
  16433. },
  16434. table: {
  16435. emptyText: "No Data",
  16436. confirmFilter: "Confirm",
  16437. resetFilter: "Reset",
  16438. clearFilter: "All",
  16439. sumText: "Sum"
  16440. },
  16441. tree: {
  16442. emptyText: "No Data"
  16443. },
  16444. transfer: {
  16445. noMatch: "No matching data",
  16446. noData: "No data",
  16447. titles: ["List 1", "List 2"],
  16448. filterPlaceholder: "Enter keyword",
  16449. noCheckedFormat: "{total} items",
  16450. hasCheckedFormat: "{checked}/{total} checked"
  16451. },
  16452. image: {
  16453. error: "FAILED"
  16454. },
  16455. pageHeader: {
  16456. title: "Back"
  16457. },
  16458. popconfirm: {
  16459. confirmButtonText: "Yes",
  16460. cancelButtonText: "No"
  16461. }
  16462. }
  16463. };
  16464. const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
  16465. const translate = (path, option, locale) => get$2(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
  16466. var _a2;
  16467. return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`;
  16468. });
  16469. const buildLocaleContext = (locale) => {
  16470. const lang = computed$1(() => unref(locale).name);
  16471. const localeRef = isRef(locale) ? locale : ref(locale);
  16472. return {
  16473. lang,
  16474. locale: localeRef,
  16475. t: buildTranslator(locale)
  16476. };
  16477. };
  16478. const localeContextKey = Symbol("localeContextKey");
  16479. const useLocale = (localeOverrides) => {
  16480. const locale = localeOverrides || inject(localeContextKey, ref());
  16481. return buildLocaleContext(computed$1(() => locale.value || English));
  16482. };
  16483. let activeEffectScope;
  16484. function recordEffectScope(effect, scope = activeEffectScope) {
  16485. if (scope && scope.active) {
  16486. scope.effects.push(effect);
  16487. }
  16488. }
  16489. const createDep = (effects) => {
  16490. const dep = new Set(effects);
  16491. dep.w = 0;
  16492. dep.n = 0;
  16493. return dep;
  16494. };
  16495. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  16496. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  16497. const initDepMarkers = ({ deps }) => {
  16498. if (deps.length) {
  16499. for (let i2 = 0; i2 < deps.length; i2++) {
  16500. deps[i2].w |= trackOpBit;
  16501. }
  16502. }
  16503. };
  16504. const finalizeDepMarkers = (effect) => {
  16505. const { deps } = effect;
  16506. if (deps.length) {
  16507. let ptr = 0;
  16508. for (let i2 = 0; i2 < deps.length; i2++) {
  16509. const dep = deps[i2];
  16510. if (wasTracked(dep) && !newTracked(dep)) {
  16511. dep.delete(effect);
  16512. } else {
  16513. deps[ptr++] = dep;
  16514. }
  16515. dep.w &= ~trackOpBit;
  16516. dep.n &= ~trackOpBit;
  16517. }
  16518. deps.length = ptr;
  16519. }
  16520. };
  16521. let effectTrackDepth = 0;
  16522. let trackOpBit = 1;
  16523. const maxMarkerBits = 30;
  16524. let activeEffect;
  16525. class ReactiveEffect {
  16526. constructor(fn2, scheduler = null, scope) {
  16527. this.fn = fn2;
  16528. this.scheduler = scheduler;
  16529. this.active = true;
  16530. this.deps = [];
  16531. this.parent = void 0;
  16532. recordEffectScope(this, scope);
  16533. }
  16534. run() {
  16535. if (!this.active) {
  16536. return this.fn();
  16537. }
  16538. let parent = activeEffect;
  16539. let lastShouldTrack = shouldTrack;
  16540. while (parent) {
  16541. if (parent === this) {
  16542. return;
  16543. }
  16544. parent = parent.parent;
  16545. }
  16546. try {
  16547. this.parent = activeEffect;
  16548. activeEffect = this;
  16549. shouldTrack = true;
  16550. trackOpBit = 1 << ++effectTrackDepth;
  16551. if (effectTrackDepth <= maxMarkerBits) {
  16552. initDepMarkers(this);
  16553. } else {
  16554. cleanupEffect(this);
  16555. }
  16556. return this.fn();
  16557. } finally {
  16558. if (effectTrackDepth <= maxMarkerBits) {
  16559. finalizeDepMarkers(this);
  16560. }
  16561. trackOpBit = 1 << --effectTrackDepth;
  16562. activeEffect = this.parent;
  16563. shouldTrack = lastShouldTrack;
  16564. this.parent = void 0;
  16565. if (this.deferStop) {
  16566. this.stop();
  16567. }
  16568. }
  16569. }
  16570. stop() {
  16571. if (activeEffect === this) {
  16572. this.deferStop = true;
  16573. } else if (this.active) {
  16574. cleanupEffect(this);
  16575. if (this.onStop) {
  16576. this.onStop();
  16577. }
  16578. this.active = false;
  16579. }
  16580. }
  16581. }
  16582. function cleanupEffect(effect2) {
  16583. const { deps } = effect2;
  16584. if (deps.length) {
  16585. for (let i2 = 0; i2 < deps.length; i2++) {
  16586. deps[i2].delete(effect2);
  16587. }
  16588. deps.length = 0;
  16589. }
  16590. }
  16591. let shouldTrack = true;
  16592. function trackEffects(dep, debuggerEventExtraInfo) {
  16593. let shouldTrack2 = false;
  16594. if (effectTrackDepth <= maxMarkerBits) {
  16595. if (!newTracked(dep)) {
  16596. dep.n |= trackOpBit;
  16597. shouldTrack2 = !wasTracked(dep);
  16598. }
  16599. } else {
  16600. shouldTrack2 = !dep.has(activeEffect);
  16601. }
  16602. if (shouldTrack2) {
  16603. dep.add(activeEffect);
  16604. activeEffect.deps.push(dep);
  16605. }
  16606. }
  16607. function triggerEffects(dep, debuggerEventExtraInfo) {
  16608. const effects = isArray$2(dep) ? dep : [...dep];
  16609. for (const effect2 of effects) {
  16610. if (effect2.computed) {
  16611. triggerEffect(effect2);
  16612. }
  16613. }
  16614. for (const effect2 of effects) {
  16615. if (!effect2.computed) {
  16616. triggerEffect(effect2);
  16617. }
  16618. }
  16619. }
  16620. function triggerEffect(effect2, debuggerEventExtraInfo) {
  16621. if (effect2 !== activeEffect || effect2.allowRecurse) {
  16622. if (effect2.scheduler) {
  16623. effect2.scheduler();
  16624. } else {
  16625. effect2.run();
  16626. }
  16627. }
  16628. }
  16629. function toRaw(observed) {
  16630. const raw = observed && observed["__v_raw"];
  16631. return raw ? toRaw(raw) : observed;
  16632. }
  16633. function trackRefValue(ref2) {
  16634. if (shouldTrack && activeEffect) {
  16635. ref2 = toRaw(ref2);
  16636. {
  16637. trackEffects(ref2.dep || (ref2.dep = createDep()));
  16638. }
  16639. }
  16640. }
  16641. function triggerRefValue(ref2, newVal) {
  16642. ref2 = toRaw(ref2);
  16643. const dep = ref2.dep;
  16644. if (dep) {
  16645. {
  16646. triggerEffects(dep);
  16647. }
  16648. }
  16649. }
  16650. class ComputedRefImpl {
  16651. constructor(getter, _setter, isReadonly, isSSR) {
  16652. this._setter = _setter;
  16653. this.dep = void 0;
  16654. this.__v_isRef = true;
  16655. this["__v_isReadonly"] = false;
  16656. this._dirty = true;
  16657. this.effect = new ReactiveEffect(getter, () => {
  16658. if (!this._dirty) {
  16659. this._dirty = true;
  16660. triggerRefValue(this);
  16661. }
  16662. });
  16663. this.effect.computed = this;
  16664. this.effect.active = this._cacheable = !isSSR;
  16665. this["__v_isReadonly"] = isReadonly;
  16666. }
  16667. get value() {
  16668. const self2 = toRaw(this);
  16669. trackRefValue(self2);
  16670. if (self2._dirty || !self2._cacheable) {
  16671. self2._dirty = false;
  16672. self2._value = self2.effect.run();
  16673. }
  16674. return self2._value;
  16675. }
  16676. set value(newValue) {
  16677. this._setter(newValue);
  16678. }
  16679. }
  16680. function computed(getterOrOptions, debugOptions, isSSR = false) {
  16681. let getter;
  16682. let setter;
  16683. const onlyGetter = isFunction$3(getterOrOptions);
  16684. if (onlyGetter) {
  16685. getter = getterOrOptions;
  16686. setter = NOOP;
  16687. } else {
  16688. getter = getterOrOptions.get;
  16689. setter = getterOrOptions.set;
  16690. }
  16691. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  16692. return cRef;
  16693. }
  16694. const defaultNamespace = "el";
  16695. const statePrefix = "is-";
  16696. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  16697. let cls = `${namespace}-${block}`;
  16698. if (blockSuffix) {
  16699. cls += `-${blockSuffix}`;
  16700. }
  16701. if (element) {
  16702. cls += `__${element}`;
  16703. }
  16704. if (modifier) {
  16705. cls += `--${modifier}`;
  16706. }
  16707. return cls;
  16708. };
  16709. const namespaceContextKey = Symbol("namespaceContextKey");
  16710. const useGetDerivedNamespace = (namespaceOverrides) => {
  16711. const derivedNamespace = namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace));
  16712. const namespace = computed$1(() => {
  16713. return unref(derivedNamespace) || defaultNamespace;
  16714. });
  16715. return namespace;
  16716. };
  16717. const useNamespace = (block, namespaceOverrides) => {
  16718. const namespace = useGetDerivedNamespace(namespaceOverrides);
  16719. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  16720. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  16721. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  16722. const be2 = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  16723. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  16724. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  16725. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  16726. const is = (name, ...args) => {
  16727. const state = args.length >= 1 ? args[0] : true;
  16728. return name && state ? `${statePrefix}${name}` : "";
  16729. };
  16730. const cssVar = (object) => {
  16731. const styles = {};
  16732. for (const key in object) {
  16733. if (object[key]) {
  16734. styles[`--${namespace.value}-${key}`] = object[key];
  16735. }
  16736. }
  16737. return styles;
  16738. };
  16739. const cssVarBlock = (object) => {
  16740. const styles = {};
  16741. for (const key in object) {
  16742. if (object[key]) {
  16743. styles[`--${namespace.value}-${block}-${key}`] = object[key];
  16744. }
  16745. }
  16746. return styles;
  16747. };
  16748. const cssVarName = (name) => `--${namespace.value}-${name}`;
  16749. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  16750. return {
  16751. namespace,
  16752. b,
  16753. e,
  16754. m,
  16755. be: be2,
  16756. em,
  16757. bm,
  16758. bem,
  16759. is,
  16760. cssVar,
  16761. cssVarName,
  16762. cssVarBlock,
  16763. cssVarBlockName
  16764. };
  16765. };
  16766. const useLockscreen = (trigger2, options2 = {}) => {
  16767. if (!isRef(trigger2)) {
  16768. throwError("[useLockscreen]", "You need to pass a ref param to this function");
  16769. }
  16770. const ns = options2.ns || useNamespace("popup");
  16771. const hiddenCls = computed(() => ns.bm("parent", "hidden"));
  16772. if (!isClient || hasClass$2(document.body, hiddenCls.value)) {
  16773. return;
  16774. }
  16775. let scrollBarWidth2 = 0;
  16776. let withoutHiddenClass = false;
  16777. let bodyWidth = "0";
  16778. const cleanup = () => {
  16779. setTimeout(() => {
  16780. removeClass$2(document == null ? void 0 : document.body, hiddenCls.value);
  16781. if (withoutHiddenClass && document) {
  16782. document.body.style.width = bodyWidth;
  16783. }
  16784. }, 200);
  16785. };
  16786. watch(trigger2, (val) => {
  16787. if (!val) {
  16788. cleanup();
  16789. return;
  16790. }
  16791. withoutHiddenClass = !hasClass$2(document.body, hiddenCls.value);
  16792. if (withoutHiddenClass) {
  16793. bodyWidth = document.body.style.width;
  16794. }
  16795. scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
  16796. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  16797. const bodyOverflowY = getStyle(document.body, "overflowY");
  16798. if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
  16799. document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
  16800. }
  16801. addClass$2(document.body, hiddenCls.value);
  16802. });
  16803. onScopeDispose(() => cleanup());
  16804. };
  16805. const _prop = buildProp({
  16806. type: definePropType(Boolean),
  16807. default: null
  16808. });
  16809. const _event = buildProp({
  16810. type: definePropType(Function)
  16811. });
  16812. const createModelToggleComposable = (name) => {
  16813. const updateEventKey = `update:${name}`;
  16814. const updateEventKeyRaw = `onUpdate:${name}`;
  16815. const useModelToggleEmits2 = [updateEventKey];
  16816. const useModelToggleProps2 = {
  16817. [name]: _prop,
  16818. [updateEventKeyRaw]: _event
  16819. };
  16820. const useModelToggle2 = ({
  16821. indicator,
  16822. toggleReason,
  16823. shouldHideWhenRouteChanges,
  16824. shouldProceed,
  16825. onShow,
  16826. onHide
  16827. }) => {
  16828. const instance = getCurrentInstance();
  16829. const { emit } = instance;
  16830. const props = instance.props;
  16831. const hasUpdateHandler = computed$1(() => isFunction$3(props[updateEventKeyRaw]));
  16832. const isModelBindingAbsent = computed$1(() => props[name] === null);
  16833. const doShow = (event2) => {
  16834. if (indicator.value === true) {
  16835. return;
  16836. }
  16837. indicator.value = true;
  16838. if (toggleReason) {
  16839. toggleReason.value = event2;
  16840. }
  16841. if (isFunction$3(onShow)) {
  16842. onShow(event2);
  16843. }
  16844. };
  16845. const doHide = (event2) => {
  16846. if (indicator.value === false) {
  16847. return;
  16848. }
  16849. indicator.value = false;
  16850. if (toggleReason) {
  16851. toggleReason.value = event2;
  16852. }
  16853. if (isFunction$3(onHide)) {
  16854. onHide(event2);
  16855. }
  16856. };
  16857. const show = (event2) => {
  16858. if (props.disabled === true || isFunction$3(shouldProceed) && !shouldProceed())
  16859. return;
  16860. const shouldEmit = hasUpdateHandler.value && isClient;
  16861. if (shouldEmit) {
  16862. emit(updateEventKey, true);
  16863. }
  16864. if (isModelBindingAbsent.value || !shouldEmit) {
  16865. doShow(event2);
  16866. }
  16867. };
  16868. const hide = (event2) => {
  16869. if (props.disabled === true || !isClient)
  16870. return;
  16871. const shouldEmit = hasUpdateHandler.value && isClient;
  16872. if (shouldEmit) {
  16873. emit(updateEventKey, false);
  16874. }
  16875. if (isModelBindingAbsent.value || !shouldEmit) {
  16876. doHide(event2);
  16877. }
  16878. };
  16879. const onChange = (val) => {
  16880. if (!isBoolean(val))
  16881. return;
  16882. if (props.disabled && val) {
  16883. if (hasUpdateHandler.value) {
  16884. emit(updateEventKey, false);
  16885. }
  16886. } else if (indicator.value !== val) {
  16887. if (val) {
  16888. doShow();
  16889. } else {
  16890. doHide();
  16891. }
  16892. }
  16893. };
  16894. const toggle = () => {
  16895. if (indicator.value) {
  16896. hide();
  16897. } else {
  16898. show();
  16899. }
  16900. };
  16901. watch(() => props[name], onChange);
  16902. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
  16903. watch(() => ({
  16904. ...instance.proxy.$route
  16905. }), () => {
  16906. if (shouldHideWhenRouteChanges.value && indicator.value) {
  16907. hide();
  16908. }
  16909. });
  16910. }
  16911. onMounted(() => {
  16912. onChange(props[name]);
  16913. });
  16914. return {
  16915. hide,
  16916. show,
  16917. toggle,
  16918. hasUpdateHandler
  16919. };
  16920. };
  16921. return {
  16922. useModelToggle: useModelToggle2,
  16923. useModelToggleProps: useModelToggleProps2,
  16924. useModelToggleEmits: useModelToggleEmits2
  16925. };
  16926. };
  16927. const useProp = (name) => {
  16928. const vm = getCurrentInstance();
  16929. return computed$1(() => {
  16930. var _a2, _b;
  16931. return (_b = (_a2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a2.$props) == null ? void 0 : _b[name];
  16932. });
  16933. };
  16934. var E = "top", R = "bottom", W = "right", P = "left", me = "auto", G = [E, R, W, P], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t2, e) {
  16935. return t2.concat([e + "-" + U, e + "-" + J]);
  16936. }, []), Ee = [].concat(G, [me]).reduce(function(t2, e) {
  16937. return t2.concat([e, e + "-" + U, e + "-" + J]);
  16938. }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt = "afterWrite", ot = [Ge, Je, Ke, Qe, Ze, et, tt, nt, rt];
  16939. function C(t2) {
  16940. return t2 ? (t2.nodeName || "").toLowerCase() : null;
  16941. }
  16942. function H(t2) {
  16943. if (t2 == null)
  16944. return window;
  16945. if (t2.toString() !== "[object Window]") {
  16946. var e = t2.ownerDocument;
  16947. return e && e.defaultView || window;
  16948. }
  16949. return t2;
  16950. }
  16951. function Q(t2) {
  16952. var e = H(t2).Element;
  16953. return t2 instanceof e || t2 instanceof Element;
  16954. }
  16955. function B(t2) {
  16956. var e = H(t2).HTMLElement;
  16957. return t2 instanceof e || t2 instanceof HTMLElement;
  16958. }
  16959. function Pe(t2) {
  16960. if (typeof ShadowRoot == "undefined")
  16961. return false;
  16962. var e = H(t2).ShadowRoot;
  16963. return t2 instanceof e || t2 instanceof ShadowRoot;
  16964. }
  16965. function Mt(t2) {
  16966. var e = t2.state;
  16967. Object.keys(e.elements).forEach(function(n) {
  16968. var r2 = e.styles[n] || {}, o = e.attributes[n] || {}, i2 = e.elements[n];
  16969. !B(i2) || !C(i2) || (Object.assign(i2.style, r2), Object.keys(o).forEach(function(a) {
  16970. var s = o[a];
  16971. s === false ? i2.removeAttribute(a) : i2.setAttribute(a, s === true ? "" : s);
  16972. }));
  16973. });
  16974. }
  16975. function Rt(t2) {
  16976. var e = t2.state, n = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  16977. return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
  16978. Object.keys(e.elements).forEach(function(r2) {
  16979. var o = e.elements[r2], i2 = e.attributes[r2] || {}, a = Object.keys(e.styles.hasOwnProperty(r2) ? e.styles[r2] : n[r2]), s = a.reduce(function(f, c) {
  16980. return f[c] = "", f;
  16981. }, {});
  16982. !B(o) || !C(o) || (Object.assign(o.style, s), Object.keys(i2).forEach(function(f) {
  16983. o.removeAttribute(f);
  16984. }));
  16985. });
  16986. };
  16987. }
  16988. var Ae = { name: "applyStyles", enabled: true, phase: "write", fn: Mt, effect: Rt, requires: ["computeStyles"] };
  16989. function q(t2) {
  16990. return t2.split("-")[0];
  16991. }
  16992. var X = Math.max, ve = Math.min, Z = Math.round;
  16993. function ee(t2, e) {
  16994. e === void 0 && (e = false);
  16995. var n = t2.getBoundingClientRect(), r2 = 1, o = 1;
  16996. if (B(t2) && e) {
  16997. var i2 = t2.offsetHeight, a = t2.offsetWidth;
  16998. a > 0 && (r2 = Z(n.width) / a || 1), i2 > 0 && (o = Z(n.height) / i2 || 1);
  16999. }
  17000. return { width: n.width / r2, height: n.height / o, top: n.top / o, right: n.right / r2, bottom: n.bottom / o, left: n.left / r2, x: n.left / r2, y: n.top / o };
  17001. }
  17002. function ke(t2) {
  17003. var e = ee(t2), n = t2.offsetWidth, r2 = t2.offsetHeight;
  17004. return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r2) <= 1 && (r2 = e.height), { x: t2.offsetLeft, y: t2.offsetTop, width: n, height: r2 };
  17005. }
  17006. function it(t2, e) {
  17007. var n = e.getRootNode && e.getRootNode();
  17008. if (t2.contains(e))
  17009. return true;
  17010. if (n && Pe(n)) {
  17011. var r2 = e;
  17012. do {
  17013. if (r2 && t2.isSameNode(r2))
  17014. return true;
  17015. r2 = r2.parentNode || r2.host;
  17016. } while (r2);
  17017. }
  17018. return false;
  17019. }
  17020. function N(t2) {
  17021. return H(t2).getComputedStyle(t2);
  17022. }
  17023. function Wt(t2) {
  17024. return ["table", "td", "th"].indexOf(C(t2)) >= 0;
  17025. }
  17026. function I(t2) {
  17027. return ((Q(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
  17028. }
  17029. function ge(t2) {
  17030. return C(t2) === "html" ? t2 : t2.assignedSlot || t2.parentNode || (Pe(t2) ? t2.host : null) || I(t2);
  17031. }
  17032. function at(t2) {
  17033. return !B(t2) || N(t2).position === "fixed" ? null : t2.offsetParent;
  17034. }
  17035. function Bt(t2) {
  17036. var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
  17037. if (n && B(t2)) {
  17038. var r2 = N(t2);
  17039. if (r2.position === "fixed")
  17040. return null;
  17041. }
  17042. var o = ge(t2);
  17043. for (Pe(o) && (o = o.host); B(o) && ["html", "body"].indexOf(C(o)) < 0; ) {
  17044. var i2 = N(o);
  17045. if (i2.transform !== "none" || i2.perspective !== "none" || i2.contain === "paint" || ["transform", "perspective"].indexOf(i2.willChange) !== -1 || e && i2.willChange === "filter" || e && i2.filter && i2.filter !== "none")
  17046. return o;
  17047. o = o.parentNode;
  17048. }
  17049. return null;
  17050. }
  17051. function se(t2) {
  17052. for (var e = H(t2), n = at(t2); n && Wt(n) && N(n).position === "static"; )
  17053. n = at(n);
  17054. return n && (C(n) === "html" || C(n) === "body" && N(n).position === "static") ? e : n || Bt(t2) || e;
  17055. }
  17056. function Le(t2) {
  17057. return ["top", "bottom"].indexOf(t2) >= 0 ? "x" : "y";
  17058. }
  17059. function fe(t2, e, n) {
  17060. return X(t2, ve(e, n));
  17061. }
  17062. function St(t2, e, n) {
  17063. var r2 = fe(t2, e, n);
  17064. return r2 > n ? n : r2;
  17065. }
  17066. function st() {
  17067. return { top: 0, right: 0, bottom: 0, left: 0 };
  17068. }
  17069. function ft(t2) {
  17070. return Object.assign({}, st(), t2);
  17071. }
  17072. function ct(t2, e) {
  17073. return e.reduce(function(n, r2) {
  17074. return n[r2] = t2, n;
  17075. }, {});
  17076. }
  17077. var Tt = function(t2, e) {
  17078. return t2 = typeof t2 == "function" ? t2(Object.assign({}, e.rects, { placement: e.placement })) : t2, ft(typeof t2 != "number" ? t2 : ct(t2, G));
  17079. };
  17080. function Ht(t2) {
  17081. var e, n = t2.state, r2 = t2.name, o = t2.options, i2 = n.elements.arrow, a = n.modifiersData.popperOffsets, s = q(n.placement), f = Le(s), c = [P, W].indexOf(s) >= 0, u = c ? "height" : "width";
  17082. if (!(!i2 || !a)) {
  17083. var m = Tt(o.padding, n), v = ke(i2), l = f === "y" ? E : P, h2 = f === "y" ? R : W, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], x = se(i2), y = x ? f === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, $2 = p / 2 - g / 2, d2 = m[l], b = y - v[u] - m[h2], w = y / 2 - v[u] / 2 + $2, O = fe(d2, w, b), j = f;
  17084. n.modifiersData[r2] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
  17085. }
  17086. }
  17087. function Ct(t2) {
  17088. var e = t2.state, n = t2.options, r2 = n.element, o = r2 === void 0 ? "[data-popper-arrow]" : r2;
  17089. o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !it(e.elements.popper, o) || (e.elements.arrow = o));
  17090. }
  17091. var pt = { name: "arrow", enabled: true, phase: "main", fn: Ht, effect: Ct, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
  17092. function te(t2) {
  17093. return t2.split("-")[1];
  17094. }
  17095. var qt = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
  17096. function Vt(t2) {
  17097. var e = t2.x, n = t2.y, r2 = window, o = r2.devicePixelRatio || 1;
  17098. return { x: Z(e * o) / o || 0, y: Z(n * o) / o || 0 };
  17099. }
  17100. function ut(t2) {
  17101. var e, n = t2.popper, r2 = t2.popperRect, o = t2.placement, i2 = t2.variation, a = t2.offsets, s = t2.position, f = t2.gpuAcceleration, c = t2.adaptive, u = t2.roundOffsets, m = t2.isFixed, v = a.x, l = v === void 0 ? 0 : v, h2 = a.y, p = h2 === void 0 ? 0 : h2, g = typeof u == "function" ? u({ x: l, y: p }) : { x: l, y: p };
  17102. l = g.x, p = g.y;
  17103. var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $2 = P, d2 = E, b = window;
  17104. if (c) {
  17105. var w = se(n), O = "clientHeight", j = "clientWidth";
  17106. if (w === H(n) && (w = I(n), N(w).position !== "static" && s === "absolute" && (O = "scrollHeight", j = "scrollWidth")), w = w, o === E || (o === P || o === W) && i2 === J) {
  17107. d2 = R;
  17108. var A = m && w === b && b.visualViewport ? b.visualViewport.height : w[O];
  17109. p -= A - r2.height, p *= f ? 1 : -1;
  17110. }
  17111. if (o === P || (o === E || o === R) && i2 === J) {
  17112. $2 = W;
  17113. var k = m && w === b && b.visualViewport ? b.visualViewport.width : w[j];
  17114. l -= k - r2.width, l *= f ? 1 : -1;
  17115. }
  17116. }
  17117. var D = Object.assign({ position: s }, c && qt), S = u === true ? Vt({ x: l, y: p }) : { x: l, y: p };
  17118. if (l = S.x, p = S.y, f) {
  17119. var L;
  17120. return Object.assign({}, D, (L = {}, L[d2] = y ? "0" : "", L[$2] = x ? "0" : "", L.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + l + "px, " + p + "px)" : "translate3d(" + l + "px, " + p + "px, 0)", L));
  17121. }
  17122. return Object.assign({}, D, (e = {}, e[d2] = y ? p + "px" : "", e[$2] = x ? l + "px" : "", e.transform = "", e));
  17123. }
  17124. function Nt(t2) {
  17125. var e = t2.state, n = t2.options, r2 = n.gpuAcceleration, o = r2 === void 0 ? true : r2, i2 = n.adaptive, a = i2 === void 0 ? true : i2, s = n.roundOffsets, f = s === void 0 ? true : s, c = { placement: q(e.placement), variation: te(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: o, isFixed: e.options.strategy === "fixed" };
  17126. e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, ut(Object.assign({}, c, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: f })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, ut(Object.assign({}, c, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: f })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
  17127. }
  17128. var Me = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: Nt, data: {} }, ye = { passive: true };
  17129. function It(t2) {
  17130. var e = t2.state, n = t2.instance, r2 = t2.options, o = r2.scroll, i2 = o === void 0 ? true : o, a = r2.resize, s = a === void 0 ? true : a, f = H(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  17131. return i2 && c.forEach(function(u) {
  17132. u.addEventListener("scroll", n.update, ye);
  17133. }), s && f.addEventListener("resize", n.update, ye), function() {
  17134. i2 && c.forEach(function(u) {
  17135. u.removeEventListener("scroll", n.update, ye);
  17136. }), s && f.removeEventListener("resize", n.update, ye);
  17137. };
  17138. }
  17139. var Re = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
  17140. }, effect: It, data: {} }, _t = { left: "right", right: "left", bottom: "top", top: "bottom" };
  17141. function be(t2) {
  17142. return t2.replace(/left|right|bottom|top/g, function(e) {
  17143. return _t[e];
  17144. });
  17145. }
  17146. var zt = { start: "end", end: "start" };
  17147. function lt(t2) {
  17148. return t2.replace(/start|end/g, function(e) {
  17149. return zt[e];
  17150. });
  17151. }
  17152. function We(t2) {
  17153. var e = H(t2), n = e.pageXOffset, r2 = e.pageYOffset;
  17154. return { scrollLeft: n, scrollTop: r2 };
  17155. }
  17156. function Be(t2) {
  17157. return ee(I(t2)).left + We(t2).scrollLeft;
  17158. }
  17159. function Ft(t2) {
  17160. var e = H(t2), n = I(t2), r2 = e.visualViewport, o = n.clientWidth, i2 = n.clientHeight, a = 0, s = 0;
  17161. return r2 && (o = r2.width, i2 = r2.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r2.offsetLeft, s = r2.offsetTop)), { width: o, height: i2, x: a + Be(t2), y: s };
  17162. }
  17163. function Ut(t2) {
  17164. var e, n = I(t2), r2 = We(t2), o = (e = t2.ownerDocument) == null ? void 0 : e.body, i2 = X(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = X(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), s = -r2.scrollLeft + Be(t2), f = -r2.scrollTop;
  17165. return N(o || n).direction === "rtl" && (s += X(n.clientWidth, o ? o.clientWidth : 0) - i2), { width: i2, height: a, x: s, y: f };
  17166. }
  17167. function Se(t2) {
  17168. var e = N(t2), n = e.overflow, r2 = e.overflowX, o = e.overflowY;
  17169. return /auto|scroll|overlay|hidden/.test(n + o + r2);
  17170. }
  17171. function dt(t2) {
  17172. return ["html", "body", "#document"].indexOf(C(t2)) >= 0 ? t2.ownerDocument.body : B(t2) && Se(t2) ? t2 : dt(ge(t2));
  17173. }
  17174. function ce(t2, e) {
  17175. var n;
  17176. e === void 0 && (e = []);
  17177. var r2 = dt(t2), o = r2 === ((n = t2.ownerDocument) == null ? void 0 : n.body), i2 = H(r2), a = o ? [i2].concat(i2.visualViewport || [], Se(r2) ? r2 : []) : r2, s = e.concat(a);
  17178. return o ? s : s.concat(ce(ge(a)));
  17179. }
  17180. function Te(t2) {
  17181. return Object.assign({}, t2, { left: t2.x, top: t2.y, right: t2.x + t2.width, bottom: t2.y + t2.height });
  17182. }
  17183. function Xt(t2) {
  17184. var e = ee(t2);
  17185. return e.top = e.top + t2.clientTop, e.left = e.left + t2.clientLeft, e.bottom = e.top + t2.clientHeight, e.right = e.left + t2.clientWidth, e.width = t2.clientWidth, e.height = t2.clientHeight, e.x = e.left, e.y = e.top, e;
  17186. }
  17187. function ht(t2, e) {
  17188. return e === je ? Te(Ft(t2)) : Q(e) ? Xt(e) : Te(Ut(I(t2)));
  17189. }
  17190. function Yt(t2) {
  17191. var e = ce(ge(t2)), n = ["absolute", "fixed"].indexOf(N(t2).position) >= 0, r2 = n && B(t2) ? se(t2) : t2;
  17192. return Q(r2) ? e.filter(function(o) {
  17193. return Q(o) && it(o, r2) && C(o) !== "body";
  17194. }) : [];
  17195. }
  17196. function Gt(t2, e, n) {
  17197. var r2 = e === "clippingParents" ? Yt(t2) : [].concat(e), o = [].concat(r2, [n]), i2 = o[0], a = o.reduce(function(s, f) {
  17198. var c = ht(t2, f);
  17199. return s.top = X(c.top, s.top), s.right = ve(c.right, s.right), s.bottom = ve(c.bottom, s.bottom), s.left = X(c.left, s.left), s;
  17200. }, ht(t2, i2));
  17201. return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
  17202. }
  17203. function mt(t2) {
  17204. var e = t2.reference, n = t2.element, r2 = t2.placement, o = r2 ? q(r2) : null, i2 = r2 ? te(r2) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, f;
  17205. switch (o) {
  17206. case E:
  17207. f = { x: a, y: e.y - n.height };
  17208. break;
  17209. case R:
  17210. f = { x: a, y: e.y + e.height };
  17211. break;
  17212. case W:
  17213. f = { x: e.x + e.width, y: s };
  17214. break;
  17215. case P:
  17216. f = { x: e.x - n.width, y: s };
  17217. break;
  17218. default:
  17219. f = { x: e.x, y: e.y };
  17220. }
  17221. var c = o ? Le(o) : null;
  17222. if (c != null) {
  17223. var u = c === "y" ? "height" : "width";
  17224. switch (i2) {
  17225. case U:
  17226. f[c] = f[c] - (e[u] / 2 - n[u] / 2);
  17227. break;
  17228. case J:
  17229. f[c] = f[c] + (e[u] / 2 - n[u] / 2);
  17230. break;
  17231. }
  17232. }
  17233. return f;
  17234. }
  17235. function ne(t2, e) {
  17236. e === void 0 && (e = {});
  17237. var n = e, r2 = n.placement, o = r2 === void 0 ? t2.placement : r2, i2 = n.boundary, a = i2 === void 0 ? Xe : i2, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? false : m, l = n.padding, h2 = l === void 0 ? 0 : l, p = ft(typeof h2 != "number" ? h2 : ct(h2, G)), g = u === K ? Ye : K, x = t2.rects.popper, y = t2.elements[v ? g : u], $2 = Gt(Q(y) ? y : y.contextElement || I(t2.elements.popper), a, f), d2 = ee(t2.elements.reference), b = mt({ reference: d2, element: x, strategy: "absolute", placement: o }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d2, j = { top: $2.top - O.top + p.top, bottom: O.bottom - $2.bottom + p.bottom, left: $2.left - O.left + p.left, right: O.right - $2.right + p.right }, A = t2.modifiersData.offset;
  17238. if (u === K && A) {
  17239. var k = A[o];
  17240. Object.keys(j).forEach(function(D) {
  17241. var S = [W, R].indexOf(D) >= 0 ? 1 : -1, L = [E, R].indexOf(D) >= 0 ? "y" : "x";
  17242. j[D] += k[L] * S;
  17243. });
  17244. }
  17245. return j;
  17246. }
  17247. function Jt(t2, e) {
  17248. e === void 0 && (e = {});
  17249. var n = e, r2 = n.placement, o = n.boundary, i2 = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r2), m = u ? s ? De : De.filter(function(h2) {
  17250. return te(h2) === u;
  17251. }) : G, v = m.filter(function(h2) {
  17252. return c.indexOf(h2) >= 0;
  17253. });
  17254. v.length === 0 && (v = m);
  17255. var l = v.reduce(function(h2, p) {
  17256. return h2[p] = ne(t2, { placement: p, boundary: o, rootBoundary: i2, padding: a })[q(p)], h2;
  17257. }, {});
  17258. return Object.keys(l).sort(function(h2, p) {
  17259. return l[h2] - l[p];
  17260. });
  17261. }
  17262. function Kt(t2) {
  17263. if (q(t2) === me)
  17264. return [];
  17265. var e = be(t2);
  17266. return [lt(t2), e, lt(e)];
  17267. }
  17268. function Qt(t2) {
  17269. var e = t2.state, n = t2.options, r2 = t2.name;
  17270. if (!e.modifiersData[r2]._skip) {
  17271. for (var o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, h2 = l === void 0 ? true : l, p = n.allowedAutoPlacements, g = e.options.placement, x = q(g), y = x === g, $2 = f || (y || !h2 ? [be(g)] : Kt(g)), d2 = [g].concat($2).reduce(function(z, V) {
  17272. return z.concat(q(V) === me ? Jt(e, { placement: V, boundary: u, rootBoundary: m, padding: c, flipVariations: h2, allowedAutoPlacements: p }) : V);
  17273. }, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = true, A = d2[0], k = 0; k < d2.length; k++) {
  17274. var D = d2[k], S = q(D), L = te(D) === U, re = [E, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, { placement: D, boundary: u, rootBoundary: m, altBoundary: v, padding: c }), T = re ? L ? W : P : L ? R : E;
  17275. b[oe] > w[oe] && (T = be(T));
  17276. var pe = be(T), _ = [];
  17277. if (i2 && _.push(M[S] <= 0), s && _.push(M[T] <= 0, M[pe] <= 0), _.every(function(z) {
  17278. return z;
  17279. })) {
  17280. A = D, j = false;
  17281. break;
  17282. }
  17283. O.set(D, _);
  17284. }
  17285. if (j)
  17286. for (var ue = h2 ? 3 : 1, xe = function(z) {
  17287. var V = d2.find(function(de) {
  17288. var ae = O.get(de);
  17289. if (ae)
  17290. return ae.slice(0, z).every(function(Y) {
  17291. return Y;
  17292. });
  17293. });
  17294. if (V)
  17295. return A = V, "break";
  17296. }, ie = ue; ie > 0; ie--) {
  17297. var le = xe(ie);
  17298. if (le === "break")
  17299. break;
  17300. }
  17301. e.placement !== A && (e.modifiersData[r2]._skip = true, e.placement = A, e.reset = true);
  17302. }
  17303. }
  17304. var vt = { name: "flip", enabled: true, phase: "main", fn: Qt, requiresIfExists: ["offset"], data: { _skip: false } };
  17305. function gt(t2, e, n) {
  17306. return n === void 0 && (n = { x: 0, y: 0 }), { top: t2.top - e.height - n.y, right: t2.right - e.width + n.x, bottom: t2.bottom - e.height + n.y, left: t2.left - e.width - n.x };
  17307. }
  17308. function yt(t2) {
  17309. return [E, W, R, P].some(function(e) {
  17310. return t2[e] >= 0;
  17311. });
  17312. }
  17313. function Zt(t2) {
  17314. var e = t2.state, n = t2.name, r2 = e.rects.reference, o = e.rects.popper, i2 = e.modifiersData.preventOverflow, a = ne(e, { elementContext: "reference" }), s = ne(e, { altBoundary: true }), f = gt(a, r2), c = gt(s, o, i2), u = yt(f), m = yt(c);
  17315. e.modifiersData[n] = { referenceClippingOffsets: f, popperEscapeOffsets: c, isReferenceHidden: u, hasPopperEscaped: m }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": m });
  17316. }
  17317. var bt = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Zt };
  17318. function en$1(t2, e, n) {
  17319. var r2 = q(t2), o = [P, E].indexOf(r2) >= 0 ? -1 : 1, i2 = typeof n == "function" ? n(Object.assign({}, e, { placement: t2 })) : n, a = i2[0], s = i2[1];
  17320. return a = a || 0, s = (s || 0) * o, [P, W].indexOf(r2) >= 0 ? { x: s, y: a } : { x: a, y: s };
  17321. }
  17322. function tn(t2) {
  17323. var e = t2.state, n = t2.options, r2 = t2.name, o = n.offset, i2 = o === void 0 ? [0, 0] : o, a = Ee.reduce(function(u, m) {
  17324. return u[m] = en$1(m, e.rects, i2), u;
  17325. }, {}), s = a[e.placement], f = s.x, c = s.y;
  17326. e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r2] = a;
  17327. }
  17328. var wt = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: tn };
  17329. function nn(t2) {
  17330. var e = t2.state, n = t2.name;
  17331. e.modifiersData[n] = mt({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
  17332. }
  17333. var He = { name: "popperOffsets", enabled: true, phase: "read", fn: nn, data: {} };
  17334. function rn(t2) {
  17335. return t2 === "x" ? "y" : "x";
  17336. }
  17337. function on$2(t2) {
  17338. var e = t2.state, n = t2.options, r2 = t2.name, o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? true : v, h2 = n.tetherOffset, p = h2 === void 0 ? 0 : h2, g = ne(e, { boundary: f, rootBoundary: c, padding: m, altBoundary: u }), x = q(e.placement), y = te(e.placement), $2 = !y, d2 = Le(x), b = rn(d2), w = e.modifiersData.popperOffsets, O = e.rects.reference, j = e.rects.popper, A = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, k = typeof A == "number" ? { mainAxis: A, altAxis: A } : Object.assign({ mainAxis: 0, altAxis: 0 }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = { x: 0, y: 0 };
  17339. if (w) {
  17340. if (i2) {
  17341. var L, re = d2 === "y" ? E : P, oe = d2 === "y" ? R : W, M = d2 === "y" ? "height" : "width", T = w[d2], pe = T + g[re], _ = T - g[oe], ue = l ? -j[M] / 2 : 0, xe = y === U ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : { width: 0, height: 0 }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : st(), de = V[re], ae = V[oe], Y = fe(0, O[M], z[M]), jt = $2 ? O[M] / 2 - ue - Y - de - k.mainAxis : xe - Y - de - k.mainAxis, Dt = $2 ? -O[M] / 2 + ue + Y + ae + k.mainAxis : ie + Y + ae + k.mainAxis, Oe = e.elements.arrow && se(e.elements.arrow), Et = Oe ? d2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L = D == null ? void 0 : D[d2]) != null ? L : 0, Pt = T + jt - Ce - Et, At = T + Dt - Ce, qe = fe(l ? ve(pe, Pt) : pe, T, l ? X(_, At) : _);
  17342. w[d2] = qe, S[d2] = qe - T;
  17343. }
  17344. if (s) {
  17345. var Ve, kt = d2 === "x" ? E : P, Lt = d2 === "x" ? R : W, F = w[b], he = b === "y" ? "height" : "width", Ne = F + g[kt], Ie = F - g[Lt], $e = [E, P].indexOf(x) !== -1, _e = (Ve = D == null ? void 0 : D[b]) != null ? Ve : 0, ze = $e ? Ne : F - O[he] - j[he] - _e + k.altAxis, Fe = $e ? F + O[he] + j[he] - _e - k.altAxis : Ie, Ue = l && $e ? St(ze, F, Fe) : fe(l ? ze : Ne, F, l ? Fe : Ie);
  17346. w[b] = Ue, S[b] = Ue - F;
  17347. }
  17348. e.modifiersData[r2] = S;
  17349. }
  17350. }
  17351. var xt = { name: "preventOverflow", enabled: true, phase: "main", fn: on$2, requiresIfExists: ["offset"] };
  17352. function an(t2) {
  17353. return { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop };
  17354. }
  17355. function sn(t2) {
  17356. return t2 === H(t2) || !B(t2) ? We(t2) : an(t2);
  17357. }
  17358. function fn(t2) {
  17359. var e = t2.getBoundingClientRect(), n = Z(e.width) / t2.offsetWidth || 1, r2 = Z(e.height) / t2.offsetHeight || 1;
  17360. return n !== 1 || r2 !== 1;
  17361. }
  17362. function cn(t2, e, n) {
  17363. n === void 0 && (n = false);
  17364. var r2 = B(e), o = B(e) && fn(e), i2 = I(e), a = ee(t2, o), s = { scrollLeft: 0, scrollTop: 0 }, f = { x: 0, y: 0 };
  17365. return (r2 || !r2 && !n) && ((C(e) !== "body" || Se(i2)) && (s = sn(e)), B(e) ? (f = ee(e, true), f.x += e.clientLeft, f.y += e.clientTop) : i2 && (f.x = Be(i2))), { x: a.left + s.scrollLeft - f.x, y: a.top + s.scrollTop - f.y, width: a.width, height: a.height };
  17366. }
  17367. function pn(t2) {
  17368. var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r2 = [];
  17369. t2.forEach(function(i2) {
  17370. e.set(i2.name, i2);
  17371. });
  17372. function o(i2) {
  17373. n.add(i2.name);
  17374. var a = [].concat(i2.requires || [], i2.requiresIfExists || []);
  17375. a.forEach(function(s) {
  17376. if (!n.has(s)) {
  17377. var f = e.get(s);
  17378. f && o(f);
  17379. }
  17380. }), r2.push(i2);
  17381. }
  17382. return t2.forEach(function(i2) {
  17383. n.has(i2.name) || o(i2);
  17384. }), r2;
  17385. }
  17386. function un(t2) {
  17387. var e = pn(t2);
  17388. return ot.reduce(function(n, r2) {
  17389. return n.concat(e.filter(function(o) {
  17390. return o.phase === r2;
  17391. }));
  17392. }, []);
  17393. }
  17394. function ln(t2) {
  17395. var e;
  17396. return function() {
  17397. return e || (e = new Promise(function(n) {
  17398. Promise.resolve().then(function() {
  17399. e = void 0, n(t2());
  17400. });
  17401. })), e;
  17402. };
  17403. }
  17404. function dn(t2) {
  17405. var e = t2.reduce(function(n, r2) {
  17406. var o = n[r2.name];
  17407. return n[r2.name] = o ? Object.assign({}, o, r2, { options: Object.assign({}, o.options, r2.options), data: Object.assign({}, o.data, r2.data) }) : r2, n;
  17408. }, {});
  17409. return Object.keys(e).map(function(n) {
  17410. return e[n];
  17411. });
  17412. }
  17413. var Ot = { placement: "bottom", modifiers: [], strategy: "absolute" };
  17414. function $t() {
  17415. for (var t2 = arguments.length, e = new Array(t2), n = 0; n < t2; n++)
  17416. e[n] = arguments[n];
  17417. return !e.some(function(r2) {
  17418. return !(r2 && typeof r2.getBoundingClientRect == "function");
  17419. });
  17420. }
  17421. function we(t2) {
  17422. t2 === void 0 && (t2 = {});
  17423. var e = t2, n = e.defaultModifiers, r2 = n === void 0 ? [] : n, o = e.defaultOptions, i2 = o === void 0 ? Ot : o;
  17424. return function(a, s, f) {
  17425. f === void 0 && (f = i2);
  17426. var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ot, i2), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, u = [], m = false, v = { state: c, setOptions: function(p) {
  17427. var g = typeof p == "function" ? p(c.options) : p;
  17428. h2(), c.options = Object.assign({}, i2, c.options, g), c.scrollParents = { reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [], popper: ce(s) };
  17429. var x = un(dn([].concat(r2, c.options.modifiers)));
  17430. return c.orderedModifiers = x.filter(function(y) {
  17431. return y.enabled;
  17432. }), l(), v.update();
  17433. }, forceUpdate: function() {
  17434. if (!m) {
  17435. var p = c.elements, g = p.reference, x = p.popper;
  17436. if ($t(g, x)) {
  17437. c.rects = { reference: cn(g, se(x), c.options.strategy === "fixed"), popper: ke(x) }, c.reset = false, c.placement = c.options.placement, c.orderedModifiers.forEach(function(j) {
  17438. return c.modifiersData[j.name] = Object.assign({}, j.data);
  17439. });
  17440. for (var y = 0; y < c.orderedModifiers.length; y++) {
  17441. if (c.reset === true) {
  17442. c.reset = false, y = -1;
  17443. continue;
  17444. }
  17445. var $2 = c.orderedModifiers[y], d2 = $2.fn, b = $2.options, w = b === void 0 ? {} : b, O = $2.name;
  17446. typeof d2 == "function" && (c = d2({ state: c, options: w, name: O, instance: v }) || c);
  17447. }
  17448. }
  17449. }
  17450. }, update: ln(function() {
  17451. return new Promise(function(p) {
  17452. v.forceUpdate(), p(c);
  17453. });
  17454. }), destroy: function() {
  17455. h2(), m = true;
  17456. } };
  17457. if (!$t(a, s))
  17458. return v;
  17459. v.setOptions(f).then(function(p) {
  17460. !m && f.onFirstUpdate && f.onFirstUpdate(p);
  17461. });
  17462. function l() {
  17463. c.orderedModifiers.forEach(function(p) {
  17464. var g = p.name, x = p.options, y = x === void 0 ? {} : x, $2 = p.effect;
  17465. if (typeof $2 == "function") {
  17466. var d2 = $2({ state: c, name: g, instance: v, options: y }), b = function() {
  17467. };
  17468. u.push(d2 || b);
  17469. }
  17470. });
  17471. }
  17472. function h2() {
  17473. u.forEach(function(p) {
  17474. return p();
  17475. }), u = [];
  17476. }
  17477. return v;
  17478. };
  17479. }
  17480. we();
  17481. var mn = [Re, He, Me, Ae];
  17482. we({ defaultModifiers: mn });
  17483. var gn = [Re, He, Me, Ae, wt, vt, xt, pt, bt], yn = we({ defaultModifiers: gn });
  17484. const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
  17485. const stateUpdater = {
  17486. name: "updateState",
  17487. enabled: true,
  17488. phase: "write",
  17489. fn: ({ state }) => {
  17490. const derivedState = deriveState(state);
  17491. Object.assign(states.value, derivedState);
  17492. },
  17493. requires: ["computeStyles"]
  17494. };
  17495. const options2 = computed$1(() => {
  17496. const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
  17497. return {
  17498. onFirstUpdate,
  17499. placement: placement || "bottom",
  17500. strategy: strategy || "absolute",
  17501. modifiers: [
  17502. ...modifiers || [],
  17503. stateUpdater,
  17504. { name: "applyStyles", enabled: false }
  17505. ]
  17506. };
  17507. });
  17508. const instanceRef = shallowRef();
  17509. const states = ref({
  17510. styles: {
  17511. popper: {
  17512. position: unref(options2).strategy,
  17513. left: "0",
  17514. top: "0"
  17515. },
  17516. arrow: {
  17517. position: "absolute"
  17518. }
  17519. },
  17520. attributes: {}
  17521. });
  17522. const destroy = () => {
  17523. if (!instanceRef.value)
  17524. return;
  17525. instanceRef.value.destroy();
  17526. instanceRef.value = void 0;
  17527. };
  17528. watch(options2, (newOptions) => {
  17529. const instance = unref(instanceRef);
  17530. if (instance) {
  17531. instance.setOptions(newOptions);
  17532. }
  17533. }, {
  17534. deep: true
  17535. });
  17536. watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
  17537. destroy();
  17538. if (!referenceElement || !popperElement)
  17539. return;
  17540. instanceRef.value = yn(referenceElement, popperElement, unref(options2));
  17541. });
  17542. onBeforeUnmount(() => {
  17543. destroy();
  17544. });
  17545. return {
  17546. state: computed$1(() => {
  17547. var _a2;
  17548. return { ...((_a2 = unref(instanceRef)) == null ? void 0 : _a2.state) || {} };
  17549. }),
  17550. styles: computed$1(() => unref(states).styles),
  17551. attributes: computed$1(() => unref(states).attributes),
  17552. update: () => {
  17553. var _a2;
  17554. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.update();
  17555. },
  17556. forceUpdate: () => {
  17557. var _a2;
  17558. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.forceUpdate();
  17559. },
  17560. instanceRef: computed$1(() => unref(instanceRef))
  17561. };
  17562. };
  17563. function deriveState(state) {
  17564. const elements = Object.keys(state.elements);
  17565. const styles = fromPairs(elements.map((element) => [element, state.styles[element] || {}]));
  17566. const attributes = fromPairs(elements.map((element) => [element, state.attributes[element]]));
  17567. return {
  17568. styles,
  17569. attributes
  17570. };
  17571. }
  17572. const useSameTarget = (handleClick) => {
  17573. if (!handleClick) {
  17574. return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
  17575. }
  17576. let mousedownTarget = false;
  17577. let mouseupTarget = false;
  17578. const onClick = (e) => {
  17579. if (mousedownTarget && mouseupTarget) {
  17580. handleClick(e);
  17581. }
  17582. mousedownTarget = mouseupTarget = false;
  17583. };
  17584. const onMousedown = (e) => {
  17585. mousedownTarget = e.target === e.currentTarget;
  17586. };
  17587. const onMouseup = (e) => {
  17588. mouseupTarget = e.target === e.currentTarget;
  17589. };
  17590. return { onClick, onMousedown, onMouseup };
  17591. };
  17592. function useTimeout() {
  17593. let timeoutHandle;
  17594. const registerTimeout = (fn2, delay) => {
  17595. cancelTimeout();
  17596. timeoutHandle = window.setTimeout(fn2, delay);
  17597. };
  17598. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  17599. tryOnScopeDispose(() => cancelTimeout());
  17600. return {
  17601. registerTimeout,
  17602. cancelTimeout
  17603. };
  17604. }
  17605. const defaultIdInjection = {
  17606. prefix: Math.floor(Math.random() * 1e4),
  17607. current: 0
  17608. };
  17609. const ID_INJECTION_KEY = Symbol("elIdInjection");
  17610. const useIdInjection = () => {
  17611. return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  17612. };
  17613. const useId = (deterministicId) => {
  17614. const idInjection = useIdInjection();
  17615. const namespace = useGetDerivedNamespace();
  17616. const idRef = computed$1(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  17617. return idRef;
  17618. };
  17619. let registeredEscapeHandlers = [];
  17620. const cachedHandler = (e) => {
  17621. const event2 = e;
  17622. if (event2.key === EVENT_CODE.esc) {
  17623. registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event2));
  17624. }
  17625. };
  17626. const useEscapeKeydown = (handler) => {
  17627. onMounted(() => {
  17628. if (registeredEscapeHandlers.length === 0) {
  17629. document.addEventListener("keydown", cachedHandler);
  17630. }
  17631. if (isClient)
  17632. registeredEscapeHandlers.push(handler);
  17633. });
  17634. onBeforeUnmount(() => {
  17635. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  17636. if (registeredEscapeHandlers.length === 0) {
  17637. if (isClient)
  17638. document.removeEventListener("keydown", cachedHandler);
  17639. }
  17640. });
  17641. };
  17642. let cachedContainer;
  17643. const usePopperContainerId = () => {
  17644. const namespace = useGetDerivedNamespace();
  17645. const idInjection = useIdInjection();
  17646. const id = computed$1(() => {
  17647. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  17648. });
  17649. const selector = computed$1(() => `#${id.value}`);
  17650. return {
  17651. id,
  17652. selector
  17653. };
  17654. };
  17655. const createContainer = (id) => {
  17656. const container = document.createElement("div");
  17657. container.id = id;
  17658. document.body.appendChild(container);
  17659. return container;
  17660. };
  17661. const usePopperContainer = () => {
  17662. const { id, selector } = usePopperContainerId();
  17663. onBeforeMount(() => {
  17664. if (!isClient)
  17665. return;
  17666. if (!cachedContainer && !document.body.querySelector(selector.value)) {
  17667. cachedContainer = createContainer(id.value);
  17668. }
  17669. });
  17670. return {
  17671. id,
  17672. selector
  17673. };
  17674. };
  17675. const useDelayedToggleProps = buildProps({
  17676. showAfter: {
  17677. type: Number,
  17678. default: 0
  17679. },
  17680. hideAfter: {
  17681. type: Number,
  17682. default: 200
  17683. },
  17684. autoClose: {
  17685. type: Number,
  17686. default: 0
  17687. }
  17688. });
  17689. const useDelayedToggle = ({
  17690. showAfter,
  17691. hideAfter,
  17692. autoClose,
  17693. open,
  17694. close
  17695. }) => {
  17696. const { registerTimeout } = useTimeout();
  17697. const {
  17698. registerTimeout: registerTimeoutForAutoClose,
  17699. cancelTimeout: cancelTimeoutForAutoClose
  17700. } = useTimeout();
  17701. const onOpen = (event2) => {
  17702. registerTimeout(() => {
  17703. open(event2);
  17704. const _autoClose = unref(autoClose);
  17705. if (isNumber(_autoClose) && _autoClose > 0) {
  17706. registerTimeoutForAutoClose(() => {
  17707. close(event2);
  17708. }, _autoClose);
  17709. }
  17710. }, unref(showAfter));
  17711. };
  17712. const onClose = (event2) => {
  17713. cancelTimeoutForAutoClose();
  17714. registerTimeout(() => {
  17715. close(event2);
  17716. }, unref(hideAfter));
  17717. };
  17718. return {
  17719. onOpen,
  17720. onClose
  17721. };
  17722. };
  17723. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  17724. const useForwardRef = (forwardRef) => {
  17725. const setForwardRef = (el) => {
  17726. forwardRef.value = el;
  17727. };
  17728. provide(FORWARD_REF_INJECTION_KEY, {
  17729. setForwardRef
  17730. });
  17731. };
  17732. const useForwardRefDirective = (setForwardRef) => {
  17733. return {
  17734. mounted(el) {
  17735. setForwardRef(el);
  17736. },
  17737. updated(el) {
  17738. setForwardRef(el);
  17739. },
  17740. unmounted() {
  17741. setForwardRef(null);
  17742. }
  17743. };
  17744. };
  17745. const zIndex = ref(0);
  17746. const defaultInitialZIndex = 2e3;
  17747. const zIndexContextKey = Symbol("zIndexContextKey");
  17748. const useZIndex = (zIndexOverrides) => {
  17749. const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, void 0);
  17750. const initialZIndex = computed$1(() => {
  17751. const zIndexFromInjection = unref(zIndexInjection);
  17752. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  17753. });
  17754. const currentZIndex = computed$1(() => initialZIndex.value + zIndex.value);
  17755. const nextZIndex = () => {
  17756. zIndex.value++;
  17757. return currentZIndex.value;
  17758. };
  17759. return {
  17760. initialZIndex,
  17761. currentZIndex,
  17762. nextZIndex
  17763. };
  17764. };
  17765. function useCursor(input) {
  17766. const selectionRef = ref();
  17767. function recordCursor() {
  17768. if (input.value == void 0)
  17769. return;
  17770. const { selectionStart, selectionEnd, value } = input.value;
  17771. if (selectionStart == null || selectionEnd == null)
  17772. return;
  17773. const beforeTxt = value.slice(0, Math.max(0, selectionStart));
  17774. const afterTxt = value.slice(Math.max(0, selectionEnd));
  17775. selectionRef.value = {
  17776. selectionStart,
  17777. selectionEnd,
  17778. value,
  17779. beforeTxt,
  17780. afterTxt
  17781. };
  17782. }
  17783. function setCursor() {
  17784. if (input.value == void 0 || selectionRef.value == void 0)
  17785. return;
  17786. const { value } = input.value;
  17787. const { beforeTxt, afterTxt, selectionStart } = selectionRef.value;
  17788. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
  17789. return;
  17790. let startPos = value.length;
  17791. if (value.endsWith(afterTxt)) {
  17792. startPos = value.length - afterTxt.length;
  17793. } else if (value.startsWith(beforeTxt)) {
  17794. startPos = beforeTxt.length;
  17795. } else {
  17796. const beforeLastChar = beforeTxt[selectionStart - 1];
  17797. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  17798. if (newIndex !== -1) {
  17799. startPos = newIndex + 1;
  17800. }
  17801. }
  17802. input.value.setSelectionRange(startPos, startPos);
  17803. }
  17804. return [recordCursor, setCursor];
  17805. }
  17806. const useSizeProp = buildProp({
  17807. type: String,
  17808. values: componentSizes,
  17809. required: false
  17810. });
  17811. const SIZE_INJECTION_KEY = Symbol("size");
  17812. const useGlobalSize = () => {
  17813. const injectedSize = inject(SIZE_INJECTION_KEY, {});
  17814. return computed$1(() => {
  17815. return unref(injectedSize.size) || "";
  17816. });
  17817. };
  17818. const configProviderContextKey = Symbol();
  17819. const globalConfig = ref();
  17820. function useGlobalConfig(key, defaultValue2 = void 0) {
  17821. const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
  17822. if (key) {
  17823. return computed$1(() => {
  17824. var _a2, _b;
  17825. return (_b = (_a2 = config.value) == null ? void 0 : _a2[key]) != null ? _b : defaultValue2;
  17826. });
  17827. } else {
  17828. return config;
  17829. }
  17830. }
  17831. const provideGlobalConfig = (config, app, global2 = false) => {
  17832. var _a2;
  17833. const inSetup = !!getCurrentInstance();
  17834. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  17835. const provideFn = (_a2 = app == null ? void 0 : app.provide) != null ? _a2 : inSetup ? provide : void 0;
  17836. if (!provideFn) {
  17837. return;
  17838. }
  17839. const context = computed$1(() => {
  17840. const cfg = unref(config);
  17841. if (!(oldConfig == null ? void 0 : oldConfig.value))
  17842. return cfg;
  17843. return mergeConfig(oldConfig.value, cfg);
  17844. });
  17845. provideFn(configProviderContextKey, context);
  17846. provideFn(localeContextKey, computed$1(() => context.value.locale));
  17847. provideFn(namespaceContextKey, computed$1(() => context.value.namespace));
  17848. provideFn(zIndexContextKey, computed$1(() => context.value.zIndex));
  17849. provideFn(SIZE_INJECTION_KEY, {
  17850. size: computed$1(() => context.value.size || "")
  17851. });
  17852. if (global2 || !globalConfig.value) {
  17853. globalConfig.value = context.value;
  17854. }
  17855. return context;
  17856. };
  17857. const mergeConfig = (a, b) => {
  17858. var _a2;
  17859. const keys3 = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
  17860. const obj = {};
  17861. for (const key of keys3) {
  17862. obj[key] = (_a2 = b[key]) != null ? _a2 : a[key];
  17863. }
  17864. return obj;
  17865. };
  17866. const configProviderProps = buildProps({
  17867. a11y: {
  17868. type: Boolean,
  17869. default: true
  17870. },
  17871. locale: {
  17872. type: definePropType(Object)
  17873. },
  17874. size: useSizeProp,
  17875. button: {
  17876. type: definePropType(Object)
  17877. },
  17878. experimentalFeatures: {
  17879. type: definePropType(Object)
  17880. },
  17881. keyboardNavigation: {
  17882. type: Boolean,
  17883. default: true
  17884. },
  17885. message: {
  17886. type: definePropType(Object)
  17887. },
  17888. zIndex: Number,
  17889. namespace: {
  17890. type: String,
  17891. default: "el"
  17892. }
  17893. });
  17894. const messageConfig = {};
  17895. const ConfigProvider = defineComponent({
  17896. name: "ElConfigProvider",
  17897. props: configProviderProps,
  17898. setup(props, { slots }) {
  17899. watch(() => props.message, (val) => {
  17900. Object.assign(messageConfig, val != null ? val : {});
  17901. }, { immediate: true, deep: true });
  17902. const config = provideGlobalConfig(props);
  17903. return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
  17904. }
  17905. });
  17906. const ElConfigProvider = withInstall(ConfigProvider);
  17907. var _export_sfc$1 = (sfc, props) => {
  17908. const target = sfc.__vccOpts || sfc;
  17909. for (const [key, val] of props) {
  17910. target[key] = val;
  17911. }
  17912. return target;
  17913. };
  17914. const iconProps = buildProps({
  17915. size: {
  17916. type: definePropType([Number, String])
  17917. },
  17918. color: {
  17919. type: String
  17920. }
  17921. });
  17922. const __default__$o = defineComponent({
  17923. name: "ElIcon",
  17924. inheritAttrs: false
  17925. });
  17926. const _sfc_main$B = /* @__PURE__ */ defineComponent({
  17927. ...__default__$o,
  17928. props: iconProps,
  17929. setup(__props) {
  17930. const props = __props;
  17931. const ns = useNamespace("icon");
  17932. const style = computed$1(() => {
  17933. const { size, color: color2 } = props;
  17934. if (!size && !color2)
  17935. return {};
  17936. return {
  17937. fontSize: isUndefined(size) ? void 0 : addUnit(size),
  17938. "--color": color2
  17939. };
  17940. });
  17941. return (_ctx, _cache) => {
  17942. return openBlock(), createElementBlock("i", mergeProps({
  17943. class: unref(ns).b(),
  17944. style: unref(style)
  17945. }, _ctx.$attrs), [
  17946. renderSlot(_ctx.$slots, "default")
  17947. ], 16);
  17948. };
  17949. }
  17950. });
  17951. var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
  17952. const ElIcon = withInstall(Icon);
  17953. const formContextKey = Symbol("formContextKey");
  17954. const formItemContextKey = Symbol("formItemContextKey");
  17955. const useFormSize = (fallback, ignore = {}) => {
  17956. const emptyRef = ref(void 0);
  17957. const size = ignore.prop ? emptyRef : useProp("size");
  17958. const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
  17959. const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
  17960. const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
  17961. return computed$1(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "");
  17962. };
  17963. const useFormDisabled = (fallback) => {
  17964. const disabled = useProp("disabled");
  17965. const form = inject(formContextKey, void 0);
  17966. return computed$1(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
  17967. };
  17968. const useFormItem = () => {
  17969. const form = inject(formContextKey, void 0);
  17970. const formItem = inject(formItemContextKey, void 0);
  17971. return {
  17972. form,
  17973. formItem
  17974. };
  17975. };
  17976. const useFormItemInputId = (props, {
  17977. formItemContext,
  17978. disableIdGeneration,
  17979. disableIdManagement
  17980. }) => {
  17981. if (!disableIdGeneration) {
  17982. disableIdGeneration = ref(false);
  17983. }
  17984. if (!disableIdManagement) {
  17985. disableIdManagement = ref(false);
  17986. }
  17987. const inputId = ref();
  17988. let idUnwatch = void 0;
  17989. const isLabeledByFormItem = computed$1(() => {
  17990. var _a2;
  17991. return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a2 = formItemContext.inputIds) == null ? void 0 : _a2.length) <= 1);
  17992. });
  17993. onMounted(() => {
  17994. idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
  17995. const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
  17996. if (newId !== inputId.value) {
  17997. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  17998. inputId.value && formItemContext.removeInputId(inputId.value);
  17999. if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
  18000. formItemContext.addInputId(newId);
  18001. }
  18002. }
  18003. inputId.value = newId;
  18004. }
  18005. }, { immediate: true });
  18006. });
  18007. onUnmounted(() => {
  18008. idUnwatch && idUnwatch();
  18009. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  18010. inputId.value && formItemContext.removeInputId(inputId.value);
  18011. }
  18012. });
  18013. return {
  18014. isLabeledByFormItem,
  18015. inputId
  18016. };
  18017. };
  18018. let hiddenTextarea = void 0;
  18019. const HIDDEN_STYLE = `
  18020. height:0 !important;
  18021. visibility:hidden !important;
  18022. ${isFirefox() ? "" : "overflow:hidden !important;"}
  18023. position:absolute !important;
  18024. z-index:-1000 !important;
  18025. top:0 !important;
  18026. right:0 !important;
  18027. `;
  18028. const CONTEXT_STYLE = [
  18029. "letter-spacing",
  18030. "line-height",
  18031. "padding-top",
  18032. "padding-bottom",
  18033. "font-family",
  18034. "font-weight",
  18035. "font-size",
  18036. "text-rendering",
  18037. "text-transform",
  18038. "width",
  18039. "text-indent",
  18040. "padding-left",
  18041. "padding-right",
  18042. "border-width",
  18043. "box-sizing"
  18044. ];
  18045. function calculateNodeStyling(targetElement) {
  18046. const style = window.getComputedStyle(targetElement);
  18047. const boxSizing = style.getPropertyValue("box-sizing");
  18048. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  18049. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  18050. const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";");
  18051. return { contextStyle, paddingSize, borderSize, boxSizing };
  18052. }
  18053. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  18054. var _a2;
  18055. if (!hiddenTextarea) {
  18056. hiddenTextarea = document.createElement("textarea");
  18057. document.body.appendChild(hiddenTextarea);
  18058. }
  18059. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  18060. hiddenTextarea.setAttribute("style", `${contextStyle};${HIDDEN_STYLE}`);
  18061. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  18062. let height2 = hiddenTextarea.scrollHeight;
  18063. const result = {};
  18064. if (boxSizing === "border-box") {
  18065. height2 = height2 + borderSize;
  18066. } else if (boxSizing === "content-box") {
  18067. height2 = height2 - paddingSize;
  18068. }
  18069. hiddenTextarea.value = "";
  18070. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  18071. if (isNumber(minRows)) {
  18072. let minHeight = singleRowHeight * minRows;
  18073. if (boxSizing === "border-box") {
  18074. minHeight = minHeight + paddingSize + borderSize;
  18075. }
  18076. height2 = Math.max(minHeight, height2);
  18077. result.minHeight = `${minHeight}px`;
  18078. }
  18079. if (isNumber(maxRows)) {
  18080. let maxHeight = singleRowHeight * maxRows;
  18081. if (boxSizing === "border-box") {
  18082. maxHeight = maxHeight + paddingSize + borderSize;
  18083. }
  18084. height2 = Math.min(maxHeight, height2);
  18085. }
  18086. result.height = `${height2}px`;
  18087. (_a2 = hiddenTextarea.parentNode) == null ? void 0 : _a2.removeChild(hiddenTextarea);
  18088. hiddenTextarea = void 0;
  18089. return result;
  18090. }
  18091. const inputProps = buildProps({
  18092. id: {
  18093. type: String,
  18094. default: void 0
  18095. },
  18096. size: useSizeProp,
  18097. disabled: Boolean,
  18098. modelValue: {
  18099. type: definePropType([
  18100. String,
  18101. Number,
  18102. Object
  18103. ]),
  18104. default: ""
  18105. },
  18106. type: {
  18107. type: String,
  18108. default: "text"
  18109. },
  18110. resize: {
  18111. type: String,
  18112. values: ["none", "both", "horizontal", "vertical"]
  18113. },
  18114. autosize: {
  18115. type: definePropType([Boolean, Object]),
  18116. default: false
  18117. },
  18118. autocomplete: {
  18119. type: String,
  18120. default: "off"
  18121. },
  18122. formatter: {
  18123. type: Function
  18124. },
  18125. parser: {
  18126. type: Function
  18127. },
  18128. placeholder: {
  18129. type: String
  18130. },
  18131. form: {
  18132. type: String
  18133. },
  18134. readonly: {
  18135. type: Boolean,
  18136. default: false
  18137. },
  18138. clearable: {
  18139. type: Boolean,
  18140. default: false
  18141. },
  18142. showPassword: {
  18143. type: Boolean,
  18144. default: false
  18145. },
  18146. showWordLimit: {
  18147. type: Boolean,
  18148. default: false
  18149. },
  18150. suffixIcon: {
  18151. type: iconPropType
  18152. },
  18153. prefixIcon: {
  18154. type: iconPropType
  18155. },
  18156. containerRole: {
  18157. type: String,
  18158. default: void 0
  18159. },
  18160. label: {
  18161. type: String,
  18162. default: void 0
  18163. },
  18164. tabindex: {
  18165. type: [String, Number],
  18166. default: 0
  18167. },
  18168. validateEvent: {
  18169. type: Boolean,
  18170. default: true
  18171. },
  18172. inputStyle: {
  18173. type: definePropType([Object, Array, String]),
  18174. default: () => mutable({})
  18175. }
  18176. });
  18177. const inputEmits = {
  18178. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  18179. input: (value) => isString(value),
  18180. change: (value) => isString(value),
  18181. focus: (evt) => evt instanceof FocusEvent,
  18182. blur: (evt) => evt instanceof FocusEvent,
  18183. clear: () => true,
  18184. mouseleave: (evt) => evt instanceof MouseEvent,
  18185. mouseenter: (evt) => evt instanceof MouseEvent,
  18186. keydown: (evt) => evt instanceof Event,
  18187. compositionstart: (evt) => evt instanceof CompositionEvent,
  18188. compositionupdate: (evt) => evt instanceof CompositionEvent,
  18189. compositionend: (evt) => evt instanceof CompositionEvent
  18190. };
  18191. const _hoisted_1$g = ["role"];
  18192. const _hoisted_2$a = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"];
  18193. const _hoisted_3$6 = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"];
  18194. const __default__$n = defineComponent({
  18195. name: "ElInput",
  18196. inheritAttrs: false
  18197. });
  18198. const _sfc_main$A = /* @__PURE__ */ defineComponent({
  18199. ...__default__$n,
  18200. props: inputProps,
  18201. emits: inputEmits,
  18202. setup(__props, { expose, emit }) {
  18203. const props = __props;
  18204. const rawAttrs = useAttrs$1();
  18205. const slots = useSlots();
  18206. const containerAttrs = computed$1(() => {
  18207. const comboBoxAttrs = {};
  18208. if (props.containerRole === "combobox") {
  18209. comboBoxAttrs["aria-haspopup"] = rawAttrs["aria-haspopup"];
  18210. comboBoxAttrs["aria-owns"] = rawAttrs["aria-owns"];
  18211. comboBoxAttrs["aria-expanded"] = rawAttrs["aria-expanded"];
  18212. }
  18213. return comboBoxAttrs;
  18214. });
  18215. const containerKls = computed$1(() => [
  18216. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  18217. nsInput.m(inputSize.value),
  18218. nsInput.is("disabled", inputDisabled.value),
  18219. nsInput.is("exceed", inputExceed.value),
  18220. {
  18221. [nsInput.b("group")]: slots.prepend || slots.append,
  18222. [nsInput.bm("group", "append")]: slots.append,
  18223. [nsInput.bm("group", "prepend")]: slots.prepend,
  18224. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  18225. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  18226. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value
  18227. },
  18228. rawAttrs.class
  18229. ]);
  18230. const wrapperKls = computed$1(() => [
  18231. nsInput.e("wrapper"),
  18232. nsInput.is("focus", focused.value)
  18233. ]);
  18234. const attrs = useAttrs({
  18235. excludeKeys: computed$1(() => {
  18236. return Object.keys(containerAttrs.value);
  18237. })
  18238. });
  18239. const { form, formItem } = useFormItem();
  18240. const { inputId } = useFormItemInputId(props, {
  18241. formItemContext: formItem
  18242. });
  18243. const inputSize = useFormSize();
  18244. const inputDisabled = useFormDisabled();
  18245. const nsInput = useNamespace("input");
  18246. const nsTextarea = useNamespace("textarea");
  18247. const input = shallowRef();
  18248. const textarea = shallowRef();
  18249. const focused = ref(false);
  18250. const hovering = ref(false);
  18251. const isComposing = ref(false);
  18252. const passwordVisible = ref(false);
  18253. const countStyle = ref();
  18254. const textareaCalcStyle = shallowRef(props.inputStyle);
  18255. const _ref = computed$1(() => input.value || textarea.value);
  18256. const needStatusIcon = computed$1(() => {
  18257. var _a2;
  18258. return (_a2 = form == null ? void 0 : form.statusIcon) != null ? _a2 : false;
  18259. });
  18260. const validateState = computed$1(() => (formItem == null ? void 0 : formItem.validateState) || "");
  18261. const validateIcon = computed$1(() => validateState.value && ValidateComponentsMap[validateState.value]);
  18262. const passwordIcon = computed$1(() => passwordVisible.value ? view_default : hide_default);
  18263. const containerStyle = computed$1(() => [
  18264. rawAttrs.style,
  18265. props.inputStyle
  18266. ]);
  18267. const textareaStyle = computed$1(() => [
  18268. props.inputStyle,
  18269. textareaCalcStyle.value,
  18270. { resize: props.resize }
  18271. ]);
  18272. const nativeInputValue = computed$1(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  18273. const showClear = computed$1(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
  18274. const showPwdVisible = computed$1(() => props.showPassword && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (!!nativeInputValue.value || focused.value));
  18275. const isWordLimitVisible = computed$1(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  18276. const textLength = computed$1(() => nativeInputValue.value.length);
  18277. const inputExceed = computed$1(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
  18278. const suffixVisible = computed$1(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  18279. const [recordCursor, setCursor] = useCursor(input);
  18280. useResizeObserver(textarea, (entries) => {
  18281. onceInitSizeTextarea();
  18282. if (!isWordLimitVisible.value || props.resize !== "both")
  18283. return;
  18284. const entry = entries[0];
  18285. const { width: width2 } = entry.contentRect;
  18286. countStyle.value = {
  18287. right: `calc(100% - ${width2 + 15 + 6}px)`
  18288. };
  18289. });
  18290. const resizeTextarea = () => {
  18291. const { type: type2, autosize } = props;
  18292. if (!isClient || type2 !== "textarea" || !textarea.value)
  18293. return;
  18294. if (autosize) {
  18295. const minRows = isObject$5(autosize) ? autosize.minRows : void 0;
  18296. const maxRows = isObject$5(autosize) ? autosize.maxRows : void 0;
  18297. const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
  18298. textareaCalcStyle.value = {
  18299. overflowY: "hidden",
  18300. ...textareaStyle2
  18301. };
  18302. nextTick(() => {
  18303. textarea.value.offsetHeight;
  18304. textareaCalcStyle.value = textareaStyle2;
  18305. });
  18306. } else {
  18307. textareaCalcStyle.value = {
  18308. minHeight: calcTextareaHeight(textarea.value).minHeight
  18309. };
  18310. }
  18311. };
  18312. const createOnceInitResize = (resizeTextarea2) => {
  18313. let isInit = false;
  18314. return () => {
  18315. var _a2;
  18316. if (isInit || !props.autosize)
  18317. return;
  18318. const isElHidden = ((_a2 = textarea.value) == null ? void 0 : _a2.offsetParent) === null;
  18319. if (!isElHidden) {
  18320. resizeTextarea2();
  18321. isInit = true;
  18322. }
  18323. };
  18324. };
  18325. const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
  18326. const setNativeInputValue = () => {
  18327. const input2 = _ref.value;
  18328. if (!input2 || input2.value === nativeInputValue.value)
  18329. return;
  18330. input2.value = nativeInputValue.value;
  18331. };
  18332. const handleInput = async (event2) => {
  18333. recordCursor();
  18334. let { value } = event2.target;
  18335. if (props.formatter) {
  18336. value = props.parser ? props.parser(value) : value;
  18337. value = props.formatter(value);
  18338. }
  18339. if (isComposing.value)
  18340. return;
  18341. if (value === nativeInputValue.value) {
  18342. setNativeInputValue();
  18343. return;
  18344. }
  18345. emit(UPDATE_MODEL_EVENT, value);
  18346. emit("input", value);
  18347. await nextTick();
  18348. setNativeInputValue();
  18349. setCursor();
  18350. };
  18351. const handleChange = (event2) => {
  18352. emit("change", event2.target.value);
  18353. };
  18354. const handleCompositionStart = (event2) => {
  18355. emit("compositionstart", event2);
  18356. isComposing.value = true;
  18357. };
  18358. const handleCompositionUpdate = (event2) => {
  18359. var _a2;
  18360. emit("compositionupdate", event2);
  18361. const text = (_a2 = event2.target) == null ? void 0 : _a2.value;
  18362. const lastCharacter = text[text.length - 1] || "";
  18363. isComposing.value = !isKorean(lastCharacter);
  18364. };
  18365. const handleCompositionEnd = (event2) => {
  18366. emit("compositionend", event2);
  18367. if (isComposing.value) {
  18368. isComposing.value = false;
  18369. handleInput(event2);
  18370. }
  18371. };
  18372. const handlePasswordVisible = () => {
  18373. passwordVisible.value = !passwordVisible.value;
  18374. focus();
  18375. };
  18376. const focus = async () => {
  18377. var _a2;
  18378. await nextTick();
  18379. (_a2 = _ref.value) == null ? void 0 : _a2.focus();
  18380. };
  18381. const blur = () => {
  18382. var _a2;
  18383. return (_a2 = _ref.value) == null ? void 0 : _a2.blur();
  18384. };
  18385. const handleFocus = (event2) => {
  18386. focused.value = true;
  18387. emit("focus", event2);
  18388. };
  18389. const handleBlur = (event2) => {
  18390. var _a2;
  18391. focused.value = false;
  18392. emit("blur", event2);
  18393. if (props.validateEvent) {
  18394. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  18395. }
  18396. };
  18397. const handleMouseLeave = (evt) => {
  18398. hovering.value = false;
  18399. emit("mouseleave", evt);
  18400. };
  18401. const handleMouseEnter = (evt) => {
  18402. hovering.value = true;
  18403. emit("mouseenter", evt);
  18404. };
  18405. const handleKeydown = (evt) => {
  18406. emit("keydown", evt);
  18407. };
  18408. const select = () => {
  18409. var _a2;
  18410. (_a2 = _ref.value) == null ? void 0 : _a2.select();
  18411. };
  18412. const clear = () => {
  18413. emit(UPDATE_MODEL_EVENT, "");
  18414. emit("change", "");
  18415. emit("clear");
  18416. emit("input", "");
  18417. };
  18418. watch(() => props.modelValue, () => {
  18419. var _a2;
  18420. nextTick(() => resizeTextarea());
  18421. if (props.validateEvent) {
  18422. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  18423. }
  18424. });
  18425. watch(nativeInputValue, () => setNativeInputValue());
  18426. watch(() => props.type, async () => {
  18427. await nextTick();
  18428. setNativeInputValue();
  18429. resizeTextarea();
  18430. });
  18431. onMounted(() => {
  18432. if (!props.formatter && props.parser)
  18433. ;
  18434. setNativeInputValue();
  18435. nextTick(resizeTextarea);
  18436. });
  18437. expose({
  18438. input,
  18439. textarea,
  18440. ref: _ref,
  18441. textareaStyle,
  18442. autosize: toRef(props, "autosize"),
  18443. focus,
  18444. blur,
  18445. select,
  18446. clear,
  18447. resizeTextarea
  18448. });
  18449. return (_ctx, _cache) => {
  18450. return withDirectives((openBlock(), createElementBlock("div", mergeProps(unref(containerAttrs), {
  18451. class: unref(containerKls),
  18452. style: unref(containerStyle),
  18453. role: _ctx.containerRole,
  18454. onMouseenter: handleMouseEnter,
  18455. onMouseleave: handleMouseLeave
  18456. }), [
  18457. createCommentVNode(" input "),
  18458. _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18459. createCommentVNode(" prepend slot "),
  18460. _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
  18461. key: 0,
  18462. class: normalizeClass(unref(nsInput).be("group", "prepend"))
  18463. }, [
  18464. renderSlot(_ctx.$slots, "prepend")
  18465. ], 2)) : createCommentVNode("v-if", true),
  18466. createElementVNode("div", {
  18467. class: normalizeClass(unref(wrapperKls))
  18468. }, [
  18469. createCommentVNode(" prefix slot "),
  18470. _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
  18471. key: 0,
  18472. class: normalizeClass(unref(nsInput).e("prefix"))
  18473. }, [
  18474. createElementVNode("span", {
  18475. class: normalizeClass(unref(nsInput).e("prefix-inner")),
  18476. onClick: focus
  18477. }, [
  18478. renderSlot(_ctx.$slots, "prefix"),
  18479. _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18480. key: 0,
  18481. class: normalizeClass(unref(nsInput).e("icon"))
  18482. }, {
  18483. default: withCtx(() => [
  18484. (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
  18485. ]),
  18486. _: 1
  18487. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18488. ], 2)
  18489. ], 2)) : createCommentVNode("v-if", true),
  18490. createElementVNode("input", mergeProps({
  18491. id: unref(inputId),
  18492. ref_key: "input",
  18493. ref: input,
  18494. class: unref(nsInput).e("inner")
  18495. }, unref(attrs), {
  18496. type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
  18497. disabled: unref(inputDisabled),
  18498. formatter: _ctx.formatter,
  18499. parser: _ctx.parser,
  18500. readonly: _ctx.readonly,
  18501. autocomplete: _ctx.autocomplete,
  18502. tabindex: _ctx.tabindex,
  18503. "aria-label": _ctx.label,
  18504. placeholder: _ctx.placeholder,
  18505. style: _ctx.inputStyle,
  18506. form: props.form,
  18507. onCompositionstart: handleCompositionStart,
  18508. onCompositionupdate: handleCompositionUpdate,
  18509. onCompositionend: handleCompositionEnd,
  18510. onInput: handleInput,
  18511. onFocus: handleFocus,
  18512. onBlur: handleBlur,
  18513. onChange: handleChange,
  18514. onKeydown: handleKeydown
  18515. }), null, 16, _hoisted_2$a),
  18516. createCommentVNode(" suffix slot "),
  18517. unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
  18518. key: 1,
  18519. class: normalizeClass(unref(nsInput).e("suffix"))
  18520. }, [
  18521. createElementVNode("span", {
  18522. class: normalizeClass(unref(nsInput).e("suffix-inner")),
  18523. onClick: focus
  18524. }, [
  18525. !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18526. renderSlot(_ctx.$slots, "suffix"),
  18527. _ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18528. key: 0,
  18529. class: normalizeClass(unref(nsInput).e("icon"))
  18530. }, {
  18531. default: withCtx(() => [
  18532. (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
  18533. ]),
  18534. _: 1
  18535. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18536. ], 64)) : createCommentVNode("v-if", true),
  18537. unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
  18538. key: 1,
  18539. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
  18540. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  18541. onClick: clear
  18542. }, {
  18543. default: withCtx(() => [
  18544. createVNode(unref(circle_close_default))
  18545. ]),
  18546. _: 1
  18547. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
  18548. unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
  18549. key: 2,
  18550. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
  18551. onClick: handlePasswordVisible
  18552. }, {
  18553. default: withCtx(() => [
  18554. (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
  18555. ]),
  18556. _: 1
  18557. }, 8, ["class"])) : createCommentVNode("v-if", true),
  18558. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18559. key: 3,
  18560. class: normalizeClass(unref(nsInput).e("count"))
  18561. }, [
  18562. createElementVNode("span", {
  18563. class: normalizeClass(unref(nsInput).e("count-inner"))
  18564. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)
  18565. ], 2)) : createCommentVNode("v-if", true),
  18566. unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
  18567. key: 4,
  18568. class: normalizeClass([
  18569. unref(nsInput).e("icon"),
  18570. unref(nsInput).e("validateIcon"),
  18571. unref(nsInput).is("loading", unref(validateState) === "validating")
  18572. ])
  18573. }, {
  18574. default: withCtx(() => [
  18575. (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
  18576. ]),
  18577. _: 1
  18578. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18579. ], 2)
  18580. ], 2)) : createCommentVNode("v-if", true)
  18581. ], 2),
  18582. createCommentVNode(" append slot "),
  18583. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  18584. key: 1,
  18585. class: normalizeClass(unref(nsInput).be("group", "append"))
  18586. }, [
  18587. renderSlot(_ctx.$slots, "append")
  18588. ], 2)) : createCommentVNode("v-if", true)
  18589. ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  18590. createCommentVNode(" textarea "),
  18591. createElementVNode("textarea", mergeProps({
  18592. id: unref(inputId),
  18593. ref_key: "textarea",
  18594. ref: textarea,
  18595. class: unref(nsTextarea).e("inner")
  18596. }, unref(attrs), {
  18597. tabindex: _ctx.tabindex,
  18598. disabled: unref(inputDisabled),
  18599. readonly: _ctx.readonly,
  18600. autocomplete: _ctx.autocomplete,
  18601. style: unref(textareaStyle),
  18602. "aria-label": _ctx.label,
  18603. placeholder: _ctx.placeholder,
  18604. form: props.form,
  18605. onCompositionstart: handleCompositionStart,
  18606. onCompositionupdate: handleCompositionUpdate,
  18607. onCompositionend: handleCompositionEnd,
  18608. onInput: handleInput,
  18609. onFocus: handleFocus,
  18610. onBlur: handleBlur,
  18611. onChange: handleChange,
  18612. onKeydown: handleKeydown
  18613. }), null, 16, _hoisted_3$6),
  18614. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18615. key: 0,
  18616. style: normalizeStyle(countStyle.value),
  18617. class: normalizeClass(unref(nsInput).e("count"))
  18618. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 7)) : createCommentVNode("v-if", true)
  18619. ], 64))
  18620. ], 16, _hoisted_1$g)), [
  18621. [vShow, _ctx.type !== "hidden"]
  18622. ]);
  18623. };
  18624. }
  18625. });
  18626. var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
  18627. const ElInput = withInstall(Input);
  18628. const GAP = 4;
  18629. const BAR_MAP = {
  18630. vertical: {
  18631. offset: "offsetHeight",
  18632. scroll: "scrollTop",
  18633. scrollSize: "scrollHeight",
  18634. size: "height",
  18635. key: "vertical",
  18636. axis: "Y",
  18637. client: "clientY",
  18638. direction: "top"
  18639. },
  18640. horizontal: {
  18641. offset: "offsetWidth",
  18642. scroll: "scrollLeft",
  18643. scrollSize: "scrollWidth",
  18644. size: "width",
  18645. key: "horizontal",
  18646. axis: "X",
  18647. client: "clientX",
  18648. direction: "left"
  18649. }
  18650. };
  18651. const renderThumbStyle = ({
  18652. move,
  18653. size,
  18654. bar
  18655. }) => ({
  18656. [bar.size]: size,
  18657. transform: `translate${bar.axis}(${move}%)`
  18658. });
  18659. const scrollbarContextKey = Symbol("scrollbarContextKey");
  18660. const thumbProps = buildProps({
  18661. vertical: Boolean,
  18662. size: String,
  18663. move: Number,
  18664. ratio: {
  18665. type: Number,
  18666. required: true
  18667. },
  18668. always: Boolean
  18669. });
  18670. const COMPONENT_NAME$4 = "Thumb";
  18671. const _sfc_main$z = /* @__PURE__ */ defineComponent({
  18672. __name: "thumb",
  18673. props: thumbProps,
  18674. setup(__props) {
  18675. const props = __props;
  18676. const scrollbar = inject(scrollbarContextKey);
  18677. const ns = useNamespace("scrollbar");
  18678. if (!scrollbar)
  18679. throwError(COMPONENT_NAME$4, "can not inject scrollbar context");
  18680. const instance = ref();
  18681. const thumb = ref();
  18682. const thumbState = ref({});
  18683. const visible = ref(false);
  18684. let cursorDown = false;
  18685. let cursorLeave = false;
  18686. let originalOnSelectStart = isClient ? document.onselectstart : null;
  18687. const bar = computed$1(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  18688. const thumbStyle = computed$1(() => renderThumbStyle({
  18689. size: props.size,
  18690. move: props.move,
  18691. bar: bar.value
  18692. }));
  18693. const offsetRatio = computed$1(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  18694. const clickThumbHandler = (e) => {
  18695. var _a2;
  18696. e.stopPropagation();
  18697. if (e.ctrlKey || [1, 2].includes(e.button))
  18698. return;
  18699. (_a2 = window.getSelection()) == null ? void 0 : _a2.removeAllRanges();
  18700. startDrag(e);
  18701. const el = e.currentTarget;
  18702. if (!el)
  18703. return;
  18704. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  18705. };
  18706. const clickTrackHandler = (e) => {
  18707. if (!thumb.value || !instance.value || !scrollbar.wrapElement)
  18708. return;
  18709. const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
  18710. const thumbHalf = thumb.value[bar.value.offset] / 2;
  18711. const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18712. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18713. };
  18714. const startDrag = (e) => {
  18715. e.stopImmediatePropagation();
  18716. cursorDown = true;
  18717. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  18718. document.addEventListener("mouseup", mouseUpDocumentHandler);
  18719. originalOnSelectStart = document.onselectstart;
  18720. document.onselectstart = () => false;
  18721. };
  18722. const mouseMoveDocumentHandler = (e) => {
  18723. if (!instance.value || !thumb.value)
  18724. return;
  18725. if (cursorDown === false)
  18726. return;
  18727. const prevPage = thumbState.value[bar.value.axis];
  18728. if (!prevPage)
  18729. return;
  18730. const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
  18731. const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
  18732. const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18733. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18734. };
  18735. const mouseUpDocumentHandler = () => {
  18736. cursorDown = false;
  18737. thumbState.value[bar.value.axis] = 0;
  18738. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  18739. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18740. restoreOnselectstart();
  18741. if (cursorLeave)
  18742. visible.value = false;
  18743. };
  18744. const mouseMoveScrollbarHandler = () => {
  18745. cursorLeave = false;
  18746. visible.value = !!props.size;
  18747. };
  18748. const mouseLeaveScrollbarHandler = () => {
  18749. cursorLeave = true;
  18750. visible.value = cursorDown;
  18751. };
  18752. onBeforeUnmount(() => {
  18753. restoreOnselectstart();
  18754. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18755. });
  18756. const restoreOnselectstart = () => {
  18757. if (document.onselectstart !== originalOnSelectStart)
  18758. document.onselectstart = originalOnSelectStart;
  18759. };
  18760. useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  18761. useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  18762. return (_ctx, _cache) => {
  18763. return openBlock(), createBlock(Transition, {
  18764. name: unref(ns).b("fade"),
  18765. persisted: ""
  18766. }, {
  18767. default: withCtx(() => [
  18768. withDirectives(createElementVNode("div", {
  18769. ref_key: "instance",
  18770. ref: instance,
  18771. class: normalizeClass([unref(ns).e("bar"), unref(ns).is(unref(bar).key)]),
  18772. onMousedown: clickTrackHandler
  18773. }, [
  18774. createElementVNode("div", {
  18775. ref_key: "thumb",
  18776. ref: thumb,
  18777. class: normalizeClass(unref(ns).e("thumb")),
  18778. style: normalizeStyle(unref(thumbStyle)),
  18779. onMousedown: clickThumbHandler
  18780. }, null, 38)
  18781. ], 34), [
  18782. [vShow, _ctx.always || visible.value]
  18783. ])
  18784. ]),
  18785. _: 1
  18786. }, 8, ["name"]);
  18787. };
  18788. }
  18789. });
  18790. var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);
  18791. const barProps = buildProps({
  18792. always: {
  18793. type: Boolean,
  18794. default: true
  18795. },
  18796. width: String,
  18797. height: String,
  18798. ratioX: {
  18799. type: Number,
  18800. default: 1
  18801. },
  18802. ratioY: {
  18803. type: Number,
  18804. default: 1
  18805. }
  18806. });
  18807. const _sfc_main$y = /* @__PURE__ */ defineComponent({
  18808. __name: "bar",
  18809. props: barProps,
  18810. setup(__props, { expose }) {
  18811. const props = __props;
  18812. const moveX = ref(0);
  18813. const moveY = ref(0);
  18814. const handleScroll = (wrap) => {
  18815. if (wrap) {
  18816. const offsetHeight = wrap.offsetHeight - GAP;
  18817. const offsetWidth = wrap.offsetWidth - GAP;
  18818. moveY.value = wrap.scrollTop * 100 / offsetHeight * props.ratioY;
  18819. moveX.value = wrap.scrollLeft * 100 / offsetWidth * props.ratioX;
  18820. }
  18821. };
  18822. expose({
  18823. handleScroll
  18824. });
  18825. return (_ctx, _cache) => {
  18826. return openBlock(), createElementBlock(Fragment, null, [
  18827. createVNode(Thumb, {
  18828. move: moveX.value,
  18829. ratio: _ctx.ratioX,
  18830. size: _ctx.width,
  18831. always: _ctx.always
  18832. }, null, 8, ["move", "ratio", "size", "always"]),
  18833. createVNode(Thumb, {
  18834. move: moveY.value,
  18835. ratio: _ctx.ratioY,
  18836. size: _ctx.height,
  18837. vertical: "",
  18838. always: _ctx.always
  18839. }, null, 8, ["move", "ratio", "size", "always"])
  18840. ], 64);
  18841. };
  18842. }
  18843. });
  18844. var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);
  18845. const scrollbarProps = buildProps({
  18846. height: {
  18847. type: [String, Number],
  18848. default: ""
  18849. },
  18850. maxHeight: {
  18851. type: [String, Number],
  18852. default: ""
  18853. },
  18854. native: {
  18855. type: Boolean,
  18856. default: false
  18857. },
  18858. wrapStyle: {
  18859. type: definePropType([String, Object, Array]),
  18860. default: ""
  18861. },
  18862. wrapClass: {
  18863. type: [String, Array],
  18864. default: ""
  18865. },
  18866. viewClass: {
  18867. type: [String, Array],
  18868. default: ""
  18869. },
  18870. viewStyle: {
  18871. type: [String, Array, Object],
  18872. default: ""
  18873. },
  18874. noresize: Boolean,
  18875. tag: {
  18876. type: String,
  18877. default: "div"
  18878. },
  18879. always: Boolean,
  18880. minSize: {
  18881. type: Number,
  18882. default: 20
  18883. }
  18884. });
  18885. const scrollbarEmits = {
  18886. scroll: ({
  18887. scrollTop,
  18888. scrollLeft
  18889. }) => [scrollTop, scrollLeft].every(isNumber)
  18890. };
  18891. const COMPONENT_NAME$3 = "ElScrollbar";
  18892. const __default__$m = defineComponent({
  18893. name: COMPONENT_NAME$3
  18894. });
  18895. const _sfc_main$x = /* @__PURE__ */ defineComponent({
  18896. ...__default__$m,
  18897. props: scrollbarProps,
  18898. emits: scrollbarEmits,
  18899. setup(__props, { expose, emit }) {
  18900. const props = __props;
  18901. const ns = useNamespace("scrollbar");
  18902. let stopResizeObserver = void 0;
  18903. let stopResizeListener = void 0;
  18904. const scrollbarRef = ref();
  18905. const wrapRef = ref();
  18906. const resizeRef = ref();
  18907. const sizeWidth = ref("0");
  18908. const sizeHeight = ref("0");
  18909. const barRef = ref();
  18910. const ratioY = ref(1);
  18911. const ratioX = ref(1);
  18912. const style = computed$1(() => {
  18913. const style2 = {};
  18914. if (props.height)
  18915. style2.height = addUnit(props.height);
  18916. if (props.maxHeight)
  18917. style2.maxHeight = addUnit(props.maxHeight);
  18918. return [props.wrapStyle, style2];
  18919. });
  18920. const wrapKls = computed$1(() => {
  18921. return [
  18922. props.wrapClass,
  18923. ns.e("wrap"),
  18924. { [ns.em("wrap", "hidden-default")]: !props.native }
  18925. ];
  18926. });
  18927. const resizeKls = computed$1(() => {
  18928. return [ns.e("view"), props.viewClass];
  18929. });
  18930. const handleScroll = () => {
  18931. var _a2;
  18932. if (wrapRef.value) {
  18933. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  18934. emit("scroll", {
  18935. scrollTop: wrapRef.value.scrollTop,
  18936. scrollLeft: wrapRef.value.scrollLeft
  18937. });
  18938. }
  18939. };
  18940. function scrollTo(arg1, arg2) {
  18941. if (isObject$5(arg1)) {
  18942. wrapRef.value.scrollTo(arg1);
  18943. } else if (isNumber(arg1) && isNumber(arg2)) {
  18944. wrapRef.value.scrollTo(arg1, arg2);
  18945. }
  18946. }
  18947. const setScrollTop = (value) => {
  18948. if (!isNumber(value)) {
  18949. return;
  18950. }
  18951. wrapRef.value.scrollTop = value;
  18952. };
  18953. const setScrollLeft = (value) => {
  18954. if (!isNumber(value)) {
  18955. return;
  18956. }
  18957. wrapRef.value.scrollLeft = value;
  18958. };
  18959. const update = () => {
  18960. if (!wrapRef.value)
  18961. return;
  18962. const offsetHeight = wrapRef.value.offsetHeight - GAP;
  18963. const offsetWidth = wrapRef.value.offsetWidth - GAP;
  18964. const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
  18965. const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
  18966. const height2 = Math.max(originalHeight, props.minSize);
  18967. const width2 = Math.max(originalWidth, props.minSize);
  18968. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height2 / (offsetHeight - height2));
  18969. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width2 / (offsetWidth - width2));
  18970. sizeHeight.value = height2 + GAP < offsetHeight ? `${height2}px` : "";
  18971. sizeWidth.value = width2 + GAP < offsetWidth ? `${width2}px` : "";
  18972. };
  18973. watch(() => props.noresize, (noresize) => {
  18974. if (noresize) {
  18975. stopResizeObserver == null ? void 0 : stopResizeObserver();
  18976. stopResizeListener == null ? void 0 : stopResizeListener();
  18977. } else {
  18978. ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
  18979. stopResizeListener = useEventListener("resize", update);
  18980. }
  18981. }, { immediate: true });
  18982. watch(() => [props.maxHeight, props.height], () => {
  18983. if (!props.native)
  18984. nextTick(() => {
  18985. var _a2;
  18986. update();
  18987. if (wrapRef.value) {
  18988. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  18989. }
  18990. });
  18991. });
  18992. provide(scrollbarContextKey, reactive({
  18993. scrollbarElement: scrollbarRef,
  18994. wrapElement: wrapRef
  18995. }));
  18996. onMounted(() => {
  18997. if (!props.native)
  18998. nextTick(() => {
  18999. update();
  19000. });
  19001. });
  19002. onUpdated(() => update());
  19003. expose({
  19004. wrapRef,
  19005. update,
  19006. scrollTo,
  19007. setScrollTop,
  19008. setScrollLeft,
  19009. handleScroll
  19010. });
  19011. return (_ctx, _cache) => {
  19012. return openBlock(), createElementBlock("div", {
  19013. ref_key: "scrollbarRef",
  19014. ref: scrollbarRef,
  19015. class: normalizeClass(unref(ns).b())
  19016. }, [
  19017. createElementVNode("div", {
  19018. ref_key: "wrapRef",
  19019. ref: wrapRef,
  19020. class: normalizeClass(unref(wrapKls)),
  19021. style: normalizeStyle(unref(style)),
  19022. onScroll: handleScroll
  19023. }, [
  19024. (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
  19025. ref_key: "resizeRef",
  19026. ref: resizeRef,
  19027. class: normalizeClass(unref(resizeKls)),
  19028. style: normalizeStyle(_ctx.viewStyle)
  19029. }, {
  19030. default: withCtx(() => [
  19031. renderSlot(_ctx.$slots, "default")
  19032. ]),
  19033. _: 3
  19034. }, 8, ["class", "style"]))
  19035. ], 38),
  19036. !_ctx.native ? (openBlock(), createBlock(Bar, {
  19037. key: 0,
  19038. ref_key: "barRef",
  19039. ref: barRef,
  19040. height: sizeHeight.value,
  19041. width: sizeWidth.value,
  19042. always: _ctx.always,
  19043. "ratio-x": ratioX.value,
  19044. "ratio-y": ratioY.value
  19045. }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
  19046. ], 2);
  19047. };
  19048. }
  19049. });
  19050. var Scrollbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
  19051. const ElScrollbar = withInstall(Scrollbar);
  19052. const POPPER_INJECTION_KEY = Symbol("popper");
  19053. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  19054. const roleTypes = [
  19055. "dialog",
  19056. "grid",
  19057. "group",
  19058. "listbox",
  19059. "menu",
  19060. "navigation",
  19061. "tooltip",
  19062. "tree"
  19063. ];
  19064. const popperProps = buildProps({
  19065. role: {
  19066. type: String,
  19067. values: roleTypes,
  19068. default: "tooltip"
  19069. }
  19070. });
  19071. const __default__$l = defineComponent({
  19072. name: "ElPopper",
  19073. inheritAttrs: false
  19074. });
  19075. const _sfc_main$w = /* @__PURE__ */ defineComponent({
  19076. ...__default__$l,
  19077. props: popperProps,
  19078. setup(__props, { expose }) {
  19079. const props = __props;
  19080. const triggerRef2 = ref();
  19081. const popperInstanceRef = ref();
  19082. const contentRef = ref();
  19083. const referenceRef = ref();
  19084. const role = computed$1(() => props.role);
  19085. const popperProvides = {
  19086. triggerRef: triggerRef2,
  19087. popperInstanceRef,
  19088. contentRef,
  19089. referenceRef,
  19090. role
  19091. };
  19092. expose(popperProvides);
  19093. provide(POPPER_INJECTION_KEY, popperProvides);
  19094. return (_ctx, _cache) => {
  19095. return renderSlot(_ctx.$slots, "default");
  19096. };
  19097. }
  19098. });
  19099. var Popper = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/popper.vue"]]);
  19100. const popperArrowProps = buildProps({
  19101. arrowOffset: {
  19102. type: Number,
  19103. default: 5
  19104. }
  19105. });
  19106. const __default__$k = defineComponent({
  19107. name: "ElPopperArrow",
  19108. inheritAttrs: false
  19109. });
  19110. const _sfc_main$v = /* @__PURE__ */ defineComponent({
  19111. ...__default__$k,
  19112. props: popperArrowProps,
  19113. setup(__props, { expose }) {
  19114. const props = __props;
  19115. const ns = useNamespace("popper");
  19116. const { arrowOffset, arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
  19117. watch(() => props.arrowOffset, (val) => {
  19118. arrowOffset.value = val;
  19119. });
  19120. onBeforeUnmount(() => {
  19121. arrowRef.value = void 0;
  19122. });
  19123. expose({
  19124. arrowRef
  19125. });
  19126. return (_ctx, _cache) => {
  19127. return openBlock(), createElementBlock("span", {
  19128. ref_key: "arrowRef",
  19129. ref: arrowRef,
  19130. class: normalizeClass(unref(ns).e("arrow")),
  19131. style: normalizeStyle(unref(arrowStyle)),
  19132. "data-popper-arrow": ""
  19133. }, null, 6);
  19134. };
  19135. }
  19136. });
  19137. var ElPopperArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);
  19138. const NAME = "ElOnlyChild";
  19139. const OnlyChild = defineComponent({
  19140. name: NAME,
  19141. setup(_, {
  19142. slots,
  19143. attrs
  19144. }) {
  19145. var _a2;
  19146. const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
  19147. const forwardRefDirective = useForwardRefDirective((_a2 = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a2 : NOOP);
  19148. return () => {
  19149. var _a22;
  19150. const defaultSlot = (_a22 = slots.default) == null ? void 0 : _a22.call(slots, attrs);
  19151. if (!defaultSlot)
  19152. return null;
  19153. if (defaultSlot.length > 1) {
  19154. return null;
  19155. }
  19156. const firstLegitNode = findFirstLegitChild(defaultSlot);
  19157. if (!firstLegitNode) {
  19158. return null;
  19159. }
  19160. return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
  19161. };
  19162. }
  19163. });
  19164. function findFirstLegitChild(node) {
  19165. if (!node)
  19166. return null;
  19167. const children = node;
  19168. for (const child of children) {
  19169. if (isObject$5(child)) {
  19170. switch (child.type) {
  19171. case Comment$1:
  19172. continue;
  19173. case Text$1:
  19174. case "svg":
  19175. return wrapTextContent(child);
  19176. case Fragment:
  19177. return findFirstLegitChild(child.children);
  19178. default:
  19179. return child;
  19180. }
  19181. }
  19182. return wrapTextContent(child);
  19183. }
  19184. return null;
  19185. }
  19186. function wrapTextContent(s) {
  19187. const ns = useNamespace("only-child");
  19188. return createVNode("span", {
  19189. "class": ns.e("content")
  19190. }, [s]);
  19191. }
  19192. const popperTriggerProps = buildProps({
  19193. virtualRef: {
  19194. type: definePropType(Object)
  19195. },
  19196. virtualTriggering: Boolean,
  19197. onMouseenter: {
  19198. type: definePropType(Function)
  19199. },
  19200. onMouseleave: {
  19201. type: definePropType(Function)
  19202. },
  19203. onClick: {
  19204. type: definePropType(Function)
  19205. },
  19206. onKeydown: {
  19207. type: definePropType(Function)
  19208. },
  19209. onFocus: {
  19210. type: definePropType(Function)
  19211. },
  19212. onBlur: {
  19213. type: definePropType(Function)
  19214. },
  19215. onContextmenu: {
  19216. type: definePropType(Function)
  19217. },
  19218. id: String,
  19219. open: Boolean
  19220. });
  19221. const __default__$j = defineComponent({
  19222. name: "ElPopperTrigger",
  19223. inheritAttrs: false
  19224. });
  19225. const _sfc_main$u = /* @__PURE__ */ defineComponent({
  19226. ...__default__$j,
  19227. props: popperTriggerProps,
  19228. setup(__props, { expose }) {
  19229. const props = __props;
  19230. const { role, triggerRef: triggerRef2 } = inject(POPPER_INJECTION_KEY, void 0);
  19231. useForwardRef(triggerRef2);
  19232. const ariaControls = computed$1(() => {
  19233. return ariaHaspopup.value ? props.id : void 0;
  19234. });
  19235. const ariaDescribedby = computed$1(() => {
  19236. if (role && role.value === "tooltip") {
  19237. return props.open && props.id ? props.id : void 0;
  19238. }
  19239. return void 0;
  19240. });
  19241. const ariaHaspopup = computed$1(() => {
  19242. if (role && role.value !== "tooltip") {
  19243. return role.value;
  19244. }
  19245. return void 0;
  19246. });
  19247. const ariaExpanded = computed$1(() => {
  19248. return ariaHaspopup.value ? `${props.open}` : void 0;
  19249. });
  19250. let virtualTriggerAriaStopWatch = void 0;
  19251. onMounted(() => {
  19252. watch(() => props.virtualRef, (virtualEl) => {
  19253. if (virtualEl) {
  19254. triggerRef2.value = unrefElement(virtualEl);
  19255. }
  19256. }, {
  19257. immediate: true
  19258. });
  19259. watch(triggerRef2, (el, prevEl) => {
  19260. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19261. virtualTriggerAriaStopWatch = void 0;
  19262. if (isElement(el)) {
  19263. [
  19264. "onMouseenter",
  19265. "onMouseleave",
  19266. "onClick",
  19267. "onKeydown",
  19268. "onFocus",
  19269. "onBlur",
  19270. "onContextmenu"
  19271. ].forEach((eventName) => {
  19272. var _a2;
  19273. const handler = props[eventName];
  19274. if (handler) {
  19275. el.addEventListener(eventName.slice(2).toLowerCase(), handler);
  19276. (_a2 = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a2.call(prevEl, eventName.slice(2).toLowerCase(), handler);
  19277. }
  19278. });
  19279. virtualTriggerAriaStopWatch = watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
  19280. [
  19281. "aria-controls",
  19282. "aria-describedby",
  19283. "aria-haspopup",
  19284. "aria-expanded"
  19285. ].forEach((key, idx) => {
  19286. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  19287. });
  19288. }, { immediate: true });
  19289. }
  19290. if (isElement(prevEl)) {
  19291. [
  19292. "aria-controls",
  19293. "aria-describedby",
  19294. "aria-haspopup",
  19295. "aria-expanded"
  19296. ].forEach((key) => prevEl.removeAttribute(key));
  19297. }
  19298. }, {
  19299. immediate: true
  19300. });
  19301. });
  19302. onBeforeUnmount(() => {
  19303. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19304. virtualTriggerAriaStopWatch = void 0;
  19305. });
  19306. expose({
  19307. triggerRef: triggerRef2
  19308. });
  19309. return (_ctx, _cache) => {
  19310. return !_ctx.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
  19311. "aria-controls": unref(ariaControls),
  19312. "aria-describedby": unref(ariaDescribedby),
  19313. "aria-expanded": unref(ariaExpanded),
  19314. "aria-haspopup": unref(ariaHaspopup)
  19315. }), {
  19316. default: withCtx(() => [
  19317. renderSlot(_ctx.$slots, "default")
  19318. ]),
  19319. _: 3
  19320. }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
  19321. };
  19322. }
  19323. });
  19324. var ElPopperTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);
  19325. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  19326. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  19327. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  19328. const FOCUS_AFTER_TRAPPED_OPTS = {
  19329. cancelable: true,
  19330. bubbles: false
  19331. };
  19332. const FOCUSOUT_PREVENTED_OPTS = {
  19333. cancelable: true,
  19334. bubbles: false
  19335. };
  19336. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  19337. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  19338. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  19339. const focusReason = ref();
  19340. const lastUserFocusTimestamp = ref(0);
  19341. const lastAutomatedFocusTimestamp = ref(0);
  19342. let focusReasonUserCount = 0;
  19343. const obtainAllFocusableElements = (element) => {
  19344. const nodes = [];
  19345. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
  19346. acceptNode: (node) => {
  19347. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  19348. if (node.disabled || node.hidden || isHiddenInput)
  19349. return NodeFilter.FILTER_SKIP;
  19350. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  19351. }
  19352. });
  19353. while (walker.nextNode())
  19354. nodes.push(walker.currentNode);
  19355. return nodes;
  19356. };
  19357. const getVisibleElement = (elements, container) => {
  19358. for (const element of elements) {
  19359. if (!isHidden(element, container))
  19360. return element;
  19361. }
  19362. };
  19363. const isHidden = (element, container) => {
  19364. if (getComputedStyle(element).visibility === "hidden")
  19365. return true;
  19366. while (element) {
  19367. if (container && element === container)
  19368. return false;
  19369. if (getComputedStyle(element).display === "none")
  19370. return true;
  19371. element = element.parentElement;
  19372. }
  19373. return false;
  19374. };
  19375. const getEdges = (container) => {
  19376. const focusable = obtainAllFocusableElements(container);
  19377. const first = getVisibleElement(focusable, container);
  19378. const last = getVisibleElement(focusable.reverse(), container);
  19379. return [first, last];
  19380. };
  19381. const isSelectable = (element) => {
  19382. return element instanceof HTMLInputElement && "select" in element;
  19383. };
  19384. const tryFocus = (element, shouldSelect) => {
  19385. if (element && element.focus) {
  19386. const prevFocusedElement = document.activeElement;
  19387. element.focus({ preventScroll: true });
  19388. lastAutomatedFocusTimestamp.value = window.performance.now();
  19389. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
  19390. element.select();
  19391. }
  19392. }
  19393. };
  19394. function removeFromStack(list, item) {
  19395. const copy2 = [...list];
  19396. const idx = list.indexOf(item);
  19397. if (idx !== -1) {
  19398. copy2.splice(idx, 1);
  19399. }
  19400. return copy2;
  19401. }
  19402. const createFocusableStack = () => {
  19403. let stack = [];
  19404. const push = (layer) => {
  19405. const currentLayer = stack[0];
  19406. if (currentLayer && layer !== currentLayer) {
  19407. currentLayer.pause();
  19408. }
  19409. stack = removeFromStack(stack, layer);
  19410. stack.unshift(layer);
  19411. };
  19412. const remove2 = (layer) => {
  19413. var _a2, _b;
  19414. stack = removeFromStack(stack, layer);
  19415. (_b = (_a2 = stack[0]) == null ? void 0 : _a2.resume) == null ? void 0 : _b.call(_a2);
  19416. };
  19417. return {
  19418. push,
  19419. remove: remove2
  19420. };
  19421. };
  19422. const focusFirstDescendant = (elements, shouldSelect = false) => {
  19423. const prevFocusedElement = document.activeElement;
  19424. for (const element of elements) {
  19425. tryFocus(element, shouldSelect);
  19426. if (document.activeElement !== prevFocusedElement)
  19427. return;
  19428. }
  19429. };
  19430. const focusableStack = createFocusableStack();
  19431. const isFocusCausedByUserEvent = () => {
  19432. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  19433. };
  19434. const notifyFocusReasonPointer = () => {
  19435. focusReason.value = "pointer";
  19436. lastUserFocusTimestamp.value = window.performance.now();
  19437. };
  19438. const notifyFocusReasonKeydown = () => {
  19439. focusReason.value = "keyboard";
  19440. lastUserFocusTimestamp.value = window.performance.now();
  19441. };
  19442. const useFocusReason = () => {
  19443. onMounted(() => {
  19444. if (focusReasonUserCount === 0) {
  19445. document.addEventListener("mousedown", notifyFocusReasonPointer);
  19446. document.addEventListener("touchstart", notifyFocusReasonPointer);
  19447. document.addEventListener("keydown", notifyFocusReasonKeydown);
  19448. }
  19449. focusReasonUserCount++;
  19450. });
  19451. onBeforeUnmount(() => {
  19452. focusReasonUserCount--;
  19453. if (focusReasonUserCount <= 0) {
  19454. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  19455. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  19456. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  19457. }
  19458. });
  19459. return {
  19460. focusReason,
  19461. lastUserFocusTimestamp,
  19462. lastAutomatedFocusTimestamp
  19463. };
  19464. };
  19465. const createFocusOutPreventedEvent = (detail) => {
  19466. return new CustomEvent(FOCUSOUT_PREVENTED, {
  19467. ...FOCUSOUT_PREVENTED_OPTS,
  19468. detail
  19469. });
  19470. };
  19471. const _sfc_main$t = defineComponent({
  19472. name: "ElFocusTrap",
  19473. inheritAttrs: false,
  19474. props: {
  19475. loop: Boolean,
  19476. trapped: Boolean,
  19477. focusTrapEl: Object,
  19478. focusStartEl: {
  19479. type: [Object, String],
  19480. default: "first"
  19481. }
  19482. },
  19483. emits: [
  19484. ON_TRAP_FOCUS_EVT,
  19485. ON_RELEASE_FOCUS_EVT,
  19486. "focusin",
  19487. "focusout",
  19488. "focusout-prevented",
  19489. "release-requested"
  19490. ],
  19491. setup(props, { emit }) {
  19492. const forwardRef = ref();
  19493. let lastFocusBeforeTrapped;
  19494. let lastFocusAfterTrapped;
  19495. const { focusReason: focusReason2 } = useFocusReason();
  19496. useEscapeKeydown((event2) => {
  19497. if (props.trapped && !focusLayer.paused) {
  19498. emit("release-requested", event2);
  19499. }
  19500. });
  19501. const focusLayer = {
  19502. paused: false,
  19503. pause() {
  19504. this.paused = true;
  19505. },
  19506. resume() {
  19507. this.paused = false;
  19508. }
  19509. };
  19510. const onKeydown = (e) => {
  19511. if (!props.loop && !props.trapped)
  19512. return;
  19513. if (focusLayer.paused)
  19514. return;
  19515. const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  19516. const { loop } = props;
  19517. const isTabbing = key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  19518. const currentFocusingEl = document.activeElement;
  19519. if (isTabbing && currentFocusingEl) {
  19520. const container = currentTarget;
  19521. const [first, last] = getEdges(container);
  19522. const isTabbable = first && last;
  19523. if (!isTabbable) {
  19524. if (currentFocusingEl === container) {
  19525. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19526. focusReason: focusReason2.value
  19527. });
  19528. emit("focusout-prevented", focusoutPreventedEvent);
  19529. if (!focusoutPreventedEvent.defaultPrevented) {
  19530. e.preventDefault();
  19531. }
  19532. }
  19533. } else {
  19534. if (!shiftKey && currentFocusingEl === last) {
  19535. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19536. focusReason: focusReason2.value
  19537. });
  19538. emit("focusout-prevented", focusoutPreventedEvent);
  19539. if (!focusoutPreventedEvent.defaultPrevented) {
  19540. e.preventDefault();
  19541. if (loop)
  19542. tryFocus(first, true);
  19543. }
  19544. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  19545. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19546. focusReason: focusReason2.value
  19547. });
  19548. emit("focusout-prevented", focusoutPreventedEvent);
  19549. if (!focusoutPreventedEvent.defaultPrevented) {
  19550. e.preventDefault();
  19551. if (loop)
  19552. tryFocus(last, true);
  19553. }
  19554. }
  19555. }
  19556. }
  19557. };
  19558. provide(FOCUS_TRAP_INJECTION_KEY, {
  19559. focusTrapRef: forwardRef,
  19560. onKeydown
  19561. });
  19562. watch(() => props.focusTrapEl, (focusTrapEl) => {
  19563. if (focusTrapEl) {
  19564. forwardRef.value = focusTrapEl;
  19565. }
  19566. }, { immediate: true });
  19567. watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
  19568. if (forwardRef2) {
  19569. forwardRef2.addEventListener("keydown", onKeydown);
  19570. forwardRef2.addEventListener("focusin", onFocusIn);
  19571. forwardRef2.addEventListener("focusout", onFocusOut);
  19572. }
  19573. if (oldForwardRef) {
  19574. oldForwardRef.removeEventListener("keydown", onKeydown);
  19575. oldForwardRef.removeEventListener("focusin", onFocusIn);
  19576. oldForwardRef.removeEventListener("focusout", onFocusOut);
  19577. }
  19578. });
  19579. const trapOnFocus = (e) => {
  19580. emit(ON_TRAP_FOCUS_EVT, e);
  19581. };
  19582. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  19583. const onFocusIn = (e) => {
  19584. const trapContainer = unref(forwardRef);
  19585. if (!trapContainer)
  19586. return;
  19587. const target = e.target;
  19588. const relatedTarget = e.relatedTarget;
  19589. const isFocusedInTrap = target && trapContainer.contains(target);
  19590. if (!props.trapped) {
  19591. const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
  19592. if (!isPrevFocusedInTrap) {
  19593. lastFocusBeforeTrapped = relatedTarget;
  19594. }
  19595. }
  19596. if (isFocusedInTrap)
  19597. emit("focusin", e);
  19598. if (focusLayer.paused)
  19599. return;
  19600. if (props.trapped) {
  19601. if (isFocusedInTrap) {
  19602. lastFocusAfterTrapped = target;
  19603. } else {
  19604. tryFocus(lastFocusAfterTrapped, true);
  19605. }
  19606. }
  19607. };
  19608. const onFocusOut = (e) => {
  19609. const trapContainer = unref(forwardRef);
  19610. if (focusLayer.paused || !trapContainer)
  19611. return;
  19612. if (props.trapped) {
  19613. const relatedTarget = e.relatedTarget;
  19614. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
  19615. setTimeout(() => {
  19616. if (!focusLayer.paused && props.trapped) {
  19617. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19618. focusReason: focusReason2.value
  19619. });
  19620. emit("focusout-prevented", focusoutPreventedEvent);
  19621. if (!focusoutPreventedEvent.defaultPrevented) {
  19622. tryFocus(lastFocusAfterTrapped, true);
  19623. }
  19624. }
  19625. }, 0);
  19626. }
  19627. } else {
  19628. const target = e.target;
  19629. const isFocusedInTrap = target && trapContainer.contains(target);
  19630. if (!isFocusedInTrap)
  19631. emit("focusout", e);
  19632. }
  19633. };
  19634. async function startTrap() {
  19635. await nextTick();
  19636. const trapContainer = unref(forwardRef);
  19637. if (trapContainer) {
  19638. focusableStack.push(focusLayer);
  19639. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  19640. lastFocusBeforeTrapped = prevFocusedElement;
  19641. const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
  19642. if (!isPrevFocusContained) {
  19643. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  19644. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19645. trapContainer.dispatchEvent(focusEvent);
  19646. if (!focusEvent.defaultPrevented) {
  19647. nextTick(() => {
  19648. let focusStartEl = props.focusStartEl;
  19649. if (!isString(focusStartEl)) {
  19650. tryFocus(focusStartEl);
  19651. if (document.activeElement !== focusStartEl) {
  19652. focusStartEl = "first";
  19653. }
  19654. }
  19655. if (focusStartEl === "first") {
  19656. focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  19657. }
  19658. if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
  19659. tryFocus(trapContainer);
  19660. }
  19661. });
  19662. }
  19663. }
  19664. }
  19665. }
  19666. function stopTrap() {
  19667. const trapContainer = unref(forwardRef);
  19668. if (trapContainer) {
  19669. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19670. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  19671. ...FOCUS_AFTER_TRAPPED_OPTS,
  19672. detail: {
  19673. focusReason: focusReason2.value
  19674. }
  19675. });
  19676. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  19677. trapContainer.dispatchEvent(releasedEvent);
  19678. if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
  19679. tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
  19680. }
  19681. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus);
  19682. focusableStack.remove(focusLayer);
  19683. }
  19684. }
  19685. onMounted(() => {
  19686. if (props.trapped) {
  19687. startTrap();
  19688. }
  19689. watch(() => props.trapped, (trapped) => {
  19690. if (trapped) {
  19691. startTrap();
  19692. } else {
  19693. stopTrap();
  19694. }
  19695. });
  19696. });
  19697. onBeforeUnmount(() => {
  19698. if (props.trapped) {
  19699. stopTrap();
  19700. }
  19701. });
  19702. return {
  19703. onKeydown
  19704. };
  19705. }
  19706. });
  19707. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  19708. return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  19709. }
  19710. var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["render", _sfc_render$7], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);
  19711. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  19712. const popperCoreConfigProps = buildProps({
  19713. boundariesPadding: {
  19714. type: Number,
  19715. default: 0
  19716. },
  19717. fallbackPlacements: {
  19718. type: definePropType(Array),
  19719. default: void 0
  19720. },
  19721. gpuAcceleration: {
  19722. type: Boolean,
  19723. default: true
  19724. },
  19725. offset: {
  19726. type: Number,
  19727. default: 12
  19728. },
  19729. placement: {
  19730. type: String,
  19731. values: Ee,
  19732. default: "bottom"
  19733. },
  19734. popperOptions: {
  19735. type: definePropType(Object),
  19736. default: () => ({})
  19737. },
  19738. strategy: {
  19739. type: String,
  19740. values: POSITIONING_STRATEGIES,
  19741. default: "absolute"
  19742. }
  19743. });
  19744. const popperContentProps = buildProps({
  19745. ...popperCoreConfigProps,
  19746. id: String,
  19747. style: {
  19748. type: definePropType([String, Array, Object])
  19749. },
  19750. className: {
  19751. type: definePropType([String, Array, Object])
  19752. },
  19753. effect: {
  19754. type: String,
  19755. default: "dark"
  19756. },
  19757. visible: Boolean,
  19758. enterable: {
  19759. type: Boolean,
  19760. default: true
  19761. },
  19762. pure: Boolean,
  19763. focusOnShow: {
  19764. type: Boolean,
  19765. default: false
  19766. },
  19767. trapping: {
  19768. type: Boolean,
  19769. default: false
  19770. },
  19771. popperClass: {
  19772. type: definePropType([String, Array, Object])
  19773. },
  19774. popperStyle: {
  19775. type: definePropType([String, Array, Object])
  19776. },
  19777. referenceEl: {
  19778. type: definePropType(Object)
  19779. },
  19780. triggerTargetEl: {
  19781. type: definePropType(Object)
  19782. },
  19783. stopPopperMouseEvent: {
  19784. type: Boolean,
  19785. default: true
  19786. },
  19787. ariaLabel: {
  19788. type: String,
  19789. default: void 0
  19790. },
  19791. virtualTriggering: Boolean,
  19792. zIndex: Number
  19793. });
  19794. const popperContentEmits = {
  19795. mouseenter: (evt) => evt instanceof MouseEvent,
  19796. mouseleave: (evt) => evt instanceof MouseEvent,
  19797. focus: () => true,
  19798. blur: () => true,
  19799. close: () => true
  19800. };
  19801. const buildPopperOptions = (props, modifiers = []) => {
  19802. const { placement, strategy, popperOptions } = props;
  19803. const options2 = {
  19804. placement,
  19805. strategy,
  19806. ...popperOptions,
  19807. modifiers: [...genModifiers(props), ...modifiers]
  19808. };
  19809. deriveExtraModifiers(options2, popperOptions == null ? void 0 : popperOptions.modifiers);
  19810. return options2;
  19811. };
  19812. const unwrapMeasurableEl = ($el) => {
  19813. if (!isClient)
  19814. return;
  19815. return unrefElement($el);
  19816. };
  19817. function genModifiers(options2) {
  19818. const { offset, gpuAcceleration, fallbackPlacements } = options2;
  19819. return [
  19820. {
  19821. name: "offset",
  19822. options: {
  19823. offset: [0, offset != null ? offset : 12]
  19824. }
  19825. },
  19826. {
  19827. name: "preventOverflow",
  19828. options: {
  19829. padding: {
  19830. top: 2,
  19831. bottom: 2,
  19832. left: 5,
  19833. right: 5
  19834. }
  19835. }
  19836. },
  19837. {
  19838. name: "flip",
  19839. options: {
  19840. padding: 5,
  19841. fallbackPlacements
  19842. }
  19843. },
  19844. {
  19845. name: "computeStyles",
  19846. options: {
  19847. gpuAcceleration
  19848. }
  19849. }
  19850. ];
  19851. }
  19852. function deriveExtraModifiers(options2, modifiers) {
  19853. if (modifiers) {
  19854. options2.modifiers = [...options2.modifiers, ...modifiers != null ? modifiers : []];
  19855. }
  19856. }
  19857. const DEFAULT_ARROW_OFFSET = 0;
  19858. const usePopperContent = (props) => {
  19859. const { popperInstanceRef, contentRef, triggerRef: triggerRef2, role } = inject(POPPER_INJECTION_KEY, void 0);
  19860. const arrowRef = ref();
  19861. const arrowOffset = ref();
  19862. const eventListenerModifier = computed$1(() => {
  19863. return {
  19864. name: "eventListeners",
  19865. enabled: !!props.visible
  19866. };
  19867. });
  19868. const arrowModifier = computed$1(() => {
  19869. var _a2;
  19870. const arrowEl = unref(arrowRef);
  19871. const offset = (_a2 = unref(arrowOffset)) != null ? _a2 : DEFAULT_ARROW_OFFSET;
  19872. return {
  19873. name: "arrow",
  19874. enabled: !isUndefined$1(arrowEl),
  19875. options: {
  19876. element: arrowEl,
  19877. padding: offset
  19878. }
  19879. };
  19880. });
  19881. const options2 = computed$1(() => {
  19882. return {
  19883. onFirstUpdate: () => {
  19884. update();
  19885. },
  19886. ...buildPopperOptions(props, [
  19887. unref(arrowModifier),
  19888. unref(eventListenerModifier)
  19889. ])
  19890. };
  19891. });
  19892. const computedReference = computed$1(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef2));
  19893. const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options2);
  19894. watch(instanceRef, (instance) => popperInstanceRef.value = instance);
  19895. onMounted(() => {
  19896. watch(() => {
  19897. var _a2;
  19898. return (_a2 = unref(computedReference)) == null ? void 0 : _a2.getBoundingClientRect();
  19899. }, () => {
  19900. update();
  19901. });
  19902. });
  19903. return {
  19904. attributes,
  19905. arrowRef,
  19906. contentRef,
  19907. instanceRef,
  19908. state,
  19909. styles,
  19910. role,
  19911. forceUpdate,
  19912. update
  19913. };
  19914. };
  19915. const usePopperContentDOM = (props, {
  19916. attributes,
  19917. styles,
  19918. role
  19919. }) => {
  19920. const { nextZIndex } = useZIndex();
  19921. const ns = useNamespace("popper");
  19922. const contentAttrs = computed$1(() => unref(attributes).popper);
  19923. const contentZIndex = ref(props.zIndex || nextZIndex());
  19924. const contentClass = computed$1(() => [
  19925. ns.b(),
  19926. ns.is("pure", props.pure),
  19927. ns.is(props.effect),
  19928. props.popperClass
  19929. ]);
  19930. const contentStyle = computed$1(() => {
  19931. return [
  19932. { zIndex: unref(contentZIndex) },
  19933. props.popperStyle || {},
  19934. unref(styles).popper
  19935. ];
  19936. });
  19937. const ariaModal = computed$1(() => role.value === "dialog" ? "false" : void 0);
  19938. const arrowStyle = computed$1(() => unref(styles).arrow || {});
  19939. const updateZIndex = () => {
  19940. contentZIndex.value = props.zIndex || nextZIndex();
  19941. };
  19942. return {
  19943. ariaModal,
  19944. arrowStyle,
  19945. contentAttrs,
  19946. contentClass,
  19947. contentStyle,
  19948. contentZIndex,
  19949. updateZIndex
  19950. };
  19951. };
  19952. const usePopperContentFocusTrap = (props, emit) => {
  19953. const trapped = ref(false);
  19954. const focusStartRef = ref();
  19955. const onFocusAfterTrapped = () => {
  19956. emit("focus");
  19957. };
  19958. const onFocusAfterReleased = (event2) => {
  19959. var _a2;
  19960. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) !== "pointer") {
  19961. focusStartRef.value = "first";
  19962. emit("blur");
  19963. }
  19964. };
  19965. const onFocusInTrap = (event2) => {
  19966. if (props.visible && !trapped.value) {
  19967. if (event2.target) {
  19968. focusStartRef.value = event2.target;
  19969. }
  19970. trapped.value = true;
  19971. }
  19972. };
  19973. const onFocusoutPrevented = (event2) => {
  19974. if (!props.trapping) {
  19975. if (event2.detail.focusReason === "pointer") {
  19976. event2.preventDefault();
  19977. }
  19978. trapped.value = false;
  19979. }
  19980. };
  19981. const onReleaseRequested = () => {
  19982. trapped.value = false;
  19983. emit("close");
  19984. };
  19985. return {
  19986. focusStartRef,
  19987. trapped,
  19988. onFocusAfterReleased,
  19989. onFocusAfterTrapped,
  19990. onFocusInTrap,
  19991. onFocusoutPrevented,
  19992. onReleaseRequested
  19993. };
  19994. };
  19995. const __default__$i = defineComponent({
  19996. name: "ElPopperContent"
  19997. });
  19998. const _sfc_main$s = /* @__PURE__ */ defineComponent({
  19999. ...__default__$i,
  20000. props: popperContentProps,
  20001. emits: popperContentEmits,
  20002. setup(__props, { expose, emit }) {
  20003. const props = __props;
  20004. const {
  20005. focusStartRef,
  20006. trapped,
  20007. onFocusAfterReleased,
  20008. onFocusAfterTrapped,
  20009. onFocusInTrap,
  20010. onFocusoutPrevented,
  20011. onReleaseRequested
  20012. } = usePopperContentFocusTrap(props, emit);
  20013. const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
  20014. const {
  20015. ariaModal,
  20016. arrowStyle,
  20017. contentAttrs,
  20018. contentClass,
  20019. contentStyle,
  20020. updateZIndex
  20021. } = usePopperContentDOM(props, {
  20022. styles,
  20023. attributes,
  20024. role
  20025. });
  20026. const formItemContext = inject(formItemContextKey, void 0);
  20027. const arrowOffset = ref();
  20028. provide(POPPER_CONTENT_INJECTION_KEY, {
  20029. arrowStyle,
  20030. arrowRef,
  20031. arrowOffset
  20032. });
  20033. if (formItemContext && (formItemContext.addInputId || formItemContext.removeInputId)) {
  20034. provide(formItemContextKey, {
  20035. ...formItemContext,
  20036. addInputId: NOOP,
  20037. removeInputId: NOOP
  20038. });
  20039. }
  20040. let triggerTargetAriaStopWatch = void 0;
  20041. const updatePopper = (shouldUpdateZIndex = true) => {
  20042. update();
  20043. shouldUpdateZIndex && updateZIndex();
  20044. };
  20045. const togglePopperAlive = () => {
  20046. updatePopper(false);
  20047. if (props.visible && props.focusOnShow) {
  20048. trapped.value = true;
  20049. } else if (props.visible === false) {
  20050. trapped.value = false;
  20051. }
  20052. };
  20053. onMounted(() => {
  20054. watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  20055. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20056. triggerTargetAriaStopWatch = void 0;
  20057. const el = unref(triggerTargetEl || contentRef.value);
  20058. const prevEl = unref(prevTriggerTargetEl || contentRef.value);
  20059. if (isElement(el)) {
  20060. triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
  20061. ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
  20062. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  20063. });
  20064. }, { immediate: true });
  20065. }
  20066. if (prevEl !== el && isElement(prevEl)) {
  20067. ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
  20068. prevEl.removeAttribute(key);
  20069. });
  20070. }
  20071. }, { immediate: true });
  20072. watch(() => props.visible, togglePopperAlive, { immediate: true });
  20073. });
  20074. onBeforeUnmount(() => {
  20075. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20076. triggerTargetAriaStopWatch = void 0;
  20077. });
  20078. expose({
  20079. popperContentRef: contentRef,
  20080. popperInstanceRef: instanceRef,
  20081. updatePopper,
  20082. contentStyle
  20083. });
  20084. return (_ctx, _cache) => {
  20085. return openBlock(), createElementBlock("div", mergeProps({
  20086. ref_key: "contentRef",
  20087. ref: contentRef
  20088. }, unref(contentAttrs), {
  20089. style: unref(contentStyle),
  20090. class: unref(contentClass),
  20091. tabindex: "-1",
  20092. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  20093. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  20094. }), [
  20095. createVNode(unref(ElFocusTrap), {
  20096. trapped: unref(trapped),
  20097. "trap-on-focus-in": true,
  20098. "focus-trap-el": unref(contentRef),
  20099. "focus-start-el": unref(focusStartRef),
  20100. onFocusAfterTrapped: unref(onFocusAfterTrapped),
  20101. onFocusAfterReleased: unref(onFocusAfterReleased),
  20102. onFocusin: unref(onFocusInTrap),
  20103. onFocusoutPrevented: unref(onFocusoutPrevented),
  20104. onReleaseRequested: unref(onReleaseRequested)
  20105. }, {
  20106. default: withCtx(() => [
  20107. renderSlot(_ctx.$slots, "default")
  20108. ]),
  20109. _: 3
  20110. }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
  20111. ], 16);
  20112. };
  20113. }
  20114. });
  20115. var ElPopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/content.vue"]]);
  20116. const ElPopper = withInstall(Popper);
  20117. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  20118. const useTooltipContentProps = buildProps({
  20119. ...useDelayedToggleProps,
  20120. ...popperContentProps,
  20121. appendTo: {
  20122. type: definePropType([String, Object])
  20123. },
  20124. content: {
  20125. type: String,
  20126. default: ""
  20127. },
  20128. rawContent: {
  20129. type: Boolean,
  20130. default: false
  20131. },
  20132. persistent: Boolean,
  20133. ariaLabel: String,
  20134. visible: {
  20135. type: definePropType(Boolean),
  20136. default: null
  20137. },
  20138. transition: String,
  20139. teleported: {
  20140. type: Boolean,
  20141. default: true
  20142. },
  20143. disabled: Boolean
  20144. });
  20145. const useTooltipTriggerProps = buildProps({
  20146. ...popperTriggerProps,
  20147. disabled: Boolean,
  20148. trigger: {
  20149. type: definePropType([String, Array]),
  20150. default: "hover"
  20151. },
  20152. triggerKeys: {
  20153. type: definePropType(Array),
  20154. default: () => [EVENT_CODE.enter, EVENT_CODE.space]
  20155. }
  20156. });
  20157. const {
  20158. useModelToggleProps: useTooltipModelToggleProps,
  20159. useModelToggleEmits: useTooltipModelToggleEmits,
  20160. useModelToggle: useTooltipModelToggle
  20161. } = createModelToggleComposable("visible");
  20162. const useTooltipProps = buildProps({
  20163. ...popperProps,
  20164. ...useTooltipModelToggleProps,
  20165. ...useTooltipContentProps,
  20166. ...useTooltipTriggerProps,
  20167. ...popperArrowProps,
  20168. showArrow: {
  20169. type: Boolean,
  20170. default: true
  20171. }
  20172. });
  20173. const tooltipEmits = [
  20174. ...useTooltipModelToggleEmits,
  20175. "before-show",
  20176. "before-hide",
  20177. "show",
  20178. "hide",
  20179. "open",
  20180. "close"
  20181. ];
  20182. const isTriggerType = (trigger2, type2) => {
  20183. if (isArray$2(trigger2)) {
  20184. return trigger2.includes(type2);
  20185. }
  20186. return trigger2 === type2;
  20187. };
  20188. const whenTrigger = (trigger2, type2, handler) => {
  20189. return (e) => {
  20190. isTriggerType(unref(trigger2), type2) && handler(e);
  20191. };
  20192. };
  20193. const __default__$h = defineComponent({
  20194. name: "ElTooltipTrigger"
  20195. });
  20196. const _sfc_main$r = /* @__PURE__ */ defineComponent({
  20197. ...__default__$h,
  20198. props: useTooltipTriggerProps,
  20199. setup(__props, { expose }) {
  20200. const props = __props;
  20201. const ns = useNamespace("tooltip");
  20202. const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20203. const triggerRef2 = ref(null);
  20204. const stopWhenControlledOrDisabled = () => {
  20205. if (unref(controlled) || props.disabled) {
  20206. return true;
  20207. }
  20208. };
  20209. const trigger2 = toRef(props, "trigger");
  20210. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onOpen));
  20211. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onClose));
  20212. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "click", (e) => {
  20213. if (e.button === 0) {
  20214. onToggle(e);
  20215. }
  20216. }));
  20217. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onOpen));
  20218. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onClose));
  20219. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "contextmenu", (e) => {
  20220. e.preventDefault();
  20221. onToggle(e);
  20222. }));
  20223. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  20224. const { code } = e;
  20225. if (props.triggerKeys.includes(code)) {
  20226. e.preventDefault();
  20227. onToggle(e);
  20228. }
  20229. });
  20230. expose({
  20231. triggerRef: triggerRef2
  20232. });
  20233. return (_ctx, _cache) => {
  20234. return openBlock(), createBlock(unref(ElPopperTrigger), {
  20235. id: unref(id),
  20236. "virtual-ref": _ctx.virtualRef,
  20237. open: unref(open),
  20238. "virtual-triggering": _ctx.virtualTriggering,
  20239. class: normalizeClass(unref(ns).e("trigger")),
  20240. onBlur: unref(onBlur),
  20241. onClick: unref(onClick),
  20242. onContextmenu: unref(onContextMenu),
  20243. onFocus: unref(onFocus),
  20244. onMouseenter: unref(onMouseenter),
  20245. onMouseleave: unref(onMouseleave),
  20246. onKeydown: unref(onKeydown)
  20247. }, {
  20248. default: withCtx(() => [
  20249. renderSlot(_ctx.$slots, "default")
  20250. ]),
  20251. _: 3
  20252. }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
  20253. };
  20254. }
  20255. });
  20256. var ElTooltipTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/trigger.vue"]]);
  20257. const __default__$g = defineComponent({
  20258. name: "ElTooltipContent",
  20259. inheritAttrs: false
  20260. });
  20261. const _sfc_main$q = /* @__PURE__ */ defineComponent({
  20262. ...__default__$g,
  20263. props: useTooltipContentProps,
  20264. setup(__props, { expose }) {
  20265. const props = __props;
  20266. const { selector } = usePopperContainerId();
  20267. const ns = useNamespace("tooltip");
  20268. const contentRef = ref(null);
  20269. const destroyed = ref(false);
  20270. const {
  20271. controlled,
  20272. id,
  20273. open,
  20274. trigger: trigger2,
  20275. onClose,
  20276. onOpen,
  20277. onShow,
  20278. onHide,
  20279. onBeforeShow,
  20280. onBeforeHide
  20281. } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20282. const transitionClass = computed$1(() => {
  20283. return props.transition || `${ns.namespace.value}-fade-in-linear`;
  20284. });
  20285. const persistentRef = computed$1(() => {
  20286. return props.persistent;
  20287. });
  20288. onBeforeUnmount(() => {
  20289. destroyed.value = true;
  20290. });
  20291. const shouldRender = computed$1(() => {
  20292. return unref(persistentRef) ? true : unref(open);
  20293. });
  20294. const shouldShow = computed$1(() => {
  20295. return props.disabled ? false : unref(open);
  20296. });
  20297. const appendTo = computed$1(() => {
  20298. return props.appendTo || selector.value;
  20299. });
  20300. const contentStyle = computed$1(() => {
  20301. var _a2;
  20302. return (_a2 = props.style) != null ? _a2 : {};
  20303. });
  20304. const ariaHidden = computed$1(() => !unref(open));
  20305. const onTransitionLeave = () => {
  20306. onHide();
  20307. };
  20308. const stopWhenControlled = () => {
  20309. if (unref(controlled))
  20310. return true;
  20311. };
  20312. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  20313. if (props.enterable && unref(trigger2) === "hover") {
  20314. onOpen();
  20315. }
  20316. });
  20317. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  20318. if (unref(trigger2) === "hover") {
  20319. onClose();
  20320. }
  20321. });
  20322. const onBeforeEnter = () => {
  20323. var _a2, _b;
  20324. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20325. onBeforeShow == null ? void 0 : onBeforeShow();
  20326. };
  20327. const onBeforeLeave = () => {
  20328. onBeforeHide == null ? void 0 : onBeforeHide();
  20329. };
  20330. const onAfterShow = () => {
  20331. onShow();
  20332. stopHandle = onClickOutside(computed$1(() => {
  20333. var _a2;
  20334. return (_a2 = contentRef.value) == null ? void 0 : _a2.popperContentRef;
  20335. }), () => {
  20336. if (unref(controlled))
  20337. return;
  20338. const $trigger = unref(trigger2);
  20339. if ($trigger !== "hover") {
  20340. onClose();
  20341. }
  20342. });
  20343. };
  20344. const onBlur = () => {
  20345. if (!props.virtualTriggering) {
  20346. onClose();
  20347. }
  20348. };
  20349. let stopHandle;
  20350. watch(() => unref(open), (val) => {
  20351. if (!val) {
  20352. stopHandle == null ? void 0 : stopHandle();
  20353. }
  20354. }, {
  20355. flush: "post"
  20356. });
  20357. watch(() => props.content, () => {
  20358. var _a2, _b;
  20359. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20360. });
  20361. expose({
  20362. contentRef
  20363. });
  20364. return (_ctx, _cache) => {
  20365. return openBlock(), createBlock(Teleport, {
  20366. disabled: !_ctx.teleported,
  20367. to: unref(appendTo)
  20368. }, [
  20369. createVNode(Transition, {
  20370. name: unref(transitionClass),
  20371. onAfterLeave: onTransitionLeave,
  20372. onBeforeEnter,
  20373. onAfterEnter: onAfterShow,
  20374. onBeforeLeave
  20375. }, {
  20376. default: withCtx(() => [
  20377. unref(shouldRender) ? withDirectives((openBlock(), createBlock(unref(ElPopperContent), mergeProps({
  20378. key: 0,
  20379. id: unref(id),
  20380. ref_key: "contentRef",
  20381. ref: contentRef
  20382. }, _ctx.$attrs, {
  20383. "aria-label": _ctx.ariaLabel,
  20384. "aria-hidden": unref(ariaHidden),
  20385. "boundaries-padding": _ctx.boundariesPadding,
  20386. "fallback-placements": _ctx.fallbackPlacements,
  20387. "gpu-acceleration": _ctx.gpuAcceleration,
  20388. offset: _ctx.offset,
  20389. placement: _ctx.placement,
  20390. "popper-options": _ctx.popperOptions,
  20391. strategy: _ctx.strategy,
  20392. effect: _ctx.effect,
  20393. enterable: _ctx.enterable,
  20394. pure: _ctx.pure,
  20395. "popper-class": _ctx.popperClass,
  20396. "popper-style": [_ctx.popperStyle, unref(contentStyle)],
  20397. "reference-el": _ctx.referenceEl,
  20398. "trigger-target-el": _ctx.triggerTargetEl,
  20399. visible: unref(shouldShow),
  20400. "z-index": _ctx.zIndex,
  20401. onMouseenter: unref(onContentEnter),
  20402. onMouseleave: unref(onContentLeave),
  20403. onBlur,
  20404. onClose: unref(onClose)
  20405. }), {
  20406. default: withCtx(() => [
  20407. !destroyed.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20408. ]),
  20409. _: 3
  20410. }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
  20411. [vShow, unref(shouldShow)]
  20412. ]) : createCommentVNode("v-if", true)
  20413. ]),
  20414. _: 3
  20415. }, 8, ["name"])
  20416. ], 8, ["disabled", "to"]);
  20417. };
  20418. }
  20419. });
  20420. var ElTooltipContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/content.vue"]]);
  20421. const _hoisted_1$f = ["innerHTML"];
  20422. const _hoisted_2$9 = { key: 1 };
  20423. const __default__$f = defineComponent({
  20424. name: "ElTooltip"
  20425. });
  20426. const _sfc_main$p = /* @__PURE__ */ defineComponent({
  20427. ...__default__$f,
  20428. props: useTooltipProps,
  20429. emits: tooltipEmits,
  20430. setup(__props, { expose, emit }) {
  20431. const props = __props;
  20432. usePopperContainer();
  20433. const id = useId();
  20434. const popperRef = ref();
  20435. const contentRef = ref();
  20436. const updatePopper = () => {
  20437. var _a2;
  20438. const popperComponent = unref(popperRef);
  20439. if (popperComponent) {
  20440. (_a2 = popperComponent.popperInstanceRef) == null ? void 0 : _a2.update();
  20441. }
  20442. };
  20443. const open = ref(false);
  20444. const toggleReason = ref();
  20445. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  20446. indicator: open,
  20447. toggleReason
  20448. });
  20449. const { onOpen, onClose } = useDelayedToggle({
  20450. showAfter: toRef(props, "showAfter"),
  20451. hideAfter: toRef(props, "hideAfter"),
  20452. autoClose: toRef(props, "autoClose"),
  20453. open: show,
  20454. close: hide
  20455. });
  20456. const controlled = computed$1(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  20457. provide(TOOLTIP_INJECTION_KEY, {
  20458. controlled,
  20459. id,
  20460. open: readonly(open),
  20461. trigger: toRef(props, "trigger"),
  20462. onOpen: (event2) => {
  20463. onOpen(event2);
  20464. },
  20465. onClose: (event2) => {
  20466. onClose(event2);
  20467. },
  20468. onToggle: (event2) => {
  20469. if (unref(open)) {
  20470. onClose(event2);
  20471. } else {
  20472. onOpen(event2);
  20473. }
  20474. },
  20475. onShow: () => {
  20476. emit("show", toggleReason.value);
  20477. },
  20478. onHide: () => {
  20479. emit("hide", toggleReason.value);
  20480. },
  20481. onBeforeShow: () => {
  20482. emit("before-show", toggleReason.value);
  20483. },
  20484. onBeforeHide: () => {
  20485. emit("before-hide", toggleReason.value);
  20486. },
  20487. updatePopper
  20488. });
  20489. watch(() => props.disabled, (disabled) => {
  20490. if (disabled && open.value) {
  20491. open.value = false;
  20492. }
  20493. });
  20494. const isFocusInsideContent = () => {
  20495. var _a2, _b;
  20496. const popperContent = (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.contentRef) == null ? void 0 : _b.popperContentRef;
  20497. return popperContent && popperContent.contains(document.activeElement);
  20498. };
  20499. onDeactivated(() => open.value && hide());
  20500. expose({
  20501. popperRef,
  20502. contentRef,
  20503. isFocusInsideContent,
  20504. updatePopper,
  20505. onOpen,
  20506. onClose,
  20507. hide
  20508. });
  20509. return (_ctx, _cache) => {
  20510. return openBlock(), createBlock(unref(ElPopper), {
  20511. ref_key: "popperRef",
  20512. ref: popperRef,
  20513. role: _ctx.role
  20514. }, {
  20515. default: withCtx(() => [
  20516. createVNode(ElTooltipTrigger, {
  20517. disabled: _ctx.disabled,
  20518. trigger: _ctx.trigger,
  20519. "trigger-keys": _ctx.triggerKeys,
  20520. "virtual-ref": _ctx.virtualRef,
  20521. "virtual-triggering": _ctx.virtualTriggering
  20522. }, {
  20523. default: withCtx(() => [
  20524. _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20525. ]),
  20526. _: 3
  20527. }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
  20528. createVNode(ElTooltipContent, {
  20529. ref_key: "contentRef",
  20530. ref: contentRef,
  20531. "aria-label": _ctx.ariaLabel,
  20532. "boundaries-padding": _ctx.boundariesPadding,
  20533. content: _ctx.content,
  20534. disabled: _ctx.disabled,
  20535. effect: _ctx.effect,
  20536. enterable: _ctx.enterable,
  20537. "fallback-placements": _ctx.fallbackPlacements,
  20538. "hide-after": _ctx.hideAfter,
  20539. "gpu-acceleration": _ctx.gpuAcceleration,
  20540. offset: _ctx.offset,
  20541. persistent: _ctx.persistent,
  20542. "popper-class": _ctx.popperClass,
  20543. "popper-style": _ctx.popperStyle,
  20544. placement: _ctx.placement,
  20545. "popper-options": _ctx.popperOptions,
  20546. pure: _ctx.pure,
  20547. "raw-content": _ctx.rawContent,
  20548. "reference-el": _ctx.referenceEl,
  20549. "trigger-target-el": _ctx.triggerTargetEl,
  20550. "show-after": _ctx.showAfter,
  20551. strategy: _ctx.strategy,
  20552. teleported: _ctx.teleported,
  20553. transition: _ctx.transition,
  20554. "virtual-triggering": _ctx.virtualTriggering,
  20555. "z-index": _ctx.zIndex,
  20556. "append-to": _ctx.appendTo
  20557. }, {
  20558. default: withCtx(() => [
  20559. renderSlot(_ctx.$slots, "content", {}, () => [
  20560. _ctx.rawContent ? (openBlock(), createElementBlock("span", {
  20561. key: 0,
  20562. innerHTML: _ctx.content
  20563. }, null, 8, _hoisted_1$f)) : (openBlock(), createElementBlock("span", _hoisted_2$9, toDisplayString(_ctx.content), 1))
  20564. ]),
  20565. _ctx.showArrow ? (openBlock(), createBlock(unref(ElPopperArrow), {
  20566. key: 0,
  20567. "arrow-offset": _ctx.arrowOffset
  20568. }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true)
  20569. ]),
  20570. _: 3
  20571. }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
  20572. ]),
  20573. _: 3
  20574. }, 8, ["role"]);
  20575. };
  20576. }
  20577. });
  20578. var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/tooltip.vue"]]);
  20579. const ElTooltip = withInstall(Tooltip);
  20580. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  20581. const useButton = (props, emit) => {
  20582. useDeprecated({
  20583. from: "type.text",
  20584. replacement: "link",
  20585. version: "3.0.0",
  20586. scope: "props",
  20587. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  20588. }, computed$1(() => props.type === "text"));
  20589. const buttonGroupContext = inject(buttonGroupContextKey, void 0);
  20590. const globalConfig2 = useGlobalConfig("button");
  20591. const { form } = useFormItem();
  20592. const _size = useFormSize(computed$1(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
  20593. const _disabled = useFormDisabled();
  20594. const _ref = ref();
  20595. const slots = useSlots();
  20596. const _type = computed$1(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
  20597. const autoInsertSpace = computed$1(() => {
  20598. var _a2, _b, _c;
  20599. return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.autoInsertSpace) != null ? _c : false;
  20600. });
  20601. const _props = computed$1(() => {
  20602. if (props.tag === "button") {
  20603. return {
  20604. ariaDisabled: _disabled.value || props.loading,
  20605. disabled: _disabled.value || props.loading,
  20606. autofocus: props.autofocus,
  20607. type: props.nativeType
  20608. };
  20609. }
  20610. return {};
  20611. });
  20612. const shouldAddSpace = computed$1(() => {
  20613. var _a2;
  20614. const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  20615. if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
  20616. const slot = defaultSlot[0];
  20617. if ((slot == null ? void 0 : slot.type) === Text$1) {
  20618. const text = slot.children;
  20619. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  20620. }
  20621. }
  20622. return false;
  20623. });
  20624. const handleClick = (evt) => {
  20625. if (props.nativeType === "reset") {
  20626. form == null ? void 0 : form.resetFields();
  20627. }
  20628. emit("click", evt);
  20629. };
  20630. return {
  20631. _disabled,
  20632. _size,
  20633. _type,
  20634. _ref,
  20635. _props,
  20636. shouldAddSpace,
  20637. handleClick
  20638. };
  20639. };
  20640. const buttonTypes = [
  20641. "default",
  20642. "primary",
  20643. "success",
  20644. "warning",
  20645. "info",
  20646. "danger",
  20647. "text",
  20648. ""
  20649. ];
  20650. const buttonNativeTypes = ["button", "submit", "reset"];
  20651. const buttonProps = buildProps({
  20652. size: useSizeProp,
  20653. disabled: Boolean,
  20654. type: {
  20655. type: String,
  20656. values: buttonTypes,
  20657. default: ""
  20658. },
  20659. icon: {
  20660. type: iconPropType
  20661. },
  20662. nativeType: {
  20663. type: String,
  20664. values: buttonNativeTypes,
  20665. default: "button"
  20666. },
  20667. loading: Boolean,
  20668. loadingIcon: {
  20669. type: iconPropType,
  20670. default: () => loading_default
  20671. },
  20672. plain: Boolean,
  20673. text: Boolean,
  20674. link: Boolean,
  20675. bg: Boolean,
  20676. autofocus: Boolean,
  20677. round: Boolean,
  20678. circle: Boolean,
  20679. color: String,
  20680. dark: Boolean,
  20681. autoInsertSpace: {
  20682. type: Boolean,
  20683. default: void 0
  20684. },
  20685. tag: {
  20686. type: definePropType([String, Object]),
  20687. default: "button"
  20688. }
  20689. });
  20690. const buttonEmits = {
  20691. click: (evt) => evt instanceof MouseEvent
  20692. };
  20693. function bound01$1(n, max2) {
  20694. if (isOnePointZero$1(n)) {
  20695. n = "100%";
  20696. }
  20697. var isPercent = isPercentage$1(n);
  20698. n = max2 === 360 ? n : Math.min(max2, Math.max(0, parseFloat(n)));
  20699. if (isPercent) {
  20700. n = parseInt(String(n * max2), 10) / 100;
  20701. }
  20702. if (Math.abs(n - max2) < 1e-6) {
  20703. return 1;
  20704. }
  20705. if (max2 === 360) {
  20706. n = (n < 0 ? n % max2 + max2 : n % max2) / parseFloat(String(max2));
  20707. } else {
  20708. n = n % max2 / parseFloat(String(max2));
  20709. }
  20710. return n;
  20711. }
  20712. function clamp01(val) {
  20713. return Math.min(1, Math.max(0, val));
  20714. }
  20715. function isOnePointZero$1(n) {
  20716. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  20717. }
  20718. function isPercentage$1(n) {
  20719. return typeof n === "string" && n.indexOf("%") !== -1;
  20720. }
  20721. function boundAlpha(a) {
  20722. a = parseFloat(a);
  20723. if (isNaN(a) || a < 0 || a > 1) {
  20724. a = 1;
  20725. }
  20726. return a;
  20727. }
  20728. function convertToPercentage(n) {
  20729. if (n <= 1) {
  20730. return "".concat(Number(n) * 100, "%");
  20731. }
  20732. return n;
  20733. }
  20734. function pad2(c) {
  20735. return c.length === 1 ? "0" + c : String(c);
  20736. }
  20737. function rgbToRgb(r2, g, b) {
  20738. return {
  20739. r: bound01$1(r2, 255) * 255,
  20740. g: bound01$1(g, 255) * 255,
  20741. b: bound01$1(b, 255) * 255
  20742. };
  20743. }
  20744. function rgbToHsl(r2, g, b) {
  20745. r2 = bound01$1(r2, 255);
  20746. g = bound01$1(g, 255);
  20747. b = bound01$1(b, 255);
  20748. var max2 = Math.max(r2, g, b);
  20749. var min2 = Math.min(r2, g, b);
  20750. var h2 = 0;
  20751. var s = 0;
  20752. var l = (max2 + min2) / 2;
  20753. if (max2 === min2) {
  20754. s = 0;
  20755. h2 = 0;
  20756. } else {
  20757. var d2 = max2 - min2;
  20758. s = l > 0.5 ? d2 / (2 - max2 - min2) : d2 / (max2 + min2);
  20759. switch (max2) {
  20760. case r2:
  20761. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20762. break;
  20763. case g:
  20764. h2 = (b - r2) / d2 + 2;
  20765. break;
  20766. case b:
  20767. h2 = (r2 - g) / d2 + 4;
  20768. break;
  20769. }
  20770. h2 /= 6;
  20771. }
  20772. return { h: h2, s, l };
  20773. }
  20774. function hue2rgb(p, q2, t2) {
  20775. if (t2 < 0) {
  20776. t2 += 1;
  20777. }
  20778. if (t2 > 1) {
  20779. t2 -= 1;
  20780. }
  20781. if (t2 < 1 / 6) {
  20782. return p + (q2 - p) * (6 * t2);
  20783. }
  20784. if (t2 < 1 / 2) {
  20785. return q2;
  20786. }
  20787. if (t2 < 2 / 3) {
  20788. return p + (q2 - p) * (2 / 3 - t2) * 6;
  20789. }
  20790. return p;
  20791. }
  20792. function hslToRgb(h2, s, l) {
  20793. var r2;
  20794. var g;
  20795. var b;
  20796. h2 = bound01$1(h2, 360);
  20797. s = bound01$1(s, 100);
  20798. l = bound01$1(l, 100);
  20799. if (s === 0) {
  20800. g = l;
  20801. b = l;
  20802. r2 = l;
  20803. } else {
  20804. var q2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
  20805. var p = 2 * l - q2;
  20806. r2 = hue2rgb(p, q2, h2 + 1 / 3);
  20807. g = hue2rgb(p, q2, h2);
  20808. b = hue2rgb(p, q2, h2 - 1 / 3);
  20809. }
  20810. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20811. }
  20812. function rgbToHsv(r2, g, b) {
  20813. r2 = bound01$1(r2, 255);
  20814. g = bound01$1(g, 255);
  20815. b = bound01$1(b, 255);
  20816. var max2 = Math.max(r2, g, b);
  20817. var min2 = Math.min(r2, g, b);
  20818. var h2 = 0;
  20819. var v = max2;
  20820. var d2 = max2 - min2;
  20821. var s = max2 === 0 ? 0 : d2 / max2;
  20822. if (max2 === min2) {
  20823. h2 = 0;
  20824. } else {
  20825. switch (max2) {
  20826. case r2:
  20827. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20828. break;
  20829. case g:
  20830. h2 = (b - r2) / d2 + 2;
  20831. break;
  20832. case b:
  20833. h2 = (r2 - g) / d2 + 4;
  20834. break;
  20835. }
  20836. h2 /= 6;
  20837. }
  20838. return { h: h2, s, v };
  20839. }
  20840. function hsvToRgb(h2, s, v) {
  20841. h2 = bound01$1(h2, 360) * 6;
  20842. s = bound01$1(s, 100);
  20843. v = bound01$1(v, 100);
  20844. var i2 = Math.floor(h2);
  20845. var f = h2 - i2;
  20846. var p = v * (1 - s);
  20847. var q2 = v * (1 - f * s);
  20848. var t2 = v * (1 - (1 - f) * s);
  20849. var mod = i2 % 6;
  20850. var r2 = [v, q2, p, p, t2, v][mod];
  20851. var g = [t2, v, v, q2, p, p][mod];
  20852. var b = [p, p, t2, v, v, q2][mod];
  20853. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20854. }
  20855. function rgbToHex(r2, g, b, allow3Char) {
  20856. var hex = [
  20857. pad2(Math.round(r2).toString(16)),
  20858. pad2(Math.round(g).toString(16)),
  20859. pad2(Math.round(b).toString(16))
  20860. ];
  20861. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
  20862. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  20863. }
  20864. return hex.join("");
  20865. }
  20866. function rgbaToHex(r2, g, b, a, allow4Char) {
  20867. var hex = [
  20868. pad2(Math.round(r2).toString(16)),
  20869. pad2(Math.round(g).toString(16)),
  20870. pad2(Math.round(b).toString(16)),
  20871. pad2(convertDecimalToHex(a))
  20872. ];
  20873. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
  20874. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  20875. }
  20876. return hex.join("");
  20877. }
  20878. function convertDecimalToHex(d2) {
  20879. return Math.round(parseFloat(d2) * 255).toString(16);
  20880. }
  20881. function convertHexToDecimal(h2) {
  20882. return parseIntFromHex(h2) / 255;
  20883. }
  20884. function parseIntFromHex(val) {
  20885. return parseInt(val, 16);
  20886. }
  20887. function numberInputToObject(color2) {
  20888. return {
  20889. r: color2 >> 16,
  20890. g: (color2 & 65280) >> 8,
  20891. b: color2 & 255
  20892. };
  20893. }
  20894. var names = {
  20895. aliceblue: "#f0f8ff",
  20896. antiquewhite: "#faebd7",
  20897. aqua: "#00ffff",
  20898. aquamarine: "#7fffd4",
  20899. azure: "#f0ffff",
  20900. beige: "#f5f5dc",
  20901. bisque: "#ffe4c4",
  20902. black: "#000000",
  20903. blanchedalmond: "#ffebcd",
  20904. blue: "#0000ff",
  20905. blueviolet: "#8a2be2",
  20906. brown: "#a52a2a",
  20907. burlywood: "#deb887",
  20908. cadetblue: "#5f9ea0",
  20909. chartreuse: "#7fff00",
  20910. chocolate: "#d2691e",
  20911. coral: "#ff7f50",
  20912. cornflowerblue: "#6495ed",
  20913. cornsilk: "#fff8dc",
  20914. crimson: "#dc143c",
  20915. cyan: "#00ffff",
  20916. darkblue: "#00008b",
  20917. darkcyan: "#008b8b",
  20918. darkgoldenrod: "#b8860b",
  20919. darkgray: "#a9a9a9",
  20920. darkgreen: "#006400",
  20921. darkgrey: "#a9a9a9",
  20922. darkkhaki: "#bdb76b",
  20923. darkmagenta: "#8b008b",
  20924. darkolivegreen: "#556b2f",
  20925. darkorange: "#ff8c00",
  20926. darkorchid: "#9932cc",
  20927. darkred: "#8b0000",
  20928. darksalmon: "#e9967a",
  20929. darkseagreen: "#8fbc8f",
  20930. darkslateblue: "#483d8b",
  20931. darkslategray: "#2f4f4f",
  20932. darkslategrey: "#2f4f4f",
  20933. darkturquoise: "#00ced1",
  20934. darkviolet: "#9400d3",
  20935. deeppink: "#ff1493",
  20936. deepskyblue: "#00bfff",
  20937. dimgray: "#696969",
  20938. dimgrey: "#696969",
  20939. dodgerblue: "#1e90ff",
  20940. firebrick: "#b22222",
  20941. floralwhite: "#fffaf0",
  20942. forestgreen: "#228b22",
  20943. fuchsia: "#ff00ff",
  20944. gainsboro: "#dcdcdc",
  20945. ghostwhite: "#f8f8ff",
  20946. goldenrod: "#daa520",
  20947. gold: "#ffd700",
  20948. gray: "#808080",
  20949. green: "#008000",
  20950. greenyellow: "#adff2f",
  20951. grey: "#808080",
  20952. honeydew: "#f0fff0",
  20953. hotpink: "#ff69b4",
  20954. indianred: "#cd5c5c",
  20955. indigo: "#4b0082",
  20956. ivory: "#fffff0",
  20957. khaki: "#f0e68c",
  20958. lavenderblush: "#fff0f5",
  20959. lavender: "#e6e6fa",
  20960. lawngreen: "#7cfc00",
  20961. lemonchiffon: "#fffacd",
  20962. lightblue: "#add8e6",
  20963. lightcoral: "#f08080",
  20964. lightcyan: "#e0ffff",
  20965. lightgoldenrodyellow: "#fafad2",
  20966. lightgray: "#d3d3d3",
  20967. lightgreen: "#90ee90",
  20968. lightgrey: "#d3d3d3",
  20969. lightpink: "#ffb6c1",
  20970. lightsalmon: "#ffa07a",
  20971. lightseagreen: "#20b2aa",
  20972. lightskyblue: "#87cefa",
  20973. lightslategray: "#778899",
  20974. lightslategrey: "#778899",
  20975. lightsteelblue: "#b0c4de",
  20976. lightyellow: "#ffffe0",
  20977. lime: "#00ff00",
  20978. limegreen: "#32cd32",
  20979. linen: "#faf0e6",
  20980. magenta: "#ff00ff",
  20981. maroon: "#800000",
  20982. mediumaquamarine: "#66cdaa",
  20983. mediumblue: "#0000cd",
  20984. mediumorchid: "#ba55d3",
  20985. mediumpurple: "#9370db",
  20986. mediumseagreen: "#3cb371",
  20987. mediumslateblue: "#7b68ee",
  20988. mediumspringgreen: "#00fa9a",
  20989. mediumturquoise: "#48d1cc",
  20990. mediumvioletred: "#c71585",
  20991. midnightblue: "#191970",
  20992. mintcream: "#f5fffa",
  20993. mistyrose: "#ffe4e1",
  20994. moccasin: "#ffe4b5",
  20995. navajowhite: "#ffdead",
  20996. navy: "#000080",
  20997. oldlace: "#fdf5e6",
  20998. olive: "#808000",
  20999. olivedrab: "#6b8e23",
  21000. orange: "#ffa500",
  21001. orangered: "#ff4500",
  21002. orchid: "#da70d6",
  21003. palegoldenrod: "#eee8aa",
  21004. palegreen: "#98fb98",
  21005. paleturquoise: "#afeeee",
  21006. palevioletred: "#db7093",
  21007. papayawhip: "#ffefd5",
  21008. peachpuff: "#ffdab9",
  21009. peru: "#cd853f",
  21010. pink: "#ffc0cb",
  21011. plum: "#dda0dd",
  21012. powderblue: "#b0e0e6",
  21013. purple: "#800080",
  21014. rebeccapurple: "#663399",
  21015. red: "#ff0000",
  21016. rosybrown: "#bc8f8f",
  21017. royalblue: "#4169e1",
  21018. saddlebrown: "#8b4513",
  21019. salmon: "#fa8072",
  21020. sandybrown: "#f4a460",
  21021. seagreen: "#2e8b57",
  21022. seashell: "#fff5ee",
  21023. sienna: "#a0522d",
  21024. silver: "#c0c0c0",
  21025. skyblue: "#87ceeb",
  21026. slateblue: "#6a5acd",
  21027. slategray: "#708090",
  21028. slategrey: "#708090",
  21029. snow: "#fffafa",
  21030. springgreen: "#00ff7f",
  21031. steelblue: "#4682b4",
  21032. tan: "#d2b48c",
  21033. teal: "#008080",
  21034. thistle: "#d8bfd8",
  21035. tomato: "#ff6347",
  21036. turquoise: "#40e0d0",
  21037. violet: "#ee82ee",
  21038. wheat: "#f5deb3",
  21039. white: "#ffffff",
  21040. whitesmoke: "#f5f5f5",
  21041. yellow: "#ffff00",
  21042. yellowgreen: "#9acd32"
  21043. };
  21044. function inputToRGB(color2) {
  21045. var rgb = { r: 0, g: 0, b: 0 };
  21046. var a = 1;
  21047. var s = null;
  21048. var v = null;
  21049. var l = null;
  21050. var ok = false;
  21051. var format = false;
  21052. if (typeof color2 === "string") {
  21053. color2 = stringInputToObject(color2);
  21054. }
  21055. if (typeof color2 === "object") {
  21056. if (isValidCSSUnit(color2.r) && isValidCSSUnit(color2.g) && isValidCSSUnit(color2.b)) {
  21057. rgb = rgbToRgb(color2.r, color2.g, color2.b);
  21058. ok = true;
  21059. format = String(color2.r).substr(-1) === "%" ? "prgb" : "rgb";
  21060. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.v)) {
  21061. s = convertToPercentage(color2.s);
  21062. v = convertToPercentage(color2.v);
  21063. rgb = hsvToRgb(color2.h, s, v);
  21064. ok = true;
  21065. format = "hsv";
  21066. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.l)) {
  21067. s = convertToPercentage(color2.s);
  21068. l = convertToPercentage(color2.l);
  21069. rgb = hslToRgb(color2.h, s, l);
  21070. ok = true;
  21071. format = "hsl";
  21072. }
  21073. if (Object.prototype.hasOwnProperty.call(color2, "a")) {
  21074. a = color2.a;
  21075. }
  21076. }
  21077. a = boundAlpha(a);
  21078. return {
  21079. ok,
  21080. format: color2.format || format,
  21081. r: Math.min(255, Math.max(rgb.r, 0)),
  21082. g: Math.min(255, Math.max(rgb.g, 0)),
  21083. b: Math.min(255, Math.max(rgb.b, 0)),
  21084. a
  21085. };
  21086. }
  21087. var CSS_INTEGER = "[-\\+]?\\d+%?";
  21088. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  21089. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  21090. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21091. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21092. var matchers = {
  21093. CSS_UNIT: new RegExp(CSS_UNIT),
  21094. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  21095. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  21096. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  21097. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  21098. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  21099. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  21100. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21101. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  21102. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21103. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  21104. };
  21105. function stringInputToObject(color2) {
  21106. color2 = color2.trim().toLowerCase();
  21107. if (color2.length === 0) {
  21108. return false;
  21109. }
  21110. var named = false;
  21111. if (names[color2]) {
  21112. color2 = names[color2];
  21113. named = true;
  21114. } else if (color2 === "transparent") {
  21115. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  21116. }
  21117. var match = matchers.rgb.exec(color2);
  21118. if (match) {
  21119. return { r: match[1], g: match[2], b: match[3] };
  21120. }
  21121. match = matchers.rgba.exec(color2);
  21122. if (match) {
  21123. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  21124. }
  21125. match = matchers.hsl.exec(color2);
  21126. if (match) {
  21127. return { h: match[1], s: match[2], l: match[3] };
  21128. }
  21129. match = matchers.hsla.exec(color2);
  21130. if (match) {
  21131. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  21132. }
  21133. match = matchers.hsv.exec(color2);
  21134. if (match) {
  21135. return { h: match[1], s: match[2], v: match[3] };
  21136. }
  21137. match = matchers.hsva.exec(color2);
  21138. if (match) {
  21139. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  21140. }
  21141. match = matchers.hex8.exec(color2);
  21142. if (match) {
  21143. return {
  21144. r: parseIntFromHex(match[1]),
  21145. g: parseIntFromHex(match[2]),
  21146. b: parseIntFromHex(match[3]),
  21147. a: convertHexToDecimal(match[4]),
  21148. format: named ? "name" : "hex8"
  21149. };
  21150. }
  21151. match = matchers.hex6.exec(color2);
  21152. if (match) {
  21153. return {
  21154. r: parseIntFromHex(match[1]),
  21155. g: parseIntFromHex(match[2]),
  21156. b: parseIntFromHex(match[3]),
  21157. format: named ? "name" : "hex"
  21158. };
  21159. }
  21160. match = matchers.hex4.exec(color2);
  21161. if (match) {
  21162. return {
  21163. r: parseIntFromHex(match[1] + match[1]),
  21164. g: parseIntFromHex(match[2] + match[2]),
  21165. b: parseIntFromHex(match[3] + match[3]),
  21166. a: convertHexToDecimal(match[4] + match[4]),
  21167. format: named ? "name" : "hex8"
  21168. };
  21169. }
  21170. match = matchers.hex3.exec(color2);
  21171. if (match) {
  21172. return {
  21173. r: parseIntFromHex(match[1] + match[1]),
  21174. g: parseIntFromHex(match[2] + match[2]),
  21175. b: parseIntFromHex(match[3] + match[3]),
  21176. format: named ? "name" : "hex"
  21177. };
  21178. }
  21179. return false;
  21180. }
  21181. function isValidCSSUnit(color2) {
  21182. return Boolean(matchers.CSS_UNIT.exec(String(color2)));
  21183. }
  21184. var TinyColor = function() {
  21185. function TinyColor2(color2, opts) {
  21186. if (color2 === void 0) {
  21187. color2 = "";
  21188. }
  21189. if (opts === void 0) {
  21190. opts = {};
  21191. }
  21192. var _a2;
  21193. if (color2 instanceof TinyColor2) {
  21194. return color2;
  21195. }
  21196. if (typeof color2 === "number") {
  21197. color2 = numberInputToObject(color2);
  21198. }
  21199. this.originalInput = color2;
  21200. var rgb = inputToRGB(color2);
  21201. this.originalInput = color2;
  21202. this.r = rgb.r;
  21203. this.g = rgb.g;
  21204. this.b = rgb.b;
  21205. this.a = rgb.a;
  21206. this.roundA = Math.round(100 * this.a) / 100;
  21207. this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb.format;
  21208. this.gradientType = opts.gradientType;
  21209. if (this.r < 1) {
  21210. this.r = Math.round(this.r);
  21211. }
  21212. if (this.g < 1) {
  21213. this.g = Math.round(this.g);
  21214. }
  21215. if (this.b < 1) {
  21216. this.b = Math.round(this.b);
  21217. }
  21218. this.isValid = rgb.ok;
  21219. }
  21220. TinyColor2.prototype.isDark = function() {
  21221. return this.getBrightness() < 128;
  21222. };
  21223. TinyColor2.prototype.isLight = function() {
  21224. return !this.isDark();
  21225. };
  21226. TinyColor2.prototype.getBrightness = function() {
  21227. var rgb = this.toRgb();
  21228. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  21229. };
  21230. TinyColor2.prototype.getLuminance = function() {
  21231. var rgb = this.toRgb();
  21232. var R2;
  21233. var G2;
  21234. var B2;
  21235. var RsRGB = rgb.r / 255;
  21236. var GsRGB = rgb.g / 255;
  21237. var BsRGB = rgb.b / 255;
  21238. if (RsRGB <= 0.03928) {
  21239. R2 = RsRGB / 12.92;
  21240. } else {
  21241. R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
  21242. }
  21243. if (GsRGB <= 0.03928) {
  21244. G2 = GsRGB / 12.92;
  21245. } else {
  21246. G2 = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
  21247. }
  21248. if (BsRGB <= 0.03928) {
  21249. B2 = BsRGB / 12.92;
  21250. } else {
  21251. B2 = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
  21252. }
  21253. return 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B2;
  21254. };
  21255. TinyColor2.prototype.getAlpha = function() {
  21256. return this.a;
  21257. };
  21258. TinyColor2.prototype.setAlpha = function(alpha) {
  21259. this.a = boundAlpha(alpha);
  21260. this.roundA = Math.round(100 * this.a) / 100;
  21261. return this;
  21262. };
  21263. TinyColor2.prototype.isMonochrome = function() {
  21264. var s = this.toHsl().s;
  21265. return s === 0;
  21266. };
  21267. TinyColor2.prototype.toHsv = function() {
  21268. var hsv = rgbToHsv(this.r, this.g, this.b);
  21269. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
  21270. };
  21271. TinyColor2.prototype.toHsvString = function() {
  21272. var hsv = rgbToHsv(this.r, this.g, this.b);
  21273. var h2 = Math.round(hsv.h * 360);
  21274. var s = Math.round(hsv.s * 100);
  21275. var v = Math.round(hsv.v * 100);
  21276. return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  21277. };
  21278. TinyColor2.prototype.toHsl = function() {
  21279. var hsl = rgbToHsl(this.r, this.g, this.b);
  21280. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
  21281. };
  21282. TinyColor2.prototype.toHslString = function() {
  21283. var hsl = rgbToHsl(this.r, this.g, this.b);
  21284. var h2 = Math.round(hsl.h * 360);
  21285. var s = Math.round(hsl.s * 100);
  21286. var l = Math.round(hsl.l * 100);
  21287. return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  21288. };
  21289. TinyColor2.prototype.toHex = function(allow3Char) {
  21290. if (allow3Char === void 0) {
  21291. allow3Char = false;
  21292. }
  21293. return rgbToHex(this.r, this.g, this.b, allow3Char);
  21294. };
  21295. TinyColor2.prototype.toHexString = function(allow3Char) {
  21296. if (allow3Char === void 0) {
  21297. allow3Char = false;
  21298. }
  21299. return "#" + this.toHex(allow3Char);
  21300. };
  21301. TinyColor2.prototype.toHex8 = function(allow4Char) {
  21302. if (allow4Char === void 0) {
  21303. allow4Char = false;
  21304. }
  21305. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  21306. };
  21307. TinyColor2.prototype.toHex8String = function(allow4Char) {
  21308. if (allow4Char === void 0) {
  21309. allow4Char = false;
  21310. }
  21311. return "#" + this.toHex8(allow4Char);
  21312. };
  21313. TinyColor2.prototype.toHexShortString = function(allowShortChar) {
  21314. if (allowShortChar === void 0) {
  21315. allowShortChar = false;
  21316. }
  21317. return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
  21318. };
  21319. TinyColor2.prototype.toRgb = function() {
  21320. return {
  21321. r: Math.round(this.r),
  21322. g: Math.round(this.g),
  21323. b: Math.round(this.b),
  21324. a: this.a
  21325. };
  21326. };
  21327. TinyColor2.prototype.toRgbString = function() {
  21328. var r2 = Math.round(this.r);
  21329. var g = Math.round(this.g);
  21330. var b = Math.round(this.b);
  21331. return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r2, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  21332. };
  21333. TinyColor2.prototype.toPercentageRgb = function() {
  21334. var fmt = function(x) {
  21335. return "".concat(Math.round(bound01$1(x, 255) * 100), "%");
  21336. };
  21337. return {
  21338. r: fmt(this.r),
  21339. g: fmt(this.g),
  21340. b: fmt(this.b),
  21341. a: this.a
  21342. };
  21343. };
  21344. TinyColor2.prototype.toPercentageRgbString = function() {
  21345. var rnd = function(x) {
  21346. return Math.round(bound01$1(x, 255) * 100);
  21347. };
  21348. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  21349. };
  21350. TinyColor2.prototype.toName = function() {
  21351. if (this.a === 0) {
  21352. return "transparent";
  21353. }
  21354. if (this.a < 1) {
  21355. return false;
  21356. }
  21357. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  21358. for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
  21359. var _b = _a2[_i], key = _b[0], value = _b[1];
  21360. if (hex === value) {
  21361. return key;
  21362. }
  21363. }
  21364. return false;
  21365. };
  21366. TinyColor2.prototype.toString = function(format) {
  21367. var formatSet = Boolean(format);
  21368. format = format !== null && format !== void 0 ? format : this.format;
  21369. var formattedString = false;
  21370. var hasAlpha = this.a < 1 && this.a >= 0;
  21371. var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
  21372. if (needsAlphaFormat) {
  21373. if (format === "name" && this.a === 0) {
  21374. return this.toName();
  21375. }
  21376. return this.toRgbString();
  21377. }
  21378. if (format === "rgb") {
  21379. formattedString = this.toRgbString();
  21380. }
  21381. if (format === "prgb") {
  21382. formattedString = this.toPercentageRgbString();
  21383. }
  21384. if (format === "hex" || format === "hex6") {
  21385. formattedString = this.toHexString();
  21386. }
  21387. if (format === "hex3") {
  21388. formattedString = this.toHexString(true);
  21389. }
  21390. if (format === "hex4") {
  21391. formattedString = this.toHex8String(true);
  21392. }
  21393. if (format === "hex8") {
  21394. formattedString = this.toHex8String();
  21395. }
  21396. if (format === "name") {
  21397. formattedString = this.toName();
  21398. }
  21399. if (format === "hsl") {
  21400. formattedString = this.toHslString();
  21401. }
  21402. if (format === "hsv") {
  21403. formattedString = this.toHsvString();
  21404. }
  21405. return formattedString || this.toHexString();
  21406. };
  21407. TinyColor2.prototype.toNumber = function() {
  21408. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  21409. };
  21410. TinyColor2.prototype.clone = function() {
  21411. return new TinyColor2(this.toString());
  21412. };
  21413. TinyColor2.prototype.lighten = function(amount) {
  21414. if (amount === void 0) {
  21415. amount = 10;
  21416. }
  21417. var hsl = this.toHsl();
  21418. hsl.l += amount / 100;
  21419. hsl.l = clamp01(hsl.l);
  21420. return new TinyColor2(hsl);
  21421. };
  21422. TinyColor2.prototype.brighten = function(amount) {
  21423. if (amount === void 0) {
  21424. amount = 10;
  21425. }
  21426. var rgb = this.toRgb();
  21427. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  21428. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  21429. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  21430. return new TinyColor2(rgb);
  21431. };
  21432. TinyColor2.prototype.darken = function(amount) {
  21433. if (amount === void 0) {
  21434. amount = 10;
  21435. }
  21436. var hsl = this.toHsl();
  21437. hsl.l -= amount / 100;
  21438. hsl.l = clamp01(hsl.l);
  21439. return new TinyColor2(hsl);
  21440. };
  21441. TinyColor2.prototype.tint = function(amount) {
  21442. if (amount === void 0) {
  21443. amount = 10;
  21444. }
  21445. return this.mix("white", amount);
  21446. };
  21447. TinyColor2.prototype.shade = function(amount) {
  21448. if (amount === void 0) {
  21449. amount = 10;
  21450. }
  21451. return this.mix("black", amount);
  21452. };
  21453. TinyColor2.prototype.desaturate = function(amount) {
  21454. if (amount === void 0) {
  21455. amount = 10;
  21456. }
  21457. var hsl = this.toHsl();
  21458. hsl.s -= amount / 100;
  21459. hsl.s = clamp01(hsl.s);
  21460. return new TinyColor2(hsl);
  21461. };
  21462. TinyColor2.prototype.saturate = function(amount) {
  21463. if (amount === void 0) {
  21464. amount = 10;
  21465. }
  21466. var hsl = this.toHsl();
  21467. hsl.s += amount / 100;
  21468. hsl.s = clamp01(hsl.s);
  21469. return new TinyColor2(hsl);
  21470. };
  21471. TinyColor2.prototype.greyscale = function() {
  21472. return this.desaturate(100);
  21473. };
  21474. TinyColor2.prototype.spin = function(amount) {
  21475. var hsl = this.toHsl();
  21476. var hue = (hsl.h + amount) % 360;
  21477. hsl.h = hue < 0 ? 360 + hue : hue;
  21478. return new TinyColor2(hsl);
  21479. };
  21480. TinyColor2.prototype.mix = function(color2, amount) {
  21481. if (amount === void 0) {
  21482. amount = 50;
  21483. }
  21484. var rgb1 = this.toRgb();
  21485. var rgb2 = new TinyColor2(color2).toRgb();
  21486. var p = amount / 100;
  21487. var rgba = {
  21488. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  21489. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  21490. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  21491. a: (rgb2.a - rgb1.a) * p + rgb1.a
  21492. };
  21493. return new TinyColor2(rgba);
  21494. };
  21495. TinyColor2.prototype.analogous = function(results, slices) {
  21496. if (results === void 0) {
  21497. results = 6;
  21498. }
  21499. if (slices === void 0) {
  21500. slices = 30;
  21501. }
  21502. var hsl = this.toHsl();
  21503. var part = 360 / slices;
  21504. var ret = [this];
  21505. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
  21506. hsl.h = (hsl.h + part) % 360;
  21507. ret.push(new TinyColor2(hsl));
  21508. }
  21509. return ret;
  21510. };
  21511. TinyColor2.prototype.complement = function() {
  21512. var hsl = this.toHsl();
  21513. hsl.h = (hsl.h + 180) % 360;
  21514. return new TinyColor2(hsl);
  21515. };
  21516. TinyColor2.prototype.monochromatic = function(results) {
  21517. if (results === void 0) {
  21518. results = 6;
  21519. }
  21520. var hsv = this.toHsv();
  21521. var h2 = hsv.h;
  21522. var s = hsv.s;
  21523. var v = hsv.v;
  21524. var res = [];
  21525. var modification = 1 / results;
  21526. while (results--) {
  21527. res.push(new TinyColor2({ h: h2, s, v }));
  21528. v = (v + modification) % 1;
  21529. }
  21530. return res;
  21531. };
  21532. TinyColor2.prototype.splitcomplement = function() {
  21533. var hsl = this.toHsl();
  21534. var h2 = hsl.h;
  21535. return [
  21536. this,
  21537. new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
  21538. new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
  21539. ];
  21540. };
  21541. TinyColor2.prototype.onBackground = function(background) {
  21542. var fg = this.toRgb();
  21543. var bg = new TinyColor2(background).toRgb();
  21544. var alpha = fg.a + bg.a * (1 - fg.a);
  21545. return new TinyColor2({
  21546. r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
  21547. g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
  21548. b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
  21549. a: alpha
  21550. });
  21551. };
  21552. TinyColor2.prototype.triad = function() {
  21553. return this.polyad(3);
  21554. };
  21555. TinyColor2.prototype.tetrad = function() {
  21556. return this.polyad(4);
  21557. };
  21558. TinyColor2.prototype.polyad = function(n) {
  21559. var hsl = this.toHsl();
  21560. var h2 = hsl.h;
  21561. var result = [this];
  21562. var increment = 360 / n;
  21563. for (var i2 = 1; i2 < n; i2++) {
  21564. result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl.s, l: hsl.l }));
  21565. }
  21566. return result;
  21567. };
  21568. TinyColor2.prototype.equals = function(color2) {
  21569. return this.toRgbString() === new TinyColor2(color2).toRgbString();
  21570. };
  21571. return TinyColor2;
  21572. }();
  21573. function darken(color2, amount = 20) {
  21574. return color2.mix("#141414", amount).toString();
  21575. }
  21576. function useButtonCustomStyle(props) {
  21577. const _disabled = useFormDisabled();
  21578. const ns = useNamespace("button");
  21579. return computed$1(() => {
  21580. let styles = {};
  21581. const buttonColor = props.color;
  21582. if (buttonColor) {
  21583. const color2 = new TinyColor(buttonColor);
  21584. const activeBgColor = props.dark ? color2.tint(20).toString() : darken(color2, 20);
  21585. if (props.plain) {
  21586. styles = ns.cssVarBlock({
  21587. "bg-color": props.dark ? darken(color2, 90) : color2.tint(90).toString(),
  21588. "text-color": buttonColor,
  21589. "border-color": props.dark ? darken(color2, 50) : color2.tint(50).toString(),
  21590. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  21591. "hover-bg-color": buttonColor,
  21592. "hover-border-color": buttonColor,
  21593. "active-bg-color": activeBgColor,
  21594. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  21595. "active-border-color": activeBgColor
  21596. });
  21597. if (_disabled.value) {
  21598. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color2, 90) : color2.tint(90).toString();
  21599. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21600. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color2, 80) : color2.tint(80).toString();
  21601. }
  21602. } else {
  21603. const hoverBgColor = props.dark ? darken(color2, 30) : color2.tint(30).toString();
  21604. const textColor = color2.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  21605. styles = ns.cssVarBlock({
  21606. "bg-color": buttonColor,
  21607. "text-color": textColor,
  21608. "border-color": buttonColor,
  21609. "hover-bg-color": hoverBgColor,
  21610. "hover-text-color": textColor,
  21611. "hover-border-color": hoverBgColor,
  21612. "active-bg-color": activeBgColor,
  21613. "active-border-color": activeBgColor
  21614. });
  21615. if (_disabled.value) {
  21616. const disabledButtonColor = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21617. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  21618. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  21619. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  21620. }
  21621. }
  21622. }
  21623. return styles;
  21624. });
  21625. }
  21626. const __default__$e = defineComponent({
  21627. name: "ElButton"
  21628. });
  21629. const _sfc_main$o = /* @__PURE__ */ defineComponent({
  21630. ...__default__$e,
  21631. props: buttonProps,
  21632. emits: buttonEmits,
  21633. setup(__props, { expose, emit }) {
  21634. const props = __props;
  21635. const buttonStyle = useButtonCustomStyle(props);
  21636. const ns = useNamespace("button");
  21637. const { _ref, _size, _type, _disabled, _props, shouldAddSpace, handleClick } = useButton(props, emit);
  21638. expose({
  21639. ref: _ref,
  21640. size: _size,
  21641. type: _type,
  21642. disabled: _disabled,
  21643. shouldAddSpace
  21644. });
  21645. return (_ctx, _cache) => {
  21646. return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
  21647. ref_key: "_ref",
  21648. ref: _ref
  21649. }, unref(_props), {
  21650. class: [
  21651. unref(ns).b(),
  21652. unref(ns).m(unref(_type)),
  21653. unref(ns).m(unref(_size)),
  21654. unref(ns).is("disabled", unref(_disabled)),
  21655. unref(ns).is("loading", _ctx.loading),
  21656. unref(ns).is("plain", _ctx.plain),
  21657. unref(ns).is("round", _ctx.round),
  21658. unref(ns).is("circle", _ctx.circle),
  21659. unref(ns).is("text", _ctx.text),
  21660. unref(ns).is("link", _ctx.link),
  21661. unref(ns).is("has-bg", _ctx.bg)
  21662. ],
  21663. style: unref(buttonStyle),
  21664. onClick: unref(handleClick)
  21665. }), {
  21666. default: withCtx(() => [
  21667. _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  21668. _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
  21669. key: 1,
  21670. class: normalizeClass(unref(ns).is("loading"))
  21671. }, {
  21672. default: withCtx(() => [
  21673. (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
  21674. ]),
  21675. _: 1
  21676. }, 8, ["class"]))
  21677. ], 64)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  21678. default: withCtx(() => [
  21679. _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
  21680. ]),
  21681. _: 3
  21682. })) : createCommentVNode("v-if", true),
  21683. _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
  21684. key: 2,
  21685. class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
  21686. }, [
  21687. renderSlot(_ctx.$slots, "default")
  21688. ], 2)) : createCommentVNode("v-if", true)
  21689. ]),
  21690. _: 3
  21691. }, 16, ["class", "style", "onClick"]);
  21692. };
  21693. }
  21694. });
  21695. var Button$2 = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
  21696. const buttonGroupProps = {
  21697. size: buttonProps.size,
  21698. type: buttonProps.type
  21699. };
  21700. const __default__$d = defineComponent({
  21701. name: "ElButtonGroup"
  21702. });
  21703. const _sfc_main$n = /* @__PURE__ */ defineComponent({
  21704. ...__default__$d,
  21705. props: buttonGroupProps,
  21706. setup(__props) {
  21707. const props = __props;
  21708. provide(buttonGroupContextKey, reactive({
  21709. size: toRef(props, "size"),
  21710. type: toRef(props, "type")
  21711. }));
  21712. const ns = useNamespace("button");
  21713. return (_ctx, _cache) => {
  21714. return openBlock(), createElementBlock("div", {
  21715. class: normalizeClass(`${unref(ns).b("group")}`)
  21716. }, [
  21717. renderSlot(_ctx.$slots, "default")
  21718. ], 2);
  21719. };
  21720. }
  21721. });
  21722. var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
  21723. const ElButton = withInstall(Button$2, {
  21724. ButtonGroup
  21725. });
  21726. const ElButtonGroup = withNoopInstall(ButtonGroup);
  21727. const nodeList = /* @__PURE__ */ new Map();
  21728. let startClick;
  21729. if (isClient) {
  21730. document.addEventListener("mousedown", (e) => startClick = e);
  21731. document.addEventListener("mouseup", (e) => {
  21732. for (const handlers of nodeList.values()) {
  21733. for (const { documentHandler } of handlers) {
  21734. documentHandler(e, startClick);
  21735. }
  21736. }
  21737. });
  21738. }
  21739. function createDocumentHandler(el, binding) {
  21740. let excludes = [];
  21741. if (Array.isArray(binding.arg)) {
  21742. excludes = binding.arg;
  21743. } else if (isElement(binding.arg)) {
  21744. excludes.push(binding.arg);
  21745. }
  21746. return function(mouseup, mousedown) {
  21747. const popperRef = binding.instance.popperRef;
  21748. const mouseUpTarget = mouseup.target;
  21749. const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
  21750. const isBound = !binding || !binding.instance;
  21751. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  21752. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  21753. const isSelf = el === mouseUpTarget;
  21754. const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  21755. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  21756. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
  21757. return;
  21758. }
  21759. binding.value(mouseup, mousedown);
  21760. };
  21761. }
  21762. const ClickOutside = {
  21763. beforeMount(el, binding) {
  21764. if (!nodeList.has(el)) {
  21765. nodeList.set(el, []);
  21766. }
  21767. nodeList.get(el).push({
  21768. documentHandler: createDocumentHandler(el, binding),
  21769. bindingFn: binding.value
  21770. });
  21771. },
  21772. updated(el, binding) {
  21773. if (!nodeList.has(el)) {
  21774. nodeList.set(el, []);
  21775. }
  21776. const handlers = nodeList.get(el);
  21777. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  21778. const newHandler = {
  21779. documentHandler: createDocumentHandler(el, binding),
  21780. bindingFn: binding.value
  21781. };
  21782. if (oldHandlerIndex >= 0) {
  21783. handlers.splice(oldHandlerIndex, 1, newHandler);
  21784. } else {
  21785. handlers.push(newHandler);
  21786. }
  21787. },
  21788. unmounted(el) {
  21789. nodeList.delete(el);
  21790. }
  21791. };
  21792. const REPEAT_INTERVAL = 100;
  21793. const REPEAT_DELAY = 600;
  21794. const vRepeatClick = {
  21795. beforeMount(el, binding) {
  21796. const value = binding.value;
  21797. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$3(value) ? {} : value;
  21798. let intervalId;
  21799. let delayId;
  21800. const handler = () => isFunction$3(value) ? value() : value.handler();
  21801. const clear = () => {
  21802. if (delayId) {
  21803. clearTimeout(delayId);
  21804. delayId = void 0;
  21805. }
  21806. if (intervalId) {
  21807. clearInterval(intervalId);
  21808. intervalId = void 0;
  21809. }
  21810. };
  21811. el.addEventListener("mousedown", (evt) => {
  21812. if (evt.button !== 0)
  21813. return;
  21814. clear();
  21815. handler();
  21816. document.addEventListener("mouseup", () => clear(), {
  21817. once: true
  21818. });
  21819. delayId = setTimeout(() => {
  21820. intervalId = setInterval(() => {
  21821. handler();
  21822. }, interval);
  21823. }, delay);
  21824. });
  21825. }
  21826. };
  21827. const radioPropsBase = buildProps({
  21828. size: useSizeProp,
  21829. disabled: Boolean,
  21830. label: {
  21831. type: [String, Number, Boolean],
  21832. default: ""
  21833. }
  21834. });
  21835. const radioProps = buildProps({
  21836. ...radioPropsBase,
  21837. modelValue: {
  21838. type: [String, Number, Boolean],
  21839. default: ""
  21840. },
  21841. name: {
  21842. type: String,
  21843. default: ""
  21844. },
  21845. border: Boolean
  21846. });
  21847. const radioEmits = {
  21848. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  21849. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  21850. };
  21851. const radioGroupKey = Symbol("radioGroupKey");
  21852. const useRadio = (props, emit) => {
  21853. const radioRef = ref();
  21854. const radioGroup = inject(radioGroupKey, void 0);
  21855. const isGroup = computed$1(() => !!radioGroup);
  21856. const modelValue = computed$1({
  21857. get() {
  21858. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  21859. },
  21860. set(val) {
  21861. if (isGroup.value) {
  21862. radioGroup.changeEvent(val);
  21863. } else {
  21864. emit && emit(UPDATE_MODEL_EVENT, val);
  21865. }
  21866. radioRef.value.checked = props.modelValue === props.label;
  21867. }
  21868. });
  21869. const size = useFormSize(computed$1(() => radioGroup == null ? void 0 : radioGroup.size));
  21870. const disabled = useFormDisabled(computed$1(() => radioGroup == null ? void 0 : radioGroup.disabled));
  21871. const focus = ref(false);
  21872. const tabIndex = computed$1(() => {
  21873. return disabled.value || isGroup.value && modelValue.value !== props.label ? -1 : 0;
  21874. });
  21875. return {
  21876. radioRef,
  21877. isGroup,
  21878. radioGroup,
  21879. focus,
  21880. size,
  21881. disabled,
  21882. tabIndex,
  21883. modelValue
  21884. };
  21885. };
  21886. const _hoisted_1$e = ["value", "name", "disabled"];
  21887. const __default__$c = defineComponent({
  21888. name: "ElRadio"
  21889. });
  21890. const _sfc_main$m = /* @__PURE__ */ defineComponent({
  21891. ...__default__$c,
  21892. props: radioProps,
  21893. emits: radioEmits,
  21894. setup(__props, { emit }) {
  21895. const props = __props;
  21896. const ns = useNamespace("radio");
  21897. const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
  21898. function handleChange() {
  21899. nextTick(() => emit("change", modelValue.value));
  21900. }
  21901. return (_ctx, _cache) => {
  21902. var _a2;
  21903. return openBlock(), createElementBlock("label", {
  21904. class: normalizeClass([
  21905. unref(ns).b(),
  21906. unref(ns).is("disabled", unref(disabled)),
  21907. unref(ns).is("focus", unref(focus)),
  21908. unref(ns).is("bordered", _ctx.border),
  21909. unref(ns).is("checked", unref(modelValue) === _ctx.label),
  21910. unref(ns).m(unref(size))
  21911. ])
  21912. }, [
  21913. createElementVNode("span", {
  21914. class: normalizeClass([
  21915. unref(ns).e("input"),
  21916. unref(ns).is("disabled", unref(disabled)),
  21917. unref(ns).is("checked", unref(modelValue) === _ctx.label)
  21918. ])
  21919. }, [
  21920. withDirectives(createElementVNode("input", {
  21921. ref_key: "radioRef",
  21922. ref: radioRef,
  21923. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  21924. class: normalizeClass(unref(ns).e("original")),
  21925. value: _ctx.label,
  21926. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  21927. disabled: unref(disabled),
  21928. type: "radio",
  21929. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  21930. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  21931. onChange: handleChange
  21932. }, null, 42, _hoisted_1$e), [
  21933. [vModelRadio, unref(modelValue)]
  21934. ]),
  21935. createElementVNode("span", {
  21936. class: normalizeClass(unref(ns).e("inner"))
  21937. }, null, 2)
  21938. ], 2),
  21939. createElementVNode("span", {
  21940. class: normalizeClass(unref(ns).e("label")),
  21941. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  21942. }, ["stop"]))
  21943. }, [
  21944. renderSlot(_ctx.$slots, "default", {}, () => [
  21945. createTextVNode(toDisplayString(_ctx.label), 1)
  21946. ])
  21947. ], 34)
  21948. ], 2);
  21949. };
  21950. }
  21951. });
  21952. var Radio = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio.vue"]]);
  21953. const radioButtonProps = buildProps({
  21954. ...radioPropsBase,
  21955. name: {
  21956. type: String,
  21957. default: ""
  21958. }
  21959. });
  21960. const _hoisted_1$d = ["value", "name", "disabled"];
  21961. const __default__$b = defineComponent({
  21962. name: "ElRadioButton"
  21963. });
  21964. const _sfc_main$l = /* @__PURE__ */ defineComponent({
  21965. ...__default__$b,
  21966. props: radioButtonProps,
  21967. setup(__props) {
  21968. const props = __props;
  21969. const ns = useNamespace("radio");
  21970. const { radioRef, focus, size, disabled, modelValue, radioGroup } = useRadio(props);
  21971. const activeStyle = computed$1(() => {
  21972. return {
  21973. backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  21974. borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  21975. boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  21976. color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
  21977. };
  21978. });
  21979. return (_ctx, _cache) => {
  21980. var _a2;
  21981. return openBlock(), createElementBlock("label", {
  21982. class: normalizeClass([
  21983. unref(ns).b("button"),
  21984. unref(ns).is("active", unref(modelValue) === _ctx.label),
  21985. unref(ns).is("disabled", unref(disabled)),
  21986. unref(ns).is("focus", unref(focus)),
  21987. unref(ns).bm("button", unref(size))
  21988. ])
  21989. }, [
  21990. withDirectives(createElementVNode("input", {
  21991. ref_key: "radioRef",
  21992. ref: radioRef,
  21993. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  21994. class: normalizeClass(unref(ns).be("button", "original-radio")),
  21995. value: _ctx.label,
  21996. type: "radio",
  21997. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  21998. disabled: unref(disabled),
  21999. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  22000. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false)
  22001. }, null, 42, _hoisted_1$d), [
  22002. [vModelRadio, unref(modelValue)]
  22003. ]),
  22004. createElementVNode("span", {
  22005. class: normalizeClass(unref(ns).be("button", "inner")),
  22006. style: normalizeStyle(unref(modelValue) === _ctx.label ? unref(activeStyle) : {}),
  22007. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  22008. }, ["stop"]))
  22009. }, [
  22010. renderSlot(_ctx.$slots, "default", {}, () => [
  22011. createTextVNode(toDisplayString(_ctx.label), 1)
  22012. ])
  22013. ], 38)
  22014. ], 2);
  22015. };
  22016. }
  22017. });
  22018. var RadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-button.vue"]]);
  22019. const radioGroupProps = buildProps({
  22020. id: {
  22021. type: String,
  22022. default: void 0
  22023. },
  22024. size: useSizeProp,
  22025. disabled: Boolean,
  22026. modelValue: {
  22027. type: [String, Number, Boolean],
  22028. default: ""
  22029. },
  22030. fill: {
  22031. type: String,
  22032. default: ""
  22033. },
  22034. label: {
  22035. type: String,
  22036. default: void 0
  22037. },
  22038. textColor: {
  22039. type: String,
  22040. default: ""
  22041. },
  22042. name: {
  22043. type: String,
  22044. default: void 0
  22045. },
  22046. validateEvent: {
  22047. type: Boolean,
  22048. default: true
  22049. }
  22050. });
  22051. const radioGroupEmits = radioEmits;
  22052. const _hoisted_1$c = ["id", "aria-label", "aria-labelledby"];
  22053. const __default__$a = defineComponent({
  22054. name: "ElRadioGroup"
  22055. });
  22056. const _sfc_main$k = /* @__PURE__ */ defineComponent({
  22057. ...__default__$a,
  22058. props: radioGroupProps,
  22059. emits: radioGroupEmits,
  22060. setup(__props, { emit }) {
  22061. const props = __props;
  22062. const ns = useNamespace("radio");
  22063. const radioId = useId();
  22064. const radioGroupRef = ref();
  22065. const { formItem } = useFormItem();
  22066. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
  22067. formItemContext: formItem
  22068. });
  22069. const changeEvent = (value) => {
  22070. emit(UPDATE_MODEL_EVENT, value);
  22071. nextTick(() => emit("change", value));
  22072. };
  22073. onMounted(() => {
  22074. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  22075. const firstLabel = radios[0];
  22076. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
  22077. firstLabel.tabIndex = 0;
  22078. }
  22079. });
  22080. const name = computed$1(() => {
  22081. return props.name || radioId.value;
  22082. });
  22083. provide(radioGroupKey, reactive({
  22084. ...toRefs(props),
  22085. changeEvent,
  22086. name
  22087. }));
  22088. watch(() => props.modelValue, () => {
  22089. if (props.validateEvent) {
  22090. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  22091. }
  22092. });
  22093. return (_ctx, _cache) => {
  22094. return openBlock(), createElementBlock("div", {
  22095. id: unref(groupId),
  22096. ref_key: "radioGroupRef",
  22097. ref: radioGroupRef,
  22098. class: normalizeClass(unref(ns).b("group")),
  22099. role: "radiogroup",
  22100. "aria-label": !unref(isLabeledByFormItem) ? _ctx.label || "radio-group" : void 0,
  22101. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
  22102. }, [
  22103. renderSlot(_ctx.$slots, "default")
  22104. ], 10, _hoisted_1$c);
  22105. };
  22106. }
  22107. });
  22108. var RadioGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-group.vue"]]);
  22109. withInstall(Radio, {
  22110. RadioButton,
  22111. RadioGroup
  22112. });
  22113. const ElRadioGroup = withNoopInstall(RadioGroup);
  22114. const ElRadioButton = withNoopInstall(RadioButton);
  22115. const tagProps = buildProps({
  22116. closable: Boolean,
  22117. type: {
  22118. type: String,
  22119. values: ["success", "info", "warning", "danger", ""],
  22120. default: ""
  22121. },
  22122. hit: Boolean,
  22123. disableTransitions: Boolean,
  22124. color: {
  22125. type: String,
  22126. default: ""
  22127. },
  22128. size: {
  22129. type: String,
  22130. values: componentSizes,
  22131. default: ""
  22132. },
  22133. effect: {
  22134. type: String,
  22135. values: ["dark", "light", "plain"],
  22136. default: "light"
  22137. },
  22138. round: Boolean
  22139. });
  22140. const tagEmits = {
  22141. close: (evt) => evt instanceof MouseEvent,
  22142. click: (evt) => evt instanceof MouseEvent
  22143. };
  22144. const __default__$9 = defineComponent({
  22145. name: "ElTag"
  22146. });
  22147. const _sfc_main$j = /* @__PURE__ */ defineComponent({
  22148. ...__default__$9,
  22149. props: tagProps,
  22150. emits: tagEmits,
  22151. setup(__props, { emit }) {
  22152. const props = __props;
  22153. const tagSize = useFormSize();
  22154. const ns = useNamespace("tag");
  22155. const classes = computed$1(() => {
  22156. const { type: type2, hit, effect, closable, round: round2 } = props;
  22157. return [
  22158. ns.b(),
  22159. ns.is("closable", closable),
  22160. ns.m(type2),
  22161. ns.m(tagSize.value),
  22162. ns.m(effect),
  22163. ns.is("hit", hit),
  22164. ns.is("round", round2)
  22165. ];
  22166. });
  22167. const handleClose = (event2) => {
  22168. emit("close", event2);
  22169. };
  22170. const handleClick = (event2) => {
  22171. emit("click", event2);
  22172. };
  22173. return (_ctx, _cache) => {
  22174. return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
  22175. key: 0,
  22176. class: normalizeClass(unref(classes)),
  22177. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22178. onClick: handleClick
  22179. }, [
  22180. createElementVNode("span", {
  22181. class: normalizeClass(unref(ns).e("content"))
  22182. }, [
  22183. renderSlot(_ctx.$slots, "default")
  22184. ], 2),
  22185. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22186. key: 0,
  22187. class: normalizeClass(unref(ns).e("close")),
  22188. onClick: withModifiers(handleClose, ["stop"])
  22189. }, {
  22190. default: withCtx(() => [
  22191. createVNode(unref(close_default))
  22192. ]),
  22193. _: 1
  22194. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22195. ], 6)) : (openBlock(), createBlock(Transition, {
  22196. key: 1,
  22197. name: `${unref(ns).namespace.value}-zoom-in-center`,
  22198. appear: ""
  22199. }, {
  22200. default: withCtx(() => [
  22201. createElementVNode("span", {
  22202. class: normalizeClass(unref(classes)),
  22203. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22204. onClick: handleClick
  22205. }, [
  22206. createElementVNode("span", {
  22207. class: normalizeClass(unref(ns).e("content"))
  22208. }, [
  22209. renderSlot(_ctx.$slots, "default")
  22210. ], 2),
  22211. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22212. key: 0,
  22213. class: normalizeClass(unref(ns).e("close")),
  22214. onClick: withModifiers(handleClose, ["stop"])
  22215. }, {
  22216. default: withCtx(() => [
  22217. createVNode(unref(close_default))
  22218. ]),
  22219. _: 1
  22220. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22221. ], 6)
  22222. ]),
  22223. _: 3
  22224. }, 8, ["name"]));
  22225. };
  22226. }
  22227. });
  22228. var Tag = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);
  22229. const ElTag = withInstall(Tag);
  22230. const emitChangeFn = (value) => typeof isNumber(value);
  22231. const collapseProps = buildProps({
  22232. accordion: Boolean,
  22233. modelValue: {
  22234. type: definePropType([Array, String, Number]),
  22235. default: () => mutable([])
  22236. }
  22237. });
  22238. const collapseEmits = {
  22239. [UPDATE_MODEL_EVENT]: emitChangeFn,
  22240. [CHANGE_EVENT]: emitChangeFn
  22241. };
  22242. const collapseContextKey = Symbol("collapseContextKey");
  22243. const useCollapse = (props, emit) => {
  22244. const activeNames = ref(castArray(props.modelValue));
  22245. const setActiveNames = (_activeNames) => {
  22246. activeNames.value = _activeNames;
  22247. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  22248. emit(UPDATE_MODEL_EVENT, value);
  22249. emit(CHANGE_EVENT, value);
  22250. };
  22251. const handleItemClick = (name) => {
  22252. if (props.accordion) {
  22253. setActiveNames([activeNames.value[0] === name ? "" : name]);
  22254. } else {
  22255. const _activeNames = [...activeNames.value];
  22256. const index2 = _activeNames.indexOf(name);
  22257. if (index2 > -1) {
  22258. _activeNames.splice(index2, 1);
  22259. } else {
  22260. _activeNames.push(name);
  22261. }
  22262. setActiveNames(_activeNames);
  22263. }
  22264. };
  22265. watch(() => props.modelValue, () => activeNames.value = castArray(props.modelValue), { deep: true });
  22266. provide(collapseContextKey, {
  22267. activeNames,
  22268. handleItemClick
  22269. });
  22270. return {
  22271. activeNames,
  22272. setActiveNames
  22273. };
  22274. };
  22275. const useCollapseDOM = () => {
  22276. const ns = useNamespace("collapse");
  22277. const rootKls = computed$1(() => ns.b());
  22278. return {
  22279. rootKls
  22280. };
  22281. };
  22282. const __default__$8 = defineComponent({
  22283. name: "ElCollapse"
  22284. });
  22285. const _sfc_main$i = /* @__PURE__ */ defineComponent({
  22286. ...__default__$8,
  22287. props: collapseProps,
  22288. emits: collapseEmits,
  22289. setup(__props, { expose, emit }) {
  22290. const props = __props;
  22291. const { activeNames, setActiveNames } = useCollapse(props, emit);
  22292. const { rootKls } = useCollapseDOM();
  22293. expose({
  22294. activeNames,
  22295. setActiveNames
  22296. });
  22297. return (_ctx, _cache) => {
  22298. return openBlock(), createElementBlock("div", {
  22299. class: normalizeClass(unref(rootKls)),
  22300. role: "tablist",
  22301. "aria-multiselectable": "true"
  22302. }, [
  22303. renderSlot(_ctx.$slots, "default")
  22304. ], 2);
  22305. };
  22306. }
  22307. });
  22308. var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);
  22309. const __default__$7 = defineComponent({
  22310. name: "ElCollapseTransition"
  22311. });
  22312. const _sfc_main$h = /* @__PURE__ */ defineComponent({
  22313. ...__default__$7,
  22314. setup(__props) {
  22315. const ns = useNamespace("collapse-transition");
  22316. const on3 = {
  22317. beforeEnter(el) {
  22318. if (!el.dataset)
  22319. el.dataset = {};
  22320. el.dataset.oldPaddingTop = el.style.paddingTop;
  22321. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22322. el.style.maxHeight = 0;
  22323. el.style.paddingTop = 0;
  22324. el.style.paddingBottom = 0;
  22325. },
  22326. enter(el) {
  22327. el.dataset.oldOverflow = el.style.overflow;
  22328. if (el.scrollHeight !== 0) {
  22329. el.style.maxHeight = `${el.scrollHeight}px`;
  22330. el.style.paddingTop = el.dataset.oldPaddingTop;
  22331. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22332. } else {
  22333. el.style.maxHeight = 0;
  22334. el.style.paddingTop = el.dataset.oldPaddingTop;
  22335. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22336. }
  22337. el.style.overflow = "hidden";
  22338. },
  22339. afterEnter(el) {
  22340. el.style.maxHeight = "";
  22341. el.style.overflow = el.dataset.oldOverflow;
  22342. },
  22343. beforeLeave(el) {
  22344. if (!el.dataset)
  22345. el.dataset = {};
  22346. el.dataset.oldPaddingTop = el.style.paddingTop;
  22347. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22348. el.dataset.oldOverflow = el.style.overflow;
  22349. el.style.maxHeight = `${el.scrollHeight}px`;
  22350. el.style.overflow = "hidden";
  22351. },
  22352. leave(el) {
  22353. if (el.scrollHeight !== 0) {
  22354. el.style.maxHeight = 0;
  22355. el.style.paddingTop = 0;
  22356. el.style.paddingBottom = 0;
  22357. }
  22358. },
  22359. afterLeave(el) {
  22360. el.style.maxHeight = "";
  22361. el.style.overflow = el.dataset.oldOverflow;
  22362. el.style.paddingTop = el.dataset.oldPaddingTop;
  22363. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22364. }
  22365. };
  22366. return (_ctx, _cache) => {
  22367. return openBlock(), createBlock(Transition, mergeProps({
  22368. name: unref(ns).b()
  22369. }, toHandlers(on3)), {
  22370. default: withCtx(() => [
  22371. renderSlot(_ctx.$slots, "default")
  22372. ]),
  22373. _: 3
  22374. }, 16, ["name"]);
  22375. };
  22376. }
  22377. });
  22378. var CollapseTransition = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse-transition/src/collapse-transition.vue"]]);
  22379. CollapseTransition.install = (app) => {
  22380. app.component(CollapseTransition.name, CollapseTransition);
  22381. };
  22382. const _CollapseTransition = CollapseTransition;
  22383. const collapseItemProps = buildProps({
  22384. title: {
  22385. type: String,
  22386. default: ""
  22387. },
  22388. name: {
  22389. type: definePropType([String, Number]),
  22390. default: () => generateId()
  22391. },
  22392. disabled: Boolean
  22393. });
  22394. const useCollapseItem = (props) => {
  22395. const collapse = inject(collapseContextKey);
  22396. const focusing = ref(false);
  22397. const isClick = ref(false);
  22398. const id = ref(generateId());
  22399. const isActive = computed$1(() => collapse == null ? void 0 : collapse.activeNames.value.includes(props.name));
  22400. const handleFocus = () => {
  22401. setTimeout(() => {
  22402. if (!isClick.value) {
  22403. focusing.value = true;
  22404. } else {
  22405. isClick.value = false;
  22406. }
  22407. }, 50);
  22408. };
  22409. const handleHeaderClick = () => {
  22410. if (props.disabled)
  22411. return;
  22412. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22413. focusing.value = false;
  22414. isClick.value = true;
  22415. };
  22416. const handleEnterClick = () => {
  22417. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22418. };
  22419. return {
  22420. focusing,
  22421. id,
  22422. isActive,
  22423. handleFocus,
  22424. handleHeaderClick,
  22425. handleEnterClick
  22426. };
  22427. };
  22428. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  22429. const ns = useNamespace("collapse");
  22430. const rootKls = computed$1(() => [
  22431. ns.b("item"),
  22432. ns.is("active", unref(isActive)),
  22433. ns.is("disabled", props.disabled)
  22434. ]);
  22435. const headKls = computed$1(() => [
  22436. ns.be("item", "header"),
  22437. ns.is("active", unref(isActive)),
  22438. { focusing: unref(focusing) && !props.disabled }
  22439. ]);
  22440. const arrowKls = computed$1(() => [
  22441. ns.be("item", "arrow"),
  22442. ns.is("active", unref(isActive))
  22443. ]);
  22444. const itemWrapperKls = computed$1(() => ns.be("item", "wrap"));
  22445. const itemContentKls = computed$1(() => ns.be("item", "content"));
  22446. const scopedContentId = computed$1(() => ns.b(`content-${unref(id)}`));
  22447. const scopedHeadId = computed$1(() => ns.b(`head-${unref(id)}`));
  22448. return {
  22449. arrowKls,
  22450. headKls,
  22451. rootKls,
  22452. itemWrapperKls,
  22453. itemContentKls,
  22454. scopedContentId,
  22455. scopedHeadId
  22456. };
  22457. };
  22458. const _hoisted_1$b = ["aria-expanded", "aria-controls", "aria-describedby"];
  22459. const _hoisted_2$8 = ["id", "tabindex"];
  22460. const _hoisted_3$5 = ["id", "aria-hidden", "aria-labelledby"];
  22461. const __default__$6 = defineComponent({
  22462. name: "ElCollapseItem"
  22463. });
  22464. const _sfc_main$g = /* @__PURE__ */ defineComponent({
  22465. ...__default__$6,
  22466. props: collapseItemProps,
  22467. setup(__props, { expose }) {
  22468. const props = __props;
  22469. const {
  22470. focusing,
  22471. id,
  22472. isActive,
  22473. handleFocus,
  22474. handleHeaderClick,
  22475. handleEnterClick
  22476. } = useCollapseItem(props);
  22477. const {
  22478. arrowKls,
  22479. headKls,
  22480. rootKls,
  22481. itemWrapperKls,
  22482. itemContentKls,
  22483. scopedContentId,
  22484. scopedHeadId
  22485. } = useCollapseItemDOM(props, { focusing, isActive, id });
  22486. expose({
  22487. isActive
  22488. });
  22489. return (_ctx, _cache) => {
  22490. return openBlock(), createElementBlock("div", {
  22491. class: normalizeClass(unref(rootKls))
  22492. }, [
  22493. createElementVNode("div", {
  22494. role: "tab",
  22495. "aria-expanded": unref(isActive),
  22496. "aria-controls": unref(scopedContentId),
  22497. "aria-describedby": unref(scopedContentId)
  22498. }, [
  22499. createElementVNode("div", {
  22500. id: unref(scopedHeadId),
  22501. class: normalizeClass(unref(headKls)),
  22502. role: "button",
  22503. tabindex: _ctx.disabled ? -1 : 0,
  22504. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
  22505. onKeypress: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
  22506. onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  22507. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  22508. }, [
  22509. renderSlot(_ctx.$slots, "title", {}, () => [
  22510. createTextVNode(toDisplayString(_ctx.title), 1)
  22511. ]),
  22512. createVNode(unref(ElIcon), {
  22513. class: normalizeClass(unref(arrowKls))
  22514. }, {
  22515. default: withCtx(() => [
  22516. createVNode(unref(arrow_right_default))
  22517. ]),
  22518. _: 1
  22519. }, 8, ["class"])
  22520. ], 42, _hoisted_2$8)
  22521. ], 8, _hoisted_1$b),
  22522. createVNode(unref(_CollapseTransition), null, {
  22523. default: withCtx(() => [
  22524. withDirectives(createElementVNode("div", {
  22525. id: unref(scopedContentId),
  22526. class: normalizeClass(unref(itemWrapperKls)),
  22527. role: "tabpanel",
  22528. "aria-hidden": !unref(isActive),
  22529. "aria-labelledby": unref(scopedHeadId)
  22530. }, [
  22531. createElementVNode("div", {
  22532. class: normalizeClass(unref(itemContentKls))
  22533. }, [
  22534. renderSlot(_ctx.$slots, "default")
  22535. ], 2)
  22536. ], 10, _hoisted_3$5), [
  22537. [vShow, unref(isActive)]
  22538. ])
  22539. ]),
  22540. _: 3
  22541. })
  22542. ], 2);
  22543. };
  22544. }
  22545. });
  22546. var CollapseItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);
  22547. const ElCollapse = withInstall(Collapse, {
  22548. CollapseItem
  22549. });
  22550. const ElCollapseItem = withNoopInstall(CollapseItem);
  22551. const alphaSliderProps = buildProps({
  22552. color: {
  22553. type: definePropType(Object),
  22554. required: true
  22555. },
  22556. vertical: {
  22557. type: Boolean,
  22558. default: false
  22559. }
  22560. });
  22561. let isDragging = false;
  22562. function draggable(element, options2) {
  22563. if (!isClient)
  22564. return;
  22565. const moveFn = function(event2) {
  22566. var _a2;
  22567. (_a2 = options2.drag) == null ? void 0 : _a2.call(options2, event2);
  22568. };
  22569. const upFn = function(event2) {
  22570. var _a2;
  22571. document.removeEventListener("mousemove", moveFn);
  22572. document.removeEventListener("mouseup", upFn);
  22573. document.removeEventListener("touchmove", moveFn);
  22574. document.removeEventListener("touchend", upFn);
  22575. document.onselectstart = null;
  22576. document.ondragstart = null;
  22577. isDragging = false;
  22578. (_a2 = options2.end) == null ? void 0 : _a2.call(options2, event2);
  22579. };
  22580. const downFn = function(event2) {
  22581. var _a2;
  22582. if (isDragging)
  22583. return;
  22584. event2.preventDefault();
  22585. document.onselectstart = () => false;
  22586. document.ondragstart = () => false;
  22587. document.addEventListener("mousemove", moveFn);
  22588. document.addEventListener("mouseup", upFn);
  22589. document.addEventListener("touchmove", moveFn);
  22590. document.addEventListener("touchend", upFn);
  22591. isDragging = true;
  22592. (_a2 = options2.start) == null ? void 0 : _a2.call(options2, event2);
  22593. };
  22594. element.addEventListener("mousedown", downFn);
  22595. element.addEventListener("touchstart", downFn);
  22596. }
  22597. const useAlphaSlider = (props) => {
  22598. const instance = getCurrentInstance();
  22599. const thumb = shallowRef();
  22600. const bar = shallowRef();
  22601. function handleClick(event2) {
  22602. const target = event2.target;
  22603. if (target !== thumb.value) {
  22604. handleDrag(event2);
  22605. }
  22606. }
  22607. function handleDrag(event2) {
  22608. if (!bar.value || !thumb.value)
  22609. return;
  22610. const el = instance.vnode.el;
  22611. const rect = el.getBoundingClientRect();
  22612. const { clientX, clientY } = getClientXY(event2);
  22613. if (!props.vertical) {
  22614. let left = clientX - rect.left;
  22615. left = Math.max(thumb.value.offsetWidth / 2, left);
  22616. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22617. props.color.set("alpha", Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100));
  22618. } else {
  22619. let top = clientY - rect.top;
  22620. top = Math.max(thumb.value.offsetHeight / 2, top);
  22621. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22622. props.color.set("alpha", Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 100));
  22623. }
  22624. }
  22625. return {
  22626. thumb,
  22627. bar,
  22628. handleDrag,
  22629. handleClick
  22630. };
  22631. };
  22632. const useAlphaSliderDOM = (props, {
  22633. bar,
  22634. thumb,
  22635. handleDrag
  22636. }) => {
  22637. const instance = getCurrentInstance();
  22638. const ns = useNamespace("color-alpha-slider");
  22639. const thumbLeft = ref(0);
  22640. const thumbTop = ref(0);
  22641. const background = ref();
  22642. function getThumbLeft() {
  22643. if (!thumb.value)
  22644. return 0;
  22645. if (props.vertical)
  22646. return 0;
  22647. const el = instance.vnode.el;
  22648. const alpha = props.color.get("alpha");
  22649. if (!el)
  22650. return 0;
  22651. return Math.round(alpha * (el.offsetWidth - thumb.value.offsetWidth / 2) / 100);
  22652. }
  22653. function getThumbTop() {
  22654. if (!thumb.value)
  22655. return 0;
  22656. const el = instance.vnode.el;
  22657. if (!props.vertical)
  22658. return 0;
  22659. const alpha = props.color.get("alpha");
  22660. if (!el)
  22661. return 0;
  22662. return Math.round(alpha * (el.offsetHeight - thumb.value.offsetHeight / 2) / 100);
  22663. }
  22664. function getBackground() {
  22665. if (props.color && props.color.value) {
  22666. const { r: r2, g, b } = props.color.toRgb();
  22667. return `linear-gradient(to right, rgba(${r2}, ${g}, ${b}, 0) 0%, rgba(${r2}, ${g}, ${b}, 1) 100%)`;
  22668. }
  22669. return "";
  22670. }
  22671. function update() {
  22672. thumbLeft.value = getThumbLeft();
  22673. thumbTop.value = getThumbTop();
  22674. background.value = getBackground();
  22675. }
  22676. onMounted(() => {
  22677. if (!bar.value || !thumb.value)
  22678. return;
  22679. const dragConfig = {
  22680. drag: (event2) => {
  22681. handleDrag(event2);
  22682. },
  22683. end: (event2) => {
  22684. handleDrag(event2);
  22685. }
  22686. };
  22687. draggable(bar.value, dragConfig);
  22688. draggable(thumb.value, dragConfig);
  22689. update();
  22690. });
  22691. watch(() => props.color.get("alpha"), () => update());
  22692. watch(() => props.color.value, () => update());
  22693. const rootKls = computed$1(() => [ns.b(), ns.is("vertical", props.vertical)]);
  22694. const barKls = computed$1(() => ns.e("bar"));
  22695. const thumbKls = computed$1(() => ns.e("thumb"));
  22696. const barStyle = computed$1(() => ({ background: background.value }));
  22697. const thumbStyle = computed$1(() => ({
  22698. left: addUnit(thumbLeft.value),
  22699. top: addUnit(thumbTop.value)
  22700. }));
  22701. return { rootKls, barKls, barStyle, thumbKls, thumbStyle, update };
  22702. };
  22703. const COMPONENT_NAME$2 = "ElColorAlphaSlider";
  22704. const __default__$5 = defineComponent({
  22705. name: COMPONENT_NAME$2
  22706. });
  22707. const _sfc_main$f = /* @__PURE__ */ defineComponent({
  22708. ...__default__$5,
  22709. props: alphaSliderProps,
  22710. setup(__props, { expose }) {
  22711. const props = __props;
  22712. const { bar, thumb, handleDrag, handleClick } = useAlphaSlider(props);
  22713. const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useAlphaSliderDOM(props, {
  22714. bar,
  22715. thumb,
  22716. handleDrag
  22717. });
  22718. expose({
  22719. update,
  22720. bar,
  22721. thumb
  22722. });
  22723. return (_ctx, _cache) => {
  22724. return openBlock(), createElementBlock("div", {
  22725. class: normalizeClass(unref(rootKls))
  22726. }, [
  22727. createElementVNode("div", {
  22728. ref_key: "bar",
  22729. ref: bar,
  22730. class: normalizeClass(unref(barKls)),
  22731. style: normalizeStyle(unref(barStyle)),
  22732. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  22733. }, null, 6),
  22734. createElementVNode("div", {
  22735. ref_key: "thumb",
  22736. ref: thumb,
  22737. class: normalizeClass(unref(thumbKls)),
  22738. style: normalizeStyle(unref(thumbStyle))
  22739. }, null, 6)
  22740. ], 2);
  22741. };
  22742. }
  22743. });
  22744. var AlphaSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/alpha-slider.vue"]]);
  22745. const _sfc_main$e = defineComponent({
  22746. name: "ElColorHueSlider",
  22747. props: {
  22748. color: {
  22749. type: Object,
  22750. required: true
  22751. },
  22752. vertical: Boolean
  22753. },
  22754. setup(props) {
  22755. const ns = useNamespace("color-hue-slider");
  22756. const instance = getCurrentInstance();
  22757. const thumb = ref();
  22758. const bar = ref();
  22759. const thumbLeft = ref(0);
  22760. const thumbTop = ref(0);
  22761. const hueValue = computed$1(() => {
  22762. return props.color.get("hue");
  22763. });
  22764. watch(() => hueValue.value, () => {
  22765. update();
  22766. });
  22767. function handleClick(event2) {
  22768. const target = event2.target;
  22769. if (target !== thumb.value) {
  22770. handleDrag(event2);
  22771. }
  22772. }
  22773. function handleDrag(event2) {
  22774. if (!bar.value || !thumb.value)
  22775. return;
  22776. const el = instance.vnode.el;
  22777. const rect = el.getBoundingClientRect();
  22778. const { clientX, clientY } = getClientXY(event2);
  22779. let hue;
  22780. if (!props.vertical) {
  22781. let left = clientX - rect.left;
  22782. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22783. left = Math.max(thumb.value.offsetWidth / 2, left);
  22784. hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
  22785. } else {
  22786. let top = clientY - rect.top;
  22787. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22788. top = Math.max(thumb.value.offsetHeight / 2, top);
  22789. hue = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 360);
  22790. }
  22791. props.color.set("hue", hue);
  22792. }
  22793. function getThumbLeft() {
  22794. if (!thumb.value)
  22795. return 0;
  22796. const el = instance.vnode.el;
  22797. if (props.vertical)
  22798. return 0;
  22799. const hue = props.color.get("hue");
  22800. if (!el)
  22801. return 0;
  22802. return Math.round(hue * (el.offsetWidth - thumb.value.offsetWidth / 2) / 360);
  22803. }
  22804. function getThumbTop() {
  22805. if (!thumb.value)
  22806. return 0;
  22807. const el = instance.vnode.el;
  22808. if (!props.vertical)
  22809. return 0;
  22810. const hue = props.color.get("hue");
  22811. if (!el)
  22812. return 0;
  22813. return Math.round(hue * (el.offsetHeight - thumb.value.offsetHeight / 2) / 360);
  22814. }
  22815. function update() {
  22816. thumbLeft.value = getThumbLeft();
  22817. thumbTop.value = getThumbTop();
  22818. }
  22819. onMounted(() => {
  22820. if (!bar.value || !thumb.value)
  22821. return;
  22822. const dragConfig = {
  22823. drag: (event2) => {
  22824. handleDrag(event2);
  22825. },
  22826. end: (event2) => {
  22827. handleDrag(event2);
  22828. }
  22829. };
  22830. draggable(bar.value, dragConfig);
  22831. draggable(thumb.value, dragConfig);
  22832. update();
  22833. });
  22834. return {
  22835. bar,
  22836. thumb,
  22837. thumbLeft,
  22838. thumbTop,
  22839. hueValue,
  22840. handleClick,
  22841. update,
  22842. ns
  22843. };
  22844. }
  22845. });
  22846. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  22847. return openBlock(), createElementBlock("div", {
  22848. class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
  22849. }, [
  22850. createElementVNode("div", {
  22851. ref: "bar",
  22852. class: normalizeClass(_ctx.ns.e("bar")),
  22853. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  22854. }, null, 2),
  22855. createElementVNode("div", {
  22856. ref: "thumb",
  22857. class: normalizeClass(_ctx.ns.e("thumb")),
  22858. style: normalizeStyle({
  22859. left: _ctx.thumbLeft + "px",
  22860. top: _ctx.thumbTop + "px"
  22861. })
  22862. }, null, 6)
  22863. ], 2);
  22864. }
  22865. var HueSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["render", _sfc_render$6], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/hue-slider.vue"]]);
  22866. const colorPickerProps = buildProps({
  22867. modelValue: String,
  22868. id: String,
  22869. showAlpha: Boolean,
  22870. colorFormat: String,
  22871. disabled: Boolean,
  22872. size: useSizeProp,
  22873. popperClass: {
  22874. type: String,
  22875. default: ""
  22876. },
  22877. label: {
  22878. type: String,
  22879. default: void 0
  22880. },
  22881. tabindex: {
  22882. type: [String, Number],
  22883. default: 0
  22884. },
  22885. predefine: {
  22886. type: definePropType(Array)
  22887. },
  22888. validateEvent: {
  22889. type: Boolean,
  22890. default: true
  22891. }
  22892. });
  22893. const colorPickerEmits = {
  22894. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  22895. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  22896. activeChange: (val) => isString(val) || isNil(val)
  22897. };
  22898. const colorPickerContextKey = Symbol("colorPickerContextKey");
  22899. const hsv2hsl = function(hue, sat, val) {
  22900. return [
  22901. hue,
  22902. sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0,
  22903. hue / 2
  22904. ];
  22905. };
  22906. const isOnePointZero = function(n) {
  22907. return typeof n === "string" && n.includes(".") && Number.parseFloat(n) === 1;
  22908. };
  22909. const isPercentage = function(n) {
  22910. return typeof n === "string" && n.includes("%");
  22911. };
  22912. const bound01 = function(value, max2) {
  22913. if (isOnePointZero(value))
  22914. value = "100%";
  22915. const processPercent = isPercentage(value);
  22916. value = Math.min(max2, Math.max(0, Number.parseFloat(`${value}`)));
  22917. if (processPercent) {
  22918. value = Number.parseInt(`${value * max2}`, 10) / 100;
  22919. }
  22920. if (Math.abs(value - max2) < 1e-6) {
  22921. return 1;
  22922. }
  22923. return value % max2 / Number.parseFloat(max2);
  22924. };
  22925. const INT_HEX_MAP = {
  22926. 10: "A",
  22927. 11: "B",
  22928. 12: "C",
  22929. 13: "D",
  22930. 14: "E",
  22931. 15: "F"
  22932. };
  22933. const hexOne = (value) => {
  22934. value = Math.min(Math.round(value), 255);
  22935. const high = Math.floor(value / 16);
  22936. const low = value % 16;
  22937. return `${INT_HEX_MAP[high] || high}${INT_HEX_MAP[low] || low}`;
  22938. };
  22939. const toHex = function({ r: r2, g, b }) {
  22940. if (Number.isNaN(+r2) || Number.isNaN(+g) || Number.isNaN(+b))
  22941. return "";
  22942. return `#${hexOne(r2)}${hexOne(g)}${hexOne(b)}`;
  22943. };
  22944. const HEX_INT_MAP = {
  22945. A: 10,
  22946. B: 11,
  22947. C: 12,
  22948. D: 13,
  22949. E: 14,
  22950. F: 15
  22951. };
  22952. const parseHexChannel = function(hex) {
  22953. if (hex.length === 2) {
  22954. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  22955. }
  22956. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  22957. };
  22958. const hsl2hsv = function(hue, sat, light) {
  22959. sat = sat / 100;
  22960. light = light / 100;
  22961. let smin = sat;
  22962. const lmin = Math.max(light, 0.01);
  22963. light *= 2;
  22964. sat *= light <= 1 ? light : 2 - light;
  22965. smin *= lmin <= 1 ? lmin : 2 - lmin;
  22966. const v = (light + sat) / 2;
  22967. const sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  22968. return {
  22969. h: hue,
  22970. s: sv * 100,
  22971. v: v * 100
  22972. };
  22973. };
  22974. const rgb2hsv = (r2, g, b) => {
  22975. r2 = bound01(r2, 255);
  22976. g = bound01(g, 255);
  22977. b = bound01(b, 255);
  22978. const max2 = Math.max(r2, g, b);
  22979. const min2 = Math.min(r2, g, b);
  22980. let h2;
  22981. const v = max2;
  22982. const d2 = max2 - min2;
  22983. const s = max2 === 0 ? 0 : d2 / max2;
  22984. if (max2 === min2) {
  22985. h2 = 0;
  22986. } else {
  22987. switch (max2) {
  22988. case r2: {
  22989. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  22990. break;
  22991. }
  22992. case g: {
  22993. h2 = (b - r2) / d2 + 2;
  22994. break;
  22995. }
  22996. case b: {
  22997. h2 = (r2 - g) / d2 + 4;
  22998. break;
  22999. }
  23000. }
  23001. h2 /= 6;
  23002. }
  23003. return { h: h2 * 360, s: s * 100, v: v * 100 };
  23004. };
  23005. const hsv2rgb = function(h2, s, v) {
  23006. h2 = bound01(h2, 360) * 6;
  23007. s = bound01(s, 100);
  23008. v = bound01(v, 100);
  23009. const i2 = Math.floor(h2);
  23010. const f = h2 - i2;
  23011. const p = v * (1 - s);
  23012. const q2 = v * (1 - f * s);
  23013. const t2 = v * (1 - (1 - f) * s);
  23014. const mod = i2 % 6;
  23015. const r2 = [v, q2, p, p, t2, v][mod];
  23016. const g = [t2, v, v, q2, p, p][mod];
  23017. const b = [p, p, t2, v, v, q2][mod];
  23018. return {
  23019. r: Math.round(r2 * 255),
  23020. g: Math.round(g * 255),
  23021. b: Math.round(b * 255)
  23022. };
  23023. };
  23024. class Color$1 {
  23025. constructor(options2 = {}) {
  23026. this._hue = 0;
  23027. this._saturation = 100;
  23028. this._value = 100;
  23029. this._alpha = 100;
  23030. this.enableAlpha = false;
  23031. this.format = "hex";
  23032. this.value = "";
  23033. for (const option in options2) {
  23034. if (hasOwn(options2, option)) {
  23035. this[option] = options2[option];
  23036. }
  23037. }
  23038. if (options2.value) {
  23039. this.fromString(options2.value);
  23040. } else {
  23041. this.doOnChange();
  23042. }
  23043. }
  23044. set(prop, value) {
  23045. if (arguments.length === 1 && typeof prop === "object") {
  23046. for (const p in prop) {
  23047. if (hasOwn(prop, p)) {
  23048. this.set(p, prop[p]);
  23049. }
  23050. }
  23051. return;
  23052. }
  23053. this[`_${prop}`] = value;
  23054. this.doOnChange();
  23055. }
  23056. get(prop) {
  23057. if (prop === "alpha") {
  23058. return Math.floor(this[`_${prop}`]);
  23059. }
  23060. return this[`_${prop}`];
  23061. }
  23062. toRgb() {
  23063. return hsv2rgb(this._hue, this._saturation, this._value);
  23064. }
  23065. fromString(value) {
  23066. if (!value) {
  23067. this._hue = 0;
  23068. this._saturation = 100;
  23069. this._value = 100;
  23070. this.doOnChange();
  23071. return;
  23072. }
  23073. const fromHSV = (h2, s, v) => {
  23074. this._hue = Math.max(0, Math.min(360, h2));
  23075. this._saturation = Math.max(0, Math.min(100, s));
  23076. this._value = Math.max(0, Math.min(100, v));
  23077. this.doOnChange();
  23078. };
  23079. if (value.includes("hsl")) {
  23080. const parts = value.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23081. if (parts.length === 4) {
  23082. this._alpha = Number.parseFloat(parts[3]) * 100;
  23083. } else if (parts.length === 3) {
  23084. this._alpha = 100;
  23085. }
  23086. if (parts.length >= 3) {
  23087. const { h: h2, s, v } = hsl2hsv(parts[0], parts[1], parts[2]);
  23088. fromHSV(h2, s, v);
  23089. }
  23090. } else if (value.includes("hsv")) {
  23091. const parts = value.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23092. if (parts.length === 4) {
  23093. this._alpha = Number.parseFloat(parts[3]) * 100;
  23094. } else if (parts.length === 3) {
  23095. this._alpha = 100;
  23096. }
  23097. if (parts.length >= 3) {
  23098. fromHSV(parts[0], parts[1], parts[2]);
  23099. }
  23100. } else if (value.includes("rgb")) {
  23101. const parts = value.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23102. if (parts.length === 4) {
  23103. this._alpha = Number.parseFloat(parts[3]) * 100;
  23104. } else if (parts.length === 3) {
  23105. this._alpha = 100;
  23106. }
  23107. if (parts.length >= 3) {
  23108. const { h: h2, s, v } = rgb2hsv(parts[0], parts[1], parts[2]);
  23109. fromHSV(h2, s, v);
  23110. }
  23111. } else if (value.includes("#")) {
  23112. const hex = value.replace("#", "").trim();
  23113. if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex))
  23114. return;
  23115. let r2, g, b;
  23116. if (hex.length === 3) {
  23117. r2 = parseHexChannel(hex[0] + hex[0]);
  23118. g = parseHexChannel(hex[1] + hex[1]);
  23119. b = parseHexChannel(hex[2] + hex[2]);
  23120. } else if (hex.length === 6 || hex.length === 8) {
  23121. r2 = parseHexChannel(hex.slice(0, 2));
  23122. g = parseHexChannel(hex.slice(2, 4));
  23123. b = parseHexChannel(hex.slice(4, 6));
  23124. }
  23125. if (hex.length === 8) {
  23126. this._alpha = parseHexChannel(hex.slice(6)) / 255 * 100;
  23127. } else if (hex.length === 3 || hex.length === 6) {
  23128. this._alpha = 100;
  23129. }
  23130. const { h: h2, s, v } = rgb2hsv(r2, g, b);
  23131. fromHSV(h2, s, v);
  23132. }
  23133. }
  23134. compare(color2) {
  23135. return Math.abs(color2._hue - this._hue) < 2 && Math.abs(color2._saturation - this._saturation) < 1 && Math.abs(color2._value - this._value) < 1 && Math.abs(color2._alpha - this._alpha) < 1;
  23136. }
  23137. doOnChange() {
  23138. const { _hue, _saturation, _value, _alpha, format } = this;
  23139. if (this.enableAlpha) {
  23140. switch (format) {
  23141. case "hsl": {
  23142. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23143. this.value = `hsla(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%, ${this.get("alpha") / 100})`;
  23144. break;
  23145. }
  23146. case "hsv": {
  23147. this.value = `hsva(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%, ${this.get("alpha") / 100})`;
  23148. break;
  23149. }
  23150. case "hex": {
  23151. this.value = `${toHex(hsv2rgb(_hue, _saturation, _value))}${hexOne(_alpha * 255 / 100)}`;
  23152. break;
  23153. }
  23154. default: {
  23155. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23156. this.value = `rgba(${r2}, ${g}, ${b}, ${this.get("alpha") / 100})`;
  23157. }
  23158. }
  23159. } else {
  23160. switch (format) {
  23161. case "hsl": {
  23162. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23163. this.value = `hsl(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%)`;
  23164. break;
  23165. }
  23166. case "hsv": {
  23167. this.value = `hsv(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%)`;
  23168. break;
  23169. }
  23170. case "rgb": {
  23171. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23172. this.value = `rgb(${r2}, ${g}, ${b})`;
  23173. break;
  23174. }
  23175. default: {
  23176. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  23177. }
  23178. }
  23179. }
  23180. }
  23181. }
  23182. const _sfc_main$d = defineComponent({
  23183. props: {
  23184. colors: {
  23185. type: Array,
  23186. required: true
  23187. },
  23188. color: {
  23189. type: Object,
  23190. required: true
  23191. }
  23192. },
  23193. setup(props) {
  23194. const ns = useNamespace("color-predefine");
  23195. const { currentColor } = inject(colorPickerContextKey);
  23196. const rgbaColors = ref(parseColors(props.colors, props.color));
  23197. watch(() => currentColor.value, (val) => {
  23198. const color2 = new Color$1();
  23199. color2.fromString(val);
  23200. rgbaColors.value.forEach((item) => {
  23201. item.selected = color2.compare(item);
  23202. });
  23203. });
  23204. watchEffect(() => {
  23205. rgbaColors.value = parseColors(props.colors, props.color);
  23206. });
  23207. function handleSelect(index2) {
  23208. props.color.fromString(props.colors[index2]);
  23209. }
  23210. function parseColors(colors, color2) {
  23211. return colors.map((value) => {
  23212. const c = new Color$1();
  23213. c.enableAlpha = true;
  23214. c.format = "rgba";
  23215. c.fromString(value);
  23216. c.selected = c.value === color2.value;
  23217. return c;
  23218. });
  23219. }
  23220. return {
  23221. rgbaColors,
  23222. handleSelect,
  23223. ns
  23224. };
  23225. }
  23226. });
  23227. const _hoisted_1$a = ["onClick"];
  23228. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  23229. return openBlock(), createElementBlock("div", {
  23230. class: normalizeClass(_ctx.ns.b())
  23231. }, [
  23232. createElementVNode("div", {
  23233. class: normalizeClass(_ctx.ns.e("colors"))
  23234. }, [
  23235. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rgbaColors, (item, index2) => {
  23236. return openBlock(), createElementBlock("div", {
  23237. key: _ctx.colors[index2],
  23238. class: normalizeClass([
  23239. _ctx.ns.e("color-selector"),
  23240. _ctx.ns.is("alpha", item._alpha < 100),
  23241. { selected: item.selected }
  23242. ]),
  23243. onClick: ($event) => _ctx.handleSelect(index2)
  23244. }, [
  23245. createElementVNode("div", {
  23246. style: normalizeStyle({ backgroundColor: item.value })
  23247. }, null, 4)
  23248. ], 10, _hoisted_1$a);
  23249. }), 128))
  23250. ], 2)
  23251. ], 2);
  23252. }
  23253. var Predefine = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$5], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/predefine.vue"]]);
  23254. const _sfc_main$c = defineComponent({
  23255. name: "ElSlPanel",
  23256. props: {
  23257. color: {
  23258. type: Object,
  23259. required: true
  23260. }
  23261. },
  23262. setup(props) {
  23263. const ns = useNamespace("color-svpanel");
  23264. const instance = getCurrentInstance();
  23265. const cursorTop = ref(0);
  23266. const cursorLeft = ref(0);
  23267. const background = ref("hsl(0, 100%, 50%)");
  23268. const colorValue = computed$1(() => {
  23269. const hue = props.color.get("hue");
  23270. const value = props.color.get("value");
  23271. return { hue, value };
  23272. });
  23273. function update() {
  23274. const saturation = props.color.get("saturation");
  23275. const value = props.color.get("value");
  23276. const el = instance.vnode.el;
  23277. const { clientWidth: width2, clientHeight: height2 } = el;
  23278. cursorLeft.value = saturation * width2 / 100;
  23279. cursorTop.value = (100 - value) * height2 / 100;
  23280. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  23281. }
  23282. function handleDrag(event2) {
  23283. const el = instance.vnode.el;
  23284. const rect = el.getBoundingClientRect();
  23285. const { clientX, clientY } = getClientXY(event2);
  23286. let left = clientX - rect.left;
  23287. let top = clientY - rect.top;
  23288. left = Math.max(0, left);
  23289. left = Math.min(left, rect.width);
  23290. top = Math.max(0, top);
  23291. top = Math.min(top, rect.height);
  23292. cursorLeft.value = left;
  23293. cursorTop.value = top;
  23294. props.color.set({
  23295. saturation: left / rect.width * 100,
  23296. value: 100 - top / rect.height * 100
  23297. });
  23298. }
  23299. watch(() => colorValue.value, () => {
  23300. update();
  23301. });
  23302. onMounted(() => {
  23303. draggable(instance.vnode.el, {
  23304. drag: (event2) => {
  23305. handleDrag(event2);
  23306. },
  23307. end: (event2) => {
  23308. handleDrag(event2);
  23309. }
  23310. });
  23311. update();
  23312. });
  23313. return {
  23314. cursorTop,
  23315. cursorLeft,
  23316. background,
  23317. colorValue,
  23318. handleDrag,
  23319. update,
  23320. ns
  23321. };
  23322. }
  23323. });
  23324. const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("div", null, null, -1);
  23325. const _hoisted_2$7 = [
  23326. _hoisted_1$9
  23327. ];
  23328. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  23329. return openBlock(), createElementBlock("div", {
  23330. class: normalizeClass(_ctx.ns.b()),
  23331. style: normalizeStyle({
  23332. backgroundColor: _ctx.background
  23333. })
  23334. }, [
  23335. createElementVNode("div", {
  23336. class: normalizeClass(_ctx.ns.e("white"))
  23337. }, null, 2),
  23338. createElementVNode("div", {
  23339. class: normalizeClass(_ctx.ns.e("black"))
  23340. }, null, 2),
  23341. createElementVNode("div", {
  23342. class: normalizeClass(_ctx.ns.e("cursor")),
  23343. style: normalizeStyle({
  23344. top: _ctx.cursorTop + "px",
  23345. left: _ctx.cursorLeft + "px"
  23346. })
  23347. }, _hoisted_2$7, 6)
  23348. ], 6);
  23349. }
  23350. var SvPanel = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$4], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/sv-panel.vue"]]);
  23351. const _hoisted_1$8 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
  23352. const __default__$4 = defineComponent({
  23353. name: "ElColorPicker"
  23354. });
  23355. const _sfc_main$b = /* @__PURE__ */ defineComponent({
  23356. ...__default__$4,
  23357. props: colorPickerProps,
  23358. emits: colorPickerEmits,
  23359. setup(__props, { expose, emit }) {
  23360. const props = __props;
  23361. const { t: t2 } = useLocale();
  23362. const ns = useNamespace("color");
  23363. const { formItem } = useFormItem();
  23364. const colorSize = useFormSize();
  23365. const colorDisabled = useFormDisabled();
  23366. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
  23367. formItemContext: formItem
  23368. });
  23369. const hue = ref();
  23370. const sv = ref();
  23371. const alpha = ref();
  23372. const popper = ref();
  23373. let shouldActiveChange = true;
  23374. const color2 = reactive(new Color$1({
  23375. enableAlpha: props.showAlpha,
  23376. format: props.colorFormat || "",
  23377. value: props.modelValue
  23378. }));
  23379. const showPicker = ref(false);
  23380. const showPanelColor = ref(false);
  23381. const customInput = ref("");
  23382. const displayedColor = computed$1(() => {
  23383. if (!props.modelValue && !showPanelColor.value) {
  23384. return "transparent";
  23385. }
  23386. return displayedRgb(color2, props.showAlpha);
  23387. });
  23388. const currentColor = computed$1(() => {
  23389. return !props.modelValue && !showPanelColor.value ? "" : color2.value;
  23390. });
  23391. const buttonAriaLabel = computed$1(() => {
  23392. return !isLabeledByFormItem.value ? props.label || t2("el.colorpicker.defaultLabel") : void 0;
  23393. });
  23394. const buttonAriaLabelledby = computed$1(() => {
  23395. return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
  23396. });
  23397. const btnKls = computed$1(() => {
  23398. return [
  23399. ns.b("picker"),
  23400. ns.is("disabled", colorDisabled.value),
  23401. ns.bm("picker", colorSize.value)
  23402. ];
  23403. });
  23404. function displayedRgb(color22, showAlpha) {
  23405. if (!(color22 instanceof Color$1)) {
  23406. throw new TypeError("color should be instance of _color Class");
  23407. }
  23408. const { r: r2, g, b } = color22.toRgb();
  23409. return showAlpha ? `rgba(${r2}, ${g}, ${b}, ${color22.get("alpha") / 100})` : `rgb(${r2}, ${g}, ${b})`;
  23410. }
  23411. function setShowPicker(value) {
  23412. showPicker.value = value;
  23413. }
  23414. const debounceSetShowPicker = debounce$2(setShowPicker, 100);
  23415. function show() {
  23416. if (colorDisabled.value)
  23417. return;
  23418. setShowPicker(true);
  23419. }
  23420. function hide() {
  23421. debounceSetShowPicker(false);
  23422. resetColor();
  23423. }
  23424. function resetColor() {
  23425. nextTick(() => {
  23426. if (props.modelValue) {
  23427. color2.fromString(props.modelValue);
  23428. } else {
  23429. color2.value = "";
  23430. nextTick(() => {
  23431. showPanelColor.value = false;
  23432. });
  23433. }
  23434. });
  23435. }
  23436. function handleTrigger() {
  23437. if (colorDisabled.value)
  23438. return;
  23439. debounceSetShowPicker(!showPicker.value);
  23440. }
  23441. function handleConfirm() {
  23442. color2.fromString(customInput.value);
  23443. }
  23444. function confirmValue() {
  23445. const value = color2.value;
  23446. emit(UPDATE_MODEL_EVENT, value);
  23447. emit("change", value);
  23448. if (props.validateEvent) {
  23449. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23450. }
  23451. debounceSetShowPicker(false);
  23452. nextTick(() => {
  23453. const newColor = new Color$1({
  23454. enableAlpha: props.showAlpha,
  23455. format: props.colorFormat || "",
  23456. value: props.modelValue
  23457. });
  23458. if (!color2.compare(newColor)) {
  23459. resetColor();
  23460. }
  23461. });
  23462. }
  23463. function clear() {
  23464. debounceSetShowPicker(false);
  23465. emit(UPDATE_MODEL_EVENT, null);
  23466. emit("change", null);
  23467. if (props.modelValue !== null && props.validateEvent) {
  23468. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23469. }
  23470. resetColor();
  23471. }
  23472. onMounted(() => {
  23473. if (props.modelValue) {
  23474. customInput.value = currentColor.value;
  23475. }
  23476. });
  23477. watch(() => props.modelValue, (newVal) => {
  23478. if (!newVal) {
  23479. showPanelColor.value = false;
  23480. } else if (newVal && newVal !== color2.value) {
  23481. shouldActiveChange = false;
  23482. color2.fromString(newVal);
  23483. }
  23484. });
  23485. watch(() => currentColor.value, (val) => {
  23486. customInput.value = val;
  23487. shouldActiveChange && emit("activeChange", val);
  23488. shouldActiveChange = true;
  23489. });
  23490. watch(() => color2.value, () => {
  23491. if (!props.modelValue && !showPanelColor.value) {
  23492. showPanelColor.value = true;
  23493. }
  23494. });
  23495. watch(() => showPicker.value, () => {
  23496. nextTick(() => {
  23497. var _a2, _b, _c;
  23498. (_a2 = hue.value) == null ? void 0 : _a2.update();
  23499. (_b = sv.value) == null ? void 0 : _b.update();
  23500. (_c = alpha.value) == null ? void 0 : _c.update();
  23501. });
  23502. });
  23503. provide(colorPickerContextKey, {
  23504. currentColor
  23505. });
  23506. expose({
  23507. color: color2,
  23508. show,
  23509. hide
  23510. });
  23511. return (_ctx, _cache) => {
  23512. return openBlock(), createBlock(unref(ElTooltip), {
  23513. ref_key: "popper",
  23514. ref: popper,
  23515. visible: showPicker.value,
  23516. "show-arrow": false,
  23517. "fallback-placements": ["bottom", "top", "right", "left"],
  23518. offset: 0,
  23519. "gpu-acceleration": false,
  23520. "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
  23521. "stop-popper-mouse-event": false,
  23522. effect: "light",
  23523. trigger: "click",
  23524. transition: `${unref(ns).namespace.value}-zoom-in-top`,
  23525. persistent: ""
  23526. }, {
  23527. content: withCtx(() => [
  23528. withDirectives((openBlock(), createElementBlock("div", null, [
  23529. createElementVNode("div", {
  23530. class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
  23531. }, [
  23532. createVNode(HueSlider, {
  23533. ref_key: "hue",
  23534. ref: hue,
  23535. class: "hue-slider",
  23536. color: unref(color2),
  23537. vertical: ""
  23538. }, null, 8, ["color"]),
  23539. createVNode(SvPanel, {
  23540. ref: "svPanel",
  23541. color: unref(color2)
  23542. }, null, 8, ["color"])
  23543. ], 2),
  23544. _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
  23545. key: 0,
  23546. ref_key: "alpha",
  23547. ref: alpha,
  23548. color: unref(color2)
  23549. }, null, 8, ["color"])) : createCommentVNode("v-if", true),
  23550. _ctx.predefine ? (openBlock(), createBlock(Predefine, {
  23551. key: 1,
  23552. ref: "predefine",
  23553. color: unref(color2),
  23554. colors: _ctx.predefine
  23555. }, null, 8, ["color", "colors"])) : createCommentVNode("v-if", true),
  23556. createElementVNode("div", {
  23557. class: normalizeClass(unref(ns).be("dropdown", "btns"))
  23558. }, [
  23559. createElementVNode("span", {
  23560. class: normalizeClass(unref(ns).be("dropdown", "value"))
  23561. }, [
  23562. createVNode(unref(ElInput), {
  23563. modelValue: customInput.value,
  23564. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  23565. "validate-event": false,
  23566. size: "small",
  23567. onKeyup: withKeys(handleConfirm, ["enter"]),
  23568. onBlur: handleConfirm
  23569. }, null, 8, ["modelValue", "onKeyup"])
  23570. ], 2),
  23571. createVNode(unref(ElButton), {
  23572. class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
  23573. text: "",
  23574. size: "small",
  23575. onClick: clear
  23576. }, {
  23577. default: withCtx(() => [
  23578. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.clear")), 1)
  23579. ]),
  23580. _: 1
  23581. }, 8, ["class"]),
  23582. createVNode(unref(ElButton), {
  23583. plain: "",
  23584. size: "small",
  23585. class: normalizeClass(unref(ns).be("dropdown", "btn")),
  23586. onClick: confirmValue
  23587. }, {
  23588. default: withCtx(() => [
  23589. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.confirm")), 1)
  23590. ]),
  23591. _: 1
  23592. }, 8, ["class"])
  23593. ], 2)
  23594. ])), [
  23595. [unref(ClickOutside), hide]
  23596. ])
  23597. ]),
  23598. default: withCtx(() => [
  23599. createElementVNode("div", {
  23600. id: unref(buttonId),
  23601. class: normalizeClass(unref(btnKls)),
  23602. role: "button",
  23603. "aria-label": unref(buttonAriaLabel),
  23604. "aria-labelledby": unref(buttonAriaLabelledby),
  23605. "aria-description": unref(t2)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
  23606. tabindex: _ctx.tabindex,
  23607. onKeydown: withKeys(handleTrigger, ["enter"])
  23608. }, [
  23609. unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
  23610. key: 0,
  23611. class: normalizeClass(unref(ns).be("picker", "mask"))
  23612. }, null, 2)) : createCommentVNode("v-if", true),
  23613. createElementVNode("div", {
  23614. class: normalizeClass(unref(ns).be("picker", "trigger")),
  23615. onClick: handleTrigger
  23616. }, [
  23617. createElementVNode("span", {
  23618. class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
  23619. }, [
  23620. createElementVNode("span", {
  23621. class: normalizeClass(unref(ns).be("picker", "color-inner")),
  23622. style: normalizeStyle({
  23623. backgroundColor: unref(displayedColor)
  23624. })
  23625. }, [
  23626. withDirectives(createVNode(unref(ElIcon), {
  23627. class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
  23628. }, {
  23629. default: withCtx(() => [
  23630. createVNode(unref(arrow_down_default))
  23631. ]),
  23632. _: 1
  23633. }, 8, ["class"]), [
  23634. [vShow, _ctx.modelValue || showPanelColor.value]
  23635. ]),
  23636. !_ctx.modelValue && !showPanelColor.value ? (openBlock(), createBlock(unref(ElIcon), {
  23637. key: 0,
  23638. class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
  23639. }, {
  23640. default: withCtx(() => [
  23641. createVNode(unref(close_default))
  23642. ]),
  23643. _: 1
  23644. }, 8, ["class"])) : createCommentVNode("v-if", true)
  23645. ], 6)
  23646. ], 2)
  23647. ], 2)
  23648. ], 42, _hoisted_1$8)
  23649. ]),
  23650. _: 1
  23651. }, 8, ["visible", "popper-class", "transition"]);
  23652. };
  23653. }
  23654. });
  23655. var ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/color-picker.vue"]]);
  23656. const ElColorPicker = withInstall(ColorPicker);
  23657. const overlayProps = buildProps({
  23658. mask: {
  23659. type: Boolean,
  23660. default: true
  23661. },
  23662. customMaskEvent: {
  23663. type: Boolean,
  23664. default: false
  23665. },
  23666. overlayClass: {
  23667. type: definePropType([
  23668. String,
  23669. Array,
  23670. Object
  23671. ])
  23672. },
  23673. zIndex: {
  23674. type: definePropType([String, Number])
  23675. }
  23676. });
  23677. const overlayEmits = {
  23678. click: (evt) => evt instanceof MouseEvent
  23679. };
  23680. const BLOCK = "overlay";
  23681. var Overlay = defineComponent({
  23682. name: "ElOverlay",
  23683. props: overlayProps,
  23684. emits: overlayEmits,
  23685. setup(props, { slots, emit }) {
  23686. const ns = useNamespace(BLOCK);
  23687. const onMaskClick = (e) => {
  23688. emit("click", e);
  23689. };
  23690. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  23691. return () => {
  23692. return props.mask ? createVNode("div", {
  23693. class: [ns.b(), props.overlayClass],
  23694. style: {
  23695. zIndex: props.zIndex
  23696. },
  23697. onClick,
  23698. onMousedown,
  23699. onMouseup
  23700. }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : h("div", {
  23701. class: props.overlayClass,
  23702. style: {
  23703. zIndex: props.zIndex,
  23704. position: "fixed",
  23705. top: "0px",
  23706. right: "0px",
  23707. bottom: "0px",
  23708. left: "0px"
  23709. }
  23710. }, [renderSlot(slots, "default")]);
  23711. };
  23712. }
  23713. });
  23714. const ElOverlay = Overlay;
  23715. const dialogInjectionKey = Symbol("dialogInjectionKey");
  23716. const dialogContentProps = buildProps({
  23717. center: {
  23718. type: Boolean,
  23719. default: false
  23720. },
  23721. alignCenter: {
  23722. type: Boolean,
  23723. default: false
  23724. },
  23725. closeIcon: {
  23726. type: iconPropType
  23727. },
  23728. customClass: {
  23729. type: String,
  23730. default: ""
  23731. },
  23732. draggable: {
  23733. type: Boolean,
  23734. default: false
  23735. },
  23736. fullscreen: {
  23737. type: Boolean,
  23738. default: false
  23739. },
  23740. showClose: {
  23741. type: Boolean,
  23742. default: true
  23743. },
  23744. title: {
  23745. type: String,
  23746. default: ""
  23747. }
  23748. });
  23749. const dialogContentEmits = {
  23750. close: () => true
  23751. };
  23752. const _hoisted_1$7 = ["aria-label"];
  23753. const _hoisted_2$6 = ["id"];
  23754. const __default__$3 = defineComponent({ name: "ElDialogContent" });
  23755. const _sfc_main$a = /* @__PURE__ */ defineComponent({
  23756. ...__default__$3,
  23757. props: dialogContentProps,
  23758. emits: dialogContentEmits,
  23759. setup(__props) {
  23760. const props = __props;
  23761. const { t: t2 } = useLocale();
  23762. const { Close } = CloseComponents;
  23763. const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
  23764. const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
  23765. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  23766. const draggable2 = computed$1(() => props.draggable);
  23767. useDraggable(dialogRef, headerRef, draggable2);
  23768. return (_ctx, _cache) => {
  23769. return openBlock(), createElementBlock("div", {
  23770. ref: unref(composedDialogRef),
  23771. class: normalizeClass([
  23772. unref(ns).b(),
  23773. unref(ns).is("fullscreen", _ctx.fullscreen),
  23774. unref(ns).is("draggable", unref(draggable2)),
  23775. unref(ns).is("align-center", _ctx.alignCenter),
  23776. { [unref(ns).m("center")]: _ctx.center },
  23777. _ctx.customClass
  23778. ]),
  23779. style: normalizeStyle(unref(style)),
  23780. tabindex: "-1"
  23781. }, [
  23782. createElementVNode("header", {
  23783. ref_key: "headerRef",
  23784. ref: headerRef,
  23785. class: normalizeClass(unref(ns).e("header"))
  23786. }, [
  23787. renderSlot(_ctx.$slots, "header", {}, () => [
  23788. createElementVNode("span", {
  23789. role: "heading",
  23790. class: normalizeClass(unref(ns).e("title"))
  23791. }, toDisplayString(_ctx.title), 3)
  23792. ]),
  23793. _ctx.showClose ? (openBlock(), createElementBlock("button", {
  23794. key: 0,
  23795. "aria-label": unref(t2)("el.dialog.close"),
  23796. class: normalizeClass(unref(ns).e("headerbtn")),
  23797. type: "button",
  23798. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  23799. }, [
  23800. createVNode(unref(ElIcon), {
  23801. class: normalizeClass(unref(ns).e("close"))
  23802. }, {
  23803. default: withCtx(() => [
  23804. (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
  23805. ]),
  23806. _: 1
  23807. }, 8, ["class"])
  23808. ], 10, _hoisted_1$7)) : createCommentVNode("v-if", true)
  23809. ], 2),
  23810. createElementVNode("div", {
  23811. id: unref(bodyId),
  23812. class: normalizeClass(unref(ns).e("body"))
  23813. }, [
  23814. renderSlot(_ctx.$slots, "default")
  23815. ], 10, _hoisted_2$6),
  23816. _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
  23817. key: 0,
  23818. class: normalizeClass(unref(ns).e("footer"))
  23819. }, [
  23820. renderSlot(_ctx.$slots, "footer")
  23821. ], 2)) : createCommentVNode("v-if", true)
  23822. ], 6);
  23823. };
  23824. }
  23825. });
  23826. var ElDialogContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);
  23827. const dialogProps = buildProps({
  23828. ...dialogContentProps,
  23829. appendToBody: {
  23830. type: Boolean,
  23831. default: false
  23832. },
  23833. beforeClose: {
  23834. type: definePropType(Function)
  23835. },
  23836. destroyOnClose: {
  23837. type: Boolean,
  23838. default: false
  23839. },
  23840. closeOnClickModal: {
  23841. type: Boolean,
  23842. default: true
  23843. },
  23844. closeOnPressEscape: {
  23845. type: Boolean,
  23846. default: true
  23847. },
  23848. lockScroll: {
  23849. type: Boolean,
  23850. default: true
  23851. },
  23852. modal: {
  23853. type: Boolean,
  23854. default: true
  23855. },
  23856. openDelay: {
  23857. type: Number,
  23858. default: 0
  23859. },
  23860. closeDelay: {
  23861. type: Number,
  23862. default: 0
  23863. },
  23864. top: {
  23865. type: String
  23866. },
  23867. modelValue: {
  23868. type: Boolean,
  23869. default: false
  23870. },
  23871. modalClass: String,
  23872. width: {
  23873. type: [String, Number]
  23874. },
  23875. zIndex: {
  23876. type: Number
  23877. },
  23878. trapFocus: {
  23879. type: Boolean,
  23880. default: false
  23881. }
  23882. });
  23883. const dialogEmits = {
  23884. open: () => true,
  23885. opened: () => true,
  23886. close: () => true,
  23887. closed: () => true,
  23888. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  23889. openAutoFocus: () => true,
  23890. closeAutoFocus: () => true
  23891. };
  23892. const useDialog = (props, targetRef) => {
  23893. const instance = getCurrentInstance();
  23894. const emit = instance.emit;
  23895. const { nextZIndex } = useZIndex();
  23896. let lastPosition = "";
  23897. const titleId = useId();
  23898. const bodyId = useId();
  23899. const visible = ref(false);
  23900. const closed = ref(false);
  23901. const rendered = ref(false);
  23902. const zIndex2 = ref(props.zIndex || nextZIndex());
  23903. let openTimer = void 0;
  23904. let closeTimer = void 0;
  23905. const namespace = useGlobalConfig("namespace", defaultNamespace);
  23906. const style = computed$1(() => {
  23907. const style2 = {};
  23908. const varPrefix = `--${namespace.value}-dialog`;
  23909. if (!props.fullscreen) {
  23910. if (props.top) {
  23911. style2[`${varPrefix}-margin-top`] = props.top;
  23912. }
  23913. if (props.width) {
  23914. style2[`${varPrefix}-width`] = addUnit(props.width);
  23915. }
  23916. }
  23917. return style2;
  23918. });
  23919. const overlayDialogStyle = computed$1(() => {
  23920. if (props.alignCenter) {
  23921. return { display: "flex" };
  23922. }
  23923. return {};
  23924. });
  23925. function afterEnter() {
  23926. emit("opened");
  23927. }
  23928. function afterLeave() {
  23929. emit("closed");
  23930. emit(UPDATE_MODEL_EVENT, false);
  23931. if (props.destroyOnClose) {
  23932. rendered.value = false;
  23933. }
  23934. }
  23935. function beforeLeave() {
  23936. emit("close");
  23937. }
  23938. function open() {
  23939. closeTimer == null ? void 0 : closeTimer();
  23940. openTimer == null ? void 0 : openTimer();
  23941. if (props.openDelay && props.openDelay > 0) {
  23942. ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
  23943. } else {
  23944. doOpen();
  23945. }
  23946. }
  23947. function close() {
  23948. openTimer == null ? void 0 : openTimer();
  23949. closeTimer == null ? void 0 : closeTimer();
  23950. if (props.closeDelay && props.closeDelay > 0) {
  23951. ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
  23952. } else {
  23953. doClose();
  23954. }
  23955. }
  23956. function handleClose() {
  23957. function hide(shouldCancel) {
  23958. if (shouldCancel)
  23959. return;
  23960. closed.value = true;
  23961. visible.value = false;
  23962. }
  23963. if (props.beforeClose) {
  23964. props.beforeClose(hide);
  23965. } else {
  23966. close();
  23967. }
  23968. }
  23969. function onModalClick() {
  23970. if (props.closeOnClickModal) {
  23971. handleClose();
  23972. }
  23973. }
  23974. function doOpen() {
  23975. if (!isClient)
  23976. return;
  23977. visible.value = true;
  23978. }
  23979. function doClose() {
  23980. visible.value = false;
  23981. }
  23982. function onOpenAutoFocus() {
  23983. emit("openAutoFocus");
  23984. }
  23985. function onCloseAutoFocus() {
  23986. emit("closeAutoFocus");
  23987. }
  23988. function onFocusoutPrevented(event2) {
  23989. var _a2;
  23990. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
  23991. event2.preventDefault();
  23992. }
  23993. }
  23994. if (props.lockScroll) {
  23995. useLockscreen(visible);
  23996. }
  23997. function onCloseRequested() {
  23998. if (props.closeOnPressEscape) {
  23999. handleClose();
  24000. }
  24001. }
  24002. watch(() => props.modelValue, (val) => {
  24003. if (val) {
  24004. closed.value = false;
  24005. open();
  24006. rendered.value = true;
  24007. zIndex2.value = props.zIndex ? zIndex2.value++ : nextZIndex();
  24008. nextTick(() => {
  24009. emit("open");
  24010. if (targetRef.value) {
  24011. targetRef.value.scrollTop = 0;
  24012. }
  24013. });
  24014. } else {
  24015. if (visible.value) {
  24016. close();
  24017. }
  24018. }
  24019. });
  24020. watch(() => props.fullscreen, (val) => {
  24021. if (!targetRef.value)
  24022. return;
  24023. if (val) {
  24024. lastPosition = targetRef.value.style.transform;
  24025. targetRef.value.style.transform = "";
  24026. } else {
  24027. targetRef.value.style.transform = lastPosition;
  24028. }
  24029. });
  24030. onMounted(() => {
  24031. if (props.modelValue) {
  24032. visible.value = true;
  24033. rendered.value = true;
  24034. open();
  24035. }
  24036. });
  24037. return {
  24038. afterEnter,
  24039. afterLeave,
  24040. beforeLeave,
  24041. handleClose,
  24042. onModalClick,
  24043. close,
  24044. doClose,
  24045. onOpenAutoFocus,
  24046. onCloseAutoFocus,
  24047. onCloseRequested,
  24048. onFocusoutPrevented,
  24049. titleId,
  24050. bodyId,
  24051. closed,
  24052. style,
  24053. overlayDialogStyle,
  24054. rendered,
  24055. visible,
  24056. zIndex: zIndex2
  24057. };
  24058. };
  24059. const _hoisted_1$6 = ["aria-label", "aria-labelledby", "aria-describedby"];
  24060. const __default__$2 = defineComponent({
  24061. name: "ElDialog",
  24062. inheritAttrs: false
  24063. });
  24064. const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  24065. ...__default__$2,
  24066. props: dialogProps,
  24067. emits: dialogEmits,
  24068. setup(__props, { expose }) {
  24069. const props = __props;
  24070. const slots = useSlots();
  24071. useDeprecated({
  24072. scope: "el-dialog",
  24073. from: "the title slot",
  24074. replacement: "the header slot",
  24075. version: "3.0.0",
  24076. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  24077. }, computed$1(() => !!slots.title));
  24078. useDeprecated({
  24079. scope: "el-dialog",
  24080. from: "custom-class",
  24081. replacement: "class",
  24082. version: "2.3.0",
  24083. ref: "https://element-plus.org/en-US/component/dialog.html#attributes",
  24084. type: "Attribute"
  24085. }, computed$1(() => !!props.customClass));
  24086. const ns = useNamespace("dialog");
  24087. const dialogRef = ref();
  24088. const headerRef = ref();
  24089. const dialogContentRef = ref();
  24090. const {
  24091. visible,
  24092. titleId,
  24093. bodyId,
  24094. style,
  24095. overlayDialogStyle,
  24096. rendered,
  24097. zIndex: zIndex2,
  24098. afterEnter,
  24099. afterLeave,
  24100. beforeLeave,
  24101. handleClose,
  24102. onModalClick,
  24103. onOpenAutoFocus,
  24104. onCloseAutoFocus,
  24105. onCloseRequested,
  24106. onFocusoutPrevented
  24107. } = useDialog(props, dialogRef);
  24108. provide(dialogInjectionKey, {
  24109. dialogRef,
  24110. headerRef,
  24111. bodyId,
  24112. ns,
  24113. rendered,
  24114. style
  24115. });
  24116. const overlayEvent = useSameTarget(onModalClick);
  24117. const draggable2 = computed$1(() => props.draggable && !props.fullscreen);
  24118. expose({
  24119. visible,
  24120. dialogContentRef
  24121. });
  24122. return (_ctx, _cache) => {
  24123. return openBlock(), createBlock(Teleport, {
  24124. to: "body",
  24125. disabled: !_ctx.appendToBody
  24126. }, [
  24127. createVNode(Transition, {
  24128. name: "dialog-fade",
  24129. onAfterEnter: unref(afterEnter),
  24130. onAfterLeave: unref(afterLeave),
  24131. onBeforeLeave: unref(beforeLeave),
  24132. persisted: ""
  24133. }, {
  24134. default: withCtx(() => [
  24135. withDirectives(createVNode(unref(ElOverlay), {
  24136. "custom-mask-event": "",
  24137. mask: _ctx.modal,
  24138. "overlay-class": _ctx.modalClass,
  24139. "z-index": unref(zIndex2)
  24140. }, {
  24141. default: withCtx(() => [
  24142. createElementVNode("div", {
  24143. role: "dialog",
  24144. "aria-modal": "true",
  24145. "aria-label": _ctx.title || void 0,
  24146. "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
  24147. "aria-describedby": unref(bodyId),
  24148. class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
  24149. style: normalizeStyle(unref(overlayDialogStyle)),
  24150. onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
  24151. onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
  24152. onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
  24153. }, [
  24154. createVNode(unref(ElFocusTrap), {
  24155. loop: "",
  24156. trapped: unref(visible),
  24157. "focus-start-el": "container",
  24158. onFocusAfterTrapped: unref(onOpenAutoFocus),
  24159. onFocusAfterReleased: unref(onCloseAutoFocus),
  24160. onFocusoutPrevented: unref(onFocusoutPrevented),
  24161. onReleaseRequested: unref(onCloseRequested)
  24162. }, {
  24163. default: withCtx(() => [
  24164. unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
  24165. key: 0,
  24166. ref_key: "dialogContentRef",
  24167. ref: dialogContentRef
  24168. }, _ctx.$attrs, {
  24169. "custom-class": _ctx.customClass,
  24170. center: _ctx.center,
  24171. "align-center": _ctx.alignCenter,
  24172. "close-icon": _ctx.closeIcon,
  24173. draggable: unref(draggable2),
  24174. fullscreen: _ctx.fullscreen,
  24175. "show-close": _ctx.showClose,
  24176. title: _ctx.title,
  24177. onClose: unref(handleClose)
  24178. }), createSlots({
  24179. header: withCtx(() => [
  24180. !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
  24181. key: 0,
  24182. close: unref(handleClose),
  24183. titleId: unref(titleId),
  24184. titleClass: unref(ns).e("title")
  24185. }) : renderSlot(_ctx.$slots, "title", { key: 1 })
  24186. ]),
  24187. default: withCtx(() => [
  24188. renderSlot(_ctx.$slots, "default")
  24189. ]),
  24190. _: 2
  24191. }, [
  24192. _ctx.$slots.footer ? {
  24193. name: "footer",
  24194. fn: withCtx(() => [
  24195. renderSlot(_ctx.$slots, "footer")
  24196. ])
  24197. } : void 0
  24198. ]), 1040, ["custom-class", "center", "align-center", "close-icon", "draggable", "fullscreen", "show-close", "title", "onClose"])) : createCommentVNode("v-if", true)
  24199. ]),
  24200. _: 3
  24201. }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
  24202. ], 46, _hoisted_1$6)
  24203. ]),
  24204. _: 3
  24205. }, 8, ["mask", "overlay-class", "z-index"]), [
  24206. [vShow, unref(visible)]
  24207. ])
  24208. ]),
  24209. _: 3
  24210. }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
  24211. ], 8, ["disabled"]);
  24212. };
  24213. }
  24214. });
  24215. var Dialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);
  24216. const ElDialog = withInstall(Dialog);
  24217. const inputNumberProps = buildProps({
  24218. id: {
  24219. type: String,
  24220. default: void 0
  24221. },
  24222. step: {
  24223. type: Number,
  24224. default: 1
  24225. },
  24226. stepStrictly: Boolean,
  24227. max: {
  24228. type: Number,
  24229. default: Number.POSITIVE_INFINITY
  24230. },
  24231. min: {
  24232. type: Number,
  24233. default: Number.NEGATIVE_INFINITY
  24234. },
  24235. modelValue: Number,
  24236. readonly: Boolean,
  24237. disabled: Boolean,
  24238. size: useSizeProp,
  24239. controls: {
  24240. type: Boolean,
  24241. default: true
  24242. },
  24243. controlsPosition: {
  24244. type: String,
  24245. default: "",
  24246. values: ["", "right"]
  24247. },
  24248. valueOnClear: {
  24249. type: [String, Number, null],
  24250. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  24251. default: null
  24252. },
  24253. name: String,
  24254. label: String,
  24255. placeholder: String,
  24256. precision: {
  24257. type: Number,
  24258. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  24259. },
  24260. validateEvent: {
  24261. type: Boolean,
  24262. default: true
  24263. }
  24264. });
  24265. const inputNumberEmits = {
  24266. [CHANGE_EVENT]: (cur, prev) => prev !== cur,
  24267. blur: (e) => e instanceof FocusEvent,
  24268. focus: (e) => e instanceof FocusEvent,
  24269. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  24270. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  24271. };
  24272. const _hoisted_1$5 = ["aria-label", "onKeydown"];
  24273. const _hoisted_2$5 = ["aria-label", "onKeydown"];
  24274. const __default__$1 = defineComponent({
  24275. name: "ElInputNumber"
  24276. });
  24277. const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  24278. ...__default__$1,
  24279. props: inputNumberProps,
  24280. emits: inputNumberEmits,
  24281. setup(__props, { expose, emit }) {
  24282. const props = __props;
  24283. const { t: t2 } = useLocale();
  24284. const ns = useNamespace("input-number");
  24285. const input = ref();
  24286. const data = reactive({
  24287. currentValue: props.modelValue,
  24288. userInput: null
  24289. });
  24290. const { formItem } = useFormItem();
  24291. const minDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  24292. const maxDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  24293. const numPrecision = computed$1(() => {
  24294. const stepPrecision = getPrecision(props.step);
  24295. if (!isUndefined(props.precision)) {
  24296. if (stepPrecision > props.precision)
  24297. ;
  24298. return props.precision;
  24299. } else {
  24300. return Math.max(getPrecision(props.modelValue), stepPrecision);
  24301. }
  24302. });
  24303. const controlsAtRight = computed$1(() => {
  24304. return props.controls && props.controlsPosition === "right";
  24305. });
  24306. const inputNumberSize = useFormSize();
  24307. const inputNumberDisabled = useFormDisabled();
  24308. const displayValue = computed$1(() => {
  24309. if (data.userInput !== null) {
  24310. return data.userInput;
  24311. }
  24312. let currentValue = data.currentValue;
  24313. if (isNil(currentValue))
  24314. return "";
  24315. if (isNumber(currentValue)) {
  24316. if (Number.isNaN(currentValue))
  24317. return "";
  24318. if (!isUndefined(props.precision)) {
  24319. currentValue = currentValue.toFixed(props.precision);
  24320. }
  24321. }
  24322. return currentValue;
  24323. });
  24324. const toPrecision = (num, pre) => {
  24325. if (isUndefined(pre))
  24326. pre = numPrecision.value;
  24327. if (pre === 0)
  24328. return Math.round(num);
  24329. let snum = String(num);
  24330. const pointPos = snum.indexOf(".");
  24331. if (pointPos === -1)
  24332. return num;
  24333. const nums = snum.replace(".", "").split("");
  24334. const datum = nums[pointPos + pre];
  24335. if (!datum)
  24336. return num;
  24337. const length = snum.length;
  24338. if (snum.charAt(length - 1) === "5") {
  24339. snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  24340. }
  24341. return Number.parseFloat(Number(snum).toFixed(pre));
  24342. };
  24343. const getPrecision = (value) => {
  24344. if (isNil(value))
  24345. return 0;
  24346. const valueString = value.toString();
  24347. const dotPosition = valueString.indexOf(".");
  24348. let precision = 0;
  24349. if (dotPosition !== -1) {
  24350. precision = valueString.length - dotPosition - 1;
  24351. }
  24352. return precision;
  24353. };
  24354. const ensurePrecision = (val, coefficient = 1) => {
  24355. if (!isNumber(val))
  24356. return data.currentValue;
  24357. return toPrecision(val + props.step * coefficient);
  24358. };
  24359. const increase = () => {
  24360. if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
  24361. return;
  24362. const value = Number(displayValue.value) || 0;
  24363. const newVal = ensurePrecision(value);
  24364. setCurrentValue(newVal);
  24365. emit(INPUT_EVENT, data.currentValue);
  24366. };
  24367. const decrease = () => {
  24368. if (props.readonly || inputNumberDisabled.value || minDisabled.value)
  24369. return;
  24370. const value = Number(displayValue.value) || 0;
  24371. const newVal = ensurePrecision(value, -1);
  24372. setCurrentValue(newVal);
  24373. emit(INPUT_EVENT, data.currentValue);
  24374. };
  24375. const verifyValue = (value, update) => {
  24376. const { max: max2, min: min2, step, precision, stepStrictly, valueOnClear } = props;
  24377. let newVal = Number(value);
  24378. if (isNil(value) || Number.isNaN(newVal)) {
  24379. return null;
  24380. }
  24381. if (value === "") {
  24382. if (valueOnClear === null) {
  24383. return null;
  24384. }
  24385. newVal = isString(valueOnClear) ? { min: min2, max: max2 }[valueOnClear] : valueOnClear;
  24386. }
  24387. if (stepStrictly) {
  24388. newVal = toPrecision(Math.round(newVal / step) * step, precision);
  24389. }
  24390. if (!isUndefined(precision)) {
  24391. newVal = toPrecision(newVal, precision);
  24392. }
  24393. if (newVal > max2 || newVal < min2) {
  24394. newVal = newVal > max2 ? max2 : min2;
  24395. update && emit(UPDATE_MODEL_EVENT, newVal);
  24396. }
  24397. return newVal;
  24398. };
  24399. const setCurrentValue = (value, emitChange = true) => {
  24400. var _a2;
  24401. const oldVal = data.currentValue;
  24402. const newVal = verifyValue(value);
  24403. if (!emitChange) {
  24404. emit(UPDATE_MODEL_EVENT, newVal);
  24405. return;
  24406. }
  24407. if (oldVal === newVal)
  24408. return;
  24409. data.userInput = null;
  24410. emit(UPDATE_MODEL_EVENT, newVal);
  24411. emit(CHANGE_EVENT, newVal, oldVal);
  24412. if (props.validateEvent) {
  24413. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  24414. }
  24415. data.currentValue = newVal;
  24416. };
  24417. const handleInput = (value) => {
  24418. data.userInput = value;
  24419. const newVal = value === "" ? null : Number(value);
  24420. emit(INPUT_EVENT, newVal);
  24421. setCurrentValue(newVal, false);
  24422. };
  24423. const handleInputChange = (value) => {
  24424. const newVal = value !== "" ? Number(value) : "";
  24425. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
  24426. setCurrentValue(newVal);
  24427. }
  24428. data.userInput = null;
  24429. };
  24430. const focus = () => {
  24431. var _a2, _b;
  24432. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  24433. };
  24434. const blur = () => {
  24435. var _a2, _b;
  24436. (_b = (_a2 = input.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
  24437. };
  24438. const handleFocus = (event2) => {
  24439. emit("focus", event2);
  24440. };
  24441. const handleBlur = (event2) => {
  24442. var _a2;
  24443. emit("blur", event2);
  24444. if (props.validateEvent) {
  24445. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  24446. }
  24447. };
  24448. watch(() => props.modelValue, (value) => {
  24449. const userInput = verifyValue(data.userInput);
  24450. const newValue = verifyValue(value, true);
  24451. if (!isNumber(userInput) && (!userInput || userInput !== newValue)) {
  24452. data.currentValue = newValue;
  24453. data.userInput = null;
  24454. }
  24455. }, { immediate: true });
  24456. onMounted(() => {
  24457. var _a2;
  24458. const { min: min2, max: max2, modelValue } = props;
  24459. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24460. innerInput.setAttribute("role", "spinbutton");
  24461. if (Number.isFinite(max2)) {
  24462. innerInput.setAttribute("aria-valuemax", String(max2));
  24463. } else {
  24464. innerInput.removeAttribute("aria-valuemax");
  24465. }
  24466. if (Number.isFinite(min2)) {
  24467. innerInput.setAttribute("aria-valuemin", String(min2));
  24468. } else {
  24469. innerInput.removeAttribute("aria-valuemin");
  24470. }
  24471. innerInput.setAttribute("aria-valuenow", String(data.currentValue));
  24472. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  24473. if (!isNumber(modelValue) && modelValue != null) {
  24474. let val = Number(modelValue);
  24475. if (Number.isNaN(val)) {
  24476. val = null;
  24477. }
  24478. emit(UPDATE_MODEL_EVENT, val);
  24479. }
  24480. });
  24481. onUpdated(() => {
  24482. var _a2;
  24483. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24484. innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${data.currentValue}`);
  24485. });
  24486. expose({
  24487. focus,
  24488. blur
  24489. });
  24490. return (_ctx, _cache) => {
  24491. return openBlock(), createElementBlock("div", {
  24492. class: normalizeClass([
  24493. unref(ns).b(),
  24494. unref(ns).m(unref(inputNumberSize)),
  24495. unref(ns).is("disabled", unref(inputNumberDisabled)),
  24496. unref(ns).is("without-controls", !_ctx.controls),
  24497. unref(ns).is("controls-right", unref(controlsAtRight))
  24498. ]),
  24499. onDragstart: _cache[1] || (_cache[1] = withModifiers(() => {
  24500. }, ["prevent"]))
  24501. }, [
  24502. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24503. key: 0,
  24504. role: "button",
  24505. "aria-label": unref(t2)("el.inputNumber.decrease"),
  24506. class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
  24507. onKeydown: withKeys(decrease, ["enter"])
  24508. }, [
  24509. createVNode(unref(ElIcon), null, {
  24510. default: withCtx(() => [
  24511. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))
  24512. ]),
  24513. _: 1
  24514. })
  24515. ], 42, _hoisted_1$5)), [
  24516. [unref(vRepeatClick), decrease]
  24517. ]) : createCommentVNode("v-if", true),
  24518. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24519. key: 1,
  24520. role: "button",
  24521. "aria-label": unref(t2)("el.inputNumber.increase"),
  24522. class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
  24523. onKeydown: withKeys(increase, ["enter"])
  24524. }, [
  24525. createVNode(unref(ElIcon), null, {
  24526. default: withCtx(() => [
  24527. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))
  24528. ]),
  24529. _: 1
  24530. })
  24531. ], 42, _hoisted_2$5)), [
  24532. [unref(vRepeatClick), increase]
  24533. ]) : createCommentVNode("v-if", true),
  24534. createVNode(unref(ElInput), {
  24535. id: _ctx.id,
  24536. ref_key: "input",
  24537. ref: input,
  24538. type: "number",
  24539. step: _ctx.step,
  24540. "model-value": unref(displayValue),
  24541. placeholder: _ctx.placeholder,
  24542. readonly: _ctx.readonly,
  24543. disabled: unref(inputNumberDisabled),
  24544. size: unref(inputNumberSize),
  24545. max: _ctx.max,
  24546. min: _ctx.min,
  24547. name: _ctx.name,
  24548. label: _ctx.label,
  24549. "validate-event": false,
  24550. onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
  24551. }, ["prevent"])),
  24552. onKeydown: [
  24553. withKeys(withModifiers(increase, ["prevent"]), ["up"]),
  24554. withKeys(withModifiers(decrease, ["prevent"]), ["down"])
  24555. ],
  24556. onBlur: handleBlur,
  24557. onFocus: handleFocus,
  24558. onInput: handleInput,
  24559. onChange: handleInputChange
  24560. }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"])
  24561. ], 34);
  24562. };
  24563. }
  24564. });
  24565. var InputNumber = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);
  24566. const ElInputNumber = withInstall(InputNumber);
  24567. const selectGroupKey = Symbol("ElSelectGroup");
  24568. const selectKey = Symbol("ElSelect");
  24569. function useOption(props, states) {
  24570. const select = inject(selectKey);
  24571. const selectGroup = inject(selectGroupKey, { disabled: false });
  24572. const isObject3 = computed$1(() => {
  24573. return Object.prototype.toString.call(props.value).toLowerCase() === "[object object]";
  24574. });
  24575. const itemSelected = computed$1(() => {
  24576. if (!select.props.multiple) {
  24577. return isEqual2(props.value, select.props.modelValue);
  24578. } else {
  24579. return contains(select.props.modelValue, props.value);
  24580. }
  24581. });
  24582. const limitReached = computed$1(() => {
  24583. if (select.props.multiple) {
  24584. const modelValue = select.props.modelValue || [];
  24585. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  24586. } else {
  24587. return false;
  24588. }
  24589. });
  24590. const currentLabel = computed$1(() => {
  24591. return props.label || (isObject3.value ? "" : props.value);
  24592. });
  24593. const currentValue = computed$1(() => {
  24594. return props.value || props.label || "";
  24595. });
  24596. const isDisabled3 = computed$1(() => {
  24597. return props.disabled || states.groupDisabled || limitReached.value;
  24598. });
  24599. const instance = getCurrentInstance();
  24600. const contains = (arr = [], target) => {
  24601. if (!isObject3.value) {
  24602. return arr && arr.includes(target);
  24603. } else {
  24604. const valueKey = select.props.valueKey;
  24605. return arr && arr.some((item) => {
  24606. return toRaw$1(get$2(item, valueKey)) === get$2(target, valueKey);
  24607. });
  24608. }
  24609. };
  24610. const isEqual2 = (a, b) => {
  24611. if (!isObject3.value) {
  24612. return a === b;
  24613. } else {
  24614. const { valueKey } = select.props;
  24615. return get$2(a, valueKey) === get$2(b, valueKey);
  24616. }
  24617. };
  24618. const hoverItem = () => {
  24619. if (!props.disabled && !selectGroup.disabled) {
  24620. select.hoverIndex = select.optionsArray.indexOf(instance.proxy);
  24621. }
  24622. };
  24623. watch(() => currentLabel.value, () => {
  24624. if (!props.created && !select.props.remote)
  24625. select.setSelected();
  24626. });
  24627. watch(() => props.value, (val, oldVal) => {
  24628. const { remote, valueKey } = select.props;
  24629. if (!Object.is(val, oldVal)) {
  24630. select.onOptionDestroy(oldVal, instance.proxy);
  24631. select.onOptionCreate(instance.proxy);
  24632. }
  24633. if (!props.created && !remote) {
  24634. if (valueKey && typeof val === "object" && typeof oldVal === "object" && val[valueKey] === oldVal[valueKey]) {
  24635. return;
  24636. }
  24637. select.setSelected();
  24638. }
  24639. });
  24640. watch(() => selectGroup.disabled, () => {
  24641. states.groupDisabled = selectGroup.disabled;
  24642. }, { immediate: true });
  24643. const { queryChange } = toRaw$1(select);
  24644. watch(queryChange, (changes) => {
  24645. const { query } = unref(changes);
  24646. const regexp = new RegExp(escapeStringRegexp(query), "i");
  24647. states.visible = regexp.test(currentLabel.value) || props.created;
  24648. if (!states.visible) {
  24649. select.filteredOptionsCount--;
  24650. }
  24651. }, { immediate: true });
  24652. return {
  24653. select,
  24654. currentLabel,
  24655. currentValue,
  24656. itemSelected,
  24657. isDisabled: isDisabled3,
  24658. hoverItem
  24659. };
  24660. }
  24661. const _sfc_main$7 = defineComponent({
  24662. name: "ElOption",
  24663. componentName: "ElOption",
  24664. props: {
  24665. value: {
  24666. required: true,
  24667. type: [String, Number, Boolean, Object]
  24668. },
  24669. label: [String, Number],
  24670. created: Boolean,
  24671. disabled: {
  24672. type: Boolean,
  24673. default: false
  24674. }
  24675. },
  24676. setup(props) {
  24677. const ns = useNamespace("select");
  24678. const states = reactive({
  24679. index: -1,
  24680. groupDisabled: false,
  24681. visible: true,
  24682. hitState: false,
  24683. hover: false
  24684. });
  24685. const { currentLabel, itemSelected, isDisabled: isDisabled3, select, hoverItem } = useOption(props, states);
  24686. const { visible, hover } = toRefs(states);
  24687. const vm = getCurrentInstance().proxy;
  24688. select.onOptionCreate(vm);
  24689. onBeforeUnmount(() => {
  24690. const key = vm.value;
  24691. const { selected } = select;
  24692. const selectedOptions = select.props.multiple ? selected : [selected];
  24693. const doesSelected = selectedOptions.some((item) => {
  24694. return item.value === vm.value;
  24695. });
  24696. nextTick(() => {
  24697. if (select.cachedOptions.get(key) === vm && !doesSelected) {
  24698. select.cachedOptions.delete(key);
  24699. }
  24700. });
  24701. select.onOptionDestroy(key, vm);
  24702. });
  24703. function selectOptionClick() {
  24704. if (props.disabled !== true && states.groupDisabled !== true) {
  24705. select.handleOptionSelect(vm, true);
  24706. }
  24707. }
  24708. return {
  24709. ns,
  24710. currentLabel,
  24711. itemSelected,
  24712. isDisabled: isDisabled3,
  24713. select,
  24714. hoverItem,
  24715. visible,
  24716. hover,
  24717. selectOptionClick,
  24718. states
  24719. };
  24720. }
  24721. });
  24722. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  24723. return withDirectives((openBlock(), createElementBlock("li", {
  24724. class: normalizeClass([
  24725. _ctx.ns.be("dropdown", "item"),
  24726. _ctx.ns.is("disabled", _ctx.isDisabled),
  24727. {
  24728. selected: _ctx.itemSelected,
  24729. hover: _ctx.hover
  24730. }
  24731. ]),
  24732. onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  24733. onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  24734. }, [
  24735. renderSlot(_ctx.$slots, "default", {}, () => [
  24736. createElementVNode("span", null, toDisplayString(_ctx.currentLabel), 1)
  24737. ])
  24738. ], 34)), [
  24739. [vShow, _ctx.visible]
  24740. ]);
  24741. }
  24742. var Option = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$3], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);
  24743. const _sfc_main$6 = defineComponent({
  24744. name: "ElSelectDropdown",
  24745. componentName: "ElSelectDropdown",
  24746. setup() {
  24747. const select = inject(selectKey);
  24748. const ns = useNamespace("select");
  24749. const popperClass = computed$1(() => select.props.popperClass);
  24750. const isMultiple = computed$1(() => select.props.multiple);
  24751. const isFitInputWidth = computed$1(() => select.props.fitInputWidth);
  24752. const minWidth = ref("");
  24753. function updateMinWidth() {
  24754. var _a2;
  24755. minWidth.value = `${(_a2 = select.selectWrapper) == null ? void 0 : _a2.offsetWidth}px`;
  24756. }
  24757. onMounted(() => {
  24758. updateMinWidth();
  24759. useResizeObserver(select.selectWrapper, updateMinWidth);
  24760. });
  24761. return {
  24762. ns,
  24763. minWidth,
  24764. popperClass,
  24765. isMultiple,
  24766. isFitInputWidth
  24767. };
  24768. }
  24769. });
  24770. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  24771. return openBlock(), createElementBlock("div", {
  24772. class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
  24773. style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  24774. }, [
  24775. renderSlot(_ctx.$slots, "default")
  24776. ], 6);
  24777. }
  24778. var ElSelectMenu = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$2], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);
  24779. function useSelectStates(props) {
  24780. const { t: t2 } = useLocale();
  24781. return reactive({
  24782. options: /* @__PURE__ */ new Map(),
  24783. cachedOptions: /* @__PURE__ */ new Map(),
  24784. createdLabel: null,
  24785. createdSelected: false,
  24786. selected: props.multiple ? [] : {},
  24787. inputLength: 20,
  24788. inputWidth: 0,
  24789. optionsCount: 0,
  24790. filteredOptionsCount: 0,
  24791. visible: false,
  24792. softFocus: false,
  24793. selectedLabel: "",
  24794. hoverIndex: -1,
  24795. query: "",
  24796. previousQuery: null,
  24797. inputHovering: false,
  24798. cachedPlaceHolder: "",
  24799. currentPlaceholder: t2("el.select.placeholder"),
  24800. menuVisibleOnFocus: false,
  24801. isOnComposition: false,
  24802. isSilentBlur: false,
  24803. prefixWidth: 11,
  24804. tagInMultiLine: false,
  24805. mouseEnter: false
  24806. });
  24807. }
  24808. const useSelect = (props, states, ctx) => {
  24809. const { t: t2 } = useLocale();
  24810. const ns = useNamespace("select");
  24811. useDeprecated({
  24812. from: "suffixTransition",
  24813. replacement: "override style scheme",
  24814. version: "2.3.0",
  24815. scope: "props",
  24816. ref: "https://element-plus.org/en-US/component/select.html#select-attributes"
  24817. }, computed$1(() => props.suffixTransition === false));
  24818. const reference = ref(null);
  24819. const input = ref(null);
  24820. const iOSInput = ref(null);
  24821. const tooltipRef = ref(null);
  24822. const tags = ref(null);
  24823. const selectWrapper = ref(null);
  24824. const scrollbar = ref(null);
  24825. const hoverOption = ref(-1);
  24826. const queryChange = shallowRef({ query: "" });
  24827. const groupQueryChange = shallowRef("");
  24828. const optionList = ref([]);
  24829. let originClientHeight = 0;
  24830. const { form, formItem } = useFormItem();
  24831. const readonly2 = computed$1(() => !props.filterable || props.multiple || !states.visible);
  24832. const selectDisabled = computed$1(() => props.disabled || (form == null ? void 0 : form.disabled));
  24833. const showClose = computed$1(() => {
  24834. const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : props.modelValue !== void 0 && props.modelValue !== null && props.modelValue !== "";
  24835. const criteria = props.clearable && !selectDisabled.value && states.inputHovering && hasValue;
  24836. return criteria;
  24837. });
  24838. const iconComponent = computed$1(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  24839. const iconReverse = computed$1(() => ns.is("reverse", iconComponent.value && states.visible && props.suffixTransition));
  24840. const debounce$12 = computed$1(() => props.remote ? 300 : 0);
  24841. const emptyText = computed$1(() => {
  24842. if (props.loading) {
  24843. return props.loadingText || t2("el.select.loading");
  24844. } else {
  24845. if (props.remote && states.query === "" && states.options.size === 0)
  24846. return false;
  24847. if (props.filterable && states.query && states.options.size > 0 && states.filteredOptionsCount === 0) {
  24848. return props.noMatchText || t2("el.select.noMatch");
  24849. }
  24850. if (states.options.size === 0) {
  24851. return props.noDataText || t2("el.select.noData");
  24852. }
  24853. }
  24854. return null;
  24855. });
  24856. const optionsArray = computed$1(() => {
  24857. const list = Array.from(states.options.values());
  24858. const newList = [];
  24859. optionList.value.forEach((item) => {
  24860. const index2 = list.findIndex((i2) => i2.currentLabel === item);
  24861. if (index2 > -1) {
  24862. newList.push(list[index2]);
  24863. }
  24864. });
  24865. return newList.length ? newList : list;
  24866. });
  24867. const cachedOptionsArray = computed$1(() => Array.from(states.cachedOptions.values()));
  24868. const showNewOption = computed$1(() => {
  24869. const hasExistingOption = optionsArray.value.filter((option) => {
  24870. return !option.created;
  24871. }).some((option) => {
  24872. return option.currentLabel === states.query;
  24873. });
  24874. return props.filterable && props.allowCreate && states.query !== "" && !hasExistingOption;
  24875. });
  24876. const selectSize = useFormSize();
  24877. const collapseTagSize = computed$1(() => ["small"].includes(selectSize.value) ? "small" : "default");
  24878. const dropMenuVisible = computed$1({
  24879. get() {
  24880. return states.visible && emptyText.value !== false;
  24881. },
  24882. set(val) {
  24883. states.visible = val;
  24884. }
  24885. });
  24886. watch([() => selectDisabled.value, () => selectSize.value, () => form == null ? void 0 : form.size], () => {
  24887. nextTick(() => {
  24888. resetInputHeight();
  24889. });
  24890. });
  24891. watch(() => props.placeholder, (val) => {
  24892. states.cachedPlaceHolder = states.currentPlaceholder = val;
  24893. });
  24894. watch(() => props.modelValue, (val, oldVal) => {
  24895. if (props.multiple) {
  24896. resetInputHeight();
  24897. if (val && val.length > 0 || input.value && states.query !== "") {
  24898. states.currentPlaceholder = "";
  24899. } else {
  24900. states.currentPlaceholder = states.cachedPlaceHolder;
  24901. }
  24902. if (props.filterable && !props.reserveKeyword) {
  24903. states.query = "";
  24904. handleQueryChange(states.query);
  24905. }
  24906. }
  24907. setSelected();
  24908. if (props.filterable && !props.multiple) {
  24909. states.inputLength = 20;
  24910. }
  24911. if (!isEqual(val, oldVal) && props.validateEvent) {
  24912. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  24913. }
  24914. }, {
  24915. flush: "post",
  24916. deep: true
  24917. });
  24918. watch(() => states.visible, (val) => {
  24919. var _a2, _b, _c, _d, _e;
  24920. if (!val) {
  24921. if (props.filterable) {
  24922. if (isFunction$3(props.filterMethod)) {
  24923. props.filterMethod("");
  24924. }
  24925. if (isFunction$3(props.remoteMethod)) {
  24926. props.remoteMethod("");
  24927. }
  24928. }
  24929. input.value && input.value.blur();
  24930. states.query = "";
  24931. states.previousQuery = null;
  24932. states.selectedLabel = "";
  24933. states.inputLength = 20;
  24934. states.menuVisibleOnFocus = false;
  24935. resetHoverIndex();
  24936. nextTick(() => {
  24937. if (input.value && input.value.value === "" && states.selected.length === 0) {
  24938. states.currentPlaceholder = states.cachedPlaceHolder;
  24939. }
  24940. });
  24941. if (!props.multiple) {
  24942. if (states.selected) {
  24943. if (props.filterable && props.allowCreate && states.createdSelected && states.createdLabel) {
  24944. states.selectedLabel = states.createdLabel;
  24945. } else {
  24946. states.selectedLabel = states.selected.currentLabel;
  24947. }
  24948. if (props.filterable)
  24949. states.query = states.selectedLabel;
  24950. }
  24951. if (props.filterable) {
  24952. states.currentPlaceholder = states.cachedPlaceHolder;
  24953. }
  24954. }
  24955. } else {
  24956. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  24957. if (props.filterable) {
  24958. states.filteredOptionsCount = states.optionsCount;
  24959. states.query = props.remote ? "" : states.selectedLabel;
  24960. (_d = (_c = iOSInput.value) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
  24961. if (props.multiple) {
  24962. (_e = input.value) == null ? void 0 : _e.focus();
  24963. } else {
  24964. if (states.selectedLabel) {
  24965. states.currentPlaceholder = `${states.selectedLabel}`;
  24966. states.selectedLabel = "";
  24967. }
  24968. }
  24969. handleQueryChange(states.query);
  24970. if (!props.multiple && !props.remote) {
  24971. queryChange.value.query = "";
  24972. triggerRef(queryChange);
  24973. triggerRef(groupQueryChange);
  24974. }
  24975. }
  24976. }
  24977. ctx.emit("visible-change", val);
  24978. });
  24979. watch(() => states.options.entries(), () => {
  24980. var _a2, _b, _c;
  24981. if (!isClient)
  24982. return;
  24983. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  24984. if (props.multiple) {
  24985. resetInputHeight();
  24986. }
  24987. const inputs = ((_c = selectWrapper.value) == null ? void 0 : _c.querySelectorAll("input")) || [];
  24988. if (!Array.from(inputs).includes(document.activeElement)) {
  24989. setSelected();
  24990. }
  24991. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  24992. checkDefaultFirstOption();
  24993. }
  24994. }, {
  24995. flush: "post"
  24996. });
  24997. watch(() => states.hoverIndex, (val) => {
  24998. if (isNumber(val) && val > -1) {
  24999. hoverOption.value = optionsArray.value[val] || {};
  25000. } else {
  25001. hoverOption.value = {};
  25002. }
  25003. optionsArray.value.forEach((option) => {
  25004. option.hover = hoverOption.value === option;
  25005. });
  25006. });
  25007. const resetInputHeight = () => {
  25008. nextTick(() => {
  25009. var _a2, _b;
  25010. if (!reference.value)
  25011. return;
  25012. const input2 = reference.value.$el.querySelector("input");
  25013. originClientHeight = originClientHeight || (input2.clientHeight > 0 ? input2.clientHeight + 2 : 0);
  25014. const _tags = tags.value;
  25015. const gotSize = getComponentSize(selectSize.value || (form == null ? void 0 : form.size));
  25016. const sizeInMap = selectSize.value || gotSize === originClientHeight || originClientHeight <= 0 ? gotSize : originClientHeight;
  25017. const isElHidden = input2.offsetParent === null;
  25018. !isElHidden && (input2.style.height = `${(states.selected.length === 0 ? sizeInMap : Math.max(_tags ? _tags.clientHeight + (_tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap)) - 2}px`);
  25019. states.tagInMultiLine = Number.parseFloat(input2.style.height) >= sizeInMap;
  25020. if (states.visible && emptyText.value !== false) {
  25021. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25022. }
  25023. });
  25024. };
  25025. const handleQueryChange = async (val) => {
  25026. if (states.previousQuery === val || states.isOnComposition)
  25027. return;
  25028. if (states.previousQuery === null && (isFunction$3(props.filterMethod) || isFunction$3(props.remoteMethod))) {
  25029. states.previousQuery = val;
  25030. return;
  25031. }
  25032. states.previousQuery = val;
  25033. nextTick(() => {
  25034. var _a2, _b;
  25035. if (states.visible)
  25036. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25037. });
  25038. states.hoverIndex = -1;
  25039. if (props.multiple && props.filterable) {
  25040. nextTick(() => {
  25041. const length = input.value.value.length * 15 + 20;
  25042. states.inputLength = props.collapseTags ? Math.min(50, length) : length;
  25043. managePlaceholder();
  25044. resetInputHeight();
  25045. });
  25046. }
  25047. if (props.remote && isFunction$3(props.remoteMethod)) {
  25048. states.hoverIndex = -1;
  25049. props.remoteMethod(val);
  25050. } else if (isFunction$3(props.filterMethod)) {
  25051. props.filterMethod(val);
  25052. triggerRef(groupQueryChange);
  25053. } else {
  25054. states.filteredOptionsCount = states.optionsCount;
  25055. queryChange.value.query = val;
  25056. triggerRef(queryChange);
  25057. triggerRef(groupQueryChange);
  25058. }
  25059. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  25060. await nextTick();
  25061. checkDefaultFirstOption();
  25062. }
  25063. };
  25064. const managePlaceholder = () => {
  25065. if (states.currentPlaceholder !== "") {
  25066. states.currentPlaceholder = input.value.value ? "" : states.cachedPlaceHolder;
  25067. }
  25068. };
  25069. const checkDefaultFirstOption = () => {
  25070. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  25071. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  25072. const firstOriginOption = optionsInDropdown[0];
  25073. states.hoverIndex = getValueIndex(optionsArray.value, userCreatedOption || firstOriginOption);
  25074. };
  25075. const setSelected = () => {
  25076. var _a2;
  25077. if (!props.multiple) {
  25078. const option = getOption(props.modelValue);
  25079. if ((_a2 = option.props) == null ? void 0 : _a2.created) {
  25080. states.createdLabel = option.props.value;
  25081. states.createdSelected = true;
  25082. } else {
  25083. states.createdSelected = false;
  25084. }
  25085. states.selectedLabel = option.currentLabel;
  25086. states.selected = option;
  25087. if (props.filterable)
  25088. states.query = states.selectedLabel;
  25089. return;
  25090. } else {
  25091. states.selectedLabel = "";
  25092. }
  25093. const result = [];
  25094. if (Array.isArray(props.modelValue)) {
  25095. props.modelValue.forEach((value) => {
  25096. result.push(getOption(value));
  25097. });
  25098. }
  25099. states.selected = result;
  25100. nextTick(() => {
  25101. resetInputHeight();
  25102. });
  25103. };
  25104. const getOption = (value) => {
  25105. let option;
  25106. const isObjectValue = toRawType(value).toLowerCase() === "object";
  25107. const isNull = toRawType(value).toLowerCase() === "null";
  25108. const isUndefined2 = toRawType(value).toLowerCase() === "undefined";
  25109. for (let i2 = states.cachedOptions.size - 1; i2 >= 0; i2--) {
  25110. const cachedOption = cachedOptionsArray.value[i2];
  25111. const isEqualValue = isObjectValue ? get$2(cachedOption.value, props.valueKey) === get$2(value, props.valueKey) : cachedOption.value === value;
  25112. if (isEqualValue) {
  25113. option = {
  25114. value,
  25115. currentLabel: cachedOption.currentLabel,
  25116. isDisabled: cachedOption.isDisabled
  25117. };
  25118. break;
  25119. }
  25120. }
  25121. if (option)
  25122. return option;
  25123. const label = isObjectValue ? value.label : !isNull && !isUndefined2 ? value : "";
  25124. const newOption = {
  25125. value,
  25126. currentLabel: label
  25127. };
  25128. if (props.multiple) {
  25129. newOption.hitState = false;
  25130. }
  25131. return newOption;
  25132. };
  25133. const resetHoverIndex = () => {
  25134. setTimeout(() => {
  25135. const valueKey = props.valueKey;
  25136. if (!props.multiple) {
  25137. states.hoverIndex = optionsArray.value.findIndex((item) => {
  25138. return getValueKey(item) === getValueKey(states.selected);
  25139. });
  25140. } else {
  25141. if (states.selected.length > 0) {
  25142. states.hoverIndex = Math.min.apply(null, states.selected.map((selected) => {
  25143. return optionsArray.value.findIndex((item) => {
  25144. return get$2(item, valueKey) === get$2(selected, valueKey);
  25145. });
  25146. }));
  25147. } else {
  25148. states.hoverIndex = -1;
  25149. }
  25150. }
  25151. }, 300);
  25152. };
  25153. const handleResize = () => {
  25154. var _a2, _b;
  25155. resetInputWidth();
  25156. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25157. if (props.multiple)
  25158. resetInputHeight();
  25159. };
  25160. const resetInputWidth = () => {
  25161. var _a2;
  25162. states.inputWidth = (_a2 = reference.value) == null ? void 0 : _a2.$el.offsetWidth;
  25163. };
  25164. const onInputChange = () => {
  25165. if (props.filterable && states.query !== states.selectedLabel) {
  25166. states.query = states.selectedLabel;
  25167. handleQueryChange(states.query);
  25168. }
  25169. };
  25170. const debouncedOnInputChange = debounce$2(() => {
  25171. onInputChange();
  25172. }, debounce$12.value);
  25173. const debouncedQueryChange = debounce$2((e) => {
  25174. handleQueryChange(e.target.value);
  25175. }, debounce$12.value);
  25176. const emitChange = (val) => {
  25177. if (!isEqual(props.modelValue, val)) {
  25178. ctx.emit(CHANGE_EVENT, val);
  25179. }
  25180. };
  25181. const deletePrevTag = (e) => {
  25182. if (e.code === EVENT_CODE.delete)
  25183. return;
  25184. if (e.target.value.length <= 0 && !toggleLastOptionHitState()) {
  25185. const value = props.modelValue.slice();
  25186. value.pop();
  25187. ctx.emit(UPDATE_MODEL_EVENT, value);
  25188. emitChange(value);
  25189. }
  25190. if (e.target.value.length === 1 && props.modelValue.length === 0) {
  25191. states.currentPlaceholder = states.cachedPlaceHolder;
  25192. }
  25193. };
  25194. const deleteTag = (event2, tag) => {
  25195. const index2 = states.selected.indexOf(tag);
  25196. if (index2 > -1 && !selectDisabled.value) {
  25197. const value = props.modelValue.slice();
  25198. value.splice(index2, 1);
  25199. ctx.emit(UPDATE_MODEL_EVENT, value);
  25200. emitChange(value);
  25201. ctx.emit("remove-tag", tag.value);
  25202. }
  25203. event2.stopPropagation();
  25204. };
  25205. const deleteSelected = (event2) => {
  25206. event2.stopPropagation();
  25207. const value = props.multiple ? [] : "";
  25208. if (!isString(value)) {
  25209. for (const item of states.selected) {
  25210. if (item.isDisabled)
  25211. value.push(item.value);
  25212. }
  25213. }
  25214. ctx.emit(UPDATE_MODEL_EVENT, value);
  25215. emitChange(value);
  25216. states.hoverIndex = -1;
  25217. states.visible = false;
  25218. ctx.emit("clear");
  25219. };
  25220. const handleOptionSelect = (option, byClick) => {
  25221. var _a2;
  25222. if (props.multiple) {
  25223. const value = (props.modelValue || []).slice();
  25224. const optionIndex = getValueIndex(value, option.value);
  25225. if (optionIndex > -1) {
  25226. value.splice(optionIndex, 1);
  25227. } else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
  25228. value.push(option.value);
  25229. }
  25230. ctx.emit(UPDATE_MODEL_EVENT, value);
  25231. emitChange(value);
  25232. if (option.created) {
  25233. states.query = "";
  25234. handleQueryChange("");
  25235. states.inputLength = 20;
  25236. }
  25237. if (props.filterable)
  25238. (_a2 = input.value) == null ? void 0 : _a2.focus();
  25239. } else {
  25240. ctx.emit(UPDATE_MODEL_EVENT, option.value);
  25241. emitChange(option.value);
  25242. states.visible = false;
  25243. }
  25244. states.isSilentBlur = byClick;
  25245. setSoftFocus();
  25246. if (states.visible)
  25247. return;
  25248. nextTick(() => {
  25249. scrollToOption(option);
  25250. });
  25251. };
  25252. const getValueIndex = (arr = [], value) => {
  25253. if (!isObject$5(value))
  25254. return arr.indexOf(value);
  25255. const valueKey = props.valueKey;
  25256. let index2 = -1;
  25257. arr.some((item, i2) => {
  25258. if (toRaw$1(get$2(item, valueKey)) === get$2(value, valueKey)) {
  25259. index2 = i2;
  25260. return true;
  25261. }
  25262. return false;
  25263. });
  25264. return index2;
  25265. };
  25266. const setSoftFocus = () => {
  25267. states.softFocus = true;
  25268. const _input = input.value || reference.value;
  25269. if (_input) {
  25270. _input == null ? void 0 : _input.focus();
  25271. }
  25272. };
  25273. const scrollToOption = (option) => {
  25274. var _a2, _b, _c, _d, _e;
  25275. const targetOption = Array.isArray(option) ? option[0] : option;
  25276. let target = null;
  25277. if (targetOption == null ? void 0 : targetOption.value) {
  25278. const options2 = optionsArray.value.filter((item) => item.value === targetOption.value);
  25279. if (options2.length > 0) {
  25280. target = options2[0].$el;
  25281. }
  25282. }
  25283. if (tooltipRef.value && target) {
  25284. const menu = (_d = (_c = (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${ns.be("dropdown", "wrap")}`);
  25285. if (menu) {
  25286. scrollIntoView(menu, target);
  25287. }
  25288. }
  25289. (_e = scrollbar.value) == null ? void 0 : _e.handleScroll();
  25290. };
  25291. const onOptionCreate = (vm) => {
  25292. states.optionsCount++;
  25293. states.filteredOptionsCount++;
  25294. states.options.set(vm.value, vm);
  25295. states.cachedOptions.set(vm.value, vm);
  25296. };
  25297. const onOptionDestroy = (key, vm) => {
  25298. if (states.options.get(key) === vm) {
  25299. states.optionsCount--;
  25300. states.filteredOptionsCount--;
  25301. states.options.delete(key);
  25302. }
  25303. };
  25304. const resetInputState = (e) => {
  25305. if (e.code !== EVENT_CODE.backspace)
  25306. toggleLastOptionHitState(false);
  25307. states.inputLength = input.value.value.length * 15 + 20;
  25308. resetInputHeight();
  25309. };
  25310. const toggleLastOptionHitState = (hit) => {
  25311. if (!Array.isArray(states.selected))
  25312. return;
  25313. const option = states.selected[states.selected.length - 1];
  25314. if (!option)
  25315. return;
  25316. if (hit === true || hit === false) {
  25317. option.hitState = hit;
  25318. return hit;
  25319. }
  25320. option.hitState = !option.hitState;
  25321. return option.hitState;
  25322. };
  25323. const handleComposition = (event2) => {
  25324. const text = event2.target.value;
  25325. if (event2.type === "compositionend") {
  25326. states.isOnComposition = false;
  25327. nextTick(() => handleQueryChange(text));
  25328. } else {
  25329. const lastCharacter = text[text.length - 1] || "";
  25330. states.isOnComposition = !isKorean(lastCharacter);
  25331. }
  25332. };
  25333. const handleMenuEnter = () => {
  25334. nextTick(() => scrollToOption(states.selected));
  25335. };
  25336. const handleFocus = (event2) => {
  25337. if (!states.softFocus) {
  25338. if (props.automaticDropdown || props.filterable) {
  25339. if (props.filterable && !states.visible) {
  25340. states.menuVisibleOnFocus = true;
  25341. }
  25342. states.visible = true;
  25343. }
  25344. ctx.emit("focus", event2);
  25345. } else {
  25346. states.softFocus = false;
  25347. }
  25348. };
  25349. const blur = () => {
  25350. var _a2, _b, _c;
  25351. states.visible = false;
  25352. (_a2 = reference.value) == null ? void 0 : _a2.blur();
  25353. (_c = (_b = iOSInput.value) == null ? void 0 : _b.blur) == null ? void 0 : _c.call(_b);
  25354. };
  25355. const handleBlur = (event2) => {
  25356. nextTick(() => {
  25357. if (states.isSilentBlur) {
  25358. states.isSilentBlur = false;
  25359. } else {
  25360. ctx.emit("blur", event2);
  25361. }
  25362. });
  25363. states.softFocus = false;
  25364. };
  25365. const handleClearClick = (event2) => {
  25366. deleteSelected(event2);
  25367. };
  25368. const handleClose = () => {
  25369. states.visible = false;
  25370. };
  25371. const handleKeydownEscape = (event2) => {
  25372. if (states.visible) {
  25373. event2.preventDefault();
  25374. event2.stopPropagation();
  25375. states.visible = false;
  25376. }
  25377. };
  25378. const toggleMenu = (e) => {
  25379. var _a2;
  25380. if (e && !states.mouseEnter) {
  25381. return;
  25382. }
  25383. if (!selectDisabled.value) {
  25384. if (states.menuVisibleOnFocus) {
  25385. states.menuVisibleOnFocus = false;
  25386. } else {
  25387. if (!tooltipRef.value || !tooltipRef.value.isFocusInsideContent()) {
  25388. states.visible = !states.visible;
  25389. }
  25390. }
  25391. if (states.visible) {
  25392. (_a2 = input.value || reference.value) == null ? void 0 : _a2.focus();
  25393. }
  25394. }
  25395. };
  25396. const selectOption = () => {
  25397. if (!states.visible) {
  25398. toggleMenu();
  25399. } else {
  25400. if (optionsArray.value[states.hoverIndex]) {
  25401. handleOptionSelect(optionsArray.value[states.hoverIndex], void 0);
  25402. }
  25403. }
  25404. };
  25405. const getValueKey = (item) => {
  25406. return isObject$5(item.value) ? get$2(item.value, props.valueKey) : item.value;
  25407. };
  25408. const optionsAllDisabled = computed$1(() => optionsArray.value.filter((option) => option.visible).every((option) => option.disabled));
  25409. const showTagList = computed$1(() => states.selected.slice(0, props.maxCollapseTags));
  25410. const collapseTagList = computed$1(() => states.selected.slice(props.maxCollapseTags));
  25411. const navigateOptions = (direction) => {
  25412. if (!states.visible) {
  25413. states.visible = true;
  25414. return;
  25415. }
  25416. if (states.options.size === 0 || states.filteredOptionsCount === 0)
  25417. return;
  25418. if (states.isOnComposition)
  25419. return;
  25420. if (!optionsAllDisabled.value) {
  25421. if (direction === "next") {
  25422. states.hoverIndex++;
  25423. if (states.hoverIndex === states.options.size) {
  25424. states.hoverIndex = 0;
  25425. }
  25426. } else if (direction === "prev") {
  25427. states.hoverIndex--;
  25428. if (states.hoverIndex < 0) {
  25429. states.hoverIndex = states.options.size - 1;
  25430. }
  25431. }
  25432. const option = optionsArray.value[states.hoverIndex];
  25433. if (option.disabled === true || option.states.groupDisabled === true || !option.visible) {
  25434. navigateOptions(direction);
  25435. }
  25436. nextTick(() => scrollToOption(hoverOption.value));
  25437. }
  25438. };
  25439. const handleMouseEnter = () => {
  25440. states.mouseEnter = true;
  25441. };
  25442. const handleMouseLeave = () => {
  25443. states.mouseEnter = false;
  25444. };
  25445. return {
  25446. optionList,
  25447. optionsArray,
  25448. selectSize,
  25449. handleResize,
  25450. debouncedOnInputChange,
  25451. debouncedQueryChange,
  25452. deletePrevTag,
  25453. deleteTag,
  25454. deleteSelected,
  25455. handleOptionSelect,
  25456. scrollToOption,
  25457. readonly: readonly2,
  25458. resetInputHeight,
  25459. showClose,
  25460. iconComponent,
  25461. iconReverse,
  25462. showNewOption,
  25463. collapseTagSize,
  25464. setSelected,
  25465. managePlaceholder,
  25466. selectDisabled,
  25467. emptyText,
  25468. toggleLastOptionHitState,
  25469. resetInputState,
  25470. handleComposition,
  25471. onOptionCreate,
  25472. onOptionDestroy,
  25473. handleMenuEnter,
  25474. handleFocus,
  25475. blur,
  25476. handleBlur,
  25477. handleClearClick,
  25478. handleClose,
  25479. handleKeydownEscape,
  25480. toggleMenu,
  25481. selectOption,
  25482. getValueKey,
  25483. navigateOptions,
  25484. dropMenuVisible,
  25485. queryChange,
  25486. groupQueryChange,
  25487. showTagList,
  25488. collapseTagList,
  25489. reference,
  25490. input,
  25491. iOSInput,
  25492. tooltipRef,
  25493. tags,
  25494. selectWrapper,
  25495. scrollbar,
  25496. handleMouseEnter,
  25497. handleMouseLeave
  25498. };
  25499. };
  25500. var ElOptions = defineComponent({
  25501. name: "ElOptions",
  25502. emits: ["update-options"],
  25503. setup(_, { slots, emit }) {
  25504. let cachedOptions = [];
  25505. function isSameOptions(a, b) {
  25506. if (a.length !== b.length)
  25507. return false;
  25508. for (const [index2] of a.entries()) {
  25509. if (a[index2] != b[index2]) {
  25510. return false;
  25511. }
  25512. }
  25513. return true;
  25514. }
  25515. return () => {
  25516. var _a2, _b;
  25517. const children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  25518. const filteredOptions = [];
  25519. function filterOptions(children2) {
  25520. if (!Array.isArray(children2))
  25521. return;
  25522. children2.forEach((item) => {
  25523. var _a22, _b2, _c, _d;
  25524. const name = (_a22 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a22.name;
  25525. if (name === "ElOptionGroup") {
  25526. filterOptions(!isString(item.children) && !Array.isArray(item.children) && isFunction$3((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children);
  25527. } else if (name === "ElOption") {
  25528. filteredOptions.push((_d = item.props) == null ? void 0 : _d.label);
  25529. } else if (Array.isArray(item.children)) {
  25530. filterOptions(item.children);
  25531. }
  25532. });
  25533. }
  25534. if (children.length) {
  25535. filterOptions((_b = children[0]) == null ? void 0 : _b.children);
  25536. }
  25537. if (!isSameOptions(filteredOptions, cachedOptions)) {
  25538. cachedOptions = filteredOptions;
  25539. emit("update-options", filteredOptions);
  25540. }
  25541. return children;
  25542. };
  25543. }
  25544. });
  25545. const COMPONENT_NAME$1 = "ElSelect";
  25546. const _sfc_main$5 = defineComponent({
  25547. name: COMPONENT_NAME$1,
  25548. componentName: COMPONENT_NAME$1,
  25549. components: {
  25550. ElInput,
  25551. ElSelectMenu,
  25552. ElOption: Option,
  25553. ElOptions,
  25554. ElTag,
  25555. ElScrollbar,
  25556. ElTooltip,
  25557. ElIcon
  25558. },
  25559. directives: { ClickOutside },
  25560. props: {
  25561. name: String,
  25562. id: String,
  25563. modelValue: {
  25564. type: [Array, String, Number, Boolean, Object],
  25565. default: void 0
  25566. },
  25567. autocomplete: {
  25568. type: String,
  25569. default: "off"
  25570. },
  25571. automaticDropdown: Boolean,
  25572. size: {
  25573. type: String,
  25574. validator: isValidComponentSize
  25575. },
  25576. effect: {
  25577. type: String,
  25578. default: "light"
  25579. },
  25580. disabled: Boolean,
  25581. clearable: Boolean,
  25582. filterable: Boolean,
  25583. allowCreate: Boolean,
  25584. loading: Boolean,
  25585. popperClass: {
  25586. type: String,
  25587. default: ""
  25588. },
  25589. popperOptions: {
  25590. type: Object,
  25591. default: () => ({})
  25592. },
  25593. remote: Boolean,
  25594. loadingText: String,
  25595. noMatchText: String,
  25596. noDataText: String,
  25597. remoteMethod: Function,
  25598. filterMethod: Function,
  25599. multiple: Boolean,
  25600. multipleLimit: {
  25601. type: Number,
  25602. default: 0
  25603. },
  25604. placeholder: {
  25605. type: String
  25606. },
  25607. defaultFirstOption: Boolean,
  25608. reserveKeyword: {
  25609. type: Boolean,
  25610. default: true
  25611. },
  25612. valueKey: {
  25613. type: String,
  25614. default: "value"
  25615. },
  25616. collapseTags: Boolean,
  25617. collapseTagsTooltip: {
  25618. type: Boolean,
  25619. default: false
  25620. },
  25621. maxCollapseTags: {
  25622. type: Number,
  25623. default: 1
  25624. },
  25625. teleported: useTooltipContentProps.teleported,
  25626. persistent: {
  25627. type: Boolean,
  25628. default: true
  25629. },
  25630. clearIcon: {
  25631. type: iconPropType,
  25632. default: circle_close_default
  25633. },
  25634. fitInputWidth: {
  25635. type: Boolean,
  25636. default: false
  25637. },
  25638. suffixIcon: {
  25639. type: iconPropType,
  25640. default: arrow_down_default
  25641. },
  25642. tagType: { ...tagProps.type, default: "info" },
  25643. validateEvent: {
  25644. type: Boolean,
  25645. default: true
  25646. },
  25647. remoteShowSuffix: {
  25648. type: Boolean,
  25649. default: false
  25650. },
  25651. suffixTransition: {
  25652. type: Boolean,
  25653. default: true
  25654. },
  25655. placement: {
  25656. type: String,
  25657. values: Ee,
  25658. default: "bottom-start"
  25659. }
  25660. },
  25661. emits: [
  25662. UPDATE_MODEL_EVENT,
  25663. CHANGE_EVENT,
  25664. "remove-tag",
  25665. "clear",
  25666. "visible-change",
  25667. "focus",
  25668. "blur"
  25669. ],
  25670. setup(props, ctx) {
  25671. const nsSelect = useNamespace("select");
  25672. const nsInput = useNamespace("input");
  25673. const { t: t2 } = useLocale();
  25674. const states = useSelectStates(props);
  25675. const {
  25676. optionList,
  25677. optionsArray,
  25678. selectSize,
  25679. readonly: readonly2,
  25680. handleResize,
  25681. collapseTagSize,
  25682. debouncedOnInputChange,
  25683. debouncedQueryChange,
  25684. deletePrevTag,
  25685. deleteTag,
  25686. deleteSelected,
  25687. handleOptionSelect,
  25688. scrollToOption,
  25689. setSelected,
  25690. resetInputHeight,
  25691. managePlaceholder,
  25692. showClose,
  25693. selectDisabled,
  25694. iconComponent,
  25695. iconReverse,
  25696. showNewOption,
  25697. emptyText,
  25698. toggleLastOptionHitState,
  25699. resetInputState,
  25700. handleComposition,
  25701. onOptionCreate,
  25702. onOptionDestroy,
  25703. handleMenuEnter,
  25704. handleFocus,
  25705. blur,
  25706. handleBlur,
  25707. handleClearClick,
  25708. handleClose,
  25709. handleKeydownEscape,
  25710. toggleMenu,
  25711. selectOption,
  25712. getValueKey,
  25713. navigateOptions,
  25714. dropMenuVisible,
  25715. reference,
  25716. input,
  25717. iOSInput,
  25718. tooltipRef,
  25719. tags,
  25720. selectWrapper,
  25721. scrollbar,
  25722. queryChange,
  25723. groupQueryChange,
  25724. handleMouseEnter,
  25725. handleMouseLeave,
  25726. showTagList,
  25727. collapseTagList
  25728. } = useSelect(props, states, ctx);
  25729. const { focus } = useFocus(reference);
  25730. const {
  25731. inputWidth,
  25732. selected,
  25733. inputLength,
  25734. filteredOptionsCount,
  25735. visible,
  25736. softFocus,
  25737. selectedLabel,
  25738. hoverIndex,
  25739. query,
  25740. inputHovering,
  25741. currentPlaceholder,
  25742. menuVisibleOnFocus,
  25743. isOnComposition,
  25744. isSilentBlur,
  25745. options: options2,
  25746. cachedOptions,
  25747. optionsCount,
  25748. prefixWidth,
  25749. tagInMultiLine
  25750. } = toRefs(states);
  25751. const wrapperKls = computed$1(() => {
  25752. const classList = [nsSelect.b()];
  25753. const _selectSize = unref(selectSize);
  25754. if (_selectSize) {
  25755. classList.push(nsSelect.m(_selectSize));
  25756. }
  25757. if (props.disabled) {
  25758. classList.push(nsSelect.m("disabled"));
  25759. }
  25760. return classList;
  25761. });
  25762. const selectTagsStyle = computed$1(() => ({
  25763. maxWidth: `${unref(inputWidth) - 32}px`,
  25764. width: "100%"
  25765. }));
  25766. const tagTextStyle = computed$1(() => {
  25767. const maxWidth = unref(inputWidth) > 123 ? unref(inputWidth) - 123 : unref(inputWidth) - 75;
  25768. return { maxWidth: `${maxWidth}px` };
  25769. });
  25770. provide(selectKey, reactive({
  25771. props,
  25772. options: options2,
  25773. optionsArray,
  25774. cachedOptions,
  25775. optionsCount,
  25776. filteredOptionsCount,
  25777. hoverIndex,
  25778. handleOptionSelect,
  25779. onOptionCreate,
  25780. onOptionDestroy,
  25781. selectWrapper,
  25782. selected,
  25783. setSelected,
  25784. queryChange,
  25785. groupQueryChange
  25786. }));
  25787. onMounted(() => {
  25788. states.cachedPlaceHolder = currentPlaceholder.value = props.placeholder || (() => t2("el.select.placeholder"));
  25789. if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
  25790. currentPlaceholder.value = "";
  25791. }
  25792. useResizeObserver(selectWrapper, handleResize);
  25793. if (props.remote && props.multiple) {
  25794. resetInputHeight();
  25795. }
  25796. nextTick(() => {
  25797. const refEl = reference.value && reference.value.$el;
  25798. if (!refEl)
  25799. return;
  25800. inputWidth.value = refEl.getBoundingClientRect().width;
  25801. if (ctx.slots.prefix) {
  25802. const prefix = refEl.querySelector(`.${nsInput.e("prefix")}`);
  25803. prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 5, 30);
  25804. }
  25805. });
  25806. setSelected();
  25807. });
  25808. if (props.multiple && !Array.isArray(props.modelValue)) {
  25809. ctx.emit(UPDATE_MODEL_EVENT, []);
  25810. }
  25811. if (!props.multiple && Array.isArray(props.modelValue)) {
  25812. ctx.emit(UPDATE_MODEL_EVENT, "");
  25813. }
  25814. const popperPaneRef = computed$1(() => {
  25815. var _a2, _b;
  25816. return (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef;
  25817. });
  25818. const onOptionsRendered = (v) => {
  25819. optionList.value = v;
  25820. };
  25821. return {
  25822. isIOS,
  25823. onOptionsRendered,
  25824. tagInMultiLine,
  25825. prefixWidth,
  25826. selectSize,
  25827. readonly: readonly2,
  25828. handleResize,
  25829. collapseTagSize,
  25830. debouncedOnInputChange,
  25831. debouncedQueryChange,
  25832. deletePrevTag,
  25833. deleteTag,
  25834. deleteSelected,
  25835. handleOptionSelect,
  25836. scrollToOption,
  25837. inputWidth,
  25838. selected,
  25839. inputLength,
  25840. filteredOptionsCount,
  25841. visible,
  25842. softFocus,
  25843. selectedLabel,
  25844. hoverIndex,
  25845. query,
  25846. inputHovering,
  25847. currentPlaceholder,
  25848. menuVisibleOnFocus,
  25849. isOnComposition,
  25850. isSilentBlur,
  25851. options: options2,
  25852. resetInputHeight,
  25853. managePlaceholder,
  25854. showClose,
  25855. selectDisabled,
  25856. iconComponent,
  25857. iconReverse,
  25858. showNewOption,
  25859. emptyText,
  25860. toggleLastOptionHitState,
  25861. resetInputState,
  25862. handleComposition,
  25863. handleMenuEnter,
  25864. handleFocus,
  25865. blur,
  25866. handleBlur,
  25867. handleClearClick,
  25868. handleClose,
  25869. handleKeydownEscape,
  25870. toggleMenu,
  25871. selectOption,
  25872. getValueKey,
  25873. navigateOptions,
  25874. dropMenuVisible,
  25875. focus,
  25876. reference,
  25877. input,
  25878. iOSInput,
  25879. tooltipRef,
  25880. popperPaneRef,
  25881. tags,
  25882. selectWrapper,
  25883. scrollbar,
  25884. wrapperKls,
  25885. selectTagsStyle,
  25886. nsSelect,
  25887. tagTextStyle,
  25888. handleMouseEnter,
  25889. handleMouseLeave,
  25890. showTagList,
  25891. collapseTagList
  25892. };
  25893. }
  25894. });
  25895. const _hoisted_1$4 = ["disabled", "autocomplete"];
  25896. const _hoisted_2$4 = ["disabled"];
  25897. const _hoisted_3$4 = { style: { "height": "100%", "display": "flex", "justify-content": "center", "align-items": "center" } };
  25898. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  25899. const _component_el_tag = resolveComponent("el-tag");
  25900. const _component_el_tooltip = resolveComponent("el-tooltip");
  25901. const _component_el_icon = resolveComponent("el-icon");
  25902. const _component_el_input = resolveComponent("el-input");
  25903. const _component_el_option = resolveComponent("el-option");
  25904. const _component_el_options = resolveComponent("el-options");
  25905. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  25906. const _component_el_select_menu = resolveComponent("el-select-menu");
  25907. const _directive_click_outside = resolveDirective("click-outside");
  25908. return withDirectives((openBlock(), createElementBlock("div", {
  25909. ref: "selectWrapper",
  25910. class: normalizeClass(_ctx.wrapperKls),
  25911. onMouseenter: _cache[21] || (_cache[21] = (...args) => _ctx.handleMouseEnter && _ctx.handleMouseEnter(...args)),
  25912. onMouseleave: _cache[22] || (_cache[22] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args)),
  25913. onClick: _cache[23] || (_cache[23] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  25914. }, [
  25915. createVNode(_component_el_tooltip, {
  25916. ref: "tooltipRef",
  25917. visible: _ctx.dropMenuVisible,
  25918. placement: _ctx.placement,
  25919. teleported: _ctx.teleported,
  25920. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  25921. "popper-options": _ctx.popperOptions,
  25922. "fallback-placements": ["bottom-start", "top-start", "right", "left"],
  25923. effect: _ctx.effect,
  25924. pure: "",
  25925. trigger: "click",
  25926. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  25927. "stop-popper-mouse-event": false,
  25928. "gpu-acceleration": false,
  25929. persistent: _ctx.persistent,
  25930. onShow: _ctx.handleMenuEnter
  25931. }, {
  25932. default: withCtx(() => [
  25933. createElementVNode("div", {
  25934. class: "select-trigger",
  25935. onMouseenter: _cache[19] || (_cache[19] = ($event) => _ctx.inputHovering = true),
  25936. onMouseleave: _cache[20] || (_cache[20] = ($event) => _ctx.inputHovering = false)
  25937. }, [
  25938. _ctx.multiple ? (openBlock(), createElementBlock("div", {
  25939. key: 0,
  25940. ref: "tags",
  25941. class: normalizeClass([
  25942. _ctx.nsSelect.e("tags"),
  25943. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  25944. ]),
  25945. style: normalizeStyle(_ctx.selectTagsStyle)
  25946. }, [
  25947. _ctx.collapseTags && _ctx.selected.length ? (openBlock(), createBlock(Transition, {
  25948. key: 0,
  25949. onAfterLeave: _ctx.resetInputHeight
  25950. }, {
  25951. default: withCtx(() => [
  25952. createElementVNode("span", {
  25953. class: normalizeClass([
  25954. _ctx.nsSelect.b("tags-wrapper"),
  25955. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  25956. ])
  25957. }, [
  25958. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  25959. return openBlock(), createBlock(_component_el_tag, {
  25960. key: _ctx.getValueKey(item),
  25961. closable: !_ctx.selectDisabled && !item.isDisabled,
  25962. size: _ctx.collapseTagSize,
  25963. hit: item.hitState,
  25964. type: _ctx.tagType,
  25965. "disable-transitions": "",
  25966. onClose: ($event) => _ctx.deleteTag($event, item)
  25967. }, {
  25968. default: withCtx(() => [
  25969. createElementVNode("span", {
  25970. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  25971. style: normalizeStyle(_ctx.tagTextStyle)
  25972. }, toDisplayString(item.currentLabel), 7)
  25973. ]),
  25974. _: 2
  25975. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  25976. }), 128)),
  25977. _ctx.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tag, {
  25978. key: 0,
  25979. closable: false,
  25980. size: _ctx.collapseTagSize,
  25981. type: _ctx.tagType,
  25982. "disable-transitions": ""
  25983. }, {
  25984. default: withCtx(() => [
  25985. _ctx.collapseTagsTooltip ? (openBlock(), createBlock(_component_el_tooltip, {
  25986. key: 0,
  25987. disabled: _ctx.dropMenuVisible,
  25988. "fallback-placements": ["bottom", "top", "right", "left"],
  25989. effect: _ctx.effect,
  25990. placement: "bottom",
  25991. teleported: _ctx.teleported
  25992. }, {
  25993. default: withCtx(() => [
  25994. createElementVNode("span", {
  25995. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  25996. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3)
  25997. ]),
  25998. content: withCtx(() => [
  25999. createElementVNode("div", {
  26000. class: normalizeClass(_ctx.nsSelect.e("collapse-tags"))
  26001. }, [
  26002. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
  26003. return openBlock(), createElementBlock("div", {
  26004. key: _ctx.getValueKey(item),
  26005. class: normalizeClass(_ctx.nsSelect.e("collapse-tag"))
  26006. }, [
  26007. createVNode(_component_el_tag, {
  26008. class: "in-tooltip",
  26009. closable: !_ctx.selectDisabled && !item.isDisabled,
  26010. size: _ctx.collapseTagSize,
  26011. hit: item.hitState,
  26012. type: _ctx.tagType,
  26013. "disable-transitions": "",
  26014. style: { margin: "2px" },
  26015. onClose: ($event) => _ctx.deleteTag($event, item)
  26016. }, {
  26017. default: withCtx(() => [
  26018. createElementVNode("span", {
  26019. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26020. style: normalizeStyle({
  26021. maxWidth: _ctx.inputWidth - 75 + "px"
  26022. })
  26023. }, toDisplayString(item.currentLabel), 7)
  26024. ]),
  26025. _: 2
  26026. }, 1032, ["closable", "size", "hit", "type", "onClose"])
  26027. ], 2);
  26028. }), 128))
  26029. ], 2)
  26030. ]),
  26031. _: 1
  26032. }, 8, ["disabled", "effect", "teleported"])) : (openBlock(), createElementBlock("span", {
  26033. key: 1,
  26034. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  26035. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3))
  26036. ]),
  26037. _: 1
  26038. }, 8, ["size", "type"])) : createCommentVNode("v-if", true)
  26039. ], 2)
  26040. ]),
  26041. _: 1
  26042. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26043. !_ctx.collapseTags ? (openBlock(), createBlock(Transition, {
  26044. key: 1,
  26045. onAfterLeave: _ctx.resetInputHeight
  26046. }, {
  26047. default: withCtx(() => [
  26048. createElementVNode("span", {
  26049. class: normalizeClass([
  26050. _ctx.nsSelect.b("tags-wrapper"),
  26051. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  26052. ])
  26053. }, [
  26054. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selected, (item) => {
  26055. return openBlock(), createBlock(_component_el_tag, {
  26056. key: _ctx.getValueKey(item),
  26057. closable: !_ctx.selectDisabled && !item.isDisabled,
  26058. size: _ctx.collapseTagSize,
  26059. hit: item.hitState,
  26060. type: _ctx.tagType,
  26061. "disable-transitions": "",
  26062. onClose: ($event) => _ctx.deleteTag($event, item)
  26063. }, {
  26064. default: withCtx(() => [
  26065. createElementVNode("span", {
  26066. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26067. style: normalizeStyle({ maxWidth: _ctx.inputWidth - 75 + "px" })
  26068. }, toDisplayString(item.currentLabel), 7)
  26069. ]),
  26070. _: 2
  26071. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  26072. }), 128))
  26073. ], 2)
  26074. ]),
  26075. _: 1
  26076. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26077. _ctx.filterable ? withDirectives((openBlock(), createElementBlock("input", {
  26078. key: 2,
  26079. ref: "input",
  26080. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.query = $event),
  26081. type: "text",
  26082. class: normalizeClass([
  26083. _ctx.nsSelect.e("input"),
  26084. _ctx.nsSelect.is(_ctx.selectSize),
  26085. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  26086. ]),
  26087. disabled: _ctx.selectDisabled,
  26088. autocomplete: _ctx.autocomplete,
  26089. style: normalizeStyle({
  26090. marginLeft: _ctx.prefixWidth && !_ctx.selected.length || _ctx.tagInMultiLine ? `${_ctx.prefixWidth}px` : "",
  26091. flexGrow: 1,
  26092. width: `${_ctx.inputLength / (_ctx.inputWidth - 32)}%`,
  26093. maxWidth: `${_ctx.inputWidth - 42}px`
  26094. }),
  26095. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  26096. onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  26097. onKeyup: _cache[3] || (_cache[3] = (...args) => _ctx.managePlaceholder && _ctx.managePlaceholder(...args)),
  26098. onKeydown: [
  26099. _cache[4] || (_cache[4] = (...args) => _ctx.resetInputState && _ctx.resetInputState(...args)),
  26100. _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["prevent"]), ["down"])),
  26101. _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["prevent"]), ["up"])),
  26102. _cache[7] || (_cache[7] = withKeys((...args) => _ctx.handleKeydownEscape && _ctx.handleKeydownEscape(...args), ["esc"])),
  26103. _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.selectOption && _ctx.selectOption(...args), ["stop", "prevent"]), ["enter"])),
  26104. _cache[9] || (_cache[9] = withKeys((...args) => _ctx.deletePrevTag && _ctx.deletePrevTag(...args), ["delete"])),
  26105. _cache[10] || (_cache[10] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26106. ],
  26107. onCompositionstart: _cache[11] || (_cache[11] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26108. onCompositionupdate: _cache[12] || (_cache[12] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26109. onCompositionend: _cache[13] || (_cache[13] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26110. onInput: _cache[14] || (_cache[14] = (...args) => _ctx.debouncedQueryChange && _ctx.debouncedQueryChange(...args))
  26111. }, null, 46, _hoisted_1$4)), [
  26112. [vModelText, _ctx.query]
  26113. ]) : createCommentVNode("v-if", true)
  26114. ], 6)) : createCommentVNode("v-if", true),
  26115. createCommentVNode(" fix: https://github.com/element-plus/element-plus/issues/11415 "),
  26116. _ctx.isIOS && !_ctx.multiple && _ctx.filterable && _ctx.readonly ? (openBlock(), createElementBlock("input", {
  26117. key: 1,
  26118. ref: "iOSInput",
  26119. class: normalizeClass([
  26120. _ctx.nsSelect.e("input"),
  26121. _ctx.nsSelect.is(_ctx.selectSize),
  26122. _ctx.nsSelect.em("input", "iOS")
  26123. ]),
  26124. disabled: _ctx.selectDisabled,
  26125. type: "text"
  26126. }, null, 10, _hoisted_2$4)) : createCommentVNode("v-if", true),
  26127. createVNode(_component_el_input, {
  26128. id: _ctx.id,
  26129. ref: "reference",
  26130. modelValue: _ctx.selectedLabel,
  26131. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.selectedLabel = $event),
  26132. type: "text",
  26133. placeholder: typeof _ctx.currentPlaceholder === "function" ? _ctx.currentPlaceholder() : _ctx.currentPlaceholder,
  26134. name: _ctx.name,
  26135. autocomplete: _ctx.autocomplete,
  26136. size: _ctx.selectSize,
  26137. disabled: _ctx.selectDisabled,
  26138. readonly: _ctx.readonly,
  26139. "validate-event": false,
  26140. class: normalizeClass([_ctx.nsSelect.is("focus", _ctx.visible)]),
  26141. tabindex: _ctx.multiple && _ctx.filterable ? -1 : void 0,
  26142. onFocus: _ctx.handleFocus,
  26143. onBlur: _ctx.handleBlur,
  26144. onInput: _ctx.debouncedOnInputChange,
  26145. onPaste: _ctx.debouncedOnInputChange,
  26146. onCompositionstart: _ctx.handleComposition,
  26147. onCompositionupdate: _ctx.handleComposition,
  26148. onCompositionend: _ctx.handleComposition,
  26149. onKeydown: [
  26150. _cache[16] || (_cache[16] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"])),
  26151. _cache[17] || (_cache[17] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"])),
  26152. withKeys(withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
  26153. withKeys(_ctx.handleKeydownEscape, ["esc"]),
  26154. _cache[18] || (_cache[18] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26155. ]
  26156. }, createSlots({
  26157. suffix: withCtx(() => [
  26158. _ctx.iconComponent && !_ctx.showClose ? (openBlock(), createBlock(_component_el_icon, {
  26159. key: 0,
  26160. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
  26161. }, {
  26162. default: withCtx(() => [
  26163. (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
  26164. ]),
  26165. _: 1
  26166. }, 8, ["class"])) : createCommentVNode("v-if", true),
  26167. _ctx.showClose && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  26168. key: 1,
  26169. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon")]),
  26170. onClick: _ctx.handleClearClick
  26171. }, {
  26172. default: withCtx(() => [
  26173. (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
  26174. ]),
  26175. _: 1
  26176. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  26177. ]),
  26178. _: 2
  26179. }, [
  26180. _ctx.$slots.prefix ? {
  26181. name: "prefix",
  26182. fn: withCtx(() => [
  26183. createElementVNode("div", _hoisted_3$4, [
  26184. renderSlot(_ctx.$slots, "prefix")
  26185. ])
  26186. ])
  26187. } : void 0
  26188. ]), 1032, ["id", "modelValue", "placeholder", "name", "autocomplete", "size", "disabled", "readonly", "class", "tabindex", "onFocus", "onBlur", "onInput", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown"])
  26189. ], 32)
  26190. ]),
  26191. content: withCtx(() => [
  26192. createVNode(_component_el_select_menu, null, {
  26193. default: withCtx(() => [
  26194. withDirectives(createVNode(_component_el_scrollbar, {
  26195. ref: "scrollbar",
  26196. tag: "ul",
  26197. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  26198. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  26199. class: normalizeClass([
  26200. _ctx.nsSelect.is("empty", !_ctx.allowCreate && Boolean(_ctx.query) && _ctx.filteredOptionsCount === 0)
  26201. ])
  26202. }, {
  26203. default: withCtx(() => [
  26204. _ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
  26205. key: 0,
  26206. value: _ctx.query,
  26207. created: true
  26208. }, null, 8, ["value"])) : createCommentVNode("v-if", true),
  26209. createVNode(_component_el_options, { onUpdateOptions: _ctx.onOptionsRendered }, {
  26210. default: withCtx(() => [
  26211. renderSlot(_ctx.$slots, "default")
  26212. ]),
  26213. _: 3
  26214. }, 8, ["onUpdateOptions"])
  26215. ]),
  26216. _: 3
  26217. }, 8, ["wrap-class", "view-class", "class"]), [
  26218. [vShow, _ctx.options.size > 0 && !_ctx.loading]
  26219. ]),
  26220. _ctx.emptyText && (!_ctx.allowCreate || _ctx.loading || _ctx.allowCreate && _ctx.options.size === 0) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  26221. _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }) : (openBlock(), createElementBlock("p", {
  26222. key: 1,
  26223. class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  26224. }, toDisplayString(_ctx.emptyText), 3))
  26225. ], 64)) : createCommentVNode("v-if", true)
  26226. ]),
  26227. _: 3
  26228. })
  26229. ]),
  26230. _: 3
  26231. }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "effect", "transition", "persistent", "onShow"])
  26232. ], 34)), [
  26233. [_directive_click_outside, _ctx.handleClose, _ctx.popperPaneRef]
  26234. ]);
  26235. }
  26236. var Select = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["render", _sfc_render$1], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);
  26237. const _sfc_main$4 = defineComponent({
  26238. name: "ElOptionGroup",
  26239. componentName: "ElOptionGroup",
  26240. props: {
  26241. label: String,
  26242. disabled: {
  26243. type: Boolean,
  26244. default: false
  26245. }
  26246. },
  26247. setup(props) {
  26248. const ns = useNamespace("select");
  26249. const visible = ref(true);
  26250. const instance = getCurrentInstance();
  26251. const children = ref([]);
  26252. provide(selectGroupKey, reactive({
  26253. ...toRefs(props)
  26254. }));
  26255. const select = inject(selectKey);
  26256. onMounted(() => {
  26257. children.value = flattedChildren(instance.subTree);
  26258. });
  26259. const flattedChildren = (node) => {
  26260. const children2 = [];
  26261. if (Array.isArray(node.children)) {
  26262. node.children.forEach((child) => {
  26263. var _a2;
  26264. if (child.type && child.type.name === "ElOption" && child.component && child.component.proxy) {
  26265. children2.push(child.component.proxy);
  26266. } else if ((_a2 = child.children) == null ? void 0 : _a2.length) {
  26267. children2.push(...flattedChildren(child));
  26268. }
  26269. });
  26270. }
  26271. return children2;
  26272. };
  26273. const { groupQueryChange } = toRaw$1(select);
  26274. watch(groupQueryChange, () => {
  26275. visible.value = children.value.some((option) => option.visible === true);
  26276. }, { flush: "post" });
  26277. return {
  26278. visible,
  26279. ns
  26280. };
  26281. }
  26282. });
  26283. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  26284. return withDirectives((openBlock(), createElementBlock("ul", {
  26285. class: normalizeClass(_ctx.ns.be("group", "wrap"))
  26286. }, [
  26287. createElementVNode("li", {
  26288. class: normalizeClass(_ctx.ns.be("group", "title"))
  26289. }, toDisplayString(_ctx.label), 3),
  26290. createElementVNode("li", null, [
  26291. createElementVNode("ul", {
  26292. class: normalizeClass(_ctx.ns.b("group"))
  26293. }, [
  26294. renderSlot(_ctx.$slots, "default")
  26295. ], 2)
  26296. ])
  26297. ], 2)), [
  26298. [vShow, _ctx.visible]
  26299. ]);
  26300. }
  26301. var OptionGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);
  26302. const ElSelect = withInstall(Select, {
  26303. Option,
  26304. OptionGroup
  26305. });
  26306. const ElOption = withNoopInstall(Option);
  26307. withNoopInstall(OptionGroup);
  26308. const switchProps = buildProps({
  26309. modelValue: {
  26310. type: [Boolean, String, Number],
  26311. default: false
  26312. },
  26313. value: {
  26314. type: [Boolean, String, Number],
  26315. default: false
  26316. },
  26317. disabled: {
  26318. type: Boolean,
  26319. default: false
  26320. },
  26321. width: {
  26322. type: [String, Number],
  26323. default: ""
  26324. },
  26325. inlinePrompt: {
  26326. type: Boolean,
  26327. default: false
  26328. },
  26329. activeIcon: {
  26330. type: iconPropType
  26331. },
  26332. inactiveIcon: {
  26333. type: iconPropType
  26334. },
  26335. activeText: {
  26336. type: String,
  26337. default: ""
  26338. },
  26339. inactiveText: {
  26340. type: String,
  26341. default: ""
  26342. },
  26343. activeColor: {
  26344. type: String,
  26345. default: ""
  26346. },
  26347. inactiveColor: {
  26348. type: String,
  26349. default: ""
  26350. },
  26351. borderColor: {
  26352. type: String,
  26353. default: ""
  26354. },
  26355. activeValue: {
  26356. type: [Boolean, String, Number],
  26357. default: true
  26358. },
  26359. inactiveValue: {
  26360. type: [Boolean, String, Number],
  26361. default: false
  26362. },
  26363. name: {
  26364. type: String,
  26365. default: ""
  26366. },
  26367. validateEvent: {
  26368. type: Boolean,
  26369. default: true
  26370. },
  26371. id: String,
  26372. loading: {
  26373. type: Boolean,
  26374. default: false
  26375. },
  26376. beforeChange: {
  26377. type: definePropType(Function)
  26378. },
  26379. size: {
  26380. type: String,
  26381. validator: isValidComponentSize
  26382. },
  26383. tabindex: {
  26384. type: [String, Number]
  26385. }
  26386. });
  26387. const switchEmits = {
  26388. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26389. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26390. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  26391. };
  26392. const _hoisted_1$3 = ["onClick"];
  26393. const _hoisted_2$3 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
  26394. const _hoisted_3$3 = ["aria-hidden"];
  26395. const _hoisted_4$3 = ["aria-hidden"];
  26396. const _hoisted_5$3 = ["aria-hidden"];
  26397. const COMPONENT_NAME = "ElSwitch";
  26398. const __default__ = defineComponent({
  26399. name: COMPONENT_NAME
  26400. });
  26401. const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  26402. ...__default__,
  26403. props: switchProps,
  26404. emits: switchEmits,
  26405. setup(__props, { expose, emit }) {
  26406. const props = __props;
  26407. const vm = getCurrentInstance();
  26408. const { formItem } = useFormItem();
  26409. const switchSize = useFormSize();
  26410. const ns = useNamespace("switch");
  26411. useDeprecated({
  26412. from: '"value"',
  26413. replacement: '"model-value" or "v-model"',
  26414. scope: COMPONENT_NAME,
  26415. version: "2.3.0",
  26416. ref: "https://element-plus.org/en-US/component/switch.html#attributes",
  26417. type: "Attribute"
  26418. }, computed$1(() => {
  26419. var _a2;
  26420. return !!((_a2 = vm.vnode.props) == null ? void 0 : _a2.value);
  26421. }));
  26422. const { inputId } = useFormItemInputId(props, {
  26423. formItemContext: formItem
  26424. });
  26425. const switchDisabled = useFormDisabled(computed$1(() => props.loading));
  26426. const isControlled = ref(props.modelValue !== false);
  26427. const input = ref();
  26428. const core = ref();
  26429. const switchKls = computed$1(() => [
  26430. ns.b(),
  26431. ns.m(switchSize.value),
  26432. ns.is("disabled", switchDisabled.value),
  26433. ns.is("checked", checked.value)
  26434. ]);
  26435. const coreStyle = computed$1(() => ({
  26436. width: addUnit(props.width)
  26437. }));
  26438. watch(() => props.modelValue, () => {
  26439. isControlled.value = true;
  26440. });
  26441. watch(() => props.value, () => {
  26442. isControlled.value = false;
  26443. });
  26444. const actualValue = computed$1(() => {
  26445. return isControlled.value ? props.modelValue : props.value;
  26446. });
  26447. const checked = computed$1(() => actualValue.value === props.activeValue);
  26448. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  26449. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  26450. emit(CHANGE_EVENT, props.inactiveValue);
  26451. emit(INPUT_EVENT, props.inactiveValue);
  26452. }
  26453. watch(checked, (val) => {
  26454. var _a2;
  26455. input.value.checked = val;
  26456. if (props.validateEvent) {
  26457. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  26458. }
  26459. });
  26460. const handleChange = () => {
  26461. const val = checked.value ? props.inactiveValue : props.activeValue;
  26462. emit(UPDATE_MODEL_EVENT, val);
  26463. emit(CHANGE_EVENT, val);
  26464. emit(INPUT_EVENT, val);
  26465. nextTick(() => {
  26466. input.value.checked = checked.value;
  26467. });
  26468. };
  26469. const switchValue = () => {
  26470. if (switchDisabled.value)
  26471. return;
  26472. const { beforeChange } = props;
  26473. if (!beforeChange) {
  26474. handleChange();
  26475. return;
  26476. }
  26477. const shouldChange = beforeChange();
  26478. const isPromiseOrBool = [
  26479. isPromise$2(shouldChange),
  26480. isBoolean(shouldChange)
  26481. ].includes(true);
  26482. if (!isPromiseOrBool) {
  26483. throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
  26484. }
  26485. if (isPromise$2(shouldChange)) {
  26486. shouldChange.then((result) => {
  26487. if (result) {
  26488. handleChange();
  26489. }
  26490. }).catch((e) => {
  26491. });
  26492. } else if (shouldChange) {
  26493. handleChange();
  26494. }
  26495. };
  26496. const styles = computed$1(() => {
  26497. return ns.cssVarBlock({
  26498. ...props.activeColor ? { "on-color": props.activeColor } : null,
  26499. ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
  26500. ...props.borderColor ? { "border-color": props.borderColor } : null
  26501. });
  26502. });
  26503. const focus = () => {
  26504. var _a2, _b;
  26505. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  26506. };
  26507. onMounted(() => {
  26508. input.value.checked = checked.value;
  26509. });
  26510. expose({
  26511. focus,
  26512. checked
  26513. });
  26514. return (_ctx, _cache) => {
  26515. return openBlock(), createElementBlock("div", {
  26516. class: normalizeClass(unref(switchKls)),
  26517. style: normalizeStyle(unref(styles)),
  26518. onClick: withModifiers(switchValue, ["prevent"])
  26519. }, [
  26520. createElementVNode("input", {
  26521. id: unref(inputId),
  26522. ref_key: "input",
  26523. ref: input,
  26524. class: normalizeClass(unref(ns).e("input")),
  26525. type: "checkbox",
  26526. role: "switch",
  26527. "aria-checked": unref(checked),
  26528. "aria-disabled": unref(switchDisabled),
  26529. name: _ctx.name,
  26530. "true-value": _ctx.activeValue,
  26531. "false-value": _ctx.inactiveValue,
  26532. disabled: unref(switchDisabled),
  26533. tabindex: _ctx.tabindex,
  26534. onChange: handleChange,
  26535. onKeydown: withKeys(switchValue, ["enter"])
  26536. }, null, 42, _hoisted_2$3),
  26537. !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
  26538. key: 0,
  26539. class: normalizeClass([
  26540. unref(ns).e("label"),
  26541. unref(ns).em("label", "left"),
  26542. unref(ns).is("active", !unref(checked))
  26543. ])
  26544. }, [
  26545. _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26546. default: withCtx(() => [
  26547. (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
  26548. ]),
  26549. _: 1
  26550. })) : createCommentVNode("v-if", true),
  26551. !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26552. key: 1,
  26553. "aria-hidden": unref(checked)
  26554. }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3$3)) : createCommentVNode("v-if", true)
  26555. ], 2)) : createCommentVNode("v-if", true),
  26556. createElementVNode("span", {
  26557. ref_key: "core",
  26558. ref: core,
  26559. class: normalizeClass(unref(ns).e("core")),
  26560. style: normalizeStyle(unref(coreStyle))
  26561. }, [
  26562. _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
  26563. key: 0,
  26564. class: normalizeClass(unref(ns).e("inner"))
  26565. }, [
  26566. _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
  26567. key: 0,
  26568. class: normalizeClass(unref(ns).is("icon"))
  26569. }, {
  26570. default: withCtx(() => [
  26571. (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
  26572. ]),
  26573. _: 1
  26574. }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26575. key: 1,
  26576. class: normalizeClass(unref(ns).is("text")),
  26577. "aria-hidden": !unref(checked)
  26578. }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4$3)) : createCommentVNode("v-if", true)
  26579. ], 2)) : createCommentVNode("v-if", true),
  26580. createElementVNode("div", {
  26581. class: normalizeClass(unref(ns).e("action"))
  26582. }, [
  26583. _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
  26584. key: 0,
  26585. class: normalizeClass(unref(ns).is("loading"))
  26586. }, {
  26587. default: withCtx(() => [
  26588. createVNode(unref(loading_default))
  26589. ]),
  26590. _: 1
  26591. }, 8, ["class"])) : createCommentVNode("v-if", true)
  26592. ], 2)
  26593. ], 6),
  26594. !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
  26595. key: 1,
  26596. class: normalizeClass([
  26597. unref(ns).e("label"),
  26598. unref(ns).em("label", "right"),
  26599. unref(ns).is("active", unref(checked))
  26600. ])
  26601. }, [
  26602. _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26603. default: withCtx(() => [
  26604. (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
  26605. ]),
  26606. _: 1
  26607. })) : createCommentVNode("v-if", true),
  26608. !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
  26609. key: 1,
  26610. "aria-hidden": !unref(checked)
  26611. }, toDisplayString(_ctx.activeText), 9, _hoisted_5$3)) : createCommentVNode("v-if", true)
  26612. ], 2)) : createCommentVNode("v-if", true)
  26613. ], 14, _hoisted_1$3);
  26614. };
  26615. }
  26616. });
  26617. var Switch = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);
  26618. const ElSwitch = withInstall(Switch);
  26619. /*! Element Plus v2.3.4 */
  26620. var zhCn = {
  26621. name: "zh-cn",
  26622. el: {
  26623. colorpicker: {
  26624. confirm: "\u786E\u5B9A",
  26625. clear: "\u6E05\u7A7A"
  26626. },
  26627. datepicker: {
  26628. now: "\u6B64\u523B",
  26629. today: "\u4ECA\u5929",
  26630. cancel: "\u53D6\u6D88",
  26631. clear: "\u6E05\u7A7A",
  26632. confirm: "\u786E\u5B9A",
  26633. selectDate: "\u9009\u62E9\u65E5\u671F",
  26634. selectTime: "\u9009\u62E9\u65F6\u95F4",
  26635. startDate: "\u5F00\u59CB\u65E5\u671F",
  26636. startTime: "\u5F00\u59CB\u65F6\u95F4",
  26637. endDate: "\u7ED3\u675F\u65E5\u671F",
  26638. endTime: "\u7ED3\u675F\u65F6\u95F4",
  26639. prevYear: "\u524D\u4E00\u5E74",
  26640. nextYear: "\u540E\u4E00\u5E74",
  26641. prevMonth: "\u4E0A\u4E2A\u6708",
  26642. nextMonth: "\u4E0B\u4E2A\u6708",
  26643. year: "\u5E74",
  26644. month1: "1 \u6708",
  26645. month2: "2 \u6708",
  26646. month3: "3 \u6708",
  26647. month4: "4 \u6708",
  26648. month5: "5 \u6708",
  26649. month6: "6 \u6708",
  26650. month7: "7 \u6708",
  26651. month8: "8 \u6708",
  26652. month9: "9 \u6708",
  26653. month10: "10 \u6708",
  26654. month11: "11 \u6708",
  26655. month12: "12 \u6708",
  26656. weeks: {
  26657. sun: "\u65E5",
  26658. mon: "\u4E00",
  26659. tue: "\u4E8C",
  26660. wed: "\u4E09",
  26661. thu: "\u56DB",
  26662. fri: "\u4E94",
  26663. sat: "\u516D"
  26664. },
  26665. months: {
  26666. jan: "\u4E00\u6708",
  26667. feb: "\u4E8C\u6708",
  26668. mar: "\u4E09\u6708",
  26669. apr: "\u56DB\u6708",
  26670. may: "\u4E94\u6708",
  26671. jun: "\u516D\u6708",
  26672. jul: "\u4E03\u6708",
  26673. aug: "\u516B\u6708",
  26674. sep: "\u4E5D\u6708",
  26675. oct: "\u5341\u6708",
  26676. nov: "\u5341\u4E00\u6708",
  26677. dec: "\u5341\u4E8C\u6708"
  26678. }
  26679. },
  26680. select: {
  26681. loading: "\u52A0\u8F7D\u4E2D",
  26682. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26683. noData: "\u65E0\u6570\u636E",
  26684. placeholder: "\u8BF7\u9009\u62E9"
  26685. },
  26686. cascader: {
  26687. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26688. loading: "\u52A0\u8F7D\u4E2D",
  26689. placeholder: "\u8BF7\u9009\u62E9",
  26690. noData: "\u6682\u65E0\u6570\u636E"
  26691. },
  26692. pagination: {
  26693. goto: "\u524D\u5F80",
  26694. pagesize: "\u6761/\u9875",
  26695. total: "\u5171 {total} \u6761",
  26696. pageClassifier: "\u9875",
  26697. page: "\u9875",
  26698. prev: "\u4E0A\u4E00\u9875",
  26699. next: "\u4E0B\u4E00\u9875",
  26700. currentPage: "\u7B2C {pager} \u9875",
  26701. prevPages: "\u5411\u524D {pager} \u9875",
  26702. nextPages: "\u5411\u540E {pager} \u9875",
  26703. deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
  26704. },
  26705. messagebox: {
  26706. title: "\u63D0\u793A",
  26707. confirm: "\u786E\u5B9A",
  26708. cancel: "\u53D6\u6D88",
  26709. error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
  26710. },
  26711. upload: {
  26712. deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
  26713. delete: "\u5220\u9664",
  26714. preview: "\u67E5\u770B\u56FE\u7247",
  26715. continue: "\u7EE7\u7EED\u4E0A\u4F20"
  26716. },
  26717. table: {
  26718. emptyText: "\u6682\u65E0\u6570\u636E",
  26719. confirmFilter: "\u7B5B\u9009",
  26720. resetFilter: "\u91CD\u7F6E",
  26721. clearFilter: "\u5168\u90E8",
  26722. sumText: "\u5408\u8BA1"
  26723. },
  26724. tree: {
  26725. emptyText: "\u6682\u65E0\u6570\u636E"
  26726. },
  26727. transfer: {
  26728. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26729. noData: "\u65E0\u6570\u636E",
  26730. titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
  26731. filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
  26732. noCheckedFormat: "\u5171 {total} \u9879",
  26733. hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
  26734. },
  26735. image: {
  26736. error: "\u52A0\u8F7D\u5931\u8D25"
  26737. },
  26738. pageHeader: {
  26739. title: "\u8FD4\u56DE"
  26740. },
  26741. popconfirm: {
  26742. confirmButtonText: "\u786E\u5B9A",
  26743. cancelButtonText: "\u53D6\u6D88"
  26744. }
  26745. }
  26746. };
  26747. /*! Element Plus v2.3.4 */
  26748. var en = {
  26749. name: "en",
  26750. el: {
  26751. colorpicker: {
  26752. confirm: "OK",
  26753. clear: "Clear",
  26754. defaultLabel: "color picker",
  26755. description: "current color is {color}. press enter to select a new color."
  26756. },
  26757. datepicker: {
  26758. now: "Now",
  26759. today: "Today",
  26760. cancel: "Cancel",
  26761. clear: "Clear",
  26762. confirm: "OK",
  26763. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  26764. monthTablePrompt: "Use the arrow keys and enter to select the month",
  26765. yearTablePrompt: "Use the arrow keys and enter to select the year",
  26766. selectedDate: "Selected date",
  26767. selectDate: "Select date",
  26768. selectTime: "Select time",
  26769. startDate: "Start Date",
  26770. startTime: "Start Time",
  26771. endDate: "End Date",
  26772. endTime: "End Time",
  26773. prevYear: "Previous Year",
  26774. nextYear: "Next Year",
  26775. prevMonth: "Previous Month",
  26776. nextMonth: "Next Month",
  26777. year: "",
  26778. month1: "January",
  26779. month2: "February",
  26780. month3: "March",
  26781. month4: "April",
  26782. month5: "May",
  26783. month6: "June",
  26784. month7: "July",
  26785. month8: "August",
  26786. month9: "September",
  26787. month10: "October",
  26788. month11: "November",
  26789. month12: "December",
  26790. week: "week",
  26791. weeks: {
  26792. sun: "Sun",
  26793. mon: "Mon",
  26794. tue: "Tue",
  26795. wed: "Wed",
  26796. thu: "Thu",
  26797. fri: "Fri",
  26798. sat: "Sat"
  26799. },
  26800. weeksFull: {
  26801. sun: "Sunday",
  26802. mon: "Monday",
  26803. tue: "Tuesday",
  26804. wed: "Wednesday",
  26805. thu: "Thursday",
  26806. fri: "Friday",
  26807. sat: "Saturday"
  26808. },
  26809. months: {
  26810. jan: "Jan",
  26811. feb: "Feb",
  26812. mar: "Mar",
  26813. apr: "Apr",
  26814. may: "May",
  26815. jun: "Jun",
  26816. jul: "Jul",
  26817. aug: "Aug",
  26818. sep: "Sep",
  26819. oct: "Oct",
  26820. nov: "Nov",
  26821. dec: "Dec"
  26822. }
  26823. },
  26824. inputNumber: {
  26825. decrease: "decrease number",
  26826. increase: "increase number"
  26827. },
  26828. select: {
  26829. loading: "Loading",
  26830. noMatch: "No matching data",
  26831. noData: "No data",
  26832. placeholder: "Select"
  26833. },
  26834. dropdown: {
  26835. toggleDropdown: "Toggle Dropdown"
  26836. },
  26837. cascader: {
  26838. noMatch: "No matching data",
  26839. loading: "Loading",
  26840. placeholder: "Select",
  26841. noData: "No data"
  26842. },
  26843. pagination: {
  26844. goto: "Go to",
  26845. pagesize: "/page",
  26846. total: "Total {total}",
  26847. pageClassifier: "",
  26848. page: "Page",
  26849. prev: "Go to previous page",
  26850. next: "Go to next page",
  26851. currentPage: "page {pager}",
  26852. prevPages: "Previous {pager} pages",
  26853. nextPages: "Next {pager} pages",
  26854. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  26855. },
  26856. dialog: {
  26857. close: "Close this dialog"
  26858. },
  26859. drawer: {
  26860. close: "Close this dialog"
  26861. },
  26862. messagebox: {
  26863. title: "Message",
  26864. confirm: "OK",
  26865. cancel: "Cancel",
  26866. error: "Illegal input",
  26867. close: "Close this dialog"
  26868. },
  26869. upload: {
  26870. deleteTip: "press delete to remove",
  26871. delete: "Delete",
  26872. preview: "Preview",
  26873. continue: "Continue"
  26874. },
  26875. slider: {
  26876. defaultLabel: "slider between {min} and {max}",
  26877. defaultRangeStartLabel: "pick start value",
  26878. defaultRangeEndLabel: "pick end value"
  26879. },
  26880. table: {
  26881. emptyText: "No Data",
  26882. confirmFilter: "Confirm",
  26883. resetFilter: "Reset",
  26884. clearFilter: "All",
  26885. sumText: "Sum"
  26886. },
  26887. tree: {
  26888. emptyText: "No Data"
  26889. },
  26890. transfer: {
  26891. noMatch: "No matching data",
  26892. noData: "No data",
  26893. titles: ["List 1", "List 2"],
  26894. filterPlaceholder: "Enter keyword",
  26895. noCheckedFormat: "{total} items",
  26896. hasCheckedFormat: "{checked}/{total} checked"
  26897. },
  26898. image: {
  26899. error: "FAILED"
  26900. },
  26901. pageHeader: {
  26902. title: "Back"
  26903. },
  26904. popconfirm: {
  26905. confirmButtonText: "Yes",
  26906. cancelButtonText: "No"
  26907. }
  26908. }
  26909. };
  26910. var jquery = { exports: {} };
  26911. /*!
  26912. * jQuery JavaScript Library v3.7.0
  26913. * https://jquery.com/
  26914. *
  26915. * Copyright OpenJS Foundation and other contributors
  26916. * Released under the MIT license
  26917. * https://jquery.org/license
  26918. *
  26919. * Date: 2023-05-11T18:29Z
  26920. */
  26921. (function(module2) {
  26922. (function(global2, factory3) {
  26923. {
  26924. module2.exports = global2.document ? factory3(global2, true) : function(w) {
  26925. if (!w.document) {
  26926. throw new Error("jQuery requires a window with a document");
  26927. }
  26928. return factory3(w);
  26929. };
  26930. }
  26931. })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
  26932. var arr = [];
  26933. var getProto = Object.getPrototypeOf;
  26934. var slice = arr.slice;
  26935. var flat2 = arr.flat ? function(array) {
  26936. return arr.flat.call(array);
  26937. } : function(array) {
  26938. return arr.concat.apply([], array);
  26939. };
  26940. var push = arr.push;
  26941. var indexOf = arr.indexOf;
  26942. var class2type = {};
  26943. var toString2 = class2type.toString;
  26944. var hasOwn2 = class2type.hasOwnProperty;
  26945. var fnToString = hasOwn2.toString;
  26946. var ObjectFunctionString = fnToString.call(Object);
  26947. var support = {};
  26948. var isFunction2 = function isFunction3(obj) {
  26949. return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
  26950. };
  26951. var isWindow = function isWindow2(obj) {
  26952. return obj != null && obj === obj.window;
  26953. };
  26954. var document2 = window2.document;
  26955. var preservedScriptAttributes = {
  26956. type: true,
  26957. src: true,
  26958. nonce: true,
  26959. noModule: true
  26960. };
  26961. function DOMEval(code, node, doc) {
  26962. doc = doc || document2;
  26963. var i2, val, script = doc.createElement("script");
  26964. script.text = code;
  26965. if (node) {
  26966. for (i2 in preservedScriptAttributes) {
  26967. val = node[i2] || node.getAttribute && node.getAttribute(i2);
  26968. if (val) {
  26969. script.setAttribute(i2, val);
  26970. }
  26971. }
  26972. }
  26973. doc.head.appendChild(script).parentNode.removeChild(script);
  26974. }
  26975. function toType(obj) {
  26976. if (obj == null) {
  26977. return obj + "";
  26978. }
  26979. return typeof obj === "object" || typeof obj === "function" ? class2type[toString2.call(obj)] || "object" : typeof obj;
  26980. }
  26981. var version2 = "3.7.0", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
  26982. return new jQuery.fn.init(selector, context);
  26983. };
  26984. jQuery.fn = jQuery.prototype = {
  26985. jquery: version2,
  26986. constructor: jQuery,
  26987. length: 0,
  26988. toArray: function() {
  26989. return slice.call(this);
  26990. },
  26991. get: function(num) {
  26992. if (num == null) {
  26993. return slice.call(this);
  26994. }
  26995. return num < 0 ? this[num + this.length] : this[num];
  26996. },
  26997. pushStack: function(elems) {
  26998. var ret = jQuery.merge(this.constructor(), elems);
  26999. ret.prevObject = this;
  27000. return ret;
  27001. },
  27002. each: function(callback2) {
  27003. return jQuery.each(this, callback2);
  27004. },
  27005. map: function(callback2) {
  27006. return this.pushStack(jQuery.map(this, function(elem, i2) {
  27007. return callback2.call(elem, i2, elem);
  27008. }));
  27009. },
  27010. slice: function() {
  27011. return this.pushStack(slice.apply(this, arguments));
  27012. },
  27013. first: function() {
  27014. return this.eq(0);
  27015. },
  27016. last: function() {
  27017. return this.eq(-1);
  27018. },
  27019. even: function() {
  27020. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27021. return (i2 + 1) % 2;
  27022. }));
  27023. },
  27024. odd: function() {
  27025. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27026. return i2 % 2;
  27027. }));
  27028. },
  27029. eq: function(i2) {
  27030. var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
  27031. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  27032. },
  27033. end: function() {
  27034. return this.prevObject || this.constructor();
  27035. },
  27036. push,
  27037. sort: arr.sort,
  27038. splice: arr.splice
  27039. };
  27040. jQuery.extend = jQuery.fn.extend = function() {
  27041. var options2, name, src, copy2, copyIsArray, clone, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
  27042. if (typeof target === "boolean") {
  27043. deep = target;
  27044. target = arguments[i2] || {};
  27045. i2++;
  27046. }
  27047. if (typeof target !== "object" && !isFunction2(target)) {
  27048. target = {};
  27049. }
  27050. if (i2 === length) {
  27051. target = this;
  27052. i2--;
  27053. }
  27054. for (; i2 < length; i2++) {
  27055. if ((options2 = arguments[i2]) != null) {
  27056. for (name in options2) {
  27057. copy2 = options2[name];
  27058. if (name === "__proto__" || target === copy2) {
  27059. continue;
  27060. }
  27061. if (deep && copy2 && (jQuery.isPlainObject(copy2) || (copyIsArray = Array.isArray(copy2)))) {
  27062. src = target[name];
  27063. if (copyIsArray && !Array.isArray(src)) {
  27064. clone = [];
  27065. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  27066. clone = {};
  27067. } else {
  27068. clone = src;
  27069. }
  27070. copyIsArray = false;
  27071. target[name] = jQuery.extend(deep, clone, copy2);
  27072. } else if (copy2 !== void 0) {
  27073. target[name] = copy2;
  27074. }
  27075. }
  27076. }
  27077. }
  27078. return target;
  27079. };
  27080. jQuery.extend({
  27081. expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
  27082. isReady: true,
  27083. error: function(msg) {
  27084. throw new Error(msg);
  27085. },
  27086. noop: function() {
  27087. },
  27088. isPlainObject: function(obj) {
  27089. var proto, Ctor;
  27090. if (!obj || toString2.call(obj) !== "[object Object]") {
  27091. return false;
  27092. }
  27093. proto = getProto(obj);
  27094. if (!proto) {
  27095. return true;
  27096. }
  27097. Ctor = hasOwn2.call(proto, "constructor") && proto.constructor;
  27098. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  27099. },
  27100. isEmptyObject: function(obj) {
  27101. var name;
  27102. for (name in obj) {
  27103. return false;
  27104. }
  27105. return true;
  27106. },
  27107. globalEval: function(code, options2, doc) {
  27108. DOMEval(code, { nonce: options2 && options2.nonce }, doc);
  27109. },
  27110. each: function(obj, callback2) {
  27111. var length, i2 = 0;
  27112. if (isArrayLike2(obj)) {
  27113. length = obj.length;
  27114. for (; i2 < length; i2++) {
  27115. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27116. break;
  27117. }
  27118. }
  27119. } else {
  27120. for (i2 in obj) {
  27121. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27122. break;
  27123. }
  27124. }
  27125. }
  27126. return obj;
  27127. },
  27128. text: function(elem) {
  27129. var node, ret = "", i2 = 0, nodeType = elem.nodeType;
  27130. if (!nodeType) {
  27131. while (node = elem[i2++]) {
  27132. ret += jQuery.text(node);
  27133. }
  27134. } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  27135. return elem.textContent;
  27136. } else if (nodeType === 3 || nodeType === 4) {
  27137. return elem.nodeValue;
  27138. }
  27139. return ret;
  27140. },
  27141. makeArray: function(arr2, results) {
  27142. var ret = results || [];
  27143. if (arr2 != null) {
  27144. if (isArrayLike2(Object(arr2))) {
  27145. jQuery.merge(
  27146. ret,
  27147. typeof arr2 === "string" ? [arr2] : arr2
  27148. );
  27149. } else {
  27150. push.call(ret, arr2);
  27151. }
  27152. }
  27153. return ret;
  27154. },
  27155. inArray: function(elem, arr2, i2) {
  27156. return arr2 == null ? -1 : indexOf.call(arr2, elem, i2);
  27157. },
  27158. isXMLDoc: function(elem) {
  27159. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  27160. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  27161. },
  27162. merge: function(first, second) {
  27163. var len = +second.length, j = 0, i2 = first.length;
  27164. for (; j < len; j++) {
  27165. first[i2++] = second[j];
  27166. }
  27167. first.length = i2;
  27168. return first;
  27169. },
  27170. grep: function(elems, callback2, invert) {
  27171. var callbackInverse, matches = [], i2 = 0, length = elems.length, callbackExpect = !invert;
  27172. for (; i2 < length; i2++) {
  27173. callbackInverse = !callback2(elems[i2], i2);
  27174. if (callbackInverse !== callbackExpect) {
  27175. matches.push(elems[i2]);
  27176. }
  27177. }
  27178. return matches;
  27179. },
  27180. map: function(elems, callback2, arg) {
  27181. var length, value, i2 = 0, ret = [];
  27182. if (isArrayLike2(elems)) {
  27183. length = elems.length;
  27184. for (; i2 < length; i2++) {
  27185. value = callback2(elems[i2], i2, arg);
  27186. if (value != null) {
  27187. ret.push(value);
  27188. }
  27189. }
  27190. } else {
  27191. for (i2 in elems) {
  27192. value = callback2(elems[i2], i2, arg);
  27193. if (value != null) {
  27194. ret.push(value);
  27195. }
  27196. }
  27197. }
  27198. return flat2(ret);
  27199. },
  27200. guid: 1,
  27201. support
  27202. });
  27203. if (typeof Symbol === "function") {
  27204. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  27205. }
  27206. jQuery.each(
  27207. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  27208. function(_i, name) {
  27209. class2type["[object " + name + "]"] = name.toLowerCase();
  27210. }
  27211. );
  27212. function isArrayLike2(obj) {
  27213. var length = !!obj && "length" in obj && obj.length, type2 = toType(obj);
  27214. if (isFunction2(obj) || isWindow(obj)) {
  27215. return false;
  27216. }
  27217. return type2 === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  27218. }
  27219. function nodeName(elem, name) {
  27220. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  27221. }
  27222. var pop = arr.pop;
  27223. var sort = arr.sort;
  27224. var splice2 = arr.splice;
  27225. var whitespace = "[\\x20\\t\\r\\n\\f]";
  27226. var rtrimCSS = new RegExp(
  27227. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  27228. "g"
  27229. );
  27230. jQuery.contains = function(a, b) {
  27231. var bup = b && b.parentNode;
  27232. return a === bup || !!(bup && bup.nodeType === 1 && (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  27233. };
  27234. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  27235. function fcssescape(ch, asCodePoint) {
  27236. if (asCodePoint) {
  27237. if (ch === "\0") {
  27238. return "\uFFFD";
  27239. }
  27240. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  27241. }
  27242. return "\\" + ch;
  27243. }
  27244. jQuery.escapeSelector = function(sel) {
  27245. return (sel + "").replace(rcssescape, fcssescape);
  27246. };
  27247. var preferredDoc = document2, pushNative = push;
  27248. (function() {
  27249. var i2, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
  27250. if (a === b) {
  27251. hasDuplicate = true;
  27252. }
  27253. return 0;
  27254. }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
  27255. ID: new RegExp("^#(" + identifier + ")"),
  27256. CLASS: new RegExp("^\\.(" + identifier + ")"),
  27257. TAG: new RegExp("^(" + identifier + "|[*])"),
  27258. ATTR: new RegExp("^" + attributes),
  27259. PSEUDO: new RegExp("^" + pseudos),
  27260. CHILD: new RegExp(
  27261. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  27262. "i"
  27263. ),
  27264. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  27265. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  27266. }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape2, nonHex) {
  27267. var high = "0x" + escape2.slice(1) - 65536;
  27268. if (nonHex) {
  27269. return nonHex;
  27270. }
  27271. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  27272. }, unloadHandler = function() {
  27273. setDocument();
  27274. }, inDisabledFieldset = addCombinator(
  27275. function(elem) {
  27276. return elem.disabled === true && nodeName(elem, "fieldset");
  27277. },
  27278. { dir: "parentNode", next: "legend" }
  27279. );
  27280. function safeActiveElement() {
  27281. try {
  27282. return document3.activeElement;
  27283. } catch (err) {
  27284. }
  27285. }
  27286. try {
  27287. push2.apply(
  27288. arr = slice.call(preferredDoc.childNodes),
  27289. preferredDoc.childNodes
  27290. );
  27291. arr[preferredDoc.childNodes.length].nodeType;
  27292. } catch (e) {
  27293. push2 = {
  27294. apply: function(target, els) {
  27295. pushNative.apply(target, slice.call(els));
  27296. },
  27297. call: function(target) {
  27298. pushNative.apply(target, slice.call(arguments, 1));
  27299. }
  27300. };
  27301. }
  27302. function find2(selector, context, results, seed) {
  27303. var m, i3, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  27304. results = results || [];
  27305. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  27306. return results;
  27307. }
  27308. if (!seed) {
  27309. setDocument(context);
  27310. context = context || document3;
  27311. if (documentIsHTML) {
  27312. if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
  27313. if (m = match[1]) {
  27314. if (nodeType === 9) {
  27315. if (elem = context.getElementById(m)) {
  27316. if (elem.id === m) {
  27317. push2.call(results, elem);
  27318. return results;
  27319. }
  27320. } else {
  27321. return results;
  27322. }
  27323. } else {
  27324. if (newContext && (elem = newContext.getElementById(m)) && find2.contains(context, elem) && elem.id === m) {
  27325. push2.call(results, elem);
  27326. return results;
  27327. }
  27328. }
  27329. } else if (match[2]) {
  27330. push2.apply(results, context.getElementsByTagName(selector));
  27331. return results;
  27332. } else if ((m = match[3]) && context.getElementsByClassName) {
  27333. push2.apply(results, context.getElementsByClassName(m));
  27334. return results;
  27335. }
  27336. }
  27337. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  27338. newSelector = selector;
  27339. newContext = context;
  27340. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  27341. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  27342. if (newContext != context || !support.scope) {
  27343. if (nid = context.getAttribute("id")) {
  27344. nid = jQuery.escapeSelector(nid);
  27345. } else {
  27346. context.setAttribute("id", nid = expando);
  27347. }
  27348. }
  27349. groups = tokenize(selector);
  27350. i3 = groups.length;
  27351. while (i3--) {
  27352. groups[i3] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i3]);
  27353. }
  27354. newSelector = groups.join(",");
  27355. }
  27356. try {
  27357. push2.apply(
  27358. results,
  27359. newContext.querySelectorAll(newSelector)
  27360. );
  27361. return results;
  27362. } catch (qsaError) {
  27363. nonnativeSelectorCache(selector, true);
  27364. } finally {
  27365. if (nid === expando) {
  27366. context.removeAttribute("id");
  27367. }
  27368. }
  27369. }
  27370. }
  27371. }
  27372. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  27373. }
  27374. function createCache() {
  27375. var keys3 = [];
  27376. function cache(key, value) {
  27377. if (keys3.push(key + " ") > Expr.cacheLength) {
  27378. delete cache[keys3.shift()];
  27379. }
  27380. return cache[key + " "] = value;
  27381. }
  27382. return cache;
  27383. }
  27384. function markFunction(fn2) {
  27385. fn2[expando] = true;
  27386. return fn2;
  27387. }
  27388. function assert(fn2) {
  27389. var el = document3.createElement("fieldset");
  27390. try {
  27391. return !!fn2(el);
  27392. } catch (e) {
  27393. return false;
  27394. } finally {
  27395. if (el.parentNode) {
  27396. el.parentNode.removeChild(el);
  27397. }
  27398. el = null;
  27399. }
  27400. }
  27401. function createInputPseudo(type2) {
  27402. return function(elem) {
  27403. return nodeName(elem, "input") && elem.type === type2;
  27404. };
  27405. }
  27406. function createButtonPseudo(type2) {
  27407. return function(elem) {
  27408. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type2;
  27409. };
  27410. }
  27411. function createDisabledPseudo(disabled) {
  27412. return function(elem) {
  27413. if ("form" in elem) {
  27414. if (elem.parentNode && elem.disabled === false) {
  27415. if ("label" in elem) {
  27416. if ("label" in elem.parentNode) {
  27417. return elem.parentNode.disabled === disabled;
  27418. } else {
  27419. return elem.disabled === disabled;
  27420. }
  27421. }
  27422. return elem.isDisabled === disabled || elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  27423. }
  27424. return elem.disabled === disabled;
  27425. } else if ("label" in elem) {
  27426. return elem.disabled === disabled;
  27427. }
  27428. return false;
  27429. };
  27430. }
  27431. function createPositionalPseudo(fn2) {
  27432. return markFunction(function(argument) {
  27433. argument = +argument;
  27434. return markFunction(function(seed, matches2) {
  27435. var j, matchIndexes = fn2([], seed.length, argument), i3 = matchIndexes.length;
  27436. while (i3--) {
  27437. if (seed[j = matchIndexes[i3]]) {
  27438. seed[j] = !(matches2[j] = seed[j]);
  27439. }
  27440. }
  27441. });
  27442. });
  27443. }
  27444. function testContext(context) {
  27445. return context && typeof context.getElementsByTagName !== "undefined" && context;
  27446. }
  27447. function setDocument(node) {
  27448. var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
  27449. if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
  27450. return document3;
  27451. }
  27452. document3 = doc;
  27453. documentElement2 = document3.documentElement;
  27454. documentIsHTML = !jQuery.isXMLDoc(document3);
  27455. matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
  27456. if (preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
  27457. subWindow.addEventListener("unload", unloadHandler);
  27458. }
  27459. support.getById = assert(function(el) {
  27460. documentElement2.appendChild(el).id = jQuery.expando;
  27461. return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
  27462. });
  27463. support.disconnectedMatch = assert(function(el) {
  27464. return matches.call(el, "*");
  27465. });
  27466. support.scope = assert(function() {
  27467. return document3.querySelectorAll(":scope");
  27468. });
  27469. support.cssHas = assert(function() {
  27470. try {
  27471. document3.querySelector(":has(*,:jqfake)");
  27472. return false;
  27473. } catch (e) {
  27474. return true;
  27475. }
  27476. });
  27477. if (support.getById) {
  27478. Expr.filter.ID = function(id) {
  27479. var attrId = id.replace(runescape, funescape);
  27480. return function(elem) {
  27481. return elem.getAttribute("id") === attrId;
  27482. };
  27483. };
  27484. Expr.find.ID = function(id, context) {
  27485. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27486. var elem = context.getElementById(id);
  27487. return elem ? [elem] : [];
  27488. }
  27489. };
  27490. } else {
  27491. Expr.filter.ID = function(id) {
  27492. var attrId = id.replace(runescape, funescape);
  27493. return function(elem) {
  27494. var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  27495. return node2 && node2.value === attrId;
  27496. };
  27497. };
  27498. Expr.find.ID = function(id, context) {
  27499. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27500. var node2, i3, elems, elem = context.getElementById(id);
  27501. if (elem) {
  27502. node2 = elem.getAttributeNode("id");
  27503. if (node2 && node2.value === id) {
  27504. return [elem];
  27505. }
  27506. elems = context.getElementsByName(id);
  27507. i3 = 0;
  27508. while (elem = elems[i3++]) {
  27509. node2 = elem.getAttributeNode("id");
  27510. if (node2 && node2.value === id) {
  27511. return [elem];
  27512. }
  27513. }
  27514. }
  27515. return [];
  27516. }
  27517. };
  27518. }
  27519. Expr.find.TAG = function(tag, context) {
  27520. if (typeof context.getElementsByTagName !== "undefined") {
  27521. return context.getElementsByTagName(tag);
  27522. } else {
  27523. return context.querySelectorAll(tag);
  27524. }
  27525. };
  27526. Expr.find.CLASS = function(className, context) {
  27527. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  27528. return context.getElementsByClassName(className);
  27529. }
  27530. };
  27531. rbuggyQSA = [];
  27532. assert(function(el) {
  27533. var input;
  27534. documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
  27535. if (!el.querySelectorAll("[selected]").length) {
  27536. rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
  27537. }
  27538. if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
  27539. rbuggyQSA.push("~=");
  27540. }
  27541. if (!el.querySelectorAll("a#" + expando + "+*").length) {
  27542. rbuggyQSA.push(".#.+[+~]");
  27543. }
  27544. if (!el.querySelectorAll(":checked").length) {
  27545. rbuggyQSA.push(":checked");
  27546. }
  27547. input = document3.createElement("input");
  27548. input.setAttribute("type", "hidden");
  27549. el.appendChild(input).setAttribute("name", "D");
  27550. documentElement2.appendChild(el).disabled = true;
  27551. if (el.querySelectorAll(":disabled").length !== 2) {
  27552. rbuggyQSA.push(":enabled", ":disabled");
  27553. }
  27554. input = document3.createElement("input");
  27555. input.setAttribute("name", "");
  27556. el.appendChild(input);
  27557. if (!el.querySelectorAll("[name='']").length) {
  27558. rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
  27559. }
  27560. });
  27561. if (!support.cssHas) {
  27562. rbuggyQSA.push(":has");
  27563. }
  27564. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  27565. sortOrder = function(a, b) {
  27566. if (a === b) {
  27567. hasDuplicate = true;
  27568. return 0;
  27569. }
  27570. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  27571. if (compare) {
  27572. return compare;
  27573. }
  27574. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
  27575. if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
  27576. if (a === document3 || a.ownerDocument == preferredDoc && find2.contains(preferredDoc, a)) {
  27577. return -1;
  27578. }
  27579. if (b === document3 || b.ownerDocument == preferredDoc && find2.contains(preferredDoc, b)) {
  27580. return 1;
  27581. }
  27582. return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  27583. }
  27584. return compare & 4 ? -1 : 1;
  27585. };
  27586. return document3;
  27587. }
  27588. find2.matches = function(expr, elements) {
  27589. return find2(expr, null, null, elements);
  27590. };
  27591. find2.matchesSelector = function(elem, expr) {
  27592. setDocument(elem);
  27593. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  27594. try {
  27595. var ret = matches.call(elem, expr);
  27596. if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
  27597. return ret;
  27598. }
  27599. } catch (e) {
  27600. nonnativeSelectorCache(expr, true);
  27601. }
  27602. }
  27603. return find2(expr, document3, null, [elem]).length > 0;
  27604. };
  27605. find2.contains = function(context, elem) {
  27606. if ((context.ownerDocument || context) != document3) {
  27607. setDocument(context);
  27608. }
  27609. return jQuery.contains(context, elem);
  27610. };
  27611. find2.attr = function(elem, name) {
  27612. if ((elem.ownerDocument || elem) != document3) {
  27613. setDocument(elem);
  27614. }
  27615. var fn2 = Expr.attrHandle[name.toLowerCase()], val = fn2 && hasOwn2.call(Expr.attrHandle, name.toLowerCase()) ? fn2(elem, name, !documentIsHTML) : void 0;
  27616. if (val !== void 0) {
  27617. return val;
  27618. }
  27619. return elem.getAttribute(name);
  27620. };
  27621. find2.error = function(msg) {
  27622. throw new Error("Syntax error, unrecognized expression: " + msg);
  27623. };
  27624. jQuery.uniqueSort = function(results) {
  27625. var elem, duplicates = [], j = 0, i3 = 0;
  27626. hasDuplicate = !support.sortStable;
  27627. sortInput = !support.sortStable && slice.call(results, 0);
  27628. sort.call(results, sortOrder);
  27629. if (hasDuplicate) {
  27630. while (elem = results[i3++]) {
  27631. if (elem === results[i3]) {
  27632. j = duplicates.push(i3);
  27633. }
  27634. }
  27635. while (j--) {
  27636. splice2.call(results, duplicates[j], 1);
  27637. }
  27638. }
  27639. sortInput = null;
  27640. return results;
  27641. };
  27642. jQuery.fn.uniqueSort = function() {
  27643. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  27644. };
  27645. Expr = jQuery.expr = {
  27646. cacheLength: 50,
  27647. createPseudo: markFunction,
  27648. match: matchExpr,
  27649. attrHandle: {},
  27650. find: {},
  27651. relative: {
  27652. ">": { dir: "parentNode", first: true },
  27653. " ": { dir: "parentNode" },
  27654. "+": { dir: "previousSibling", first: true },
  27655. "~": { dir: "previousSibling" }
  27656. },
  27657. preFilter: {
  27658. ATTR: function(match) {
  27659. match[1] = match[1].replace(runescape, funescape);
  27660. match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
  27661. if (match[2] === "~=") {
  27662. match[3] = " " + match[3] + " ";
  27663. }
  27664. return match.slice(0, 4);
  27665. },
  27666. CHILD: function(match) {
  27667. match[1] = match[1].toLowerCase();
  27668. if (match[1].slice(0, 3) === "nth") {
  27669. if (!match[3]) {
  27670. find2.error(match[0]);
  27671. }
  27672. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  27673. match[5] = +(match[7] + match[8] || match[3] === "odd");
  27674. } else if (match[3]) {
  27675. find2.error(match[0]);
  27676. }
  27677. return match;
  27678. },
  27679. PSEUDO: function(match) {
  27680. var excess, unquoted = !match[6] && match[2];
  27681. if (matchExpr.CHILD.test(match[0])) {
  27682. return null;
  27683. }
  27684. if (match[3]) {
  27685. match[2] = match[4] || match[5] || "";
  27686. } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  27687. match[0] = match[0].slice(0, excess);
  27688. match[2] = unquoted.slice(0, excess);
  27689. }
  27690. return match.slice(0, 3);
  27691. }
  27692. },
  27693. filter: {
  27694. TAG: function(nodeNameSelector) {
  27695. var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
  27696. return nodeNameSelector === "*" ? function() {
  27697. return true;
  27698. } : function(elem) {
  27699. return nodeName(elem, expectedNodeName);
  27700. };
  27701. },
  27702. CLASS: function(className) {
  27703. var pattern = classCache[className + " "];
  27704. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  27705. return pattern.test(
  27706. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  27707. );
  27708. });
  27709. },
  27710. ATTR: function(name, operator, check) {
  27711. return function(elem) {
  27712. var result = find2.attr(elem, name);
  27713. if (result == null) {
  27714. return operator === "!=";
  27715. }
  27716. if (!operator) {
  27717. return true;
  27718. }
  27719. result += "";
  27720. if (operator === "=") {
  27721. return result === check;
  27722. }
  27723. if (operator === "!=") {
  27724. return result !== check;
  27725. }
  27726. if (operator === "^=") {
  27727. return check && result.indexOf(check) === 0;
  27728. }
  27729. if (operator === "*=") {
  27730. return check && result.indexOf(check) > -1;
  27731. }
  27732. if (operator === "$=") {
  27733. return check && result.slice(-check.length) === check;
  27734. }
  27735. if (operator === "~=") {
  27736. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  27737. }
  27738. if (operator === "|=") {
  27739. return result === check || result.slice(0, check.length + 1) === check + "-";
  27740. }
  27741. return false;
  27742. };
  27743. },
  27744. CHILD: function(type2, what, _argument, first, last) {
  27745. var simple = type2.slice(0, 3) !== "nth", forward = type2.slice(-4) !== "last", ofType = what === "of-type";
  27746. return first === 1 && last === 0 ? function(elem) {
  27747. return !!elem.parentNode;
  27748. } : function(elem, _context, xml) {
  27749. var cache, outerCache, node, nodeIndex, start2, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  27750. if (parent) {
  27751. if (simple) {
  27752. while (dir2) {
  27753. node = elem;
  27754. while (node = node[dir2]) {
  27755. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  27756. return false;
  27757. }
  27758. }
  27759. start2 = dir2 = type2 === "only" && !start2 && "nextSibling";
  27760. }
  27761. return true;
  27762. }
  27763. start2 = [forward ? parent.firstChild : parent.lastChild];
  27764. if (forward && useCache) {
  27765. outerCache = parent[expando] || (parent[expando] = {});
  27766. cache = outerCache[type2] || [];
  27767. nodeIndex = cache[0] === dirruns && cache[1];
  27768. diff = nodeIndex && cache[2];
  27769. node = nodeIndex && parent.childNodes[nodeIndex];
  27770. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27771. if (node.nodeType === 1 && ++diff && node === elem) {
  27772. outerCache[type2] = [dirruns, nodeIndex, diff];
  27773. break;
  27774. }
  27775. }
  27776. } else {
  27777. if (useCache) {
  27778. outerCache = elem[expando] || (elem[expando] = {});
  27779. cache = outerCache[type2] || [];
  27780. nodeIndex = cache[0] === dirruns && cache[1];
  27781. diff = nodeIndex;
  27782. }
  27783. if (diff === false) {
  27784. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27785. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  27786. if (useCache) {
  27787. outerCache = node[expando] || (node[expando] = {});
  27788. outerCache[type2] = [dirruns, diff];
  27789. }
  27790. if (node === elem) {
  27791. break;
  27792. }
  27793. }
  27794. }
  27795. }
  27796. }
  27797. diff -= last;
  27798. return diff === first || diff % first === 0 && diff / first >= 0;
  27799. }
  27800. };
  27801. },
  27802. PSEUDO: function(pseudo, argument) {
  27803. var args, fn2 = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find2.error("unsupported pseudo: " + pseudo);
  27804. if (fn2[expando]) {
  27805. return fn2(argument);
  27806. }
  27807. if (fn2.length > 1) {
  27808. args = [pseudo, pseudo, "", argument];
  27809. return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
  27810. var idx, matched = fn2(seed, argument), i3 = matched.length;
  27811. while (i3--) {
  27812. idx = indexOf.call(seed, matched[i3]);
  27813. seed[idx] = !(matches2[idx] = matched[i3]);
  27814. }
  27815. }) : function(elem) {
  27816. return fn2(elem, 0, args);
  27817. };
  27818. }
  27819. return fn2;
  27820. }
  27821. },
  27822. pseudos: {
  27823. not: markFunction(function(selector) {
  27824. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  27825. return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
  27826. var elem, unmatched = matcher(seed, null, xml, []), i3 = seed.length;
  27827. while (i3--) {
  27828. if (elem = unmatched[i3]) {
  27829. seed[i3] = !(matches2[i3] = elem);
  27830. }
  27831. }
  27832. }) : function(elem, _context, xml) {
  27833. input[0] = elem;
  27834. matcher(input, null, xml, results);
  27835. input[0] = null;
  27836. return !results.pop();
  27837. };
  27838. }),
  27839. has: markFunction(function(selector) {
  27840. return function(elem) {
  27841. return find2(selector, elem).length > 0;
  27842. };
  27843. }),
  27844. contains: markFunction(function(text) {
  27845. text = text.replace(runescape, funescape);
  27846. return function(elem) {
  27847. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  27848. };
  27849. }),
  27850. lang: markFunction(function(lang) {
  27851. if (!ridentifier.test(lang || "")) {
  27852. find2.error("unsupported lang: " + lang);
  27853. }
  27854. lang = lang.replace(runescape, funescape).toLowerCase();
  27855. return function(elem) {
  27856. var elemLang;
  27857. do {
  27858. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  27859. elemLang = elemLang.toLowerCase();
  27860. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  27861. }
  27862. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  27863. return false;
  27864. };
  27865. }),
  27866. target: function(elem) {
  27867. var hash = window2.location && window2.location.hash;
  27868. return hash && hash.slice(1) === elem.id;
  27869. },
  27870. root: function(elem) {
  27871. return elem === documentElement2;
  27872. },
  27873. focus: function(elem) {
  27874. return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  27875. },
  27876. enabled: createDisabledPseudo(false),
  27877. disabled: createDisabledPseudo(true),
  27878. checked: function(elem) {
  27879. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  27880. },
  27881. selected: function(elem) {
  27882. if (elem.parentNode) {
  27883. elem.parentNode.selectedIndex;
  27884. }
  27885. return elem.selected === true;
  27886. },
  27887. empty: function(elem) {
  27888. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  27889. if (elem.nodeType < 6) {
  27890. return false;
  27891. }
  27892. }
  27893. return true;
  27894. },
  27895. parent: function(elem) {
  27896. return !Expr.pseudos.empty(elem);
  27897. },
  27898. header: function(elem) {
  27899. return rheader.test(elem.nodeName);
  27900. },
  27901. input: function(elem) {
  27902. return rinputs.test(elem.nodeName);
  27903. },
  27904. button: function(elem) {
  27905. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  27906. },
  27907. text: function(elem) {
  27908. var attr;
  27909. return nodeName(elem, "input") && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
  27910. },
  27911. first: createPositionalPseudo(function() {
  27912. return [0];
  27913. }),
  27914. last: createPositionalPseudo(function(_matchIndexes, length) {
  27915. return [length - 1];
  27916. }),
  27917. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  27918. return [argument < 0 ? argument + length : argument];
  27919. }),
  27920. even: createPositionalPseudo(function(matchIndexes, length) {
  27921. var i3 = 0;
  27922. for (; i3 < length; i3 += 2) {
  27923. matchIndexes.push(i3);
  27924. }
  27925. return matchIndexes;
  27926. }),
  27927. odd: createPositionalPseudo(function(matchIndexes, length) {
  27928. var i3 = 1;
  27929. for (; i3 < length; i3 += 2) {
  27930. matchIndexes.push(i3);
  27931. }
  27932. return matchIndexes;
  27933. }),
  27934. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27935. var i3;
  27936. if (argument < 0) {
  27937. i3 = argument + length;
  27938. } else if (argument > length) {
  27939. i3 = length;
  27940. } else {
  27941. i3 = argument;
  27942. }
  27943. for (; --i3 >= 0; ) {
  27944. matchIndexes.push(i3);
  27945. }
  27946. return matchIndexes;
  27947. }),
  27948. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27949. var i3 = argument < 0 ? argument + length : argument;
  27950. for (; ++i3 < length; ) {
  27951. matchIndexes.push(i3);
  27952. }
  27953. return matchIndexes;
  27954. })
  27955. }
  27956. };
  27957. Expr.pseudos.nth = Expr.pseudos.eq;
  27958. for (i2 in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  27959. Expr.pseudos[i2] = createInputPseudo(i2);
  27960. }
  27961. for (i2 in { submit: true, reset: true }) {
  27962. Expr.pseudos[i2] = createButtonPseudo(i2);
  27963. }
  27964. function setFilters() {
  27965. }
  27966. setFilters.prototype = Expr.filters = Expr.pseudos;
  27967. Expr.setFilters = new setFilters();
  27968. function tokenize(selector, parseOnly) {
  27969. var matched, match, tokens, type2, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  27970. if (cached) {
  27971. return parseOnly ? 0 : cached.slice(0);
  27972. }
  27973. soFar = selector;
  27974. groups = [];
  27975. preFilters = Expr.preFilter;
  27976. while (soFar) {
  27977. if (!matched || (match = rcomma.exec(soFar))) {
  27978. if (match) {
  27979. soFar = soFar.slice(match[0].length) || soFar;
  27980. }
  27981. groups.push(tokens = []);
  27982. }
  27983. matched = false;
  27984. if (match = rleadingCombinator.exec(soFar)) {
  27985. matched = match.shift();
  27986. tokens.push({
  27987. value: matched,
  27988. type: match[0].replace(rtrimCSS, " ")
  27989. });
  27990. soFar = soFar.slice(matched.length);
  27991. }
  27992. for (type2 in Expr.filter) {
  27993. if ((match = matchExpr[type2].exec(soFar)) && (!preFilters[type2] || (match = preFilters[type2](match)))) {
  27994. matched = match.shift();
  27995. tokens.push({
  27996. value: matched,
  27997. type: type2,
  27998. matches: match
  27999. });
  28000. soFar = soFar.slice(matched.length);
  28001. }
  28002. }
  28003. if (!matched) {
  28004. break;
  28005. }
  28006. }
  28007. if (parseOnly) {
  28008. return soFar.length;
  28009. }
  28010. return soFar ? find2.error(selector) : tokenCache(selector, groups).slice(0);
  28011. }
  28012. function toSelector(tokens) {
  28013. var i3 = 0, len = tokens.length, selector = "";
  28014. for (; i3 < len; i3++) {
  28015. selector += tokens[i3].value;
  28016. }
  28017. return selector;
  28018. }
  28019. function addCombinator(matcher, combinator, base2) {
  28020. var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base2 && key === "parentNode", doneName = done++;
  28021. return combinator.first ? function(elem, context, xml) {
  28022. while (elem = elem[dir2]) {
  28023. if (elem.nodeType === 1 || checkNonElements) {
  28024. return matcher(elem, context, xml);
  28025. }
  28026. }
  28027. return false;
  28028. } : function(elem, context, xml) {
  28029. var oldCache, outerCache, newCache = [dirruns, doneName];
  28030. if (xml) {
  28031. while (elem = elem[dir2]) {
  28032. if (elem.nodeType === 1 || checkNonElements) {
  28033. if (matcher(elem, context, xml)) {
  28034. return true;
  28035. }
  28036. }
  28037. }
  28038. } else {
  28039. while (elem = elem[dir2]) {
  28040. if (elem.nodeType === 1 || checkNonElements) {
  28041. outerCache = elem[expando] || (elem[expando] = {});
  28042. if (skip && nodeName(elem, skip)) {
  28043. elem = elem[dir2] || elem;
  28044. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  28045. return newCache[2] = oldCache[2];
  28046. } else {
  28047. outerCache[key] = newCache;
  28048. if (newCache[2] = matcher(elem, context, xml)) {
  28049. return true;
  28050. }
  28051. }
  28052. }
  28053. }
  28054. }
  28055. return false;
  28056. };
  28057. }
  28058. function elementMatcher(matchers2) {
  28059. return matchers2.length > 1 ? function(elem, context, xml) {
  28060. var i3 = matchers2.length;
  28061. while (i3--) {
  28062. if (!matchers2[i3](elem, context, xml)) {
  28063. return false;
  28064. }
  28065. }
  28066. return true;
  28067. } : matchers2[0];
  28068. }
  28069. function multipleContexts(selector, contexts, results) {
  28070. var i3 = 0, len = contexts.length;
  28071. for (; i3 < len; i3++) {
  28072. find2(selector, contexts[i3], results);
  28073. }
  28074. return results;
  28075. }
  28076. function condense(unmatched, map, filter, context, xml) {
  28077. var elem, newUnmatched = [], i3 = 0, len = unmatched.length, mapped = map != null;
  28078. for (; i3 < len; i3++) {
  28079. if (elem = unmatched[i3]) {
  28080. if (!filter || filter(elem, context, xml)) {
  28081. newUnmatched.push(elem);
  28082. if (mapped) {
  28083. map.push(i3);
  28084. }
  28085. }
  28086. }
  28087. }
  28088. return newUnmatched;
  28089. }
  28090. function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
  28091. if (postFilter && !postFilter[expando]) {
  28092. postFilter = setMatcher(postFilter);
  28093. }
  28094. if (postFinder && !postFinder[expando]) {
  28095. postFinder = setMatcher(postFinder, postSelector);
  28096. }
  28097. return markFunction(function(seed, results, context, xml) {
  28098. var temp, i3, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  28099. selector || "*",
  28100. context.nodeType ? [context] : context,
  28101. []
  28102. ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
  28103. if (matcher) {
  28104. matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results;
  28105. matcher(matcherIn, matcherOut, context, xml);
  28106. } else {
  28107. matcherOut = matcherIn;
  28108. }
  28109. if (postFilter) {
  28110. temp = condense(matcherOut, postMap);
  28111. postFilter(temp, [], context, xml);
  28112. i3 = temp.length;
  28113. while (i3--) {
  28114. if (elem = temp[i3]) {
  28115. matcherOut[postMap[i3]] = !(matcherIn[postMap[i3]] = elem);
  28116. }
  28117. }
  28118. }
  28119. if (seed) {
  28120. if (postFinder || preFilter) {
  28121. if (postFinder) {
  28122. temp = [];
  28123. i3 = matcherOut.length;
  28124. while (i3--) {
  28125. if (elem = matcherOut[i3]) {
  28126. temp.push(matcherIn[i3] = elem);
  28127. }
  28128. }
  28129. postFinder(null, matcherOut = [], temp, xml);
  28130. }
  28131. i3 = matcherOut.length;
  28132. while (i3--) {
  28133. if ((elem = matcherOut[i3]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i3]) > -1) {
  28134. seed[temp] = !(results[temp] = elem);
  28135. }
  28136. }
  28137. }
  28138. } else {
  28139. matcherOut = condense(
  28140. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  28141. );
  28142. if (postFinder) {
  28143. postFinder(null, results, matcherOut, xml);
  28144. } else {
  28145. push2.apply(results, matcherOut);
  28146. }
  28147. }
  28148. });
  28149. }
  28150. function matcherFromTokens(tokens) {
  28151. var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i3 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  28152. return elem === checkContext;
  28153. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  28154. return indexOf.call(checkContext, elem) > -1;
  28155. }, implicitRelative, true), matchers2 = [function(elem, context, xml) {
  28156. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  28157. checkContext = null;
  28158. return ret;
  28159. }];
  28160. for (; i3 < len; i3++) {
  28161. if (matcher = Expr.relative[tokens[i3].type]) {
  28162. matchers2 = [addCombinator(elementMatcher(matchers2), matcher)];
  28163. } else {
  28164. matcher = Expr.filter[tokens[i3].type].apply(null, tokens[i3].matches);
  28165. if (matcher[expando]) {
  28166. j = ++i3;
  28167. for (; j < len; j++) {
  28168. if (Expr.relative[tokens[j].type]) {
  28169. break;
  28170. }
  28171. }
  28172. return setMatcher(
  28173. i3 > 1 && elementMatcher(matchers2),
  28174. i3 > 1 && toSelector(
  28175. tokens.slice(0, i3 - 1).concat({ value: tokens[i3 - 2].type === " " ? "*" : "" })
  28176. ).replace(rtrimCSS, "$1"),
  28177. matcher,
  28178. i3 < j && matcherFromTokens(tokens.slice(i3, j)),
  28179. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  28180. j < len && toSelector(tokens)
  28181. );
  28182. }
  28183. matchers2.push(matcher);
  28184. }
  28185. }
  28186. return elementMatcher(matchers2);
  28187. }
  28188. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  28189. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  28190. var elem, j, matcher, matchedCount = 0, i3 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
  28191. if (outermost) {
  28192. outermostContext = context == document3 || context || outermost;
  28193. }
  28194. for (; i3 !== len && (elem = elems[i3]) != null; i3++) {
  28195. if (byElement && elem) {
  28196. j = 0;
  28197. if (!context && elem.ownerDocument != document3) {
  28198. setDocument(elem);
  28199. xml = !documentIsHTML;
  28200. }
  28201. while (matcher = elementMatchers[j++]) {
  28202. if (matcher(elem, context || document3, xml)) {
  28203. push2.call(results, elem);
  28204. break;
  28205. }
  28206. }
  28207. if (outermost) {
  28208. dirruns = dirrunsUnique;
  28209. }
  28210. }
  28211. if (bySet) {
  28212. if (elem = !matcher && elem) {
  28213. matchedCount--;
  28214. }
  28215. if (seed) {
  28216. unmatched.push(elem);
  28217. }
  28218. }
  28219. }
  28220. matchedCount += i3;
  28221. if (bySet && i3 !== matchedCount) {
  28222. j = 0;
  28223. while (matcher = setMatchers[j++]) {
  28224. matcher(unmatched, setMatched, context, xml);
  28225. }
  28226. if (seed) {
  28227. if (matchedCount > 0) {
  28228. while (i3--) {
  28229. if (!(unmatched[i3] || setMatched[i3])) {
  28230. setMatched[i3] = pop.call(results);
  28231. }
  28232. }
  28233. }
  28234. setMatched = condense(setMatched);
  28235. }
  28236. push2.apply(results, setMatched);
  28237. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  28238. jQuery.uniqueSort(results);
  28239. }
  28240. }
  28241. if (outermost) {
  28242. dirruns = dirrunsUnique;
  28243. outermostContext = contextBackup;
  28244. }
  28245. return unmatched;
  28246. };
  28247. return bySet ? markFunction(superMatcher) : superMatcher;
  28248. }
  28249. function compile(selector, match) {
  28250. var i3, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  28251. if (!cached) {
  28252. if (!match) {
  28253. match = tokenize(selector);
  28254. }
  28255. i3 = match.length;
  28256. while (i3--) {
  28257. cached = matcherFromTokens(match[i3]);
  28258. if (cached[expando]) {
  28259. setMatchers.push(cached);
  28260. } else {
  28261. elementMatchers.push(cached);
  28262. }
  28263. }
  28264. cached = compilerCache(
  28265. selector,
  28266. matcherFromGroupMatchers(elementMatchers, setMatchers)
  28267. );
  28268. cached.selector = selector;
  28269. }
  28270. return cached;
  28271. }
  28272. function select(selector, context, results, seed) {
  28273. var i3, tokens, token, type2, find3, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  28274. results = results || [];
  28275. if (match.length === 1) {
  28276. tokens = match[0] = match[0].slice(0);
  28277. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
  28278. context = (Expr.find.ID(
  28279. token.matches[0].replace(runescape, funescape),
  28280. context
  28281. ) || [])[0];
  28282. if (!context) {
  28283. return results;
  28284. } else if (compiled) {
  28285. context = context.parentNode;
  28286. }
  28287. selector = selector.slice(tokens.shift().value.length);
  28288. }
  28289. i3 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  28290. while (i3--) {
  28291. token = tokens[i3];
  28292. if (Expr.relative[type2 = token.type]) {
  28293. break;
  28294. }
  28295. if (find3 = Expr.find[type2]) {
  28296. if (seed = find3(
  28297. token.matches[0].replace(runescape, funescape),
  28298. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  28299. )) {
  28300. tokens.splice(i3, 1);
  28301. selector = seed.length && toSelector(tokens);
  28302. if (!selector) {
  28303. push2.apply(results, seed);
  28304. return results;
  28305. }
  28306. break;
  28307. }
  28308. }
  28309. }
  28310. }
  28311. (compiled || compile(selector, match))(
  28312. seed,
  28313. context,
  28314. !documentIsHTML,
  28315. results,
  28316. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  28317. );
  28318. return results;
  28319. }
  28320. support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
  28321. setDocument();
  28322. support.sortDetached = assert(function(el) {
  28323. return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
  28324. });
  28325. jQuery.find = find2;
  28326. jQuery.expr[":"] = jQuery.expr.pseudos;
  28327. jQuery.unique = jQuery.uniqueSort;
  28328. find2.compile = compile;
  28329. find2.select = select;
  28330. find2.setDocument = setDocument;
  28331. find2.escape = jQuery.escapeSelector;
  28332. find2.getText = jQuery.text;
  28333. find2.isXML = jQuery.isXMLDoc;
  28334. find2.selectors = jQuery.expr;
  28335. find2.support = jQuery.support;
  28336. find2.uniqueSort = jQuery.uniqueSort;
  28337. })();
  28338. var dir = function(elem, dir2, until) {
  28339. var matched = [], truncate = until !== void 0;
  28340. while ((elem = elem[dir2]) && elem.nodeType !== 9) {
  28341. if (elem.nodeType === 1) {
  28342. if (truncate && jQuery(elem).is(until)) {
  28343. break;
  28344. }
  28345. matched.push(elem);
  28346. }
  28347. }
  28348. return matched;
  28349. };
  28350. var siblings = function(n, elem) {
  28351. var matched = [];
  28352. for (; n; n = n.nextSibling) {
  28353. if (n.nodeType === 1 && n !== elem) {
  28354. matched.push(n);
  28355. }
  28356. }
  28357. return matched;
  28358. };
  28359. var rneedsContext = jQuery.expr.match.needsContext;
  28360. var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
  28361. function winnow(elements, qualifier, not) {
  28362. if (isFunction2(qualifier)) {
  28363. return jQuery.grep(elements, function(elem, i2) {
  28364. return !!qualifier.call(elem, i2, elem) !== not;
  28365. });
  28366. }
  28367. if (qualifier.nodeType) {
  28368. return jQuery.grep(elements, function(elem) {
  28369. return elem === qualifier !== not;
  28370. });
  28371. }
  28372. if (typeof qualifier !== "string") {
  28373. return jQuery.grep(elements, function(elem) {
  28374. return indexOf.call(qualifier, elem) > -1 !== not;
  28375. });
  28376. }
  28377. return jQuery.filter(qualifier, elements, not);
  28378. }
  28379. jQuery.filter = function(expr, elems, not) {
  28380. var elem = elems[0];
  28381. if (not) {
  28382. expr = ":not(" + expr + ")";
  28383. }
  28384. if (elems.length === 1 && elem.nodeType === 1) {
  28385. return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
  28386. }
  28387. return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
  28388. return elem2.nodeType === 1;
  28389. }));
  28390. };
  28391. jQuery.fn.extend({
  28392. find: function(selector) {
  28393. var i2, ret, len = this.length, self2 = this;
  28394. if (typeof selector !== "string") {
  28395. return this.pushStack(jQuery(selector).filter(function() {
  28396. for (i2 = 0; i2 < len; i2++) {
  28397. if (jQuery.contains(self2[i2], this)) {
  28398. return true;
  28399. }
  28400. }
  28401. }));
  28402. }
  28403. ret = this.pushStack([]);
  28404. for (i2 = 0; i2 < len; i2++) {
  28405. jQuery.find(selector, self2[i2], ret);
  28406. }
  28407. return len > 1 ? jQuery.uniqueSort(ret) : ret;
  28408. },
  28409. filter: function(selector) {
  28410. return this.pushStack(winnow(this, selector || [], false));
  28411. },
  28412. not: function(selector) {
  28413. return this.pushStack(winnow(this, selector || [], true));
  28414. },
  28415. is: function(selector) {
  28416. return !!winnow(
  28417. this,
  28418. typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
  28419. false
  28420. ).length;
  28421. }
  28422. });
  28423. var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root2) {
  28424. var match, elem;
  28425. if (!selector) {
  28426. return this;
  28427. }
  28428. root2 = root2 || rootjQuery;
  28429. if (typeof selector === "string") {
  28430. if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
  28431. match = [null, selector, null];
  28432. } else {
  28433. match = rquickExpr.exec(selector);
  28434. }
  28435. if (match && (match[1] || !context)) {
  28436. if (match[1]) {
  28437. context = context instanceof jQuery ? context[0] : context;
  28438. jQuery.merge(this, jQuery.parseHTML(
  28439. match[1],
  28440. context && context.nodeType ? context.ownerDocument || context : document2,
  28441. true
  28442. ));
  28443. if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
  28444. for (match in context) {
  28445. if (isFunction2(this[match])) {
  28446. this[match](context[match]);
  28447. } else {
  28448. this.attr(match, context[match]);
  28449. }
  28450. }
  28451. }
  28452. return this;
  28453. } else {
  28454. elem = document2.getElementById(match[2]);
  28455. if (elem) {
  28456. this[0] = elem;
  28457. this.length = 1;
  28458. }
  28459. return this;
  28460. }
  28461. } else if (!context || context.jquery) {
  28462. return (context || root2).find(selector);
  28463. } else {
  28464. return this.constructor(context).find(selector);
  28465. }
  28466. } else if (selector.nodeType) {
  28467. this[0] = selector;
  28468. this.length = 1;
  28469. return this;
  28470. } else if (isFunction2(selector)) {
  28471. return root2.ready !== void 0 ? root2.ready(selector) : selector(jQuery);
  28472. }
  28473. return jQuery.makeArray(selector, this);
  28474. };
  28475. init.prototype = jQuery.fn;
  28476. rootjQuery = jQuery(document2);
  28477. var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
  28478. children: true,
  28479. contents: true,
  28480. next: true,
  28481. prev: true
  28482. };
  28483. jQuery.fn.extend({
  28484. has: function(target) {
  28485. var targets = jQuery(target, this), l = targets.length;
  28486. return this.filter(function() {
  28487. var i2 = 0;
  28488. for (; i2 < l; i2++) {
  28489. if (jQuery.contains(this, targets[i2])) {
  28490. return true;
  28491. }
  28492. }
  28493. });
  28494. },
  28495. closest: function(selectors, context) {
  28496. var cur, i2 = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
  28497. if (!rneedsContext.test(selectors)) {
  28498. for (; i2 < l; i2++) {
  28499. for (cur = this[i2]; cur && cur !== context; cur = cur.parentNode) {
  28500. if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
  28501. matched.push(cur);
  28502. break;
  28503. }
  28504. }
  28505. }
  28506. }
  28507. return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
  28508. },
  28509. index: function(elem) {
  28510. if (!elem) {
  28511. return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
  28512. }
  28513. if (typeof elem === "string") {
  28514. return indexOf.call(jQuery(elem), this[0]);
  28515. }
  28516. return indexOf.call(
  28517. this,
  28518. elem.jquery ? elem[0] : elem
  28519. );
  28520. },
  28521. add: function(selector, context) {
  28522. return this.pushStack(
  28523. jQuery.uniqueSort(
  28524. jQuery.merge(this.get(), jQuery(selector, context))
  28525. )
  28526. );
  28527. },
  28528. addBack: function(selector) {
  28529. return this.add(
  28530. selector == null ? this.prevObject : this.prevObject.filter(selector)
  28531. );
  28532. }
  28533. });
  28534. function sibling(cur, dir2) {
  28535. while ((cur = cur[dir2]) && cur.nodeType !== 1) {
  28536. }
  28537. return cur;
  28538. }
  28539. jQuery.each({
  28540. parent: function(elem) {
  28541. var parent = elem.parentNode;
  28542. return parent && parent.nodeType !== 11 ? parent : null;
  28543. },
  28544. parents: function(elem) {
  28545. return dir(elem, "parentNode");
  28546. },
  28547. parentsUntil: function(elem, _i, until) {
  28548. return dir(elem, "parentNode", until);
  28549. },
  28550. next: function(elem) {
  28551. return sibling(elem, "nextSibling");
  28552. },
  28553. prev: function(elem) {
  28554. return sibling(elem, "previousSibling");
  28555. },
  28556. nextAll: function(elem) {
  28557. return dir(elem, "nextSibling");
  28558. },
  28559. prevAll: function(elem) {
  28560. return dir(elem, "previousSibling");
  28561. },
  28562. nextUntil: function(elem, _i, until) {
  28563. return dir(elem, "nextSibling", until);
  28564. },
  28565. prevUntil: function(elem, _i, until) {
  28566. return dir(elem, "previousSibling", until);
  28567. },
  28568. siblings: function(elem) {
  28569. return siblings((elem.parentNode || {}).firstChild, elem);
  28570. },
  28571. children: function(elem) {
  28572. return siblings(elem.firstChild);
  28573. },
  28574. contents: function(elem) {
  28575. if (elem.contentDocument != null && getProto(elem.contentDocument)) {
  28576. return elem.contentDocument;
  28577. }
  28578. if (nodeName(elem, "template")) {
  28579. elem = elem.content || elem;
  28580. }
  28581. return jQuery.merge([], elem.childNodes);
  28582. }
  28583. }, function(name, fn2) {
  28584. jQuery.fn[name] = function(until, selector) {
  28585. var matched = jQuery.map(this, fn2, until);
  28586. if (name.slice(-5) !== "Until") {
  28587. selector = until;
  28588. }
  28589. if (selector && typeof selector === "string") {
  28590. matched = jQuery.filter(selector, matched);
  28591. }
  28592. if (this.length > 1) {
  28593. if (!guaranteedUnique[name]) {
  28594. jQuery.uniqueSort(matched);
  28595. }
  28596. if (rparentsprev.test(name)) {
  28597. matched.reverse();
  28598. }
  28599. }
  28600. return this.pushStack(matched);
  28601. };
  28602. });
  28603. var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
  28604. function createOptions(options2) {
  28605. var object = {};
  28606. jQuery.each(options2.match(rnothtmlwhite) || [], function(_, flag) {
  28607. object[flag] = true;
  28608. });
  28609. return object;
  28610. }
  28611. jQuery.Callbacks = function(options2) {
  28612. options2 = typeof options2 === "string" ? createOptions(options2) : jQuery.extend({}, options2);
  28613. var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
  28614. locked = locked || options2.once;
  28615. fired = firing = true;
  28616. for (; queue.length; firingIndex = -1) {
  28617. memory = queue.shift();
  28618. while (++firingIndex < list.length) {
  28619. if (list[firingIndex].apply(memory[0], memory[1]) === false && options2.stopOnFalse) {
  28620. firingIndex = list.length;
  28621. memory = false;
  28622. }
  28623. }
  28624. }
  28625. if (!options2.memory) {
  28626. memory = false;
  28627. }
  28628. firing = false;
  28629. if (locked) {
  28630. if (memory) {
  28631. list = [];
  28632. } else {
  28633. list = "";
  28634. }
  28635. }
  28636. }, self2 = {
  28637. add: function() {
  28638. if (list) {
  28639. if (memory && !firing) {
  28640. firingIndex = list.length - 1;
  28641. queue.push(memory);
  28642. }
  28643. (function add(args) {
  28644. jQuery.each(args, function(_, arg) {
  28645. if (isFunction2(arg)) {
  28646. if (!options2.unique || !self2.has(arg)) {
  28647. list.push(arg);
  28648. }
  28649. } else if (arg && arg.length && toType(arg) !== "string") {
  28650. add(arg);
  28651. }
  28652. });
  28653. })(arguments);
  28654. if (memory && !firing) {
  28655. fire();
  28656. }
  28657. }
  28658. return this;
  28659. },
  28660. remove: function() {
  28661. jQuery.each(arguments, function(_, arg) {
  28662. var index2;
  28663. while ((index2 = jQuery.inArray(arg, list, index2)) > -1) {
  28664. list.splice(index2, 1);
  28665. if (index2 <= firingIndex) {
  28666. firingIndex--;
  28667. }
  28668. }
  28669. });
  28670. return this;
  28671. },
  28672. has: function(fn2) {
  28673. return fn2 ? jQuery.inArray(fn2, list) > -1 : list.length > 0;
  28674. },
  28675. empty: function() {
  28676. if (list) {
  28677. list = [];
  28678. }
  28679. return this;
  28680. },
  28681. disable: function() {
  28682. locked = queue = [];
  28683. list = memory = "";
  28684. return this;
  28685. },
  28686. disabled: function() {
  28687. return !list;
  28688. },
  28689. lock: function() {
  28690. locked = queue = [];
  28691. if (!memory && !firing) {
  28692. list = memory = "";
  28693. }
  28694. return this;
  28695. },
  28696. locked: function() {
  28697. return !!locked;
  28698. },
  28699. fireWith: function(context, args) {
  28700. if (!locked) {
  28701. args = args || [];
  28702. args = [context, args.slice ? args.slice() : args];
  28703. queue.push(args);
  28704. if (!firing) {
  28705. fire();
  28706. }
  28707. }
  28708. return this;
  28709. },
  28710. fire: function() {
  28711. self2.fireWith(this, arguments);
  28712. return this;
  28713. },
  28714. fired: function() {
  28715. return !!fired;
  28716. }
  28717. };
  28718. return self2;
  28719. };
  28720. function Identity(v) {
  28721. return v;
  28722. }
  28723. function Thrower(ex) {
  28724. throw ex;
  28725. }
  28726. function adoptValue(value, resolve2, reject2, noValue) {
  28727. var method;
  28728. try {
  28729. if (value && isFunction2(method = value.promise)) {
  28730. method.call(value).done(resolve2).fail(reject2);
  28731. } else if (value && isFunction2(method = value.then)) {
  28732. method.call(value, resolve2, reject2);
  28733. } else {
  28734. resolve2.apply(void 0, [value].slice(noValue));
  28735. }
  28736. } catch (value2) {
  28737. reject2.apply(void 0, [value2]);
  28738. }
  28739. }
  28740. jQuery.extend({
  28741. Deferred: function(func) {
  28742. var tuples = [
  28743. [
  28744. "notify",
  28745. "progress",
  28746. jQuery.Callbacks("memory"),
  28747. jQuery.Callbacks("memory"),
  28748. 2
  28749. ],
  28750. [
  28751. "resolve",
  28752. "done",
  28753. jQuery.Callbacks("once memory"),
  28754. jQuery.Callbacks("once memory"),
  28755. 0,
  28756. "resolved"
  28757. ],
  28758. [
  28759. "reject",
  28760. "fail",
  28761. jQuery.Callbacks("once memory"),
  28762. jQuery.Callbacks("once memory"),
  28763. 1,
  28764. "rejected"
  28765. ]
  28766. ], state = "pending", promise = {
  28767. state: function() {
  28768. return state;
  28769. },
  28770. always: function() {
  28771. deferred.done(arguments).fail(arguments);
  28772. return this;
  28773. },
  28774. "catch": function(fn2) {
  28775. return promise.then(null, fn2);
  28776. },
  28777. pipe: function() {
  28778. var fns = arguments;
  28779. return jQuery.Deferred(function(newDefer) {
  28780. jQuery.each(tuples, function(_i, tuple2) {
  28781. var fn2 = isFunction2(fns[tuple2[4]]) && fns[tuple2[4]];
  28782. deferred[tuple2[1]](function() {
  28783. var returned = fn2 && fn2.apply(this, arguments);
  28784. if (returned && isFunction2(returned.promise)) {
  28785. returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
  28786. } else {
  28787. newDefer[tuple2[0] + "With"](
  28788. this,
  28789. fn2 ? [returned] : arguments
  28790. );
  28791. }
  28792. });
  28793. });
  28794. fns = null;
  28795. }).promise();
  28796. },
  28797. then: function(onFulfilled, onRejected, onProgress) {
  28798. var maxDepth = 0;
  28799. function resolve2(depth, deferred2, handler, special) {
  28800. return function() {
  28801. var that = this, args = arguments, mightThrow = function() {
  28802. var returned, then;
  28803. if (depth < maxDepth) {
  28804. return;
  28805. }
  28806. returned = handler.apply(that, args);
  28807. if (returned === deferred2.promise()) {
  28808. throw new TypeError("Thenable self-resolution");
  28809. }
  28810. then = returned && (typeof returned === "object" || typeof returned === "function") && returned.then;
  28811. if (isFunction2(then)) {
  28812. if (special) {
  28813. then.call(
  28814. returned,
  28815. resolve2(maxDepth, deferred2, Identity, special),
  28816. resolve2(maxDepth, deferred2, Thrower, special)
  28817. );
  28818. } else {
  28819. maxDepth++;
  28820. then.call(
  28821. returned,
  28822. resolve2(maxDepth, deferred2, Identity, special),
  28823. resolve2(maxDepth, deferred2, Thrower, special),
  28824. resolve2(
  28825. maxDepth,
  28826. deferred2,
  28827. Identity,
  28828. deferred2.notifyWith
  28829. )
  28830. );
  28831. }
  28832. } else {
  28833. if (handler !== Identity) {
  28834. that = void 0;
  28835. args = [returned];
  28836. }
  28837. (special || deferred2.resolveWith)(that, args);
  28838. }
  28839. }, process2 = special ? mightThrow : function() {
  28840. try {
  28841. mightThrow();
  28842. } catch (e) {
  28843. if (jQuery.Deferred.exceptionHook) {
  28844. jQuery.Deferred.exceptionHook(
  28845. e,
  28846. process2.error
  28847. );
  28848. }
  28849. if (depth + 1 >= maxDepth) {
  28850. if (handler !== Thrower) {
  28851. that = void 0;
  28852. args = [e];
  28853. }
  28854. deferred2.rejectWith(that, args);
  28855. }
  28856. }
  28857. };
  28858. if (depth) {
  28859. process2();
  28860. } else {
  28861. if (jQuery.Deferred.getErrorHook) {
  28862. process2.error = jQuery.Deferred.getErrorHook();
  28863. } else if (jQuery.Deferred.getStackHook) {
  28864. process2.error = jQuery.Deferred.getStackHook();
  28865. }
  28866. window2.setTimeout(process2);
  28867. }
  28868. };
  28869. }
  28870. return jQuery.Deferred(function(newDefer) {
  28871. tuples[0][3].add(
  28872. resolve2(
  28873. 0,
  28874. newDefer,
  28875. isFunction2(onProgress) ? onProgress : Identity,
  28876. newDefer.notifyWith
  28877. )
  28878. );
  28879. tuples[1][3].add(
  28880. resolve2(
  28881. 0,
  28882. newDefer,
  28883. isFunction2(onFulfilled) ? onFulfilled : Identity
  28884. )
  28885. );
  28886. tuples[2][3].add(
  28887. resolve2(
  28888. 0,
  28889. newDefer,
  28890. isFunction2(onRejected) ? onRejected : Thrower
  28891. )
  28892. );
  28893. }).promise();
  28894. },
  28895. promise: function(obj) {
  28896. return obj != null ? jQuery.extend(obj, promise) : promise;
  28897. }
  28898. }, deferred = {};
  28899. jQuery.each(tuples, function(i2, tuple2) {
  28900. var list = tuple2[2], stateString = tuple2[5];
  28901. promise[tuple2[1]] = list.add;
  28902. if (stateString) {
  28903. list.add(
  28904. function() {
  28905. state = stateString;
  28906. },
  28907. tuples[3 - i2][2].disable,
  28908. tuples[3 - i2][3].disable,
  28909. tuples[0][2].lock,
  28910. tuples[0][3].lock
  28911. );
  28912. }
  28913. list.add(tuple2[3].fire);
  28914. deferred[tuple2[0]] = function() {
  28915. deferred[tuple2[0] + "With"](this === deferred ? void 0 : this, arguments);
  28916. return this;
  28917. };
  28918. deferred[tuple2[0] + "With"] = list.fireWith;
  28919. });
  28920. promise.promise(deferred);
  28921. if (func) {
  28922. func.call(deferred, deferred);
  28923. }
  28924. return deferred;
  28925. },
  28926. when: function(singleValue) {
  28927. var remaining = arguments.length, i2 = remaining, resolveContexts = Array(i2), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i3) {
  28928. return function(value) {
  28929. resolveContexts[i3] = this;
  28930. resolveValues[i3] = arguments.length > 1 ? slice.call(arguments) : value;
  28931. if (!--remaining) {
  28932. primary.resolveWith(resolveContexts, resolveValues);
  28933. }
  28934. };
  28935. };
  28936. if (remaining <= 1) {
  28937. adoptValue(
  28938. singleValue,
  28939. primary.done(updateFunc(i2)).resolve,
  28940. primary.reject,
  28941. !remaining
  28942. );
  28943. if (primary.state() === "pending" || isFunction2(resolveValues[i2] && resolveValues[i2].then)) {
  28944. return primary.then();
  28945. }
  28946. }
  28947. while (i2--) {
  28948. adoptValue(resolveValues[i2], updateFunc(i2), primary.reject);
  28949. }
  28950. return primary.promise();
  28951. }
  28952. });
  28953. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  28954. jQuery.Deferred.exceptionHook = function(error, asyncError) {
  28955. if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
  28956. window2.console.warn(
  28957. "jQuery.Deferred exception: " + error.message,
  28958. error.stack,
  28959. asyncError
  28960. );
  28961. }
  28962. };
  28963. jQuery.readyException = function(error) {
  28964. window2.setTimeout(function() {
  28965. throw error;
  28966. });
  28967. };
  28968. var readyList = jQuery.Deferred();
  28969. jQuery.fn.ready = function(fn2) {
  28970. readyList.then(fn2).catch(function(error) {
  28971. jQuery.readyException(error);
  28972. });
  28973. return this;
  28974. };
  28975. jQuery.extend({
  28976. isReady: false,
  28977. readyWait: 1,
  28978. ready: function(wait) {
  28979. if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
  28980. return;
  28981. }
  28982. jQuery.isReady = true;
  28983. if (wait !== true && --jQuery.readyWait > 0) {
  28984. return;
  28985. }
  28986. readyList.resolveWith(document2, [jQuery]);
  28987. }
  28988. });
  28989. jQuery.ready.then = readyList.then;
  28990. function completed() {
  28991. document2.removeEventListener("DOMContentLoaded", completed);
  28992. window2.removeEventListener("load", completed);
  28993. jQuery.ready();
  28994. }
  28995. if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
  28996. window2.setTimeout(jQuery.ready);
  28997. } else {
  28998. document2.addEventListener("DOMContentLoaded", completed);
  28999. window2.addEventListener("load", completed);
  29000. }
  29001. var access = function(elems, fn2, key, value, chainable, emptyGet, raw) {
  29002. var i2 = 0, len = elems.length, bulk = key == null;
  29003. if (toType(key) === "object") {
  29004. chainable = true;
  29005. for (i2 in key) {
  29006. access(elems, fn2, i2, key[i2], true, emptyGet, raw);
  29007. }
  29008. } else if (value !== void 0) {
  29009. chainable = true;
  29010. if (!isFunction2(value)) {
  29011. raw = true;
  29012. }
  29013. if (bulk) {
  29014. if (raw) {
  29015. fn2.call(elems, value);
  29016. fn2 = null;
  29017. } else {
  29018. bulk = fn2;
  29019. fn2 = function(elem, _key, value2) {
  29020. return bulk.call(jQuery(elem), value2);
  29021. };
  29022. }
  29023. }
  29024. if (fn2) {
  29025. for (; i2 < len; i2++) {
  29026. fn2(
  29027. elems[i2],
  29028. key,
  29029. raw ? value : value.call(elems[i2], i2, fn2(elems[i2], key))
  29030. );
  29031. }
  29032. }
  29033. }
  29034. if (chainable) {
  29035. return elems;
  29036. }
  29037. if (bulk) {
  29038. return fn2.call(elems);
  29039. }
  29040. return len ? fn2(elems[0], key) : emptyGet;
  29041. };
  29042. var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
  29043. function fcamelCase(_all, letter) {
  29044. return letter.toUpperCase();
  29045. }
  29046. function camelCase3(string) {
  29047. return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  29048. }
  29049. var acceptData = function(owner) {
  29050. return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
  29051. };
  29052. function Data() {
  29053. this.expando = jQuery.expando + Data.uid++;
  29054. }
  29055. Data.uid = 1;
  29056. Data.prototype = {
  29057. cache: function(owner) {
  29058. var value = owner[this.expando];
  29059. if (!value) {
  29060. value = {};
  29061. if (acceptData(owner)) {
  29062. if (owner.nodeType) {
  29063. owner[this.expando] = value;
  29064. } else {
  29065. Object.defineProperty(owner, this.expando, {
  29066. value,
  29067. configurable: true
  29068. });
  29069. }
  29070. }
  29071. }
  29072. return value;
  29073. },
  29074. set: function(owner, data, value) {
  29075. var prop, cache = this.cache(owner);
  29076. if (typeof data === "string") {
  29077. cache[camelCase3(data)] = value;
  29078. } else {
  29079. for (prop in data) {
  29080. cache[camelCase3(prop)] = data[prop];
  29081. }
  29082. }
  29083. return cache;
  29084. },
  29085. get: function(owner, key) {
  29086. return key === void 0 ? this.cache(owner) : owner[this.expando] && owner[this.expando][camelCase3(key)];
  29087. },
  29088. access: function(owner, key, value) {
  29089. if (key === void 0 || key && typeof key === "string" && value === void 0) {
  29090. return this.get(owner, key);
  29091. }
  29092. this.set(owner, key, value);
  29093. return value !== void 0 ? value : key;
  29094. },
  29095. remove: function(owner, key) {
  29096. var i2, cache = owner[this.expando];
  29097. if (cache === void 0) {
  29098. return;
  29099. }
  29100. if (key !== void 0) {
  29101. if (Array.isArray(key)) {
  29102. key = key.map(camelCase3);
  29103. } else {
  29104. key = camelCase3(key);
  29105. key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
  29106. }
  29107. i2 = key.length;
  29108. while (i2--) {
  29109. delete cache[key[i2]];
  29110. }
  29111. }
  29112. if (key === void 0 || jQuery.isEmptyObject(cache)) {
  29113. if (owner.nodeType) {
  29114. owner[this.expando] = void 0;
  29115. } else {
  29116. delete owner[this.expando];
  29117. }
  29118. }
  29119. },
  29120. hasData: function(owner) {
  29121. var cache = owner[this.expando];
  29122. return cache !== void 0 && !jQuery.isEmptyObject(cache);
  29123. }
  29124. };
  29125. var dataPriv = new Data();
  29126. var dataUser = new Data();
  29127. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
  29128. function getData(data) {
  29129. if (data === "true") {
  29130. return true;
  29131. }
  29132. if (data === "false") {
  29133. return false;
  29134. }
  29135. if (data === "null") {
  29136. return null;
  29137. }
  29138. if (data === +data + "") {
  29139. return +data;
  29140. }
  29141. if (rbrace.test(data)) {
  29142. return JSON.parse(data);
  29143. }
  29144. return data;
  29145. }
  29146. function dataAttr(elem, key, data) {
  29147. var name;
  29148. if (data === void 0 && elem.nodeType === 1) {
  29149. name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
  29150. data = elem.getAttribute(name);
  29151. if (typeof data === "string") {
  29152. try {
  29153. data = getData(data);
  29154. } catch (e) {
  29155. }
  29156. dataUser.set(elem, key, data);
  29157. } else {
  29158. data = void 0;
  29159. }
  29160. }
  29161. return data;
  29162. }
  29163. jQuery.extend({
  29164. hasData: function(elem) {
  29165. return dataUser.hasData(elem) || dataPriv.hasData(elem);
  29166. },
  29167. data: function(elem, name, data) {
  29168. return dataUser.access(elem, name, data);
  29169. },
  29170. removeData: function(elem, name) {
  29171. dataUser.remove(elem, name);
  29172. },
  29173. _data: function(elem, name, data) {
  29174. return dataPriv.access(elem, name, data);
  29175. },
  29176. _removeData: function(elem, name) {
  29177. dataPriv.remove(elem, name);
  29178. }
  29179. });
  29180. jQuery.fn.extend({
  29181. data: function(key, value) {
  29182. var i2, name, data, elem = this[0], attrs = elem && elem.attributes;
  29183. if (key === void 0) {
  29184. if (this.length) {
  29185. data = dataUser.get(elem);
  29186. if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
  29187. i2 = attrs.length;
  29188. while (i2--) {
  29189. if (attrs[i2]) {
  29190. name = attrs[i2].name;
  29191. if (name.indexOf("data-") === 0) {
  29192. name = camelCase3(name.slice(5));
  29193. dataAttr(elem, name, data[name]);
  29194. }
  29195. }
  29196. }
  29197. dataPriv.set(elem, "hasDataAttrs", true);
  29198. }
  29199. }
  29200. return data;
  29201. }
  29202. if (typeof key === "object") {
  29203. return this.each(function() {
  29204. dataUser.set(this, key);
  29205. });
  29206. }
  29207. return access(this, function(value2) {
  29208. var data2;
  29209. if (elem && value2 === void 0) {
  29210. data2 = dataUser.get(elem, key);
  29211. if (data2 !== void 0) {
  29212. return data2;
  29213. }
  29214. data2 = dataAttr(elem, key);
  29215. if (data2 !== void 0) {
  29216. return data2;
  29217. }
  29218. return;
  29219. }
  29220. this.each(function() {
  29221. dataUser.set(this, key, value2);
  29222. });
  29223. }, null, value, arguments.length > 1, null, true);
  29224. },
  29225. removeData: function(key) {
  29226. return this.each(function() {
  29227. dataUser.remove(this, key);
  29228. });
  29229. }
  29230. });
  29231. jQuery.extend({
  29232. queue: function(elem, type2, data) {
  29233. var queue;
  29234. if (elem) {
  29235. type2 = (type2 || "fx") + "queue";
  29236. queue = dataPriv.get(elem, type2);
  29237. if (data) {
  29238. if (!queue || Array.isArray(data)) {
  29239. queue = dataPriv.access(elem, type2, jQuery.makeArray(data));
  29240. } else {
  29241. queue.push(data);
  29242. }
  29243. }
  29244. return queue || [];
  29245. }
  29246. },
  29247. dequeue: function(elem, type2) {
  29248. type2 = type2 || "fx";
  29249. var queue = jQuery.queue(elem, type2), startLength = queue.length, fn2 = queue.shift(), hooks3 = jQuery._queueHooks(elem, type2), next = function() {
  29250. jQuery.dequeue(elem, type2);
  29251. };
  29252. if (fn2 === "inprogress") {
  29253. fn2 = queue.shift();
  29254. startLength--;
  29255. }
  29256. if (fn2) {
  29257. if (type2 === "fx") {
  29258. queue.unshift("inprogress");
  29259. }
  29260. delete hooks3.stop;
  29261. fn2.call(elem, next, hooks3);
  29262. }
  29263. if (!startLength && hooks3) {
  29264. hooks3.empty.fire();
  29265. }
  29266. },
  29267. _queueHooks: function(elem, type2) {
  29268. var key = type2 + "queueHooks";
  29269. return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
  29270. empty: jQuery.Callbacks("once memory").add(function() {
  29271. dataPriv.remove(elem, [type2 + "queue", key]);
  29272. })
  29273. });
  29274. }
  29275. });
  29276. jQuery.fn.extend({
  29277. queue: function(type2, data) {
  29278. var setter = 2;
  29279. if (typeof type2 !== "string") {
  29280. data = type2;
  29281. type2 = "fx";
  29282. setter--;
  29283. }
  29284. if (arguments.length < setter) {
  29285. return jQuery.queue(this[0], type2);
  29286. }
  29287. return data === void 0 ? this : this.each(function() {
  29288. var queue = jQuery.queue(this, type2, data);
  29289. jQuery._queueHooks(this, type2);
  29290. if (type2 === "fx" && queue[0] !== "inprogress") {
  29291. jQuery.dequeue(this, type2);
  29292. }
  29293. });
  29294. },
  29295. dequeue: function(type2) {
  29296. return this.each(function() {
  29297. jQuery.dequeue(this, type2);
  29298. });
  29299. },
  29300. clearQueue: function(type2) {
  29301. return this.queue(type2 || "fx", []);
  29302. },
  29303. promise: function(type2, obj) {
  29304. var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i2 = this.length, resolve2 = function() {
  29305. if (!--count) {
  29306. defer.resolveWith(elements, [elements]);
  29307. }
  29308. };
  29309. if (typeof type2 !== "string") {
  29310. obj = type2;
  29311. type2 = void 0;
  29312. }
  29313. type2 = type2 || "fx";
  29314. while (i2--) {
  29315. tmp = dataPriv.get(elements[i2], type2 + "queueHooks");
  29316. if (tmp && tmp.empty) {
  29317. count++;
  29318. tmp.empty.add(resolve2);
  29319. }
  29320. }
  29321. resolve2();
  29322. return defer.promise(obj);
  29323. }
  29324. });
  29325. var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
  29326. var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
  29327. var cssExpand = ["Top", "Right", "Bottom", "Left"];
  29328. var documentElement = document2.documentElement;
  29329. var isAttached = function(elem) {
  29330. return jQuery.contains(elem.ownerDocument, elem);
  29331. }, composed = { composed: true };
  29332. if (documentElement.getRootNode) {
  29333. isAttached = function(elem) {
  29334. return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
  29335. };
  29336. }
  29337. var isHiddenWithinTree = function(elem, el) {
  29338. elem = el || elem;
  29339. return elem.style.display === "none" || elem.style.display === "" && isAttached(elem) && jQuery.css(elem, "display") === "none";
  29340. };
  29341. function adjustCSS(elem, prop, valueParts, tween) {
  29342. var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
  29343. return tween.cur();
  29344. } : function() {
  29345. return jQuery.css(elem, prop, "");
  29346. }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
  29347. if (initialInUnit && initialInUnit[3] !== unit) {
  29348. initial = initial / 2;
  29349. unit = unit || initialInUnit[3];
  29350. initialInUnit = +initial || 1;
  29351. while (maxIterations--) {
  29352. jQuery.style(elem, prop, initialInUnit + unit);
  29353. if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
  29354. maxIterations = 0;
  29355. }
  29356. initialInUnit = initialInUnit / scale;
  29357. }
  29358. initialInUnit = initialInUnit * 2;
  29359. jQuery.style(elem, prop, initialInUnit + unit);
  29360. valueParts = valueParts || [];
  29361. }
  29362. if (valueParts) {
  29363. initialInUnit = +initialInUnit || +initial || 0;
  29364. adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
  29365. if (tween) {
  29366. tween.unit = unit;
  29367. tween.start = initialInUnit;
  29368. tween.end = adjusted;
  29369. }
  29370. }
  29371. return adjusted;
  29372. }
  29373. var defaultDisplayMap = {};
  29374. function getDefaultDisplay(elem) {
  29375. var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
  29376. if (display) {
  29377. return display;
  29378. }
  29379. temp = doc.body.appendChild(doc.createElement(nodeName2));
  29380. display = jQuery.css(temp, "display");
  29381. temp.parentNode.removeChild(temp);
  29382. if (display === "none") {
  29383. display = "block";
  29384. }
  29385. defaultDisplayMap[nodeName2] = display;
  29386. return display;
  29387. }
  29388. function showHide(elements, show) {
  29389. var display, elem, values3 = [], index2 = 0, length = elements.length;
  29390. for (; index2 < length; index2++) {
  29391. elem = elements[index2];
  29392. if (!elem.style) {
  29393. continue;
  29394. }
  29395. display = elem.style.display;
  29396. if (show) {
  29397. if (display === "none") {
  29398. values3[index2] = dataPriv.get(elem, "display") || null;
  29399. if (!values3[index2]) {
  29400. elem.style.display = "";
  29401. }
  29402. }
  29403. if (elem.style.display === "" && isHiddenWithinTree(elem)) {
  29404. values3[index2] = getDefaultDisplay(elem);
  29405. }
  29406. } else {
  29407. if (display !== "none") {
  29408. values3[index2] = "none";
  29409. dataPriv.set(elem, "display", display);
  29410. }
  29411. }
  29412. }
  29413. for (index2 = 0; index2 < length; index2++) {
  29414. if (values3[index2] != null) {
  29415. elements[index2].style.display = values3[index2];
  29416. }
  29417. }
  29418. return elements;
  29419. }
  29420. jQuery.fn.extend({
  29421. show: function() {
  29422. return showHide(this, true);
  29423. },
  29424. hide: function() {
  29425. return showHide(this);
  29426. },
  29427. toggle: function(state) {
  29428. if (typeof state === "boolean") {
  29429. return state ? this.show() : this.hide();
  29430. }
  29431. return this.each(function() {
  29432. if (isHiddenWithinTree(this)) {
  29433. jQuery(this).show();
  29434. } else {
  29435. jQuery(this).hide();
  29436. }
  29437. });
  29438. }
  29439. });
  29440. var rcheckableType = /^(?:checkbox|radio)$/i;
  29441. var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
  29442. var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
  29443. (function() {
  29444. var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
  29445. input.setAttribute("type", "radio");
  29446. input.setAttribute("checked", "checked");
  29447. input.setAttribute("name", "t");
  29448. div.appendChild(input);
  29449. support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
  29450. div.innerHTML = "<textarea>x</textarea>";
  29451. support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
  29452. div.innerHTML = "<option></option>";
  29453. support.option = !!div.lastChild;
  29454. })();
  29455. var wrapMap = {
  29456. thead: [1, "<table>", "</table>"],
  29457. col: [2, "<table><colgroup>", "</colgroup></table>"],
  29458. tr: [2, "<table><tbody>", "</tbody></table>"],
  29459. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  29460. _default: [0, "", ""]
  29461. };
  29462. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  29463. wrapMap.th = wrapMap.td;
  29464. if (!support.option) {
  29465. wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
  29466. }
  29467. function getAll(context, tag) {
  29468. var ret;
  29469. if (typeof context.getElementsByTagName !== "undefined") {
  29470. ret = context.getElementsByTagName(tag || "*");
  29471. } else if (typeof context.querySelectorAll !== "undefined") {
  29472. ret = context.querySelectorAll(tag || "*");
  29473. } else {
  29474. ret = [];
  29475. }
  29476. if (tag === void 0 || tag && nodeName(context, tag)) {
  29477. return jQuery.merge([context], ret);
  29478. }
  29479. return ret;
  29480. }
  29481. function setGlobalEval(elems, refElements) {
  29482. var i2 = 0, l = elems.length;
  29483. for (; i2 < l; i2++) {
  29484. dataPriv.set(
  29485. elems[i2],
  29486. "globalEval",
  29487. !refElements || dataPriv.get(refElements[i2], "globalEval")
  29488. );
  29489. }
  29490. }
  29491. var rhtml = /<|&#?\w+;/;
  29492. function buildFragment(elems, context, scripts, selection, ignored) {
  29493. var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i2 = 0, l = elems.length;
  29494. for (; i2 < l; i2++) {
  29495. elem = elems[i2];
  29496. if (elem || elem === 0) {
  29497. if (toType(elem) === "object") {
  29498. jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
  29499. } else if (!rhtml.test(elem)) {
  29500. nodes.push(context.createTextNode(elem));
  29501. } else {
  29502. tmp = tmp || fragment.appendChild(context.createElement("div"));
  29503. tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
  29504. wrap = wrapMap[tag] || wrapMap._default;
  29505. tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
  29506. j = wrap[0];
  29507. while (j--) {
  29508. tmp = tmp.lastChild;
  29509. }
  29510. jQuery.merge(nodes, tmp.childNodes);
  29511. tmp = fragment.firstChild;
  29512. tmp.textContent = "";
  29513. }
  29514. }
  29515. }
  29516. fragment.textContent = "";
  29517. i2 = 0;
  29518. while (elem = nodes[i2++]) {
  29519. if (selection && jQuery.inArray(elem, selection) > -1) {
  29520. if (ignored) {
  29521. ignored.push(elem);
  29522. }
  29523. continue;
  29524. }
  29525. attached = isAttached(elem);
  29526. tmp = getAll(fragment.appendChild(elem), "script");
  29527. if (attached) {
  29528. setGlobalEval(tmp);
  29529. }
  29530. if (scripts) {
  29531. j = 0;
  29532. while (elem = tmp[j++]) {
  29533. if (rscriptType.test(elem.type || "")) {
  29534. scripts.push(elem);
  29535. }
  29536. }
  29537. }
  29538. }
  29539. return fragment;
  29540. }
  29541. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  29542. function returnTrue() {
  29543. return true;
  29544. }
  29545. function returnFalse() {
  29546. return false;
  29547. }
  29548. function on3(elem, types, selector, data, fn2, one3) {
  29549. var origFn, type2;
  29550. if (typeof types === "object") {
  29551. if (typeof selector !== "string") {
  29552. data = data || selector;
  29553. selector = void 0;
  29554. }
  29555. for (type2 in types) {
  29556. on3(elem, type2, selector, data, types[type2], one3);
  29557. }
  29558. return elem;
  29559. }
  29560. if (data == null && fn2 == null) {
  29561. fn2 = selector;
  29562. data = selector = void 0;
  29563. } else if (fn2 == null) {
  29564. if (typeof selector === "string") {
  29565. fn2 = data;
  29566. data = void 0;
  29567. } else {
  29568. fn2 = data;
  29569. data = selector;
  29570. selector = void 0;
  29571. }
  29572. }
  29573. if (fn2 === false) {
  29574. fn2 = returnFalse;
  29575. } else if (!fn2) {
  29576. return elem;
  29577. }
  29578. if (one3 === 1) {
  29579. origFn = fn2;
  29580. fn2 = function(event2) {
  29581. jQuery().off(event2);
  29582. return origFn.apply(this, arguments);
  29583. };
  29584. fn2.guid = origFn.guid || (origFn.guid = jQuery.guid++);
  29585. }
  29586. return elem.each(function() {
  29587. jQuery.event.add(this, types, fn2, data, selector);
  29588. });
  29589. }
  29590. jQuery.event = {
  29591. global: {},
  29592. add: function(elem, types, handler, data, selector) {
  29593. var handleObjIn, eventHandle, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.get(elem);
  29594. if (!acceptData(elem)) {
  29595. return;
  29596. }
  29597. if (handler.handler) {
  29598. handleObjIn = handler;
  29599. handler = handleObjIn.handler;
  29600. selector = handleObjIn.selector;
  29601. }
  29602. if (selector) {
  29603. jQuery.find.matchesSelector(documentElement, selector);
  29604. }
  29605. if (!handler.guid) {
  29606. handler.guid = jQuery.guid++;
  29607. }
  29608. if (!(events = elemData.events)) {
  29609. events = elemData.events = /* @__PURE__ */ Object.create(null);
  29610. }
  29611. if (!(eventHandle = elemData.handle)) {
  29612. eventHandle = elemData.handle = function(e) {
  29613. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
  29614. };
  29615. }
  29616. types = (types || "").match(rnothtmlwhite) || [""];
  29617. t2 = types.length;
  29618. while (t2--) {
  29619. tmp = rtypenamespace.exec(types[t2]) || [];
  29620. type2 = origType = tmp[1];
  29621. namespaces = (tmp[2] || "").split(".").sort();
  29622. if (!type2) {
  29623. continue;
  29624. }
  29625. special = jQuery.event.special[type2] || {};
  29626. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29627. special = jQuery.event.special[type2] || {};
  29628. handleObj = jQuery.extend({
  29629. type: type2,
  29630. origType,
  29631. data,
  29632. handler,
  29633. guid: handler.guid,
  29634. selector,
  29635. needsContext: selector && jQuery.expr.match.needsContext.test(selector),
  29636. namespace: namespaces.join(".")
  29637. }, handleObjIn);
  29638. if (!(handlers = events[type2])) {
  29639. handlers = events[type2] = [];
  29640. handlers.delegateCount = 0;
  29641. if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
  29642. if (elem.addEventListener) {
  29643. elem.addEventListener(type2, eventHandle);
  29644. }
  29645. }
  29646. }
  29647. if (special.add) {
  29648. special.add.call(elem, handleObj);
  29649. if (!handleObj.handler.guid) {
  29650. handleObj.handler.guid = handler.guid;
  29651. }
  29652. }
  29653. if (selector) {
  29654. handlers.splice(handlers.delegateCount++, 0, handleObj);
  29655. } else {
  29656. handlers.push(handleObj);
  29657. }
  29658. jQuery.event.global[type2] = true;
  29659. }
  29660. },
  29661. remove: function(elem, types, handler, selector, mappedTypes) {
  29662. var j, origCount, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
  29663. if (!elemData || !(events = elemData.events)) {
  29664. return;
  29665. }
  29666. types = (types || "").match(rnothtmlwhite) || [""];
  29667. t2 = types.length;
  29668. while (t2--) {
  29669. tmp = rtypenamespace.exec(types[t2]) || [];
  29670. type2 = origType = tmp[1];
  29671. namespaces = (tmp[2] || "").split(".").sort();
  29672. if (!type2) {
  29673. for (type2 in events) {
  29674. jQuery.event.remove(elem, type2 + types[t2], handler, selector, true);
  29675. }
  29676. continue;
  29677. }
  29678. special = jQuery.event.special[type2] || {};
  29679. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29680. handlers = events[type2] || [];
  29681. tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
  29682. origCount = j = handlers.length;
  29683. while (j--) {
  29684. handleObj = handlers[j];
  29685. if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
  29686. handlers.splice(j, 1);
  29687. if (handleObj.selector) {
  29688. handlers.delegateCount--;
  29689. }
  29690. if (special.remove) {
  29691. special.remove.call(elem, handleObj);
  29692. }
  29693. }
  29694. }
  29695. if (origCount && !handlers.length) {
  29696. if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
  29697. jQuery.removeEvent(elem, type2, elemData.handle);
  29698. }
  29699. delete events[type2];
  29700. }
  29701. }
  29702. if (jQuery.isEmptyObject(events)) {
  29703. dataPriv.remove(elem, "handle events");
  29704. }
  29705. },
  29706. dispatch: function(nativeEvent) {
  29707. var i2, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event2 = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event2.type] || [], special = jQuery.event.special[event2.type] || {};
  29708. args[0] = event2;
  29709. for (i2 = 1; i2 < arguments.length; i2++) {
  29710. args[i2] = arguments[i2];
  29711. }
  29712. event2.delegateTarget = this;
  29713. if (special.preDispatch && special.preDispatch.call(this, event2) === false) {
  29714. return;
  29715. }
  29716. handlerQueue = jQuery.event.handlers.call(this, event2, handlers);
  29717. i2 = 0;
  29718. while ((matched = handlerQueue[i2++]) && !event2.isPropagationStopped()) {
  29719. event2.currentTarget = matched.elem;
  29720. j = 0;
  29721. while ((handleObj = matched.handlers[j++]) && !event2.isImmediatePropagationStopped()) {
  29722. if (!event2.rnamespace || handleObj.namespace === false || event2.rnamespace.test(handleObj.namespace)) {
  29723. event2.handleObj = handleObj;
  29724. event2.data = handleObj.data;
  29725. ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
  29726. if (ret !== void 0) {
  29727. if ((event2.result = ret) === false) {
  29728. event2.preventDefault();
  29729. event2.stopPropagation();
  29730. }
  29731. }
  29732. }
  29733. }
  29734. }
  29735. if (special.postDispatch) {
  29736. special.postDispatch.call(this, event2);
  29737. }
  29738. return event2.result;
  29739. },
  29740. handlers: function(event2, handlers) {
  29741. var i2, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event2.target;
  29742. if (delegateCount && cur.nodeType && !(event2.type === "click" && event2.button >= 1)) {
  29743. for (; cur !== this; cur = cur.parentNode || this) {
  29744. if (cur.nodeType === 1 && !(event2.type === "click" && cur.disabled === true)) {
  29745. matchedHandlers = [];
  29746. matchedSelectors = {};
  29747. for (i2 = 0; i2 < delegateCount; i2++) {
  29748. handleObj = handlers[i2];
  29749. sel = handleObj.selector + " ";
  29750. if (matchedSelectors[sel] === void 0) {
  29751. matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
  29752. }
  29753. if (matchedSelectors[sel]) {
  29754. matchedHandlers.push(handleObj);
  29755. }
  29756. }
  29757. if (matchedHandlers.length) {
  29758. handlerQueue.push({ elem: cur, handlers: matchedHandlers });
  29759. }
  29760. }
  29761. }
  29762. }
  29763. cur = this;
  29764. if (delegateCount < handlers.length) {
  29765. handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
  29766. }
  29767. return handlerQueue;
  29768. },
  29769. addProp: function(name, hook3) {
  29770. Object.defineProperty(jQuery.Event.prototype, name, {
  29771. enumerable: true,
  29772. configurable: true,
  29773. get: isFunction2(hook3) ? function() {
  29774. if (this.originalEvent) {
  29775. return hook3(this.originalEvent);
  29776. }
  29777. } : function() {
  29778. if (this.originalEvent) {
  29779. return this.originalEvent[name];
  29780. }
  29781. },
  29782. set: function(value) {
  29783. Object.defineProperty(this, name, {
  29784. enumerable: true,
  29785. configurable: true,
  29786. writable: true,
  29787. value
  29788. });
  29789. }
  29790. });
  29791. },
  29792. fix: function(originalEvent) {
  29793. return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
  29794. },
  29795. special: {
  29796. load: {
  29797. noBubble: true
  29798. },
  29799. click: {
  29800. setup: function(data) {
  29801. var el = this || data;
  29802. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29803. leverageNative(el, "click", true);
  29804. }
  29805. return false;
  29806. },
  29807. trigger: function(data) {
  29808. var el = this || data;
  29809. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29810. leverageNative(el, "click");
  29811. }
  29812. return true;
  29813. },
  29814. _default: function(event2) {
  29815. var target = event2.target;
  29816. return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
  29817. }
  29818. },
  29819. beforeunload: {
  29820. postDispatch: function(event2) {
  29821. if (event2.result !== void 0 && event2.originalEvent) {
  29822. event2.originalEvent.returnValue = event2.result;
  29823. }
  29824. }
  29825. }
  29826. }
  29827. };
  29828. function leverageNative(el, type2, isSetup) {
  29829. if (!isSetup) {
  29830. if (dataPriv.get(el, type2) === void 0) {
  29831. jQuery.event.add(el, type2, returnTrue);
  29832. }
  29833. return;
  29834. }
  29835. dataPriv.set(el, type2, false);
  29836. jQuery.event.add(el, type2, {
  29837. namespace: false,
  29838. handler: function(event2) {
  29839. var result, saved = dataPriv.get(this, type2);
  29840. if (event2.isTrigger & 1 && this[type2]) {
  29841. if (!saved) {
  29842. saved = slice.call(arguments);
  29843. dataPriv.set(this, type2, saved);
  29844. this[type2]();
  29845. result = dataPriv.get(this, type2);
  29846. dataPriv.set(this, type2, false);
  29847. if (saved !== result) {
  29848. event2.stopImmediatePropagation();
  29849. event2.preventDefault();
  29850. return result;
  29851. }
  29852. } else if ((jQuery.event.special[type2] || {}).delegateType) {
  29853. event2.stopPropagation();
  29854. }
  29855. } else if (saved) {
  29856. dataPriv.set(this, type2, jQuery.event.trigger(
  29857. saved[0],
  29858. saved.slice(1),
  29859. this
  29860. ));
  29861. event2.stopPropagation();
  29862. event2.isImmediatePropagationStopped = returnTrue;
  29863. }
  29864. }
  29865. });
  29866. }
  29867. jQuery.removeEvent = function(elem, type2, handle) {
  29868. if (elem.removeEventListener) {
  29869. elem.removeEventListener(type2, handle);
  29870. }
  29871. };
  29872. jQuery.Event = function(src, props) {
  29873. if (!(this instanceof jQuery.Event)) {
  29874. return new jQuery.Event(src, props);
  29875. }
  29876. if (src && src.type) {
  29877. this.originalEvent = src;
  29878. this.type = src.type;
  29879. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && src.returnValue === false ? returnTrue : returnFalse;
  29880. this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
  29881. this.currentTarget = src.currentTarget;
  29882. this.relatedTarget = src.relatedTarget;
  29883. } else {
  29884. this.type = src;
  29885. }
  29886. if (props) {
  29887. jQuery.extend(this, props);
  29888. }
  29889. this.timeStamp = src && src.timeStamp || Date.now();
  29890. this[jQuery.expando] = true;
  29891. };
  29892. jQuery.Event.prototype = {
  29893. constructor: jQuery.Event,
  29894. isDefaultPrevented: returnFalse,
  29895. isPropagationStopped: returnFalse,
  29896. isImmediatePropagationStopped: returnFalse,
  29897. isSimulated: false,
  29898. preventDefault: function() {
  29899. var e = this.originalEvent;
  29900. this.isDefaultPrevented = returnTrue;
  29901. if (e && !this.isSimulated) {
  29902. e.preventDefault();
  29903. }
  29904. },
  29905. stopPropagation: function() {
  29906. var e = this.originalEvent;
  29907. this.isPropagationStopped = returnTrue;
  29908. if (e && !this.isSimulated) {
  29909. e.stopPropagation();
  29910. }
  29911. },
  29912. stopImmediatePropagation: function() {
  29913. var e = this.originalEvent;
  29914. this.isImmediatePropagationStopped = returnTrue;
  29915. if (e && !this.isSimulated) {
  29916. e.stopImmediatePropagation();
  29917. }
  29918. this.stopPropagation();
  29919. }
  29920. };
  29921. jQuery.each({
  29922. altKey: true,
  29923. bubbles: true,
  29924. cancelable: true,
  29925. changedTouches: true,
  29926. ctrlKey: true,
  29927. detail: true,
  29928. eventPhase: true,
  29929. metaKey: true,
  29930. pageX: true,
  29931. pageY: true,
  29932. shiftKey: true,
  29933. view: true,
  29934. "char": true,
  29935. code: true,
  29936. charCode: true,
  29937. key: true,
  29938. keyCode: true,
  29939. button: true,
  29940. buttons: true,
  29941. clientX: true,
  29942. clientY: true,
  29943. offsetX: true,
  29944. offsetY: true,
  29945. pointerId: true,
  29946. pointerType: true,
  29947. screenX: true,
  29948. screenY: true,
  29949. targetTouches: true,
  29950. toElement: true,
  29951. touches: true,
  29952. which: true
  29953. }, jQuery.event.addProp);
  29954. jQuery.each({ focus: "focusin", blur: "focusout" }, function(type2, delegateType) {
  29955. function focusMappedHandler(nativeEvent) {
  29956. if (document2.documentMode) {
  29957. var handle = dataPriv.get(this, "handle"), event2 = jQuery.event.fix(nativeEvent);
  29958. event2.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  29959. event2.isSimulated = true;
  29960. handle(nativeEvent);
  29961. if (event2.target === event2.currentTarget) {
  29962. handle(event2);
  29963. }
  29964. } else {
  29965. jQuery.event.simulate(
  29966. delegateType,
  29967. nativeEvent.target,
  29968. jQuery.event.fix(nativeEvent)
  29969. );
  29970. }
  29971. }
  29972. jQuery.event.special[type2] = {
  29973. setup: function() {
  29974. var attaches;
  29975. leverageNative(this, type2, true);
  29976. if (document2.documentMode) {
  29977. attaches = dataPriv.get(this, delegateType);
  29978. if (!attaches) {
  29979. this.addEventListener(delegateType, focusMappedHandler);
  29980. }
  29981. dataPriv.set(this, delegateType, (attaches || 0) + 1);
  29982. } else {
  29983. return false;
  29984. }
  29985. },
  29986. trigger: function() {
  29987. leverageNative(this, type2);
  29988. return true;
  29989. },
  29990. teardown: function() {
  29991. var attaches;
  29992. if (document2.documentMode) {
  29993. attaches = dataPriv.get(this, delegateType) - 1;
  29994. if (!attaches) {
  29995. this.removeEventListener(delegateType, focusMappedHandler);
  29996. dataPriv.remove(this, delegateType);
  29997. } else {
  29998. dataPriv.set(this, delegateType, attaches);
  29999. }
  30000. } else {
  30001. return false;
  30002. }
  30003. },
  30004. _default: function(event2) {
  30005. return dataPriv.get(event2.target, type2);
  30006. },
  30007. delegateType
  30008. };
  30009. jQuery.event.special[delegateType] = {
  30010. setup: function() {
  30011. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
  30012. if (!attaches) {
  30013. if (document2.documentMode) {
  30014. this.addEventListener(delegateType, focusMappedHandler);
  30015. } else {
  30016. doc.addEventListener(type2, focusMappedHandler, true);
  30017. }
  30018. }
  30019. dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
  30020. },
  30021. teardown: function() {
  30022. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
  30023. if (!attaches) {
  30024. if (document2.documentMode) {
  30025. this.removeEventListener(delegateType, focusMappedHandler);
  30026. } else {
  30027. doc.removeEventListener(type2, focusMappedHandler, true);
  30028. }
  30029. dataPriv.remove(dataHolder, delegateType);
  30030. } else {
  30031. dataPriv.set(dataHolder, delegateType, attaches);
  30032. }
  30033. }
  30034. };
  30035. });
  30036. jQuery.each({
  30037. mouseenter: "mouseover",
  30038. mouseleave: "mouseout",
  30039. pointerenter: "pointerover",
  30040. pointerleave: "pointerout"
  30041. }, function(orig, fix) {
  30042. jQuery.event.special[orig] = {
  30043. delegateType: fix,
  30044. bindType: fix,
  30045. handle: function(event2) {
  30046. var ret, target = this, related = event2.relatedTarget, handleObj = event2.handleObj;
  30047. if (!related || related !== target && !jQuery.contains(target, related)) {
  30048. event2.type = handleObj.origType;
  30049. ret = handleObj.handler.apply(this, arguments);
  30050. event2.type = fix;
  30051. }
  30052. return ret;
  30053. }
  30054. };
  30055. });
  30056. jQuery.fn.extend({
  30057. on: function(types, selector, data, fn2) {
  30058. return on3(this, types, selector, data, fn2);
  30059. },
  30060. one: function(types, selector, data, fn2) {
  30061. return on3(this, types, selector, data, fn2, 1);
  30062. },
  30063. off: function(types, selector, fn2) {
  30064. var handleObj, type2;
  30065. if (types && types.preventDefault && types.handleObj) {
  30066. handleObj = types.handleObj;
  30067. jQuery(types.delegateTarget).off(
  30068. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  30069. handleObj.selector,
  30070. handleObj.handler
  30071. );
  30072. return this;
  30073. }
  30074. if (typeof types === "object") {
  30075. for (type2 in types) {
  30076. this.off(type2, selector, types[type2]);
  30077. }
  30078. return this;
  30079. }
  30080. if (selector === false || typeof selector === "function") {
  30081. fn2 = selector;
  30082. selector = void 0;
  30083. }
  30084. if (fn2 === false) {
  30085. fn2 = returnFalse;
  30086. }
  30087. return this.each(function() {
  30088. jQuery.event.remove(this, types, fn2, selector);
  30089. });
  30090. }
  30091. });
  30092. var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  30093. function manipulationTarget(elem, content) {
  30094. if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
  30095. return jQuery(elem).children("tbody")[0] || elem;
  30096. }
  30097. return elem;
  30098. }
  30099. function disableScript(elem) {
  30100. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  30101. return elem;
  30102. }
  30103. function restoreScript(elem) {
  30104. if ((elem.type || "").slice(0, 5) === "true/") {
  30105. elem.type = elem.type.slice(5);
  30106. } else {
  30107. elem.removeAttribute("type");
  30108. }
  30109. return elem;
  30110. }
  30111. function cloneCopyEvent(src, dest) {
  30112. var i2, l, type2, pdataOld, udataOld, udataCur, events;
  30113. if (dest.nodeType !== 1) {
  30114. return;
  30115. }
  30116. if (dataPriv.hasData(src)) {
  30117. pdataOld = dataPriv.get(src);
  30118. events = pdataOld.events;
  30119. if (events) {
  30120. dataPriv.remove(dest, "handle events");
  30121. for (type2 in events) {
  30122. for (i2 = 0, l = events[type2].length; i2 < l; i2++) {
  30123. jQuery.event.add(dest, type2, events[type2][i2]);
  30124. }
  30125. }
  30126. }
  30127. }
  30128. if (dataUser.hasData(src)) {
  30129. udataOld = dataUser.access(src);
  30130. udataCur = jQuery.extend({}, udataOld);
  30131. dataUser.set(dest, udataCur);
  30132. }
  30133. }
  30134. function fixInput(src, dest) {
  30135. var nodeName2 = dest.nodeName.toLowerCase();
  30136. if (nodeName2 === "input" && rcheckableType.test(src.type)) {
  30137. dest.checked = src.checked;
  30138. } else if (nodeName2 === "input" || nodeName2 === "textarea") {
  30139. dest.defaultValue = src.defaultValue;
  30140. }
  30141. }
  30142. function domManip(collection, args, callback2, ignored) {
  30143. args = flat2(args);
  30144. var fragment, first, scripts, hasScripts, node, doc, i2 = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction2(value);
  30145. if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
  30146. return collection.each(function(index2) {
  30147. var self2 = collection.eq(index2);
  30148. if (valueIsFunction) {
  30149. args[0] = value.call(this, index2, self2.html());
  30150. }
  30151. domManip(self2, args, callback2, ignored);
  30152. });
  30153. }
  30154. if (l) {
  30155. fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
  30156. first = fragment.firstChild;
  30157. if (fragment.childNodes.length === 1) {
  30158. fragment = first;
  30159. }
  30160. if (first || ignored) {
  30161. scripts = jQuery.map(getAll(fragment, "script"), disableScript);
  30162. hasScripts = scripts.length;
  30163. for (; i2 < l; i2++) {
  30164. node = fragment;
  30165. if (i2 !== iNoClone) {
  30166. node = jQuery.clone(node, true, true);
  30167. if (hasScripts) {
  30168. jQuery.merge(scripts, getAll(node, "script"));
  30169. }
  30170. }
  30171. callback2.call(collection[i2], node, i2);
  30172. }
  30173. if (hasScripts) {
  30174. doc = scripts[scripts.length - 1].ownerDocument;
  30175. jQuery.map(scripts, restoreScript);
  30176. for (i2 = 0; i2 < hasScripts; i2++) {
  30177. node = scripts[i2];
  30178. if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
  30179. if (node.src && (node.type || "").toLowerCase() !== "module") {
  30180. if (jQuery._evalUrl && !node.noModule) {
  30181. jQuery._evalUrl(node.src, {
  30182. nonce: node.nonce || node.getAttribute("nonce")
  30183. }, doc);
  30184. }
  30185. } else {
  30186. DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
  30187. }
  30188. }
  30189. }
  30190. }
  30191. }
  30192. }
  30193. return collection;
  30194. }
  30195. function remove2(elem, selector, keepData) {
  30196. var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i2 = 0;
  30197. for (; (node = nodes[i2]) != null; i2++) {
  30198. if (!keepData && node.nodeType === 1) {
  30199. jQuery.cleanData(getAll(node));
  30200. }
  30201. if (node.parentNode) {
  30202. if (keepData && isAttached(node)) {
  30203. setGlobalEval(getAll(node, "script"));
  30204. }
  30205. node.parentNode.removeChild(node);
  30206. }
  30207. }
  30208. return elem;
  30209. }
  30210. jQuery.extend({
  30211. htmlPrefilter: function(html) {
  30212. return html;
  30213. },
  30214. clone: function(elem, dataAndEvents, deepDataAndEvents) {
  30215. var i2, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
  30216. if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  30217. destElements = getAll(clone);
  30218. srcElements = getAll(elem);
  30219. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30220. fixInput(srcElements[i2], destElements[i2]);
  30221. }
  30222. }
  30223. if (dataAndEvents) {
  30224. if (deepDataAndEvents) {
  30225. srcElements = srcElements || getAll(elem);
  30226. destElements = destElements || getAll(clone);
  30227. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30228. cloneCopyEvent(srcElements[i2], destElements[i2]);
  30229. }
  30230. } else {
  30231. cloneCopyEvent(elem, clone);
  30232. }
  30233. }
  30234. destElements = getAll(clone, "script");
  30235. if (destElements.length > 0) {
  30236. setGlobalEval(destElements, !inPage && getAll(elem, "script"));
  30237. }
  30238. return clone;
  30239. },
  30240. cleanData: function(elems) {
  30241. var data, elem, type2, special = jQuery.event.special, i2 = 0;
  30242. for (; (elem = elems[i2]) !== void 0; i2++) {
  30243. if (acceptData(elem)) {
  30244. if (data = elem[dataPriv.expando]) {
  30245. if (data.events) {
  30246. for (type2 in data.events) {
  30247. if (special[type2]) {
  30248. jQuery.event.remove(elem, type2);
  30249. } else {
  30250. jQuery.removeEvent(elem, type2, data.handle);
  30251. }
  30252. }
  30253. }
  30254. elem[dataPriv.expando] = void 0;
  30255. }
  30256. if (elem[dataUser.expando]) {
  30257. elem[dataUser.expando] = void 0;
  30258. }
  30259. }
  30260. }
  30261. }
  30262. });
  30263. jQuery.fn.extend({
  30264. detach: function(selector) {
  30265. return remove2(this, selector, true);
  30266. },
  30267. remove: function(selector) {
  30268. return remove2(this, selector);
  30269. },
  30270. text: function(value) {
  30271. return access(this, function(value2) {
  30272. return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
  30273. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30274. this.textContent = value2;
  30275. }
  30276. });
  30277. }, null, value, arguments.length);
  30278. },
  30279. append: function() {
  30280. return domManip(this, arguments, function(elem) {
  30281. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30282. var target = manipulationTarget(this, elem);
  30283. target.appendChild(elem);
  30284. }
  30285. });
  30286. },
  30287. prepend: function() {
  30288. return domManip(this, arguments, function(elem) {
  30289. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30290. var target = manipulationTarget(this, elem);
  30291. target.insertBefore(elem, target.firstChild);
  30292. }
  30293. });
  30294. },
  30295. before: function() {
  30296. return domManip(this, arguments, function(elem) {
  30297. if (this.parentNode) {
  30298. this.parentNode.insertBefore(elem, this);
  30299. }
  30300. });
  30301. },
  30302. after: function() {
  30303. return domManip(this, arguments, function(elem) {
  30304. if (this.parentNode) {
  30305. this.parentNode.insertBefore(elem, this.nextSibling);
  30306. }
  30307. });
  30308. },
  30309. empty: function() {
  30310. var elem, i2 = 0;
  30311. for (; (elem = this[i2]) != null; i2++) {
  30312. if (elem.nodeType === 1) {
  30313. jQuery.cleanData(getAll(elem, false));
  30314. elem.textContent = "";
  30315. }
  30316. }
  30317. return this;
  30318. },
  30319. clone: function(dataAndEvents, deepDataAndEvents) {
  30320. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  30321. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  30322. return this.map(function() {
  30323. return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
  30324. });
  30325. },
  30326. html: function(value) {
  30327. return access(this, function(value2) {
  30328. var elem = this[0] || {}, i2 = 0, l = this.length;
  30329. if (value2 === void 0 && elem.nodeType === 1) {
  30330. return elem.innerHTML;
  30331. }
  30332. if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
  30333. value2 = jQuery.htmlPrefilter(value2);
  30334. try {
  30335. for (; i2 < l; i2++) {
  30336. elem = this[i2] || {};
  30337. if (elem.nodeType === 1) {
  30338. jQuery.cleanData(getAll(elem, false));
  30339. elem.innerHTML = value2;
  30340. }
  30341. }
  30342. elem = 0;
  30343. } catch (e) {
  30344. }
  30345. }
  30346. if (elem) {
  30347. this.empty().append(value2);
  30348. }
  30349. }, null, value, arguments.length);
  30350. },
  30351. replaceWith: function() {
  30352. var ignored = [];
  30353. return domManip(this, arguments, function(elem) {
  30354. var parent = this.parentNode;
  30355. if (jQuery.inArray(this, ignored) < 0) {
  30356. jQuery.cleanData(getAll(this));
  30357. if (parent) {
  30358. parent.replaceChild(elem, this);
  30359. }
  30360. }
  30361. }, ignored);
  30362. }
  30363. });
  30364. jQuery.each({
  30365. appendTo: "append",
  30366. prependTo: "prepend",
  30367. insertBefore: "before",
  30368. insertAfter: "after",
  30369. replaceAll: "replaceWith"
  30370. }, function(name, original) {
  30371. jQuery.fn[name] = function(selector) {
  30372. var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i2 = 0;
  30373. for (; i2 <= last; i2++) {
  30374. elems = i2 === last ? this : this.clone(true);
  30375. jQuery(insert[i2])[original](elems);
  30376. push.apply(ret, elems.get());
  30377. }
  30378. return this.pushStack(ret);
  30379. };
  30380. });
  30381. var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
  30382. var rcustomProp = /^--/;
  30383. var getStyles = function(elem) {
  30384. var view = elem.ownerDocument.defaultView;
  30385. if (!view || !view.opener) {
  30386. view = window2;
  30387. }
  30388. return view.getComputedStyle(elem);
  30389. };
  30390. var swap = function(elem, options2, callback2) {
  30391. var ret, name, old = {};
  30392. for (name in options2) {
  30393. old[name] = elem.style[name];
  30394. elem.style[name] = options2[name];
  30395. }
  30396. ret = callback2.call(elem);
  30397. for (name in options2) {
  30398. elem.style[name] = old[name];
  30399. }
  30400. return ret;
  30401. };
  30402. var rboxStyle = new RegExp(cssExpand.join("|"), "i");
  30403. (function() {
  30404. function computeStyleTests() {
  30405. if (!div) {
  30406. return;
  30407. }
  30408. container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
  30409. div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
  30410. documentElement.appendChild(container).appendChild(div);
  30411. var divStyle = window2.getComputedStyle(div);
  30412. pixelPositionVal = divStyle.top !== "1%";
  30413. reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
  30414. div.style.right = "60%";
  30415. pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
  30416. boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
  30417. div.style.position = "absolute";
  30418. scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
  30419. documentElement.removeChild(container);
  30420. div = null;
  30421. }
  30422. function roundPixelMeasures(measure) {
  30423. return Math.round(parseFloat(measure));
  30424. }
  30425. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
  30426. if (!div.style) {
  30427. return;
  30428. }
  30429. div.style.backgroundClip = "content-box";
  30430. div.cloneNode(true).style.backgroundClip = "";
  30431. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  30432. jQuery.extend(support, {
  30433. boxSizingReliable: function() {
  30434. computeStyleTests();
  30435. return boxSizingReliableVal;
  30436. },
  30437. pixelBoxStyles: function() {
  30438. computeStyleTests();
  30439. return pixelBoxStylesVal;
  30440. },
  30441. pixelPosition: function() {
  30442. computeStyleTests();
  30443. return pixelPositionVal;
  30444. },
  30445. reliableMarginLeft: function() {
  30446. computeStyleTests();
  30447. return reliableMarginLeftVal;
  30448. },
  30449. scrollboxSize: function() {
  30450. computeStyleTests();
  30451. return scrollboxSizeVal;
  30452. },
  30453. reliableTrDimensions: function() {
  30454. var table, tr, trChild, trStyle;
  30455. if (reliableTrDimensionsVal == null) {
  30456. table = document2.createElement("table");
  30457. tr = document2.createElement("tr");
  30458. trChild = document2.createElement("div");
  30459. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  30460. tr.style.cssText = "border:1px solid";
  30461. tr.style.height = "1px";
  30462. trChild.style.height = "9px";
  30463. trChild.style.display = "block";
  30464. documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
  30465. trStyle = window2.getComputedStyle(tr);
  30466. reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
  30467. documentElement.removeChild(table);
  30468. }
  30469. return reliableTrDimensionsVal;
  30470. }
  30471. });
  30472. })();
  30473. function curCSS(elem, name, computed2) {
  30474. var width2, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
  30475. computed2 = computed2 || getStyles(elem);
  30476. if (computed2) {
  30477. ret = computed2.getPropertyValue(name) || computed2[name];
  30478. if (isCustomProp && ret) {
  30479. ret = ret.replace(rtrimCSS, "$1") || void 0;
  30480. }
  30481. if (ret === "" && !isAttached(elem)) {
  30482. ret = jQuery.style(elem, name);
  30483. }
  30484. if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
  30485. width2 = style.width;
  30486. minWidth = style.minWidth;
  30487. maxWidth = style.maxWidth;
  30488. style.minWidth = style.maxWidth = style.width = ret;
  30489. ret = computed2.width;
  30490. style.width = width2;
  30491. style.minWidth = minWidth;
  30492. style.maxWidth = maxWidth;
  30493. }
  30494. }
  30495. return ret !== void 0 ? ret + "" : ret;
  30496. }
  30497. function addGetHookIf(conditionFn, hookFn) {
  30498. return {
  30499. get: function() {
  30500. if (conditionFn()) {
  30501. delete this.get;
  30502. return;
  30503. }
  30504. return (this.get = hookFn).apply(this, arguments);
  30505. }
  30506. };
  30507. }
  30508. var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
  30509. function vendorPropName(name) {
  30510. var capName = name[0].toUpperCase() + name.slice(1), i2 = cssPrefixes.length;
  30511. while (i2--) {
  30512. name = cssPrefixes[i2] + capName;
  30513. if (name in emptyStyle) {
  30514. return name;
  30515. }
  30516. }
  30517. }
  30518. function finalPropName(name) {
  30519. var final = jQuery.cssProps[name] || vendorProps[name];
  30520. if (final) {
  30521. return final;
  30522. }
  30523. if (name in emptyStyle) {
  30524. return name;
  30525. }
  30526. return vendorProps[name] = vendorPropName(name) || name;
  30527. }
  30528. var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
  30529. letterSpacing: "0",
  30530. fontWeight: "400"
  30531. };
  30532. function setPositiveNumber(_elem, value, subtract) {
  30533. var matches = rcssNum.exec(value);
  30534. return matches ? Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value;
  30535. }
  30536. function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
  30537. var i2 = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
  30538. if (box === (isBorderBox ? "border" : "content")) {
  30539. return 0;
  30540. }
  30541. for (; i2 < 4; i2 += 2) {
  30542. if (box === "margin") {
  30543. marginDelta += jQuery.css(elem, box + cssExpand[i2], true, styles);
  30544. }
  30545. if (!isBorderBox) {
  30546. delta += jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30547. if (box !== "padding") {
  30548. delta += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30549. } else {
  30550. extra += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30551. }
  30552. } else {
  30553. if (box === "content") {
  30554. delta -= jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30555. }
  30556. if (box !== "margin") {
  30557. delta -= jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30558. }
  30559. }
  30560. }
  30561. if (!isBorderBox && computedVal >= 0) {
  30562. delta += Math.max(0, Math.ceil(
  30563. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
  30564. )) || 0;
  30565. }
  30566. return delta + marginDelta;
  30567. }
  30568. function getWidthOrHeight(elem, dimension, extra) {
  30569. var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
  30570. if (rnumnonpx.test(val)) {
  30571. if (!extra) {
  30572. return val;
  30573. }
  30574. val = "auto";
  30575. }
  30576. if ((!support.boxSizingReliable() && isBorderBox || !support.reliableTrDimensions() && nodeName(elem, "tr") || val === "auto" || !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && elem.getClientRects().length) {
  30577. isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
  30578. valueIsBorderBox = offsetProp in elem;
  30579. if (valueIsBorderBox) {
  30580. val = elem[offsetProp];
  30581. }
  30582. }
  30583. val = parseFloat(val) || 0;
  30584. return val + boxModelAdjustment(
  30585. elem,
  30586. dimension,
  30587. extra || (isBorderBox ? "border" : "content"),
  30588. valueIsBorderBox,
  30589. styles,
  30590. val
  30591. ) + "px";
  30592. }
  30593. jQuery.extend({
  30594. cssHooks: {
  30595. opacity: {
  30596. get: function(elem, computed2) {
  30597. if (computed2) {
  30598. var ret = curCSS(elem, "opacity");
  30599. return ret === "" ? "1" : ret;
  30600. }
  30601. }
  30602. }
  30603. },
  30604. cssNumber: {
  30605. animationIterationCount: true,
  30606. aspectRatio: true,
  30607. borderImageSlice: true,
  30608. columnCount: true,
  30609. flexGrow: true,
  30610. flexShrink: true,
  30611. fontWeight: true,
  30612. gridArea: true,
  30613. gridColumn: true,
  30614. gridColumnEnd: true,
  30615. gridColumnStart: true,
  30616. gridRow: true,
  30617. gridRowEnd: true,
  30618. gridRowStart: true,
  30619. lineHeight: true,
  30620. opacity: true,
  30621. order: true,
  30622. orphans: true,
  30623. scale: true,
  30624. widows: true,
  30625. zIndex: true,
  30626. zoom: true,
  30627. fillOpacity: true,
  30628. floodOpacity: true,
  30629. stopOpacity: true,
  30630. strokeMiterlimit: true,
  30631. strokeOpacity: true
  30632. },
  30633. cssProps: {},
  30634. style: function(elem, name, value, extra) {
  30635. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
  30636. return;
  30637. }
  30638. var ret, type2, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name), style = elem.style;
  30639. if (!isCustomProp) {
  30640. name = finalPropName(origName);
  30641. }
  30642. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30643. if (value !== void 0) {
  30644. type2 = typeof value;
  30645. if (type2 === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
  30646. value = adjustCSS(elem, name, ret);
  30647. type2 = "number";
  30648. }
  30649. if (value == null || value !== value) {
  30650. return;
  30651. }
  30652. if (type2 === "number" && !isCustomProp) {
  30653. value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
  30654. }
  30655. if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
  30656. style[name] = "inherit";
  30657. }
  30658. if (!hooks3 || !("set" in hooks3) || (value = hooks3.set(elem, value, extra)) !== void 0) {
  30659. if (isCustomProp) {
  30660. style.setProperty(name, value);
  30661. } else {
  30662. style[name] = value;
  30663. }
  30664. }
  30665. } else {
  30666. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, false, extra)) !== void 0) {
  30667. return ret;
  30668. }
  30669. return style[name];
  30670. }
  30671. },
  30672. css: function(elem, name, extra, styles) {
  30673. var val, num, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name);
  30674. if (!isCustomProp) {
  30675. name = finalPropName(origName);
  30676. }
  30677. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30678. if (hooks3 && "get" in hooks3) {
  30679. val = hooks3.get(elem, true, extra);
  30680. }
  30681. if (val === void 0) {
  30682. val = curCSS(elem, name, styles);
  30683. }
  30684. if (val === "normal" && name in cssNormalTransform) {
  30685. val = cssNormalTransform[name];
  30686. }
  30687. if (extra === "" || extra) {
  30688. num = parseFloat(val);
  30689. return extra === true || isFinite(num) ? num || 0 : val;
  30690. }
  30691. return val;
  30692. }
  30693. });
  30694. jQuery.each(["height", "width"], function(_i, dimension) {
  30695. jQuery.cssHooks[dimension] = {
  30696. get: function(elem, computed2, extra) {
  30697. if (computed2) {
  30698. return rdisplayswap.test(jQuery.css(elem, "display")) && (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
  30699. return getWidthOrHeight(elem, dimension, extra);
  30700. }) : getWidthOrHeight(elem, dimension, extra);
  30701. }
  30702. },
  30703. set: function(elem, value, extra) {
  30704. var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
  30705. elem,
  30706. dimension,
  30707. extra,
  30708. isBorderBox,
  30709. styles
  30710. ) : 0;
  30711. if (isBorderBox && scrollboxSizeBuggy) {
  30712. subtract -= Math.ceil(
  30713. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
  30714. );
  30715. }
  30716. if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
  30717. elem.style[dimension] = value;
  30718. value = jQuery.css(elem, dimension);
  30719. }
  30720. return setPositiveNumber(elem, value, subtract);
  30721. }
  30722. };
  30723. });
  30724. jQuery.cssHooks.marginLeft = addGetHookIf(
  30725. support.reliableMarginLeft,
  30726. function(elem, computed2) {
  30727. if (computed2) {
  30728. return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
  30729. return elem.getBoundingClientRect().left;
  30730. })) + "px";
  30731. }
  30732. }
  30733. );
  30734. jQuery.each({
  30735. margin: "",
  30736. padding: "",
  30737. border: "Width"
  30738. }, function(prefix, suffix) {
  30739. jQuery.cssHooks[prefix + suffix] = {
  30740. expand: function(value) {
  30741. var i2 = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
  30742. for (; i2 < 4; i2++) {
  30743. expanded[prefix + cssExpand[i2] + suffix] = parts[i2] || parts[i2 - 2] || parts[0];
  30744. }
  30745. return expanded;
  30746. }
  30747. };
  30748. if (prefix !== "margin") {
  30749. jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
  30750. }
  30751. });
  30752. jQuery.fn.extend({
  30753. css: function(name, value) {
  30754. return access(this, function(elem, name2, value2) {
  30755. var styles, len, map = {}, i2 = 0;
  30756. if (Array.isArray(name2)) {
  30757. styles = getStyles(elem);
  30758. len = name2.length;
  30759. for (; i2 < len; i2++) {
  30760. map[name2[i2]] = jQuery.css(elem, name2[i2], false, styles);
  30761. }
  30762. return map;
  30763. }
  30764. return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
  30765. }, name, value, arguments.length > 1);
  30766. }
  30767. });
  30768. function Tween(elem, options2, prop, end, easing) {
  30769. return new Tween.prototype.init(elem, options2, prop, end, easing);
  30770. }
  30771. jQuery.Tween = Tween;
  30772. Tween.prototype = {
  30773. constructor: Tween,
  30774. init: function(elem, options2, prop, end, easing, unit) {
  30775. this.elem = elem;
  30776. this.prop = prop;
  30777. this.easing = easing || jQuery.easing._default;
  30778. this.options = options2;
  30779. this.start = this.now = this.cur();
  30780. this.end = end;
  30781. this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
  30782. },
  30783. cur: function() {
  30784. var hooks3 = Tween.propHooks[this.prop];
  30785. return hooks3 && hooks3.get ? hooks3.get(this) : Tween.propHooks._default.get(this);
  30786. },
  30787. run: function(percent) {
  30788. var eased, hooks3 = Tween.propHooks[this.prop];
  30789. if (this.options.duration) {
  30790. this.pos = eased = jQuery.easing[this.easing](
  30791. percent,
  30792. this.options.duration * percent,
  30793. 0,
  30794. 1,
  30795. this.options.duration
  30796. );
  30797. } else {
  30798. this.pos = eased = percent;
  30799. }
  30800. this.now = (this.end - this.start) * eased + this.start;
  30801. if (this.options.step) {
  30802. this.options.step.call(this.elem, this.now, this);
  30803. }
  30804. if (hooks3 && hooks3.set) {
  30805. hooks3.set(this);
  30806. } else {
  30807. Tween.propHooks._default.set(this);
  30808. }
  30809. return this;
  30810. }
  30811. };
  30812. Tween.prototype.init.prototype = Tween.prototype;
  30813. Tween.propHooks = {
  30814. _default: {
  30815. get: function(tween) {
  30816. var result;
  30817. if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
  30818. return tween.elem[tween.prop];
  30819. }
  30820. result = jQuery.css(tween.elem, tween.prop, "");
  30821. return !result || result === "auto" ? 0 : result;
  30822. },
  30823. set: function(tween) {
  30824. if (jQuery.fx.step[tween.prop]) {
  30825. jQuery.fx.step[tween.prop](tween);
  30826. } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
  30827. jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
  30828. } else {
  30829. tween.elem[tween.prop] = tween.now;
  30830. }
  30831. }
  30832. }
  30833. };
  30834. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  30835. set: function(tween) {
  30836. if (tween.elem.nodeType && tween.elem.parentNode) {
  30837. tween.elem[tween.prop] = tween.now;
  30838. }
  30839. }
  30840. };
  30841. jQuery.easing = {
  30842. linear: function(p) {
  30843. return p;
  30844. },
  30845. swing: function(p) {
  30846. return 0.5 - Math.cos(p * Math.PI) / 2;
  30847. },
  30848. _default: "swing"
  30849. };
  30850. jQuery.fx = Tween.prototype.init;
  30851. jQuery.fx.step = {};
  30852. var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
  30853. function schedule() {
  30854. if (inProgress) {
  30855. if (document2.hidden === false && window2.requestAnimationFrame) {
  30856. window2.requestAnimationFrame(schedule);
  30857. } else {
  30858. window2.setTimeout(schedule, jQuery.fx.interval);
  30859. }
  30860. jQuery.fx.tick();
  30861. }
  30862. }
  30863. function createFxNow() {
  30864. window2.setTimeout(function() {
  30865. fxNow = void 0;
  30866. });
  30867. return fxNow = Date.now();
  30868. }
  30869. function genFx(type2, includeWidth) {
  30870. var which, i2 = 0, attrs = { height: type2 };
  30871. includeWidth = includeWidth ? 1 : 0;
  30872. for (; i2 < 4; i2 += 2 - includeWidth) {
  30873. which = cssExpand[i2];
  30874. attrs["margin" + which] = attrs["padding" + which] = type2;
  30875. }
  30876. if (includeWidth) {
  30877. attrs.opacity = attrs.width = type2;
  30878. }
  30879. return attrs;
  30880. }
  30881. function createTween(value, prop, animation) {
  30882. var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index2 = 0, length = collection.length;
  30883. for (; index2 < length; index2++) {
  30884. if (tween = collection[index2].call(animation, prop, value)) {
  30885. return tween;
  30886. }
  30887. }
  30888. }
  30889. function defaultPrefilter(elem, props, opts) {
  30890. var prop, value, toggle, hooks3, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
  30891. if (!opts.queue) {
  30892. hooks3 = jQuery._queueHooks(elem, "fx");
  30893. if (hooks3.unqueued == null) {
  30894. hooks3.unqueued = 0;
  30895. oldfire = hooks3.empty.fire;
  30896. hooks3.empty.fire = function() {
  30897. if (!hooks3.unqueued) {
  30898. oldfire();
  30899. }
  30900. };
  30901. }
  30902. hooks3.unqueued++;
  30903. anim.always(function() {
  30904. anim.always(function() {
  30905. hooks3.unqueued--;
  30906. if (!jQuery.queue(elem, "fx").length) {
  30907. hooks3.empty.fire();
  30908. }
  30909. });
  30910. });
  30911. }
  30912. for (prop in props) {
  30913. value = props[prop];
  30914. if (rfxtypes.test(value)) {
  30915. delete props[prop];
  30916. toggle = toggle || value === "toggle";
  30917. if (value === (hidden ? "hide" : "show")) {
  30918. if (value === "show" && dataShow && dataShow[prop] !== void 0) {
  30919. hidden = true;
  30920. } else {
  30921. continue;
  30922. }
  30923. }
  30924. orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
  30925. }
  30926. }
  30927. propTween = !jQuery.isEmptyObject(props);
  30928. if (!propTween && jQuery.isEmptyObject(orig)) {
  30929. return;
  30930. }
  30931. if (isBox && elem.nodeType === 1) {
  30932. opts.overflow = [style.overflow, style.overflowX, style.overflowY];
  30933. restoreDisplay = dataShow && dataShow.display;
  30934. if (restoreDisplay == null) {
  30935. restoreDisplay = dataPriv.get(elem, "display");
  30936. }
  30937. display = jQuery.css(elem, "display");
  30938. if (display === "none") {
  30939. if (restoreDisplay) {
  30940. display = restoreDisplay;
  30941. } else {
  30942. showHide([elem], true);
  30943. restoreDisplay = elem.style.display || restoreDisplay;
  30944. display = jQuery.css(elem, "display");
  30945. showHide([elem]);
  30946. }
  30947. }
  30948. if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
  30949. if (jQuery.css(elem, "float") === "none") {
  30950. if (!propTween) {
  30951. anim.done(function() {
  30952. style.display = restoreDisplay;
  30953. });
  30954. if (restoreDisplay == null) {
  30955. display = style.display;
  30956. restoreDisplay = display === "none" ? "" : display;
  30957. }
  30958. }
  30959. style.display = "inline-block";
  30960. }
  30961. }
  30962. }
  30963. if (opts.overflow) {
  30964. style.overflow = "hidden";
  30965. anim.always(function() {
  30966. style.overflow = opts.overflow[0];
  30967. style.overflowX = opts.overflow[1];
  30968. style.overflowY = opts.overflow[2];
  30969. });
  30970. }
  30971. propTween = false;
  30972. for (prop in orig) {
  30973. if (!propTween) {
  30974. if (dataShow) {
  30975. if ("hidden" in dataShow) {
  30976. hidden = dataShow.hidden;
  30977. }
  30978. } else {
  30979. dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
  30980. }
  30981. if (toggle) {
  30982. dataShow.hidden = !hidden;
  30983. }
  30984. if (hidden) {
  30985. showHide([elem], true);
  30986. }
  30987. anim.done(function() {
  30988. if (!hidden) {
  30989. showHide([elem]);
  30990. }
  30991. dataPriv.remove(elem, "fxshow");
  30992. for (prop in orig) {
  30993. jQuery.style(elem, prop, orig[prop]);
  30994. }
  30995. });
  30996. }
  30997. propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
  30998. if (!(prop in dataShow)) {
  30999. dataShow[prop] = propTween.start;
  31000. if (hidden) {
  31001. propTween.end = propTween.start;
  31002. propTween.start = 0;
  31003. }
  31004. }
  31005. }
  31006. }
  31007. function propFilter(props, specialEasing) {
  31008. var index2, name, easing, value, hooks3;
  31009. for (index2 in props) {
  31010. name = camelCase3(index2);
  31011. easing = specialEasing[name];
  31012. value = props[index2];
  31013. if (Array.isArray(value)) {
  31014. easing = value[1];
  31015. value = props[index2] = value[0];
  31016. }
  31017. if (index2 !== name) {
  31018. props[name] = value;
  31019. delete props[index2];
  31020. }
  31021. hooks3 = jQuery.cssHooks[name];
  31022. if (hooks3 && "expand" in hooks3) {
  31023. value = hooks3.expand(value);
  31024. delete props[name];
  31025. for (index2 in value) {
  31026. if (!(index2 in props)) {
  31027. props[index2] = value[index2];
  31028. specialEasing[index2] = easing;
  31029. }
  31030. }
  31031. } else {
  31032. specialEasing[name] = easing;
  31033. }
  31034. }
  31035. }
  31036. function Animation(elem, properties, options2) {
  31037. var result, stopped, index2 = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
  31038. delete tick.elem;
  31039. }), tick = function() {
  31040. if (stopped) {
  31041. return false;
  31042. }
  31043. var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index3 = 0, length2 = animation.tweens.length;
  31044. for (; index3 < length2; index3++) {
  31045. animation.tweens[index3].run(percent);
  31046. }
  31047. deferred.notifyWith(elem, [animation, percent, remaining]);
  31048. if (percent < 1 && length2) {
  31049. return remaining;
  31050. }
  31051. if (!length2) {
  31052. deferred.notifyWith(elem, [animation, 1, 0]);
  31053. }
  31054. deferred.resolveWith(elem, [animation]);
  31055. return false;
  31056. }, animation = deferred.promise({
  31057. elem,
  31058. props: jQuery.extend({}, properties),
  31059. opts: jQuery.extend(true, {
  31060. specialEasing: {},
  31061. easing: jQuery.easing._default
  31062. }, options2),
  31063. originalProperties: properties,
  31064. originalOptions: options2,
  31065. startTime: fxNow || createFxNow(),
  31066. duration: options2.duration,
  31067. tweens: [],
  31068. createTween: function(prop, end) {
  31069. var tween = jQuery.Tween(
  31070. elem,
  31071. animation.opts,
  31072. prop,
  31073. end,
  31074. animation.opts.specialEasing[prop] || animation.opts.easing
  31075. );
  31076. animation.tweens.push(tween);
  31077. return tween;
  31078. },
  31079. stop: function(gotoEnd) {
  31080. var index3 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
  31081. if (stopped) {
  31082. return this;
  31083. }
  31084. stopped = true;
  31085. for (; index3 < length2; index3++) {
  31086. animation.tweens[index3].run(1);
  31087. }
  31088. if (gotoEnd) {
  31089. deferred.notifyWith(elem, [animation, 1, 0]);
  31090. deferred.resolveWith(elem, [animation, gotoEnd]);
  31091. } else {
  31092. deferred.rejectWith(elem, [animation, gotoEnd]);
  31093. }
  31094. return this;
  31095. }
  31096. }), props = animation.props;
  31097. propFilter(props, animation.opts.specialEasing);
  31098. for (; index2 < length; index2++) {
  31099. result = Animation.prefilters[index2].call(animation, elem, props, animation.opts);
  31100. if (result) {
  31101. if (isFunction2(result.stop)) {
  31102. jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
  31103. }
  31104. return result;
  31105. }
  31106. }
  31107. jQuery.map(props, createTween, animation);
  31108. if (isFunction2(animation.opts.start)) {
  31109. animation.opts.start.call(elem, animation);
  31110. }
  31111. animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
  31112. jQuery.fx.timer(
  31113. jQuery.extend(tick, {
  31114. elem,
  31115. anim: animation,
  31116. queue: animation.opts.queue
  31117. })
  31118. );
  31119. return animation;
  31120. }
  31121. jQuery.Animation = jQuery.extend(Animation, {
  31122. tweeners: {
  31123. "*": [function(prop, value) {
  31124. var tween = this.createTween(prop, value);
  31125. adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
  31126. return tween;
  31127. }]
  31128. },
  31129. tweener: function(props, callback2) {
  31130. if (isFunction2(props)) {
  31131. callback2 = props;
  31132. props = ["*"];
  31133. } else {
  31134. props = props.match(rnothtmlwhite);
  31135. }
  31136. var prop, index2 = 0, length = props.length;
  31137. for (; index2 < length; index2++) {
  31138. prop = props[index2];
  31139. Animation.tweeners[prop] = Animation.tweeners[prop] || [];
  31140. Animation.tweeners[prop].unshift(callback2);
  31141. }
  31142. },
  31143. prefilters: [defaultPrefilter],
  31144. prefilter: function(callback2, prepend) {
  31145. if (prepend) {
  31146. Animation.prefilters.unshift(callback2);
  31147. } else {
  31148. Animation.prefilters.push(callback2);
  31149. }
  31150. }
  31151. });
  31152. jQuery.speed = function(speed, easing, fn2) {
  31153. var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  31154. complete: fn2 || !fn2 && easing || isFunction2(speed) && speed,
  31155. duration: speed,
  31156. easing: fn2 && easing || easing && !isFunction2(easing) && easing
  31157. };
  31158. if (jQuery.fx.off) {
  31159. opt.duration = 0;
  31160. } else {
  31161. if (typeof opt.duration !== "number") {
  31162. if (opt.duration in jQuery.fx.speeds) {
  31163. opt.duration = jQuery.fx.speeds[opt.duration];
  31164. } else {
  31165. opt.duration = jQuery.fx.speeds._default;
  31166. }
  31167. }
  31168. }
  31169. if (opt.queue == null || opt.queue === true) {
  31170. opt.queue = "fx";
  31171. }
  31172. opt.old = opt.complete;
  31173. opt.complete = function() {
  31174. if (isFunction2(opt.old)) {
  31175. opt.old.call(this);
  31176. }
  31177. if (opt.queue) {
  31178. jQuery.dequeue(this, opt.queue);
  31179. }
  31180. };
  31181. return opt;
  31182. };
  31183. jQuery.fn.extend({
  31184. fadeTo: function(speed, to, easing, callback2) {
  31185. return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback2);
  31186. },
  31187. animate: function(prop, speed, easing, callback2) {
  31188. var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback2), doAnimation = function() {
  31189. var anim = Animation(this, jQuery.extend({}, prop), optall);
  31190. if (empty || dataPriv.get(this, "finish")) {
  31191. anim.stop(true);
  31192. }
  31193. };
  31194. doAnimation.finish = doAnimation;
  31195. return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
  31196. },
  31197. stop: function(type2, clearQueue, gotoEnd) {
  31198. var stopQueue = function(hooks3) {
  31199. var stop = hooks3.stop;
  31200. delete hooks3.stop;
  31201. stop(gotoEnd);
  31202. };
  31203. if (typeof type2 !== "string") {
  31204. gotoEnd = clearQueue;
  31205. clearQueue = type2;
  31206. type2 = void 0;
  31207. }
  31208. if (clearQueue) {
  31209. this.queue(type2 || "fx", []);
  31210. }
  31211. return this.each(function() {
  31212. var dequeue3 = true, index2 = type2 != null && type2 + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
  31213. if (index2) {
  31214. if (data[index2] && data[index2].stop) {
  31215. stopQueue(data[index2]);
  31216. }
  31217. } else {
  31218. for (index2 in data) {
  31219. if (data[index2] && data[index2].stop && rrun.test(index2)) {
  31220. stopQueue(data[index2]);
  31221. }
  31222. }
  31223. }
  31224. for (index2 = timers.length; index2--; ) {
  31225. if (timers[index2].elem === this && (type2 == null || timers[index2].queue === type2)) {
  31226. timers[index2].anim.stop(gotoEnd);
  31227. dequeue3 = false;
  31228. timers.splice(index2, 1);
  31229. }
  31230. }
  31231. if (dequeue3 || !gotoEnd) {
  31232. jQuery.dequeue(this, type2);
  31233. }
  31234. });
  31235. },
  31236. finish: function(type2) {
  31237. if (type2 !== false) {
  31238. type2 = type2 || "fx";
  31239. }
  31240. return this.each(function() {
  31241. var index2, data = dataPriv.get(this), queue = data[type2 + "queue"], hooks3 = data[type2 + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
  31242. data.finish = true;
  31243. jQuery.queue(this, type2, []);
  31244. if (hooks3 && hooks3.stop) {
  31245. hooks3.stop.call(this, true);
  31246. }
  31247. for (index2 = timers.length; index2--; ) {
  31248. if (timers[index2].elem === this && timers[index2].queue === type2) {
  31249. timers[index2].anim.stop(true);
  31250. timers.splice(index2, 1);
  31251. }
  31252. }
  31253. for (index2 = 0; index2 < length; index2++) {
  31254. if (queue[index2] && queue[index2].finish) {
  31255. queue[index2].finish.call(this);
  31256. }
  31257. }
  31258. delete data.finish;
  31259. });
  31260. }
  31261. });
  31262. jQuery.each(["toggle", "show", "hide"], function(_i, name) {
  31263. var cssFn = jQuery.fn[name];
  31264. jQuery.fn[name] = function(speed, easing, callback2) {
  31265. return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback2);
  31266. };
  31267. });
  31268. jQuery.each({
  31269. slideDown: genFx("show"),
  31270. slideUp: genFx("hide"),
  31271. slideToggle: genFx("toggle"),
  31272. fadeIn: { opacity: "show" },
  31273. fadeOut: { opacity: "hide" },
  31274. fadeToggle: { opacity: "toggle" }
  31275. }, function(name, props) {
  31276. jQuery.fn[name] = function(speed, easing, callback2) {
  31277. return this.animate(props, speed, easing, callback2);
  31278. };
  31279. });
  31280. jQuery.timers = [];
  31281. jQuery.fx.tick = function() {
  31282. var timer, i2 = 0, timers = jQuery.timers;
  31283. fxNow = Date.now();
  31284. for (; i2 < timers.length; i2++) {
  31285. timer = timers[i2];
  31286. if (!timer() && timers[i2] === timer) {
  31287. timers.splice(i2--, 1);
  31288. }
  31289. }
  31290. if (!timers.length) {
  31291. jQuery.fx.stop();
  31292. }
  31293. fxNow = void 0;
  31294. };
  31295. jQuery.fx.timer = function(timer) {
  31296. jQuery.timers.push(timer);
  31297. jQuery.fx.start();
  31298. };
  31299. jQuery.fx.interval = 13;
  31300. jQuery.fx.start = function() {
  31301. if (inProgress) {
  31302. return;
  31303. }
  31304. inProgress = true;
  31305. schedule();
  31306. };
  31307. jQuery.fx.stop = function() {
  31308. inProgress = null;
  31309. };
  31310. jQuery.fx.speeds = {
  31311. slow: 600,
  31312. fast: 200,
  31313. _default: 400
  31314. };
  31315. jQuery.fn.delay = function(time, type2) {
  31316. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  31317. type2 = type2 || "fx";
  31318. return this.queue(type2, function(next, hooks3) {
  31319. var timeout = window2.setTimeout(next, time);
  31320. hooks3.stop = function() {
  31321. window2.clearTimeout(timeout);
  31322. };
  31323. });
  31324. };
  31325. (function() {
  31326. var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
  31327. input.type = "checkbox";
  31328. support.checkOn = input.value !== "";
  31329. support.optSelected = opt.selected;
  31330. input = document2.createElement("input");
  31331. input.value = "t";
  31332. input.type = "radio";
  31333. support.radioValue = input.value === "t";
  31334. })();
  31335. var boolHook, attrHandle = jQuery.expr.attrHandle;
  31336. jQuery.fn.extend({
  31337. attr: function(name, value) {
  31338. return access(this, jQuery.attr, name, value, arguments.length > 1);
  31339. },
  31340. removeAttr: function(name) {
  31341. return this.each(function() {
  31342. jQuery.removeAttr(this, name);
  31343. });
  31344. }
  31345. });
  31346. jQuery.extend({
  31347. attr: function(elem, name, value) {
  31348. var ret, hooks3, nType = elem.nodeType;
  31349. if (nType === 3 || nType === 8 || nType === 2) {
  31350. return;
  31351. }
  31352. if (typeof elem.getAttribute === "undefined") {
  31353. return jQuery.prop(elem, name, value);
  31354. }
  31355. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31356. hooks3 = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
  31357. }
  31358. if (value !== void 0) {
  31359. if (value === null) {
  31360. jQuery.removeAttr(elem, name);
  31361. return;
  31362. }
  31363. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31364. return ret;
  31365. }
  31366. elem.setAttribute(name, value + "");
  31367. return value;
  31368. }
  31369. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31370. return ret;
  31371. }
  31372. ret = jQuery.find.attr(elem, name);
  31373. return ret == null ? void 0 : ret;
  31374. },
  31375. attrHooks: {
  31376. type: {
  31377. set: function(elem, value) {
  31378. if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
  31379. var val = elem.value;
  31380. elem.setAttribute("type", value);
  31381. if (val) {
  31382. elem.value = val;
  31383. }
  31384. return value;
  31385. }
  31386. }
  31387. }
  31388. },
  31389. removeAttr: function(elem, value) {
  31390. var name, i2 = 0, attrNames = value && value.match(rnothtmlwhite);
  31391. if (attrNames && elem.nodeType === 1) {
  31392. while (name = attrNames[i2++]) {
  31393. elem.removeAttribute(name);
  31394. }
  31395. }
  31396. }
  31397. });
  31398. boolHook = {
  31399. set: function(elem, value, name) {
  31400. if (value === false) {
  31401. jQuery.removeAttr(elem, name);
  31402. } else {
  31403. elem.setAttribute(name, name);
  31404. }
  31405. return name;
  31406. }
  31407. };
  31408. jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
  31409. var getter = attrHandle[name] || jQuery.find.attr;
  31410. attrHandle[name] = function(elem, name2, isXML) {
  31411. var ret, handle, lowercaseName = name2.toLowerCase();
  31412. if (!isXML) {
  31413. handle = attrHandle[lowercaseName];
  31414. attrHandle[lowercaseName] = ret;
  31415. ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
  31416. attrHandle[lowercaseName] = handle;
  31417. }
  31418. return ret;
  31419. };
  31420. });
  31421. var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
  31422. jQuery.fn.extend({
  31423. prop: function(name, value) {
  31424. return access(this, jQuery.prop, name, value, arguments.length > 1);
  31425. },
  31426. removeProp: function(name) {
  31427. return this.each(function() {
  31428. delete this[jQuery.propFix[name] || name];
  31429. });
  31430. }
  31431. });
  31432. jQuery.extend({
  31433. prop: function(elem, name, value) {
  31434. var ret, hooks3, nType = elem.nodeType;
  31435. if (nType === 3 || nType === 8 || nType === 2) {
  31436. return;
  31437. }
  31438. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31439. name = jQuery.propFix[name] || name;
  31440. hooks3 = jQuery.propHooks[name];
  31441. }
  31442. if (value !== void 0) {
  31443. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31444. return ret;
  31445. }
  31446. return elem[name] = value;
  31447. }
  31448. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31449. return ret;
  31450. }
  31451. return elem[name];
  31452. },
  31453. propHooks: {
  31454. tabIndex: {
  31455. get: function(elem) {
  31456. var tabindex = jQuery.find.attr(elem, "tabindex");
  31457. if (tabindex) {
  31458. return parseInt(tabindex, 10);
  31459. }
  31460. if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
  31461. return 0;
  31462. }
  31463. return -1;
  31464. }
  31465. }
  31466. },
  31467. propFix: {
  31468. "for": "htmlFor",
  31469. "class": "className"
  31470. }
  31471. });
  31472. if (!support.optSelected) {
  31473. jQuery.propHooks.selected = {
  31474. get: function(elem) {
  31475. var parent = elem.parentNode;
  31476. if (parent && parent.parentNode) {
  31477. parent.parentNode.selectedIndex;
  31478. }
  31479. return null;
  31480. },
  31481. set: function(elem) {
  31482. var parent = elem.parentNode;
  31483. if (parent) {
  31484. parent.selectedIndex;
  31485. if (parent.parentNode) {
  31486. parent.parentNode.selectedIndex;
  31487. }
  31488. }
  31489. }
  31490. };
  31491. }
  31492. jQuery.each([
  31493. "tabIndex",
  31494. "readOnly",
  31495. "maxLength",
  31496. "cellSpacing",
  31497. "cellPadding",
  31498. "rowSpan",
  31499. "colSpan",
  31500. "useMap",
  31501. "frameBorder",
  31502. "contentEditable"
  31503. ], function() {
  31504. jQuery.propFix[this.toLowerCase()] = this;
  31505. });
  31506. function stripAndCollapse(value) {
  31507. var tokens = value.match(rnothtmlwhite) || [];
  31508. return tokens.join(" ");
  31509. }
  31510. function getClass2(elem) {
  31511. return elem.getAttribute && elem.getAttribute("class") || "";
  31512. }
  31513. function classesToArray(value) {
  31514. if (Array.isArray(value)) {
  31515. return value;
  31516. }
  31517. if (typeof value === "string") {
  31518. return value.match(rnothtmlwhite) || [];
  31519. }
  31520. return [];
  31521. }
  31522. jQuery.fn.extend({
  31523. addClass: function(value) {
  31524. var classNames, cur, curValue, className, i2, finalValue;
  31525. if (isFunction2(value)) {
  31526. return this.each(function(j) {
  31527. jQuery(this).addClass(value.call(this, j, getClass2(this)));
  31528. });
  31529. }
  31530. classNames = classesToArray(value);
  31531. if (classNames.length) {
  31532. return this.each(function() {
  31533. curValue = getClass2(this);
  31534. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31535. if (cur) {
  31536. for (i2 = 0; i2 < classNames.length; i2++) {
  31537. className = classNames[i2];
  31538. if (cur.indexOf(" " + className + " ") < 0) {
  31539. cur += className + " ";
  31540. }
  31541. }
  31542. finalValue = stripAndCollapse(cur);
  31543. if (curValue !== finalValue) {
  31544. this.setAttribute("class", finalValue);
  31545. }
  31546. }
  31547. });
  31548. }
  31549. return this;
  31550. },
  31551. removeClass: function(value) {
  31552. var classNames, cur, curValue, className, i2, finalValue;
  31553. if (isFunction2(value)) {
  31554. return this.each(function(j) {
  31555. jQuery(this).removeClass(value.call(this, j, getClass2(this)));
  31556. });
  31557. }
  31558. if (!arguments.length) {
  31559. return this.attr("class", "");
  31560. }
  31561. classNames = classesToArray(value);
  31562. if (classNames.length) {
  31563. return this.each(function() {
  31564. curValue = getClass2(this);
  31565. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31566. if (cur) {
  31567. for (i2 = 0; i2 < classNames.length; i2++) {
  31568. className = classNames[i2];
  31569. while (cur.indexOf(" " + className + " ") > -1) {
  31570. cur = cur.replace(" " + className + " ", " ");
  31571. }
  31572. }
  31573. finalValue = stripAndCollapse(cur);
  31574. if (curValue !== finalValue) {
  31575. this.setAttribute("class", finalValue);
  31576. }
  31577. }
  31578. });
  31579. }
  31580. return this;
  31581. },
  31582. toggleClass: function(value, stateVal) {
  31583. var classNames, className, i2, self2, type2 = typeof value, isValidValue = type2 === "string" || Array.isArray(value);
  31584. if (isFunction2(value)) {
  31585. return this.each(function(i3) {
  31586. jQuery(this).toggleClass(
  31587. value.call(this, i3, getClass2(this), stateVal),
  31588. stateVal
  31589. );
  31590. });
  31591. }
  31592. if (typeof stateVal === "boolean" && isValidValue) {
  31593. return stateVal ? this.addClass(value) : this.removeClass(value);
  31594. }
  31595. classNames = classesToArray(value);
  31596. return this.each(function() {
  31597. if (isValidValue) {
  31598. self2 = jQuery(this);
  31599. for (i2 = 0; i2 < classNames.length; i2++) {
  31600. className = classNames[i2];
  31601. if (self2.hasClass(className)) {
  31602. self2.removeClass(className);
  31603. } else {
  31604. self2.addClass(className);
  31605. }
  31606. }
  31607. } else if (value === void 0 || type2 === "boolean") {
  31608. className = getClass2(this);
  31609. if (className) {
  31610. dataPriv.set(this, "__className__", className);
  31611. }
  31612. if (this.setAttribute) {
  31613. this.setAttribute(
  31614. "class",
  31615. className || value === false ? "" : dataPriv.get(this, "__className__") || ""
  31616. );
  31617. }
  31618. }
  31619. });
  31620. },
  31621. hasClass: function(selector) {
  31622. var className, elem, i2 = 0;
  31623. className = " " + selector + " ";
  31624. while (elem = this[i2++]) {
  31625. if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass2(elem)) + " ").indexOf(className) > -1) {
  31626. return true;
  31627. }
  31628. }
  31629. return false;
  31630. }
  31631. });
  31632. var rreturn = /\r/g;
  31633. jQuery.fn.extend({
  31634. val: function(value) {
  31635. var hooks3, ret, valueIsFunction, elem = this[0];
  31636. if (!arguments.length) {
  31637. if (elem) {
  31638. hooks3 = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  31639. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, "value")) !== void 0) {
  31640. return ret;
  31641. }
  31642. ret = elem.value;
  31643. if (typeof ret === "string") {
  31644. return ret.replace(rreturn, "");
  31645. }
  31646. return ret == null ? "" : ret;
  31647. }
  31648. return;
  31649. }
  31650. valueIsFunction = isFunction2(value);
  31651. return this.each(function(i2) {
  31652. var val;
  31653. if (this.nodeType !== 1) {
  31654. return;
  31655. }
  31656. if (valueIsFunction) {
  31657. val = value.call(this, i2, jQuery(this).val());
  31658. } else {
  31659. val = value;
  31660. }
  31661. if (val == null) {
  31662. val = "";
  31663. } else if (typeof val === "number") {
  31664. val += "";
  31665. } else if (Array.isArray(val)) {
  31666. val = jQuery.map(val, function(value2) {
  31667. return value2 == null ? "" : value2 + "";
  31668. });
  31669. }
  31670. hooks3 = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
  31671. if (!hooks3 || !("set" in hooks3) || hooks3.set(this, val, "value") === void 0) {
  31672. this.value = val;
  31673. }
  31674. });
  31675. }
  31676. });
  31677. jQuery.extend({
  31678. valHooks: {
  31679. option: {
  31680. get: function(elem) {
  31681. var val = jQuery.find.attr(elem, "value");
  31682. return val != null ? val : stripAndCollapse(jQuery.text(elem));
  31683. }
  31684. },
  31685. select: {
  31686. get: function(elem) {
  31687. var value, option, i2, options2 = elem.options, index2 = elem.selectedIndex, one3 = elem.type === "select-one", values3 = one3 ? null : [], max2 = one3 ? index2 + 1 : options2.length;
  31688. if (index2 < 0) {
  31689. i2 = max2;
  31690. } else {
  31691. i2 = one3 ? index2 : 0;
  31692. }
  31693. for (; i2 < max2; i2++) {
  31694. option = options2[i2];
  31695. if ((option.selected || i2 === index2) && !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
  31696. value = jQuery(option).val();
  31697. if (one3) {
  31698. return value;
  31699. }
  31700. values3.push(value);
  31701. }
  31702. }
  31703. return values3;
  31704. },
  31705. set: function(elem, value) {
  31706. var optionSet, option, options2 = elem.options, values3 = jQuery.makeArray(value), i2 = options2.length;
  31707. while (i2--) {
  31708. option = options2[i2];
  31709. if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values3) > -1) {
  31710. optionSet = true;
  31711. }
  31712. }
  31713. if (!optionSet) {
  31714. elem.selectedIndex = -1;
  31715. }
  31716. return values3;
  31717. }
  31718. }
  31719. }
  31720. });
  31721. jQuery.each(["radio", "checkbox"], function() {
  31722. jQuery.valHooks[this] = {
  31723. set: function(elem, value) {
  31724. if (Array.isArray(value)) {
  31725. return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
  31726. }
  31727. }
  31728. };
  31729. if (!support.checkOn) {
  31730. jQuery.valHooks[this].get = function(elem) {
  31731. return elem.getAttribute("value") === null ? "on" : elem.value;
  31732. };
  31733. }
  31734. });
  31735. var location = window2.location;
  31736. var nonce = { guid: Date.now() };
  31737. var rquery = /\?/;
  31738. jQuery.parseXML = function(data) {
  31739. var xml, parserErrorElem;
  31740. if (!data || typeof data !== "string") {
  31741. return null;
  31742. }
  31743. try {
  31744. xml = new window2.DOMParser().parseFromString(data, "text/xml");
  31745. } catch (e) {
  31746. }
  31747. parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
  31748. if (!xml || parserErrorElem) {
  31749. jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
  31750. return el.textContent;
  31751. }).join("\n") : data));
  31752. }
  31753. return xml;
  31754. };
  31755. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
  31756. e.stopPropagation();
  31757. };
  31758. jQuery.extend(jQuery.event, {
  31759. trigger: function(event2, data, elem, onlyHandlers) {
  31760. var i2, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type2 = hasOwn2.call(event2, "type") ? event2.type : event2, namespaces = hasOwn2.call(event2, "namespace") ? event2.namespace.split(".") : [];
  31761. cur = lastElement = tmp = elem = elem || document2;
  31762. if (elem.nodeType === 3 || elem.nodeType === 8) {
  31763. return;
  31764. }
  31765. if (rfocusMorph.test(type2 + jQuery.event.triggered)) {
  31766. return;
  31767. }
  31768. if (type2.indexOf(".") > -1) {
  31769. namespaces = type2.split(".");
  31770. type2 = namespaces.shift();
  31771. namespaces.sort();
  31772. }
  31773. ontype = type2.indexOf(":") < 0 && "on" + type2;
  31774. event2 = event2[jQuery.expando] ? event2 : new jQuery.Event(type2, typeof event2 === "object" && event2);
  31775. event2.isTrigger = onlyHandlers ? 2 : 3;
  31776. event2.namespace = namespaces.join(".");
  31777. event2.rnamespace = event2.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
  31778. event2.result = void 0;
  31779. if (!event2.target) {
  31780. event2.target = elem;
  31781. }
  31782. data = data == null ? [event2] : jQuery.makeArray(data, [event2]);
  31783. special = jQuery.event.special[type2] || {};
  31784. if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
  31785. return;
  31786. }
  31787. if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
  31788. bubbleType = special.delegateType || type2;
  31789. if (!rfocusMorph.test(bubbleType + type2)) {
  31790. cur = cur.parentNode;
  31791. }
  31792. for (; cur; cur = cur.parentNode) {
  31793. eventPath.push(cur);
  31794. tmp = cur;
  31795. }
  31796. if (tmp === (elem.ownerDocument || document2)) {
  31797. eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
  31798. }
  31799. }
  31800. i2 = 0;
  31801. while ((cur = eventPath[i2++]) && !event2.isPropagationStopped()) {
  31802. lastElement = cur;
  31803. event2.type = i2 > 1 ? bubbleType : special.bindType || type2;
  31804. handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event2.type] && dataPriv.get(cur, "handle");
  31805. if (handle) {
  31806. handle.apply(cur, data);
  31807. }
  31808. handle = ontype && cur[ontype];
  31809. if (handle && handle.apply && acceptData(cur)) {
  31810. event2.result = handle.apply(cur, data);
  31811. if (event2.result === false) {
  31812. event2.preventDefault();
  31813. }
  31814. }
  31815. }
  31816. event2.type = type2;
  31817. if (!onlyHandlers && !event2.isDefaultPrevented()) {
  31818. if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
  31819. if (ontype && isFunction2(elem[type2]) && !isWindow(elem)) {
  31820. tmp = elem[ontype];
  31821. if (tmp) {
  31822. elem[ontype] = null;
  31823. }
  31824. jQuery.event.triggered = type2;
  31825. if (event2.isPropagationStopped()) {
  31826. lastElement.addEventListener(type2, stopPropagationCallback);
  31827. }
  31828. elem[type2]();
  31829. if (event2.isPropagationStopped()) {
  31830. lastElement.removeEventListener(type2, stopPropagationCallback);
  31831. }
  31832. jQuery.event.triggered = void 0;
  31833. if (tmp) {
  31834. elem[ontype] = tmp;
  31835. }
  31836. }
  31837. }
  31838. }
  31839. return event2.result;
  31840. },
  31841. simulate: function(type2, elem, event2) {
  31842. var e = jQuery.extend(
  31843. new jQuery.Event(),
  31844. event2,
  31845. {
  31846. type: type2,
  31847. isSimulated: true
  31848. }
  31849. );
  31850. jQuery.event.trigger(e, null, elem);
  31851. }
  31852. });
  31853. jQuery.fn.extend({
  31854. trigger: function(type2, data) {
  31855. return this.each(function() {
  31856. jQuery.event.trigger(type2, data, this);
  31857. });
  31858. },
  31859. triggerHandler: function(type2, data) {
  31860. var elem = this[0];
  31861. if (elem) {
  31862. return jQuery.event.trigger(type2, data, elem, true);
  31863. }
  31864. }
  31865. });
  31866. var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
  31867. function buildParams(prefix, obj, traditional, add) {
  31868. var name;
  31869. if (Array.isArray(obj)) {
  31870. jQuery.each(obj, function(i2, v) {
  31871. if (traditional || rbracket.test(prefix)) {
  31872. add(prefix, v);
  31873. } else {
  31874. buildParams(
  31875. prefix + "[" + (typeof v === "object" && v != null ? i2 : "") + "]",
  31876. v,
  31877. traditional,
  31878. add
  31879. );
  31880. }
  31881. });
  31882. } else if (!traditional && toType(obj) === "object") {
  31883. for (name in obj) {
  31884. buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
  31885. }
  31886. } else {
  31887. add(prefix, obj);
  31888. }
  31889. }
  31890. jQuery.param = function(a, traditional) {
  31891. var prefix, s = [], add = function(key, valueOrFunction) {
  31892. var value = isFunction2(valueOrFunction) ? valueOrFunction() : valueOrFunction;
  31893. s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
  31894. };
  31895. if (a == null) {
  31896. return "";
  31897. }
  31898. if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
  31899. jQuery.each(a, function() {
  31900. add(this.name, this.value);
  31901. });
  31902. } else {
  31903. for (prefix in a) {
  31904. buildParams(prefix, a[prefix], traditional, add);
  31905. }
  31906. }
  31907. return s.join("&");
  31908. };
  31909. jQuery.fn.extend({
  31910. serialize: function() {
  31911. return jQuery.param(this.serializeArray());
  31912. },
  31913. serializeArray: function() {
  31914. return this.map(function() {
  31915. var elements = jQuery.prop(this, "elements");
  31916. return elements ? jQuery.makeArray(elements) : this;
  31917. }).filter(function() {
  31918. var type2 = this.type;
  31919. return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type2) && (this.checked || !rcheckableType.test(type2));
  31920. }).map(function(_i, elem) {
  31921. var val = jQuery(this).val();
  31922. if (val == null) {
  31923. return null;
  31924. }
  31925. if (Array.isArray(val)) {
  31926. return jQuery.map(val, function(val2) {
  31927. return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
  31928. });
  31929. }
  31930. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  31931. }).get();
  31932. }
  31933. });
  31934. var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
  31935. originAnchor.href = location.href;
  31936. function addToPrefiltersOrTransports(structure) {
  31937. return function(dataTypeExpression, func) {
  31938. if (typeof dataTypeExpression !== "string") {
  31939. func = dataTypeExpression;
  31940. dataTypeExpression = "*";
  31941. }
  31942. var dataType, i2 = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
  31943. if (isFunction2(func)) {
  31944. while (dataType = dataTypes[i2++]) {
  31945. if (dataType[0] === "+") {
  31946. dataType = dataType.slice(1) || "*";
  31947. (structure[dataType] = structure[dataType] || []).unshift(func);
  31948. } else {
  31949. (structure[dataType] = structure[dataType] || []).push(func);
  31950. }
  31951. }
  31952. }
  31953. };
  31954. }
  31955. function inspectPrefiltersOrTransports(structure, options2, originalOptions, jqXHR) {
  31956. var inspected = {}, seekingTransport = structure === transports;
  31957. function inspect(dataType) {
  31958. var selected;
  31959. inspected[dataType] = true;
  31960. jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
  31961. var dataTypeOrTransport = prefilterOrFactory(options2, originalOptions, jqXHR);
  31962. if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
  31963. options2.dataTypes.unshift(dataTypeOrTransport);
  31964. inspect(dataTypeOrTransport);
  31965. return false;
  31966. } else if (seekingTransport) {
  31967. return !(selected = dataTypeOrTransport);
  31968. }
  31969. });
  31970. return selected;
  31971. }
  31972. return inspect(options2.dataTypes[0]) || !inspected["*"] && inspect("*");
  31973. }
  31974. function ajaxExtend(target, src) {
  31975. var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
  31976. for (key in src) {
  31977. if (src[key] !== void 0) {
  31978. (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
  31979. }
  31980. }
  31981. if (deep) {
  31982. jQuery.extend(true, target, deep);
  31983. }
  31984. return target;
  31985. }
  31986. function ajaxHandleResponses(s, jqXHR, responses) {
  31987. var ct2, type2, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
  31988. while (dataTypes[0] === "*") {
  31989. dataTypes.shift();
  31990. if (ct2 === void 0) {
  31991. ct2 = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  31992. }
  31993. }
  31994. if (ct2) {
  31995. for (type2 in contents) {
  31996. if (contents[type2] && contents[type2].test(ct2)) {
  31997. dataTypes.unshift(type2);
  31998. break;
  31999. }
  32000. }
  32001. }
  32002. if (dataTypes[0] in responses) {
  32003. finalDataType = dataTypes[0];
  32004. } else {
  32005. for (type2 in responses) {
  32006. if (!dataTypes[0] || s.converters[type2 + " " + dataTypes[0]]) {
  32007. finalDataType = type2;
  32008. break;
  32009. }
  32010. if (!firstDataType) {
  32011. firstDataType = type2;
  32012. }
  32013. }
  32014. finalDataType = finalDataType || firstDataType;
  32015. }
  32016. if (finalDataType) {
  32017. if (finalDataType !== dataTypes[0]) {
  32018. dataTypes.unshift(finalDataType);
  32019. }
  32020. return responses[finalDataType];
  32021. }
  32022. }
  32023. function ajaxConvert(s, response, jqXHR, isSuccess) {
  32024. var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
  32025. if (dataTypes[1]) {
  32026. for (conv in s.converters) {
  32027. converters[conv.toLowerCase()] = s.converters[conv];
  32028. }
  32029. }
  32030. current = dataTypes.shift();
  32031. while (current) {
  32032. if (s.responseFields[current]) {
  32033. jqXHR[s.responseFields[current]] = response;
  32034. }
  32035. if (!prev && isSuccess && s.dataFilter) {
  32036. response = s.dataFilter(response, s.dataType);
  32037. }
  32038. prev = current;
  32039. current = dataTypes.shift();
  32040. if (current) {
  32041. if (current === "*") {
  32042. current = prev;
  32043. } else if (prev !== "*" && prev !== current) {
  32044. conv = converters[prev + " " + current] || converters["* " + current];
  32045. if (!conv) {
  32046. for (conv2 in converters) {
  32047. tmp = conv2.split(" ");
  32048. if (tmp[1] === current) {
  32049. conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
  32050. if (conv) {
  32051. if (conv === true) {
  32052. conv = converters[conv2];
  32053. } else if (converters[conv2] !== true) {
  32054. current = tmp[0];
  32055. dataTypes.unshift(tmp[1]);
  32056. }
  32057. break;
  32058. }
  32059. }
  32060. }
  32061. }
  32062. if (conv !== true) {
  32063. if (conv && s.throws) {
  32064. response = conv(response);
  32065. } else {
  32066. try {
  32067. response = conv(response);
  32068. } catch (e) {
  32069. return {
  32070. state: "parsererror",
  32071. error: conv ? e : "No conversion from " + prev + " to " + current
  32072. };
  32073. }
  32074. }
  32075. }
  32076. }
  32077. }
  32078. }
  32079. return { state: "success", data: response };
  32080. }
  32081. jQuery.extend({
  32082. active: 0,
  32083. lastModified: {},
  32084. etag: {},
  32085. ajaxSettings: {
  32086. url: location.href,
  32087. type: "GET",
  32088. isLocal: rlocalProtocol.test(location.protocol),
  32089. global: true,
  32090. processData: true,
  32091. async: true,
  32092. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  32093. accepts: {
  32094. "*": allTypes,
  32095. text: "text/plain",
  32096. html: "text/html",
  32097. xml: "application/xml, text/xml",
  32098. json: "application/json, text/javascript"
  32099. },
  32100. contents: {
  32101. xml: /\bxml\b/,
  32102. html: /\bhtml/,
  32103. json: /\bjson\b/
  32104. },
  32105. responseFields: {
  32106. xml: "responseXML",
  32107. text: "responseText",
  32108. json: "responseJSON"
  32109. },
  32110. converters: {
  32111. "* text": String,
  32112. "text html": true,
  32113. "text json": JSON.parse,
  32114. "text xml": jQuery.parseXML
  32115. },
  32116. flatOptions: {
  32117. url: true,
  32118. context: true
  32119. }
  32120. },
  32121. ajaxSetup: function(target, settings) {
  32122. return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
  32123. },
  32124. ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
  32125. ajaxTransport: addToPrefiltersOrTransports(transports),
  32126. ajax: function(url, options2) {
  32127. if (typeof url === "object") {
  32128. options2 = url;
  32129. url = void 0;
  32130. }
  32131. options2 = options2 || {};
  32132. var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i2, uncached, s = jQuery.ajaxSetup({}, options2), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
  32133. readyState: 0,
  32134. getResponseHeader: function(key) {
  32135. var match;
  32136. if (completed2) {
  32137. if (!responseHeaders) {
  32138. responseHeaders = {};
  32139. while (match = rheaders.exec(responseHeadersString)) {
  32140. responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
  32141. }
  32142. }
  32143. match = responseHeaders[key.toLowerCase() + " "];
  32144. }
  32145. return match == null ? null : match.join(", ");
  32146. },
  32147. getAllResponseHeaders: function() {
  32148. return completed2 ? responseHeadersString : null;
  32149. },
  32150. setRequestHeader: function(name, value) {
  32151. if (completed2 == null) {
  32152. name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
  32153. requestHeaders[name] = value;
  32154. }
  32155. return this;
  32156. },
  32157. overrideMimeType: function(type2) {
  32158. if (completed2 == null) {
  32159. s.mimeType = type2;
  32160. }
  32161. return this;
  32162. },
  32163. statusCode: function(map) {
  32164. var code;
  32165. if (map) {
  32166. if (completed2) {
  32167. jqXHR.always(map[jqXHR.status]);
  32168. } else {
  32169. for (code in map) {
  32170. statusCode[code] = [statusCode[code], map[code]];
  32171. }
  32172. }
  32173. }
  32174. return this;
  32175. },
  32176. abort: function(statusText) {
  32177. var finalText = statusText || strAbort;
  32178. if (transport) {
  32179. transport.abort(finalText);
  32180. }
  32181. done(0, finalText);
  32182. return this;
  32183. }
  32184. };
  32185. deferred.promise(jqXHR);
  32186. s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//");
  32187. s.type = options2.method || options2.type || s.method || s.type;
  32188. s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
  32189. if (s.crossDomain == null) {
  32190. urlAnchor = document2.createElement("a");
  32191. try {
  32192. urlAnchor.href = s.url;
  32193. urlAnchor.href = urlAnchor.href;
  32194. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
  32195. } catch (e) {
  32196. s.crossDomain = true;
  32197. }
  32198. }
  32199. if (s.data && s.processData && typeof s.data !== "string") {
  32200. s.data = jQuery.param(s.data, s.traditional);
  32201. }
  32202. inspectPrefiltersOrTransports(prefilters, s, options2, jqXHR);
  32203. if (completed2) {
  32204. return jqXHR;
  32205. }
  32206. fireGlobals = jQuery.event && s.global;
  32207. if (fireGlobals && jQuery.active++ === 0) {
  32208. jQuery.event.trigger("ajaxStart");
  32209. }
  32210. s.type = s.type.toUpperCase();
  32211. s.hasContent = !rnoContent.test(s.type);
  32212. cacheURL = s.url.replace(rhash, "");
  32213. if (!s.hasContent) {
  32214. uncached = s.url.slice(cacheURL.length);
  32215. if (s.data && (s.processData || typeof s.data === "string")) {
  32216. cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
  32217. delete s.data;
  32218. }
  32219. if (s.cache === false) {
  32220. cacheURL = cacheURL.replace(rantiCache, "$1");
  32221. uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
  32222. }
  32223. s.url = cacheURL + uncached;
  32224. } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
  32225. s.data = s.data.replace(r20, "+");
  32226. }
  32227. if (s.ifModified) {
  32228. if (jQuery.lastModified[cacheURL]) {
  32229. jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
  32230. }
  32231. if (jQuery.etag[cacheURL]) {
  32232. jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
  32233. }
  32234. }
  32235. if (s.data && s.hasContent && s.contentType !== false || options2.contentType) {
  32236. jqXHR.setRequestHeader("Content-Type", s.contentType);
  32237. }
  32238. jqXHR.setRequestHeader(
  32239. "Accept",
  32240. s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
  32241. );
  32242. for (i2 in s.headers) {
  32243. jqXHR.setRequestHeader(i2, s.headers[i2]);
  32244. }
  32245. if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
  32246. return jqXHR.abort();
  32247. }
  32248. strAbort = "abort";
  32249. completeDeferred.add(s.complete);
  32250. jqXHR.done(s.success);
  32251. jqXHR.fail(s.error);
  32252. transport = inspectPrefiltersOrTransports(transports, s, options2, jqXHR);
  32253. if (!transport) {
  32254. done(-1, "No Transport");
  32255. } else {
  32256. jqXHR.readyState = 1;
  32257. if (fireGlobals) {
  32258. globalEventContext.trigger("ajaxSend", [jqXHR, s]);
  32259. }
  32260. if (completed2) {
  32261. return jqXHR;
  32262. }
  32263. if (s.async && s.timeout > 0) {
  32264. timeoutTimer = window2.setTimeout(function() {
  32265. jqXHR.abort("timeout");
  32266. }, s.timeout);
  32267. }
  32268. try {
  32269. completed2 = false;
  32270. transport.send(requestHeaders, done);
  32271. } catch (e) {
  32272. if (completed2) {
  32273. throw e;
  32274. }
  32275. done(-1, e);
  32276. }
  32277. }
  32278. function done(status, nativeStatusText, responses, headers) {
  32279. var isSuccess, success, error, response, modified, statusText = nativeStatusText;
  32280. if (completed2) {
  32281. return;
  32282. }
  32283. completed2 = true;
  32284. if (timeoutTimer) {
  32285. window2.clearTimeout(timeoutTimer);
  32286. }
  32287. transport = void 0;
  32288. responseHeadersString = headers || "";
  32289. jqXHR.readyState = status > 0 ? 4 : 0;
  32290. isSuccess = status >= 200 && status < 300 || status === 304;
  32291. if (responses) {
  32292. response = ajaxHandleResponses(s, jqXHR, responses);
  32293. }
  32294. if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
  32295. s.converters["text script"] = function() {
  32296. };
  32297. }
  32298. response = ajaxConvert(s, response, jqXHR, isSuccess);
  32299. if (isSuccess) {
  32300. if (s.ifModified) {
  32301. modified = jqXHR.getResponseHeader("Last-Modified");
  32302. if (modified) {
  32303. jQuery.lastModified[cacheURL] = modified;
  32304. }
  32305. modified = jqXHR.getResponseHeader("etag");
  32306. if (modified) {
  32307. jQuery.etag[cacheURL] = modified;
  32308. }
  32309. }
  32310. if (status === 204 || s.type === "HEAD") {
  32311. statusText = "nocontent";
  32312. } else if (status === 304) {
  32313. statusText = "notmodified";
  32314. } else {
  32315. statusText = response.state;
  32316. success = response.data;
  32317. error = response.error;
  32318. isSuccess = !error;
  32319. }
  32320. } else {
  32321. error = statusText;
  32322. if (status || !statusText) {
  32323. statusText = "error";
  32324. if (status < 0) {
  32325. status = 0;
  32326. }
  32327. }
  32328. }
  32329. jqXHR.status = status;
  32330. jqXHR.statusText = (nativeStatusText || statusText) + "";
  32331. if (isSuccess) {
  32332. deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
  32333. } else {
  32334. deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
  32335. }
  32336. jqXHR.statusCode(statusCode);
  32337. statusCode = void 0;
  32338. if (fireGlobals) {
  32339. globalEventContext.trigger(
  32340. isSuccess ? "ajaxSuccess" : "ajaxError",
  32341. [jqXHR, s, isSuccess ? success : error]
  32342. );
  32343. }
  32344. completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
  32345. if (fireGlobals) {
  32346. globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
  32347. if (!--jQuery.active) {
  32348. jQuery.event.trigger("ajaxStop");
  32349. }
  32350. }
  32351. }
  32352. return jqXHR;
  32353. },
  32354. getJSON: function(url, data, callback2) {
  32355. return jQuery.get(url, data, callback2, "json");
  32356. },
  32357. getScript: function(url, callback2) {
  32358. return jQuery.get(url, void 0, callback2, "script");
  32359. }
  32360. });
  32361. jQuery.each(["get", "post"], function(_i, method) {
  32362. jQuery[method] = function(url, data, callback2, type2) {
  32363. if (isFunction2(data)) {
  32364. type2 = type2 || callback2;
  32365. callback2 = data;
  32366. data = void 0;
  32367. }
  32368. return jQuery.ajax(jQuery.extend({
  32369. url,
  32370. type: method,
  32371. dataType: type2,
  32372. data,
  32373. success: callback2
  32374. }, jQuery.isPlainObject(url) && url));
  32375. };
  32376. });
  32377. jQuery.ajaxPrefilter(function(s) {
  32378. var i2;
  32379. for (i2 in s.headers) {
  32380. if (i2.toLowerCase() === "content-type") {
  32381. s.contentType = s.headers[i2] || "";
  32382. }
  32383. }
  32384. });
  32385. jQuery._evalUrl = function(url, options2, doc) {
  32386. return jQuery.ajax({
  32387. url,
  32388. type: "GET",
  32389. dataType: "script",
  32390. cache: true,
  32391. async: false,
  32392. global: false,
  32393. converters: {
  32394. "text script": function() {
  32395. }
  32396. },
  32397. dataFilter: function(response) {
  32398. jQuery.globalEval(response, options2, doc);
  32399. }
  32400. });
  32401. };
  32402. jQuery.fn.extend({
  32403. wrapAll: function(html) {
  32404. var wrap;
  32405. if (this[0]) {
  32406. if (isFunction2(html)) {
  32407. html = html.call(this[0]);
  32408. }
  32409. wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
  32410. if (this[0].parentNode) {
  32411. wrap.insertBefore(this[0]);
  32412. }
  32413. wrap.map(function() {
  32414. var elem = this;
  32415. while (elem.firstElementChild) {
  32416. elem = elem.firstElementChild;
  32417. }
  32418. return elem;
  32419. }).append(this);
  32420. }
  32421. return this;
  32422. },
  32423. wrapInner: function(html) {
  32424. if (isFunction2(html)) {
  32425. return this.each(function(i2) {
  32426. jQuery(this).wrapInner(html.call(this, i2));
  32427. });
  32428. }
  32429. return this.each(function() {
  32430. var self2 = jQuery(this), contents = self2.contents();
  32431. if (contents.length) {
  32432. contents.wrapAll(html);
  32433. } else {
  32434. self2.append(html);
  32435. }
  32436. });
  32437. },
  32438. wrap: function(html) {
  32439. var htmlIsFunction = isFunction2(html);
  32440. return this.each(function(i2) {
  32441. jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i2) : html);
  32442. });
  32443. },
  32444. unwrap: function(selector) {
  32445. this.parent(selector).not("body").each(function() {
  32446. jQuery(this).replaceWith(this.childNodes);
  32447. });
  32448. return this;
  32449. }
  32450. });
  32451. jQuery.expr.pseudos.hidden = function(elem) {
  32452. return !jQuery.expr.pseudos.visible(elem);
  32453. };
  32454. jQuery.expr.pseudos.visible = function(elem) {
  32455. return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
  32456. };
  32457. jQuery.ajaxSettings.xhr = function() {
  32458. try {
  32459. return new window2.XMLHttpRequest();
  32460. } catch (e) {
  32461. }
  32462. };
  32463. var xhrSuccessStatus = {
  32464. 0: 200,
  32465. 1223: 204
  32466. }, xhrSupported = jQuery.ajaxSettings.xhr();
  32467. support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
  32468. support.ajax = xhrSupported = !!xhrSupported;
  32469. jQuery.ajaxTransport(function(options2) {
  32470. var callback2, errorCallback;
  32471. if (support.cors || xhrSupported && !options2.crossDomain) {
  32472. return {
  32473. send: function(headers, complete) {
  32474. var i2, xhr = options2.xhr();
  32475. xhr.open(
  32476. options2.type,
  32477. options2.url,
  32478. options2.async,
  32479. options2.username,
  32480. options2.password
  32481. );
  32482. if (options2.xhrFields) {
  32483. for (i2 in options2.xhrFields) {
  32484. xhr[i2] = options2.xhrFields[i2];
  32485. }
  32486. }
  32487. if (options2.mimeType && xhr.overrideMimeType) {
  32488. xhr.overrideMimeType(options2.mimeType);
  32489. }
  32490. if (!options2.crossDomain && !headers["X-Requested-With"]) {
  32491. headers["X-Requested-With"] = "XMLHttpRequest";
  32492. }
  32493. for (i2 in headers) {
  32494. xhr.setRequestHeader(i2, headers[i2]);
  32495. }
  32496. callback2 = function(type2) {
  32497. return function() {
  32498. if (callback2) {
  32499. callback2 = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
  32500. if (type2 === "abort") {
  32501. xhr.abort();
  32502. } else if (type2 === "error") {
  32503. if (typeof xhr.status !== "number") {
  32504. complete(0, "error");
  32505. } else {
  32506. complete(
  32507. xhr.status,
  32508. xhr.statusText
  32509. );
  32510. }
  32511. } else {
  32512. complete(
  32513. xhrSuccessStatus[xhr.status] || xhr.status,
  32514. xhr.statusText,
  32515. (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
  32516. xhr.getAllResponseHeaders()
  32517. );
  32518. }
  32519. }
  32520. };
  32521. };
  32522. xhr.onload = callback2();
  32523. errorCallback = xhr.onerror = xhr.ontimeout = callback2("error");
  32524. if (xhr.onabort !== void 0) {
  32525. xhr.onabort = errorCallback;
  32526. } else {
  32527. xhr.onreadystatechange = function() {
  32528. if (xhr.readyState === 4) {
  32529. window2.setTimeout(function() {
  32530. if (callback2) {
  32531. errorCallback();
  32532. }
  32533. });
  32534. }
  32535. };
  32536. }
  32537. callback2 = callback2("abort");
  32538. try {
  32539. xhr.send(options2.hasContent && options2.data || null);
  32540. } catch (e) {
  32541. if (callback2) {
  32542. throw e;
  32543. }
  32544. }
  32545. },
  32546. abort: function() {
  32547. if (callback2) {
  32548. callback2();
  32549. }
  32550. }
  32551. };
  32552. }
  32553. });
  32554. jQuery.ajaxPrefilter(function(s) {
  32555. if (s.crossDomain) {
  32556. s.contents.script = false;
  32557. }
  32558. });
  32559. jQuery.ajaxSetup({
  32560. accepts: {
  32561. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  32562. },
  32563. contents: {
  32564. script: /\b(?:java|ecma)script\b/
  32565. },
  32566. converters: {
  32567. "text script": function(text) {
  32568. jQuery.globalEval(text);
  32569. return text;
  32570. }
  32571. }
  32572. });
  32573. jQuery.ajaxPrefilter("script", function(s) {
  32574. if (s.cache === void 0) {
  32575. s.cache = false;
  32576. }
  32577. if (s.crossDomain) {
  32578. s.type = "GET";
  32579. }
  32580. });
  32581. jQuery.ajaxTransport("script", function(s) {
  32582. if (s.crossDomain || s.scriptAttrs) {
  32583. var script, callback2;
  32584. return {
  32585. send: function(_, complete) {
  32586. script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback2 = function(evt) {
  32587. script.remove();
  32588. callback2 = null;
  32589. if (evt) {
  32590. complete(evt.type === "error" ? 404 : 200, evt.type);
  32591. }
  32592. });
  32593. document2.head.appendChild(script[0]);
  32594. },
  32595. abort: function() {
  32596. if (callback2) {
  32597. callback2();
  32598. }
  32599. }
  32600. };
  32601. }
  32602. });
  32603. var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
  32604. jQuery.ajaxSetup({
  32605. jsonp: "callback",
  32606. jsonpCallback: function() {
  32607. var callback2 = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
  32608. this[callback2] = true;
  32609. return callback2;
  32610. }
  32611. });
  32612. jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
  32613. var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
  32614. if (jsonProp || s.dataTypes[0] === "jsonp") {
  32615. callbackName = s.jsonpCallback = isFunction2(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
  32616. if (jsonProp) {
  32617. s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
  32618. } else if (s.jsonp !== false) {
  32619. s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
  32620. }
  32621. s.converters["script json"] = function() {
  32622. if (!responseContainer) {
  32623. jQuery.error(callbackName + " was not called");
  32624. }
  32625. return responseContainer[0];
  32626. };
  32627. s.dataTypes[0] = "json";
  32628. overwritten = window2[callbackName];
  32629. window2[callbackName] = function() {
  32630. responseContainer = arguments;
  32631. };
  32632. jqXHR.always(function() {
  32633. if (overwritten === void 0) {
  32634. jQuery(window2).removeProp(callbackName);
  32635. } else {
  32636. window2[callbackName] = overwritten;
  32637. }
  32638. if (s[callbackName]) {
  32639. s.jsonpCallback = originalSettings.jsonpCallback;
  32640. oldCallbacks.push(callbackName);
  32641. }
  32642. if (responseContainer && isFunction2(overwritten)) {
  32643. overwritten(responseContainer[0]);
  32644. }
  32645. responseContainer = overwritten = void 0;
  32646. });
  32647. return "script";
  32648. }
  32649. });
  32650. support.createHTMLDocument = function() {
  32651. var body = document2.implementation.createHTMLDocument("").body;
  32652. body.innerHTML = "<form></form><form></form>";
  32653. return body.childNodes.length === 2;
  32654. }();
  32655. jQuery.parseHTML = function(data, context, keepScripts) {
  32656. if (typeof data !== "string") {
  32657. return [];
  32658. }
  32659. if (typeof context === "boolean") {
  32660. keepScripts = context;
  32661. context = false;
  32662. }
  32663. var base2, parsed, scripts;
  32664. if (!context) {
  32665. if (support.createHTMLDocument) {
  32666. context = document2.implementation.createHTMLDocument("");
  32667. base2 = context.createElement("base");
  32668. base2.href = document2.location.href;
  32669. context.head.appendChild(base2);
  32670. } else {
  32671. context = document2;
  32672. }
  32673. }
  32674. parsed = rsingleTag.exec(data);
  32675. scripts = !keepScripts && [];
  32676. if (parsed) {
  32677. return [context.createElement(parsed[1])];
  32678. }
  32679. parsed = buildFragment([data], context, scripts);
  32680. if (scripts && scripts.length) {
  32681. jQuery(scripts).remove();
  32682. }
  32683. return jQuery.merge([], parsed.childNodes);
  32684. };
  32685. jQuery.fn.load = function(url, params, callback2) {
  32686. var selector, type2, response, self2 = this, off2 = url.indexOf(" ");
  32687. if (off2 > -1) {
  32688. selector = stripAndCollapse(url.slice(off2));
  32689. url = url.slice(0, off2);
  32690. }
  32691. if (isFunction2(params)) {
  32692. callback2 = params;
  32693. params = void 0;
  32694. } else if (params && typeof params === "object") {
  32695. type2 = "POST";
  32696. }
  32697. if (self2.length > 0) {
  32698. jQuery.ajax({
  32699. url,
  32700. type: type2 || "GET",
  32701. dataType: "html",
  32702. data: params
  32703. }).done(function(responseText) {
  32704. response = arguments;
  32705. self2.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
  32706. }).always(callback2 && function(jqXHR, status) {
  32707. self2.each(function() {
  32708. callback2.apply(this, response || [jqXHR.responseText, status, jqXHR]);
  32709. });
  32710. });
  32711. }
  32712. return this;
  32713. };
  32714. jQuery.expr.pseudos.animated = function(elem) {
  32715. return jQuery.grep(jQuery.timers, function(fn2) {
  32716. return elem === fn2.elem;
  32717. }).length;
  32718. };
  32719. jQuery.offset = {
  32720. setOffset: function(elem, options2, i2) {
  32721. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position2 = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
  32722. if (position2 === "static") {
  32723. elem.style.position = "relative";
  32724. }
  32725. curOffset = curElem.offset();
  32726. curCSSTop = jQuery.css(elem, "top");
  32727. curCSSLeft = jQuery.css(elem, "left");
  32728. calculatePosition = (position2 === "absolute" || position2 === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
  32729. if (calculatePosition) {
  32730. curPosition = curElem.position();
  32731. curTop = curPosition.top;
  32732. curLeft = curPosition.left;
  32733. } else {
  32734. curTop = parseFloat(curCSSTop) || 0;
  32735. curLeft = parseFloat(curCSSLeft) || 0;
  32736. }
  32737. if (isFunction2(options2)) {
  32738. options2 = options2.call(elem, i2, jQuery.extend({}, curOffset));
  32739. }
  32740. if (options2.top != null) {
  32741. props.top = options2.top - curOffset.top + curTop;
  32742. }
  32743. if (options2.left != null) {
  32744. props.left = options2.left - curOffset.left + curLeft;
  32745. }
  32746. if ("using" in options2) {
  32747. options2.using.call(elem, props);
  32748. } else {
  32749. curElem.css(props);
  32750. }
  32751. }
  32752. };
  32753. jQuery.fn.extend({
  32754. offset: function(options2) {
  32755. if (arguments.length) {
  32756. return options2 === void 0 ? this : this.each(function(i2) {
  32757. jQuery.offset.setOffset(this, options2, i2);
  32758. });
  32759. }
  32760. var rect, win2, elem = this[0];
  32761. if (!elem) {
  32762. return;
  32763. }
  32764. if (!elem.getClientRects().length) {
  32765. return { top: 0, left: 0 };
  32766. }
  32767. rect = elem.getBoundingClientRect();
  32768. win2 = elem.ownerDocument.defaultView;
  32769. return {
  32770. top: rect.top + win2.pageYOffset,
  32771. left: rect.left + win2.pageXOffset
  32772. };
  32773. },
  32774. position: function() {
  32775. if (!this[0]) {
  32776. return;
  32777. }
  32778. var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
  32779. if (jQuery.css(elem, "position") === "fixed") {
  32780. offset = elem.getBoundingClientRect();
  32781. } else {
  32782. offset = this.offset();
  32783. doc = elem.ownerDocument;
  32784. offsetParent = elem.offsetParent || doc.documentElement;
  32785. while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
  32786. offsetParent = offsetParent.parentNode;
  32787. }
  32788. if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
  32789. parentOffset = jQuery(offsetParent).offset();
  32790. parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
  32791. parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
  32792. }
  32793. }
  32794. return {
  32795. top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
  32796. left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
  32797. };
  32798. },
  32799. offsetParent: function() {
  32800. return this.map(function() {
  32801. var offsetParent = this.offsetParent;
  32802. while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
  32803. offsetParent = offsetParent.offsetParent;
  32804. }
  32805. return offsetParent || documentElement;
  32806. });
  32807. }
  32808. });
  32809. jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
  32810. var top = "pageYOffset" === prop;
  32811. jQuery.fn[method] = function(val) {
  32812. return access(this, function(elem, method2, val2) {
  32813. var win2;
  32814. if (isWindow(elem)) {
  32815. win2 = elem;
  32816. } else if (elem.nodeType === 9) {
  32817. win2 = elem.defaultView;
  32818. }
  32819. if (val2 === void 0) {
  32820. return win2 ? win2[prop] : elem[method2];
  32821. }
  32822. if (win2) {
  32823. win2.scrollTo(
  32824. !top ? val2 : win2.pageXOffset,
  32825. top ? val2 : win2.pageYOffset
  32826. );
  32827. } else {
  32828. elem[method2] = val2;
  32829. }
  32830. }, method, val, arguments.length);
  32831. };
  32832. });
  32833. jQuery.each(["top", "left"], function(_i, prop) {
  32834. jQuery.cssHooks[prop] = addGetHookIf(
  32835. support.pixelPosition,
  32836. function(elem, computed2) {
  32837. if (computed2) {
  32838. computed2 = curCSS(elem, prop);
  32839. return rnumnonpx.test(computed2) ? jQuery(elem).position()[prop] + "px" : computed2;
  32840. }
  32841. }
  32842. );
  32843. });
  32844. jQuery.each({ Height: "height", Width: "width" }, function(name, type2) {
  32845. jQuery.each({
  32846. padding: "inner" + name,
  32847. content: type2,
  32848. "": "outer" + name
  32849. }, function(defaultExtra, funcName) {
  32850. jQuery.fn[funcName] = function(margin, value) {
  32851. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  32852. return access(this, function(elem, type3, value2) {
  32853. var doc;
  32854. if (isWindow(elem)) {
  32855. return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
  32856. }
  32857. if (elem.nodeType === 9) {
  32858. doc = elem.documentElement;
  32859. return Math.max(
  32860. elem.body["scroll" + name],
  32861. doc["scroll" + name],
  32862. elem.body["offset" + name],
  32863. doc["offset" + name],
  32864. doc["client" + name]
  32865. );
  32866. }
  32867. return value2 === void 0 ? jQuery.css(elem, type3, extra) : jQuery.style(elem, type3, value2, extra);
  32868. }, type2, chainable ? margin : void 0, chainable);
  32869. };
  32870. });
  32871. });
  32872. jQuery.each([
  32873. "ajaxStart",
  32874. "ajaxStop",
  32875. "ajaxComplete",
  32876. "ajaxError",
  32877. "ajaxSuccess",
  32878. "ajaxSend"
  32879. ], function(_i, type2) {
  32880. jQuery.fn[type2] = function(fn2) {
  32881. return this.on(type2, fn2);
  32882. };
  32883. });
  32884. jQuery.fn.extend({
  32885. bind: function(types, data, fn2) {
  32886. return this.on(types, null, data, fn2);
  32887. },
  32888. unbind: function(types, fn2) {
  32889. return this.off(types, null, fn2);
  32890. },
  32891. delegate: function(selector, types, data, fn2) {
  32892. return this.on(types, selector, data, fn2);
  32893. },
  32894. undelegate: function(selector, types, fn2) {
  32895. return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn2);
  32896. },
  32897. hover: function(fnOver, fnOut) {
  32898. return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
  32899. }
  32900. });
  32901. jQuery.each(
  32902. "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
  32903. function(_i, name) {
  32904. jQuery.fn[name] = function(data, fn2) {
  32905. return arguments.length > 0 ? this.on(name, null, data, fn2) : this.trigger(name);
  32906. };
  32907. }
  32908. );
  32909. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  32910. jQuery.proxy = function(fn2, context) {
  32911. var tmp, args, proxy;
  32912. if (typeof context === "string") {
  32913. tmp = fn2[context];
  32914. context = fn2;
  32915. fn2 = tmp;
  32916. }
  32917. if (!isFunction2(fn2)) {
  32918. return void 0;
  32919. }
  32920. args = slice.call(arguments, 2);
  32921. proxy = function() {
  32922. return fn2.apply(context || this, args.concat(slice.call(arguments)));
  32923. };
  32924. proxy.guid = fn2.guid = fn2.guid || jQuery.guid++;
  32925. return proxy;
  32926. };
  32927. jQuery.holdReady = function(hold) {
  32928. if (hold) {
  32929. jQuery.readyWait++;
  32930. } else {
  32931. jQuery.ready(true);
  32932. }
  32933. };
  32934. jQuery.isArray = Array.isArray;
  32935. jQuery.parseJSON = JSON.parse;
  32936. jQuery.nodeName = nodeName;
  32937. jQuery.isFunction = isFunction2;
  32938. jQuery.isWindow = isWindow;
  32939. jQuery.camelCase = camelCase3;
  32940. jQuery.type = toType;
  32941. jQuery.now = Date.now;
  32942. jQuery.isNumeric = function(obj) {
  32943. var type2 = jQuery.type(obj);
  32944. return (type2 === "number" || type2 === "string") && !isNaN(obj - parseFloat(obj));
  32945. };
  32946. jQuery.trim = function(text) {
  32947. return text == null ? "" : (text + "").replace(rtrim, "$1");
  32948. };
  32949. var _jQuery = window2.jQuery, _$ = window2.$;
  32950. jQuery.noConflict = function(deep) {
  32951. if (window2.$ === jQuery) {
  32952. window2.$ = _$;
  32953. }
  32954. if (deep && window2.jQuery === jQuery) {
  32955. window2.jQuery = _jQuery;
  32956. }
  32957. return jQuery;
  32958. };
  32959. if (typeof noGlobal === "undefined") {
  32960. window2.jQuery = window2.$ = jQuery;
  32961. }
  32962. return jQuery;
  32963. });
  32964. })(jquery);
  32965. var _style_0$2 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-wall-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-wall-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-wall-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-wall-row .col-main{flex:1;display:flex;flex-direction:row}.jt-wall-row .col-main .el-input--suffix{background-color:#fff0}.jt-wall-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-wall-row .col-main .el-input-number__decrease,.jt-wall-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-wall-dialog{pointer-events:none}.jt-wall-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-wall-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-wall-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-wall-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-wall-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-wall-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  32966. `;
  32967. var _export_sfc = (sfc, props) => {
  32968. const target = sfc.__vccOpts || sfc;
  32969. for (const [key, val] of props) {
  32970. target[key] = val;
  32971. }
  32972. return target;
  32973. };
  32974. const _hoisted_1$2 = { class: "jt-wall-dialog" };
  32975. const _hoisted_2$2 = {
  32976. slot: "title",
  32977. class: "header-title"
  32978. };
  32979. const _hoisted_3$2 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  32980. const _hoisted_4$2 = { class: "odin-dialog__content" };
  32981. const _hoisted_5$2 = { class: "jt-wall-row" };
  32982. const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u9AD8\u5EA6", -1);
  32983. const _hoisted_7$2 = { class: "col-main" };
  32984. const _hoisted_8$2 = { class: "jt-wall-row" };
  32985. const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5F2F\u66F2\u5EA6", -1);
  32986. const _hoisted_10$1 = { class: "col-main" };
  32987. const _hoisted_11$1 = { class: "jt-wall-row" };
  32988. const _hoisted_12$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EBF\u5BBD", -1);
  32989. const _hoisted_13$1 = { class: "col-main" };
  32990. const _hoisted_14$1 = { class: "jt-wall-row" };
  32991. const _hoisted_15$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u53D1\u5149\u5F3A\u5EA6", -1);
  32992. const _hoisted_16$1 = { class: "col-main" };
  32993. const _hoisted_17$1 = { class: "jt-wall-row" };
  32994. const _hoisted_18$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  32995. const _hoisted_19$1 = { class: "col-main" };
  32996. const _hoisted_20$1 = { class: "jt-wall-row" };
  32997. const _hoisted_21$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65B9\u5411", -1);
  32998. const _hoisted_22$1 = { class: "col-main" };
  32999. const _hoisted_23$1 = { class: "jt-wall-row" };
  33000. const _hoisted_24$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u987A\u5E8F", -1);
  33001. const _hoisted_25$1 = { class: "col-main" };
  33002. const _hoisted_26$1 = { class: "jt-wall-row" };
  33003. const _hoisted_27$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65F6\u95F4", -1);
  33004. const _hoisted_28$1 = { class: "col-main" };
  33005. const _hoisted_29$1 = { class: "col-main" };
  33006. const _hoisted_30$1 = { class: "jt-wall-row" };
  33007. const _hoisted_31$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u91CD\u590D\u6570\u91CF", -1);
  33008. const _hoisted_32$1 = { class: "col-main" };
  33009. const _hoisted_33$1 = {
  33010. class: "jt-wall-row",
  33011. style: { "height": "60rem" }
  33012. };
  33013. const _hoisted_34$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6587\u5B57\u5185\u5BB9", -1);
  33014. const _hoisted_35$1 = { class: "col-main" };
  33015. const _hoisted_36$1 = { class: "jt-wall-row" };
  33016. const _hoisted_37$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u5BBD\u5EA6", -1);
  33017. const _hoisted_38$1 = { class: "col-main" };
  33018. const _hoisted_39$1 = { class: "jt-wall-row" };
  33019. const _hoisted_40$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u989C\u8272", -1);
  33020. const _hoisted_41$1 = { class: "col-main" };
  33021. const _hoisted_42$1 = {
  33022. class: "jt-wall-row",
  33023. style: { "height": "100rem" }
  33024. };
  33025. const _hoisted_43$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u89C6\u9891\u5730\u5740", -1);
  33026. const _hoisted_44$1 = { class: "col-main" };
  33027. const _hoisted_45$1 = { class: "jt-wall-row" };
  33028. const _hoisted_46$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "X\u8F74\u5E73\u79FB", -1);
  33029. const _hoisted_47$1 = { class: "col-main" };
  33030. const _hoisted_48$1 = { class: "jt-wall-row" };
  33031. const _hoisted_49$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Y\u8F74\u5E73\u79FB", -1);
  33032. const _hoisted_50$1 = { class: "col-main" };
  33033. const _hoisted_51$1 = { class: "jt-wall-row" };
  33034. const _hoisted_52$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Z\u8F74\u5E73\u79FB", -1);
  33035. const _hoisted_53$1 = { class: "col-main" };
  33036. const _hoisted_54$1 = { class: "el-body-foot" };
  33037. const _sfc_main$2 = {
  33038. __name: "CrEditProperty.ce",
  33039. props: {
  33040. params: {
  33041. id: {
  33042. type: String,
  33043. default: () => void 0
  33044. },
  33045. height: {
  33046. type: Number,
  33047. default: () => 13
  33048. },
  33049. bottomHeight: {
  33050. type: Number,
  33051. default: () => 0
  33052. },
  33053. color: {
  33054. type: String,
  33055. default: () => "255,255,0,0.9"
  33056. },
  33057. direction: {
  33058. type: String,
  33059. default: () => "horizontal"
  33060. },
  33061. order: {
  33062. type: String,
  33063. default: () => "+"
  33064. },
  33065. count: {
  33066. type: Number,
  33067. default: () => 2
  33068. },
  33069. text: {
  33070. type: String,
  33071. default: () => ""
  33072. },
  33073. lineWidth: {
  33074. type: Number,
  33075. default: () => 2
  33076. },
  33077. glowPower: {
  33078. type: Number,
  33079. default: () => 0.25
  33080. },
  33081. outlineWidth: {
  33082. type: Number,
  33083. default: () => 0
  33084. },
  33085. outlineColor: {
  33086. type: String,
  33087. default: () => "255,255,0,0.9"
  33088. },
  33089. speed: {
  33090. type: Number,
  33091. default: () => 1.5
  33092. },
  33093. videoUrl: {
  33094. type: String,
  33095. default: () => ""
  33096. },
  33097. arcHeight: {
  33098. type: Number,
  33099. default: () => 1e3
  33100. },
  33101. axisX: {
  33102. type: Number,
  33103. default: () => 0
  33104. },
  33105. axisY: {
  33106. type: Number,
  33107. default: () => 0
  33108. },
  33109. axisZ: {
  33110. type: Number,
  33111. default: () => 0
  33112. }
  33113. },
  33114. showDialog: {
  33115. type: Boolean,
  33116. default: () => false
  33117. }
  33118. },
  33119. emits: ["submit", "update:showDialog", "update:params", "remove"],
  33120. setup(__props, { expose: __expose, emit }) {
  33121. const props = __props;
  33122. const language = ref("zh-cn");
  33123. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  33124. const {
  33125. proxy
  33126. } = getCurrentInstance();
  33127. const predefineColors = ref([
  33128. "#ff4500",
  33129. "#ff8c00",
  33130. "#ffd700",
  33131. "#90ee90",
  33132. "#00ced1",
  33133. "#1e90ff",
  33134. "#c71585",
  33135. "rgba(255, 69, 0, 0.68)",
  33136. "rgb(255, 120, 0)",
  33137. "hsv(51, 100, 98)",
  33138. "hsva(120, 40, 94, 0.5)",
  33139. "hsl(181, 100%, 37%)",
  33140. "hsla(209, 100%, 56%, 0.73)",
  33141. "#c7158577"
  33142. ]);
  33143. const isShowColor = ref(false);
  33144. const isShowText = ref(false);
  33145. const isShowHeight = ref(false);
  33146. const isShowDirection = ref(false);
  33147. const isShowOrder = ref(false);
  33148. const isShowCount = ref(false);
  33149. ref(false);
  33150. const isShowLineWidth = ref(false);
  33151. const isShowGlowpower = ref(false);
  33152. const isShowOutlineWidth = ref(false);
  33153. const isShowOutlineColor = ref(false);
  33154. const isShowSpeed = ref(false);
  33155. const isShowVideoUrl = ref(false);
  33156. const isShowArcHeight = ref(false);
  33157. const isShowAxis = ref(false);
  33158. const color2 = ref(props.params.color);
  33159. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  33160. const dialogVisible = ref(props.showDialog);
  33161. const directions = reactive([{
  33162. key: "\u5DE6\u53F3",
  33163. value: "horizontal"
  33164. }, {
  33165. key: "\u4E0A\u4E0B",
  33166. value: "vertical"
  33167. }]);
  33168. const orders = reactive([]);
  33169. const radioDirection = ref("");
  33170. const radioOrder = ref("");
  33171. const wallHeight = ref(0);
  33172. const yCount = ref(0);
  33173. const txtContent = ref("");
  33174. const lineWidth = ref(0);
  33175. const glowPower = ref(0.25);
  33176. const outlineWidth = ref(0);
  33177. const outlineColor = ref(props.params.outlineColor);
  33178. const speed = ref(1.5);
  33179. const txtVideoUrl = ref("");
  33180. const arcHeight = ref(1e3);
  33181. const axisX = ref(0);
  33182. const axisY = ref(0);
  33183. const axisZ = ref(0);
  33184. updateParams(props.params);
  33185. function updateParams(params) {
  33186. proxy._params = params;
  33187. _setShowControls(false);
  33188. if (params.id === DrawTools.DrawType.TextWall) {
  33189. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  33190. isShowColor.value = true;
  33191. isShowText.value = true;
  33192. isShowHeight.value = true;
  33193. } else if (params.id === DrawTools.DrawType.DynamicWall) {
  33194. title.value = "\u52A8\u6001\u56F4\u680F\u7F16\u8F91";
  33195. isShowColor.value = true;
  33196. isShowDirection.value = true;
  33197. isShowOrder.value = true;
  33198. isShowCount.value = true;
  33199. isShowHeight.value = true;
  33200. isShowSpeed.value = true;
  33201. } else if (params.id === DrawTools.DrawType.NormalWall) {
  33202. title.value = "\u666E\u901A\u56F4\u680F\u7F16\u8F91";
  33203. isShowColor.value = true;
  33204. isShowHeight.value = true;
  33205. } else if (params.id === DrawTools.DrawType.Circle) {
  33206. title.value = "\u8D34\u5730\u5706\u7F16\u8F91";
  33207. isShowColor.value = true;
  33208. isShowOutlineColor.value = true;
  33209. isShowOutlineWidth.value = true;
  33210. } else if (params.id === DrawTools.DrawType.DynamicCircle) {
  33211. title.value = "\u6269\u6563\u5706\u7F16\u8F91";
  33212. isShowColor.value = true;
  33213. isShowCount.value = true;
  33214. isShowSpeed.value = true;
  33215. } else if (params.id === DrawTools.DrawType.House) {
  33216. title.value = "\u623F\u5C4B\u7F16\u8F91";
  33217. isShowColor.value = true;
  33218. isShowHeight.value = true;
  33219. } else if (params.id === DrawTools.DrawType.VideoWall) {
  33220. title.value = "\u89C6\u9891\u5899\u7F16\u8F91";
  33221. isShowHeight.value = true;
  33222. isShowVideoUrl.value = true;
  33223. isShowAxis.value = true;
  33224. } else if (params.id === DrawTools.DrawType.Polyline) {
  33225. title.value = "\u8D34\u5730\u7EBF\u7F16\u8F91";
  33226. isShowColor.value = true;
  33227. isShowLineWidth.value = true;
  33228. } else if (params.id === DrawTools.DrawType.ArrowPolyline) {
  33229. title.value = "\u7BAD\u5934\u7EBF\u7F16\u8F91";
  33230. isShowColor.value = true;
  33231. isShowLineWidth.value = true;
  33232. } else if (params.id === DrawTools.DrawType.DynamicPolyline) {
  33233. title.value = "\u52A8\u6001\u7EBF\u7F16\u8F91";
  33234. isShowColor.value = true;
  33235. isShowOrder.value = true;
  33236. isShowCount.value = true;
  33237. isShowLineWidth.value = true;
  33238. isShowSpeed.value = true;
  33239. } else if (params.id === DrawTools.DrawType.GrowPolyline) {
  33240. title.value = "\u53D1\u5149\u7EBF\u7F16\u8F91";
  33241. isShowColor.value = true;
  33242. isShowLineWidth.value = true;
  33243. isShowGlowpower.value = true;
  33244. } else if (params.id === DrawTools.DrawType.OutlinePolyline) {
  33245. title.value = "\u63CF\u8FB9\u7EBF\u7F16\u8F91";
  33246. isShowColor.value = true;
  33247. isShowLineWidth.value = true;
  33248. isShowOutlineColor.value = true;
  33249. isShowOutlineWidth.value = true;
  33250. } else if (params.id === DrawTools.DrawType.Polygon) {
  33251. title.value = "\u8D34\u5730\u9762\u7F16\u8F91";
  33252. isShowColor.value = true;
  33253. isShowOutlineColor.value = true;
  33254. isShowOutlineWidth.value = true;
  33255. } else if (params.id === DrawTools.DrawType.Rectangle) {
  33256. title.value = "\u77E9\u5F62\u7F16\u8F91";
  33257. isShowColor.value = true;
  33258. isShowOutlineColor.value = true;
  33259. isShowOutlineWidth.value = true;
  33260. } else if (params.id === DrawTools.DrawType.SpatialLine) {
  33261. title.value = "\u7A7A\u95F4\u7EBF\u7F16\u8F91";
  33262. isShowColor.value = true;
  33263. isShowLineWidth.value = true;
  33264. } else if (params.id === DrawTools.DrawType.OdLine) {
  33265. title.value = "OD\u7EBF\u7F16\u8F91";
  33266. isShowSpeed.value = true;
  33267. isShowColor.value = true;
  33268. isShowLineWidth.value = true;
  33269. isShowOrder.value = true;
  33270. isShowArcHeight.value = true;
  33271. } else {
  33272. _setShowControls(false);
  33273. }
  33274. color2.value = params.color;
  33275. if (params.direction === "horizontal") {
  33276. radioDirection.value = directions[0].key;
  33277. Object.assign(orders, [{
  33278. key: "\u81EA\u5DE6\u81F3\u53F3",
  33279. value: "-"
  33280. }, {
  33281. key: "\u81EA\u53F3\u81F3\u5DE6",
  33282. value: "+"
  33283. }]);
  33284. if (params.order === "-") {
  33285. radioOrder.value = orders[0].key;
  33286. } else {
  33287. radioOrder.value = orders[1].key;
  33288. }
  33289. } else {
  33290. radioDirection.value = directions[1].key;
  33291. Object.assign(orders, [{
  33292. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33293. value: "+"
  33294. }, {
  33295. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33296. value: "-"
  33297. }]);
  33298. if (params.order === "+") {
  33299. radioOrder.value = orders[0].key;
  33300. } else {
  33301. radioOrder.value = orders[1].key;
  33302. }
  33303. }
  33304. if (params.id === DrawTools.DrawType.OdLine) {
  33305. Object.assign(orders, [{
  33306. key: "\u6C47\u805A",
  33307. value: "+"
  33308. }, {
  33309. key: "\u6269\u6563",
  33310. value: "-"
  33311. }]);
  33312. if (params.order === "+") {
  33313. radioOrder.value = orders[0].key;
  33314. } else {
  33315. radioOrder.value = orders[1].key;
  33316. }
  33317. }
  33318. wallHeight.value = parseFloat(params.height).toFixed(2);
  33319. yCount.value = params.count;
  33320. txtContent.value = params.text;
  33321. lineWidth.value = params.lineWidth;
  33322. glowPower.value = params.power;
  33323. outlineColor.value = params.outlineColor;
  33324. outlineWidth.value = params.outlineWidth;
  33325. speed.value = (parseFloat(params.duration) / 1e3).toFixed(2);
  33326. txtVideoUrl.value = params.videoUrl;
  33327. arcHeight.value = params.odlineHeight;
  33328. axisX.value = params.axisX;
  33329. axisY.value = params.axisY;
  33330. axisZ.value = params.axisZ;
  33331. }
  33332. function _setShowControls(isShow) {
  33333. isShowColor.value = isShow;
  33334. isShowText.value = isShow;
  33335. isShowDirection.value = isShow;
  33336. isShowOrder.value = isShow;
  33337. isShowCount.value = isShow;
  33338. isShowHeight.value = isShow;
  33339. isShowLineWidth.value = isShow;
  33340. isShowGlowpower.value = isShow;
  33341. isShowOutlineColor.value = isShow;
  33342. isShowOutlineWidth.value = isShow;
  33343. isShowSpeed.value = isShow;
  33344. isShowVideoUrl.value = isShow;
  33345. isShowArcHeight.value = isShow;
  33346. isShowAxis.value = isShow;
  33347. }
  33348. __expose({});
  33349. function submit() {
  33350. let outParam = proxy._params;
  33351. outParam.height = wallHeight.value;
  33352. outParam.color = color2.value;
  33353. outParam.direction = directions.filter((item) => {
  33354. return item.key === radioDirection.value;
  33355. })[0].value;
  33356. outParam.order = orders.filter((item) => {
  33357. return item.key === radioOrder.value;
  33358. })[0].value;
  33359. outParam.count = yCount.value;
  33360. outParam.text = txtContent.value;
  33361. outParam.lineWidth = lineWidth.value;
  33362. outParam.power = glowPower.value;
  33363. outParam.outlineColor = outlineColor.value;
  33364. outParam.outlineWidth = outlineWidth.value;
  33365. outParam.duration = speed.value * 1e3;
  33366. outParam.videoUrl = txtVideoUrl.value;
  33367. outParam.odlineHeight = arcHeight.value;
  33368. outParam.bottomHeight = props.params.bottomHeight;
  33369. outParam.axisX = axisX.value;
  33370. outParam.axisY = axisY.value;
  33371. outParam.axisZ = axisZ.value;
  33372. emit("submit", outParam);
  33373. axisX.value = axisY.value = axisZ.value = 0;
  33374. }
  33375. function close() {
  33376. dialogVisible.value = false;
  33377. }
  33378. function remove2() {
  33379. emit("remove", {});
  33380. dialogVisible.value = false;
  33381. }
  33382. function directionChange(e) {
  33383. if (e.target.value === directions[0].key) {
  33384. Object.assign(orders, [{
  33385. key: "\u81EA\u5DE6\u81F3\u53F3",
  33386. value: "-"
  33387. }, {
  33388. key: "\u81EA\u53F3\u81F3\u5DE6",
  33389. value: "+"
  33390. }]);
  33391. radioOrder.value = orders[0].key;
  33392. } else if (e.target.value === directions[1].key) {
  33393. Object.assign(orders, [{
  33394. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33395. value: "-"
  33396. }, {
  33397. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33398. value: "+"
  33399. }]);
  33400. radioOrder.value = orders[0].key;
  33401. }
  33402. }
  33403. function closeDialog() {
  33404. emit("update:showDialog", false);
  33405. }
  33406. function openDialog() {
  33407. updateParams(props.params);
  33408. }
  33409. return (_ctx, _cache) => {
  33410. return openBlock(), createElementBlock("div", _hoisted_1$2, [
  33411. createVNode(unref(ElDialog), {
  33412. modal: false,
  33413. "destroy-on-close": false,
  33414. modelValue: dialogVisible.value,
  33415. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => dialogVisible.value = $event),
  33416. title: title.value,
  33417. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  33418. onClose: closeDialog,
  33419. onOpen: openDialog,
  33420. "show-close": false
  33421. }, {
  33422. header: withCtx(() => [
  33423. createElementVNode("div", _hoisted_2$2, [
  33424. createElementVNode("span", _hoisted_3$2, toDisplayString(title.value), 1)
  33425. ])
  33426. ]),
  33427. default: withCtx(() => [
  33428. createElementVNode("div", _hoisted_4$2, [
  33429. withDirectives(createElementVNode("div", _hoisted_5$2, [
  33430. _hoisted_6$2,
  33431. createElementVNode("div", _hoisted_7$2, [
  33432. createVNode(unref(ElInput), {
  33433. modelValue: wallHeight.value,
  33434. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => wallHeight.value = $event),
  33435. placeholder: "\u8F93\u5165\u9AD8\u5EA6\u503C",
  33436. clearable: ""
  33437. }, null, 8, ["modelValue"])
  33438. ])
  33439. ], 512), [
  33440. [vShow, isShowHeight.value]
  33441. ]),
  33442. withDirectives(createElementVNode("div", _hoisted_8$2, [
  33443. _hoisted_9$1,
  33444. createElementVNode("div", _hoisted_10$1, [
  33445. createVNode(unref(ElInput), {
  33446. modelValue: arcHeight.value,
  33447. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => arcHeight.value = $event),
  33448. placeholder: "\u8F93\u5165\u5F2F\u66F2\u5EA60\uFF5E9000",
  33449. clearable: ""
  33450. }, null, 8, ["modelValue"])
  33451. ])
  33452. ], 512), [
  33453. [vShow, isShowArcHeight.value]
  33454. ]),
  33455. withDirectives(createElementVNode("div", _hoisted_11$1, [
  33456. _hoisted_12$1,
  33457. createElementVNode("div", _hoisted_13$1, [
  33458. createVNode(unref(ElInput), {
  33459. modelValue: lineWidth.value,
  33460. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => lineWidth.value = $event),
  33461. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33462. clearable: ""
  33463. }, null, 8, ["modelValue"])
  33464. ])
  33465. ], 512), [
  33466. [vShow, isShowLineWidth.value]
  33467. ]),
  33468. withDirectives(createElementVNode("div", _hoisted_14$1, [
  33469. _hoisted_15$1,
  33470. createElementVNode("div", _hoisted_16$1, [
  33471. createVNode(unref(ElInput), {
  33472. modelValue: glowPower.value,
  33473. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => glowPower.value = $event),
  33474. placeholder: "\u8F93\u5165\u53D1\u5149\u5F3A\u5EA60\uFF5E1",
  33475. clearable: ""
  33476. }, null, 8, ["modelValue"])
  33477. ])
  33478. ], 512), [
  33479. [vShow, isShowGlowpower.value]
  33480. ]),
  33481. withDirectives(createElementVNode("div", _hoisted_17$1, [
  33482. _hoisted_18$1,
  33483. createElementVNode("div", _hoisted_19$1, [
  33484. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33485. default: withCtx(() => [
  33486. createVNode(unref(ElColorPicker), {
  33487. modelValue: color2.value,
  33488. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => color2.value = $event),
  33489. "show-alpha": "",
  33490. predefine: predefineColors.value,
  33491. label: "12"
  33492. }, null, 8, ["modelValue", "predefine"])
  33493. ]),
  33494. _: 1
  33495. }, 8, ["locale"])
  33496. ])
  33497. ], 512), [
  33498. [vShow, isShowColor.value]
  33499. ]),
  33500. withDirectives(createElementVNode("div", _hoisted_20$1, [
  33501. _hoisted_21$1,
  33502. createElementVNode("div", _hoisted_22$1, [
  33503. createVNode(unref(ElRadioGroup), {
  33504. modelValue: radioDirection.value,
  33505. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => radioDirection.value = $event)
  33506. }, {
  33507. default: withCtx(() => [
  33508. (openBlock(true), createElementBlock(Fragment, null, renderList(directions, (item, index2) => {
  33509. return openBlock(), createBlock(unref(ElRadioButton), {
  33510. label: item.key,
  33511. modelValue: item.value,
  33512. "onUpdate:modelValue": ($event) => item.value = $event,
  33513. onChange: directionChange
  33514. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33515. }), 256))
  33516. ]),
  33517. _: 1
  33518. }, 8, ["modelValue"])
  33519. ])
  33520. ], 512), [
  33521. [vShow, isShowDirection.value]
  33522. ]),
  33523. withDirectives(createElementVNode("div", _hoisted_23$1, [
  33524. _hoisted_24$1,
  33525. createElementVNode("div", _hoisted_25$1, [
  33526. createVNode(unref(ElRadioGroup), {
  33527. modelValue: radioOrder.value,
  33528. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => radioOrder.value = $event)
  33529. }, {
  33530. default: withCtx(() => [
  33531. (openBlock(true), createElementBlock(Fragment, null, renderList(orders, (item, index2) => {
  33532. return openBlock(), createBlock(unref(ElRadioButton), {
  33533. label: item.key,
  33534. modelValue: item.value,
  33535. "onUpdate:modelValue": ($event) => item.value = $event
  33536. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33537. }), 256))
  33538. ]),
  33539. _: 1
  33540. }, 8, ["modelValue"])
  33541. ])
  33542. ], 512), [
  33543. [vShow, isShowOrder.value]
  33544. ]),
  33545. withDirectives(createElementVNode("div", _hoisted_26$1, [
  33546. _hoisted_27$1,
  33547. createElementVNode("div", _hoisted_28$1, [
  33548. createElementVNode("div", _hoisted_29$1, [
  33549. createVNode(unref(ElInput), {
  33550. modelValue: speed.value,
  33551. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => speed.value = $event),
  33552. placeholder: "\u8F93\u5165\u6D41\u52A8\u65F6\u95F40\uFF5E10",
  33553. clearable: ""
  33554. }, null, 8, ["modelValue"])
  33555. ])
  33556. ])
  33557. ], 512), [
  33558. [vShow, isShowSpeed.value]
  33559. ]),
  33560. withDirectives(createElementVNode("div", _hoisted_30$1, [
  33561. _hoisted_31$1,
  33562. createElementVNode("div", _hoisted_32$1, [
  33563. createVNode(unref(ElInput), {
  33564. modelValue: yCount.value,
  33565. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => yCount.value = $event),
  33566. placeholder: "\u8F93\u51651\uFF5E100",
  33567. clearable: ""
  33568. }, null, 8, ["modelValue"])
  33569. ])
  33570. ], 512), [
  33571. [vShow, isShowCount.value]
  33572. ]),
  33573. withDirectives(createElementVNode("div", _hoisted_33$1, [
  33574. _hoisted_34$1,
  33575. createElementVNode("div", _hoisted_35$1, [
  33576. createVNode(unref(ElInput), {
  33577. modelValue: txtContent.value,
  33578. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => txtContent.value = $event),
  33579. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  33580. clearable: "",
  33581. type: "textarea",
  33582. rows: 2
  33583. }, null, 8, ["modelValue"])
  33584. ])
  33585. ], 512), [
  33586. [vShow, isShowText.value]
  33587. ]),
  33588. withDirectives(createElementVNode("div", _hoisted_36$1, [
  33589. _hoisted_37$1,
  33590. createElementVNode("div", _hoisted_38$1, [
  33591. createVNode(unref(ElInput), {
  33592. modelValue: outlineWidth.value,
  33593. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => outlineWidth.value = $event),
  33594. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33595. clearable: ""
  33596. }, null, 8, ["modelValue"])
  33597. ])
  33598. ], 512), [
  33599. [vShow, isShowOutlineWidth.value]
  33600. ]),
  33601. withDirectives(createElementVNode("div", _hoisted_39$1, [
  33602. _hoisted_40$1,
  33603. createElementVNode("div", _hoisted_41$1, [
  33604. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33605. default: withCtx(() => [
  33606. createVNode(unref(ElColorPicker), {
  33607. modelValue: outlineColor.value,
  33608. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => outlineColor.value = $event),
  33609. "show-alpha": "",
  33610. predefine: predefineColors.value,
  33611. label: "12"
  33612. }, null, 8, ["modelValue", "predefine"])
  33613. ]),
  33614. _: 1
  33615. }, 8, ["locale"])
  33616. ])
  33617. ], 512), [
  33618. [vShow, isShowOutlineColor.value]
  33619. ]),
  33620. withDirectives(createElementVNode("div", _hoisted_42$1, [
  33621. _hoisted_43$1,
  33622. createElementVNode("div", _hoisted_44$1, [
  33623. createVNode(unref(ElInput), {
  33624. modelValue: txtVideoUrl.value,
  33625. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => txtVideoUrl.value = $event),
  33626. placeholder: "\u8F93\u5165\u64AD\u653E\u89C6\u9891\u7684\u5730\u5740",
  33627. clearable: "",
  33628. type: "textarea",
  33629. rows: 4
  33630. }, null, 8, ["modelValue"])
  33631. ])
  33632. ], 512), [
  33633. [vShow, isShowVideoUrl.value]
  33634. ]),
  33635. withDirectives(createElementVNode("div", _hoisted_45$1, [
  33636. _hoisted_46$1,
  33637. createElementVNode("div", _hoisted_47$1, [
  33638. createVNode(unref(ElInputNumber), {
  33639. modelValue: axisX.value,
  33640. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => axisX.value = $event),
  33641. precision: 2,
  33642. step: 0.1,
  33643. max: 10
  33644. }, null, 8, ["modelValue"])
  33645. ])
  33646. ], 512), [
  33647. [vShow, isShowAxis.value]
  33648. ]),
  33649. withDirectives(createElementVNode("div", _hoisted_48$1, [
  33650. _hoisted_49$1,
  33651. createElementVNode("div", _hoisted_50$1, [
  33652. createVNode(unref(ElInputNumber), {
  33653. modelValue: axisY.value,
  33654. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => axisY.value = $event),
  33655. precision: 2,
  33656. step: 0.1,
  33657. max: 10
  33658. }, null, 8, ["modelValue"])
  33659. ])
  33660. ], 512), [
  33661. [vShow, isShowAxis.value]
  33662. ]),
  33663. withDirectives(createElementVNode("div", _hoisted_51$1, [
  33664. _hoisted_52$1,
  33665. createElementVNode("div", _hoisted_53$1, [
  33666. createVNode(unref(ElInputNumber), {
  33667. modelValue: axisZ.value,
  33668. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => axisZ.value = $event),
  33669. precision: 2,
  33670. step: 0.1,
  33671. max: 10
  33672. }, null, 8, ["modelValue"])
  33673. ])
  33674. ], 512), [
  33675. [vShow, isShowAxis.value]
  33676. ]),
  33677. createElementVNode("div", _hoisted_54$1, [
  33678. createVNode(unref(ElButtonGroup), null, {
  33679. default: withCtx(() => [
  33680. createVNode(unref(ElButton), {
  33681. type: "primary",
  33682. icon: unref(edit_default),
  33683. onClick: _cache[16] || (_cache[16] = ($event) => submit())
  33684. }, {
  33685. default: withCtx(() => [
  33686. createTextVNode("\u4FEE\u6539")
  33687. ]),
  33688. _: 1
  33689. }, 8, ["icon"]),
  33690. createVNode(unref(ElButton), {
  33691. type: "primary",
  33692. style: { "background-color": "rgb(222, 146, 47)" },
  33693. icon: unref(delete_default),
  33694. onClick: _cache[17] || (_cache[17] = ($event) => remove2())
  33695. }, {
  33696. default: withCtx(() => [
  33697. createTextVNode("\u5220\u9664")
  33698. ]),
  33699. _: 1
  33700. }, 8, ["icon"]),
  33701. createVNode(unref(ElButton), {
  33702. type: "primary",
  33703. style: { "background-color": "rgb(126, 128, 135)" },
  33704. icon: unref(close_default),
  33705. onClick: _cache[18] || (_cache[18] = ($event) => close())
  33706. }, {
  33707. default: withCtx(() => [
  33708. createTextVNode("\u5173\u95ED")
  33709. ]),
  33710. _: 1
  33711. }, 8, ["icon"])
  33712. ]),
  33713. _: 1
  33714. })
  33715. ])
  33716. ])
  33717. ]),
  33718. _: 1
  33719. }, 8, ["modelValue", "title", "style"])
  33720. ]);
  33721. };
  33722. }
  33723. };
  33724. var DialogEditProperty$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["styles", [_style_0$2]]]);
  33725. Array.prototype.last = function() {
  33726. if (this === void 0 || this.length === void 0 || this.length === 0)
  33727. return void 0;
  33728. return this[this.length - 1];
  33729. };
  33730. Array.prototype.first = function() {
  33731. if (this === void 0 || this.length === void 0 || this.length === 0)
  33732. return void 0;
  33733. return this[0];
  33734. };
  33735. Cesium.Entity.prototype.setEditType = function(options2) {
  33736. this._editType = options2;
  33737. };
  33738. Cesium.Entity.prototype.getEditType = function() {
  33739. return this._editType;
  33740. };
  33741. Cesium.Entity.prototype.setEntityType = function(entityType) {
  33742. this._entityType = entityType;
  33743. };
  33744. Cesium.Entity.prototype.getEntityType = function(entityType) {
  33745. return this._entityType;
  33746. };
  33747. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  33748. this._isEdit = isEdit;
  33749. };
  33750. Cesium.Entity.prototype.getIsEdit = function() {
  33751. return this._isEdit;
  33752. };
  33753. Cesium.Entity.prototype.setParams = function(params) {
  33754. this._params = params;
  33755. };
  33756. Cesium.Entity.prototype.getParams = function() {
  33757. return this._params;
  33758. };
  33759. Cesium.Entity.prototype.bindEntity = function(entity) {
  33760. this._bindEntity = entity;
  33761. };
  33762. Cesium.Entity.prototype.getBindEntity = function() {
  33763. return this._bindEntity;
  33764. };
  33765. class DrawTools {
  33766. constructor(viewer2, options2) {
  33767. this._viewer = viewer2;
  33768. this._init(options2);
  33769. }
  33770. static initEditPropertyParams() {
  33771. return {
  33772. id: void 0,
  33773. height: 20,
  33774. bottomHeight: 0,
  33775. color: "rgba(0,255,0,0.75)",
  33776. direction: "horizontal",
  33777. order: "-",
  33778. count: 2,
  33779. text: "",
  33780. lineWidth: 0,
  33781. power: 0.25,
  33782. outlineWidth: 0,
  33783. outlineColor: "rgba(255,255,255,1)",
  33784. videoUrl: "",
  33785. duration: 1500,
  33786. odlineHeight: 1e3,
  33787. odlineCount: 50,
  33788. axisX: 0,
  33789. axisY: 0,
  33790. axisZ: 0
  33791. };
  33792. }
  33793. _init(options2) {
  33794. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  33795. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  33796. this._sketchEntityName = this._guid();
  33797. let dataSource = new Cesium.CustomDataSource(this._sketchEntityName);
  33798. this._viewer.dataSources.add(dataSource);
  33799. this._entities = dataSource.entities;
  33800. this._pointEntitys = [];
  33801. this._sketchPointImage = void 0;
  33802. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  33803. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  33804. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  33805. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  33806. this._image_arrow_forward = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTA3MThEMzhCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTA3MThEMzdCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjI3YWU1YjEtZmRkMy0wOTQyLWIyMzUtMDFkYWY3YTJlNGUyIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+BD9OfQAAEDhJREFUeNrsXT3PJEcRrho2QQ5IkAj4HfwJEhLInUHAjwBBgEACCRC2gAA5MEiQ2QRYpCQgPiJbsiAxyMYGm+O48927u+8WPd6Zd3t7u6qe6lnfe3tvt9Sa3Zmej+6uruep6i9+9NxzTPvAh4MQHf+Z09RCfsPRzUXInyOVa9b/Hnq4zMBdmnv9dhnp7enpDKtToJf9f04/5OZajQiwQhK4UmWskAUtTa3avSAV8aj9Ro7a7/JcDz34UtkVba/fp1JGLrCSpQvmx0EASnAfwZ8V650rgMugdAkA7lIhGGSQkMP1wxs1oqJds64jxIZOyg8jGTmZ2BXXdzfXOf2WozRykub4XAeWbiktK+deR5299G9+mhXgd1N8McU3z+wBqFrqNTLAQE0xYNE7ROKkS0J/n5hppJJXAQgBBT0SrBCH4yNP0K6TjsP3SfUZHlGxiA9ViEeNXOyyNLsszXVxXxmv1fTyDECL2Yazi7dJduRp1Vs9dJdQJ11nCF9K8ZMpfj/FN5pr9XQMgGptt1jPFEhvWd9FGp59Qdo9Gvk4h5XvfbsFvEPQMxF5JgeOZf0OgW8ZjPKI3jd/wzD9Lo+7gohcT+e3Bbko4674v90fOUXZHf7TLnvWdddwPfTQw4WEzaS7fp3ij1N8bYkHQLPec+bHDdZwrsxF8SZoYC8KYFDWETRUniv1fJieCDGAq/Z8bSwDWgZEtW4X37MiFSCV4LElTwwSQ494kXOfFP8/UXipNDLjkZ35sRGylBMXOX4X5zK4qxCOmVhsMwKSx43yf5OlXxf3dnLSQw89lPj9hRQ/m+KnU3w1xfvn8gBQ0JpHLFvb2q/34deUvxjWvgb0kT58Bq1hxPL13uNZ6QP4Tu97Ix4C6x2IFwUpj4hXQ3sH8u3oteg57TuQMkO+r/Xbau/PycmmIBzr7Pfj7Pp87Sr7vT785hRlk5GcHp5U6N74HvbtMJeI91J8IcWXU/xbCwGwQNvrG/cG7KGg7H2DRwyQ5wwKkUCfMVTyFiEELfdEAMRIV+06iRIA9PuRb1wK4lGiYZWRlq7iAQgTiyUEhQnv8tHS1fI9BGXMqmO0fq137DJisi7i1URO5uPj6fx4/DD7X6Zbd3LSwzNOAErMemkiAn8pSELIA+BZqwIAjzc1EL0HJSje/S1WeASQlzwXsbARr8K5PQHnsuqXehdQS/j0+n5Cq/atshBQ0XuigGqBfQuZGgJ5o4bvjJIjPkvdtsssSmZr77iavB8jyXiUkY2RiDyczj3Kfj+Yrn2YpZt/bzuO9XAmD0DeJfnHFL+T4m8mOTQJwED1PnAEqJda8BqAc+B7UOtaAGBBr0UHEUa+tQZcVlcABZWkl1YMMEIsYdS6jIAc6vmIgLTlGVpq0aNl3jImoREMmQ3vD0pUEALHhpyg+YwAey6XA0AgozNpWtoQ0v6HkD6IEc9tRkRmYvIgi/ez3/em4/+m45x2Qz1cEgEoceftFH9G+wGCf496AFr6/C0vAmLdKySDWZkGyNQ+6wAhHC0uejLARah9vECrm5waFFNUCVmgN5yWdwiIxsNQ1H/Uy+DlCx1vQADI1cBwiTKPkpHl3RKH6amtXo0ocYl6LILyeCNvVt2j71hC9lrG1ESeHSH2pOjWCBmJfFftnGTk5P5ERMb43+n/Byn+OzuXX3t89NS7OR5iA3jRxy6w36b4rRR/F+0CiPb7e258aQTw0gL20nrjDWrPo4pbGPVG5B4UT1miwNkKuMh5VPFFXP8RBbhUqbVaXUxtHpOlsw9axwNoRCPaBeC882ZciEcKqLCyW8BwaCgvVBZQr1K0Tmr1ER0/YbzrCITR5wr5U4qXkoaIt7Ce7uDFXGrkRL22BHo1kfdcTWTkPym+P5GSf9F+0N3b0//3p3MfTKTmNgkAVbDr9RS/meIvLAJgWebeNaL4QMCWlflQdhmZmRBhsS1MN2qha982NL4zYBFADXQIlsUSwGtR/i19wxGS0gpemLV5rDSHj58AwIAZ6FY5IhUWEQ6AOXM2HRm15j2PD/KcqCejdTYJUVvXFS98XlQnDQFdvAToOfunLYaG4gY34gWqbxEvMOopR7zn6AJ2+e/Re/K9FH+S4ju1ymwJEVIghjVuFYoEGpL1DXkQsFKIsLUKECdUba47WnZWHpD8ksMQvWfXGGb5OgG+Q1tVMvqM8t7IEtNI2VvpxCkvtEyl+l3ilgEiP1q55jIoC/NuvFfYaMMElE9lczGxvo0b86DVpSzQhWiQxvtr+kiMMhanDUXzKISvr4J4bP16FHd/FqTurXYrICC31BNSJ2zIXjkxXoB2VMvPp1L8Woo/TfFzHgEQowAFLMDagjxcqUA/87oClYAyJ6XhREBTAvfVCIYYjVCAckbA2RJycQSFi5+sAEe+uI6leFhRHlEm3KJEBbB4tPITkOwyqFS1bjJk4SdEYUfkWQy5jACCR0CI6otfeRa/V67aQl8CKO4WHdEOnAzLbfRJUskvA+DikVEEsDQ9jui0aSqySbzYAVAkPy1BFmALGwZOxEjQu4TFXKRNHHzLr30+xV+m+HyKn5m7AKIsDun3j/7mhvdaFSCAuxeZdsgN744+h2l5l4D3HM2diPZpou9t7Y/kQF644T1L3LWeaxidf3/OkfBaHpeU//H3H/f9L51aiHxvax211Dc6Y6Hl2+y9Pc4jk0u6ABHdQKAcU7DMiOJufG09EwGIJOKab+2eRvR+BNPQay33l+U1jm14ZWkXAOLGRdiWtyMgwlS5YG7sMGEBLUfEOkI2B0LvQayUSFeC57KNHKPWYst+EFFvTov3hSqeDW/cS83iQrtmOOB2RNtRixsQUSaHe8VU9uLLJyPtwHPtCpDO86awo7ti9ciwXrQs9mjdWN8kDe2vxTpmMD/syLJXl863SkQfH+sutrzbWXcmm1vXe5a2AN5YT68zWJ4Casmq7AyKwvAEp6XwLUUgZG+ZS6DLiEFBR9YxkEAjkqAyQIkJohxa6oYbFZKnTCOKBumSEPCd7NSfp+ijOz8iZRx1US6RM1baBBmuTISIWG3QyydX+u2lkq3IeB5PFoXaBluhXT45MYoYRXWChZPEsq2KAcLR8Q61vAoom7WxJZ7coWSnTCaAnvHSlLMSiu/NBpmKWocCkOzIFveahR4h2/Z7T+9+K8WvpPjVAQQhcVwe3qA6MQqOlYxG9xhA+8JrDVEChYsCnShPbLHUCWDT5DRmURpqpIxR0EStXAZkDQEetHykoazF8FIJQESQvFnAICH5wrInAcvcIgZWPpV3iNUGI4NzEY+HOHUaLVNkDECE7EmQwJfGS8Qjxwu/2+prZooPxEXD9GzxNiQD88za96K6PGIMoeO4JNjOI56c8v5x98Av0n6RoH8OhkUsgRcgzDHafyFKYxEQQKKj7cXJjwDP1nY95IyNSYBsRZUyWgcRa9ADfw4KJUK20MGlrcCOKuiagovOICDCBxp6HiiEVHBxyfPIWXKlDTBjhda2TBVm0DPIwLdansAzWKGmvLIB7l6/bMSrihJDDsihAM9EZrGgso2Ut+ZdEDBfClEQRM8tGVQYGQ+HzqjgRlnIwzgN8Ospfjk94g/zyVWgceQL5HhuIc2NoW1L28JbvalsnmJh0l3hVtcCG+RkVoaSuQnRDYc0j4onIBJQdJGpY0T1LYUHUJFGWLrnoq2VkCdDkcWrPBlG9r4gh0wPhocGXWZbew7apiJWk9Zm60RFTCJXey4B8sYV/dNKvgT0aFkyUNMBg6NbvHyDg7g+uh1tUyh5x9pbnawg7QuRI03movPoa3p7AGW4xQMTbVe2YViXj3yRoX9Mv9+lvQv/JcczldfFGyl+g24WAsoaa8NCQHkYCJ8T2rKgD9JAoqsORhd0QI6WVUPA957jHZHvtlcRq2+gg74/siOdZQW2bK1L1L4KHJKvc64EiD4HSVdZclm9Z2iUjSUb6Gh7EZTph2A5WGVTy0skr6i8DwvaSPS7tbIWalvds2X5cDrjEWmnSBu2cGm+Pu6P8HCyhMcV+8b9DsbV/O5NwPredP4eHZYgHuMVPZ1hA+CjuxTwymHiOaCK40KuMZjWUbkUuP9wD9+42D2LGbGgIiPRxWGibFg5FqNGLHbPJW+5n+vCI6bl6b2fHE8KSo4igxSt+cMSlLn8dq4UBiKTkXn4iOcqQqzF8Rp49eYt2d3igSNjvQjNChycNJ6F7xGhljU8kFlTeTqtrMXw9NW8C0L24EV2dAgH2i5ax1s63unwwQSu8wZDI9iOGwyNS+jOa/3fn9KO6caNinbUw5JgyRa0GdDKAARRFLG2+AYFG5jnMkVchcfXxHTdiuOytZSOVejS2IC8iszeXe0HMdxtVeCKEiPNnUkG2A+Om8xTWFYdDUG3YsTNq8iJIKSPi+pBVy9ESKEF2uKAH5tk2RfHSBtBlVWETFl6wUuHki7U4CjbFgfbCmLZbiaLbd5mON9e+PEEpjPQPiyAd073cEq7DpssPVxyyLs7RlL1pxS/TcB2wKvTB90IuFQ8AB7bVBqrKnFRDwHaFy4KMEWtaALf4ylZbzlhtr0BQgB4ZdfFy5vQMitVUymn9+XDH22PAkoKo91U1iJRnifCA2zLY6Kl1/oovXtbPQ6R+pSK/LSQWlEs5+hAPQHPkWKhXk3AupkAcjMB5Ayy60lBbjLwvJqANU/3+ADOcvnQ2cH/GQF9zrFhrtWXU/xRin/+SK4dsrc6VSriWRfIspGFkpOWxoxaz4hLNToTAPVgsML+I6QGAT0UCCygtFb+I8dNGtnKWahcubo+gLSlqwWx6C2wQWUw6i2QLFfeltgEeFUsMuN1B1nuZ3Y8CdaztxmYXhf/1wXYrqfj1RTXWZp1FrcTuG6n2EMPlxuerGeFC8NwHMPwQoo/T/GvKNlbATwRcYtrykb7BGQhHgZca0SxEdh4FR6P5EcsO9QyQ6bRRTd6sfpErbXfkVH/5RKcrVaZZ1Eu8UoI4BmxtoC2ABdfXEYgi3j+v52AdDfF6+zcNvu9no4zuO4ygN1mxxyQt0XsNl8Pt45Yd8Emv6Xw+xR/mOKrtB9nAYeVAVxWP3wNlL3FIKzlZJGFJFpdksgKS6cgJJDF71mRiNehVYxQELY2S4m4l6XY4tUjIMrzquMTKOAN0DbSmcFUClC9zq7PabbF9esCgL1z+bN66OFCgb2D/4WHUQe9Qvstfl9recAKAMxaPz7iXkUGEVrWaHS0bmR+prezUmSN+cg3Bqxtt3VHRjWj3QRz2BWWKhXgqh132f/r7Pz14Zzk13fF9fIZPfTQwwWZoj08sfAO7Vf1+0GKr7dywJUBTBGhQheI8abLnQJsm5cq0reqLUHsjWL33scFoFrLD9eWRC1jDYRr50T5Lx1Ye+hWcA/PRpWdo34vWkZ+leKLKb65hAPm2wHrGxacTnPSRq7nA5G8qTBWvzS6ap4G4LVZCzXQ9YBYA2frd1dcXXH1cJfq86z134Wpy9uTCyvAYt4Vq8LlVm0NdLm4tmSnPLp7rUG6BF9avqTX0Z1ugnLOcu51dOdE9xbz9n8BBgASWdK5g1XGVgAAAABJRU5ErkJggg==";
  33807. this._image_arrow_reverse = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QThBQTYyN0ZCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QThBQTYyN0VCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YmIzYjdkNGEtYmQwYi04YjRjLTkwNmQtMTRhMTNkNjEwZWUxIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EmbDrAAAEJdJREFUeNrsXTuPJEkRjujpmdnd2b1bYFkEAhwkpMPi7eCiQ+LuPAyEEMLhcQiQDgmEARL8AhxMDHxsHH4C+Hg4CAMDIYGziBMVZO1k7WRnZ0R8kdWz2zObKeVUVU898hEZX0RkZCQ/ubigkQ6UOGUZzfDc2mq096CRkUa6WRSNXEvjf61R4Y0Q2b1n5/anJ9vRJwdMchM51gsqsxzJOwaQHvF4Gl03UpjSuQJTNs6RY+vcAmiPgqU4SuN3Nu6pn6/vpaYAcXlX+it7zx5CAPh4yt9N+UdD5B9cdqRb2MVDEx+C2lXaFEC65M3e9WVdNo17qLimxrtQUK4BT4JAK8a79Puu+sh6PzsAbfU4eh83hIGWYLBb6upZXjkF8FrKP0z5zZQ/Mkbw4CQjje6/vroYFbs9dS4B86Q4X643jazdvylAe6OA9qYBrhYQWsCn3cPF+T7YcjpK6LseaCP3i6JRTwYga4KGouk/rTZaXsti4Akr1rUYAsMqC8DrKX875TdoTCUMrX6k0f3XXhc5VJ25ANNtAZ7pnNO5nFxd00mRN9X1SQW62+Ld1ADpqXGsAXJJUwDAIs+Vx6mhNUqwHaegOLqvqcrevPYUpBJ26iBgucT4vdayq3ex5J+l+qwlmrID/K2yMnC/oNaDHuB+JWv8P0j5s4PbjjTSSApz2xYgelacn+bz0+Ke1vW2AOJtA4ALcN1hwNLQ6ATTKoUqAPKeE0c71jRNUTRvD6AsIBADyFogwQ6AIMcIeCMAHRUErHl0ZF4dMa9b78/lFDa+L2A7tMo9BWik+p1dISQqAHws5a+l/HbKj4eqOZJLiiNdZ1q01gSccpZB9jQfl/Pz4nzJdwqwPasA+bQCWc3Ui4IeApbe8572Kw3iYwWgxKFWSwuManHeNy2Q9kaTOPXSwKp3zrlHSy4BDNXMyzZloF0toYDJd7SjgBZOQLvYNKKXuvWtloCItkfp9Ke2FyoAzEzhkxn4vzHY/kgm+d4+kD3LoHleHJff7uXjct26r8wL0G46gbNxnyAg7Wlz0wG0Me0+uQYq85hbbQHwTKceOEgQoJl057AImGvz59c0Ck2nC0SAsSwEqHUj8i2tv7W+pUa7liA7AZYAcjR9XdgRWKjQ2pEBywI8jhABYPYS/FLKP075M44JY6SRetK2ANN71fn9lO9mOrxbnN8rQDb9xudZCz4HwJQCGiqBYCrgdy0mEQE5URibKMylBSyTo915jDwyt6oxPA9E2Dm3NH1vbpsbWqsoJdO0X68fUS3dA3A22l2CVgkPG7yyS/D9njCDrGsXh75QS4vnG4GAMgP9x+AYQdf0E/AeBvjIznOeADB79s+Oft9M+UMdHT/S8aTTDKYX+fggHx/m45xfKc7vF0C7AO8W1IpQMEU0UNDbWFBty5ofZEcLbmkOEziAGRw/GuAJyCQQTcn5bcd7mQDNFxG2LOBH6hRhlhJoBwZaCtWEkekGASwmaN9pQoUlVEVAlp1xbD13ZfrfXzqHCCkofSA0JqBAbbUTg2MgMi4twQ39dlRw2HmvJQB8IeWfpvzFbLrs/eDtTfstcSeD6KsZWJfjo5TfW/3vYb5eQJZBCdUC0QjoSsXsraU7iObqMVbLgckzBzL5c55rrFKKRsZSRc5q1S3yXTkotelOQ+1nd9mxYVYUAjTuKIhbtIy8R8hehsVAm7cAaAKEC+kQxObb5nnY1vun9ruejUV07hrR/D0rQ49AgDgPlrCPll8DYDZ4j7XKAPX94ICiwri1gEuLCgMKR6v9vPpq/JaBMqvLAL+a8s9S/gQ4yJ5nupfB9P0pvy+D62ydeJx/e5R/f0++75zwtaM1o2ETbMVkEhbD84A+Im55modjOhNES/YGbO2tKo4Jc6qKxEGQtPquZWZEwFP7DOpVjWjZiBNaRNjSn69DgTRLxajzXI+w52nvHASwCMP3hCgUzHumLsrHUS18GYvsCBwC1Kc13iyTeY8JGp3TZ0f7RpwNifS1+Uy+74qQ7ZDI4Phkh883VkMIO+2D8lbNzB9RLqBVAB9M+Vspv5M1VW9wlum/hikqEDzBNO2g0Zs8k6VHpIjJkU2T3GVwCwl0kucbiswptjRAD+gQT1tkTi0aSMQyM0faHPm/xTBaXstEWJANhUaYC00OnSJwono1wVoTgBbx1KFfeV6WvCXgSxnyBZ33D5k0wXFCDlj0Wm487dYTJGVlu7ToF5nKWcrlOechJmzptE5EV2VooI2sXkBC8EZB1uOHETrRcDTSvlDfbIobPpfyb1L+RQP8EQmbi4GOgDgDxBQdgKz8xgEtEjGbeYO3Bf51Ga0wl8g1NcxKPVYai2ARKZgp7nTEnQyWgMFFjgk5aiJG+1EarxFQqyWDuS2XDJgwo3WghoUPmS+NMJ3yK0hYVqTNidYt2+qxOiCgzEFabwFb4B1sjePI8jEkLgEFtU82ymLRT9STXYzvInSEWi0JrCOTv6lP6/9s/I7wn640CwAfoEsnv9+l/GWDcLgxANsgJeoAYqBCHlPmQOcQ2V6n67UaHUQ5rmWwxVSteSNR+icCusi8Uk0L3txcb3v2vMVjwuibGHiHN6fp0UOLltmhFXTuMsI4OWhdQTScqGc7U3tumcE+ZpApinOftWGMHEB4RcBdwH7hhgVNW+/P1WcZsKwi1lOvLSLToBauRPi8p2R69BzhERq2eMKkF6CICfOVQKze7vTYPAXw65Tfot3lU0joQURjRADdezcDDeqBmOVUQgEmaAxIKGh5xCQbCVrSIkZ0Hr/H1N6zjCliSmv5Dfd6BaPmNc9aIAB9IVpMj8ORpqWX72yvv991/EOdsBzggaaU0PlyRNhsTeG0fD0kQGMe86SOtkKdYxFTsxfAhwxeUT0jmrVhopiDncVDJgfEEQ98hD45MA4j1iKEJ3GwnZhiFu+eUMzRlU4743ijAjmHGbllykL2OY7Ov4hjFSijL3HDbCaN+6yYz86cjiASoyWtevPh7GikvWDsCXYMCB8eYUfNaXGLDYcFUwaB2tJavb6MrNRQ+pq9cWNZ47gYyWJoVwyMcwnQDKJ9e2M/2o8REyriF4Bqodw5rjxLROT91jr2iBPyGq2bO9ug12rHYHsglhxv/r4WNiOR+lBlM7qK6CCr8WYB4Pt0uZ3vX5VPiaOdR5mSx4QY+C4FTFaL41EmKGkxZi6eZpBIjHsYnXdETVTWGlUBGYeA7ewJdhpYiwGMKHMXh2Fb1Magqdeia89EyyvGAzkCawn2rQ1FPCuX1p6IjwfiVc+geRUBlOhe6lHHKhS4PcHQmvZA55kRS5KAdEPgN3sEbu5oYw7wMwRoI4AYoTNkejDCs9Glx0jYbERpphV9Q4Y18akA8PeUf5vyV1L+fdCc6g02r2GQzpdOoo9oLHkAMKrlki3YCFP/sknUAUnzqxCKaWQ9dZaGaYw7Bi3qfISWmzrrboVaFZB+UdrUYi5QNYXEwPcsCxCqOTtty7SiXwQU9BgoKwFWNE1joyAv8KyOEdrzIvihfg89q18iIG3F/kAdC6NtXf+3Z4kbO/2AWJwlKGBxsI3Z4N1k8AWP/jkwnpt9WqwC4D+lP99J+Zcp/6tz0HNAo7I0CnYkr54EgJNQh8VC03Yjkd/QAYoyBwGYlQDaMjqtENW+BGCAVuAMDkjGa6wvVjkQJzVP0udA/3PFJhFth4GyOhqHRIUGDmpgFKBDxFqmMdm1MUw4MB5RK0uUR1lttMZ7noFzRINHhfT2+8TkC9b6fYuvWb4XkdUJiACH+JoxyGu8PlizVPYqAMuTi4vWA3MgoJ+n/Brhc/PzJkEfpctVBXMgng/TbrAezUENia2Nrmm1rAiexcGKaDWB1gkw+p4Zcx2dR7aes9YDR8oIhOBtlWMnAlb0vRIc2JOjya/dKAfdHwAtU3RLWWQnPuQ7E+mOc2v2MfA2FbKesTZu6WnDKA1QR9u3/78b9yM6hhDa4JXtb9WLKBbILDoevMBqGt+eqvb16hUJXYzu54A4hbYDFTG1lr4SyN/ZqKMn6HjOnc+e0QSAOWmhgDUgPaXjTPPqhiX07qN8nCMEPs7CycN8fj//PsdAmBtl22j4ySESCRDPmqiBIBBDAk6UGZECKMh3J5DxXBfgaO0+AXWlFQBtlbnRLyyN8Mw9ghRaV689NQbrtT3ar2u2G+4V6iJClSeY9AgPER4xrR67+2DUQxu9gsEa3nXIb3jPeXTChCsmPd9DlF5PQQ1ZoywBYE7aZkCtRjlWAeAmpHkq5m4WPuZQx6/Q1V4Bc0jjB1koWTbueTUfyx3ztp2DskeIiOxJ4DFNlPFqjHBS7mNQi0QZOVK3ifRoglMH+EXLI53PdAoqXaArnXWK0BGy10VUWOwBME+Dj7RppEyI0HAIUEXvYcAipT1v3cNgOTxAR33S6o2NohFue3zfPMFhTXRD8QQAoqvtgH+S8qczWLXW4w4B4CYnbEZp2fN+2Zr3ohJEyusH+d5y+9672SJzVtBLr3m2cT+XexusmWpAtaFDaX+HAnOj3Grb9AJO77bHqNXALs+VyV0UZh6d9ukRsiLadKStvBgHiBUCsXagZW7RjyO47O0oGVEsKDBOkSkGMqyXUYuBrHjWExYQS4J3D0esErYAcFXNmVl/KuXvpfz13Rc96+izgaIjHYkoc14IK4vQcScLIeeFEHOaj2fVfaf5+jTn+fcTAACmgCaGaINTh7a1dj6/R+CJmOFbYBed70fKjW4vjQJ1r6WmVzDy/AqY4r4RnjUHEWx6rIsR4Eetikhdestujd2Ipr5ipdveTqSIMKAFAFpWue1t/rY1WenVre+m/MeU/5nyX1J+my7nzctNT45JUx3p5U0zdfwn538fcTm3Od/Jx7Min1fn51kQOauEkvJ6m4WU5fqEsI1GagZiMTJrsySieIRNVsBMX3XiO4N5dSGD4Vtm1hoUDrFHuxG+N31H1LKx044tM7AV26DeLY8I22iHwTbUVn71cPneXQx7o1MeIupodBe/cmfISIRFZzO7/YiQyBRAneZ56TfpMoDQ5+n4nQBHGhLVSP3Esa1yKXBsi/NFQNlUQshZPm4LIWU5bnI+KSwsh7Z4oJaNXl8DxMrQ40/Qqbk/G88Rh75JAcs1/kOW1SKqjaNWgbaVYFdoZMId+CZHiNDKiewsiTqMW/2NRBM0HQR7BIAlvU6XWwe/VWgeIw1BYaSRnncqhYg6b8HfNvn3WiA5qYQVLs4twIwuRaWAw2IEFFF/AUR4QQQfpKxr6oPWAxEeiGK+A9Hl6hG/AFEsBl55kT1fVGFhu4L3/yHlv6X8j5TfGDzotqcB/iMdbZpyfvfIJehNJUhUVhDhQgAp/8/Fb5uGMKIdl+9agYO0zZusQa9NOSCmew8gUY3Dm9rQmJi2MRFS7poZRsvYalukHtrUhXL+9NSaynmWMAFAr+KfU/5Vyk9ebs028I6hSA/rx0gvqwT9v5yPndg3tB9JcqNcbxrP1cJHKyqlFvu+tRcDExZ2WByQZ2Ng90Q7RdgGg2AeES5qfw2kqM33rZkCGDx1pBfX6dFXDXobpDTSbeo0K6S2F2obDb/bCv+NOBIigYy8CLgtE34dO4FVwWd/Q/Wmc+j2hdGCDFp/OZWgAzWqDHp7qYlXXvaBeBPrJYd+mdyQjrJ+4+DzJfBPDYKo91Uw9wz5vwADAFVdqz1vyN8hAAAAAElFTkSuQmCC";
  33808. this._image_h_l_r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAABIklEQVR4nO3WbQuCMBiG0dn//80tiAp6WT4zi+A+54vTTdMKuZZ20Y/H2/is9/r+aFxdNz5/qa7t1/Gr+dlj79ZX5mrnvz93p+3T9zKznbnnynW/OPfwnLXP/v2xqXvolXv8dH7Ld7Vhvs+cf/2v/d/vd3dfq8/0zbm1a1d/18L2o3fIzHbtnVi51p5zK8f6q3Xj8cza8XjrusH+oQEAcQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAAJCmtXYCutDwWwUr9cEAAAAASUVORK5CYII=";
  33809. this._image_h_r_l = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAC90lEQVR4Ae3WzVbbMBAG0PzBgcOa93/M7nCj2F8zUUILdDmXjWTNSLauBMz+19vbstvvl139+c5zza39sd7hUNe99mveZ/3dbs3/LF7W3j/IXbZ5hzI/Yzf7TXxux/fPY3n+W+wrOfP3Zs5P26wXk22d/bzenJf8jNf82h/73XLOh7KeS51b++fEw/R8uQfzetvzsubmbtyuPXLmteo6W/9Qv2lZ7te4fde6l6xT52Ysbf22jK3t+o7j8frdt/H1HTWe96RdY+v8OnfrX84u45kznrPm6Cde2/THnPRrW/vjK+e8OT6e61j6OZcaH/ZbfDvXy+/Qsc5Jv55TxtKOWNY/t39+bx/NSV6dk3VGrM4Zu/2fsbFW/Ou69RvGO2rOFlvq2Pwdc2w8Z/0tdpqeL/HTab0/iaWd1xt5iaWd587PyXt6evyOOT939LP8jCcv66d9fn78nsSH2cvLv3OS//p6mzvmJza3Izb+D64/ae/zR/zR3IyN+MfH/fz39+tY9j9yv9//6pw57+45/xvOfzv9ECBAgAABAt0EFADdTtx+CRAgQIDAWUAB4BoQIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgK/AX08dE/3SOoSAAAAAElFTkSuQmCC";
  33810. this._image_v_b_t = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAADcklEQVR4nO3di27bMAyFYdpWLuv2/o+aJfFFgxOp5VjKdjDM6rD/A4KkbZyhwIBzTMluE/s+CAAA+J/EIH1/SL9ws/KLR/5rAADwZb2S4zHIMBzVN9YOzh8QN74XAAD8HTmLt2Z3Ns3PId7vR/MB9oPihtcAAGBfOq9Lr3WOR/0Icrt5BaAxb14rAwAA4OsUAC/HPxWAk4i0hSmAF/iT8zMAALCvnNXtQiHwwn/O8WkuAGdTALy1hFhoEQAAoA5ver+W4aoAXK8UAAAA/j1/UgDGED8mAHYZQB/ofYBQAgAAqMIL/qXN/L+F/6MAyPX6TUS6lQLgPYQCAABAFaUCsJbjY3oMQS4XXQDaFwoAywAAANRRCv6lApDP/odHAYi3Wy4A3YYCMFEAAACozgv9tUn+qApAnycA4cUCMFEAAACoxgv+LQVgSI8Q5OdPWwDawoE2/CcKAAAAVZTC3zuRn5wC0M0F4LuIHJx9AHb3/2TCnwIAAEAdugC0zmtRWW4LwP0xAYjPCcAhTQHswZ9uHOAUAQAAsC971t8WLunXBeD97H9+X14COBT2Adj1flsCKAAAAOzPC35vGcBb/291ATguFIBS8FMAAACoo1QASpP8993/7wUgLQGcUgEICxMAHfojVwIAAFCNLQDdCwUgPDcBXi5vqQAcCgUgOsFv9wIAAID9NE74ezf1swXgnt7X6CWAo7oh0FIBGLkSAACAqvJGPxv+paX8UW8AnH+Q7wR4NhsBvQIwqgnASAEAAKAaO/7fUgB6lfEx3wnwbDYCLhWAkQIAAEBVXgHwbuufc3xQ9/xJBeB6PacCcFooAF74jxQAAACqWAp/fVdfXQD6lO+PE/ggH0sA+koAUQdKOpACAADA1/BKARC1AbDNpSDE5wQgXwrYpQKwNgEYKQAAAFRTKgD27/roCYC+1f84TwDOZg9AMAfa9f+BCQAAAFW16iqAYJ717YBzjg9qiX96/jng2+2Uzv6PqgSUJgCDKQHcDRAAgP3Zs/9gvvY2Abb6ioC5AOTgP5vw17p0QKueKQAAANThFYCgzvytLn2dpwHHEO/3tfCX9P2ggr8zlwICAIB9NGb8vxT8OsePefw/XxIYpO9/mJ3/S/LGgqDW/ikAAADsp9kQ+J45v9/S9+NcALaGv5X/4W77IQAAoLI3EWl/AQ/TsX9wLtbWAAAAAElFTkSuQmCC";
  33811. this._image_v_t_b = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAHhUlEQVR4Ae2d2W7bSBREucmy7IcA+f+fnAePtXCZqr68IhVLSGLATIA5DbS72QspHT9U9UbV79++vVdV9axIgAAEIAABCEDgf0Kgq3a7f/RdR8WXT37nSf0yfvIWdIMABCAAAQhA4DcJNHP7+jf7uXlvA/CmTHb2TEDe0A3uhRT7XpWOg+JU1bXLCRCAAAQgAAEIbEFgmqzXjq1iN+d/ruF13dfT9NbVT08XdXI8zZ33StMQKHsN94R/UMNBFZ5BIEAAAhCAAAQgsBEB6W8j/U0T4MF4GgGnj3TcA/ej4rmr9vuzM4rpHpQteXfOG1j8ffOMvSos/CWqHAMgCAQIQAACEIDAVgRW4m8TYB1uNRs/VtNkA5AmYK3jFv+zCs7qe+6m/f6ki92qsW+SZsAdLf6OLrcBKNP+Kuj1oEEPyjpVESAAAQhAAAIQ2IhALR1uZsH3TH4n0W4lymkAbAys4w7W8F5t+6muPeg/dbUMgAp25SYh9BZ5G4BavUpH3cwd0wBY9Ici/mEI7DZcR4AABCAAAQhAYCsCtWX6ugfAot9rTO5ZgDQAax33YN0GwPrtJf9j18gAyA3kVEGO5m0AHIoB0J8QeU8thOjnUoDTNAduT4AABCAAAQhAYAsC0xQzADHi92g/xD+WAH7UcQ3xp75qGpuAMADT4XDUbsBaJqCeR/Ke4i8zAEqLAVCaIn9rAGIJYJTjcDkBAhCAAAQgAIGNCEi2lxmAZSkgR/85sE8d9wA/l/FPujh6E+BRmUYi3tSNNhTaIaQBsLtw8BG/2FhwHfmrj5cCxkblaoQBKKD4AwEIQAACENiIQAzcGwlwGf3rsq3GMZcAYv1/reOzAZB+n1UpA/Dy4uMAthFW+0E32in94BzUwSI/qFNJnVcc53KXESAAAQhAAAIQ2I6A5Lpq9MfRum0zUGYAXKZr1zs6eMe+Ndyn+C7KH7v6+fmoYo3xPZxvBqVlF6HLZAuio+rKDIA6W/B1A5//TyOgonJKoDyBPxCAAAQgAAEIbELAS/eN9NknAWppeCsNb10m+S5lNzpuDdfSvTS8HP/vqsPhXY2t4EXY9ZG9/u8phFqL+8UA6E7aJFDW+Yvou63arDcA2gQQIAABCEAAAhDYjoA12iP9YgK0lu+0GIC57J6O9xLsi3T/1E0vL+8e/auxR/flHKHyZQlAdy4GQOWut+hnXIu/y1xPgAAEIAABCEBgOwIxUz9q/C7h1+g+zEBcF3NwR8fLuwDU/tQ1h8O/cgLe0NdrE6BfCNQpbwdxuwRg8W+8vHA1Abn730cEMQDb/cN5EgQgAAEIQCAJlNG/hD7Ef53e03Gf3ov3BehVwN4DMIu6VDxmAGQAtALgtYUyAyCnYIVPob8xAaWvTwkQIAABCEAAAhDYmkARfonwYgBm4S+m4KOOFwMgXb/EEsA4xuheGwD1yTtVWNFjA4G/ii9jlL+IfxwLtPCPpd7tCBCAAAQgAAEIbEkgtNrr/2kCmqaUze/3uQ7kVT/qmKB13C8EunRtnAKwiNsVxAZAO4b5BldxTwOwFv6cFfD7AwgQgAAEIAABCGxLYPSreDRgT81OI+BZfEeHmBGYZvH3gN96X2YAvAegV7uz0usJAFXaTSwhDYDTtQmIlwdhABZS5CAAAQhAAALbELDIW/Rz4G5DkGYgDcDySXIGwL8H0PsYoN8DMEjXPfUf7wBwp3AVS7dZ6DWlEHsBMg1DgAFYSJGDAAQgAAEIbEMgRvf5PoCSSsLzdEDMAOQnkY5PsQQwGwAdA5TY+6d9y+hfSh5vAfzROcQMwDL693WO/qMuH0EKAQhAAAIQgMAWBNZi77xmA8rav4/x39PxeKePlwCGbtrtjmqT7//3C4CaMvq/19GC7zP/FnwMwBb/Wp4BAQhAAAIQeEzAWu3oWfvMW/zzet0zdPu6DNB1r69HqX+e/S9vANQ97joH9Q3hb9vFBPjmLidAAAIQgAAEILAtAeu1Q+r2oDf1W8QVStn601jEFTR7P1bDMJQfA+r860F++Y83DrhT39feFbju17mTQ9ct4p9lma47kIcABCAAAQhA4GsJpFan4M8a7ofe1XFruPcBKHZV256qp6dWbiDE352fnrQb8NYAlG9goc/oAud9MwIEIAABCEAAAn+GgAbt19H+rOG+9sa+m5D67bRtZQBeX09l5H+5LAbAN/hVA+A9AQQIQAACEIAABP4MgU4H+FKzU7/zev2J1gZAmwE7jfaP89T/YgC8gcAhb+BOS4h8HCWo1H9dt7QiBwEIQAACEIDA1xM4n0OzvYwfYVnC/6jjMZO/28kANM1ZsdZvAoSDyMaR5k2iQ36NtSFY57OeFAIQgAAEIACBbQgcDqnVy8DdT36k4/NMQFd9/352s+rt7Z4BWD78Wugf5ZfW5CAAAQhAAAIQ2IJADtz9rEd516V2Xw3A6WQDUFX7fU4d3N6gVN75M9/g5mF3mlEEAQhAAAIQgMAXErAeW/jX4v/ocWkCVK/f+Z2ena7arvOr4muWNf8rCjIQgAAEIACBv47AL+m4TwlcFH/W+K/7dnwgCEAAAhCAAAQ+T+A/hVJn6rP9qnIAAAAASUVORK5CYII=";
  33812. this._sketchTempPoints = [];
  33813. this._sketchPoints = [];
  33814. this._sketchOutputPoints = [];
  33815. this._sketchWallHeights = [];
  33816. this._drawEntity = void 0;
  33817. this._lineLabel = void 0;
  33818. this._polygonLabel = void 0;
  33819. if (options2 && options2.isDrawPoint)
  33820. this._isDrawPoint = options2.isDrawPoint;
  33821. else
  33822. this._isDrawPoint = false;
  33823. if (options2 && options2.isRetainDrawPoint)
  33824. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  33825. else
  33826. this._isRetainDrawPoint = false;
  33827. this._param = {
  33828. lineWidth: 3,
  33829. lineColor: "rgba(0,255,0,0.75)",
  33830. outlineWidth: 2,
  33831. outlineColor: "rgba(255,255,255,1)",
  33832. polygonColor: "rgba(0,255,0,0.5)",
  33833. wallHeight: 30,
  33834. power: 0.25,
  33835. odlineHeight: 1e3,
  33836. odlineCount: 50,
  33837. text: "\u91D1\u7530\u4EA7\u4E1A\u96C6\u56E2",
  33838. duration: 1500,
  33839. count: 1,
  33840. direction_h: "horizontal",
  33841. direction_v: "vertical",
  33842. order_add: "+",
  33843. order_minus: "-",
  33844. houseColor: "rgba(0,255,0,0.95)"
  33845. };
  33846. if (options2 && options2.iconType) {
  33847. switch (options2.iconType) {
  33848. case DrawTools.IconType.Normal:
  33849. this._sketchPointImage = this._iconNormal;
  33850. break;
  33851. case DrawTools.IconType.Blue:
  33852. this._sketchPointImage = this._iconBlue;
  33853. break;
  33854. case DrawTools.IconType.Green:
  33855. this._sketchPointImage = this._iconGreen;
  33856. break;
  33857. case DrawTools.IconType.Violet:
  33858. this._sketchPointImage = this._iconViolet;
  33859. break;
  33860. default:
  33861. this._sketchPointImage = this._iconNormal;
  33862. break;
  33863. }
  33864. } else {
  33865. this._sketchPointImage = this._iconNormal;
  33866. }
  33867. this._canvasWidth = this._viewer.scene.canvas.width;
  33868. this._canvasHeight = this._viewer.scene.canvas.height;
  33869. if (this._isRuntimeApp()) {
  33870. this._viewer._cesiumWidget._supportsImageRenderingPixelated = Cesium.FeatureDetection.supportsImageRenderingPixelated();
  33871. this._viewer._cesiumWidget._forceResize = true;
  33872. if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
  33873. this._viewer.resolutionScale = 2.6;
  33874. }
  33875. }
  33876. }
  33877. _arcToDegree(arc) {
  33878. return arc / Math.PI * 180;
  33879. }
  33880. _toColor(red, green, blue, alpha) {
  33881. let normalColor = new Cesium.Color(0, 0, 0, 1);
  33882. if (typeof red != "number")
  33883. return normalColor;
  33884. if (typeof green != "number")
  33885. return normalColor;
  33886. if (typeof blue != "number")
  33887. return normalColor;
  33888. if (typeof alpha != "number")
  33889. return normalColor;
  33890. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  33891. return normalColor;
  33892. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  33893. }
  33894. _toColorFromArray(array) {
  33895. if (!array || array.length === void 0 || array.length === 0)
  33896. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  33897. let r2 = 255, g = 255, b = 255, a = 1;
  33898. if (array.length === 1) {
  33899. r2 = parseInt(array[0]);
  33900. } else if (array.length === 2) {
  33901. r2 = parseInt(array[0]);
  33902. g = parseInt(array[1]);
  33903. } else if (array.length === 3) {
  33904. r2 = parseInt(array[0]);
  33905. g = parseInt(array[1]);
  33906. b = parseInt(array[2]);
  33907. } else if (array.length >= 4) {
  33908. r2 = parseInt(array[0]);
  33909. g = parseInt(array[1]);
  33910. b = parseInt(array[2]);
  33911. a = parseFloat(array[3]);
  33912. }
  33913. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  33914. }
  33915. _updateScene() {
  33916. this._viewer.scene.requestRender();
  33917. }
  33918. _getScreenClickPosition(screenPosition) {
  33919. let resCartesian = void 0;
  33920. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  33921. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33922. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33923. if (Cesium.defined(position2)) {
  33924. resCartesian = {
  33925. x: position2.x,
  33926. y: position2.y,
  33927. z: position2.z
  33928. };
  33929. }
  33930. return resCartesian;
  33931. }
  33932. _getScreenClickPositionAndHeight(screenPoint) {
  33933. var lng = void 0, lat = void 0, height2 = void 0;
  33934. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  33935. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33936. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33937. cartographic = Cesium.Cartographic.fromCartesian(position2);
  33938. var feature2 = this._viewer.scene.pick(screenPoint);
  33939. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  33940. lng = this._arcToDegree(cartographic.longitude);
  33941. lat = this._arcToDegree(cartographic.latitude);
  33942. height2 = cartographic.height;
  33943. } else {
  33944. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  33945. if (Cesium.defined(cartesian)) {
  33946. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  33947. if (Cesium.defined(cartographic)) {
  33948. lng = this._arcToDegree(cartographic.longitude);
  33949. lat = this._arcToDegree(cartographic.latitude);
  33950. height2 = cartographic.height;
  33951. }
  33952. }
  33953. }
  33954. return {
  33955. lng,
  33956. lat,
  33957. height: height2
  33958. };
  33959. }
  33960. _transfromFromScreenPoint(screenPosition) {
  33961. let location = this._getScreenClickPositionAndHeight(screenPosition);
  33962. if (location.lng != void 0) {
  33963. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  33964. return {
  33965. gLocation: location,
  33966. sLocation: cartesian
  33967. };
  33968. } else {
  33969. return {
  33970. gLocation: void 0,
  33971. sLocation: void 0
  33972. };
  33973. }
  33974. }
  33975. _removeEntityByName(entityName) {
  33976. var entities2 = this._entities;
  33977. if (!entities2 || !entities2.values)
  33978. return;
  33979. var delEntitys = [];
  33980. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  33981. if (entities2.values[i2].name == entityName) {
  33982. delEntitys.push(entities2.values[i2]);
  33983. }
  33984. }
  33985. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  33986. entities2.remove(delEntitys[i2]);
  33987. }
  33988. this._updateScene();
  33989. }
  33990. _removeEntityByObject(objEntity) {
  33991. if (!Cesium.defined(objEntity))
  33992. return;
  33993. this._entities.remove(objEntity);
  33994. }
  33995. _createPoint(coord, label) {
  33996. let _self = this;
  33997. let entity = new Cesium.Entity({
  33998. name: _self._sketchEntityName + "_Point",
  33999. position: coord,
  34000. billboard: {
  34001. image: _self._sketchPointImage,
  34002. horizontalOrigin: Cesium.HorizontalOrigin.center,
  34003. verticalOrigin: Cesium.VerticalOrigin.bottom,
  34004. scale: 0.5,
  34005. pixelOffset: new Cesium.Cartesian2(0, -11),
  34006. disableDepthTestDistance: Number.POSITIVE_INFINITY
  34007. }
  34008. });
  34009. if (label) {
  34010. entity.label = {
  34011. text: label,
  34012. font: "12px sans-serif",
  34013. fillColor: this._toColor(255, 255, 255, 1),
  34014. outlineColor: this._toColor(0, 154, 94, 1),
  34015. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  34016. outlineWidth: 1,
  34017. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  34018. pixelOffset: new Cesium.Cartesian2(0, -28),
  34019. showBackground: true,
  34020. backgroundColor: this._toColor(0, 0, 0, 0.6),
  34021. disableDepthTestDistance: Number.POSITIVE_INFINITY
  34022. };
  34023. }
  34024. this._entities.add(entity);
  34025. this._pointEntitys.push(entity);
  34026. this._updateScene();
  34027. }
  34028. _removePointEntitys() {
  34029. this._removeEntityByName(this._sketchEntityName + "_Point");
  34030. this._pointEntitys = [];
  34031. }
  34032. _callUpdaeEllipseCenterPosition() {
  34033. let _self = this;
  34034. return function() {
  34035. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  34036. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  34037. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(
  34038. Cesium.Math.toDegrees(
  34039. point1cartographic.longitude
  34040. ),
  34041. Cesium.Math.toDegrees(point1cartographic.latitude),
  34042. point2cartographic.height
  34043. );
  34044. return _self._sketchEllipseCenterPosition;
  34045. };
  34046. }
  34047. _callUpdateEllipseMinorAxis(positions) {
  34048. let _self = this;
  34049. return function() {
  34050. if (positions === void 0 || positions.length === void 0 || positions.length < 2) {
  34051. _self._sketchEllipseRadius = 0;
  34052. } else {
  34053. _self._sketchEllipseRadius = _self._calculateEllipseMinorAxis(positions[0], positions[1]);
  34054. if (_self._sketchEllipseRadius <= 0)
  34055. _self._sketchEllipseRadius = 1;
  34056. }
  34057. return _self._sketchEllipseRadius;
  34058. };
  34059. }
  34060. _calculateEllipseMinorAxis(position1, position2) {
  34061. let point1cartographic = Cesium.Cartographic.fromCartesian(position1);
  34062. let point2cartographic = Cesium.Cartographic.fromCartesian(position2);
  34063. let geodesic = new Cesium.EllipsoidGeodesic();
  34064. geodesic.setEndPoints(point1cartographic, point2cartographic);
  34065. return geodesic.surfaceDistance;
  34066. }
  34067. _calculateEllipseOutlineCoordinate(position1, position2) {
  34068. let positionCenter = position1;
  34069. let positionRotate = position2;
  34070. let ellipseOutlineCoordinates = [];
  34071. for (let angle = 5; angle < 360; ) {
  34072. let newPosition = this._rotatedPointByAngle(positionRotate, positionCenter, angle);
  34073. ellipseOutlineCoordinates.push(newPosition);
  34074. angle = angle + 5;
  34075. }
  34076. ellipseOutlineCoordinates.push(ellipseOutlineCoordinates[0]);
  34077. return ellipseOutlineCoordinates;
  34078. }
  34079. _callEllipseOutlineCoordinate(positions) {
  34080. let _self = this;
  34081. return function() {
  34082. _self._ellipseOutlineCoordinates = _self._calculateEllipseOutlineCoordinate(positions[0], positions[1]);
  34083. return _self._ellipseOutlineCoordinates;
  34084. };
  34085. }
  34086. _rotatedPointByAngle(position_A, position_B, angle) {
  34087. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  34088. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  34089. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  34090. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  34091. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  34092. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  34093. var new_z = localPosition_A.z;
  34094. return Cesium.Matrix4.multiplyByPoint(
  34095. localToWorld_Matrix,
  34096. new Cesium.Cartesian3(new_x, new_y, new_z),
  34097. new Cesium.Cartesian3()
  34098. );
  34099. }
  34100. _callUpdateRectangleCoordinates(positions) {
  34101. let _self = this;
  34102. return function() {
  34103. let g0 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[0]);
  34104. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[1]);
  34105. let lng0 = Cesium.Math.toDegrees(g0.longitude);
  34106. let lat0 = Cesium.Math.toDegrees(g0.latitude);
  34107. let lng1 = Cesium.Math.toDegrees(g1.longitude);
  34108. let lat1 = Cesium.Math.toDegrees(g1.latitude);
  34109. _self._rectangleCoordinates = [0, 0, 1, 1];
  34110. if (lng0 < lng1) {
  34111. _self._rectangleCoordinates[0] = lng0;
  34112. _self._rectangleCoordinates[2] = lng1;
  34113. } else {
  34114. _self._rectangleCoordinates[0] = lng1;
  34115. _self._rectangleCoordinates[2] = lng0;
  34116. }
  34117. if (lat0 < lat1) {
  34118. _self._rectangleCoordinates[1] = lat0;
  34119. _self._rectangleCoordinates[3] = lat1;
  34120. } else {
  34121. _self._rectangleCoordinates[1] = lat1;
  34122. _self._rectangleCoordinates[3] = lat0;
  34123. }
  34124. let rectangle = Cesium.Rectangle.fromDegrees(
  34125. _self._rectangleCoordinates[0],
  34126. _self._rectangleCoordinates[1],
  34127. _self._rectangleCoordinates[2],
  34128. _self._rectangleCoordinates[3]
  34129. );
  34130. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  34131. _self._rectangleOutlineCoordinates = res.cPoints;
  34132. _self._sketchOutputPoints = res.gPoints;
  34133. return rectangle;
  34134. };
  34135. }
  34136. _calculateRectangleOutlineCoordinates(rectangle) {
  34137. let south_east = Cesium.Rectangle.southeast(rectangle);
  34138. let se2 = Cesium.Cartographic.toCartesian(south_east);
  34139. let south_west = Cesium.Rectangle.southwest(rectangle);
  34140. let sw = Cesium.Cartographic.toCartesian(south_west);
  34141. let north_east = Cesium.Rectangle.northeast(rectangle);
  34142. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  34143. let north_west = Cesium.Rectangle.northwest(rectangle);
  34144. let nw = Cesium.Cartographic.toCartesian(north_west);
  34145. let gPoints = [];
  34146. gPoints.push({
  34147. lng: Cesium.Math.toDegrees(south_west.longitude),
  34148. lat: Cesium.Math.toDegrees(south_west.latitude),
  34149. height: south_west.height
  34150. });
  34151. gPoints.push({
  34152. lng: Cesium.Math.toDegrees(south_east.longitude),
  34153. lat: Cesium.Math.toDegrees(south_east.latitude),
  34154. height: south_east.height
  34155. });
  34156. gPoints.push({
  34157. lng: Cesium.Math.toDegrees(north_east.longitude),
  34158. lat: Cesium.Math.toDegrees(north_east.latitude),
  34159. height: north_east.height
  34160. });
  34161. gPoints.push({
  34162. lng: Cesium.Math.toDegrees(north_west.longitude),
  34163. lat: Cesium.Math.toDegrees(north_west.latitude),
  34164. height: north_west.height
  34165. });
  34166. gPoints.push({
  34167. lng: Cesium.Math.toDegrees(south_west.longitude),
  34168. lat: Cesium.Math.toDegrees(south_west.latitude),
  34169. height: south_west.height
  34170. });
  34171. return {
  34172. cPoints: [sw, se2, ne2, nw, sw],
  34173. gPoints
  34174. };
  34175. }
  34176. _callUpdateRectangleOutlineCoordinates() {
  34177. let _self = this;
  34178. return function() {
  34179. return _self._rectangleOutlineCoordinates;
  34180. };
  34181. }
  34182. _materialTextImageProperty(options2) {
  34183. this._canvasId = "canvasJt";
  34184. let canvasObj = document.getElementById(this._canvasId);
  34185. if (canvasObj != null) {
  34186. document.body.removeChild(canvasObj);
  34187. }
  34188. canvasObj = document.createElement("canvas");
  34189. canvasObj.id = this._canvasId;
  34190. canvasObj.setAttribute("width", "1024px");
  34191. canvasObj.setAttribute("height", "256px");
  34192. document.body.appendChild(canvasObj);
  34193. let context = canvasObj.getContext("2d");
  34194. context.fillStyle = options2.color === void 0 ? "rgba(255,0,0,1)" : options2.color;
  34195. context.font = "bold 240px \u5FAE\u8F6F\u96C5\u9ED1";
  34196. context.textAlign = "left";
  34197. context.textBaseline = "bottom";
  34198. context.fillText(options2.text, 12, 250, 1e3);
  34199. let textMaterial = new Cesium.ImageMaterialProperty({
  34200. image: canvasObj,
  34201. transparent: true
  34202. });
  34203. textMaterial._param = {
  34204. color: context.fillStyle,
  34205. text: options2.text
  34206. };
  34207. return textMaterial;
  34208. }
  34209. _materialColorProperty(options2) {
  34210. let mColor = "rgba(0,255,0,1)";
  34211. if (options2 !== void 0 && options2.color !== void 0)
  34212. mColor = options2.color;
  34213. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34214. colorMaterial._param = {
  34215. color: mColor
  34216. };
  34217. return colorMaterial;
  34218. }
  34219. _materialPolylineArrowProperty(options2) {
  34220. let mColor = "rgba(0,255,0,1)";
  34221. if (options2 !== void 0 && options2.color !== void 0)
  34222. mColor = options2.color;
  34223. let colorMaterial = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34224. colorMaterial._param = {
  34225. color: mColor
  34226. };
  34227. return colorMaterial;
  34228. }
  34229. _materialPolylineGlowProperty(options2) {
  34230. let mColor = "rgba(0,255,0,1)";
  34231. if (options2 !== void 0 && options2.color !== void 0)
  34232. mColor = options2.color;
  34233. let power = 0.25;
  34234. if (options2 !== void 0 && options2.power !== void 0 && typeof options2.power === "number")
  34235. power = options2.power;
  34236. let colorMaterial = new Cesium.PolylineGlowMaterialProperty({
  34237. color: Cesium.Color.fromCssColorString(mColor),
  34238. glowPower: power
  34239. });
  34240. colorMaterial._param = {
  34241. color: mColor,
  34242. power
  34243. };
  34244. return colorMaterial;
  34245. }
  34246. _materialPolylineOutlineProperty(options2) {
  34247. let mColor = "rgba(0,255,0,1)";
  34248. let outlineColor = "rgba(255,255,255,1.0)";
  34249. let outlineWidth = 1.2;
  34250. if (options2 !== void 0 && options2.color !== void 0)
  34251. mColor = options2.color;
  34252. if (options2 !== void 0 && options2.outlineColor !== void 0)
  34253. outlineColor = options2.outlineColor;
  34254. if (options2 !== void 0 && options2.outlineWidth !== void 0 && typeof options2.outlineWidth === "number")
  34255. outlineWidth = options2.outlineWidth;
  34256. let colorMaterial = new Cesium.PolylineOutlineMaterialProperty({
  34257. color: Cesium.Color.fromCssColorString(mColor),
  34258. outlineColor: Cesium.Color.fromCssColorString(outlineColor),
  34259. outlineWidth
  34260. });
  34261. colorMaterial._param = {
  34262. color: mColor,
  34263. outlineColor,
  34264. outlineWidth
  34265. };
  34266. return colorMaterial;
  34267. }
  34268. _clear(isAll) {
  34269. if (isAll != void 0 && isAll === true) {
  34270. this._removeEntityByName(this._sketchEntityName);
  34271. this._removePointEntitys();
  34272. }
  34273. this._sketchTempPoints = [];
  34274. this._sketchPoints = [];
  34275. this._sketchOutputPoints = [];
  34276. this._sketchWallHeights = [];
  34277. this._drawEntity = void 0;
  34278. this._removeOperationDom();
  34279. this._tooltipRemove();
  34280. if (this._drawEventHandler !== null && this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  34281. this._clearEvent(this._drawEventHandler);
  34282. }
  34283. }
  34284. }
  34285. Object.assign(DrawTools.prototype, {
  34286. setLabel: function(options2) {
  34287. if (!options2) {
  34288. options2 = {
  34289. lineLabel: void 0,
  34290. polygonLabel: void 0
  34291. };
  34292. }
  34293. if (options2.lineLabel)
  34294. this._lineLabel = options2.lineLabel;
  34295. if (options2.polygonLabel)
  34296. this._lineLabel = options2.polygonLabel;
  34297. }
  34298. });
  34299. Object.assign(DrawTools.prototype, {
  34300. _registerLeftClickEvent: function(handler, callChange) {
  34301. let _self = this;
  34302. if (!handler)
  34303. return;
  34304. handler.setInputAction(function(event2) {
  34305. _self._lock = true;
  34306. clearTimeout(_self._timer);
  34307. _self._timer = setTimeout(function() {
  34308. if (callChange)
  34309. callChange(event2);
  34310. _self._lock = false;
  34311. }, 200);
  34312. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  34313. },
  34314. _registerLeftDoubleClickEvent: function(handler, callChange) {
  34315. let _self = this;
  34316. if (!handler)
  34317. return;
  34318. handler.setInputAction(function(event2) {
  34319. clearTimeout(_self._timer);
  34320. _self._lock = false;
  34321. if (callChange)
  34322. callChange(event2);
  34323. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  34324. },
  34325. _registerMouseMoveEvent: function(handler, callChange) {
  34326. let _self = this;
  34327. if (!handler)
  34328. return;
  34329. handler.setInputAction(function(event2) {
  34330. if (_self._lock === void 0 || _self._lock === false) {
  34331. if (callChange)
  34332. callChange(event2);
  34333. }
  34334. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  34335. },
  34336. _registerRightClickEvent: function(handler, callChange) {
  34337. if (!handler)
  34338. return;
  34339. handler.setInputAction(function(event2) {
  34340. if (callChange)
  34341. callChange(event2);
  34342. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  34343. },
  34344. _registerLeftDownEvent: function(handler, callChange) {
  34345. if (!handler)
  34346. return;
  34347. handler.setInputAction(function(event2) {
  34348. if (callChange)
  34349. callChange(event2);
  34350. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  34351. },
  34352. _registerLeftUpEvent: function(handler, callChange) {
  34353. if (!handler)
  34354. return;
  34355. handler.setInputAction(function(event2) {
  34356. if (callChange)
  34357. callChange(event2);
  34358. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  34359. },
  34360. _clearEvent: function(handler) {
  34361. this._endTooltip();
  34362. this._removeOperationDom();
  34363. if (!handler)
  34364. return;
  34365. handler.destroy();
  34366. handler = null;
  34367. }
  34368. });
  34369. Object.assign(DrawTools.prototype, {
  34370. _createPolyline: function(polylineType) {
  34371. let _self = this;
  34372. let entityParam = DrawTools.initEditPropertyParams();
  34373. let polylineWidth = _self._param.lineWidth;
  34374. let polylineMaterial = this._materialColorProperty({
  34375. color: _self._param.lineColor
  34376. });
  34377. entityParam.id = DrawTools.DrawType.Polyline;
  34378. if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.ArrowsPolyline) {
  34379. polylineMaterial = this._materialPolylineArrowProperty({
  34380. color: _self._param.lineColor
  34381. });
  34382. polylineWidth = _self._param.lineWidth * 3;
  34383. entityParam.color = _self._param.lineColor;
  34384. entityParam.id = DrawTools.DrawType.ArrowPolyline;
  34385. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.GrowPolyline) {
  34386. polylineMaterial = this._materialPolylineGlowProperty({
  34387. color: _self._param.lineColor,
  34388. power: _self._param.power
  34389. });
  34390. polylineWidth = _self._param.lineWidth * 3;
  34391. entityParam.color = _self._param.lineColor;
  34392. entityParam.power = _self._param.power;
  34393. entityParam.id = DrawTools.DrawType.GrowPolyline;
  34394. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.OutlinePolyline) {
  34395. polylineMaterial = this._materialPolylineOutlineProperty({
  34396. color: _self._param.lineColor,
  34397. outlineColor: _self._param.outlineColor,
  34398. outlineWidth: _self._param.outlineWidth
  34399. });
  34400. polylineWidth = _self._param.lineWidth * 2;
  34401. entityParam.color = _self._param.lineColor;
  34402. entityParam.outlineColor = _self._param.outlineColor;
  34403. entityParam.outlineWidth = _self._param.outlineWidth;
  34404. entityParam.id = DrawTools.DrawType.OutlinePolyline;
  34405. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.DynamicPolyline) {
  34406. polylineMaterial = new WallMaterialProperty({
  34407. viewer: _self._viewer,
  34408. trailImage: _self._image_h_l_r,
  34409. duration: _self._param.duration,
  34410. color: Cesium.Color.fromCssColorString(_self._param.lineColor),
  34411. param: {
  34412. direction: _self._param.direction_h,
  34413. count: _self._param.count,
  34414. order: _self._param.order_minus
  34415. }
  34416. });
  34417. polylineWidth = _self._param.lineWidth;
  34418. entityParam.color = _self._param.lineColor;
  34419. entityParam.duration = _self._param.duration;
  34420. entityParam.direction = _self._param.direction_h;
  34421. entityParam.count = _self._param.count;
  34422. entityParam.order = _self._param.order_minus;
  34423. entityParam.id = DrawTools.DrawType.DynamicPolyline;
  34424. }
  34425. entityParam.lineWidth = polylineWidth;
  34426. let entityPolyline = new Cesium.Entity({
  34427. name: _self._sketchEntityName,
  34428. polyline: {
  34429. show: true,
  34430. positions: new Cesium.CallbackProperty(function() {
  34431. return _self._sketchTempPoints;
  34432. }, false),
  34433. material: polylineMaterial,
  34434. width: polylineWidth,
  34435. clampToGround: true
  34436. }
  34437. });
  34438. this._drawEntity = this._entities.add(entityPolyline);
  34439. this._drawEntity.setParams(entityParam);
  34440. },
  34441. _updatePolyline: function(isEdit) {
  34442. this._drawEntity.polyline.positions = this._sketchPoints;
  34443. this._drawEntity.setEntityType(DrawTools.DrawType.Polyline);
  34444. if (isEdit != void 0 && isEdit === true) {
  34445. this._removePointEntitys();
  34446. this._setEntityIsEdit(this._drawEntity);
  34447. }
  34448. },
  34449. _createSpatialPolyline: function() {
  34450. let _self = this;
  34451. let entityParam = DrawTools.initEditPropertyParams();
  34452. let lineMaterial = this._materialColorProperty({
  34453. color: _self._param.lineColor
  34454. });
  34455. entityParam.id = DrawTools.DrawType.SpatialLine;
  34456. entityParam.color = _self._param.lineColor;
  34457. entityParam.lineWidth = _self._param.lineWidth;
  34458. let entity = new Cesium.Entity({
  34459. name: _self._sketchEntityName,
  34460. polyline: {
  34461. show: true,
  34462. positions: new Cesium.CallbackProperty(function() {
  34463. return _self._sketchTempPoints;
  34464. }, false),
  34465. material: lineMaterial,
  34466. width: _self._param.lineWidth,
  34467. clampToGround: false
  34468. }
  34469. });
  34470. this._drawEntity = this._entities.add(entity);
  34471. this._drawEntity.setParams(entityParam);
  34472. },
  34473. _updateSpatialPolyline: function(isEdit) {
  34474. this._drawEntity.polyline.positions = this._sketchPoints;
  34475. this._drawEntity.setEntityType(DrawTools.DrawType.SpatialLine);
  34476. if (isEdit != void 0 && isEdit === true) {
  34477. this._removePointEntitys();
  34478. this._setEntityIsEdit(this._drawEntity);
  34479. }
  34480. },
  34481. _createPolygon: function(polygonType) {
  34482. let _self = this;
  34483. let entityParam = DrawTools.initEditPropertyParams();
  34484. let polygonMaterial = this._materialColorProperty({
  34485. color: _self._param.polygonColor
  34486. });
  34487. let lineMaterial = this._materialColorProperty({
  34488. color: _self._param.outlineColor
  34489. });
  34490. let entityPolygon = new Cesium.Entity({
  34491. name: _self._sketchEntityName,
  34492. polygon: {
  34493. show: true,
  34494. hierarchy: new Cesium.CallbackProperty(function() {
  34495. return {
  34496. positions: _self._sketchTempPoints
  34497. };
  34498. }, false),
  34499. material: polygonMaterial,
  34500. classificationType: Cesium.ClassificationType.BOTH
  34501. },
  34502. polyline: {
  34503. show: true,
  34504. positions: new Cesium.CallbackProperty(function() {
  34505. return _self._sketchTempPoints;
  34506. }, false),
  34507. material: lineMaterial,
  34508. width: _self._param.outlineWidth,
  34509. clampToGround: true
  34510. }
  34511. });
  34512. entityParam.color = _self._param.polygonColor;
  34513. entityParam.outlineColor = _self._param.outlineColor;
  34514. entityParam.outlineWidth = _self._param.outlineWidth;
  34515. this._drawEntity = this._entities.add(entityPolygon);
  34516. if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.NormalPolygon) {
  34517. this._drawEntity.setEntityType(DrawTools.DrawType.Polygon);
  34518. entityParam.id = DrawTools.DrawType.Polygon;
  34519. } else if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.HousePolygon) {
  34520. this._drawEntity.setEntityType(DrawTools.DrawType.House);
  34521. entityParam.id = DrawTools.DrawType.House;
  34522. }
  34523. this._drawEntity.setParams(entityParam);
  34524. },
  34525. _updatePolygon: function(isEdit) {
  34526. let _self = this;
  34527. let houseMaterial = this._materialColorProperty({
  34528. color: _self._param.houseColor
  34529. });
  34530. let entityType = this._drawEntity.getEntityType();
  34531. if (entityType === DrawTools.DrawType.Polygon) {
  34532. this._drawEntity.polygon.hierarchy = {
  34533. positions: _self._sketchPoints
  34534. };
  34535. this._drawEntity.polyline.positions = this._sketchPoints;
  34536. } else if (entityType === DrawTools.DrawType.House) {
  34537. let entityParam = this._drawEntity.getParams();
  34538. this._removeEntityByObject(this._drawEntity);
  34539. let height2 = parseFloat(this._sketchOutputPoints[0].height);
  34540. let houseHeight = height2 + parseInt(_self._param.wallHeight);
  34541. let houseEntity = new Cesium.Entity({
  34542. name: _self._sketchEntityName,
  34543. polygon: {
  34544. show: true,
  34545. hierarchy: {
  34546. positions: _self._sketchPoints
  34547. },
  34548. extrudedHeight: houseHeight,
  34549. material: houseMaterial
  34550. }
  34551. });
  34552. this._drawEntity = this._entities.add(houseEntity);
  34553. this._drawEntity.setEntityType(entityType);
  34554. entityParam.height = _self._param.wallHeight;
  34555. entityParam.bottomHeight = height2;
  34556. entityParam.color = _self._param.houseColor;
  34557. this._drawEntity.setParams(entityParam);
  34558. }
  34559. if (isEdit != void 0 && isEdit === true) {
  34560. this._removePointEntitys();
  34561. this._setEntityIsEdit(this._drawEntity);
  34562. }
  34563. },
  34564. _createRectangle: function() {
  34565. let _self = this;
  34566. let entityParam = DrawTools.initEditPropertyParams();
  34567. let rectMaterial = this._materialColorProperty({
  34568. color: _self._param.polygonColor
  34569. });
  34570. let lineMaterial = this._materialColorProperty({
  34571. color: _self._param.outlineColor
  34572. });
  34573. let entityRectangle = new Cesium.Entity({
  34574. name: _self._sketchEntityName,
  34575. polyline: {
  34576. show: true,
  34577. positions: new Cesium.CallbackProperty(
  34578. _self._callUpdateRectangleOutlineCoordinates(),
  34579. false
  34580. ),
  34581. material: lineMaterial,
  34582. width: _self._param.outlineWidth,
  34583. clampToGround: true
  34584. },
  34585. rectangle: {
  34586. show: true,
  34587. coordinates: new Cesium.CallbackProperty(
  34588. _self._callUpdateRectangleCoordinates(
  34589. _self._sketchTempPoints
  34590. ),
  34591. false
  34592. ),
  34593. material: rectMaterial,
  34594. classificationType: Cesium.ClassificationType.BOTH
  34595. }
  34596. });
  34597. entityParam.id = DrawTools.DrawType.Rectangle;
  34598. entityParam.color = _self._param.polygonColor;
  34599. entityParam.outlineColor = _self._param.outlineColor;
  34600. entityParam.outlineWidth = _self._param.outlineWidth;
  34601. this._drawEntity = this._entities.add(entityRectangle);
  34602. this._drawEntity.setParams(entityParam);
  34603. },
  34604. _updateRectangle(isEdit) {
  34605. this._drawEntity.polyline.positions = this._rectangleOutlineCoordinates;
  34606. let coordinates = this._rectangleCoordinates;
  34607. this._drawEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
  34608. this._drawEntity.setEntityType(DrawTools.DrawType.Rectangle);
  34609. if (isEdit != void 0 && isEdit === true) {
  34610. this._setEntityIsEdit(this._drawEntity);
  34611. }
  34612. },
  34613. _createCircle: function(centerPosition, circleType) {
  34614. let _self = this;
  34615. let entityParam = DrawTools.initEditPropertyParams();
  34616. let circleMaterial = this._materialColorProperty({
  34617. color: _self._param.polygonColor
  34618. });
  34619. let lineMaterial = this._materialColorProperty({
  34620. color: _self._param.outlineColor
  34621. });
  34622. if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34623. circleMaterial = new CircleMaterialProperty({
  34624. viewer: _self._viewer,
  34625. duration: _self._param.duration,
  34626. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34627. count: _self._param.count
  34628. });
  34629. }
  34630. this._sketchEllipseCenterPosition = centerPosition.clone();
  34631. let entityCircle = new Cesium.Entity({
  34632. name: _self._sketchEntityName,
  34633. position: centerPosition,
  34634. ellipse: {
  34635. show: true,
  34636. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34637. _self._sketchTempPoints
  34638. ), false),
  34639. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34640. _self._sketchTempPoints
  34641. ), false),
  34642. material: circleMaterial,
  34643. classificationType: Cesium.ClassificationType.BOTH
  34644. }
  34645. });
  34646. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34647. entityCircle.polyline = {
  34648. show: true,
  34649. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(
  34650. _self._sketchTempPoints
  34651. ), false),
  34652. material: lineMaterial,
  34653. width: _self._param.outlineWidth,
  34654. clampToGround: true
  34655. };
  34656. }
  34657. this._drawEntity = this._entities.add(entityCircle);
  34658. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34659. this._drawEntity.setEntityType(DrawTools.DrawType.Circle);
  34660. entityParam.id = DrawTools.DrawType.Circle;
  34661. entityParam.color = _self._param.polygonColor;
  34662. entityParam.outlineColor = _self._param.outlineColor;
  34663. entityParam.outlineWidth = _self._param.outlineWidth;
  34664. } else if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34665. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicCircle);
  34666. entityParam.id = DrawTools.DrawType.DynamicCircle;
  34667. entityParam.color = _self._param.polygonColor;
  34668. entityParam.duration = _self._param.duration;
  34669. entityParam.count = _self._param.count;
  34670. }
  34671. this._drawEntity.setParams(entityParam);
  34672. },
  34673. _updateCircle(isEdit) {
  34674. this._drawEntity.position = this._sketchEllipseCenterPosition;
  34675. let center2 = this._sketchTempPoints.first();
  34676. let outpoint = this._sketchTempPoints.last();
  34677. this._ellipseOutlineCoordinates = this._calculateEllipseOutlineCoordinate(center2, outpoint);
  34678. this._sketchEllipseRadius = this._calculateEllipseMinorAxis(center2, outpoint);
  34679. if (this._drawEntity.polyline != void 0) {
  34680. this._drawEntity.polyline.positions = this._ellipseOutlineCoordinates;
  34681. }
  34682. this._drawEntity.ellipse.semiMajorAxis = this._sketchEllipseRadius;
  34683. this._drawEntity.ellipse.semiMinorAxis = this._sketchEllipseRadius;
  34684. if (isEdit != void 0 && isEdit === true) {
  34685. this._setEntityIsEdit(this._drawEntity);
  34686. }
  34687. },
  34688. _createWall: function(wallType) {
  34689. let _self = this;
  34690. let entityParam = DrawTools.initEditPropertyParams();
  34691. let wallMaterial = this._materialColorProperty({
  34692. color: _self._param.polygonColor
  34693. });
  34694. entityParam.color = _self._param.polygonColor;
  34695. if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34696. wallMaterial = this._materialTextImageProperty({
  34697. color: _self._param.polygonColor,
  34698. text: _self._param.text
  34699. });
  34700. entityParam.text = _self._param.text;
  34701. entityParam.color = _self._param.polygonColor;
  34702. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34703. wallMaterial = new WallMaterialProperty({
  34704. viewer: _self._viewer,
  34705. trailImage: _self._image_v_t_b,
  34706. duration: _self._param.duration,
  34707. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34708. param: {
  34709. count: _self._param.count,
  34710. direction: _self._param.direction_v,
  34711. order: _self._param.order_minus
  34712. }
  34713. });
  34714. entityParam.color = _self._param.polygonColor;
  34715. entityParam.duration = _self._param.duration;
  34716. entityParam.direction = _self._param.direction_v;
  34717. entityParam.count = _self._param.count;
  34718. entityParam.order = _self._param.order_minus;
  34719. }
  34720. let normalWall = new Cesium.Entity({
  34721. name: _self._sketchEntityName,
  34722. wall: {
  34723. show: true,
  34724. positions: new Cesium.CallbackProperty(function() {
  34725. return _self._sketchTempPoints;
  34726. }, false),
  34727. minimumHeights: new Cesium.CallbackProperty(function() {
  34728. return _self._sketchWallHeights;
  34729. }, false),
  34730. maximumHeights: new Cesium.CallbackProperty(function() {
  34731. _self._sketchWallMaxHeights = [];
  34732. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  34733. _self._sketchWallMaxHeights.push(_self._sketchWallHeights[i2] + _self._param.wallHeight);
  34734. }
  34735. return _self._sketchWallMaxHeights;
  34736. }, false),
  34737. material: wallMaterial
  34738. }
  34739. });
  34740. this._drawEntity = this._entities.add(normalWall);
  34741. entityParam.height = this._param.wallHeight;
  34742. if (wallType === void 0 || wallType === DrawTools.WallType.ColorWall) {
  34743. this._drawEntity.setEntityType(DrawTools.DrawType.NormalWall);
  34744. entityParam.id = DrawTools.DrawType.NormalWall;
  34745. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34746. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicWall);
  34747. entityParam.id = DrawTools.DrawType.DynamicWall;
  34748. } else if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34749. this._drawEntity.setEntityType(DrawTools.DrawType.TextWall);
  34750. entityParam.id = DrawTools.DrawType.TextWall;
  34751. }
  34752. this._drawEntity.setParams(entityParam);
  34753. },
  34754. _updateWall: function(isEdit) {
  34755. let hLength = this._sketchWallHeights.length;
  34756. let mhLength = this._sketchWallMaxHeights.length;
  34757. let pLength = this._sketchPoints.length;
  34758. if (hLength === mhLength && hLength - pLength === 1) {
  34759. this._sketchWallHeights.pop();
  34760. this._sketchWallMaxHeights.pop();
  34761. this._drawEntity.wall.positions = this._sketchPoints;
  34762. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34763. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34764. if (isEdit != void 0 && isEdit === true) {
  34765. this._removePointEntitys();
  34766. this._setEntityIsEdit(this._drawEntity);
  34767. }
  34768. } else {
  34769. this._console(hLength, mhLength, pLength);
  34770. }
  34771. },
  34772. _createVideoWall: function() {
  34773. let _self = this;
  34774. let entityWall = new Cesium.Entity({
  34775. name: _self._sketchEntityName,
  34776. position: _self._sketchOutputPoints[0],
  34777. wall: {
  34778. show: true,
  34779. positions: new Cesium.CallbackProperty(function() {
  34780. let pt0 = _self._sketchOutputPoints[0];
  34781. let pt1 = _self._sketchOutputPoints[1];
  34782. _self._wallPositions = [];
  34783. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34784. pt0.lng,
  34785. pt0.lat,
  34786. pt0.height
  34787. ));
  34788. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34789. pt1.lng,
  34790. pt1.lat,
  34791. pt0.height
  34792. ));
  34793. return _self._wallPositions;
  34794. }, false),
  34795. maximumHeights: new Cesium.CallbackProperty(function() {
  34796. _self._sketchWallHeights = [];
  34797. let pt2 = _self._sketchOutputPoints[0];
  34798. _self._sketchWallHeights.push(pt2.height);
  34799. _self._sketchWallHeights.push(pt2.height);
  34800. return _self._sketchWallHeights;
  34801. }, false),
  34802. minimumHeights: new Cesium.CallbackProperty(function() {
  34803. _self._sketchWallMaxHeights = [];
  34804. let pt2 = _self._sketchOutputPoints[1];
  34805. _self._sketchWallMaxHeights.push(pt2.height);
  34806. _self._sketchWallMaxHeights.push(pt2.height);
  34807. return _self._sketchWallMaxHeights;
  34808. }, false),
  34809. material: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34810. outline: true,
  34811. outlineColor: Cesium.Color.fromCssColorString(_self._param.outlineColor),
  34812. outlineWidth: _self._param.outlineWidth
  34813. }
  34814. });
  34815. _self._drawEntity = _self._entities.add(entityWall);
  34816. },
  34817. _updateVideoWall: function(isEdit) {
  34818. let entityParam = DrawTools.initEditPropertyParams();
  34819. entityParam.id = DrawTools.DrawType.VideoWall;
  34820. let videoElement = document.getElementById("wallVideo");
  34821. if (videoElement !== null) {
  34822. document.body.removeChild(videoElement);
  34823. }
  34824. videoElement = document.createElement("video");
  34825. videoElement.id = "wallVideo";
  34826. videoElement.setAttribute("crossorigin", "anonymous");
  34827. videoElement.setAttribute("width", "1024px");
  34828. videoElement.setAttribute("height", "256px");
  34829. videoElement.setAttribute("controls", "controls");
  34830. videoElement.setAttribute(
  34831. "src",
  34832. "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4"
  34833. );
  34834. videoElement.setAttribute("loop", "loop");
  34835. videoElement.play();
  34836. document.body.appendChild(videoElement);
  34837. this._drawEntity.wall.positions = this._wallPositions;
  34838. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34839. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34840. entityParam.height = this._sketchWallMaxHeights[0] - this._sketchWallHeights[0];
  34841. this._drawEntity.wall.material = videoElement;
  34842. this._removePointEntitys();
  34843. this._drawEntity.setEntityType(DrawTools.DrawType.VideoWall);
  34844. entityParam.videoUrl = "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4";
  34845. entityParam.id = DrawTools.DrawType.VideoWall;
  34846. this._drawEntity.setParams(entityParam);
  34847. if (isEdit != void 0 && isEdit === true) {
  34848. this._setEntityIsEdit(this._drawEntity);
  34849. }
  34850. },
  34851. _calculateOdlinePositios: function(strPoint, endPoint, height2, count) {
  34852. let pt1 = this._cartesian3ToGeo(strPoint);
  34853. let pt2 = this._cartesian3ToGeo(endPoint);
  34854. var h2 = height2 && height2 < 1e3 ? height2 : 1e3;
  34855. var L = Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude) ? Math.abs(pt1.longitude - pt2.longitude) : Math.abs(pt1.latitude - pt2.latitude);
  34856. var num = count && count > 50 ? count : 50;
  34857. var result = [];
  34858. var tempResult = [];
  34859. var dlt = L / num;
  34860. var addHeight = pt1.height > pt2.height ? pt1.height : pt2.height;
  34861. var maxHeight = addHeight + h2;
  34862. var minHeight1 = pt1.height;
  34863. var minHeight2 = pt2.height;
  34864. if (Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude)) {
  34865. var delLat = (pt2.latitude - pt1.latitude) / num;
  34866. if (pt1.longitude - pt2.longitude > 0) {
  34867. dlt = -dlt;
  34868. }
  34869. for (var i2 = 1; i2 < num; i2++) {
  34870. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34871. var lon = pt1.longitude + dlt * i2;
  34872. var lat = pt1.latitude + delLat * i2;
  34873. var alt = void 0;
  34874. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34875. alt = maxHeight;
  34876. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34877. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34878. } else {
  34879. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34880. }
  34881. tempResult.push([lon, lat, alt]);
  34882. }
  34883. } else {
  34884. var delLon = (pt2.longitude - pt1.longitude) / num;
  34885. if (pt1.latitude - pt2.latitude > 0) {
  34886. dlt = -dlt;
  34887. }
  34888. for (var i2 = 1; i2 < num; i2++) {
  34889. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34890. var lon = pt1.longitude + delLon * i2;
  34891. var lat = pt1.latitude + dlt * i2;
  34892. var alt = void 0;
  34893. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34894. alt = maxHeight;
  34895. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34896. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34897. } else {
  34898. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34899. }
  34900. tempResult.push([lon, lat, alt]);
  34901. }
  34902. }
  34903. result.push([pt1.longitude, pt1.latitude, pt1.height]);
  34904. for (var i2 = 0; i2 < tempResult.length; i2++) {
  34905. result.push(tempResult[i2]);
  34906. }
  34907. result.push([pt2.longitude, pt2.latitude, pt2.height]);
  34908. let results = [];
  34909. for (let i3 = 0; i3 < result.length; i3++) {
  34910. results.push(Cesium.Cartesian3.fromDegrees(result[i3][0], result[i3][1], result[i3][2]));
  34911. }
  34912. return results;
  34913. },
  34914. _createOdline: function(isFirst) {
  34915. let _self = this;
  34916. if (isFirst !== void 0 && isFirst === true) {
  34917. let fatherEntity = new Cesium.Entity({
  34918. name: this._sketchEntityName
  34919. });
  34920. this._odlineFatherEntity = this._entities.add(fatherEntity);
  34921. let entityParam = DrawTools.initEditPropertyParams();
  34922. entityParam.id = DrawTools.DrawType.OdLine;
  34923. entityParam.color = _self._param.polygonColor;
  34924. entityParam.duration = _self._param.duration;
  34925. entityParam.direction = _self._param.direction_h;
  34926. entityParam.count = _self._param.count;
  34927. entityParam.order = _self._param.order_add;
  34928. entityParam.odlineHeight = _self._param.odlineHeight;
  34929. entityParam.odlineCount = _self._param.odlineCount;
  34930. entityParam.lineWidth = _self._param.lineWidth * 3;
  34931. this._odlineFatherEntity.setParams(entityParam);
  34932. this._odlineEntitys = [];
  34933. }
  34934. let faterParam = this._odlineFatherEntity.getParams();
  34935. let odLineMaterial = new WallMaterialProperty({
  34936. viewer: _self._viewer,
  34937. trailImage: _self._image_arrow_reverse,
  34938. duration: faterParam.duration,
  34939. color: Cesium.Color.fromCssColorString(faterParam.color),
  34940. param: {
  34941. direction: faterParam.direction,
  34942. count: faterParam.count,
  34943. order: faterParam.order
  34944. }
  34945. });
  34946. let entity = new Cesium.Entity({
  34947. name: _self._sketchEntityName,
  34948. parent: this._odlineFatherEntity,
  34949. polyline: {
  34950. show: true,
  34951. positions: new Cesium.CallbackProperty(function() {
  34952. let center2 = _self._sketchTempPoints[0];
  34953. let endPoint = _self._sketchTempPoints[_self._sketchTempPoints.length - 1];
  34954. let results = _self._calculateOdlinePositios(
  34955. center2,
  34956. endPoint,
  34957. parseInt(
  34958. faterParam.odlineHeight
  34959. ),
  34960. parseInt(faterParam.odlineCount)
  34961. );
  34962. return results;
  34963. }, false),
  34964. material: odLineMaterial,
  34965. width: faterParam.lineWidth,
  34966. clampToGround: false
  34967. }
  34968. });
  34969. this._drawEntity = this._entities.add(entity);
  34970. },
  34971. _updateOdline: function(isLast, isEdit) {
  34972. if (isLast !== void 0 && isLast === true) {
  34973. if (isEdit !== void 0 && isEdit === true) {
  34974. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  34975. this._setEntityIsEdit(this._drawEntity);
  34976. this._drawEntity.parent.setIsEdit(true);
  34977. }
  34978. } else {
  34979. let params = this._drawEntity.parent.getParams();
  34980. let center2 = this._sketchTempPoints[0];
  34981. let endPoint = this._sketchTempPoints[this._sketchTempPoints.length - 1];
  34982. let results = this._calculateOdlinePositios(
  34983. center2,
  34984. endPoint,
  34985. parseInt(params.odlineHeight),
  34986. parseInt(params.odlineCount)
  34987. );
  34988. this._drawEntity.polyline.positions = results;
  34989. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  34990. this._odlineEntitys.push(this._drawEntity);
  34991. if (isEdit !== void 0 && isEdit === true) {
  34992. this._drawEntity.setIsEdit(true);
  34993. }
  34994. }
  34995. },
  34996. _guid() {
  34997. function S4() {
  34998. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  34999. }
  35000. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  35001. },
  35002. _console(...rest) {
  35003. console.log("===>>>", rest);
  35004. }
  35005. });
  35006. Object.assign(DrawTools.prototype, {
  35007. _drawMovingDoubleTooltip(position2) {
  35008. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236,\u53F3\u952E\u5355\u51FB\u64A4\u9500<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  35009. },
  35010. _drawMovingSimpleTooltip(position2) {
  35011. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  35012. },
  35013. _removeLastDrawPointEntity() {
  35014. let lastPointEntity = this._pointEntitys.last();
  35015. if (lastPointEntity !== void 0) {
  35016. this._removeEntityByObject(lastPointEntity);
  35017. this._pointEntitys.pop();
  35018. }
  35019. },
  35020. _sketchDrawPoint(handler, options2) {
  35021. let _self = this;
  35022. this._registerLeftClickEvent(handler, function(event2) {
  35023. let scene = _self._viewer.scene;
  35024. if (scene.mode !== Cesium.SceneMode.MORPHING) {
  35025. var pickedObject = scene.pick(event2.position);
  35026. if (scene.pickPositionSupported && Cesium.defined(pickedObject)) {
  35027. var cartesian = scene.pickPosition(event2.position);
  35028. if (Cesium.defined(cartesian)) {
  35029. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  35030. var lng = Cesium.Math.toDegrees(cartographic.longitude);
  35031. var lat = Cesium.Math.toDegrees(cartographic.latitude);
  35032. var height2 = cartographic.height;
  35033. _self._sketchOutputPoints.push({
  35034. lng,
  35035. lat,
  35036. height: height2
  35037. });
  35038. }
  35039. _self._createPoint(cartesian, "\u70B9");
  35040. _self._sketchPoints.push(cartesian.clone());
  35041. if (_self._sketchPoints.length >= 2) {
  35042. _self._createVideoWall();
  35043. _self._clearEvent(handler);
  35044. }
  35045. }
  35046. }
  35047. if (options2.onComplete)
  35048. options2.onComplete(loc.sLocation, loc.gLocation);
  35049. });
  35050. },
  35051. _sketchDrawMultiplePoint(handler, options2) {
  35052. let _self = this;
  35053. this._registerLeftClickEvent(handler, function(event2) {
  35054. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35055. if (!Cesium.defined(loc2.sLocation))
  35056. return;
  35057. if (_self._isDrawPoint) {
  35058. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35059. }
  35060. _self._sketchPoints.push(loc2.sLocation);
  35061. _self._sketchOutputPoints.push(loc2.gLocation);
  35062. if (options2.onAdded)
  35063. options2.onAdded(loc2.sLocation, loc2.gLocation);
  35064. });
  35065. this._registerRightClickEvent(handler, function(event2) {
  35066. if (_self._sketchPoints.length > 0) {
  35067. _self._sketchPoints.pop();
  35068. _self._sketchOutputPoints.pop();
  35069. if (options2.onUndo)
  35070. options2.onUndo();
  35071. }
  35072. });
  35073. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35074. _self._clearEvent(handler);
  35075. if (options2.onComplete)
  35076. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35077. });
  35078. },
  35079. _sketchDrawPolyline(handler, options2) {
  35080. let _self = this;
  35081. this._registerLeftClickEvent(handler, function(event2) {
  35082. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35083. if (!Cesium.defined(loc2.sLocation))
  35084. return;
  35085. if (_self._isDrawPoint) {
  35086. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35087. }
  35088. if (_self._sketchTempPoints.length === 0) {
  35089. _self._createPolyline(options2.polylineType);
  35090. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35091. }
  35092. _self._sketchTempPoints.push(loc2.sLocation);
  35093. _self._sketchPoints.push(loc2.sLocation.clone());
  35094. _self._sketchOutputPoints.push(loc2.gLocation);
  35095. if (options2.onAdded)
  35096. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35097. _self._createOperationDom();
  35098. });
  35099. this._registerMouseMoveEvent(handler, function(event2) {
  35100. if (_self._isRuntimeApp())
  35101. return;
  35102. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35103. if (!Cesium.defined(loc2.sLocation))
  35104. return;
  35105. if (_self._sketchTempPoints.length > 1) {
  35106. _self._drawMovingDoubleTooltip(event2.endPosition);
  35107. _self._sketchTempPoints.pop();
  35108. _self._sketchTempPoints.push(loc2.sLocation);
  35109. if (options2.onMoving)
  35110. options2.onMoving(loc2.sLocation);
  35111. }
  35112. });
  35113. this._registerRightClickEvent(handler, function(event2) {
  35114. if (_self._sketchTempPoints.length > 2) {
  35115. _self._drawByUndo();
  35116. if (options2.onUndo)
  35117. options2.onUndo();
  35118. }
  35119. });
  35120. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35121. if (_self._sketchPoints.length < 2) {
  35122. if (options2.onError)
  35123. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35124. return;
  35125. }
  35126. _self._updatePolyline(options2.isEdit);
  35127. if (!_self._isRetainDrawPoint)
  35128. _self._removePointEntitys();
  35129. _self._clearEvent(handler);
  35130. if (options2.onComplete)
  35131. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35132. });
  35133. },
  35134. _sketchDrawSpatialPolyline(handler, options2) {
  35135. let _self = this;
  35136. this._registerLeftClickEvent(handler, function(event2) {
  35137. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35138. if (!Cesium.defined(loc2.sLocation))
  35139. return;
  35140. if (_self._isDrawPoint) {
  35141. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35142. }
  35143. if (_self._sketchTempPoints.length === 0) {
  35144. _self._createSpatialPolyline();
  35145. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35146. }
  35147. _self._sketchTempPoints.push(loc2.sLocation);
  35148. _self._sketchPoints.push(loc2.sLocation.clone());
  35149. _self._sketchOutputPoints.push(loc2.gLocation);
  35150. if (options2.onAdded)
  35151. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35152. _self._createOperationDom();
  35153. });
  35154. this._registerMouseMoveEvent(handler, function(event2) {
  35155. if (_self._isRuntimeApp())
  35156. return;
  35157. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35158. if (!Cesium.defined(loc2.sLocation))
  35159. return;
  35160. if (_self._sketchTempPoints.length > 1) {
  35161. _self._drawMovingDoubleTooltip(event2.endPosition);
  35162. _self._sketchTempPoints.pop();
  35163. _self._sketchTempPoints.push(loc2.sLocation);
  35164. if (options2.onMoving)
  35165. options2.onMoving(loc2.sLocation);
  35166. }
  35167. });
  35168. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35169. if (_self._sketchPoints.length < 2) {
  35170. if (options2.onError)
  35171. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35172. return;
  35173. }
  35174. _self._updateSpatialPolyline(options2.isEdit);
  35175. _self._removePointEntitys();
  35176. _self._clearEvent(handler);
  35177. if (options2.onComplete)
  35178. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35179. });
  35180. this._registerRightClickEvent(handler, function(event2) {
  35181. if (_self._sketchTempPoints.length > 2) {
  35182. _self._drawByUndo();
  35183. if (options2.onUndo)
  35184. options2.onUndo();
  35185. }
  35186. });
  35187. },
  35188. _sketchDrawOdline(handler, options2) {
  35189. let _self = this;
  35190. this._registerLeftClickEvent(handler, function(event2) {
  35191. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35192. if (!Cesium.defined(loc2.sLocation))
  35193. return;
  35194. if (_self._isDrawPoint) {
  35195. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35196. }
  35197. if (_self._isRuntimeApp()) {
  35198. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED8\u5236\u4E00\u6761OD\u7EBF\uFF01");
  35199. }
  35200. if (_self._sketchTempPoints.length === 0) {
  35201. _self._createOdline(true);
  35202. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35203. } else {
  35204. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35205. _self._updateOdline(false, options2.isEdit);
  35206. _self._createOdline();
  35207. }
  35208. _self._sketchTempPoints.push(loc2.sLocation);
  35209. _self._sketchPoints.push(loc2.sLocation.clone());
  35210. _self._sketchOutputPoints.push(loc2.gLocation);
  35211. if (options2.onAdded)
  35212. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35213. _self._createOperationDom();
  35214. });
  35215. this._registerMouseMoveEvent(handler, function(event2) {
  35216. if (_self._isRuntimeApp())
  35217. return;
  35218. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35219. if (!Cesium.defined(loc2.sLocation))
  35220. return;
  35221. if (_self._sketchTempPoints.length > 1) {
  35222. _self._drawMovingDoubleTooltip(event2.endPosition);
  35223. _self._sketchTempPoints.pop();
  35224. _self._sketchTempPoints.push(loc2.sLocation);
  35225. if (options2.onMoving)
  35226. options2.onMoving(loc2.sLocation);
  35227. }
  35228. });
  35229. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35230. _self._removeEntityByObject(_self._drawEntity);
  35231. _self._updateOdline(true, options2.isEdit);
  35232. _self._removePointEntitys();
  35233. _self._clearEvent(handler);
  35234. if (options2.onComplete)
  35235. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35236. });
  35237. this._registerRightClickEvent(handler, function(event2) {
  35238. if (_self._odlineEntitys.length > 0) {
  35239. if (_self._isDrawPoint) {
  35240. _self._removeLastDrawPointEntity();
  35241. }
  35242. _self._removeEntityByObject(_self._odlineEntitys.last());
  35243. _self._odlineEntitys.pop();
  35244. if (options2.onUndo)
  35245. options2.onUndo();
  35246. }
  35247. });
  35248. },
  35249. _sketchDrawPolygon(handler, options2) {
  35250. let _self = this;
  35251. this._registerLeftClickEvent(handler, function(event2) {
  35252. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35253. if (!Cesium.defined(loc2.sLocation))
  35254. return;
  35255. if (_self._isDrawPoint) {
  35256. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35257. }
  35258. if (_self._sketchTempPoints.length === 0) {
  35259. _self._createPolygon(options2.polygonType);
  35260. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35261. }
  35262. _self._sketchTempPoints.push(loc2.sLocation);
  35263. _self._sketchPoints.push(loc2.sLocation.clone());
  35264. _self._sketchOutputPoints.push(loc2.gLocation);
  35265. if (options2.onAdded)
  35266. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35267. _self._createOperationDom();
  35268. });
  35269. this._registerMouseMoveEvent(handler, function(event2) {
  35270. if (_self._isRuntimeApp())
  35271. return;
  35272. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35273. if (!Cesium.defined(loc2.sLocation))
  35274. return;
  35275. if (_self._sketchTempPoints.length > 1) {
  35276. _self._drawMovingDoubleTooltip(event2.endPosition);
  35277. _self._sketchTempPoints.pop();
  35278. _self._sketchTempPoints.push(loc2.sLocation);
  35279. if (options2.onMoving)
  35280. options2.onMoving(loc2.sLocation);
  35281. }
  35282. });
  35283. this._registerRightClickEvent(handler, function(event2) {
  35284. if (_self._sketchTempPoints.length > 2) {
  35285. _self._drawByUndo();
  35286. if (options2.onUndo)
  35287. options2.onUndo();
  35288. }
  35289. });
  35290. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35291. if (_self._sketchPoints.length < 3) {
  35292. if (options2.onError)
  35293. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35294. return;
  35295. }
  35296. _self._updatePolygon(options2.isEdit);
  35297. if (!_self._isRetainDrawPoint)
  35298. _self._removePointEntitys();
  35299. _self._clearEvent(handler);
  35300. if (options2.onComplete)
  35301. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35302. });
  35303. },
  35304. _sketchDrawCircle: function(handler, options2) {
  35305. let _self = this;
  35306. this._registerLeftClickEvent(handler, function(event2) {
  35307. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35308. if (!Cesium.defined(loc2.sLocation))
  35309. return;
  35310. if (_self._sketchTempPoints.length === 0) {
  35311. if (_self._isDrawPoint) {
  35312. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35313. }
  35314. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35315. _self._sketchTempPoints.push(loc2.sLocation);
  35316. _self._sketchPoints.push(loc2.sLocation.clone());
  35317. _self._sketchOutputPoints.push(loc2.gLocation);
  35318. _self._createCircle(loc2.sLocation, options2.circleType);
  35319. if (_self._isRuntimeApp()) {
  35320. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35321. }
  35322. if (options2.onAdded)
  35323. options2.onAdded(loc2.sLocation);
  35324. } else {
  35325. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35326. _self._removePointEntitys();
  35327. _self._updateCircle(options2.isEdit);
  35328. _self._clearEvent(handler);
  35329. if (options2.onComplete)
  35330. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  35331. }
  35332. });
  35333. this._registerMouseMoveEvent(handler, function(event2) {
  35334. if (_self._isRuntimeApp()) {
  35335. return;
  35336. }
  35337. if (_self._sketchTempPoints.length <= 0)
  35338. return;
  35339. _self._drawMovingSimpleTooltip(event2.endPosition);
  35340. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  35341. if (cartesian == void 0)
  35342. return;
  35343. _self._sketchTempPoints.pop();
  35344. _self._sketchTempPoints.push(cartesian);
  35345. });
  35346. },
  35347. _sketchDrawRectangle: function(handler, options2) {
  35348. let _self = this;
  35349. this._registerLeftClickEvent(handler, function(event2) {
  35350. if (_self._sketchTempPoints.length === 0) {
  35351. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35352. if (!Cesium.defined(loc2.sLocation))
  35353. return;
  35354. if (_self._isDrawPoint) {
  35355. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35356. }
  35357. _self._sketchTempPoints.push(loc2.sLocation);
  35358. _self._sketchTempPoints.push(loc2.sLocation);
  35359. _self._sketchPoints.push(loc2.gLocation);
  35360. _self._createRectangle();
  35361. if (options2.onAdded)
  35362. options2.onAdded(loc2.sLocation);
  35363. if (_self._isRuntimeApp()) {
  35364. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35365. }
  35366. } else {
  35367. _self._removePointEntitys();
  35368. _self._removeEntityByObject(_self._sketchTempRectangle);
  35369. _self._updateRectangle(options2.isEdit);
  35370. _self._clearEvent(handler);
  35371. if (options2.onComplete)
  35372. options2.onComplete(_self._sketchOutputPoints);
  35373. }
  35374. });
  35375. this._registerMouseMoveEvent(handler, function(event2) {
  35376. if (_self._sketchTempPoints.length < 1)
  35377. return;
  35378. _self._drawMovingSimpleTooltip(event2.endPosition);
  35379. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35380. if (!Cesium.defined(loc2.sLocation))
  35381. return;
  35382. _self._sketchTempPoints.pop();
  35383. _self._sketchTempPoints.push(loc2.sLocation);
  35384. });
  35385. },
  35386. _sketchDrawWall: function(handler, options2) {
  35387. let _self = this;
  35388. this._registerLeftClickEvent(handler, function(event2) {
  35389. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35390. if (!Cesium.defined(loc2.sLocation))
  35391. return;
  35392. if (_self._isDrawPoint) {
  35393. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35394. }
  35395. if (_self._sketchTempPoints.length === 0) {
  35396. _self._createWall(options2.wallType);
  35397. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35398. _self._sketchWallHeights.push(loc2.gLocation.height);
  35399. }
  35400. _self._sketchTempPoints.push(loc2.sLocation);
  35401. _self._sketchWallHeights.push(loc2.gLocation.height);
  35402. _self._sketchPoints.push(loc2.sLocation.clone());
  35403. _self._createOperationDom();
  35404. });
  35405. this._registerMouseMoveEvent(handler, function(event2) {
  35406. if (_self._isRuntimeApp()) {
  35407. return;
  35408. }
  35409. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35410. if (!Cesium.defined(loc2.sLocation))
  35411. return;
  35412. if (_self._sketchTempPoints.length > 1) {
  35413. _self._drawMovingDoubleTooltip(event2.endPosition);
  35414. _self._sketchTempPoints.pop();
  35415. _self._sketchTempPoints.push(loc2.sLocation);
  35416. _self._sketchWallHeights.pop();
  35417. _self._sketchWallHeights.push(loc2.gLocation.height);
  35418. }
  35419. });
  35420. this._registerRightClickEvent(handler, function(event2) {
  35421. if (_self._sketchTempPoints.length > 2) {
  35422. _self._sketchPoints.pop();
  35423. if (_self._isRuntimeApp()) {
  35424. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 1, 1);
  35425. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 1, 1);
  35426. } else {
  35427. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  35428. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 2, 1);
  35429. }
  35430. if (_self._isDrawPoint) {
  35431. _self._removeLastDrawPointEntity();
  35432. }
  35433. }
  35434. });
  35435. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35436. if (_self._sketchPoints.length < 2) {
  35437. if (options2.onError)
  35438. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35439. return;
  35440. }
  35441. _self._updateWall(options2.isEdit);
  35442. if (!_self._isRetainDrawPoint)
  35443. _self._removePointEntitys();
  35444. _self._clearEvent(handler);
  35445. });
  35446. },
  35447. _sketchDrawVideoWall: function(handler, options2) {
  35448. let _self = this;
  35449. this._registerLeftClickEvent(handler, function(event2) {
  35450. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35451. if (!Cesium.defined(loc2.sLocation))
  35452. return;
  35453. if (_self._isDrawPoint) {
  35454. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35455. }
  35456. if (_self._sketchOutputPoints.length === 0) {
  35457. _self._sketchOutputPoints.push(loc2.gLocation);
  35458. _self._sketchOutputPoints.push(loc2.gLocation);
  35459. _self._createVideoWall();
  35460. if (_self._isRuntimeApp()) {
  35461. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  35462. }
  35463. } else {
  35464. _self._updateVideoWall(options2.isEdit);
  35465. _self._clearEvent(handler);
  35466. }
  35467. });
  35468. this._registerMouseMoveEvent(handler, function(event2) {
  35469. if (_self._isRuntimeApp())
  35470. return;
  35471. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35472. if (!Cesium.defined(loc2.sLocation))
  35473. return;
  35474. if (_self._sketchOutputPoints.length > 1) {
  35475. _self._drawMovingSimpleTooltip(event2.endPosition);
  35476. _self._sketchOutputPoints.pop();
  35477. _self._sketchOutputPoints.push(loc2.gLocation);
  35478. }
  35479. });
  35480. },
  35481. _drawByUndo: function() {
  35482. this._sketchPoints.pop();
  35483. if (this._isRuntimeApp()) {
  35484. this._sketchTempPoints.splice(this._sketchTempPoints.length - 1, 1);
  35485. } else {
  35486. this._sketchTempPoints.splice(this._sketchTempPoints.length - 2, 1);
  35487. }
  35488. if (this._isDrawPoint) {
  35489. this._removeLastDrawPointEntity();
  35490. }
  35491. },
  35492. draw: function(type2, options2) {
  35493. let _self = this;
  35494. this._clear();
  35495. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35496. if (this._isRuntimeApp()) {
  35497. this._showTooltipMessage("\u5355\u51FB\u7ED8\u5236");
  35498. } else {
  35499. this._beginTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236", void 0);
  35500. }
  35501. this._drawType = type2;
  35502. switch (type2) {
  35503. case DrawTools.DrawType.Point:
  35504. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  35505. break;
  35506. case DrawTools.DrawType.Polyline:
  35507. options2.polylineType = DrawTools.PolylineType.NormalPolyline;
  35508. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35509. break;
  35510. case DrawTools.DrawType.ArrowPolyline:
  35511. options2.polylineType = DrawTools.PolylineType.ArrowsPolyline;
  35512. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35513. break;
  35514. case DrawTools.DrawType.DynamicPolyline:
  35515. options2.polylineType = DrawTools.PolylineType.DynamicPolyline;
  35516. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35517. break;
  35518. case DrawTools.DrawType.GrowPolyline:
  35519. options2.polylineType = DrawTools.PolylineType.GrowPolyline;
  35520. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35521. break;
  35522. case DrawTools.DrawType.OutlinePolyline:
  35523. options2.polylineType = DrawTools.PolylineType.OutlinePolyline;
  35524. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35525. break;
  35526. case DrawTools.DrawType.Polygon:
  35527. options2.polygonType = DrawTools.PolygonType.NormalPolygon;
  35528. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35529. break;
  35530. case DrawTools.DrawType.SpatialLine:
  35531. _self._sketchDrawSpatialPolyline(_self._drawEventHandler, options2);
  35532. break;
  35533. case DrawTools.DrawType.Circle:
  35534. options2.circleType = DrawTools.CircleType.ColorCircle;
  35535. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35536. break;
  35537. case DrawTools.DrawType.Rectangle:
  35538. _self._sketchDrawRectangle(_self._drawEventHandler, options2);
  35539. break;
  35540. case DrawTools.DrawType.NormalWall:
  35541. options2.wallType = DrawTools.WallType.ColorWall;
  35542. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35543. break;
  35544. case DrawTools.DrawType.DynamicWall:
  35545. options2.wallType = DrawTools.WallType.DynamicWall;
  35546. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35547. break;
  35548. case DrawTools.DrawType.TextWall:
  35549. options2.wallType = DrawTools.WallType.TextWall;
  35550. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35551. break;
  35552. case DrawTools.DrawType.DynamicCircle:
  35553. options2.circleType = DrawTools.CircleType.DynamicCircle;
  35554. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35555. break;
  35556. case DrawTools.DrawType.House:
  35557. options2.polygonType = DrawTools.PolygonType.HousePolygon;
  35558. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35559. break;
  35560. case DrawTools.DrawType.VideoWall:
  35561. _self._sketchDrawVideoWall(_self._drawEventHandler, options2);
  35562. break;
  35563. case DrawTools.DrawType.OdLine:
  35564. _self._sketchDrawOdline(_self._drawEventHandler, options2);
  35565. break;
  35566. }
  35567. },
  35568. Clear: function() {
  35569. this._clear(true);
  35570. this._unActivateEdit();
  35571. this._closePropertyEditDialog();
  35572. this._removeOperationDom();
  35573. },
  35574. sketchInit: function() {
  35575. this._clear(false);
  35576. },
  35577. _checkAppOrWeb() {
  35578. if (window.navigator.userAgent.match(
  35579. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  35580. )) {
  35581. return DrawTools.RuntimeEnvironment.App;
  35582. } else {
  35583. return DrawTools.RuntimeEnvironment.Web;
  35584. }
  35585. },
  35586. _isRuntimeApp() {
  35587. if (this._checkAppOrWeb() === DrawTools.RuntimeEnvironment.App) {
  35588. return true;
  35589. }
  35590. return false;
  35591. }
  35592. });
  35593. Object.assign(DrawTools.prototype, {
  35594. _tooltipInit: function(text, mousePosition) {
  35595. let _self = this;
  35596. this._tooltipId = "tooltipSketchmodel";
  35597. let tooltipObj = document.getElementById(this._tooltipId);
  35598. if (tooltipObj === null) {
  35599. tooltipObj = document.createElement("div");
  35600. tooltipObj.id = this._tooltipId;
  35601. document.body.appendChild(tooltipObj);
  35602. let divStyle = "";
  35603. divStyle += "top: 30px;";
  35604. divStyle += "left: 30px;";
  35605. divStyle += "position: absolute;";
  35606. divStyle += "display: flex;";
  35607. divStyle += "align-items: center;";
  35608. divStyle += "width: 12x0px;";
  35609. divStyle += "height: auto;";
  35610. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  35611. divStyle += "border-radius: 5px;";
  35612. divStyle += "color: rgb(255, 255, 255);";
  35613. divStyle += "font-size: 12px;";
  35614. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  35615. divStyle += "padding: 8px;";
  35616. divStyle += "border:solid 1px rgb(255,0,0);";
  35617. tooltipObj.setAttribute("style", divStyle);
  35618. }
  35619. if (text != void 0)
  35620. tooltipObj.innerHTML = text;
  35621. if (mousePosition === void 0) {
  35622. document.onmousemove = function(event2) {
  35623. if (event2.clientX < 100 || event2.clientX > _self._canvasWidth - 100 || event2.clientY < 100 || event2.clientY > _self._canvasHeight - 100) {
  35624. tooltipObj.style.display = "none";
  35625. } else {
  35626. tooltipObj.style.display = "flex";
  35627. tooltipObj.style.left = event2.clientX + 10 + "px";
  35628. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  35629. }
  35630. };
  35631. } else {
  35632. if (mousePosition.x < 100 || mousePosition.x > _self._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > _self._canvasHeight - 100) {
  35633. tooltipObj.style.display = "none";
  35634. } else {
  35635. tooltipObj.style.display = "flex";
  35636. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35637. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35638. }
  35639. }
  35640. },
  35641. _tooltipRemove: function() {
  35642. let tooltipObj = document.getElementById(this._tooltipId);
  35643. if (tooltipObj != null) {
  35644. document.body.removeChild(tooltipObj);
  35645. }
  35646. },
  35647. _tooltipSetText: function(text, mousePosition) {
  35648. let tooltipObj = document.getElementById(this._tooltipId);
  35649. if (tooltipObj != null) {
  35650. if (text != void 0)
  35651. tooltipObj.innerHTML = text;
  35652. if (mousePosition != void 0) {
  35653. if (mousePosition.x < 100 || mousePosition.x > this._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > this._canvasHeight - 100) {
  35654. tooltipObj.style.display = "none";
  35655. } else {
  35656. tooltipObj.style.display = "flex";
  35657. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35658. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35659. }
  35660. }
  35661. }
  35662. },
  35663. _setMousePointerStyle: function() {
  35664. document.querySelector("body").style.cursor = "crosshair";
  35665. },
  35666. _setMouseDefaultStyle: function() {
  35667. document.querySelector("body").style.cursor = "default";
  35668. },
  35669. _beginTooltip(text, position2) {
  35670. this._tooltipInit(text, position2);
  35671. this._setMousePointerStyle();
  35672. },
  35673. _updateTooltip(text, position2) {
  35674. this._tooltipSetText(text, position2);
  35675. },
  35676. _endTooltip() {
  35677. this._tooltipRemove();
  35678. this._setMouseDefaultStyle();
  35679. },
  35680. _showTooltipMessage: function(message) {
  35681. let msgMainDom = document.getElementById("messageMainDom");
  35682. if (msgMainDom !== null && msgMainDom !== void 0) {
  35683. document.body.removeChild(msgMainDom);
  35684. }
  35685. msgMainDom = document.createElement("div");
  35686. msgMainDom.style.width = "30%";
  35687. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  35688. msgMainDom.style.height = "45px";
  35689. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  35690. msgMainDom.style.borderRadius = "8px";
  35691. msgMainDom.style.display = "flex";
  35692. msgMainDom.style.alignItems = "center";
  35693. msgMainDom.style.paddingLeft = "10px";
  35694. msgMainDom.style.color = "rgb(91, 188, 48)";
  35695. msgMainDom.style.fontSize = "14px";
  35696. msgMainDom.style.fontWeight = "600";
  35697. msgMainDom.style.position = "absolute";
  35698. msgMainDom.style.left = "35%";
  35699. msgMainDom.style.transition = "transform 1s";
  35700. msgMainDom.style.transform = "translateY(-90px)";
  35701. msgMainDom.style.top = "0px";
  35702. msgMainDom.style.zIndex = 1e3;
  35703. document.body.appendChild(msgMainDom);
  35704. let strHtml = "";
  35705. strHtml += "<div style='";
  35706. strHtml += "background-color: rgb(88, 185, 45);";
  35707. strHtml += "color: rgb(255, 255, 255);";
  35708. strHtml += "height: 24px;";
  35709. strHtml += "width: 24px;";
  35710. strHtml += "border-radius: 20px;";
  35711. strHtml += "display: flex;";
  35712. strHtml += "justify-content: center;";
  35713. strHtml += "align-items: center;";
  35714. strHtml += "font-size: 14px;";
  35715. strHtml += "margin-right: 18px;";
  35716. strHtml += "'>&#10003</div>";
  35717. strHtml += "<div>" + message + "</div>";
  35718. msgMainDom.innerHTML = strHtml;
  35719. msgMainDom.addEventListener("transitionend", function() {
  35720. setTimeout(function() {
  35721. document.body.removeChild(msgMainDom);
  35722. }, 1e3);
  35723. }, false);
  35724. setTimeout(function() {
  35725. msgMainDom.style.transform = "translateY(50px)";
  35726. }, 100);
  35727. }
  35728. });
  35729. Object.assign(DrawTools.prototype, {
  35730. _createSingleCoordinateAxisArrow(positions, color2, axisEntityId) {
  35731. let _self = this;
  35732. let coordinateAxisEntity = new Cesium.Entity({
  35733. id: axisEntityId,
  35734. name: _self._coordinateAxisEntityName,
  35735. position: positions[0],
  35736. polyline: {
  35737. positions,
  35738. width: 10,
  35739. material: _self._materialPolylineArrowProperty({
  35740. color: color2
  35741. })
  35742. }
  35743. });
  35744. coordinateAxisEntity.setEditType({
  35745. type: DrawTools.EditPointType.CoordinateAxis
  35746. });
  35747. return this._entities.add(coordinateAxisEntity);
  35748. },
  35749. _getTranslatePostion: function(originPosition, translateCartesian) {
  35750. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(originPosition);
  35751. let m = new Cesium.Matrix4();
  35752. Cesium.Matrix4.setTranslation(
  35753. Cesium.Matrix4.IDENTITY,
  35754. translateCartesian,
  35755. m
  35756. );
  35757. let modelMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  35758. let outPosition = new Cesium.Cartesian3(0, 0, 0);
  35759. Cesium.Matrix4.getTranslation(modelMatrix, outPosition);
  35760. return outPosition;
  35761. },
  35762. _createCoordinateAxis: function(position2) {
  35763. this._showTooltipMessage("\u5355\u51FB\u53F3\u952E\u79FB\u9664\u8C03\u6574\u8F74\u7EBF\uFF01");
  35764. this._removeCoorinateAxis();
  35765. let _self = this;
  35766. let cameraRight = this._viewer.scene.camera.rightWC;
  35767. this._tx = cameraRight.x > 0 ? 150 : -150;
  35768. this._ty = cameraRight.y > 0 ? 150 : -150;
  35769. this._tz = 150;
  35770. this._coordinateAxisEntityId_x = "coordinateAxisId_x";
  35771. this._coordinateAxisEntityId_y = "coordinateAxisId_y";
  35772. this._coordinateAxisEntityId_z = "coordinateAxisId_z";
  35773. this._coordinateAxisEntityName = "coordinateAxisEntity";
  35774. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35775. let endPosition = this._getTranslatePostion(position2, translateCartesian);
  35776. const xPos = [position2, endPosition];
  35777. this._coordinateEntity_x = this._createSingleCoordinateAxisArrow(xPos, "rgba(0,255,0,1.0)", this._coordinateAxisEntityId_x);
  35778. this._coordinateAxisBindEntity(this._coordinateEntity_x);
  35779. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35780. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35781. const yPos = [position2, endPosition];
  35782. this._coordinateEntity_y = this._createSingleCoordinateAxisArrow(yPos, "rgba(0,0,255,1.0)", this._coordinateAxisEntityId_y);
  35783. this._coordinateAxisBindEntity(this._coordinateEntity_y);
  35784. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35785. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35786. const zPos = [position2, endPosition];
  35787. this._coordinateEntity_z = this._createSingleCoordinateAxisArrow(zPos, "rgba(255,0,0,1.0)", this._coordinateAxisEntityId_z);
  35788. this._coordinateAxisBindEntity(this._coordinateEntity_z);
  35789. this._eventCoorinateAxis = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35790. this._registerLeftDownEvent(this._eventCoorinateAxis, function(event2) {
  35791. _self._coorinateAxisMouseDown(event2);
  35792. });
  35793. this._registerMouseMoveEvent(this._eventCoorinateAxis, function(event2) {
  35794. _self._coorinateAxisMouseMove(event2);
  35795. });
  35796. this._registerLeftUpEvent(this._eventCoorinateAxis, function(event2) {
  35797. _self._coorinateAxisMouseUp(event2);
  35798. });
  35799. this._registerRightClickEvent(this._eventCoorinateAxis, function(event2) {
  35800. _self._removeCoorinateAxis();
  35801. });
  35802. },
  35803. _coordinateAxisBindEntity: function(axisEntity) {
  35804. if (this._editEntity === void 0)
  35805. return;
  35806. let editEntityType = this._editEntity.getEntityType();
  35807. if (editEntityType === void 0)
  35808. return;
  35809. if (editEntityType === DrawTools.DrawType.VideoWall) {
  35810. axisEntity.bindEntity(this._editEntity);
  35811. }
  35812. },
  35813. _coorinateAxisMouseDown: function(event2) {
  35814. let _self = this;
  35815. let feature2 = this._viewer.scene.pick(event2.position);
  35816. if (feature2 === void 0)
  35817. return;
  35818. if (feature2.id != void 0 && feature2.id instanceof Cesium.Entity) {
  35819. this._viewer.scene.screenSpaceCameraController.enableRotate = false;
  35820. if (feature2.id.getEditType() === void 0)
  35821. return;
  35822. let entityType = feature2.id.getEditType().type;
  35823. if (entityType !== DrawTools.EditPointType.CoordinateAxis)
  35824. return;
  35825. this._editCoorinateAxis = feature2.id;
  35826. this._editCoorinateAxis.polyline.width = 15;
  35827. this._coordinateAxisMoveStartPosition = this._viewer.scene.camera.pickEllipsoid(
  35828. event2.position,
  35829. this._viewer.scene.globe.ellipsoid
  35830. );
  35831. this._coordinateAxisMoveStartScreen = event2.position;
  35832. this._coorinateAxisPosition = this._editCoorinateAxis.position._value;
  35833. this._coordinateEntity_x.polyline.positions = new Cesium.CallbackProperty(function() {
  35834. let translateCartesian = new Cesium.Cartesian3(_self._tx, 0, 0);
  35835. let endPosition = _self._getTranslatePostion(
  35836. _self._coorinateAxisPosition,
  35837. translateCartesian
  35838. );
  35839. return [_self._coorinateAxisPosition, endPosition];
  35840. }, false);
  35841. this._coordinateEntity_y.polyline.positions = new Cesium.CallbackProperty(function() {
  35842. let translateCartesian = new Cesium.Cartesian3(0, _self._ty, 0);
  35843. let endPosition = _self._getTranslatePostion(
  35844. _self._coorinateAxisPosition,
  35845. translateCartesian
  35846. );
  35847. return [_self._coorinateAxisPosition, endPosition];
  35848. }, false);
  35849. this._coordinateEntity_z.polyline.positions = new Cesium.CallbackProperty(function() {
  35850. let translateCartesian = new Cesium.Cartesian3(0, 0, _self._tz);
  35851. let endPosition = _self._getTranslatePostion(
  35852. _self._coorinateAxisPosition,
  35853. translateCartesian
  35854. );
  35855. return [_self._coorinateAxisPosition, endPosition];
  35856. }, false);
  35857. this._coordinateAxisActivateEditEntity(this._editCoorinateAxis);
  35858. }
  35859. },
  35860. _coorinateAxisMouseMove: function(event2) {
  35861. if (!Cesium.defined(this._editCoorinateAxis))
  35862. return;
  35863. let position2 = this._viewer.scene.camera.pickEllipsoid(
  35864. event2.endPosition,
  35865. this._viewer.scene.globe.ellipsoid
  35866. );
  35867. if (!position2)
  35868. return;
  35869. let strGeo = this._cartesian3ToGeo(this._coordinateAxisMoveStartPosition);
  35870. let endGeo = this._cartesian3ToGeo(position2);
  35871. let entityId = this._editCoorinateAxis.id;
  35872. let entityPosition = this._editCoorinateAxis.position._value;
  35873. let entityGeo = this._cartesian3ToGeo(entityPosition);
  35874. let heightDifference = 0;
  35875. if (entityId === this._coordinateAxisEntityId_x) {
  35876. let difference = strGeo.longitude - endGeo.longitude;
  35877. entityGeo.longitude = entityGeo.longitude - difference;
  35878. } else if (entityId === this._coordinateAxisEntityId_y) {
  35879. let difference = strGeo.latitude - endGeo.latitude;
  35880. entityGeo.latitude = entityGeo.latitude - difference;
  35881. } else if (entityId === this._coordinateAxisEntityId_z) {
  35882. heightDifference = event2.endPosition.y - this._coordinateAxisMoveStartScreen.y;
  35883. heightDifference = heightDifference * 0.5;
  35884. entityGeo.height = entityGeo.height - heightDifference;
  35885. }
  35886. this._coorinateAxisPosition = Cesium.Cartesian3.fromDegrees(entityGeo.longitude, entityGeo.latitude, entityGeo.height);
  35887. this._moveEditEntityByCoordinateAxis(entityPosition, this._coorinateAxisPosition, heightDifference);
  35888. },
  35889. _coorinateAxisMouseUp: function(event2) {
  35890. this._viewer.scene.screenSpaceCameraController.enableRotate = true;
  35891. if (this._editCoorinateAxis !== void 0) {
  35892. this._editCoorinateAxis.polyline.width = 10;
  35893. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35894. let endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35895. this._coordinateEntity_x.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35896. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35897. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35898. this._coordinateEntity_y.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35899. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35900. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35901. this._coordinateEntity_z.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35902. this._coordinateEntity_x.position = this._coorinateAxisPosition;
  35903. this._coordinateEntity_y.position = this._coorinateAxisPosition;
  35904. this._coordinateEntity_z.position = this._coorinateAxisPosition;
  35905. this._coordinateAxisUpdateEditEntity(this._editCoorinateAxis);
  35906. this._editCoorinateAxis = void 0;
  35907. }
  35908. },
  35909. _moveEditEntityByCoordinateAxis: function(strPosition, endPosition, heightDifference) {
  35910. let movePosition = Cesium.Cartesian3.subtract(endPosition, strPosition, new Cesium.Cartesian3());
  35911. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35912. let moveResult = Cesium.Cartesian3.add(this._moveInitPositions[i2], movePosition, new Cesium.Cartesian3());
  35913. this._moveUpdatePositions[i2] = moveResult.clone();
  35914. }
  35915. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35916. this._moveUpdateHeights[i2] = parseFloat(this._moveInitHeights[i2]) + heightDifference * -1;
  35917. }
  35918. },
  35919. _coordinateAxisActivateEditEntity: function(moveAxisEntity) {
  35920. let _self = this;
  35921. let bindEntity = moveAxisEntity.getBindEntity();
  35922. if (bindEntity === void 0)
  35923. return;
  35924. let bindEntityType = bindEntity.getEntityType();
  35925. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  35926. let wall = bindEntity.wall;
  35927. this._moveInitPositions = wall.positions._value;
  35928. this._moveInitHeights = wall.minimumHeights._value;
  35929. this._moveInitHeight = wall.maximumHeights._value[0] - wall.minimumHeights._value[0];
  35930. this._moveUpdatePositions = [];
  35931. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35932. this._moveUpdatePositions.push(this._moveInitPositions[i2].clone());
  35933. }
  35934. wall.positions = new Cesium.CallbackProperty(function() {
  35935. return _self._moveUpdatePositions;
  35936. }, false);
  35937. this._moveUpdateHeights = [];
  35938. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35939. this._moveUpdateHeights.push(this._moveInitHeights[i2]);
  35940. }
  35941. wall.minimumHeights = new Cesium.CallbackProperty(function() {
  35942. return _self._moveUpdateHeights;
  35943. }, false);
  35944. wall.maximumHeights = new Cesium.CallbackProperty(function() {
  35945. let maxHeights = [];
  35946. for (let i2 = 0; i2 < _self._moveUpdateHeights.length; i2++) {
  35947. maxHeights.push(parseFloat(_self._moveUpdateHeights[i2]) + _self._moveInitHeight);
  35948. }
  35949. return maxHeights;
  35950. }, false);
  35951. }
  35952. },
  35953. _coordinateAxisUpdateEditEntity: function(moveAxisEntity) {
  35954. let bindEntity = moveAxisEntity.getBindEntity();
  35955. if (bindEntity === void 0)
  35956. return;
  35957. let bindEntityType = bindEntity.getEntityType();
  35958. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  35959. let wall = bindEntity.wall;
  35960. wall.positions = this._moveUpdatePositions;
  35961. wall.minimumHeights = this._moveUpdateHeights;
  35962. let maxHeights = [];
  35963. for (let i2 = 0; i2 < this._moveUpdateHeights.length; i2++) {
  35964. maxHeights.push(parseFloat(this._moveUpdateHeights[i2]) + this._moveInitHeight);
  35965. }
  35966. wall.maximumHeights = maxHeights;
  35967. }
  35968. },
  35969. _coordinateCalculateEntityOrientation: function(entity, options2) {
  35970. let position2 = entity.position._value;
  35971. let orientation = entity.orientation === void 0 ? new Cesium.Cartesian3(0, 0, 0) : entity.orientation._value;
  35972. let transform3 = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  35973. position2,
  35974. orientation,
  35975. new Cesium.Cartesian3(1, 1, 1),
  35976. new Cesium.Matrix4()
  35977. );
  35978. let _rotateX = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.x));
  35979. let _rotateY = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.y));
  35980. let _rotateZ = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.z));
  35981. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateX, transform3);
  35982. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateY, transform3);
  35983. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateZ, transform3);
  35984. let m3 = Cesium.Matrix4.getRotation(transform3, new Cesium.Matrix3());
  35985. let resOrientation = new Cesium.Quaternion();
  35986. Cesium.Quaternion.fromRotationMatrix(m3, resOrientation);
  35987. return resOrientation;
  35988. },
  35989. _removeCoorinateAxis: function() {
  35990. if (this._coordinateAxisEntityName !== void 0) {
  35991. this._removeEntityByName(this._coordinateAxisEntityName);
  35992. }
  35993. if (this._eventCoorinateAxis !== void 0) {
  35994. this._clearEvent(this._eventCoorinateAxis);
  35995. this._eventCoorinateAxis = void 0;
  35996. }
  35997. }
  35998. });
  35999. Object.assign(DrawTools.prototype, {
  36000. _setEntityIsEdit(entity) {
  36001. let _self = this;
  36002. entity.setIsEdit(true);
  36003. this._unActivateEdit();
  36004. this._sendShowPropertyDialog(entity);
  36005. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36006. this._registerLeftClickEvent(handler, function(event2) {
  36007. _self._unActivateEdit();
  36008. let feature2 = _self._viewer.scene.pick(event2.position);
  36009. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  36010. let featureType = feature2.id.getEditType();
  36011. let entityType = feature2.id.getEntityType();
  36012. if (featureType === DrawTools.EditPointType.Node || featureType === DrawTools.EditPointType.Middle || featureType === DrawTools.EditPointType.Center || featureType === DrawTools.EditPointType.CoordinateAxis || featureType === DrawTools.EditPointType.OdlineStrartNode || featureType === DrawTools.EditPointType.OdlineEndNode || entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.ArrowPolyline || entityType === DrawTools.DrawType.DynamicPolyline || entityType === DrawTools.DrawType.GrowPolyline || entityType === DrawTools.DrawType.OutlinePolyline || entityType === DrawTools.DrawType.OdLine || entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.SpatialLine || entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle || entityType === DrawTools.DrawType.Rectangle || entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.House || entityType === DrawTools.DrawType.TextWall || entityType === DrawTools.DrawType.VideoWall) {
  36013. _self._sendShowPropertyDialog(feature2.id);
  36014. }
  36015. }
  36016. });
  36017. },
  36018. _sendShowPropertyDialog(entity) {
  36019. let _self = this;
  36020. let editEntityType = entity.getEntityType();
  36021. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  36022. this._unActivateEdit();
  36023. return;
  36024. }
  36025. let editProperty = entity.getParams();
  36026. if (editEntityType === DrawTools.DrawType.OdLine) {
  36027. editProperty = entity.parent.getParams();
  36028. }
  36029. this._console("\u9009\u62E9\u5B9E\u4F53\u7684\u5C5E\u6027", editProperty);
  36030. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  36031. this._openPropertyEditDialog(editProperty, function(params) {
  36032. _self.updateEditEntityProperty(params);
  36033. }, function() {
  36034. _self._removeEditEntity();
  36035. });
  36036. }
  36037. this._activateEdit(entity);
  36038. },
  36039. _removeEditEntity() {
  36040. if (this._editEntity !== void 0) {
  36041. this._console("\u79FB\u9664\u5B9E\u4F53", this._editEntity);
  36042. let entityType = this._editEntity.getEntityType();
  36043. if (entityType === DrawTools.DrawType.OdLine) {
  36044. let fatherEntityId = this._editEntity.parent.id;
  36045. let removeEntitys = [];
  36046. for (let entity of this._entities.values) {
  36047. if (entity.parent !== void 0 && entity.parent.id === fatherEntityId) {
  36048. removeEntitys.push(entity);
  36049. }
  36050. }
  36051. for (let removeEntity of removeEntitys) {
  36052. this._removeEntityByObject(removeEntity);
  36053. }
  36054. } else {
  36055. this._removeEntityByObject(this._editEntity);
  36056. }
  36057. this._unActivateEdit();
  36058. this._editEntity = void 0;
  36059. }
  36060. },
  36061. updateEditEntityProperty: function(params) {
  36062. if (this._editEntity === void 0)
  36063. return;
  36064. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  36065. return;
  36066. let editEntityType = this._editEntity.getEntityType();
  36067. if (editEntityType === void 0)
  36068. return;
  36069. if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36070. this._updateWallProperty(params);
  36071. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36072. this._updateCircleProperty(params);
  36073. } else if (editEntityType === DrawTools.DrawType.House) {
  36074. this._updateHouseProperty(params);
  36075. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36076. this._updateVideoWallProperty(params);
  36077. } else if (editEntityType === DrawTools.DrawType.Polyline) {
  36078. this._updatePolylineProperty(params);
  36079. } else if (editEntityType === DrawTools.DrawType.Polygon) {
  36080. this._updatePolygonProperty(params);
  36081. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36082. this._updateRectangleProperty(params);
  36083. } else if (editEntityType === DrawTools.DrawType.SpatialLine) {
  36084. this._updateSpatialPolylineProperty(params);
  36085. } else if (editEntityType === DrawTools.DrawType.OdLine) {
  36086. this._updateOdlineProperty(params);
  36087. }
  36088. },
  36089. _updateOdlineProperty(params) {
  36090. let _self = this;
  36091. let fatherEntity = this._editEntity.parent;
  36092. this._editOdlineEntities = [];
  36093. for (let entity of this._entities.values) {
  36094. if (entity.parent !== void 0 && entity.parent.id === fatherEntity.id) {
  36095. this._editOdlineEntities.push(entity);
  36096. }
  36097. }
  36098. let meterialImage = this._image_arrow_reverse;
  36099. if (params.order === this._param.order_add) {
  36100. meterialImage = this._image_arrow_reverse;
  36101. } else if (params.order === this._param.order_minus) {
  36102. meterialImage = this._image_arrow_forward;
  36103. }
  36104. let odLineMaterial = new WallMaterialProperty({
  36105. viewer: _self._viewer,
  36106. trailImage: meterialImage,
  36107. duration: params.duration,
  36108. color: Cesium.Color.fromCssColorString(params.color),
  36109. param: {
  36110. direction: params.direction,
  36111. count: params.count,
  36112. order: params.order
  36113. }
  36114. });
  36115. for (let entity of this._editOdlineEntities) {
  36116. entity.polyline.material = odLineMaterial;
  36117. let positions = entity.polyline.positions._value;
  36118. let strPoint = positions.first();
  36119. let endPoint = positions.last();
  36120. let newPositios = this._calculateOdlinePositios(
  36121. strPoint,
  36122. endPoint,
  36123. parseInt(params.odlineHeight),
  36124. parseInt(params.odlineCount)
  36125. );
  36126. entity.polyline.positions = newPositios;
  36127. entity.polyline.width = parseInt(params.lineWidth);
  36128. }
  36129. fatherEntity.setParams(params);
  36130. },
  36131. _updateSpatialPolylineProperty(params) {
  36132. let material = this._editEntity.polyline.material;
  36133. let newMaterial = void 0;
  36134. if (material instanceof Cesium.ColorMaterialProperty) {
  36135. newMaterial = this._materialColorProperty({
  36136. color: params.color
  36137. });
  36138. }
  36139. if (newMaterial !== void 0)
  36140. this._editEntity.polyline.material = newMaterial;
  36141. this._editEntity.polyline.width = parseFloat(params.lineWidth);
  36142. this._editEntity.setParams(params);
  36143. },
  36144. _updateRectangleProperty(params) {
  36145. let material = this._editEntity.rectangle.material;
  36146. if (material instanceof Cesium.ColorMaterialProperty) {
  36147. let newMaterial = this._materialColorProperty({
  36148. color: params.color
  36149. });
  36150. this._editEntity.rectangle.material = newMaterial;
  36151. }
  36152. if (this._editEntity.polyline !== void 0) {
  36153. let newMaterial = this._materialColorProperty({
  36154. color: params.outlineColor
  36155. });
  36156. this._editEntity.polyline.material = newMaterial;
  36157. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36158. }
  36159. this._editEntity.setParams(params);
  36160. },
  36161. _updatePolygonProperty(params) {
  36162. let material = this._editEntity.polygon.material;
  36163. if (material instanceof Cesium.ColorMaterialProperty) {
  36164. let newMaterial = this._materialColorProperty({
  36165. color: params.color
  36166. });
  36167. this._editEntity.polygon.material = newMaterial;
  36168. }
  36169. if (this._editEntity.polyline !== void 0) {
  36170. let newMaterial = this._materialColorProperty({
  36171. color: params.outlineColor
  36172. });
  36173. this._editEntity.polyline.material = newMaterial;
  36174. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36175. }
  36176. this._editEntity.setParams(params);
  36177. },
  36178. _updatePolylineProperty(params) {
  36179. let material = this._editEntity.polyline.material;
  36180. let newMaterial = void 0;
  36181. if (material instanceof Cesium.ColorMaterialProperty) {
  36182. newMaterial = this._materialColorProperty({
  36183. color: params.color
  36184. });
  36185. } else if (material instanceof Cesium.PolylineArrowMaterialProperty) {
  36186. newMaterial = this._materialPolylineArrowProperty({
  36187. color: params.color
  36188. });
  36189. } else if (material instanceof WallMaterialProperty) {
  36190. let materialImage = this._image_h_l_r;
  36191. if (params.order === this._param.order_minus) {
  36192. materialImage = this._image_h_r_l;
  36193. } else if (params.order === this._param.order_add) {
  36194. materialImage = this._image_h_l_r;
  36195. }
  36196. newMaterial = new WallMaterialProperty({
  36197. viewer: this._viewer,
  36198. trailImage: materialImage,
  36199. duration: params.duration,
  36200. color: Cesium.Color.fromCssColorString(params.color),
  36201. param: {
  36202. count: parseInt(params.count),
  36203. direction: params.direction,
  36204. order: params.order
  36205. }
  36206. });
  36207. } else if (material instanceof Cesium.PolylineGlowMaterialProperty) {
  36208. newMaterial = this._materialPolylineGlowProperty({
  36209. color: params.color,
  36210. power: parseFloat(params.power)
  36211. });
  36212. } else if (material instanceof Cesium.PolylineOutlineMaterialProperty) {
  36213. newMaterial = this._materialPolylineOutlineProperty({
  36214. color: params.color,
  36215. outlineWidth: parseFloat(params.outlineWidth),
  36216. outlineColor: params.outlineColor
  36217. });
  36218. }
  36219. if (newMaterial !== void 0)
  36220. this._editEntity.polyline.material = newMaterial;
  36221. this._editEntity.polyline.width = params.lineWidth;
  36222. this._editEntity.setParams(params);
  36223. },
  36224. _updateHouseProperty(params) {
  36225. let entityParams = this._editEntity.getParams();
  36226. let polygonMaterial = this._editEntity.polygon.material;
  36227. if (polygonMaterial instanceof Cesium.ColorMaterialProperty) {
  36228. let material = this._materialColorProperty({
  36229. color: params.color
  36230. });
  36231. this._editEntity.polygon.material = material;
  36232. this._editEntity.polygon.extrudedHeight = parseFloat(params.height) + parseFloat(
  36233. entityParams.bottomHeight
  36234. );
  36235. this._editEntity.setParams(params);
  36236. }
  36237. },
  36238. _updateCircleProperty(params) {
  36239. let circleMaterial = this._editEntity.ellipse.material;
  36240. if (circleMaterial instanceof CircleMaterialProperty) {
  36241. let material = new CircleMaterialProperty({
  36242. viewer: this._viewer,
  36243. duration: params.duration,
  36244. color: Cesium.Color.fromCssColorString(params.color),
  36245. count: parseFloat(params.count)
  36246. });
  36247. this._editEntity.ellipse.material = material;
  36248. } else if (circleMaterial instanceof Cesium.ColorMaterialProperty) {
  36249. let material = this._materialColorProperty({
  36250. color: params.color
  36251. });
  36252. this._editEntity.ellipse.material = material;
  36253. if (this._editEntity.polyline !== void 0) {
  36254. let newMaterial = this._materialColorProperty({
  36255. color: params.outlineColor
  36256. });
  36257. this._editEntity.polyline.material = newMaterial;
  36258. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36259. }
  36260. }
  36261. this._editEntity.setParams(params);
  36262. },
  36263. _updateVideoWallProperty(params) {
  36264. let videoElement = document.getElementById("wallVideo");
  36265. if (videoElement !== null) {
  36266. document.body.removeChild(videoElement);
  36267. }
  36268. videoElement = document.createElement("video");
  36269. videoElement.id = "wallVideo";
  36270. videoElement.setAttribute("crossorigin", "anonymous");
  36271. videoElement.setAttribute("width", "1024px");
  36272. videoElement.setAttribute("height", "256px");
  36273. videoElement.setAttribute("controls", "controls");
  36274. videoElement.setAttribute("src", params.videoUrl);
  36275. videoElement.setAttribute("loop", "loop");
  36276. videoElement.play();
  36277. document.body.appendChild(videoElement);
  36278. let minimumHeights = this._editEntity.wall.minimumHeights._value;
  36279. let maximumHeights = [];
  36280. for (let i2 = 0; i2 < minimumHeights.length; i2++) {
  36281. maximumHeights.push(minimumHeights[i2] + parseFloat(params.height));
  36282. }
  36283. this._editEntity.wall.maximumHeights = maximumHeights;
  36284. this._editEntity.wall.material = videoElement;
  36285. let wallPositions = this._editEntity.wall.positions._value;
  36286. let newPositions = [];
  36287. for (let wallPosition of wallPositions) {
  36288. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(wallPosition);
  36289. let m = new Cesium.Matrix4();
  36290. Cesium.Matrix4.setTranslation(Cesium.Matrix4.IDENTITY, new Cesium.Cartesian3(
  36291. parseFloat(params.axisX),
  36292. parseFloat(params.axisY),
  36293. parseFloat(params.axisZ)
  36294. ), m);
  36295. let moveMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  36296. let newPosition = new Cesium.Cartesian3();
  36297. Cesium.Matrix4.getTranslation(moveMatrix, newPosition);
  36298. newPositions.push(newPosition);
  36299. }
  36300. this._editEntity.wall.positions = newPositions;
  36301. params.axisX = params.axisY = params.axisZ = 0;
  36302. this._editEntity.setParams(params);
  36303. this._activateEdit(this._editEntity);
  36304. },
  36305. _updateWallProperty(params) {
  36306. let minHeights = this._editEntity.wall.minimumHeights._value;
  36307. let maxHeights = [];
  36308. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36309. maxHeights.push(minHeights[i2] + parseFloat(params.height));
  36310. }
  36311. this._editEntity.wall.maximumHeights = maxHeights;
  36312. this._sketchWallMaxHeights = maxHeights;
  36313. let wallMaterial = this._editEntity.wall.material;
  36314. if (wallMaterial instanceof Cesium.ImageMaterialProperty) {
  36315. let material = this._materialTextImageProperty({
  36316. color: params.color,
  36317. text: params.text
  36318. });
  36319. this._editEntity.wall.material = material;
  36320. } else if (wallMaterial instanceof WallMaterialProperty) {
  36321. let materialImage = this._image_h_l_r;
  36322. if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36323. materialImage = this._image_h_l_r;
  36324. } else if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36325. materialImage = this._image_h_r_l;
  36326. } else if (params.direction === this._param.direction_v && params.order === this._param.order_minus) {
  36327. materialImage = this._image_v_t_b;
  36328. } else if (params.direction === this._param.direction_v && params.order === this._param.order_add) {
  36329. materialImage = this._image_v_b_t;
  36330. }
  36331. let material = new WallMaterialProperty({
  36332. viewer: this._viewer,
  36333. trailImage: materialImage,
  36334. duration: params.duration,
  36335. color: Cesium.Color.fromCssColorString(params.color),
  36336. param: {
  36337. count: parseFloat(params.count),
  36338. direction: params.direction,
  36339. order: params.order
  36340. }
  36341. });
  36342. this._editEntity.wall.material = material;
  36343. } else if (wallMaterial instanceof Cesium.ColorMaterialProperty) {
  36344. let material = this._materialColorProperty({
  36345. color: params.color
  36346. });
  36347. this._editEntity.wall.material = material;
  36348. }
  36349. this._editEntity.setParams(params);
  36350. },
  36351. rotationEntity(options2) {
  36352. if (this._editEntity === void 0)
  36353. return;
  36354. this._coordinateCalculateEntityOrientation(this._editEntity, options2);
  36355. },
  36356. _getEntityEditData: function(entity) {
  36357. if (entity instanceof Cesium.Entity) {
  36358. let editEntityType = entity.getEntityType();
  36359. if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36360. return entity.polyline.positions._value;
  36361. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36362. let positions = entity.polygon.hierarchy._value.positions;
  36363. if (positions[0].x !== positions[positions.length - 1].x) {
  36364. positions.push(positions[0].clone());
  36365. }
  36366. return positions;
  36367. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36368. let rect = entity.rectangle.coordinates._value;
  36369. let gNw = Cesium.Rectangle.northwest(rect);
  36370. if (gNw.height <= 0) {
  36371. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gNw.longitude), Cesium.Math.toDegrees(gNw.latitude));
  36372. gNw.height = height2;
  36373. }
  36374. let cNw = Cesium.Cartesian3.fromRadians(gNw.longitude, gNw.latitude, gNw.height);
  36375. let gSe = Cesium.Rectangle.southeast(rect);
  36376. if (gSe.height <= 0) {
  36377. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gSe.longitude), Cesium.Math.toDegrees(gSe.latitude));
  36378. gSe.height = height2;
  36379. }
  36380. let cSe = Cesium.Cartesian3.fromRadians(gSe.longitude, gSe.latitude, gSe.height);
  36381. return [cNw, cSe];
  36382. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36383. let centerPosition = entity.position._value;
  36384. let radius = entity.ellipse.semiMajorAxis._value;
  36385. let cbPoint = this._calculateCircleBoundaryPoint(centerPosition, radius);
  36386. return [centerPosition, cbPoint];
  36387. } else if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36388. this._sketchWallHeights = [];
  36389. this._sketchWallMaxHeights = [];
  36390. let minHeights = entity.wall.minimumHeights._value;
  36391. let maxHeights = entity.wall.maximumHeights._value;
  36392. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36393. this._sketchWallHeights.push(minHeights[i2]);
  36394. this._sketchWallMaxHeights.push(maxHeights[i2]);
  36395. }
  36396. return entity.wall.positions._value;
  36397. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36398. let positions = entity.wall.positions._value;
  36399. return [positions[0].clone()];
  36400. } else {
  36401. return [];
  36402. }
  36403. } else {
  36404. return [];
  36405. }
  36406. },
  36407. _calculateCircleBoundaryPoint: function(centerPosition, radius) {
  36408. let gCenter = Cesium.Ellipsoid.WGS84.cartesianToCartographic(centerPosition);
  36409. let cPoint = point([Cesium.Math.toDegrees(gCenter.longitude), Cesium.Math.toDegrees(
  36410. gCenter.latitude
  36411. )]);
  36412. let boundaryPoint = destination(cPoint, radius / 1e3, 90, {
  36413. units: "kilometers"
  36414. }).geometry.coordinates;
  36415. let height2 = this._queryHeightFromGeo(boundaryPoint[0], boundaryPoint[1]);
  36416. let cbPoint = Cesium.Cartesian3.fromDegrees(boundaryPoint[0], boundaryPoint[1], height2);
  36417. return cbPoint;
  36418. },
  36419. _calculateCenterPosition: function(positions) {
  36420. if (positions === void 0 || positions.length === 0)
  36421. return void 0;
  36422. else if (positions.length === 1) {
  36423. return positions[0];
  36424. } else if (positions.length === 2) {
  36425. let pt0 = this._cartesian3ToGeo(positions[0]);
  36426. let pt1 = this._cartesian3ToGeo(positions[1]);
  36427. let point0 = point([pt0.longitude, pt0.latitude]);
  36428. let point1 = point([pt1.longitude, pt1.latitude]);
  36429. let center2 = midpoint(point0, point1).geometry.coordinates;
  36430. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36431. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36432. } else {
  36433. let geoPoints = [
  36434. []
  36435. ];
  36436. for (let i2 = 0; i2 < positions.length; i2++) {
  36437. let geoPoint = this._cartesian3ToGeo(positions[i2]);
  36438. geoPoints[0].push([geoPoint.longitude, geoPoint.latitude]);
  36439. }
  36440. geoPoints[0].push(geoPoints[0][0]);
  36441. let polygon$1 = polygon(geoPoints);
  36442. let center2 = centerOfMass(polygon$1).geometry.coordinates;
  36443. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36444. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36445. }
  36446. },
  36447. _calculateTransformPosition: function(position2, distance2, bearing2, options2) {
  36448. let geoPoint = this._cartesian3ToGeo(position2);
  36449. let point$1 = point([geoPoint.longitude, geoPoint.latitude]);
  36450. let resPoint = destination(point$1, distance2, bearing2, options2).geometry.coordinates;
  36451. let height2 = geoPoint.height;
  36452. if (options2 !== void 0 && options2.calculateHeight !== void 0 && options2.calculateHeight === true) {
  36453. height2 = this._queryHeightFromGeo(resPoint[0], resPoint[1]);
  36454. }
  36455. let cPosition = Cesium.Cartesian3.fromDegrees(
  36456. resPoint[0],
  36457. resPoint[1],
  36458. height2
  36459. );
  36460. return cPosition;
  36461. },
  36462. _unActivateEdit: function() {
  36463. this._clearEditPoint();
  36464. this._removeCoorinateAxis();
  36465. this._closePropertyEditDialog();
  36466. },
  36467. _activateEdit: function(editEntity) {
  36468. let entityType = editEntity.getEntityType();
  36469. let entityIsEdit = editEntity.getIsEdit();
  36470. if (entityIsEdit === void 0 || entityType === void 0 || entityIsEdit === false) {
  36471. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91");
  36472. return;
  36473. }
  36474. if (entityType === DrawTools.DrawType.OdLine) {
  36475. this._activeteOdlineEdit(editEntity);
  36476. } else {
  36477. this._activeteNormalEdit(editEntity);
  36478. }
  36479. },
  36480. _activeteOdlineEdit: function(editEntity) {
  36481. let _self = this;
  36482. let entityType = editEntity.getEntityType();
  36483. if (entityType === void 0 || entityType !== DrawTools.DrawType.OdLine) {
  36484. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91\u6216\u8BE5\u5B9E\u4F53\u4E0D\u662FOD\u7EBF\u7C7B\u578B");
  36485. return;
  36486. }
  36487. let faterEntityId = editEntity.parent.id;
  36488. this._editOdlineEntities = [];
  36489. for (let entity of this._entities.values) {
  36490. if (entity.parent !== void 0 && entity.parent.id === faterEntityId) {
  36491. this._editOdlineEntities.push(entity);
  36492. }
  36493. }
  36494. if (this._editOdlineEntities.length === 0)
  36495. return;
  36496. this._editEntity = this._editOdlineEntities[0];
  36497. for (let i2 = 0; i2 < this._editOdlineEntities.length; i2++) {
  36498. let entity = this._editOdlineEntities[i2];
  36499. let positions = entity.polyline.positions._value;
  36500. if (i2 === 0) {
  36501. this._createEditOdlineStartPoint(positions.first(), entity);
  36502. this._createEditOdlineEndPoint(positions.last(), entity);
  36503. } else {
  36504. this._createEditOdlineEndPoint(positions.last(), entity);
  36505. }
  36506. }
  36507. if (this._sketchEditHandler === void 0) {
  36508. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36509. }
  36510. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36511. _self._eventEditMouseDown(event2);
  36512. });
  36513. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36514. _self._eventEditMouseMove(event2);
  36515. });
  36516. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36517. _self._eventEditMouseUp(event2);
  36518. });
  36519. },
  36520. _activeteNormalEdit: function(editEntity) {
  36521. let _self = this;
  36522. let positions = this._getEntityEditData(editEntity);
  36523. this._removePointEntitys();
  36524. let entityType = editEntity.getEntityType();
  36525. this._editEntity = editEntity;
  36526. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36527. this._createEditCenterPoint(positions[0]);
  36528. this._createEditNodePoint(positions, 1);
  36529. } else if (entityType === DrawTools.DrawType.VideoWall) {
  36530. if (!this._isRuntimeApp()) {
  36531. let position2 = positions[0];
  36532. this._removeCoorinateAxis();
  36533. this._createCoordinateAxis(position2);
  36534. }
  36535. } else {
  36536. this._createEditNodePoint(positions);
  36537. let centerPosition = this._calculateCenterPosition(positions);
  36538. if (centerPosition !== void 0) {
  36539. this._createEditCenterPoint(centerPosition);
  36540. }
  36541. }
  36542. if (entityType !== DrawTools.DrawType.Rectangle && entityType !== DrawTools.DrawType.Circle && entityType !== DrawTools.DrawType.DynamicCircle && entityType !== DrawTools.DrawType.VideoWall) {
  36543. if (entityType === DrawTools.DrawType.SpatialLine) {
  36544. this._createEditMiddlePoint(positions, true);
  36545. } else {
  36546. this._createEditMiddlePoint(positions);
  36547. }
  36548. }
  36549. if (this._sketchEditHandler === void 0) {
  36550. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36551. }
  36552. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36553. _self._eventEditMouseDown(event2);
  36554. });
  36555. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36556. _self._eventEditMouseMove(event2);
  36557. });
  36558. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36559. _self._eventEditMouseUp(event2);
  36560. });
  36561. },
  36562. _eventEditMouseDown: function(event2) {
  36563. let _self = this;
  36564. let feature2 = _self._viewer.scene.pick(event2.position);
  36565. if (feature2 != void 0 && feature2.id instanceof Cesium.Entity) {
  36566. let featureType = feature2.id.getEditType();
  36567. if (featureType === void 0)
  36568. return;
  36569. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  36570. let entityPosition = feature2.id.position._value;
  36571. _self._editPointEntity = feature2.id;
  36572. _self._setMousePointerStyle();
  36573. if (featureType.type === DrawTools.EditPointType.Node || featureType.type === DrawTools.EditPointType.Middle) {
  36574. _self._entityCallbackPropertyByMouseDown();
  36575. _self._removeEntityByObject(_self._editPointEntity);
  36576. if (_self._sketchEditEntitySpatialName != void 0) {
  36577. _self._removeEntityByName(_self._sketchEditEntitySpatialName);
  36578. }
  36579. } else if (featureType.type === DrawTools.EditPointType.Center) {
  36580. _self._entityCenterMouseDownEvent();
  36581. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode) {
  36582. _self._removeEntityByObject(_self._editPointEntity);
  36583. _self._editEntity = featureType.joinEntity;
  36584. let params = _self._editEntity.parent.getParams();
  36585. _self._sketchEditPoints = [];
  36586. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36587. _self._sketchEditPoints.push(joinEntityPositions.first());
  36588. _self._sketchEditPoints.push(joinEntityPositions.last());
  36589. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36590. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36591. return positions;
  36592. }, false);
  36593. } else if (featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36594. _self._removeEntityByObject(_self._editPointEntity);
  36595. _self._editEntity = featureType.joinEntity;
  36596. let params = _self._editEntity.parent.getParams();
  36597. _self._sketchEditPoints = [];
  36598. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36599. _self._sketchEditPoints.push(joinEntityPositions.first());
  36600. for (let odEntity of _self._editOdlineEntities) {
  36601. let odEntityPositions = odEntity.polyline.positions._value;
  36602. let lastPosition = odEntityPositions.last();
  36603. _self._sketchEditPoints.push(lastPosition.clone());
  36604. odEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36605. let positions = _self._calculateOdlinePositios(
  36606. _self._sketchEditPoints[0],
  36607. lastPosition,
  36608. parseInt(params.odlineHeight),
  36609. parseInt(params.odlineCount)
  36610. );
  36611. return positions;
  36612. }, false);
  36613. }
  36614. }
  36615. if (featureType.type === DrawTools.EditPointType.Middle) {
  36616. let index2 = featureType.index;
  36617. _self._sketchEditPoints.splice(index2, 0, entityPosition);
  36618. _self._sketchEditIndex = index2;
  36619. if (_self._sketchWallHeights != void 0 && _self._sketchWallHeights.length > 0) {
  36620. let geoPoint = _self._cartesian3ToGeo(entityPosition);
  36621. let height2 = _self._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  36622. _self._sketchWallHeights.splice(index2, 0, height2);
  36623. let heightDifference = _self._sketchWallMaxHeights[0] - _self._sketchWallHeights[0];
  36624. _self._sketchWallMaxHeights.splice(index2, 0, height2 + heightDifference);
  36625. }
  36626. _self._tooltipInit("\u62D6\u52A8\u4E2D\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36627. } else if (featureType.type === DrawTools.EditPointType.Node) {
  36628. _self._sketchEditIndex = featureType.index;
  36629. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36630. } else if (featureType.type === DrawTools.EditPointType.Spatial) {
  36631. _self._sketchEditIndex = featureType.index;
  36632. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u9AD8\u5EA6", event2.position);
  36633. } else if (featureType.type === DrawTools.EditPointType.CoordinateAxis) {
  36634. _self._tooltipInit("\u62D6\u52A8\u5750\u6807\u8F74\uFF0C\u6539\u53D8\u4F4D\u7F6E", event2.position);
  36635. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode || featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36636. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8OD\u7EBF\u4F4D\u7F6E", event2.position);
  36637. }
  36638. }
  36639. },
  36640. _eventEditMouseMove: function(event2) {
  36641. let _self = this;
  36642. if (_self._editPointEntity != void 0) {
  36643. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  36644. if (!Cesium.defined(loc2.sLocation))
  36645. return;
  36646. _self._editPosition = loc2.sLocation;
  36647. let editEntityType = _self._editPointEntity.getEditType();
  36648. if (editEntityType.type === DrawTools.EditPointType.Node) {
  36649. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36650. let editEntityType2 = _self._editEntity.getEntityType();
  36651. if (editEntityType2 != DrawTools.DrawType.Rectangle && editEntityType2 != DrawTools.DrawType.Circle && editEntityType2 != DrawTools.DrawType.DynamicCircle) {
  36652. if ((editEntityType2 === DrawTools.DrawType.Polygon || editEntityType2 === DrawTools.DrawType.House) && _self._sketchEditIndex === 0) {
  36653. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36654. } else if (editEntityType2 === DrawTools.DrawType.NormalWall || editEntityType2 === DrawTools.DrawType.DynamicWall || editEntityType2 === DrawTools.DrawType.TextWall) {
  36655. _self._sketchWallHeights[_self._sketchEditIndex] = loc2.gLocation.height;
  36656. }
  36657. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36658. if (editEntityType2 === DrawTools.DrawType.SpatialLine) {
  36659. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36660. } else {
  36661. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36662. }
  36663. }
  36664. } else if (editEntityType.type === DrawTools.EditPointType.Middle) {
  36665. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36666. } else if (editEntityType.type === DrawTools.EditPointType.Center) {
  36667. _self._entityCenterMouseMoveEvent(event2);
  36668. } else if (editEntityType.type === DrawTools.EditPointType.Spatial) {
  36669. let ellipsoid = _self._viewer.scene.globe.ellipsoid;
  36670. let cartesian = _self._viewer.camera.pickEllipsoid(
  36671. event2.endPosition,
  36672. ellipsoid
  36673. );
  36674. let bottomPoint = _self._sketchEditPoints[_self._sketchEditIndex];
  36675. let heightDifference = cartesian.z - bottomPoint.z;
  36676. if (heightDifference > 0 && heightDifference < 500) {
  36677. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  36678. _self._sketchWallMaxHeights[i2] = _self._sketchWallHeights[i2] + heightDifference;
  36679. }
  36680. }
  36681. } else if (editEntityType.type === DrawTools.EditPointType.OdlineEndNode) {
  36682. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36683. } else if (editEntityType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36684. _self._sketchEditPoints[0] = loc2.sLocation;
  36685. }
  36686. _self._tooltipInit("\u62AC\u8D77\u9F20\u6807\uFF0C\u5B8C\u6210\u66F4\u6539", event2.endPosition);
  36687. }
  36688. },
  36689. _eventEditMouseUp: function(event2) {
  36690. let _self = this;
  36691. if (_self._editPointEntity != void 0) {
  36692. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  36693. _self._tooltipRemove();
  36694. _self._setMouseDefaultStyle();
  36695. let editEntityPointType = _self._editPointEntity.getEditType().type;
  36696. let entityType = _self._editEntity.getEntityType();
  36697. if (editEntityPointType === DrawTools.EditPointType.CoordinateAxis)
  36698. ;
  36699. else if (editEntityPointType === DrawTools.EditPointType.OdlineEndNode) {
  36700. let params = _self._editEntity.parent.getParams();
  36701. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36702. _self._editEntity.polyline.positions = positions;
  36703. _self._createEditOdlineEndPoint(_self._sketchEditPoints[1], _self._editEntity);
  36704. } else if (editEntityPointType === DrawTools.EditPointType.OdlineStrartNode) {
  36705. let params = _self._editEntity.parent.getParams();
  36706. let index2 = 1;
  36707. for (let odEntity of _self._editOdlineEntities) {
  36708. let lastPosition = _self._sketchEditPoints[index2++];
  36709. let positions = _self._calculateOdlinePositios(
  36710. _self._sketchEditPoints[0],
  36711. lastPosition,
  36712. parseInt(params.odlineHeight),
  36713. parseInt(params.odlineCount)
  36714. );
  36715. odEntity.polyline.positions = positions;
  36716. }
  36717. _self._createEditOdlineStartPoint(_self._sketchEditPoints[0], _self._editOdlineEntities[0]);
  36718. } else {
  36719. if (editEntityPointType === DrawTools.EditPointType.Node || editEntityPointType === DrawTools.EditPointType.Middle) {
  36720. _self._entityCallbackPropertyByMouseUp();
  36721. } else if (editEntityPointType === DrawTools.EditPointType.Center) {
  36722. _self._entityCenterMouseUpEvent(event2);
  36723. }
  36724. _self._removeEntityByName(_self._sketchEditEntityNodeName);
  36725. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36726. _self._removeEntityByName(_self._sketchEditEntityCenterName);
  36727. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36728. let centerPosition = _self._editEntity.position._value;
  36729. let boundaryPosition = _self._calculateCircleBoundaryPoint(
  36730. centerPosition,
  36731. _self._sketchEllipseRadius
  36732. );
  36733. _self._sketchEditPoints[0] = centerPosition;
  36734. _self._sketchEditPoints[1] = boundaryPosition;
  36735. _self._createEditNodePoint(_self._sketchEditPoints, 1);
  36736. _self._createEditCenterPoint(centerPosition);
  36737. } else {
  36738. _self._createEditNodePoint(_self._sketchEditPoints);
  36739. let centerPosition = _self._calculateCenterPosition(_self._sketchEditPoints);
  36740. _self._createEditCenterPoint(centerPosition);
  36741. }
  36742. if (entityType != DrawTools.DrawType.Rectangle && entityType != DrawTools.DrawType.Circle && entityType != DrawTools.DrawType.DynamicCircle) {
  36743. if (entityType === DrawTools.DrawType.SpatialLine) {
  36744. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36745. } else {
  36746. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36747. }
  36748. }
  36749. }
  36750. _self._editPointEntity = void 0;
  36751. }
  36752. },
  36753. _entityCenterMouseDownEvent: function() {
  36754. let _self = this;
  36755. let entityPosition = this._editEntity.position._value;
  36756. this._removeEntityByName(this._sketchEditEntityNodeName);
  36757. this._removeEntityByName(this._sketchEditEntityMiddleName);
  36758. this._removeEntityByName(this._sketchEditEntityCenterName);
  36759. this._startPoint = entityPosition;
  36760. this._startMovePoints = [];
  36761. this._movePoint = entityPosition;
  36762. let editEntityType = this._editEntity.getEntityType();
  36763. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36764. if (this._editEntity.polyline !== void 0) {
  36765. for (let i2 = 0; i2 < this._ellipseOutlineCoordinates.length; i2++) {
  36766. this._startMovePoints.push(this._ellipseOutlineCoordinates[i2]);
  36767. }
  36768. this._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36769. function() {
  36770. return _self._ellipseOutlineCoordinates;
  36771. },
  36772. false
  36773. );
  36774. }
  36775. this._editEntity.position = new Cesium.CallbackProperty(function() {
  36776. return _self._movePoint;
  36777. }, false);
  36778. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36779. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36780. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36781. }
  36782. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(function() {
  36783. return {
  36784. positions: _self._sketchEditPoints
  36785. };
  36786. }, false);
  36787. if (_self._editEntity.polyline != void 0) {
  36788. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36789. return _self._sketchEditPoints;
  36790. }, false);
  36791. }
  36792. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36793. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36794. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36795. }
  36796. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36797. return _self._sketchEditPoints;
  36798. }, false);
  36799. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36800. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36801. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36802. }
  36803. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(_self._sketchEditPoints), false);
  36804. if (_self._editEntity.polyline != void 0) {
  36805. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36806. _self._callUpdateRectangleOutlineCoordinates(),
  36807. false
  36808. );
  36809. }
  36810. }
  36811. },
  36812. _entityCenterMouseMoveEvent: function(event2) {
  36813. this._calculatePositionsByCenter(event2.endPosition, false);
  36814. },
  36815. _calculatePositionsByCenter: function(screenPosition, calculateHeight) {
  36816. let strLoc = this._cartesian3ToGeo(this._startPoint);
  36817. let endLoc = this._transfromFromScreenPoint(screenPosition);
  36818. var point1 = point([strLoc.longitude, strLoc.latitude]);
  36819. var point2 = point([endLoc.gLocation.lng, endLoc.gLocation.lat]);
  36820. var bearing$1 = bearing(point1, point2);
  36821. var options2 = {
  36822. units: "kilometers",
  36823. calculateHeight
  36824. };
  36825. var distance$1 = distance(point1, point2, options2);
  36826. let editEntityType = this._editEntity.getEntityType();
  36827. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36828. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36829. let position2 = this._calculateTransformPosition(
  36830. this._startMovePoints[i2],
  36831. distance$1,
  36832. bearing$1,
  36833. options2
  36834. );
  36835. this._ellipseOutlineCoordinates[i2] = position2.clone();
  36836. }
  36837. this._movePoint = endLoc.sLocation;
  36838. } else {
  36839. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36840. let position2 = this._calculateTransformPosition(
  36841. this._startMovePoints[i2],
  36842. distance$1,
  36843. bearing$1,
  36844. options2
  36845. );
  36846. this._sketchEditPoints[i2] = position2.clone();
  36847. }
  36848. }
  36849. },
  36850. _entityCenterMouseUpEvent: function(event2) {
  36851. this._calculatePositionsByCenter(event2.position, true);
  36852. let _self = this;
  36853. let editEntityType = this._editEntity.getEntityType();
  36854. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36855. this._editEntity.position = this._movePoint;
  36856. if (this._editEntity.polyline !== void 0) {
  36857. this._editEntity.polyline.positions = this._ellipseOutlineCoordinates;
  36858. }
  36859. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36860. this._editEntity.polyline.positions = this._sketchEditPoints;
  36861. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36862. this._editEntity.polygon.hierarchy = {
  36863. positions: _self._sketchEditPoints
  36864. };
  36865. if (this._editEntity.polyline != void 0) {
  36866. this._editEntity.polyline.positions = this._sketchEditPoints;
  36867. }
  36868. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36869. this._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36870. if (this._editEntity.polyline != void 0) {
  36871. this._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36872. }
  36873. }
  36874. },
  36875. _entityCallbackPropertyByMouseUp: function() {
  36876. let _self = this;
  36877. let entityType = _self._editEntity.getEntityType();
  36878. if (entityType === DrawTools.DrawType.Polyline) {
  36879. _self._editEntity.polyline.positions = _self._sketchEditPoints;
  36880. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36881. _self._editEntity.polygon.hierarchy = {
  36882. positions: _self._sketchEditPoints
  36883. };
  36884. if (_self._editEntity.polyline != void 0) {
  36885. let polygonPositions = _self._editEntity.polygon.hierarchy._value.positions;
  36886. let linePositions = [];
  36887. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36888. linePositions.push(polygonPositions[i2].clone());
  36889. }
  36890. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36891. linePositions.push(linePositions[0].clone());
  36892. }
  36893. _self._editEntity.polyline.positions = linePositions;
  36894. }
  36895. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36896. _self._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36897. if (_self._editEntity.polyline != void 0) {
  36898. _self._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36899. }
  36900. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36901. _self._editEntity.ellipse.semiMajorAxis = _self._sketchEllipseRadius;
  36902. _self._editEntity.ellipse.semiMinorAxis = _self._sketchEllipseRadius;
  36903. if (_self._editEntity.polyline != void 0) {
  36904. _self._editEntity.polyline.positions = _self._ellipseOutlineCoordinates;
  36905. }
  36906. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  36907. _self._editEntity.wall.positions = _self._sketchEditPoints;
  36908. _self._editEntity.wall.minimumHeights = _self._sketchWallHeights;
  36909. _self._editEntity.wall.maximumHeights = _self._sketchWallMaxHeights;
  36910. }
  36911. },
  36912. _entityCallbackPropertyByMouseDown: function() {
  36913. let _self = this;
  36914. let entityType = _self._editEntity.getEntityType();
  36915. if (entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.SpatialLine) {
  36916. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36917. function() {
  36918. return _self._sketchEditPoints;
  36919. },
  36920. false
  36921. );
  36922. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36923. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(
  36924. function() {
  36925. return {
  36926. positions: _self._sketchEditPoints
  36927. };
  36928. },
  36929. false
  36930. );
  36931. if (_self._editEntity.polyline != void 0) {
  36932. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36933. function() {
  36934. let polygonPositions = _self._sketchEditPoints;
  36935. let linePositions = [];
  36936. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36937. linePositions.push(polygonPositions[i2].clone());
  36938. }
  36939. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36940. linePositions.push(linePositions[0].clone());
  36941. }
  36942. return linePositions;
  36943. },
  36944. false
  36945. );
  36946. }
  36947. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36948. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(
  36949. _self._callUpdateRectangleCoordinates(_self._sketchEditPoints),
  36950. false
  36951. );
  36952. if (_self._editEntity.polyline != void 0) {
  36953. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36954. _self._callUpdateRectangleOutlineCoordinates(),
  36955. false
  36956. );
  36957. }
  36958. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36959. if (_self._editPointEntity.getEditType().index === 1) {
  36960. _self._editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty(
  36961. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  36962. false
  36963. );
  36964. _self._editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty(
  36965. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  36966. false
  36967. );
  36968. }
  36969. if (_self._editEntity.polyline != void 0) {
  36970. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36971. _self._callEllipseOutlineCoordinate(_self._sketchEditPoints),
  36972. false
  36973. );
  36974. }
  36975. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  36976. _self._editEntity.wall.positions = new Cesium.CallbackProperty(function() {
  36977. return _self._sketchEditPoints;
  36978. }, false);
  36979. _self._editEntity.wall.minimumHeights = new Cesium.CallbackProperty(function() {
  36980. return _self._sketchWallHeights;
  36981. }, false);
  36982. _self._editEntity.wall.maximumHeights = new Cesium.CallbackProperty(function() {
  36983. return _self._sketchWallMaxHeights;
  36984. }, false);
  36985. }
  36986. },
  36987. _createEditPointEntity(options2) {
  36988. let _self = this;
  36989. if (options2 === void 0 || options2.position === void 0)
  36990. return;
  36991. if (options2 === void 0 || options2.editType === void 0)
  36992. return;
  36993. let color2 = options2.color != void 0 ? options2.color : [255, 0, 0, 1];
  36994. let size = options2.size != void 0 && typeof options2.size === "number" ? options2.size : 9;
  36995. let outlineWidth = options2.outlineWidth != void 0 && typeof options2.outlineWidth === "number" ? options2.outlineWidth : 1;
  36996. let outlineColor = options2.outlineColor != void 0 ? options2.outlineColor : [255, 255, 255, 1];
  36997. let pointEntity = new Cesium.Entity({
  36998. name: options2.name != void 0 ? options2.name : _self._sketchEntityName,
  36999. position: options2.position,
  37000. point: {
  37001. show: true,
  37002. pixelSize: size,
  37003. heightReference: Cesium.HeightReference.NONE,
  37004. color: _self._toColorFromArray(color2),
  37005. outlineWidth,
  37006. outlineColor: _self._toColorFromArray(outlineColor),
  37007. disableDepthTestDistance: 15e11
  37008. }
  37009. });
  37010. pointEntity.setEditType(options2.editType);
  37011. _self._entities.add(pointEntity);
  37012. },
  37013. _createEditNodePoint(positions, startIndex) {
  37014. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37015. let _self = this;
  37016. this._sketchEditPoints = [];
  37017. let strIndex = startIndex === void 0 ? 0 : startIndex;
  37018. for (let i2 = 0; i2 < positions.length; i2++) {
  37019. let position2 = positions[i2];
  37020. this._sketchEditPoints.push(position2.clone());
  37021. if (i2 < strIndex)
  37022. continue;
  37023. if (i2 !== 0 && position2.x === positions[0].x && position2.y === positions[0].y && position2.z === positions[0].z) {
  37024. continue;
  37025. }
  37026. let geoPoint = this._cartesian3ToGeo(position2);
  37027. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37028. let newPosition = Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37029. _self._createEditPointEntity({
  37030. name: _self._sketchEditEntityNodeName,
  37031. position: newPosition,
  37032. size: 12,
  37033. color: [0, 0, 255, 1],
  37034. editType: {
  37035. type: DrawTools.EditPointType.Node,
  37036. index: i2
  37037. }
  37038. });
  37039. }
  37040. },
  37041. _createEditSpatialPoint(positions, heights, startIndex) {
  37042. return;
  37043. },
  37044. _createEditMiddlePoint(positions, isSpatial = false) {
  37045. this._sketchEditEntityMiddleName = "SketchEditEntityMiddle";
  37046. let _self = this;
  37047. if (!isSpatial) {
  37048. for (let i2 = 1; i2 < positions.length; i2++) {
  37049. let p1 = positions[i2 - 1];
  37050. let p2 = positions[i2];
  37051. let pCenter = this._calculateMiddlePoint(p1, p2);
  37052. this._createEditPointEntity({
  37053. name: _self._sketchEditEntityMiddleName,
  37054. position: pCenter,
  37055. size: 9,
  37056. color: [255, 255, 0, 1],
  37057. editType: {
  37058. type: DrawTools.EditPointType.Middle,
  37059. index: i2
  37060. }
  37061. });
  37062. }
  37063. } else {
  37064. for (let i2 = 1; i2 < positions.length; i2++) {
  37065. let p1 = positions[i2 - 1];
  37066. let p2 = positions[i2];
  37067. let pCenter = {
  37068. x: (p1.x + p2.x) / 2,
  37069. y: (p1.y + p2.y) / 2,
  37070. z: (p1.z + p2.z) / 2
  37071. };
  37072. this._createEditPointEntity({
  37073. name: _self._sketchEditEntityMiddleName,
  37074. position: pCenter,
  37075. size: 9,
  37076. color: [255, 255, 0, 1],
  37077. editType: {
  37078. type: DrawTools.EditPointType.Middle,
  37079. index: i2
  37080. }
  37081. });
  37082. }
  37083. }
  37084. },
  37085. _createEditCenterPoint(position2) {
  37086. let _self = this;
  37087. this._sketchEditEntityCenterName = "SketchEditEntityCenter";
  37088. this._createEditPointEntity({
  37089. name: _self._sketchEditEntityCenterName,
  37090. position: position2,
  37091. size: 12,
  37092. color: [0, 255, 0, 0.1],
  37093. outlineWidth: 2,
  37094. outlineColor: [255, 255, 255, 1],
  37095. editType: {
  37096. type: DrawTools.EditPointType.Center
  37097. }
  37098. });
  37099. if (this._editEntity != void 0) {
  37100. this._editEntity.position = position2.clone();
  37101. }
  37102. },
  37103. _createEditOdlineEndPoint(position2, joinEntity) {
  37104. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37105. let _self = this;
  37106. let geoPoint = this._cartesian3ToGeo(position2);
  37107. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37108. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37109. _self._createEditPointEntity({
  37110. name: _self._sketchEditEntityNodeName,
  37111. position: position2,
  37112. size: 12,
  37113. color: [0, 0, 255, 1],
  37114. editType: {
  37115. type: DrawTools.EditPointType.OdlineEndNode,
  37116. joinEntity
  37117. }
  37118. });
  37119. },
  37120. _createEditOdlineStartPoint(position2, joinEntity) {
  37121. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37122. let _self = this;
  37123. let geoPoint = this._cartesian3ToGeo(position2);
  37124. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37125. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37126. _self._createEditPointEntity({
  37127. name: _self._sketchEditEntityNodeName,
  37128. position: position2,
  37129. size: 12,
  37130. color: [0, 255, 0, 0.6],
  37131. editType: {
  37132. type: DrawTools.EditPointType.OdlineStrartNode,
  37133. joinEntity
  37134. }
  37135. });
  37136. },
  37137. _calculateMiddlePoint(position1, position2) {
  37138. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position1);
  37139. let g2 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37140. let pt1 = [Cesium.Math.toDegrees(g1.longitude), Cesium.Math.toDegrees(g1.latitude)];
  37141. let pt2 = [Cesium.Math.toDegrees(g2.longitude), Cesium.Math.toDegrees(g2.latitude)];
  37142. let tpt1 = point(pt1);
  37143. let tpt2 = point(pt2);
  37144. let midpoint$1 = midpoint(tpt1, tpt2).geometry.coordinates;
  37145. let height2 = this._queryHeightFromGeo(midpoint$1[0], midpoint$1[1]);
  37146. let result = Cesium.Cartesian3.fromDegrees(midpoint$1[0], midpoint$1[1], height2);
  37147. return result;
  37148. },
  37149. _cartesian3ToGeo: function(position2) {
  37150. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37151. return {
  37152. longitude: Cesium.Math.toDegrees(g.longitude),
  37153. latitude: Cesium.Math.toDegrees(g.latitude),
  37154. height: g.height
  37155. };
  37156. },
  37157. _queryHeightFromGeo: function(longitude, latitude) {
  37158. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37159. return 0;
  37160. let rLng = Cesium.Math.toRadians(longitude);
  37161. let rLat = Cesium.Math.toRadians(latitude);
  37162. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37163. let noQueryEntities = [];
  37164. for (let i2 = 0; i2 < this._entities.values.length; i2++) {
  37165. if (this._entities.values[i2].name === this._sketchEntityName) {
  37166. noQueryEntities.push(this._entities.values[i2]);
  37167. }
  37168. }
  37169. let height2 = this._viewer.scene.sampleHeight(cartographic, noQueryEntities);
  37170. if (height2 === void 0)
  37171. return 0;
  37172. else
  37173. return height2;
  37174. },
  37175. _queryHeightFromGeoAsync: function(longitude, latitude, callComplete) {
  37176. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37177. return 0;
  37178. let rLng = Cesium.Math.toRadians(longitude);
  37179. let rLat = Cesium.Math.toRadians(latitude);
  37180. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37181. let promise = this._viewer.scene.sampleHeightMostDetailed([cartographic]);
  37182. promise.then(function(updatedPositions) {
  37183. if (callComplete)
  37184. callComplete(updatedPositions[0].height);
  37185. });
  37186. },
  37187. _clearEditPoint: function() {
  37188. if (this._sketchEditHandler != void 0) {
  37189. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  37190. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  37191. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37192. }
  37193. this._sketchEditPoints = [];
  37194. this._sketchEditIndex = void 0;
  37195. this._editEntity = void 0;
  37196. this._removeEntityByName(this._sketchEditEntityNodeName);
  37197. this._removeEntityByName(this._sketchEditEntityMiddleName);
  37198. this._removeEntityByName(this._sketchEditEntityCenterName);
  37199. this._removeEntityByName(this._sketchEditEntitySpatialName);
  37200. }
  37201. });
  37202. Object.assign(DrawTools.prototype, {
  37203. _checkColor: function(color2) {
  37204. if (color2 === void 0 || color2 === null)
  37205. return false;
  37206. if (typeof color2 != "number")
  37207. return false;
  37208. let intColor = parseInt(color2);
  37209. if (intColor < 0 || intColor > 255)
  37210. return false;
  37211. return true;
  37212. },
  37213. _checkAlpha: function(alpha) {
  37214. if (alpha === void 0 || alpha === null)
  37215. return false;
  37216. if (typeof alpha != "number")
  37217. return false;
  37218. let floatAlpha = parseFloat(alpha);
  37219. if (floatAlpha < 0 || floatAlpha > 1)
  37220. return false;
  37221. return true;
  37222. },
  37223. _checkColorAndAlpha: function(colorAndAlpah) {
  37224. let setColor = void 0;
  37225. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  37226. return void 0;
  37227. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  37228. setColor = [colorAndAlpah[0], 0, 0, 1];
  37229. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37230. colorAndAlpah[1]
  37231. )) {
  37232. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  37233. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37234. colorAndAlpah[1]
  37235. ) && this._checkColor(colorAndAlpah[2])) {
  37236. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  37237. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37238. colorAndAlpah[1]
  37239. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  37240. colorAndAlpah[3]
  37241. )) {
  37242. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  37243. }
  37244. return setColor;
  37245. }
  37246. });
  37247. Object.assign(DrawTools.prototype, {
  37248. _initOperationDom: function() {
  37249. let _self = this;
  37250. this._operationDomId = "drawButtonDiv";
  37251. this._operationDom = document.getElementById(this._operationDomId);
  37252. this._removeOperationDom();
  37253. this._createOperationMainDom();
  37254. if ([
  37255. DrawTools.DrawType.Rectangle,
  37256. DrawTools.DrawType.Circle,
  37257. DrawTools.DrawType.DynamicCircle,
  37258. DrawTools.DrawType.VideoWall
  37259. ].indexOf(this._drawType) === -1) {
  37260. let btnUndo = this._createOperationUndoButtonDom();
  37261. btnUndo.onclick = function() {
  37262. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  37263. };
  37264. }
  37265. if ([
  37266. DrawTools.DrawType.Rectangle,
  37267. DrawTools.DrawType.Circle,
  37268. DrawTools.DrawType.DynamicCircle,
  37269. DrawTools.DrawType.VideoWall
  37270. ] === -1) {
  37271. let btnCompletion = this._crateOperationCompletionButtonDom();
  37272. btnCompletion.onclick = function() {
  37273. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37274. };
  37275. } else {
  37276. let btnCompletion = this._crateOperationCompletionButtonDom();
  37277. btnCompletion.onclick = function() {
  37278. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  37279. };
  37280. }
  37281. },
  37282. _operationExecuteEvent(eventType) {
  37283. if (this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  37284. let event2 = {
  37285. position: new Cesium.Cartesian2(300, 300)
  37286. };
  37287. let action = this._drawEventHandler.getInputAction(eventType);
  37288. action(event2);
  37289. }
  37290. },
  37291. _createOperationMainDom: function() {
  37292. this._operationDom = document.createElement("div");
  37293. this._operationDom.id = this._operationDomId;
  37294. this._operationDom.style.width = "80px";
  37295. this._operationDom.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37296. this._operationDom.style.borderRadius = "5px";
  37297. this._operationDom.style.display = "flex";
  37298. this._operationDom.style.flexDirection = "column";
  37299. this._operationDom.style.padding = "8px";
  37300. this._operationDom.style.justifyContent = "center";
  37301. this._operationDom.style.position = "absolute";
  37302. this._operationDom.style.bottom = "150px";
  37303. this._operationDom.style.right = "10px";
  37304. document.body.appendChild(this._operationDom);
  37305. },
  37306. _createOperationUndoButtonDom: function() {
  37307. let btnUndo = document.createElement("button");
  37308. btnUndo.id = "btnDrawBackout";
  37309. btnUndo.style.height = "30px";
  37310. btnUndo.style.marginBottom = "8px";
  37311. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37312. btnUndo.style.color = "rgb(255, 255, 255)";
  37313. btnUndo.style.border = "0px solid red";
  37314. btnUndo.style.borderRadius = "5px";
  37315. btnUndo.innerHTML = "\u56DE\u9000";
  37316. btnUndo.style.fontSize = "13px";
  37317. btnUndo.style.cursor = "pointer";
  37318. this._operationDom.appendChild(btnUndo);
  37319. return btnUndo;
  37320. },
  37321. _crateOperationCompletionButtonDom: function() {
  37322. let btnCompletion = document.createElement("button");
  37323. btnCompletion.id = "btnDrawComplete";
  37324. btnCompletion.style.height = "30px";
  37325. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37326. btnCompletion.style.color = "rgb(255, 255, 255)";
  37327. btnCompletion.style.border = "0px solid red";
  37328. btnCompletion.style.borderRadius = "5px";
  37329. btnCompletion.innerHTML = "\u5B8C\u6210";
  37330. btnCompletion.style.fontSize = "13px";
  37331. btnCompletion.style.cursor = "pointer";
  37332. this._operationDom.appendChild(btnCompletion);
  37333. return btnCompletion;
  37334. },
  37335. _removeOperationDom: function() {
  37336. if (this._operationDom !== null && this._operationDom !== void 0) {
  37337. document.body.removeChild(this._operationDom);
  37338. this._operationDom = void 0;
  37339. }
  37340. },
  37341. _createOperationDom: function() {
  37342. if (this._isRuntimeApp()) {
  37343. this._initOperationDom();
  37344. }
  37345. }
  37346. });
  37347. Object.assign(DrawTools.prototype, {
  37348. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  37349. this._editPropertyDialogDomId = "dialog-property-dom";
  37350. this._registerDOMPropertyEdit = "dialog-edit-property";
  37351. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  37352. if (PropertyEditComponent === void 0) {
  37353. PropertyEditComponent = defineCustomElement(DialogEditProperty$2);
  37354. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  37355. }
  37356. this._closePropertyEditDialog();
  37357. let dialogPropertyElement = new PropertyEditComponent({
  37358. params
  37359. });
  37360. dialogPropertyElement.id = this._editPropertyDialogDomId;
  37361. dialogPropertyElement.showDialog = true;
  37362. document.body.appendChild(dialogPropertyElement);
  37363. dialogPropertyElement.addEventListener(
  37364. "submit",
  37365. (e) => {
  37366. if (callEdit)
  37367. callEdit(e.detail[0]);
  37368. },
  37369. false
  37370. );
  37371. dialogPropertyElement.addEventListener(
  37372. "remove",
  37373. (e) => {
  37374. if (callRemove)
  37375. callRemove();
  37376. },
  37377. false
  37378. );
  37379. },
  37380. _closePropertyEditDialog() {
  37381. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  37382. if (dom2 !== null && dom2 !== void 0) {
  37383. document.body.removeChild(dom2);
  37384. }
  37385. }
  37386. });
  37387. DrawTools.DrawType = Object.freeze({
  37388. Point: "point",
  37389. Polyline: "polyline",
  37390. ArrowPolyline: "arrowPolyline",
  37391. DynamicPolyline: "dynamicPolyline",
  37392. GrowPolyline: "\u53D1\u5149\u7EBF",
  37393. OutlinePolyline: "outlinePolyline",
  37394. OdLine: "odLine",
  37395. Polygon: "polygon",
  37396. SpatialLine: "spatialLine",
  37397. Circle: "circle",
  37398. DynamicCircle: "dynamicCircle",
  37399. Rectangle: "rectangle",
  37400. NormalWall: "normalWall",
  37401. DynamicWall: "dynamicWall",
  37402. House: "house",
  37403. TextWall: "text",
  37404. VideoWall: "videoWall"
  37405. });
  37406. DrawTools.IconType = Object.freeze({
  37407. Normal: "normal",
  37408. Blue: "blue",
  37409. Green: "green",
  37410. Violet: "violter"
  37411. });
  37412. DrawTools.EditPointType = Object.freeze({
  37413. Node: "node",
  37414. Middle: "middle",
  37415. Center: "center",
  37416. CoordinateAxis: "coordinateAxis",
  37417. OdlineStrartNode: "odlineStartNode",
  37418. OdlineEndNode: "odlineEndNode"
  37419. });
  37420. DrawTools.WallType = Object.freeze({
  37421. ColorWall: "colorWall",
  37422. DynamicWall: "dynamicWall",
  37423. TextWall: "textWall"
  37424. });
  37425. DrawTools.CircleType = Object.freeze({
  37426. ColorCircle: "colorCircle",
  37427. DynamicCircle: "dynamicCircle"
  37428. });
  37429. DrawTools.PolylineType = Object.freeze({
  37430. NormalPolyline: "normalPolyline",
  37431. ArrowsPolyline: "arrowsPolyline",
  37432. DynamicPolyline: "dynamicPolyline",
  37433. DottedPolyline: "dottedPolyline",
  37434. GrowPolyline: "growPolyline",
  37435. OutlinePolyline: "outlinePolyline"
  37436. });
  37437. DrawTools.PolygonType = Object.freeze({
  37438. NormalPolygon: "normalPolygon",
  37439. HousePolygon: "housePolygon"
  37440. });
  37441. DrawTools.RuntimeEnvironment = Object.freeze({
  37442. App: "app",
  37443. Web: "web"
  37444. });
  37445. class WallMaterialProperty {
  37446. constructor(options2) {
  37447. this._viewer = options2.viewer;
  37448. this._definitionChanged = new Cesium.Event();
  37449. this._color = void 0;
  37450. this.color = options2.color || Cesium.Color.BLUE;
  37451. this.duration = options2.duration || 1e3;
  37452. this.trailImage = options2.trailImage;
  37453. this._time = new Date().getTime();
  37454. this._materialTypeName = "WallMaterial" + this._guid();
  37455. this._param = {
  37456. color: this.color._value.toCssColorString(),
  37457. image: this.trailImage,
  37458. duration: this.duration,
  37459. count: 0,
  37460. direction: "",
  37461. order: ""
  37462. };
  37463. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37464. fabric: {
  37465. type: this._materialTypeName,
  37466. uniforms: {
  37467. time: -20,
  37468. color: new Cesium.Color(1, 0, 0, 0.5),
  37469. image: options2.trailImage
  37470. },
  37471. source: this._getDirectionWallShader(options2.param)
  37472. },
  37473. translucent: function(material) {
  37474. return true;
  37475. }
  37476. });
  37477. }
  37478. _guid() {
  37479. function S4() {
  37480. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  37481. }
  37482. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  37483. }
  37484. getType(time) {
  37485. return this._materialTypeName;
  37486. }
  37487. getValue(time, result) {
  37488. if (!Cesium.defined(result)) {
  37489. result = {};
  37490. }
  37491. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37492. result.image = this.trailImage;
  37493. if (this.duration) {
  37494. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37495. }
  37496. this._viewer.scene.requestRender();
  37497. return result;
  37498. }
  37499. equals(other) {
  37500. return this === other || other instanceof WallMaterialProperty && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  37501. }
  37502. _getDirectionWallShader(options2) {
  37503. let op = Cesium.defaultValue(options2, {});
  37504. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  37505. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  37506. let order = op.order === "+" ? "+" : "-";
  37507. this._param.count = count;
  37508. this._param.direction = direction;
  37509. this._param.order = order;
  37510. let materail = "";
  37511. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  37512. if (direction === "vertical") {
  37513. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  37514. } else if (direction === "horizontal") {
  37515. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  37516. }
  37517. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  37518. return materail;
  37519. }
  37520. }
  37521. Object.defineProperties(WallMaterialProperty.prototype, {
  37522. isConstant: {
  37523. get: function() {
  37524. return false;
  37525. }
  37526. },
  37527. definitionChanged: {
  37528. get: function() {
  37529. return this._definitionChanged;
  37530. }
  37531. },
  37532. color: Cesium.createPropertyDescriptor("color")
  37533. });
  37534. class CircleMaterialProperty {
  37535. constructor(options2) {
  37536. this._viewer = options2.viewer;
  37537. this._definitionChanged = new Cesium.Event();
  37538. this._color = void 0;
  37539. this.color = options2.color || Cesium.Color.BLUE;
  37540. this.count = options2.count || 1;
  37541. this.duration = options2.duration || 1e3;
  37542. this._time = new Date().getTime();
  37543. this._materialTypeName = "jtCircleMaterial";
  37544. this._param = {
  37545. color: this.color._value.toCssColorString(),
  37546. duration: this.duration,
  37547. count: this.count
  37548. };
  37549. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37550. fabric: {
  37551. type: this._materialTypeName,
  37552. uniforms: {
  37553. time: 0,
  37554. color: new Cesium.Color(1, 0, 0, 0.5),
  37555. count: 1
  37556. },
  37557. source: this._getCircleMaterial()
  37558. },
  37559. translucent: function(material) {
  37560. return true;
  37561. }
  37562. });
  37563. }
  37564. _getCircleMaterial() {
  37565. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  37566. return circleMaterial;
  37567. }
  37568. }
  37569. Object.assign(CircleMaterialProperty.prototype, {
  37570. getType: function(time) {
  37571. return this._materialTypeName;
  37572. },
  37573. getValue: function(time, result) {
  37574. if (!Cesium.defined(result)) {
  37575. result = {};
  37576. }
  37577. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37578. result.count = this.count;
  37579. if (this.duration) {
  37580. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37581. }
  37582. this._viewer.scene.requestRender();
  37583. return result;
  37584. },
  37585. equals: function(other) {
  37586. return this === other || other instanceof CircleMaterialProperty && Cesium.Property.equals(this._color, other._color);
  37587. }
  37588. });
  37589. Object.defineProperties(CircleMaterialProperty.prototype, {
  37590. isConstant: {
  37591. get: function() {
  37592. return false;
  37593. }
  37594. },
  37595. definitionChanged: {
  37596. get: function() {
  37597. return this._definitionChanged;
  37598. }
  37599. },
  37600. color: Cesium.createPropertyDescriptor("color")
  37601. });
  37602. const _checkAppOrWeb = function() {
  37603. if (window.navigator.userAgent.match(
  37604. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  37605. )) {
  37606. return "App";
  37607. } else {
  37608. return "Web";
  37609. }
  37610. };
  37611. const isRuntimeApp = function() {
  37612. if (_checkAppOrWeb() === "App") {
  37613. return true;
  37614. }
  37615. return false;
  37616. };
  37617. const isRuntimeWeb = function() {
  37618. if (_checkAppOrWeb() === "Web") {
  37619. return true;
  37620. }
  37621. return false;
  37622. };
  37623. function createOperationMainDom() {
  37624. let buttonDiv = document.createElement("div");
  37625. buttonDiv.id = "drawButtonDiv";
  37626. buttonDiv.style.width = "80px";
  37627. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37628. buttonDiv.style.borderRadius = "5px";
  37629. buttonDiv.style.display = "flex";
  37630. buttonDiv.style.flexDirection = "column";
  37631. buttonDiv.style.padding = "8px";
  37632. buttonDiv.style.justifyContent = "center";
  37633. buttonDiv.style.position = "absolute";
  37634. buttonDiv.style.bottom = "150px";
  37635. buttonDiv.style.right = "10px";
  37636. let btnUndo = document.createElement("button");
  37637. btnUndo.id = "btnDrawBackout";
  37638. btnUndo.style.height = "30px";
  37639. btnUndo.style.marginBottom = "8px";
  37640. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37641. btnUndo.style.color = "rgb(255, 255, 255)";
  37642. btnUndo.style.border = "0px solid red";
  37643. btnUndo.style.borderRadius = "5px";
  37644. btnUndo.innerHTML = "\u56DE\u9000";
  37645. btnUndo.style.fontSize = "13px";
  37646. btnUndo.style.cursor = "pointer";
  37647. buttonDiv.appendChild(btnUndo);
  37648. let btnCompletion = document.createElement("button");
  37649. btnCompletion.id = "btnDrawComplete";
  37650. btnCompletion.style.height = "30px";
  37651. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37652. btnCompletion.style.color = "rgb(255, 255, 255)";
  37653. btnCompletion.style.border = "0px solid red";
  37654. btnCompletion.style.borderRadius = "5px";
  37655. btnCompletion.innerHTML = "\u5B8C\u6210";
  37656. btnCompletion.style.fontSize = "13px";
  37657. btnCompletion.style.cursor = "pointer";
  37658. buttonDiv.appendChild(btnCompletion);
  37659. document.body.appendChild(buttonDiv);
  37660. }
  37661. function showTooltipMessage(message) {
  37662. let msgMainDom = document.getElementById("messageMainDom");
  37663. if (msgMainDom !== null && msgMainDom !== void 0) {
  37664. document.body.removeChild(msgMainDom);
  37665. }
  37666. msgMainDom = document.createElement("div");
  37667. msgMainDom.style.width = "30%";
  37668. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  37669. msgMainDom.style.height = "45px";
  37670. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  37671. msgMainDom.style.borderRadius = "8px";
  37672. msgMainDom.style.display = "flex";
  37673. msgMainDom.style.alignItems = "center";
  37674. msgMainDom.style.paddingLeft = "10px";
  37675. msgMainDom.style.color = "rgb(91, 188, 48)";
  37676. msgMainDom.style.fontSize = "14px";
  37677. msgMainDom.style.fontWeight = "600";
  37678. msgMainDom.style.position = "absolute";
  37679. msgMainDom.style.left = "35%";
  37680. msgMainDom.style.transition = "transform 1s";
  37681. msgMainDom.style.transform = "translateY(-90px)";
  37682. msgMainDom.style.top = "0px";
  37683. msgMainDom.style.zIndex = 1e3;
  37684. document.body.appendChild(msgMainDom);
  37685. let strHtml = "";
  37686. strHtml += "<div style='";
  37687. strHtml += "background-color: rgb(88, 185, 45);";
  37688. strHtml += "color: rgb(255, 255, 255);";
  37689. strHtml += "height: 24px;";
  37690. strHtml += "width: 24px;";
  37691. strHtml += "border-radius: 20px;";
  37692. strHtml += "display: flex;";
  37693. strHtml += "justify-content: center;";
  37694. strHtml += "align-items: center;";
  37695. strHtml += "font-size: 14px;";
  37696. strHtml += "margin-right: 18px;";
  37697. strHtml += "'>&#10003</div>";
  37698. strHtml += "<div>" + message + "</div>";
  37699. msgMainDom.innerHTML = strHtml;
  37700. msgMainDom.addEventListener("transitionend", function() {
  37701. setTimeout(function() {
  37702. document.body.removeChild(msgMainDom);
  37703. }, 1e3);
  37704. }, false);
  37705. setTimeout(function() {
  37706. msgMainDom.style.transform = "translateY(50px)";
  37707. }, 100);
  37708. }
  37709. var RuntimeEnvironment = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  37710. __proto__: null,
  37711. isRuntimeApp,
  37712. isRuntimeWeb,
  37713. createOperationMainDom,
  37714. showTooltipMessage
  37715. }, Symbol.toStringTag, { value: "Module" }));
  37716. class DrawStraightArrow {
  37717. constructor(arg) {
  37718. this.viewer = arg.viewer;
  37719. this.Cesium = arg.Cesium;
  37720. this.floatingPoint = null;
  37721. this._straightArrow = null;
  37722. this._straightArrowLast = null;
  37723. this._positions = [];
  37724. this._entities_point = [];
  37725. this._entities_straightArrow = [];
  37726. this._straightArrowData = null;
  37727. this.DrawStartEvent = new Cesium.Event();
  37728. this.DrawEndEvent = new Cesium.Event();
  37729. this._tooltip = createTooltip(this.viewer.container);
  37730. this._param = {
  37731. id: "DrawStraightArrow",
  37732. polygonColor: "rgba(0,255,0,0.5)",
  37733. outlineColor: "rgba(255, 255, 255, 1)",
  37734. outlineWidth: 1
  37735. };
  37736. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  37737. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  37738. }
  37739. get straightArrow() {
  37740. return this._straightArrowLast;
  37741. }
  37742. getData() {
  37743. return this._straightArrowData;
  37744. }
  37745. computePosition(data) {
  37746. var $this = this;
  37747. var length = data.length;
  37748. var p1 = data[0];
  37749. var p2 = data[length - 1];
  37750. var firstPoint = $this.cartesianToLatlng(p1);
  37751. var endPoints = $this.cartesianToLatlng(p2);
  37752. var arrow = [];
  37753. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37754. for (var i2 = 0; i2 < res.length; i2++) {
  37755. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37756. arrow.push(cart3);
  37757. }
  37758. $this._straightArrowData = [firstPoint, endPoints];
  37759. return new $this.Cesium.PolygonHierarchy(arrow);
  37760. }
  37761. addload(data) {
  37762. var $this = this;
  37763. if (data.length < 2) {
  37764. return null;
  37765. }
  37766. var length = data.length;
  37767. var p1 = data[0];
  37768. var p2 = data[length - 1];
  37769. var arrow = [];
  37770. var res = $this.fineArrow([p1[0], p1[1]], [p2[0], p2[1]]);
  37771. for (var i2 = 0; i2 < res.length; i2++) {
  37772. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37773. arrow.push(cart3);
  37774. }
  37775. var arrowEntity = $this.viewer.entities.add({
  37776. Type: "DrawStraightArrow",
  37777. Position: data,
  37778. id: data.id || $this.objId,
  37779. polygon: {
  37780. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  37781. show: true,
  37782. fill: true,
  37783. clampToGround: true,
  37784. material: $this.polygonMaterial
  37785. }
  37786. });
  37787. return arrowEntity;
  37788. }
  37789. startCreate(drawType) {
  37790. if (isRuntimeApp()) {
  37791. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37792. }
  37793. var $this = this;
  37794. this.drawType = drawType;
  37795. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  37796. this.handler.setInputAction(function(evt) {
  37797. if (isRuntimeApp()) {
  37798. var cartesian = $this.getCatesian3FromPX(evt.position);
  37799. if (!cartesian) {
  37800. return;
  37801. }
  37802. $this.createPoint(cartesian);
  37803. $this._positions.push(cartesian);
  37804. if ($this._positions.length === 2) {
  37805. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  37806. $this.destroy();
  37807. if (!$this.Cesium.defined($this._straightArrow)) {
  37808. $this._straightArrow = $this.createStraightArrow();
  37809. createOperationMainDom();
  37810. document.getElementById("btnDrawBackout").style.display = "none";
  37811. document.getElementById("btnDrawComplete").onclick = () => {
  37812. $this._straightArrowData = $this._positions.concat();
  37813. $this.viewer.entities.remove($this._straightArrow);
  37814. $this._straightArrow = null;
  37815. $this._positions = [];
  37816. var lnglatArr = [];
  37817. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37818. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37819. lnglatArr.push(lnglat);
  37820. }
  37821. $this._straightArrowData = lnglatArr;
  37822. var straightArrow = $this.addload($this._straightArrowData);
  37823. $this._entities_straightArrow.push(straightArrow);
  37824. $this._straightArrowLast = straightArrow;
  37825. $this.clearPoint();
  37826. $this.destroy();
  37827. let buttonDiv = document.getElementById("drawButtonDiv");
  37828. if (buttonDiv) {
  37829. document.body.removeChild(buttonDiv);
  37830. }
  37831. };
  37832. }
  37833. }
  37834. } else {
  37835. clearTimeout($this._timer);
  37836. $this._timer = setTimeout(function() {
  37837. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  37838. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  37839. if ($this._positions.length == 0) {
  37840. $this._positions.push(cartesian2.clone());
  37841. $this.floatingPoint = $this.createPoint(cartesian2);
  37842. $this._positions.push(cartesian2);
  37843. }
  37844. if (!$this._straightArrow) {
  37845. $this.createPoint(cartesian2);
  37846. } else {
  37847. $this._straightArrowData = $this._positions.concat();
  37848. $this.viewer.entities.remove($this._straightArrow);
  37849. $this._straightArrow = null;
  37850. $this._positions = [];
  37851. $this.floatingPoint.position.setValue(cartesian2);
  37852. var lnglatArr = [];
  37853. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37854. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37855. lnglatArr.push(lnglat);
  37856. }
  37857. $this._straightArrowData = lnglatArr;
  37858. var straightArrow = $this.addload($this._straightArrowData);
  37859. $this._entities_straightArrow.push(straightArrow);
  37860. $this._straightArrowLast = straightArrow;
  37861. $this.clearPoint();
  37862. $this.destroy();
  37863. $this._tooltip.setVisible(false);
  37864. }
  37865. }, 200);
  37866. }
  37867. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37868. this.handler.setInputAction(function(evt) {
  37869. if (isRuntimeApp())
  37870. return;
  37871. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37872. if ($this._positions.length < 2)
  37873. return;
  37874. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  37875. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  37876. if (!$this.Cesium.defined($this._straightArrow)) {
  37877. $this._straightArrow = $this.createStraightArrow();
  37878. }
  37879. $this.floatingPoint.position.setValue(cartesian);
  37880. if ($this._straightArrow) {
  37881. $this._positions.pop();
  37882. $this._positions.push(cartesian);
  37883. }
  37884. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37885. }
  37886. createStraightArrow() {
  37887. var $this = this;
  37888. var arrowEntity = $this.viewer.entities.add({
  37889. polygon: {
  37890. hierarchy: new $this.Cesium.CallbackProperty(
  37891. function() {
  37892. var length = $this._positions.length;
  37893. var p1 = $this._positions[0];
  37894. var p2 = $this._positions[length - 1];
  37895. var firstPoint = $this.cartesianToLatlng(p1);
  37896. var endPoints = $this.cartesianToLatlng(p2);
  37897. var arrow = [];
  37898. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37899. for (var i2 = 0; i2 < res.length; i2++) {
  37900. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37901. arrow.push(cart3);
  37902. }
  37903. return new $this.Cesium.PolygonHierarchy(arrow);
  37904. },
  37905. false
  37906. ),
  37907. show: true,
  37908. fill: true,
  37909. clampToGround: true,
  37910. material: $this.polygonMaterial
  37911. }
  37912. });
  37913. $this._entities_straightArrow.push(arrowEntity);
  37914. return arrowEntity;
  37915. }
  37916. createPoint(cartesian) {
  37917. var $this = this;
  37918. var point2 = this.viewer.entities.add({
  37919. position: cartesian,
  37920. point: {
  37921. pixelSize: 10,
  37922. color: $this.Cesium.Color.RED,
  37923. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  37924. }
  37925. });
  37926. $this._entities_point.push(point2);
  37927. return point2;
  37928. }
  37929. cartesianToLatlng(cartesian) {
  37930. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  37931. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  37932. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  37933. return [lng, lat];
  37934. }
  37935. destroy() {
  37936. if (this.handler) {
  37937. this.handler.destroy();
  37938. this.handler = null;
  37939. }
  37940. }
  37941. clearPoint() {
  37942. this.DrawEndEvent.raiseEvent(this._straightArrowLast, this._straightArrowData, this.drawType);
  37943. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37944. this.viewer.entities.remove(this._entities_point[i2]);
  37945. }
  37946. this._entities_point = [];
  37947. }
  37948. clear() {
  37949. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37950. this.viewer.entities.remove(this._entities_point[i2]);
  37951. }
  37952. for (var i2 = 0; i2 < this._entities_straightArrow.length; i2++) {
  37953. this.viewer.entities.remove(this._entities_straightArrow[i2]);
  37954. }
  37955. this.floatingPoint = null;
  37956. this._straightArrow = null;
  37957. this._straightArrowLast = null;
  37958. this._positions = [];
  37959. this._entities_point = [];
  37960. this._entities_straightArrow = [];
  37961. this._straightArrowData = null;
  37962. }
  37963. getCatesian3FromPX(px) {
  37964. var cartesian;
  37965. var ray = this.viewer.camera.getPickRay(px);
  37966. if (!ray)
  37967. return null;
  37968. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  37969. return cartesian;
  37970. }
  37971. fineArrowDefualParam() {
  37972. return {
  37973. tailWidthFactor: 0.15,
  37974. neckWidthFactor: 0.2,
  37975. headWidthFactor: 0.25,
  37976. headAngle: Math.PI / 8.5,
  37977. neckAngle: Math.PI / 13
  37978. };
  37979. }
  37980. fineArrow(tailPoint, headerPoint) {
  37981. var $this = this;
  37982. if (tailPoint.length < 2 || headerPoint.length < 2)
  37983. return;
  37984. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  37985. let neckWidthFactor = $this.fineArrowDefualParam().neckWidthFactor;
  37986. let headWidthFactor = $this.fineArrowDefualParam().headWidthFactor;
  37987. let headAngle = $this.fineArrowDefualParam().headAngle;
  37988. let neckAngle = $this.fineArrowDefualParam().neckAngle;
  37989. var o = [];
  37990. o[0] = tailPoint;
  37991. o[1] = headerPoint;
  37992. var e = o[0], r2 = o[1], n = $this.getBaseLength(o), g = n * tailWidthFactor, i2 = n * neckWidthFactor, s = n * headWidthFactor, a = $this.getThirdPoint(r2, e, Math.PI / 2, g, true), l = $this.getThirdPoint(r2, e, Math.PI / 2, g, false), u = $this.getThirdPoint(e, r2, headAngle, s, false), c = $this.getThirdPoint(e, r2, headAngle, s, true), p = $this.getThirdPoint(e, r2, neckAngle, i2, false), h2 = $this.getThirdPoint(e, r2, neckAngle, i2, true), d2 = [];
  37993. d2.push(a[0], a[1], p[0], p[1], u[0], u[1], r2[0], r2[1], c[0], c[1], h2[0], h2[1], l[0], l[1], e[0], e[1]);
  37994. return $this.Cesium.Cartesian3.fromDegreesArray(d2);
  37995. }
  37996. getBaseLength(t2) {
  37997. return Math.pow(this.wholeDistance(t2), 0.99);
  37998. }
  37999. wholeDistance(t2) {
  38000. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38001. o += this.distance(t2[e], t2[e + 1]);
  38002. return o;
  38003. }
  38004. distance(t2, o) {
  38005. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38006. }
  38007. getThirdPoint(t2, o, e, r2, n) {
  38008. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38009. return [o[0] + s, o[1] + a];
  38010. }
  38011. getAzimuth(t2, o) {
  38012. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38013. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38014. }
  38015. }
  38016. class DrawAttackArrow {
  38017. constructor(arg) {
  38018. __publicField(this, "getAttackArrowBodyPoints", function(t2, o, e, r2) {
  38019. var $this = this;
  38020. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38021. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38022. l += $this.distance(t2[p - 1], t2[p]);
  38023. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38024. u.push(f), c.push(E2);
  38025. }
  38026. return u.concat(c);
  38027. });
  38028. __publicField(this, "getQBSplinePoints", function(t2) {
  38029. if (t2.length <= 2)
  38030. return t2;
  38031. var o = 2, e = [], r2 = t2.length - o - 1, y = 0;
  38032. e.push(t2[0]);
  38033. for (var n = 0; r2 >= n; n++)
  38034. for (var g = 0; 1 >= g; g += 0.05) {
  38035. for (var i2 = y = 0, s = 0; o >= s; s++) {
  38036. var a = this.getQuadricBSplineFactor(s, g);
  38037. i2 += a * t2[n + s][0], y += a * t2[n + s][1];
  38038. }
  38039. e.push([i2, y]);
  38040. }
  38041. return e.push(t2[t2.length - 1]), e;
  38042. });
  38043. __publicField(this, "getQuadricBSplineFactor", function(t2, o) {
  38044. return 0 == t2 ? Math.pow(o - 1, 2) / 2 : 1 == t2 ? (-2 * Math.pow(o, 2) + 2 * o + 1) / 2 : 2 == t2 ? Math.pow(o, 2) / 2 : 0;
  38045. });
  38046. __publicField(this, "array2Dto1D", function(array) {
  38047. var newArray = [];
  38048. array.forEach(function(elt) {
  38049. newArray.push(elt[0]);
  38050. newArray.push(elt[1]);
  38051. });
  38052. return newArray;
  38053. });
  38054. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  38055. this.viewer = arg.viewer;
  38056. this.Cesium = arg.Cesium;
  38057. this.floatingPoint = null;
  38058. this._AttackArrow = null;
  38059. this._AttackArrowLast = null;
  38060. this._positions = [];
  38061. this._entities_point = [];
  38062. this._entities_AttackArrow = [];
  38063. this._AttackArrowData = null;
  38064. this.DrawStartEvent = new Cesium.Event();
  38065. this.DrawEndEvent = new Cesium.Event();
  38066. this._tooltip = createTooltip(this.viewer.container);
  38067. this._param = {
  38068. id: "DrawStraightArrow",
  38069. polygonColor: "rgba(0,255,0,0.5)",
  38070. outlineColor: "rgba(255, 255, 255, 1)",
  38071. outlineWidth: 1
  38072. };
  38073. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38074. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38075. }
  38076. get AttackArrow() {
  38077. return this._AttackArrowLast;
  38078. }
  38079. getData() {
  38080. return this._AttackArrowData;
  38081. }
  38082. addload(data) {
  38083. var $this = this;
  38084. if (data.length < 3) {
  38085. return null;
  38086. }
  38087. var res = $this.fineArrow(data);
  38088. var returnData = res.polygonalPoint;
  38089. var arrowEntity = $this.viewer.entities.add({
  38090. Type: "DrawAttackArrow",
  38091. Position: data,
  38092. id: data.id || $this.objId,
  38093. polygon: {
  38094. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38095. show: true,
  38096. fill: true,
  38097. clampToGround: true,
  38098. material: $this.polygonMaterial
  38099. }
  38100. });
  38101. return arrowEntity;
  38102. }
  38103. computePosition(data) {
  38104. let $this = this;
  38105. var lnglatArr = [];
  38106. for (var i2 = 0; i2 < data.length; i2++) {
  38107. var lnglat = $this.cartesianToLatlng(data[i2]);
  38108. lnglatArr.push(lnglat);
  38109. }
  38110. $this._AttackArrowData = lnglatArr;
  38111. var res = $this.fineArrow(lnglatArr);
  38112. var returnData = res.polygonalPoint;
  38113. return new $this.Cesium.PolygonHierarchy(returnData);
  38114. }
  38115. startCreate(drawType) {
  38116. if (isRuntimeApp()) {
  38117. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38118. }
  38119. var $this = this;
  38120. this.drawType = drawType;
  38121. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  38122. this.handler.setInputAction(function(evt) {
  38123. if (isRuntimeApp()) {
  38124. var cartesian = $this.getCatesian3FromPX(evt.position);
  38125. if (!cartesian) {
  38126. return;
  38127. }
  38128. $this.createPoint(cartesian);
  38129. $this._positions.push(cartesian);
  38130. if ($this._positions.length <= 2) {
  38131. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38132. } else {
  38133. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38134. if ($this._positions.length === 3) {
  38135. if (!$this.Cesium.defined($this._AttackArrow)) {
  38136. $this._AttackArrow = $this.createAttackArrow();
  38137. createOperationMainDom();
  38138. document.getElementById("btnDrawBackout").style.display = "none";
  38139. document.getElementById("btnDrawComplete").onclick = () => {
  38140. $this._AttackArrowData = $this._positions.concat();
  38141. $this.viewer.entities.remove($this._AttackArrow);
  38142. $this._AttackArrow = null;
  38143. $this._positions = [];
  38144. let lnglatArr = [];
  38145. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38146. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38147. lnglatArr.push(lnglat);
  38148. }
  38149. $this._AttackArrowData = lnglatArr;
  38150. var straightArrow = $this.addload(lnglatArr);
  38151. $this._entities_AttackArrow.push(straightArrow);
  38152. $this._AttackArrowLast = straightArrow;
  38153. $this.clearPoint();
  38154. $this.destroy();
  38155. let buttonDiv = document.getElementById("drawButtonDiv");
  38156. if (buttonDiv) {
  38157. document.body.removeChild(buttonDiv);
  38158. }
  38159. };
  38160. }
  38161. }
  38162. }
  38163. } else {
  38164. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38165. clearTimeout($this._timer);
  38166. $this._timer = setTimeout(function() {
  38167. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38168. if (!cartesian2) {
  38169. return;
  38170. }
  38171. if ($this._positions.length == 0) {
  38172. $this.floatingPoint = $this.createPoint(cartesian2);
  38173. $this.createPoint(cartesian2);
  38174. }
  38175. if ($this._positions.length == 1) {
  38176. $this._positions.push(cartesian2.clone());
  38177. $this.createPoint(cartesian2);
  38178. }
  38179. $this._positions.push(cartesian2);
  38180. }, 200);
  38181. }
  38182. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38183. this.handler.setInputAction(function(evt) {
  38184. if (isRuntimeApp())
  38185. return;
  38186. if ($this._positions.length == 0) {
  38187. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38188. } else {
  38189. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38190. }
  38191. if ($this._positions.length < 3)
  38192. return;
  38193. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38194. if (!$this.Cesium.defined($this._AttackArrow)) {
  38195. $this._AttackArrow = $this.createAttackArrow();
  38196. }
  38197. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38198. if (!cartesian) {
  38199. return;
  38200. }
  38201. $this.floatingPoint.position.setValue(cartesian);
  38202. if ($this._AttackArrow) {
  38203. $this._positions.pop();
  38204. $this._positions.push(cartesian);
  38205. }
  38206. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38207. this.handler.setInputAction(function(evt) {
  38208. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38209. this.handler.setInputAction(function(evt) {
  38210. if (isRuntimeApp())
  38211. return;
  38212. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38213. clearTimeout($this._timer);
  38214. var cartesian = $this.getCatesian3FromPX(evt.position);
  38215. $this._positions.pop();
  38216. $this._positions.push(cartesian);
  38217. $this._AttackArrowData = $this._positions.concat();
  38218. $this.viewer.entities.remove($this._AttackArrow);
  38219. $this._AttackArrow = null;
  38220. $this._positions = [];
  38221. $this.floatingPoint.position.setValue(cartesian);
  38222. let lnglatArr = [];
  38223. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38224. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38225. lnglatArr.push(lnglat);
  38226. }
  38227. $this._AttackArrowData = lnglatArr;
  38228. var straightArrow = $this.addload(lnglatArr);
  38229. $this._entities_AttackArrow.push(straightArrow);
  38230. $this._AttackArrowLast = straightArrow;
  38231. $this.clearPoint();
  38232. $this.destroy();
  38233. $this._tooltip.setVisible(false);
  38234. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38235. }
  38236. createAttackArrow() {
  38237. var $this = this;
  38238. var arrowEntity = $this.viewer.entities.add({
  38239. polygon: {
  38240. hierarchy: new $this.Cesium.CallbackProperty(
  38241. function() {
  38242. var lnglatArr = [];
  38243. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38244. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38245. lnglatArr.push(lnglat);
  38246. }
  38247. var res = $this.fineArrow(lnglatArr);
  38248. var returnData = res.polygonalPoint;
  38249. return new $this.Cesium.PolygonHierarchy(returnData);
  38250. },
  38251. false
  38252. ),
  38253. show: true,
  38254. fill: true,
  38255. clampToGround: true,
  38256. material: $this.polygonMaterial
  38257. }
  38258. });
  38259. $this._entities_AttackArrow.push(arrowEntity);
  38260. return arrowEntity;
  38261. }
  38262. createPoint(cartesian) {
  38263. var $this = this;
  38264. var point2 = this.viewer.entities.add({
  38265. position: cartesian,
  38266. point: {
  38267. pixelSize: 10,
  38268. color: $this.Cesium.Color.RED,
  38269. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38270. }
  38271. });
  38272. point2.objId = this.objId;
  38273. $this._entities_point.push(point2);
  38274. return point2;
  38275. }
  38276. cartesianToLatlng(cartesian) {
  38277. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38278. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38279. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38280. let alt = cartographic.height;
  38281. return [lng, lat, alt];
  38282. }
  38283. destroy() {
  38284. if (this.handler) {
  38285. this.handler.destroy();
  38286. this.handler = null;
  38287. }
  38288. }
  38289. clearPoint() {
  38290. this.DrawEndEvent.raiseEvent(this._AttackArrowLast, this._AttackArrowData, this.drawType);
  38291. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38292. this.viewer.entities.remove(this._entities_point[i2]);
  38293. }
  38294. this._entities_point = [];
  38295. }
  38296. clear() {
  38297. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38298. this.viewer.entities.remove(this._entities_point[i2]);
  38299. }
  38300. for (var i2 = 0; i2 < this._entities_AttackArrow.length; i2++) {
  38301. this.viewer.entities.remove(this._entities_AttackArrow[i2]);
  38302. }
  38303. this.floatingPoint = null;
  38304. this._AttackArrow = null;
  38305. this._AttackArrowLast = null;
  38306. this._positions = [];
  38307. this._entities_point = [];
  38308. this._entities_AttackArrow = [];
  38309. this._AttackArrowData = null;
  38310. }
  38311. getCatesian3FromPX(px) {
  38312. var cartesian;
  38313. var ray = this.viewer.camera.getPickRay(px);
  38314. if (!ray)
  38315. return null;
  38316. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38317. return cartesian;
  38318. }
  38319. fineArrowDefualParam() {
  38320. return {
  38321. headHeightFactor: 0.18,
  38322. headWidthFactor: 0.3,
  38323. neckHeightFactor: 0.85,
  38324. neckWidthFactor: 0.15,
  38325. tailWidthFactor: 0.1,
  38326. headTailFactor: 0.8,
  38327. swallowTailFactor: 1
  38328. };
  38329. }
  38330. fineArrow(inputPoint) {
  38331. var $this = this;
  38332. inputPoint = $this.dereplication(inputPoint);
  38333. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  38334. let swallowTailFactor = $this.fineArrowDefualParam().swallowTailFactor;
  38335. let swallowTailPnt = $this.fineArrowDefualParam().swallowTailPnt;
  38336. var result = {
  38337. controlPoint: null,
  38338. polygonalPoint: null
  38339. };
  38340. result.controlPoint = inputPoint;
  38341. var t2 = inputPoint.length;
  38342. if (!(2 > t2)) {
  38343. if (2 == inputPoint.length) {
  38344. result.polygonalPoint = inputPoint;
  38345. return result;
  38346. }
  38347. var o = inputPoint, e = o[0], r2 = o[1];
  38348. $this.isClockWise(o[0], o[1], o[2]) && (e = o[1], r2 = o[0]);
  38349. var n = $this.mid(e, r2), g = [n].concat(o.slice(2)), i2 = $this.getAttackArrowHeadPoints(g, e, r2, $this.fineArrowDefualParam()), s = i2[0], a = i2[4], l = $this.distance(e, r2), u = $this.getBaseLength(g), c = u * tailWidthFactor * swallowTailFactor;
  38350. swallowTailPnt = $this.getThirdPoint(g[1], g[0], 0, c, true);
  38351. var p = l / u, h2 = $this.getAttackArrowBodyPoints(g, s, a, p), t2 = h2.length, d2 = [e].concat(h2.slice(0, t2 / 2));
  38352. d2.push(s);
  38353. var f = [r2].concat(h2.slice(t2 / 2, t2));
  38354. var newArray = [];
  38355. f.push(a), d2 = $this.getQBSplinePoints(d2), f = $this.getQBSplinePoints(f), newArray = $this.array2Dto1D(d2.concat(i2, f.reverse(), [swallowTailPnt, d2[0]]));
  38356. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38357. }
  38358. return result;
  38359. }
  38360. getArrowBodyPoints(t2, o, e, r2) {
  38361. var $this = this;
  38362. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38363. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38364. l += $this.distance(t2[p - 1], t2[p]);
  38365. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38366. u.push(f), c.push(E2);
  38367. }
  38368. return u.concat(c);
  38369. }
  38370. getAttackArrowHeadPoints(t2, o, e, defaultParam) {
  38371. var $this = this;
  38372. let headHeightFactor = defaultParam.headHeightFactor;
  38373. let headTailFactor = defaultParam.headTailFactor;
  38374. let headWidthFactor = defaultParam.headWidthFactor;
  38375. let neckWidthFactor = defaultParam.neckWidthFactor;
  38376. let neckHeightFactor = defaultParam.neckHeightFactor;
  38377. var r2 = $this.getBaseLength(t2), n = r2 * headHeightFactor, g = t2[t2.length - 1];
  38378. r2 = $this.distance(g, t2[t2.length - 2]);
  38379. var i2 = $this.distance(o, e);
  38380. n > i2 * headTailFactor && (n = i2 * headTailFactor);
  38381. var s = n * headWidthFactor, a = n * neckWidthFactor;
  38382. n = n > r2 ? r2 : n;
  38383. var l = n * neckHeightFactor, u = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), c = $this.getThirdPoint(t2[t2.length - 2], g, 0, l, true), p = $this.getThirdPoint(g, u, Math.PI / 2, s, false), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true), d2 = $this.getThirdPoint(g, c, Math.PI / 2, a, false), f = $this.getThirdPoint(g, c, Math.PI / 2, a, true);
  38384. return [d2, p, g, h2, f];
  38385. }
  38386. getAngleOfThreePoints(t2, o, e) {
  38387. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38388. return 0 > r2 ? r2 + Math.PI * 2 : r2;
  38389. }
  38390. dereplication(array) {
  38391. var last = array[array.length - 1];
  38392. var change = false;
  38393. var newArray = [];
  38394. newArray = array.filter(function(i2) {
  38395. if (i2[0] != last[0] && i2[1] != last[1]) {
  38396. return i2;
  38397. }
  38398. change = true;
  38399. });
  38400. if (change)
  38401. newArray.push(last);
  38402. return newArray;
  38403. }
  38404. getBaseLength(t2) {
  38405. return Math.pow(this.wholeDistance(t2), 0.99);
  38406. }
  38407. wholeDistance(t2) {
  38408. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38409. o += this.distance(t2[e], t2[e + 1]);
  38410. return o;
  38411. }
  38412. distance(t2, o) {
  38413. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38414. }
  38415. getThirdPoint(t2, o, e, r2, n) {
  38416. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38417. return [o[0] + s, o[1] + a];
  38418. }
  38419. getAzimuth(t2, o) {
  38420. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38421. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38422. }
  38423. isClockWise(t2, o, e) {
  38424. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38425. }
  38426. mid(t2, o) {
  38427. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38428. }
  38429. }
  38430. class DrawPincerArrow {
  38431. constructor(arg) {
  38432. this.viewer = arg.viewer;
  38433. this.Cesium = arg.Cesium;
  38434. this.floatingPoint = null;
  38435. this._PincerArrow = null;
  38436. this._PincerArrowLast = null;
  38437. this._positions = [];
  38438. this._entities_point = [];
  38439. this._entities_PincerArrow = [];
  38440. this._PincerArrowData = null;
  38441. this.DrawStartEvent = new Cesium.Event();
  38442. this.DrawEndEvent = new Cesium.Event();
  38443. this._tooltip = createTooltip(this.viewer.container);
  38444. this._param = {
  38445. id: "DrawStraightArrow",
  38446. polygonColor: "rgba(0,255,0,0.5)",
  38447. outlineColor: "rgba(255, 255, 255, 1)",
  38448. outlineWidth: 1
  38449. };
  38450. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38451. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38452. }
  38453. get PincerArrow() {
  38454. return this._PincerArrowLast;
  38455. }
  38456. getData() {
  38457. return this._PincerArrowData;
  38458. }
  38459. addload(data) {
  38460. var $this = this;
  38461. if (data.length < 3) {
  38462. return;
  38463. }
  38464. var res = $this.doubleArrow(data);
  38465. var returnData = res.polygonalPoint;
  38466. var arrowEntity = $this.viewer.entities.add({
  38467. Type: "DrawPincerArrow",
  38468. Position: data,
  38469. id: data.id || $this.objId,
  38470. polygon: {
  38471. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38472. show: true,
  38473. fill: true,
  38474. clampToGround: true,
  38475. material: $this.polygonMaterial
  38476. }
  38477. });
  38478. return arrowEntity;
  38479. }
  38480. computePosition(data) {
  38481. let $this = this;
  38482. var lnglatArr = [];
  38483. for (var i2 = 0; i2 < data.length; i2++) {
  38484. var lnglat = $this.cartesianToLatlng(data[i2]);
  38485. lnglatArr.push(lnglat);
  38486. }
  38487. $this._PincerArrowData = lnglatArr;
  38488. var res = $this.doubleArrow(lnglatArr);
  38489. var returnData = res.polygonalPoint;
  38490. return new $this.Cesium.PolygonHierarchy(returnData);
  38491. }
  38492. startCreate(drawType) {
  38493. if (isRuntimeApp()) {
  38494. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38495. }
  38496. var $this = this;
  38497. this.drawType = drawType;
  38498. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  38499. this.handler.setInputAction(function(evt) {
  38500. if (isRuntimeApp()) {
  38501. var cartesian = $this.getCatesian3FromPX(evt.position);
  38502. if (!cartesian) {
  38503. return;
  38504. }
  38505. $this.createPoint(cartesian);
  38506. $this._positions.push(cartesian);
  38507. if ($this._positions.length < 3 || $this._positions.length === 4) {
  38508. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38509. }
  38510. if ($this._positions.length === 2) {
  38511. if (!$this.Cesium.defined($this._PincerArrow)) {
  38512. $this._PincerArrow = $this.createPincerArrow();
  38513. }
  38514. }
  38515. if ($this._positions.length === 3) {
  38516. $this._positions.pop();
  38517. $this._positions.push(cartesian);
  38518. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38519. createOperationMainDom();
  38520. document.getElementById("btnDrawBackout").style.display = "none";
  38521. document.getElementById("btnDrawComplete").onclick = () => {
  38522. $this._PincerArrowData = $this._positions.concat();
  38523. $this.viewer.entities.remove($this._PincerArrow);
  38524. $this._PincerArrow = null;
  38525. $this._positions = [];
  38526. var lnglatArr = [];
  38527. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38528. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38529. lnglatArr.push(lnglat);
  38530. }
  38531. $this._PincerArrowData = lnglatArr;
  38532. var pincerArrow = $this.addload(lnglatArr);
  38533. $this._entities_PincerArrow.push(pincerArrow);
  38534. $this._PincerArrowLast = pincerArrow;
  38535. $this.clearPoint();
  38536. $this.destroy();
  38537. let buttonDiv = document.getElementById("drawButtonDiv");
  38538. if (buttonDiv) {
  38539. document.body.removeChild(buttonDiv);
  38540. }
  38541. };
  38542. }
  38543. if ($this._positions.length === 5) {
  38544. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38545. $this.destroy();
  38546. }
  38547. } else {
  38548. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38549. clearTimeout($this._timer);
  38550. $this._timer = setTimeout(function() {
  38551. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38552. if (!cartesian2) {
  38553. return;
  38554. }
  38555. if ($this._positions.length == 0) {
  38556. $this.floatingPoint = $this.createPoint(cartesian2);
  38557. }
  38558. if ($this._positions.length < 5) {
  38559. $this._positions.push(cartesian2);
  38560. $this.createPoint(cartesian2);
  38561. }
  38562. if ($this._positions.length == 5) {
  38563. $this._positions[4] = cartesian2;
  38564. $this.floatingPoint.position.setValue(cartesian2);
  38565. }
  38566. }, 200);
  38567. }
  38568. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38569. this.handler.setInputAction(function(evt) {
  38570. if (isRuntimeApp())
  38571. return;
  38572. if ($this._positions.length == 0) {
  38573. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38574. } else {
  38575. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38576. }
  38577. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38578. if (!cartesian)
  38579. return;
  38580. if ($this._positions.length < 2)
  38581. return;
  38582. if (!$this.Cesium.defined($this._PincerArrow)) {
  38583. if ($this._positions.length == 2) {
  38584. $this._positions.push(cartesian);
  38585. }
  38586. $this._PincerArrow = $this.createPincerArrow();
  38587. }
  38588. $this.floatingPoint.position.setValue(cartesian);
  38589. if ($this._positions.length == 3) {
  38590. $this._positions[2] = cartesian;
  38591. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38592. }
  38593. if ($this._positions.length > 3) {
  38594. $this._positions.pop();
  38595. $this._positions.push(cartesian);
  38596. if ($this._positions === 4) {
  38597. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38598. }
  38599. if ($this._positions.length == 5) {
  38600. $this._tooltip.showAt(evt.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38601. }
  38602. }
  38603. console.log($this._positions.length);
  38604. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38605. this.handler.setInputAction(function(evt) {
  38606. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38607. this.handler.setInputAction(function(evt) {
  38608. if (isRuntimeApp())
  38609. return;
  38610. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38611. clearTimeout($this._timer);
  38612. if (!$this._PincerArrow) {
  38613. return;
  38614. }
  38615. var cartesian = $this.getCatesian3FromPX(evt.position);
  38616. if (!cartesian)
  38617. return;
  38618. $this._positions.pop();
  38619. $this._PincerArrowData = $this._positions.concat();
  38620. $this.viewer.entities.remove($this._PincerArrow);
  38621. $this._PincerArrow = null;
  38622. $this._positions = [];
  38623. $this.floatingPoint.position.setValue(cartesian);
  38624. var lnglatArr = [];
  38625. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38626. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38627. lnglatArr.push(lnglat);
  38628. }
  38629. $this._PincerArrowData = lnglatArr;
  38630. var pincerArrow = $this.addload(lnglatArr);
  38631. $this._entities_PincerArrow.push(pincerArrow);
  38632. $this._PincerArrowLast = pincerArrow;
  38633. $this.clearPoint();
  38634. $this.destroy();
  38635. $this._tooltip.setVisible(false);
  38636. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38637. }
  38638. createPincerArrow() {
  38639. var $this = this;
  38640. $this._computeTempPositions();
  38641. var arrowEntity = $this.viewer.entities.add({
  38642. polygon: {
  38643. hierarchy: new $this.Cesium.CallbackProperty(
  38644. function() {
  38645. var lnglatArr = [];
  38646. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38647. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38648. lnglatArr.push(lnglat);
  38649. }
  38650. var res = $this.doubleArrow(lnglatArr);
  38651. var returnData = res.polygonalPoint;
  38652. return new $this.Cesium.PolygonHierarchy(returnData);
  38653. },
  38654. false
  38655. ),
  38656. show: true,
  38657. fill: true,
  38658. clampToGround: true,
  38659. material: $this.polygonMaterial
  38660. }
  38661. });
  38662. $this._entities_PincerArrow.push(arrowEntity);
  38663. return arrowEntity;
  38664. }
  38665. createPoint(cartesian) {
  38666. var $this = this;
  38667. var point2 = this.viewer.entities.add({
  38668. position: cartesian,
  38669. point: {
  38670. pixelSize: 10,
  38671. color: $this.Cesium.Color.RED,
  38672. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38673. }
  38674. });
  38675. $this._entities_point.push(point2);
  38676. return point2;
  38677. }
  38678. cartesianToLatlng(cartesian) {
  38679. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38680. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38681. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38682. let alt = cartographic.height;
  38683. return [lng, lat, alt];
  38684. }
  38685. destroy() {
  38686. if (this.handler) {
  38687. this.handler.destroy();
  38688. this.handler = null;
  38689. }
  38690. }
  38691. clearPoint() {
  38692. this.DrawEndEvent.raiseEvent(this._PincerArrowLast, this._PincerArrowData, this.drawType);
  38693. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38694. this.viewer.entities.remove(this._entities_point[i2]);
  38695. }
  38696. this._entities_point = [];
  38697. }
  38698. clear() {
  38699. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38700. this.viewer.entities.remove(this._entities_point[i2]);
  38701. }
  38702. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  38703. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  38704. }
  38705. this.floatingPoint = null;
  38706. this._PincerArrow = null;
  38707. this._PincerArrowLast = null;
  38708. this._positions = [];
  38709. this._entities_point = [];
  38710. this._entities_PincerArrow = [];
  38711. this._PincerArrowData = null;
  38712. }
  38713. getCatesian3FromPX(px) {
  38714. var cartesian;
  38715. var ray = this.viewer.camera.getPickRay(px);
  38716. if (!ray)
  38717. return null;
  38718. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38719. return cartesian;
  38720. }
  38721. _computeTempPositions() {
  38722. var _this = this;
  38723. var pnts = [].concat(_this._positions);
  38724. var num = pnts.length;
  38725. var first = pnts[0];
  38726. var last = pnts[num - 1];
  38727. if (_this._isSimpleXYZ(first, last) == false) {
  38728. pnts.push(first);
  38729. num += 1;
  38730. }
  38731. _this.tempPositions = [];
  38732. for (var i2 = 1; i2 < num; i2++) {
  38733. var p1 = pnts[i2 - 1];
  38734. var p2 = pnts[i2];
  38735. var cp = _this._computeCenterPotition(p1, p2);
  38736. _this.tempPositions.push(p1);
  38737. _this.tempPositions.push(cp);
  38738. }
  38739. }
  38740. _isSimpleXYZ(p1, p2) {
  38741. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  38742. return true;
  38743. }
  38744. return false;
  38745. }
  38746. _computeCenterPotition(p1, p2) {
  38747. var _this = this;
  38748. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  38749. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  38750. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  38751. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  38752. return cp;
  38753. }
  38754. doubleArrow(inputPoint) {
  38755. var $this = this;
  38756. this.connPoint = null;
  38757. this.tempPoint4 = null;
  38758. this.points = inputPoint;
  38759. var result = {
  38760. controlPoint: null,
  38761. polygonalPoint: null
  38762. };
  38763. var t2 = inputPoint.length;
  38764. if (!(2 > t2)) {
  38765. if (2 == t2)
  38766. return inputPoint;
  38767. var o = this.points[0], e = this.points[1], r2 = this.points[2], t2 = inputPoint.length;
  38768. 3 == t2 ? this.tempPoint4 = $this.getTempPoint4(o, e, r2) : this.tempPoint4 = this.points[3], 3 == t2 || 4 == t2 ? this.connPoint = $this.mid(o, e) : this.connPoint = this.points[4];
  38769. var n, g;
  38770. $this.isClockWise(o, e, r2) ? (n = $this.getArrowPoints(o, this.connPoint, this.tempPoint4, false), g = $this.getArrowPoints(this.connPoint, e, r2, true)) : (n = $this.getArrowPoints(e, this.connPoint, r2, false), g = $this.getArrowPoints(this.connPoint, o, this.tempPoint4, true));
  38771. var i2 = n.length, s = (i2 - 5) / 2, a = n.slice(0, s), l = n.slice(s, s + 5), u = n.slice(s + 5, i2), c = g.slice(0, s), p = g.slice(s, s + 5), h2 = g.slice(s + 5, i2);
  38772. c = $this.getBezierPoints(c);
  38773. var d2 = $this.getBezierPoints(h2.concat(a.slice(1)));
  38774. u = $this.getBezierPoints(u);
  38775. var f = c.concat(p, d2, l, u);
  38776. var newArray = $this.array2Dto1D(f);
  38777. result.controlPoint = [o, e, r2, this.tempPoint4, this.connPoint];
  38778. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38779. }
  38780. return result;
  38781. }
  38782. getTempPoint4(t2, o, e) {
  38783. var $this = this;
  38784. var r2, n, g, i2, s = $this.mid(t2, o), a = $this.distance(s, e), l = $this.getAngleOfThreePoints(t2, s, e);
  38785. return l < Math.PI / 2 ? (n = a * Math.sin(l), g = a * Math.cos(l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : l >= Math.PI / 2 && l < Math.PI ? (n = a * Math.sin(Math.PI - l), g = a * Math.cos(Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)) : l >= Math.PI && l < 1.5 * Math.PI ? (n = a * Math.sin(l - Math.PI), g = a * Math.cos(l - Math.PI), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : (n = a * Math.sin(2 * Math.PI - l), g = a * Math.cos(2 * Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)), r2;
  38786. }
  38787. mid(t2, o) {
  38788. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38789. }
  38790. isClockWise(t2, o, e) {
  38791. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38792. }
  38793. getArrowPoints(t2, o, e, r2) {
  38794. var $this = this;
  38795. var doubleArrowDefualParam = {
  38796. type: "doublearrow",
  38797. headHeightFactor: 0.25,
  38798. headWidthFactor: 0.3,
  38799. neckHeightFactor: 0.85,
  38800. fixPointCount: 4,
  38801. neckWidthFactor: 0.15
  38802. };
  38803. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38804. var n = $this.mid(t2, o), g = $this.distance(n, e), i2 = $this.getThirdPoint(e, n, 0, 0.3 * g, true), s = $this.getThirdPoint(e, n, 0, 0.5 * g, true);
  38805. i2 = $this.getThirdPoint(n, i2, Math.PI / 2, g / 5, r2), s = $this.getThirdPoint(n, s, Math.PI / 2, g / 4, r2);
  38806. var a = [n, i2, s, e], l = $this.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor), u = l[0], c = l[4], p = $this.distance(t2, o) / $this.getBaseLength(a) / 2, h2 = $this.getArrowBodyPoints(a, u, c, p), d2 = h2.length, f = h2.slice(0, d2 / 2), E2 = h2.slice(d2 / 2, d2);
  38807. return f.push(u), E2.push(c), f = f.reverse(), f.push(o), E2 = E2.reverse(), E2.push(t2), f.reverse().concat(l, E2);
  38808. }
  38809. getArrowHeadPoints(t2, o, e) {
  38810. var $this = this;
  38811. var doubleArrowDefualParam = {
  38812. type: "doublearrow",
  38813. headHeightFactor: 0.25,
  38814. headWidthFactor: 0.3,
  38815. neckHeightFactor: 0.85,
  38816. fixPointCount: 4,
  38817. neckWidthFactor: 0.15
  38818. };
  38819. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38820. var r2 = $this.getBaseLength(t2), n = r2 * this.headHeightFactor, g = t2[t2.length - 1], i2 = ($this.distance(o, e), n * this.headWidthFactor), s = n * this.neckWidthFactor, a = n * this.neckHeightFactor, l = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), u = $this.getThirdPoint(t2[t2.length - 2], g, 0, a, true), c = $this.getThirdPoint(g, l, Math.PI / 2, i2, false), p = $this.getThirdPoint(g, l, Math.PI / 2, i2, true), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, false), d2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true);
  38821. return [h2, c, g, p, d2];
  38822. }
  38823. getArrowBodyPoints(t2, o, e, r2) {
  38824. var $this = this;
  38825. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38826. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38827. l += $this.distance(t2[p - 1], t2[p]);
  38828. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38829. u.push(f), c.push(E2);
  38830. }
  38831. return u.concat(c);
  38832. }
  38833. getBezierPoints(t2) {
  38834. if (t2.length <= 2)
  38835. return t2;
  38836. for (var o = [], e = t2.length - 1, r2 = 0; 1 >= r2; r2 += 0.01) {
  38837. for (var n = 0, y = 0, g = 0; e >= g; g++) {
  38838. var i2 = this.getBinomialFactor(e, g), s = Math.pow(r2, g), a = Math.pow(1 - r2, e - g);
  38839. n += i2 * s * a * t2[g][0], y += i2 * s * a * t2[g][1];
  38840. }
  38841. o.push([n, y]);
  38842. }
  38843. return o.push(t2[e]), o;
  38844. }
  38845. getBaseLength(t2) {
  38846. return Math.pow(this.wholeDistance(t2), 0.99);
  38847. }
  38848. wholeDistance(t2) {
  38849. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38850. o += this.distance(t2[e], t2[e + 1]);
  38851. return o;
  38852. }
  38853. getBinomialFactor(t2, o) {
  38854. return this.getFactorial(t2) / (this.getFactorial(o) * this.getFactorial(t2 - o));
  38855. }
  38856. getFactorial(t2) {
  38857. if (1 >= t2)
  38858. return 1;
  38859. if (2 == t2)
  38860. return 2;
  38861. if (3 == t2)
  38862. return 6;
  38863. if (4 == t2)
  38864. return 24;
  38865. if (5 == t2)
  38866. return 120;
  38867. for (var o = 1, e = 1; t2 >= e; e++)
  38868. o *= e;
  38869. return o;
  38870. }
  38871. array2Dto1D(array) {
  38872. var newArray = [];
  38873. array.forEach(function(elt) {
  38874. newArray.push(elt[0]);
  38875. newArray.push(elt[1]);
  38876. });
  38877. return newArray;
  38878. }
  38879. distance(t2, o) {
  38880. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38881. }
  38882. getAngleOfThreePoints(t2, o, e) {
  38883. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38884. return 0 > r2 ? r2 + 2 * Math.PI : r2;
  38885. }
  38886. getAzimuth(t2, o) {
  38887. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38888. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38889. }
  38890. getThirdPoint(t2, o, e, r2, n) {
  38891. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38892. return [o[0] + s, o[1] + a];
  38893. }
  38894. }
  38895. class DrawGatheringPlace {
  38896. constructor(arg) {
  38897. this.viewer = arg.viewer;
  38898. this.Cesium = arg.Cesium;
  38899. this.tt = 0.4;
  38900. this.floatingPoint = null;
  38901. this.drawHandler = null;
  38902. this.gatheringPlace = null;
  38903. this._gatheringPlaceLast = null;
  38904. this._positions = [];
  38905. this._entities_point = [];
  38906. this._entities_PincerArrow = [];
  38907. this._gatheringPlaceData = null;
  38908. this.DrawStartEvent = new Cesium.Event();
  38909. this.DrawEndEvent = new Cesium.Event();
  38910. this._tooltip = createTooltip(this.viewer.container);
  38911. this._param = {
  38912. id: "DrawStraightArrow",
  38913. polygonColor: "rgba(0,255,0,0.5)",
  38914. outlineColor: "rgba(255, 255, 255, 1)",
  38915. outlineWidth: 1
  38916. };
  38917. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38918. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38919. }
  38920. get PincerArrow() {
  38921. return this._gatheringPlaceLast;
  38922. }
  38923. getData() {
  38924. return this._gatheringPlaceData;
  38925. }
  38926. computePosition(data) {
  38927. var $this = this;
  38928. if (data.length < 3) {
  38929. return;
  38930. }
  38931. var gatheringPlace = [];
  38932. var lonLats = [];
  38933. var res = $this.fineGatheringPlace(data);
  38934. for (var i2 = 0; i2 < res.length; i2++) {
  38935. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  38936. gatheringPlace.push(cart3);
  38937. }
  38938. for (let q2 = 0; q2 < data.length; q2++) {
  38939. lonLats.push($this.cartesianToLatlng(data[q2]));
  38940. }
  38941. this._gatheringPlaceData = lonLats;
  38942. return new $this.Cesium.PolygonHierarchy(gatheringPlace);
  38943. }
  38944. addload(data) {
  38945. var $this = this;
  38946. if (data.length < 3) {
  38947. return;
  38948. }
  38949. var gatheringPlace = [];
  38950. var lnglatArr = [];
  38951. for (var i2 = 0; i2 < data.length; i2++) {
  38952. var lnglat = $this.LatlngTocartesian(data[i2]);
  38953. lnglatArr.push(lnglat);
  38954. }
  38955. var res = $this.fineGatheringPlace(lnglatArr);
  38956. for (var i2 = 0; i2 < res.length; i2++) {
  38957. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  38958. gatheringPlace.push(cart3);
  38959. }
  38960. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  38961. var arrowEntity = $this.viewer.entities.add({
  38962. Type: "DrawGatheringPlace",
  38963. Position: data,
  38964. id: data.id || $this.objId,
  38965. polygon: {
  38966. hierarchy: pHierarchy,
  38967. show: true,
  38968. fill: true,
  38969. clampToGround: true,
  38970. material: $this.polygonMaterial
  38971. }
  38972. });
  38973. return arrowEntity;
  38974. }
  38975. startCreate(drawType) {
  38976. if (isRuntimeApp()) {
  38977. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38978. }
  38979. var $this = this;
  38980. this.drawType = drawType;
  38981. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  38982. this.handler.setInputAction(function(event2) {
  38983. if (isRuntimeApp()) {
  38984. var cartesian = $this.getCatesian3FromPX(event2.position);
  38985. if (!cartesian) {
  38986. return;
  38987. }
  38988. $this.createPoint(cartesian);
  38989. $this._positions.push(cartesian);
  38990. if ($this._positions.length < 3) {
  38991. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38992. }
  38993. if ($this._positions.length === 3) {
  38994. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38995. $this.destroy();
  38996. if (!$this.Cesium.defined($this.gatheringPlace)) {
  38997. $this.gatheringPlace = $this.createGatheringPlace();
  38998. createOperationMainDom();
  38999. document.getElementById("btnDrawBackout").style.display = "none";
  39000. document.getElementById("btnDrawComplete").onclick = () => {
  39001. $this._gatheringPlaceData = $this._positions.concat();
  39002. $this.viewer.entities.remove($this.gatheringPlace);
  39003. $this.gatheringPlace = null;
  39004. var lnglatArr = [];
  39005. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  39006. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  39007. lnglatArr.push(lnglat);
  39008. }
  39009. $this._gatheringPlaceData = lnglatArr;
  39010. var pincerArrow = $this.addload(lnglatArr);
  39011. $this._entities_PincerArrow.push(pincerArrow);
  39012. $this._gatheringPlaceLast = pincerArrow;
  39013. $this.viewer.entities.remove($this.floatingPoint);
  39014. $this.floatingPoint = null;
  39015. $this.clearPoint();
  39016. $this.destroy();
  39017. let buttonDiv = document.getElementById("drawButtonDiv");
  39018. if (buttonDiv) {
  39019. document.body.removeChild(buttonDiv);
  39020. }
  39021. };
  39022. }
  39023. }
  39024. } else {
  39025. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39026. clearTimeout($this._timer);
  39027. $this._timer = setTimeout(function() {
  39028. var position2 = event2.position;
  39029. if (!$this.Cesium.defined(position2)) {
  39030. return;
  39031. }
  39032. var ray = $this.viewer.camera.getPickRay(position2);
  39033. if (!$this.Cesium.defined(ray)) {
  39034. return;
  39035. }
  39036. var cartesian2 = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39037. if (!$this.Cesium.defined(cartesian2)) {
  39038. return;
  39039. }
  39040. if ($this._positions.length == 0) {
  39041. $this._positions.push(cartesian2.clone());
  39042. $this.floatingPoint = $this.createPoint(cartesian2);
  39043. }
  39044. if ($this._positions.length <= 2) {
  39045. $this.createPoint(cartesian2);
  39046. $this._positions.push(cartesian2);
  39047. }
  39048. }, 200);
  39049. }
  39050. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39051. this.handler.setInputAction(function(event2) {
  39052. if (isRuntimeApp())
  39053. return;
  39054. if ($this._positions.length == 0) {
  39055. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39056. } else {
  39057. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39058. }
  39059. if ($this._positions.length < 2) {
  39060. return;
  39061. }
  39062. if ($this._positions.length == 3) {
  39063. $this._tooltip.showAt(event2.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39064. }
  39065. var position2 = event2.endPosition;
  39066. if (!$this.Cesium.defined(position2)) {
  39067. return;
  39068. }
  39069. var ray = $this.viewer.camera.getPickRay(position2);
  39070. if (!$this.Cesium.defined(ray)) {
  39071. return;
  39072. }
  39073. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39074. if (!$this.Cesium.defined(cartesian)) {
  39075. return;
  39076. }
  39077. if (!$this.Cesium.defined($this.gatheringPlace)) {
  39078. $this.gatheringPlace = $this.createGatheringPlace();
  39079. }
  39080. $this.floatingPoint.position.setValue(cartesian);
  39081. if ($this.gatheringPlace) {
  39082. if ($this._positions.length == 3) {
  39083. $this._positions[1] = cartesian;
  39084. } else {
  39085. $this._positions.pop();
  39086. $this._positions.push(cartesian);
  39087. }
  39088. }
  39089. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39090. this.handler.setInputAction(function(movement) {
  39091. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39092. this.handler.setInputAction(function(movement) {
  39093. if (isRuntimeApp())
  39094. return;
  39095. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39096. clearTimeout($this._timer);
  39097. if ($this._positions.length >= 3) {
  39098. $this._gatheringPlaceData = $this._positions.concat();
  39099. $this.viewer.entities.remove($this.gatheringPlace);
  39100. $this.gatheringPlace = null;
  39101. var lnglatArr = [];
  39102. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  39103. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  39104. lnglatArr.push(lnglat);
  39105. }
  39106. $this._gatheringPlaceData = lnglatArr;
  39107. var pincerArrow = $this.addload(lnglatArr);
  39108. $this._entities_PincerArrow.push(pincerArrow);
  39109. $this._gatheringPlaceLast = pincerArrow;
  39110. $this.viewer.entities.remove($this.floatingPoint);
  39111. $this.floatingPoint = null;
  39112. $this.clearPoint();
  39113. $this.destroy();
  39114. $this._tooltip.setVisible(false);
  39115. }
  39116. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39117. }
  39118. createGatheringPlace() {
  39119. let $this = this;
  39120. var gatheringPlaceEntity = $this.viewer.entities.add({
  39121. polygon: {
  39122. hierarchy: new $this.Cesium.CallbackProperty(function() {
  39123. if ($this._positions.length < 3) {
  39124. return;
  39125. }
  39126. var gatheringPlace = [];
  39127. var res = $this.fineGatheringPlace($this._positions);
  39128. for (var i2 = 0; i2 < res.length; i2++) {
  39129. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  39130. gatheringPlace.push(cart3);
  39131. }
  39132. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  39133. var lonLats = $this.cartesianToLatlng($this._positions);
  39134. pHierarchy.keyPoints = lonLats;
  39135. return pHierarchy;
  39136. }, false),
  39137. show: true,
  39138. fill: true,
  39139. clampToGround: true,
  39140. material: $this.polygonMaterial
  39141. }
  39142. });
  39143. $this._entities_PincerArrow.push(gatheringPlaceEntity);
  39144. return gatheringPlaceEntity;
  39145. }
  39146. createPoint(cartesian) {
  39147. var $this = this;
  39148. var point2 = this.viewer.entities.add({
  39149. position: cartesian,
  39150. point: {
  39151. pixelSize: 10,
  39152. color: $this.Cesium.Color.RED,
  39153. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39154. }
  39155. });
  39156. $this._entities_point.push(point2);
  39157. return point2;
  39158. }
  39159. cartesianToLatlng(cartesian) {
  39160. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39161. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  39162. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  39163. let alt = cartographic.height;
  39164. return [lng, lat, alt];
  39165. }
  39166. destroy() {
  39167. if (this.handler) {
  39168. this.handler.destroy();
  39169. this.handler = null;
  39170. }
  39171. }
  39172. clearPoint() {
  39173. this.DrawEndEvent.raiseEvent(this._gatheringPlaceLast, this._gatheringPlaceData, this.drawType);
  39174. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39175. this.viewer.entities.remove(this._entities_point[i2]);
  39176. }
  39177. this._entities_point = [];
  39178. }
  39179. clear() {
  39180. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39181. this.viewer.entities.remove(this._entities_point[i2]);
  39182. }
  39183. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  39184. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  39185. }
  39186. this.floatingPoint = null;
  39187. this._PincerArrow = null;
  39188. this._PincerArrowLast = null;
  39189. this._positions = [];
  39190. this._entities_point = [];
  39191. this._entities_PincerArrow = [];
  39192. this._PincerArrowData = null;
  39193. }
  39194. getCatesian3FromPX(px) {
  39195. var cartesian;
  39196. var ray = this.viewer.camera.getPickRay(px);
  39197. if (!ray)
  39198. return null;
  39199. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39200. return cartesian;
  39201. }
  39202. _computeTempPositions() {
  39203. var _this = this;
  39204. var pnts = [].concat(_this._positions);
  39205. var num = pnts.length;
  39206. var first = pnts[0];
  39207. var last = pnts[num - 1];
  39208. if (_this._isSimpleXYZ(first, last) == false) {
  39209. pnts.push(first);
  39210. num += 1;
  39211. }
  39212. _this.tempPositions = [];
  39213. for (var i2 = 1; i2 < num; i2++) {
  39214. var p1 = pnts[i2 - 1];
  39215. var p2 = pnts[i2];
  39216. var cp = _this._computeCenterPotition(p1, p2);
  39217. _this.tempPositions.push(p1);
  39218. _this.tempPositions.push(cp);
  39219. }
  39220. }
  39221. _isSimpleXYZ(p1, p2) {
  39222. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  39223. return true;
  39224. }
  39225. return false;
  39226. }
  39227. _computeCenterPotition(p1, p2) {
  39228. var _this = this;
  39229. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  39230. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  39231. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  39232. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  39233. return cp;
  39234. }
  39235. getLonLat(cartesian) {
  39236. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39237. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  39238. var pos = {
  39239. lon: cartographic.longitude,
  39240. lat: cartographic.latitude,
  39241. alt: cartographic.height
  39242. };
  39243. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  39244. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  39245. return pos;
  39246. }
  39247. LatlngTocartesian(latlng) {
  39248. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39249. return cartesian3;
  39250. }
  39251. fineGatheringPlace(gatherPosition) {
  39252. let $this = this;
  39253. let points2 = gatherPosition.length;
  39254. if (points2 < 2) {
  39255. return false;
  39256. } else {
  39257. let pnts = new Array();
  39258. gatherPosition.forEach(function(item) {
  39259. var posLonLat = $this.getLonLat(item);
  39260. pnts.push([posLonLat.lon, posLonLat.lat]);
  39261. });
  39262. if (pnts.length === 2) {
  39263. let mid2 = $this.mid(pnts[0], pnts[1]);
  39264. let d2 = $this.distance(pnts[0], mid2) / 0.9;
  39265. let pnt = $this.getThirdPoint(pnts[0], mid2, Math.PI / 2, d2, true);
  39266. pnts = [pnts[0], pnt, pnts[1]];
  39267. }
  39268. let mid = $this.mid(pnts[0], pnts[2]);
  39269. pnts.push(mid, pnts[0], pnts[1]);
  39270. let [normals, pnt1, pnt2, pnt3, pList] = [
  39271. [],
  39272. void 0,
  39273. void 0,
  39274. void 0,
  39275. []
  39276. ];
  39277. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39278. pnt1 = pnts[i2];
  39279. pnt2 = pnts[i2 + 1];
  39280. pnt3 = pnts[i2 + 2];
  39281. let normalPoints = $this.getBisectorNormals($this.tt, pnt1, pnt2, pnt3);
  39282. normals = normals.concat(normalPoints);
  39283. }
  39284. let count = normals.length;
  39285. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39286. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39287. pnt1 = pnts[i2];
  39288. pnt2 = pnts[i2 + 1];
  39289. pList = pList.concat(pnt1);
  39290. for (let t2 = 0; t2 <= 100; t2++) {
  39291. let pnt = $this.getCubicValue(t2 / 100, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39292. pList = pList.concat(pnt);
  39293. }
  39294. pList = pList.concat(pnt2);
  39295. }
  39296. return Cesium.Cartesian3.fromDegreesArray(pList);
  39297. }
  39298. }
  39299. mid(t2, o) {
  39300. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  39301. }
  39302. distance(t2, o) {
  39303. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  39304. }
  39305. getThirdPoint(t2, o, e, r2, n) {
  39306. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  39307. return [o[0] + s, o[1] + a];
  39308. }
  39309. getAzimuth(t2, o) {
  39310. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  39311. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  39312. }
  39313. getBisectorNormals(t2, o, e, r2) {
  39314. var n = this.getNormal(o, e, r2), g = Math.sqrt(n[0] * n[0] + n[1] * n[1]), i2 = n[0] / g, s = n[1] / g, a = this.distance(o, e), l = this.distance(e, r2);
  39315. if (g > 1e-4)
  39316. if (this.isClockWise(o, e, r2)) {
  39317. var u = t2 * a, c = e[0] - u * s, p = e[1] + u * i2, h2 = [c, p];
  39318. u = t2 * l, c = e[0] + u * s, p = e[1] - u * i2;
  39319. var d2 = [c, p];
  39320. } else
  39321. u = t2 * a, c = e[0] + u * s, p = e[1] - u * i2, h2 = [c, p], u = t2 * l, c = e[0] - u * s, p = e[1] + u * i2, d2 = [c, p];
  39322. else
  39323. c = e[0] + t2 * (o[0] - e[0]), p = e[1] + t2 * (o[1] - e[1]), h2 = [c, p], c = e[0] + t2 * (r2[0] - e[0]), p = e[1] + t2 * (r2[1] - e[1]), d2 = [c, p];
  39324. return [h2, d2];
  39325. }
  39326. getNormal(t2, o, e) {
  39327. var r2 = t2[0] - o[0], n = t2[1] - o[1], g = Math.sqrt(r2 * r2 + n * n);
  39328. r2 /= g, n /= g;
  39329. var i2 = e[0] - o[0], s = e[1] - o[1], a = Math.sqrt(i2 * i2 + s * s);
  39330. i2 /= a, s /= a;
  39331. var l = r2 + i2, u = n + s;
  39332. return [l, u];
  39333. }
  39334. isClockWise(t2, o, e) {
  39335. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  39336. }
  39337. getCubicValue(t2, o, e, r2, n) {
  39338. t2 = Math.max(Math.min(t2, 1), 0);
  39339. var g = 1 - t2, i2 = t2 * t2, s = i2 * t2, a = g * g, l = a * g, u = l * o[0] + 3 * a * t2 * e[0] + 3 * g * i2 * r2[0] + s * n[0], c = l * o[1] + 3 * a * t2 * e[1] + 3 * g * i2 * r2[1] + s * n[1];
  39340. return [u, c];
  39341. }
  39342. }
  39343. class DrawClosedCurve {
  39344. constructor(arg) {
  39345. this.viewer = arg.viewer;
  39346. this.Cesium = arg.Cesium;
  39347. this.floatingPoint = null;
  39348. this._ClosedCurve = null;
  39349. this._ClosedCurveLast = null;
  39350. this._positions = [];
  39351. this._entities_point = [];
  39352. this._entities_ClosedCurve = [];
  39353. this._ClosedCurveData = null;
  39354. this.ZERO_TOLERANCE = 1e-4;
  39355. this.FITTING_COUNT = 100;
  39356. this.t = 0.3;
  39357. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  39358. this.DrawStartEvent = new Cesium.Event();
  39359. this.DrawEndEvent = new Cesium.Event();
  39360. this._tooltip = createTooltip(this.viewer.container);
  39361. this._param = {
  39362. id: "DrawStraightArrow",
  39363. polygonColor: "rgba(0,255,0,0.5)",
  39364. outlineColor: "rgba(255, 255, 255, 1)",
  39365. outlineWidth: 1
  39366. };
  39367. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39368. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39369. }
  39370. get ClosedCurve() {
  39371. return this._ClosedCurveLast;
  39372. }
  39373. getData() {
  39374. return this._ClosedCurveData;
  39375. }
  39376. computePosition(data) {
  39377. let $this = this;
  39378. if (data.length < 2)
  39379. return;
  39380. let pnts = [];
  39381. for (let p = 0; p < data.length; p++) {
  39382. pnts.push($this.cartesianToLatlng(data[p]));
  39383. }
  39384. this._ClosedCurveData = Array.from(pnts);
  39385. pnts.push(pnts[0], pnts[1]);
  39386. let [normals, pList] = [
  39387. [],
  39388. []
  39389. ];
  39390. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39391. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39392. normals = normals.concat(normalPoints);
  39393. }
  39394. let count = normals.length;
  39395. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39396. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39397. let pnt1 = pnts[i2];
  39398. let pnt2 = pnts[i2 + 1];
  39399. pList.push($this.LatlngTocartesian(pnt1));
  39400. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39401. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39402. pList.push($this.LatlngTocartesian(pnt));
  39403. }
  39404. pList.push($this.LatlngTocartesian(pnt2));
  39405. }
  39406. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(pList);
  39407. return {
  39408. PolygonHierarchy,
  39409. pList
  39410. };
  39411. }
  39412. addload(data) {
  39413. let $this = this;
  39414. if (data.length < 2)
  39415. return;
  39416. let pnts = Array.from(data);
  39417. pnts.push(pnts[0], pnts[1]);
  39418. let [normals, pList] = [
  39419. [],
  39420. []
  39421. ];
  39422. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39423. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39424. normals = normals.concat(normalPoints);
  39425. }
  39426. let count = normals.length;
  39427. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39428. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39429. let pnt1 = pnts[i2];
  39430. let pnt2 = pnts[i2 + 1];
  39431. pList.push($this.LatlngTocartesian(pnt1));
  39432. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39433. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39434. pList.push($this.LatlngTocartesian(pnt));
  39435. }
  39436. pList.push($this.LatlngTocartesian(pnt2));
  39437. }
  39438. console.log(data, pnts);
  39439. var arrowEntity = $this.viewer.entities.add({
  39440. Type: "DrawClosedCurve",
  39441. Position: data,
  39442. id: data.id || $this.objId,
  39443. polygon: {
  39444. hierarchy: new $this.Cesium.PolygonHierarchy(pList),
  39445. show: true,
  39446. fill: true,
  39447. clampToGround: true,
  39448. material: $this.polygonMaterial
  39449. },
  39450. polyline: {
  39451. positions: pList,
  39452. show: true,
  39453. material: new Cesium.PolylineDashMaterialProperty({
  39454. color: Cesium.Color.YELLOW
  39455. }),
  39456. width: 3,
  39457. clampToGround: true
  39458. }
  39459. });
  39460. return arrowEntity;
  39461. }
  39462. startCreate(drawType) {
  39463. if (isRuntimeApp()) {
  39464. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39465. }
  39466. var $this = this;
  39467. this.drawType = drawType;
  39468. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39469. this.handler.setInputAction(function(evt) {
  39470. if (isRuntimeApp()) {
  39471. var cartesian = $this.getCatesian3FromPX(evt.position);
  39472. if (!cartesian) {
  39473. return;
  39474. }
  39475. $this.createPoint(cartesian);
  39476. $this._positions.push(cartesian);
  39477. if ($this._positions.length > 2) {
  39478. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  39479. if ($this._positions.length === 3) {
  39480. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39481. $this._ClosedCurve = $this.createClosedCurve();
  39482. createOperationMainDom();
  39483. document.getElementById("btnDrawBackout").style.display = "none";
  39484. document.getElementById("btnDrawComplete").onclick = () => {
  39485. $this._ClosedCurveData = $this._positions.concat();
  39486. $this.viewer.entities.remove($this._ClosedCurve);
  39487. $this._ClosedCurve = null;
  39488. $this._positions = [];
  39489. var lnglatArr = [];
  39490. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39491. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39492. lnglatArr.push(lnglat);
  39493. }
  39494. $this._ClosedCurveData = lnglatArr;
  39495. var ClosedCurve = $this.addload(lnglatArr);
  39496. $this._entities_ClosedCurve.push(ClosedCurve);
  39497. $this._ClosedCurveLast = ClosedCurve;
  39498. $this.clearPoint();
  39499. $this.destroy();
  39500. let buttonDiv = document.getElementById("drawButtonDiv");
  39501. if (buttonDiv) {
  39502. document.body.removeChild(buttonDiv);
  39503. }
  39504. };
  39505. }
  39506. }
  39507. } else {
  39508. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39509. }
  39510. } else {
  39511. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39512. clearTimeout($this._timer);
  39513. $this._timer = setTimeout(function() {
  39514. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  39515. if ($this._positions.length == 0) {
  39516. $this.floatingPoint = $this.createPoint(cartesian2);
  39517. }
  39518. $this._positions.push(cartesian2);
  39519. $this.createPoint(cartesian2);
  39520. }, 200);
  39521. }
  39522. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39523. this.handler.setInputAction(function(evt) {
  39524. if (isRuntimeApp())
  39525. return;
  39526. if ($this._positions.length == 0) {
  39527. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39528. } else {
  39529. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39530. }
  39531. if ($this._positions.length < 2)
  39532. return;
  39533. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39534. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39535. if ($this._positions.length == 2) {
  39536. $this._positions.push(cartesian);
  39537. }
  39538. $this._positions.pop();
  39539. $this._positions.push(cartesian);
  39540. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39541. $this._ClosedCurve = $this.createClosedCurve();
  39542. }
  39543. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39544. this.handler.setInputAction(function(evt) {
  39545. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39546. this.handler.setInputAction(function(evt) {
  39547. if (isRuntimeApp())
  39548. return;
  39549. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39550. clearTimeout($this._timer);
  39551. if (!$this._ClosedCurve)
  39552. return;
  39553. var cartesian = $this.getCatesian3FromPX(evt.position);
  39554. $this._positions.pop();
  39555. $this._positions.push(cartesian);
  39556. $this._ClosedCurveData = $this._positions.concat();
  39557. $this.viewer.entities.remove($this._ClosedCurve);
  39558. $this._ClosedCurve = null;
  39559. $this._positions = [];
  39560. $this.floatingPoint.position.setValue(cartesian);
  39561. var lnglatArr = [];
  39562. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39563. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39564. lnglatArr.push(lnglat);
  39565. }
  39566. $this._ClosedCurveData = lnglatArr;
  39567. var ClosedCurve = $this.addload(lnglatArr);
  39568. $this._entities_ClosedCurve.push(ClosedCurve);
  39569. $this._ClosedCurveLast = ClosedCurve;
  39570. $this.clearPoint();
  39571. $this.destroy();
  39572. $this._tooltip.setVisible(false);
  39573. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39574. }
  39575. createClosedCurve() {
  39576. var $this = this;
  39577. $this.pLists = "";
  39578. var arrowEntity = $this.viewer.entities.add({
  39579. polygon: {
  39580. hierarchy: new $this.Cesium.CallbackProperty(
  39581. function() {
  39582. if ($this._positions.length < 2)
  39583. return;
  39584. let pnts = [];
  39585. for (let p = 0; p < $this._positions.length; p++) {
  39586. pnts.push($this.cartesianToLatlng($this._positions[p]));
  39587. }
  39588. pnts.push(pnts[0], pnts[1]);
  39589. let [normals, pList] = [
  39590. [],
  39591. []
  39592. ];
  39593. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39594. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39595. normals = normals.concat(normalPoints);
  39596. }
  39597. let count = normals.length;
  39598. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39599. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39600. let pnt1 = pnts[i2];
  39601. let pnt2 = pnts[i2 + 1];
  39602. pList.push($this.LatlngTocartesian(pnt1));
  39603. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39604. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39605. pList.push($this.LatlngTocartesian(pnt));
  39606. }
  39607. pList.push($this.LatlngTocartesian(pnt2));
  39608. }
  39609. $this.pLists = pList;
  39610. return new $this.Cesium.PolygonHierarchy(pList);
  39611. },
  39612. false
  39613. ),
  39614. show: true,
  39615. fill: true,
  39616. clampToGround: true,
  39617. material: $this.polygonMaterial
  39618. },
  39619. polyline: {
  39620. positions: new $this.Cesium.CallbackProperty(
  39621. function() {
  39622. return $this.pLists;
  39623. },
  39624. false
  39625. ),
  39626. show: true,
  39627. material: new Cesium.PolylineDashMaterialProperty({
  39628. color: Cesium.Color.YELLOW
  39629. }),
  39630. width: 3,
  39631. clampToGround: true
  39632. }
  39633. });
  39634. $this._entities_ClosedCurve.push(arrowEntity);
  39635. return arrowEntity;
  39636. }
  39637. createPoint(cartesian) {
  39638. var $this = this;
  39639. var point2 = this.viewer.entities.add({
  39640. position: cartesian,
  39641. point: {
  39642. pixelSize: 10,
  39643. color: $this.Cesium.Color.RED,
  39644. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39645. }
  39646. });
  39647. $this._entities_point.push(point2);
  39648. return point2;
  39649. }
  39650. cartesianToLatlng(cartesian) {
  39651. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39652. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  39653. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  39654. return [lng, lat];
  39655. }
  39656. LatlngTocartesian(latlng) {
  39657. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39658. return cartesian3;
  39659. }
  39660. lonLatToMercator(Latlng) {
  39661. var E2 = Latlng[0];
  39662. var N2 = Latlng[1];
  39663. var x = E2 * 2003750834e-2 / 180;
  39664. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  39665. y = y * 2003750834e-2 / 180;
  39666. return [x, y];
  39667. }
  39668. WebMercator2lonLat(mercator) {
  39669. let x = mercator[0] / 2003750834e-2 * 180;
  39670. let ly = mercator[1] / 2003750834e-2 * 180;
  39671. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  39672. return [x, y];
  39673. }
  39674. destroy() {
  39675. if (this.handler) {
  39676. this.handler.destroy();
  39677. this.handler = null;
  39678. }
  39679. }
  39680. clearPoint() {
  39681. this.DrawEndEvent.raiseEvent(this._ClosedCurveLast, this._ClosedCurveData);
  39682. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39683. this.viewer.entities.remove(this._entities_point[i2]);
  39684. }
  39685. this._entities_point = [];
  39686. }
  39687. clear() {
  39688. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39689. this.viewer.entities.remove(this._entities_point[i2]);
  39690. }
  39691. for (var i2 = 0; i2 < this._entities_ClosedCurve.length; i2++) {
  39692. this.viewer.entities.remove(this._entities_ClosedCurve[i2]);
  39693. }
  39694. this.floatingPoint = null;
  39695. this._ClosedCurve = null;
  39696. this._ClosedCurveLast = null;
  39697. this._positions = [];
  39698. this._entities_point = [];
  39699. this._entities_ClosedCurve = [];
  39700. this._ClosedCurveData = null;
  39701. }
  39702. getCatesian3FromPX(px) {
  39703. var cartesian;
  39704. var ray = this.viewer.camera.getPickRay(px);
  39705. if (!ray)
  39706. return null;
  39707. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39708. return cartesian;
  39709. }
  39710. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  39711. let $this = this;
  39712. let normal = $this.getNormal(pnt1, pnt2, pnt3);
  39713. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  39714. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  39715. let uX = normal[0] / dist;
  39716. let uY = normal[1] / dist;
  39717. let d1 = $this.MathDistance(pnt1, pnt2);
  39718. let d2 = $this.MathDistance(pnt2, pnt3);
  39719. if (dist > $this.ZERO_TOLERANCE) {
  39720. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  39721. dt2 = t2 * d1;
  39722. x = pnt2[0] - dt2 * uY;
  39723. y = pnt2[1] + dt2 * uX;
  39724. bisectorNormalRight = [x, y];
  39725. dt2 = t2 * d2;
  39726. x = pnt2[0] + dt2 * uY;
  39727. y = pnt2[1] - dt2 * uX;
  39728. bisectorNormalLeft = [x, y];
  39729. } else {
  39730. dt2 = t2 * d1;
  39731. x = pnt2[0] + dt2 * uY;
  39732. y = pnt2[1] - dt2 * uX;
  39733. bisectorNormalRight = [x, y];
  39734. dt2 = t2 * d2;
  39735. x = pnt2[0] - dt2 * uY;
  39736. y = pnt2[1] + dt2 * uX;
  39737. bisectorNormalLeft = [x, y];
  39738. }
  39739. } else {
  39740. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  39741. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  39742. bisectorNormalRight = [x, y];
  39743. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  39744. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  39745. bisectorNormalLeft = [x, y];
  39746. }
  39747. return [bisectorNormalRight, bisectorNormalLeft];
  39748. }
  39749. getNormal(pnt1, pnt2, pnt3) {
  39750. let dX1 = pnt1[0] - pnt2[0];
  39751. let dY1 = pnt1[1] - pnt2[1];
  39752. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  39753. dX1 /= d1;
  39754. dY1 /= d1;
  39755. let dX2 = pnt3[0] - pnt2[0];
  39756. let dY2 = pnt3[1] - pnt2[1];
  39757. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  39758. dX2 /= d2;
  39759. dY2 /= d2;
  39760. let uX = dX1 + dX2;
  39761. let uY = dY1 + dY2;
  39762. return [uX, uY];
  39763. }
  39764. MathDistance(pnt1, pnt2) {
  39765. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  39766. }
  39767. isClockWise(pnt1, pnt2, pnt3) {
  39768. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  39769. }
  39770. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  39771. t2 = Math.max(Math.min(t2, 1), 0);
  39772. let [tp, t22] = [1 - t2, t2 * t2];
  39773. let t3 = t22 * t2;
  39774. let tp2 = tp * tp;
  39775. let tp3 = tp2 * tp;
  39776. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  39777. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  39778. return [x, y];
  39779. }
  39780. }
  39781. class DrawSector {
  39782. constructor(arg) {
  39783. this.viewer = arg.viewer;
  39784. this.Cesium = arg.Cesium;
  39785. this.floatingPoint = null;
  39786. this._sector = null;
  39787. this._sectorLast = null;
  39788. this._positions = [];
  39789. this._entities_point = [];
  39790. this._entities_sector = [];
  39791. this._sectorData = null;
  39792. this.DrawStartEvent = new Cesium.Event();
  39793. this.DrawEndEvent = new Cesium.Event();
  39794. this._param = {
  39795. id: "DrawStraightArrow",
  39796. polygonColor: "rgba(0,255,0,0.5)",
  39797. outlineColor: "rgba(255, 255, 255, 1)",
  39798. outlineWidth: 1
  39799. };
  39800. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39801. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39802. }
  39803. get sector() {
  39804. return this._sectorLast;
  39805. }
  39806. getData() {
  39807. return this._sectorData;
  39808. }
  39809. computePosition(data) {
  39810. let $this = this;
  39811. let pnts = data;
  39812. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39813. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39814. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39815. var radius = $this.MathDistance(pnt2, center2);
  39816. var startAngle = $this.getAzimuth(pnt2, center2);
  39817. var endAngle = $this.getAzimuth(pnt3, center2);
  39818. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39819. pList.push(pnts[0], pList[0]);
  39820. let arrow = [];
  39821. for (var i2 = 0; i2 < pList.length; i2++) {
  39822. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39823. arrow.push(cart3);
  39824. }
  39825. var lnglatArr = [];
  39826. for (var d2 = 0; d2 < data.length; d2++) {
  39827. lnglatArr.push($this.cartesianToLatlng(data[d2]));
  39828. }
  39829. $this._sectorData = lnglatArr;
  39830. return new $this.Cesium.PolygonHierarchy(arrow);
  39831. }
  39832. addload(data) {
  39833. var $this = this;
  39834. let pnts = data;
  39835. let center2 = $this.lonLatToMercator(pnts[0]);
  39836. let pnt2 = $this.lonLatToMercator(pnts[1]);
  39837. let pnt3 = $this.lonLatToMercator(pnts[2]);
  39838. var radius = $this.MathDistance(pnt2, center2);
  39839. var startAngle = $this.getAzimuth(pnt2, center2);
  39840. var endAngle = $this.getAzimuth(pnt3, center2);
  39841. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39842. let pntsc = $this.Cesium.Cartesian3.fromDegrees(pnts[0][0], pnts[0][1]);
  39843. pList.push(pntsc, pList[0]);
  39844. let arrow = [];
  39845. for (var i2 = 0; i2 < pList.length; i2++) {
  39846. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39847. arrow.push(cart3);
  39848. }
  39849. var arrowEntity = $this.viewer.entities.add({
  39850. Type: "DrawSector",
  39851. Position: data,
  39852. id: data.id || $this.objId,
  39853. polygon: {
  39854. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  39855. show: true,
  39856. fill: true,
  39857. clampToGround: true,
  39858. material: $this.Cesium.Color.AQUA.withAlpha(0.9)
  39859. }
  39860. });
  39861. return arrowEntity;
  39862. }
  39863. startCreate() {
  39864. var $this = this;
  39865. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39866. this.handler.setInputAction(function(evt) {
  39867. var cartesian = $this.getCatesian3FromPX(evt.position);
  39868. if ($this._positions.length < 3) {
  39869. $this.floatingPoint = $this.createPoint(cartesian);
  39870. $this._positions.push(cartesian);
  39871. }
  39872. if (!$this._sector)
  39873. ;
  39874. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39875. this.handler.setInputAction(function(evt) {
  39876. if ($this._positions.length < 2)
  39877. return;
  39878. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39879. if ($this._positions.length == 2) {
  39880. $this._positions.push(cartesian);
  39881. }
  39882. if ($this._positions.length == 3) {
  39883. $this._positions.pop();
  39884. $this._positions.push(cartesian);
  39885. if (!$this.Cesium.defined($this._sector)) {
  39886. $this._sector = $this.createsector();
  39887. }
  39888. }
  39889. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39890. this.handler.setInputAction(function(evt) {
  39891. if (!$this._sector)
  39892. return;
  39893. var cartesian = $this.getCatesian3FromPX(evt.position);
  39894. $this._positions.pop();
  39895. $this._positions.push(cartesian);
  39896. $this._sectorData = $this._positions.concat();
  39897. $this.viewer.entities.remove($this._sector);
  39898. $this._sector = null;
  39899. $this._positions = [];
  39900. $this.floatingPoint.position.setValue(cartesian);
  39901. var lnglatArr = [];
  39902. for (var i2 = 0; i2 < $this._sectorData.length; i2++) {
  39903. var lnglat = $this.cartesianToLatlng($this._sectorData[i2]);
  39904. lnglatArr.push(lnglat);
  39905. }
  39906. $this._sectorData = lnglatArr;
  39907. var sector = $this.addload(lnglatArr);
  39908. $this._entities_sector.push(sector);
  39909. $this._sectorLast = sector;
  39910. $this.clearPoint();
  39911. $this.destroy();
  39912. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39913. }
  39914. createsector() {
  39915. var $this = this;
  39916. var arrowEntity = $this.viewer.entities.add(
  39917. {
  39918. polygon: {
  39919. hierarchy: new $this.Cesium.CallbackProperty(
  39920. function() {
  39921. let pnts = $this._positions;
  39922. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39923. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39924. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39925. var radius = $this.MathDistance(pnt2, center2);
  39926. var startAngle = $this.getAzimuth(pnt2, center2);
  39927. var endAngle = $this.getAzimuth(pnt3, center2);
  39928. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39929. pList.push(pnts[0], pList[0]);
  39930. for (var i2 = 0; i2 < pList.length; i2++) {
  39931. new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39932. }
  39933. return new $this.Cesium.PolygonHierarchy(pList);
  39934. },
  39935. false
  39936. ),
  39937. show: true,
  39938. fill: true,
  39939. clampToGround: true,
  39940. material: $this.Cesium.Color.AQUA.withAlpha(0.5)
  39941. }
  39942. }
  39943. );
  39944. $this._entities_sector.push(arrowEntity);
  39945. return arrowEntity;
  39946. }
  39947. createPoint(cartesian) {
  39948. var $this = this;
  39949. var point2 = this.viewer.entities.add({
  39950. position: cartesian,
  39951. point: {
  39952. pixelSize: 10,
  39953. color: $this.Cesium.Color.RED,
  39954. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39955. }
  39956. });
  39957. $this._entities_point.push(point2);
  39958. return point2;
  39959. }
  39960. cartesianToLatlng(cartesian) {
  39961. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39962. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  39963. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  39964. return [lng, lat];
  39965. }
  39966. lonLatToMercator(Latlng) {
  39967. var E2 = Latlng[0];
  39968. var N2 = Latlng[1];
  39969. var x = E2 * 2003750834e-2 / 180;
  39970. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  39971. y = y * 2003750834e-2 / 180;
  39972. return [x, y];
  39973. }
  39974. WebMercator2lonLat(mercator) {
  39975. let x = mercator[0] / 2003750834e-2 * 180;
  39976. let ly = mercator[1] / 2003750834e-2 * 180;
  39977. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  39978. return [x, y];
  39979. }
  39980. destroy() {
  39981. if (this.handler) {
  39982. this.handler.destroy();
  39983. this.handler = null;
  39984. }
  39985. }
  39986. clearPoint() {
  39987. this.DrawEndEvent.raiseEvent(this._sectorLast, this._sectorData);
  39988. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39989. this.viewer.entities.remove(this._entities_point[i2]);
  39990. }
  39991. this._entities_point = [];
  39992. }
  39993. clear() {
  39994. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39995. this.viewer.entities.remove(this._entities_point[i2]);
  39996. }
  39997. for (var i2 = 0; i2 < this._entities_sector.length; i2++) {
  39998. this.viewer.entities.remove(this._entities_sector[i2]);
  39999. }
  40000. this.floatingPoint = null;
  40001. this._sector = null;
  40002. this._sectorLast = null;
  40003. this._positions = [];
  40004. this._entities_point = [];
  40005. this._entities_sector = [];
  40006. this._sectorData = null;
  40007. }
  40008. getCatesian3FromPX(px) {
  40009. var cartesian;
  40010. var ray = this.viewer.camera.getPickRay(px);
  40011. if (!ray)
  40012. return null;
  40013. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40014. return cartesian;
  40015. }
  40016. MathDistance(pnt1, pnt2) {
  40017. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40018. }
  40019. getAzimuth(startPoint, endPoint) {
  40020. var azimuth;
  40021. var angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40022. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40023. azimuth = angle + Math.PI;
  40024. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40025. azimuth = Math.PI * 2 - angle;
  40026. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40027. azimuth = angle;
  40028. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40029. azimuth = Math.PI - angle;
  40030. }
  40031. return azimuth;
  40032. }
  40033. getArcPoints(center2, radius, startAngle, endAngle) {
  40034. var x = null, y = null, pnts = [], angleDiff = endAngle - startAngle;
  40035. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40036. for (var i2 = 0; i2 <= 100; i2++) {
  40037. var angle = startAngle + angleDiff * i2 / 100;
  40038. x = center2[0] + radius * Math.cos(angle);
  40039. y = center2[1] + radius * Math.sin(angle);
  40040. let latlon = this.WebMercator2lonLat([x, y]);
  40041. pnts.push(this.Cesium.Cartesian3.fromDegrees(latlon[0], latlon[1]));
  40042. }
  40043. return pnts;
  40044. }
  40045. }
  40046. class DrawBowLine {
  40047. constructor(arg) {
  40048. this.viewer = arg.viewer;
  40049. this.Cesium = arg.Cesium;
  40050. this.tt = 0.4;
  40051. this.floatingPoint = null;
  40052. this.drawHandler = null;
  40053. this.DrawBowLine = null;
  40054. this._DrawBowLineLast = null;
  40055. this._positions = [];
  40056. this._entities_point = [];
  40057. this._entities_PincerArrow = [];
  40058. this._DrawBowLineData = null;
  40059. this.DrawStartEvent = new Cesium.Event();
  40060. this.DrawEndEvent = new Cesium.Event();
  40061. this._param = {
  40062. id: "DrawStraightArrow",
  40063. polygonColor: "rgba(0,255,0,0.5)",
  40064. outlineColor: "rgba(255, 255, 255, 1)",
  40065. outlineWidth: 1
  40066. };
  40067. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40068. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40069. }
  40070. get PincerArrow() {
  40071. return this._DrawBowLineLast;
  40072. }
  40073. getData() {
  40074. return this._DrawBowLineData;
  40075. }
  40076. computePosition(data) {
  40077. var $this = this;
  40078. if (data.length < 3) {
  40079. return;
  40080. }
  40081. var DrawBowLine2 = [];
  40082. let positions = [];
  40083. for (var i2 = 0; i2 < data.length; i2++) {
  40084. positions.push($this.cartesianToLatlng(data[i2]));
  40085. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40086. DrawBowLine2.push(cart3);
  40087. }
  40088. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40089. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40090. let radius = $this.MathDistance(pnt1, center2);
  40091. let angle1 = $this.getAzimuth(pnt1, center2);
  40092. let angle2 = $this.getAzimuth(pnt2, center2);
  40093. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40094. startAngle = angle2;
  40095. endAngle = angle1;
  40096. } else {
  40097. startAngle = angle1;
  40098. endAngle = angle2;
  40099. }
  40100. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40101. let pHierarchy = [];
  40102. for (var l = 0; l < getArcPoint.length; l++) {
  40103. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40104. pHierarchy.push(cart3);
  40105. }
  40106. $this._DrawBowLineData = positions;
  40107. return pHierarchy;
  40108. }
  40109. addload(data) {
  40110. var $this = this;
  40111. if (data.length < 3) {
  40112. return;
  40113. }
  40114. var DrawBowLine2 = [];
  40115. for (var i2 = 0; i2 < data.length; i2++) {
  40116. var cart3 = $this.lonLatToMercator(data[i2]);
  40117. DrawBowLine2.push(cart3);
  40118. }
  40119. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40120. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40121. let radius = $this.MathDistance(pnt1, center2);
  40122. let angle1 = $this.getAzimuth(pnt1, center2);
  40123. let angle2 = $this.getAzimuth(pnt2, center2);
  40124. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40125. startAngle = angle2;
  40126. endAngle = angle1;
  40127. } else {
  40128. startAngle = angle1;
  40129. endAngle = angle2;
  40130. }
  40131. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40132. let pHierarchy = [];
  40133. for (var l = 0; l < getArcPoint.length; l++) {
  40134. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40135. pHierarchy.push(cart3);
  40136. }
  40137. var arrowEntity = $this.viewer.entities.add({
  40138. Type: "DrawBowLine",
  40139. Position: data,
  40140. id: data.id || $this.objId,
  40141. polyline: {
  40142. positions: pHierarchy,
  40143. show: true,
  40144. material: $this.Cesium.Color.YELLOW,
  40145. width: 3,
  40146. clampToGround: true
  40147. }
  40148. });
  40149. return arrowEntity;
  40150. }
  40151. startCreate(drawType) {
  40152. this.drawType = drawType;
  40153. var $this = this;
  40154. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40155. this.handler.setInputAction(function(event2) {
  40156. var position2 = event2.position;
  40157. if (!$this.Cesium.defined(position2)) {
  40158. return;
  40159. }
  40160. var ray = $this.viewer.camera.getPickRay(position2);
  40161. if (!$this.Cesium.defined(ray)) {
  40162. return;
  40163. }
  40164. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40165. if (!$this.Cesium.defined(cartesian)) {
  40166. return;
  40167. }
  40168. if ($this._positions.length == 0) {
  40169. $this._positions.push(cartesian.clone());
  40170. $this.floatingPoint = $this.createPoint(cartesian);
  40171. }
  40172. if ($this._positions.length <= 2) {
  40173. $this.createPoint(cartesian);
  40174. $this._positions.push(cartesian);
  40175. }
  40176. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40177. this.handler.setInputAction(function(event2) {
  40178. if ($this._positions.length < 2) {
  40179. return;
  40180. }
  40181. var position2 = event2.endPosition;
  40182. if (!$this.Cesium.defined(position2)) {
  40183. return;
  40184. }
  40185. var ray = $this.viewer.camera.getPickRay(position2);
  40186. if (!$this.Cesium.defined(ray)) {
  40187. return;
  40188. }
  40189. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40190. if (!$this.Cesium.defined(cartesian)) {
  40191. return;
  40192. }
  40193. if (!$this.Cesium.defined($this.DrawBowLine)) {
  40194. $this.DrawBowLine = $this.createDrawBowLine();
  40195. }
  40196. $this.floatingPoint.position.setValue(cartesian);
  40197. if ($this.DrawBowLine) {
  40198. if ($this._positions.length == 3) {
  40199. $this._positions[1] = cartesian;
  40200. } else {
  40201. $this._positions.pop();
  40202. $this._positions.push(cartesian);
  40203. }
  40204. }
  40205. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40206. this.handler.setInputAction(function(movement) {
  40207. if ($this._positions.length >= 3) {
  40208. $this._DrawBowLineData = $this._positions.concat();
  40209. $this.viewer.entities.remove($this.DrawBowLine);
  40210. $this.DrawBowLine = null;
  40211. var lnglatArr = [];
  40212. for (var i2 = 0; i2 < $this._DrawBowLineData.length; i2++) {
  40213. var lnglat = $this.cartesianToLatlng($this._DrawBowLineData[i2]);
  40214. lnglatArr.push(lnglat);
  40215. }
  40216. $this._DrawBowLineData = lnglatArr;
  40217. var pincerArrow = $this.addload(lnglatArr);
  40218. $this._entities_PincerArrow.push(pincerArrow);
  40219. $this._DrawBowLineLast = pincerArrow;
  40220. $this.viewer.entities.remove($this.floatingPoint);
  40221. $this.floatingPoint = null;
  40222. $this.clearPoint();
  40223. $this.destroy();
  40224. }
  40225. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40226. }
  40227. createDrawBowLine() {
  40228. let $this = this;
  40229. var DrawBowLineEntity = $this.viewer.entities.add({
  40230. polyline: {
  40231. positions: new $this.Cesium.CallbackProperty(function() {
  40232. if ($this._positions.length < 3) {
  40233. return;
  40234. }
  40235. var DrawBowLine2 = [];
  40236. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40237. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40238. DrawBowLine2.push(cart3);
  40239. }
  40240. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40241. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40242. let radius = $this.MathDistance(pnt1, center2);
  40243. let angle1 = $this.getAzimuth(pnt1, center2);
  40244. let angle2 = $this.getAzimuth(pnt2, center2);
  40245. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40246. startAngle = angle2;
  40247. endAngle = angle1;
  40248. } else {
  40249. startAngle = angle1;
  40250. endAngle = angle2;
  40251. }
  40252. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40253. let pHierarchy = [];
  40254. for (var l = 0; l < getArcPoint.length; l++) {
  40255. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40256. pHierarchy.push(cart3);
  40257. }
  40258. return pHierarchy;
  40259. }, false),
  40260. show: true,
  40261. material: $this.Cesium.Color.YELLOW,
  40262. width: 3,
  40263. clampToGround: true
  40264. }
  40265. });
  40266. $this._entities_PincerArrow.push(DrawBowLineEntity);
  40267. return DrawBowLineEntity;
  40268. }
  40269. createPoint(cartesian) {
  40270. var $this = this;
  40271. var point2 = this.viewer.entities.add({
  40272. position: cartesian,
  40273. point: {
  40274. pixelSize: 10,
  40275. color: $this.Cesium.Color.RED,
  40276. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40277. }
  40278. });
  40279. $this._entities_point.push(point2);
  40280. return point2;
  40281. }
  40282. cartesianToLatlng(cartesian) {
  40283. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40284. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40285. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40286. cartographic.height;
  40287. return [lng, lat];
  40288. }
  40289. destroy() {
  40290. if (this.handler) {
  40291. this.handler.destroy();
  40292. this.handler = null;
  40293. }
  40294. }
  40295. clearPoint() {
  40296. this.DrawEndEvent.raiseEvent(this._DrawBowLineLast, this._DrawBowLineData, this.drawType);
  40297. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40298. this.viewer.entities.remove(this._entities_point[i2]);
  40299. }
  40300. this._entities_point = [];
  40301. }
  40302. clear() {
  40303. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40304. this.viewer.entities.remove(this._entities_point[i2]);
  40305. }
  40306. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40307. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40308. }
  40309. this.floatingPoint = null;
  40310. this._PincerArrow = null;
  40311. this._PincerArrowLast = null;
  40312. this._positions = [];
  40313. this._entities_point = [];
  40314. this._entities_PincerArrow = [];
  40315. this._PincerArrowData = null;
  40316. }
  40317. getCatesian3FromPX(px) {
  40318. var cartesian;
  40319. var ray = this.viewer.camera.getPickRay(px);
  40320. if (!ray)
  40321. return null;
  40322. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40323. return cartesian;
  40324. }
  40325. _computeTempPositions() {
  40326. var _this = this;
  40327. var pnts = [].concat(_this._positions);
  40328. var num = pnts.length;
  40329. var first = pnts[0];
  40330. var last = pnts[num - 1];
  40331. if (_this._isSimpleXYZ(first, last) == false) {
  40332. pnts.push(first);
  40333. num += 1;
  40334. }
  40335. _this.tempPositions = [];
  40336. for (var i2 = 1; i2 < num; i2++) {
  40337. var p1 = pnts[i2 - 1];
  40338. var p2 = pnts[i2];
  40339. var cp = _this._computeCenterPotition(p1, p2);
  40340. _this.tempPositions.push(p1);
  40341. _this.tempPositions.push(cp);
  40342. }
  40343. }
  40344. _isSimpleXYZ(p1, p2) {
  40345. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40346. return true;
  40347. }
  40348. return false;
  40349. }
  40350. _computeCenterPotition(p1, p2) {
  40351. var _this = this;
  40352. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40353. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40354. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40355. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40356. return cp;
  40357. }
  40358. getLonLat(cartesian) {
  40359. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40360. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40361. var pos = {
  40362. lon: cartographic.longitude,
  40363. lat: cartographic.latitude,
  40364. alt: cartographic.height
  40365. };
  40366. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40367. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40368. return pos;
  40369. }
  40370. LatlngTocartesian(latlng) {
  40371. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40372. return cartesian3;
  40373. }
  40374. lonLatToMercator(Latlng) {
  40375. var E2 = Latlng[0];
  40376. var N2 = Latlng[1];
  40377. var x = E2 * 2003750834e-2 / 180;
  40378. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40379. y = y * 2003750834e-2 / 180;
  40380. return [x, y];
  40381. }
  40382. WebMercator2lonLat(mercator) {
  40383. let x = mercator[0] / 2003750834e-2 * 180;
  40384. let ly = mercator[1] / 2003750834e-2 * 180;
  40385. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40386. return [x, y];
  40387. }
  40388. getCircleCenterOfThreePoints(point1, point2, point3) {
  40389. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40390. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40391. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40392. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40393. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40394. }
  40395. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40396. if (pntA[1] === pntB[1]) {
  40397. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40398. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40399. let y2 = pntA[1];
  40400. return [x2, y2];
  40401. }
  40402. if (pntC[1] === pntD[1]) {
  40403. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40404. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40405. let y2 = pntC[1];
  40406. return [x2, y2];
  40407. }
  40408. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40409. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40410. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40411. let x = e * y - e * pntA[1] + pntA[0];
  40412. return [x, y];
  40413. }
  40414. MathDistance(pnt1, pnt2) {
  40415. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40416. }
  40417. getAzimuth(startPoint, endPoint) {
  40418. let azimuth;
  40419. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40420. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40421. azimuth = angle + Math.PI;
  40422. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40423. azimuth = Math.PI * 2 - angle;
  40424. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40425. azimuth = angle;
  40426. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40427. azimuth = Math.PI - angle;
  40428. }
  40429. return azimuth;
  40430. }
  40431. isClockWise(pnt1, pnt2, pnt3) {
  40432. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40433. }
  40434. getArcPoints(center2, radius, startAngle, endAngle) {
  40435. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40436. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40437. for (let i2 = 0; i2 <= 100; i2++) {
  40438. let angle = startAngle + angleDiff * i2 / 100;
  40439. x = center2[0] + radius * Math.cos(angle);
  40440. y = center2[1] + radius * Math.sin(angle);
  40441. pnts.push([x, y]);
  40442. }
  40443. return pnts;
  40444. }
  40445. }
  40446. class DrawBowPlane {
  40447. constructor(arg) {
  40448. this.viewer = arg.viewer;
  40449. this.Cesium = arg.Cesium;
  40450. this.tt = 0.4;
  40451. this.floatingPoint = null;
  40452. this.drawHandler = null;
  40453. this.DrawBowPlane = null;
  40454. this._DrawBowPlaneLast = null;
  40455. this._positions = [];
  40456. this._entities_point = [];
  40457. this._entities_PincerArrow = [];
  40458. this._DrawBowPlaneData = null;
  40459. this.DrawStartEvent = new Cesium.Event();
  40460. this.DrawEndEvent = new Cesium.Event();
  40461. this._param = {
  40462. id: "DrawStraightArrow",
  40463. polygonColor: "rgba(0,255,0,0.5)",
  40464. outlineColor: "rgba(255, 255, 255, 1)",
  40465. outlineWidth: 1
  40466. };
  40467. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40468. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40469. }
  40470. get PincerArrow() {
  40471. return this._DrawBowPlaneLast;
  40472. }
  40473. getData() {
  40474. return this._DrawBowPlaneData;
  40475. }
  40476. computePosition(data) {
  40477. var $this = this;
  40478. if (data.length < 3) {
  40479. return;
  40480. }
  40481. var DrawBowPlane2 = [];
  40482. let positions = [];
  40483. for (var i2 = 0; i2 < data.length; i2++) {
  40484. positions.push($this.cartesianToLatlng(data[i2]));
  40485. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40486. DrawBowPlane2.push(cart3);
  40487. }
  40488. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40489. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40490. let radius = $this.MathDistance(pnt1, center2);
  40491. let angle1 = $this.getAzimuth(pnt1, center2);
  40492. let angle2 = $this.getAzimuth(pnt2, center2);
  40493. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40494. startAngle = angle2;
  40495. endAngle = angle1;
  40496. } else {
  40497. startAngle = angle1;
  40498. endAngle = angle2;
  40499. }
  40500. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40501. let pHierarchy = [];
  40502. for (var l = 0; l < getArcPoint.length; l++) {
  40503. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40504. pHierarchy.push(cart3);
  40505. }
  40506. pHierarchy.push(pHierarchy[0]);
  40507. $this._DrawBowPlaneData = positions;
  40508. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40509. }
  40510. addload(data) {
  40511. var $this = this;
  40512. if (data.length < 3) {
  40513. return;
  40514. }
  40515. var DrawBowPlane2 = [];
  40516. for (var i2 = 0; i2 < data.length; i2++) {
  40517. var cart3 = $this.lonLatToMercator(data[i2]);
  40518. DrawBowPlane2.push(cart3);
  40519. }
  40520. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40521. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40522. let radius = $this.MathDistance(pnt1, center2);
  40523. let angle1 = $this.getAzimuth(pnt1, center2);
  40524. let angle2 = $this.getAzimuth(pnt2, center2);
  40525. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40526. startAngle = angle2;
  40527. endAngle = angle1;
  40528. } else {
  40529. startAngle = angle1;
  40530. endAngle = angle2;
  40531. }
  40532. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40533. let pHierarchy = [];
  40534. for (var l = 0; l < getArcPoint.length; l++) {
  40535. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40536. pHierarchy.push(cart3);
  40537. }
  40538. pHierarchy.push(pHierarchy[0]);
  40539. var arrowEntity = $this.viewer.entities.add(
  40540. {
  40541. Type: "DrawBowPlane",
  40542. Position: data,
  40543. id: data.id || $this.objId,
  40544. polygon: {
  40545. hierarchy: new $this.Cesium.PolygonHierarchy(pHierarchy),
  40546. show: true,
  40547. material: $this.Cesium.Color.YELLOW,
  40548. width: 3,
  40549. clampToGround: true,
  40550. outlineWidth: 3,
  40551. outline: true,
  40552. outlineColor: Cesium.Color.MAGENTA
  40553. }
  40554. }
  40555. );
  40556. return arrowEntity;
  40557. }
  40558. startCreate(drawType) {
  40559. this.drawType = drawType;
  40560. var $this = this;
  40561. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40562. this.handler.setInputAction(function(event2) {
  40563. var position2 = event2.position;
  40564. if (!$this.Cesium.defined(position2)) {
  40565. return;
  40566. }
  40567. var ray = $this.viewer.camera.getPickRay(position2);
  40568. if (!$this.Cesium.defined(ray)) {
  40569. return;
  40570. }
  40571. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40572. if (!$this.Cesium.defined(cartesian)) {
  40573. return;
  40574. }
  40575. if ($this._positions.length == 0) {
  40576. $this._positions.push(cartesian.clone());
  40577. $this.floatingPoint = $this.createPoint(cartesian);
  40578. }
  40579. if ($this._positions.length <= 2) {
  40580. $this.createPoint(cartesian);
  40581. $this._positions.push(cartesian);
  40582. }
  40583. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40584. this.handler.setInputAction(function(event2) {
  40585. if ($this._positions.length < 2) {
  40586. return;
  40587. }
  40588. var position2 = event2.endPosition;
  40589. if (!$this.Cesium.defined(position2)) {
  40590. return;
  40591. }
  40592. var ray = $this.viewer.camera.getPickRay(position2);
  40593. if (!$this.Cesium.defined(ray)) {
  40594. return;
  40595. }
  40596. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40597. if (!$this.Cesium.defined(cartesian)) {
  40598. return;
  40599. }
  40600. if (!$this.Cesium.defined($this.DrawBowPlane)) {
  40601. $this.DrawBowPlane = $this.createDrawBowPlane();
  40602. }
  40603. $this.floatingPoint.position.setValue(cartesian);
  40604. if ($this.DrawBowPlane) {
  40605. if ($this._positions.length == 3) {
  40606. $this._positions[1] = cartesian;
  40607. } else {
  40608. $this._positions.pop();
  40609. $this._positions.push(cartesian);
  40610. }
  40611. }
  40612. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40613. this.handler.setInputAction(function(movement) {
  40614. if ($this._positions.length >= 3) {
  40615. $this._DrawBowPlaneData = $this._positions.concat();
  40616. $this.viewer.entities.remove($this.DrawBowPlane);
  40617. $this.DrawBowPlane = null;
  40618. var lnglatArr = [];
  40619. for (var i2 = 0; i2 < $this._DrawBowPlaneData.length; i2++) {
  40620. var lnglat = $this.cartesianToLatlng($this._DrawBowPlaneData[i2]);
  40621. lnglatArr.push(lnglat);
  40622. }
  40623. $this._DrawBowPlaneData = lnglatArr;
  40624. var pincerArrow = $this.addload(lnglatArr);
  40625. $this._entities_PincerArrow.push(pincerArrow);
  40626. $this._DrawBowPlaneLast = pincerArrow;
  40627. $this.viewer.entities.remove($this.floatingPoint);
  40628. $this.floatingPoint = null;
  40629. $this.clearPoint();
  40630. $this.destroy();
  40631. }
  40632. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40633. }
  40634. createDrawBowPlane() {
  40635. let $this = this;
  40636. var DrawBowPlaneEntity = $this.viewer.entities.add(
  40637. {
  40638. polygon: {
  40639. hierarchy: new $this.Cesium.CallbackProperty(function() {
  40640. if ($this._positions.length < 3) {
  40641. return;
  40642. }
  40643. var DrawBowPlane2 = [];
  40644. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40645. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40646. DrawBowPlane2.push(cart3);
  40647. }
  40648. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40649. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40650. let radius = $this.MathDistance(pnt1, center2);
  40651. let angle1 = $this.getAzimuth(pnt1, center2);
  40652. let angle2 = $this.getAzimuth(pnt2, center2);
  40653. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40654. startAngle = angle2;
  40655. endAngle = angle1;
  40656. } else {
  40657. startAngle = angle1;
  40658. endAngle = angle2;
  40659. }
  40660. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40661. let pHierarchy = [];
  40662. for (var l = 0; l < getArcPoint.length; l++) {
  40663. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40664. pHierarchy.push(cart3);
  40665. }
  40666. pHierarchy.push(pHierarchy[0]);
  40667. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40668. }, false),
  40669. show: true,
  40670. material: $this.Cesium.Color.YELLOW,
  40671. clampToGround: true
  40672. }
  40673. }
  40674. );
  40675. $this._entities_PincerArrow.push(DrawBowPlaneEntity);
  40676. return DrawBowPlaneEntity;
  40677. }
  40678. createPoint(cartesian) {
  40679. var $this = this;
  40680. var point2 = this.viewer.entities.add({
  40681. position: cartesian,
  40682. point: {
  40683. pixelSize: 10,
  40684. color: $this.Cesium.Color.RED,
  40685. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40686. }
  40687. });
  40688. $this._entities_point.push(point2);
  40689. return point2;
  40690. }
  40691. cartesianToLatlng(cartesian) {
  40692. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40693. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40694. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40695. cartographic.height;
  40696. return [lng, lat];
  40697. }
  40698. destroy() {
  40699. if (this.handler) {
  40700. this.handler.destroy();
  40701. this.handler = null;
  40702. }
  40703. }
  40704. clearPoint() {
  40705. this.DrawEndEvent.raiseEvent(this._DrawBowPlaneLast, this._DrawBowPlaneData, this.drawType);
  40706. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40707. this.viewer.entities.remove(this._entities_point[i2]);
  40708. }
  40709. this._entities_point = [];
  40710. }
  40711. clear() {
  40712. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40713. this.viewer.entities.remove(this._entities_point[i2]);
  40714. }
  40715. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40716. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40717. }
  40718. this.floatingPoint = null;
  40719. this._PincerArrow = null;
  40720. this._PincerArrowLast = null;
  40721. this._positions = [];
  40722. this._entities_point = [];
  40723. this._entities_PincerArrow = [];
  40724. this._PincerArrowData = null;
  40725. }
  40726. getCatesian3FromPX(px) {
  40727. var cartesian;
  40728. var ray = this.viewer.camera.getPickRay(px);
  40729. if (!ray)
  40730. return null;
  40731. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40732. return cartesian;
  40733. }
  40734. _computeTempPositions() {
  40735. var _this = this;
  40736. var pnts = [].concat(_this._positions);
  40737. var num = pnts.length;
  40738. var first = pnts[0];
  40739. var last = pnts[num - 1];
  40740. if (_this._isSimpleXYZ(first, last) == false) {
  40741. pnts.push(first);
  40742. num += 1;
  40743. }
  40744. _this.tempPositions = [];
  40745. for (var i2 = 1; i2 < num; i2++) {
  40746. var p1 = pnts[i2 - 1];
  40747. var p2 = pnts[i2];
  40748. var cp = _this._computeCenterPotition(p1, p2);
  40749. _this.tempPositions.push(p1);
  40750. _this.tempPositions.push(cp);
  40751. }
  40752. }
  40753. _isSimpleXYZ(p1, p2) {
  40754. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40755. return true;
  40756. }
  40757. return false;
  40758. }
  40759. _computeCenterPotition(p1, p2) {
  40760. var _this = this;
  40761. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40762. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40763. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40764. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40765. return cp;
  40766. }
  40767. getLonLat(cartesian) {
  40768. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40769. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40770. var pos = {
  40771. lon: cartographic.longitude,
  40772. lat: cartographic.latitude,
  40773. alt: cartographic.height
  40774. };
  40775. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40776. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40777. return pos;
  40778. }
  40779. LatlngTocartesian(latlng) {
  40780. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40781. return cartesian3;
  40782. }
  40783. lonLatToMercator(Latlng) {
  40784. var E2 = Latlng[0];
  40785. var N2 = Latlng[1];
  40786. var x = E2 * 2003750834e-2 / 180;
  40787. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40788. y = y * 2003750834e-2 / 180;
  40789. return [x, y];
  40790. }
  40791. WebMercator2lonLat(mercator) {
  40792. let x = mercator[0] / 2003750834e-2 * 180;
  40793. let ly = mercator[1] / 2003750834e-2 * 180;
  40794. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40795. return [x, y];
  40796. }
  40797. getCircleCenterOfThreePoints(point1, point2, point3) {
  40798. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40799. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40800. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40801. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40802. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40803. }
  40804. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40805. if (pntA[1] === pntB[1]) {
  40806. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40807. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40808. let y2 = pntA[1];
  40809. return [x2, y2];
  40810. }
  40811. if (pntC[1] === pntD[1]) {
  40812. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40813. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40814. let y2 = pntC[1];
  40815. return [x2, y2];
  40816. }
  40817. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40818. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40819. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40820. let x = e * y - e * pntA[1] + pntA[0];
  40821. return [x, y];
  40822. }
  40823. MathDistance(pnt1, pnt2) {
  40824. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40825. }
  40826. getAzimuth(startPoint, endPoint) {
  40827. let azimuth;
  40828. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40829. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40830. azimuth = angle + Math.PI;
  40831. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40832. azimuth = Math.PI * 2 - angle;
  40833. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40834. azimuth = angle;
  40835. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40836. azimuth = Math.PI - angle;
  40837. }
  40838. return azimuth;
  40839. }
  40840. isClockWise(pnt1, pnt2, pnt3) {
  40841. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40842. }
  40843. getArcPoints(center2, radius, startAngle, endAngle) {
  40844. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40845. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40846. for (let i2 = 0; i2 <= 100; i2++) {
  40847. let angle = startAngle + angleDiff * i2 / 100;
  40848. x = center2[0] + radius * Math.cos(angle);
  40849. y = center2[1] + radius * Math.sin(angle);
  40850. pnts.push([x, y]);
  40851. }
  40852. return pnts;
  40853. }
  40854. }
  40855. class DrawCurve {
  40856. constructor(arg) {
  40857. this.viewer = arg.viewer;
  40858. this.Cesium = arg.Cesium;
  40859. this.floatingPoint = null;
  40860. this._curveline = null;
  40861. this._curvelineLast = null;
  40862. this._positions = [];
  40863. this._entities_point = [];
  40864. this._entities_line = [];
  40865. this._curvelineData = null;
  40866. this.DrawStartEvent = new Cesium.Event();
  40867. this.DrawEndEvent = new Cesium.Event();
  40868. this.ZERO_TOLERANCE = 1e-4;
  40869. this.FITTING_COUNT = 100;
  40870. this.t = 0.3;
  40871. this._param = {
  40872. id: "DrawStraightArrow",
  40873. polygonColor: "rgba(0,255,0,0.5)",
  40874. outlineColor: "rgba(255, 255, 255, 1)",
  40875. outlineWidth: 1
  40876. };
  40877. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40878. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40879. }
  40880. get curveline() {
  40881. return this._curvelineLast;
  40882. }
  40883. getData() {
  40884. return this._curvelineData;
  40885. }
  40886. addload(data) {
  40887. var $this = this;
  40888. let pnts = [];
  40889. for (let p = 0; p < data.length; p++) {
  40890. pnts.push($this.lonLatToMercator(data[p]));
  40891. }
  40892. let CurvePoints = $this.getCurvePoints(pnts);
  40893. let point2 = [];
  40894. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40895. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  40896. }
  40897. var polyline = this.viewer.entities.add({
  40898. Type: "DrawCurve",
  40899. Position: data,
  40900. id: data.id || $this.objId,
  40901. polyline: {
  40902. positions: point2,
  40903. show: true,
  40904. material: $this.Cesium.Color.YELLOW,
  40905. width: 3,
  40906. clampToGround: true
  40907. }
  40908. });
  40909. return polyline;
  40910. }
  40911. computePosition(data) {
  40912. let pnts = [];
  40913. let position2 = [];
  40914. for (let p = 0; p < data.length; p++) {
  40915. position2.push(this.cartesianToLatlng(data[p]));
  40916. pnts.push(this.lonLatToMercator(this.cartesianToLatlng(data[p])));
  40917. }
  40918. this._curvelineData = position2;
  40919. let CurvePoints = this.getCurvePoints(pnts);
  40920. let point2 = [];
  40921. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40922. point2.push(this.LatlngTocartesian(this.WebMercator2lonLat(CurvePoints[i2])));
  40923. }
  40924. return point2;
  40925. }
  40926. startCreate(drawType) {
  40927. this.drawType = drawType;
  40928. var $this = this;
  40929. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  40930. this.handler.setInputAction(function(evt) {
  40931. var cartesian = $this.getCatesian3FromPX(evt.position);
  40932. if ($this._positions.length == 0) {
  40933. $this._positions.push(cartesian.clone());
  40934. $this.floatingPoint = $this.createPoint(cartesian);
  40935. $this.createPoint(cartesian);
  40936. }
  40937. $this._positions.push(cartesian);
  40938. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40939. this.handler.setInputAction(function(evt) {
  40940. if ($this._positions.length < 3)
  40941. return;
  40942. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  40943. if (!$this.Cesium.defined($this._curveline)) {
  40944. $this._curveline = $this.createCurveline();
  40945. }
  40946. $this.floatingPoint.position.setValue(cartesian);
  40947. if ($this._curveline) {
  40948. $this._positions.pop();
  40949. $this._positions.push(cartesian);
  40950. }
  40951. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40952. this.handler.setInputAction(function(evt) {
  40953. if (!$this._curveline)
  40954. return;
  40955. var cartesian = $this.getCatesian3FromPX(evt.position);
  40956. $this._positions.pop();
  40957. $this._positions.push(cartesian);
  40958. $this.createPoint(cartesian);
  40959. $this._curvelineData = $this._positions.concat();
  40960. $this.viewer.entities.remove($this._curveline);
  40961. $this._curveline = null;
  40962. $this._positions = [];
  40963. $this.floatingPoint.position.setValue(cartesian);
  40964. let lnglatArr = [];
  40965. for (var i2 = 0; i2 < $this._curvelineData.length; i2++) {
  40966. var lnglat = $this.cartesianToLatlng($this._curvelineData[i2]);
  40967. lnglatArr.push(lnglat);
  40968. }
  40969. $this._curvelineData = lnglatArr;
  40970. var line = $this.addload($this._curvelineData);
  40971. $this._entities_line.push(line);
  40972. $this._curvelineLast = line;
  40973. $this.clearPoint();
  40974. $this.destroy();
  40975. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40976. }
  40977. createPoint(cartesian) {
  40978. var $this = this;
  40979. var point2 = this.viewer.entities.add({
  40980. position: cartesian,
  40981. point: {
  40982. pixelSize: 10,
  40983. color: $this.Cesium.Color.RED,
  40984. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40985. }
  40986. });
  40987. $this._entities_point.push(point2);
  40988. return point2;
  40989. }
  40990. createCurveline() {
  40991. var $this = this;
  40992. var polyline = this.viewer.entities.add({
  40993. polyline: {
  40994. positions: new $this.Cesium.CallbackProperty(function() {
  40995. let pnts = [];
  40996. for (let p = 0; p < $this._positions.length; p++) {
  40997. pnts.push($this.lonLatToMercator($this.cartesianToLatlng($this._positions[p])));
  40998. }
  40999. let CurvePoints = $this.getCurvePoints(pnts);
  41000. let point2 = [];
  41001. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  41002. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  41003. }
  41004. return point2;
  41005. }, false),
  41006. show: true,
  41007. material: $this.Cesium.Color.YELLOW,
  41008. width: 3,
  41009. clampToGround: true
  41010. }
  41011. });
  41012. $this._entities_line.push(polyline);
  41013. return polyline;
  41014. }
  41015. clearPoint() {
  41016. this.DrawEndEvent.raiseEvent(this._curvelineLast, this._curvelineData, this.drawType);
  41017. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41018. this.viewer.entities.remove(this._entities_point[i2]);
  41019. }
  41020. this._entities_point = [];
  41021. }
  41022. destroy() {
  41023. if (this.handler) {
  41024. this.handler.destroy();
  41025. this.handler = null;
  41026. }
  41027. }
  41028. clear() {
  41029. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41030. this.viewer.entities.remove(this._entities_point[i2]);
  41031. }
  41032. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  41033. this.viewer.entities.remove(this._entities_line[i2]);
  41034. }
  41035. this.floatingPoint = null;
  41036. this._curveline = null;
  41037. this._curvelineLast = null;
  41038. this._positions = [];
  41039. this._entities_point = [];
  41040. this._entities_line = [];
  41041. this._curvelineData = null;
  41042. }
  41043. getCatesian3FromPX(px) {
  41044. var cartesian;
  41045. var ray = this.viewer.camera.getPickRay(px);
  41046. if (!ray)
  41047. return null;
  41048. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41049. return cartesian;
  41050. }
  41051. cartesianToLatlng(cartesian) {
  41052. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41053. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41054. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41055. return [lng, lat];
  41056. }
  41057. LatlngTocartesian(latlng) {
  41058. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41059. return cartesian3;
  41060. }
  41061. lonLatToMercator(Latlng) {
  41062. var E2 = Latlng[0];
  41063. var N2 = Latlng[1];
  41064. var x = E2 * 2003750834e-2 / 180;
  41065. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  41066. y = y * 2003750834e-2 / 180;
  41067. return [x, y];
  41068. }
  41069. WebMercator2lonLat(mercator) {
  41070. let x = mercator[0] / 2003750834e-2 * 180;
  41071. let ly = mercator[1] / 2003750834e-2 * 180;
  41072. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  41073. return [x, y];
  41074. }
  41075. getCurvePoints(controlPoints) {
  41076. let leftControl = this.getLeftMostControlPoint(controlPoints, this.t);
  41077. let [pnt1, pnt2, pnt3, normals, points2] = [null, null, null, [leftControl], []];
  41078. for (let i2 = 0; i2 < controlPoints.length - 2; i2++) {
  41079. [pnt1, pnt2, pnt3] = [controlPoints[i2], controlPoints[i2 + 1], controlPoints[i2 + 2]];
  41080. let normalPoints = this.getBisectorNormals(this.t, pnt1, pnt2, pnt3);
  41081. normals = normals.concat(normalPoints);
  41082. }
  41083. let rightControl = this.getRightMostControlPoint(controlPoints, this.t);
  41084. if (rightControl) {
  41085. normals.push(rightControl);
  41086. }
  41087. for (let i2 = 0; i2 < controlPoints.length - 1; i2++) {
  41088. pnt1 = controlPoints[i2];
  41089. pnt2 = controlPoints[i2 + 1];
  41090. points2.push(pnt1);
  41091. for (let t2 = 0; t2 < this.FITTING_COUNT; t2++) {
  41092. let pnt = this.getCubicValue(t2 / this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  41093. points2.push(pnt);
  41094. }
  41095. points2.push(pnt2);
  41096. }
  41097. return points2;
  41098. }
  41099. getLeftMostControlPoint(controlPoints, t2) {
  41100. let [pnt1, pnt2, pnt3, controlX, controlY] = [controlPoints[0], controlPoints[1], controlPoints[2], null, null];
  41101. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41102. let normalRight = pnts[0];
  41103. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41104. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41105. if (dist > this.ZERO_TOLERANCE) {
  41106. let mid = this.Mid(pnt1, pnt2);
  41107. let pX = pnt1[0] - mid[0];
  41108. let pY = pnt1[1] - mid[1];
  41109. let d1 = this.MathDistance(pnt1, pnt2);
  41110. let n = 2 / d1;
  41111. let nX = -n * pY;
  41112. let nY = n * pX;
  41113. let a11 = nX * nX - nY * nY;
  41114. let a12 = 2 * nX * nY;
  41115. let a22 = nY * nY - nX * nX;
  41116. let dX = normalRight[0] - mid[0];
  41117. let dY = normalRight[1] - mid[1];
  41118. controlX = mid[0] + a11 * dX + a12 * dY;
  41119. controlY = mid[1] + a12 * dX + a22 * dY;
  41120. } else {
  41121. controlX = pnt1[0] + t2 * (pnt2[0] - pnt1[0]);
  41122. controlY = pnt1[1] + t2 * (pnt2[1] - pnt1[1]);
  41123. }
  41124. return [controlX, controlY];
  41125. }
  41126. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  41127. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41128. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  41129. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41130. let uX = normal[0] / dist;
  41131. let uY = normal[1] / dist;
  41132. let d1 = this.MathDistance(pnt1, pnt2);
  41133. let d2 = this.MathDistance(pnt2, pnt3);
  41134. if (dist > this.ZERO_TOLERANCE) {
  41135. if (this.isClockWise(pnt1, pnt2, pnt3)) {
  41136. dt2 = t2 * d1;
  41137. x = pnt2[0] - dt2 * uY;
  41138. y = pnt2[1] + dt2 * uX;
  41139. bisectorNormalRight = [x, y];
  41140. dt2 = t2 * d2;
  41141. x = pnt2[0] + dt2 * uY;
  41142. y = pnt2[1] - dt2 * uX;
  41143. bisectorNormalLeft = [x, y];
  41144. } else {
  41145. dt2 = t2 * d1;
  41146. x = pnt2[0] + dt2 * uY;
  41147. y = pnt2[1] - dt2 * uX;
  41148. bisectorNormalRight = [x, y];
  41149. dt2 = t2 * d2;
  41150. x = pnt2[0] - dt2 * uY;
  41151. y = pnt2[1] + dt2 * uX;
  41152. bisectorNormalLeft = [x, y];
  41153. }
  41154. } else {
  41155. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  41156. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  41157. bisectorNormalRight = [x, y];
  41158. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  41159. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  41160. bisectorNormalLeft = [x, y];
  41161. }
  41162. return [bisectorNormalRight, bisectorNormalLeft];
  41163. }
  41164. getNormal(pnt1, pnt2, pnt3) {
  41165. let dX1 = pnt1[0] - pnt2[0];
  41166. let dY1 = pnt1[1] - pnt2[1];
  41167. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  41168. dX1 /= d1;
  41169. dY1 /= d1;
  41170. let dX2 = pnt3[0] - pnt2[0];
  41171. let dY2 = pnt3[1] - pnt2[1];
  41172. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  41173. dX2 /= d2;
  41174. dY2 /= d2;
  41175. let uX = dX1 + dX2;
  41176. let uY = dY1 + dY2;
  41177. return [uX, uY];
  41178. }
  41179. isClockWise(pnt1, pnt2, pnt3) {
  41180. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  41181. }
  41182. Mid(point1, point2) {
  41183. return [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  41184. }
  41185. MathDistance(pnt1, pnt2) {
  41186. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  41187. }
  41188. getRightMostControlPoint(controlPoints, t2) {
  41189. let count = controlPoints.length;
  41190. let pnt1 = controlPoints[count - 3];
  41191. let pnt2 = controlPoints[count - 2];
  41192. let pnt3 = controlPoints[count - 1];
  41193. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41194. let normalLeft = pnts[1];
  41195. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41196. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41197. let [controlX, controlY] = [null, null];
  41198. if (dist > this.ZERO_TOLERANCE) {
  41199. let mid = this.Mid(pnt2, pnt3);
  41200. let pX = pnt3[0] - mid[0];
  41201. let pY = pnt3[1] - mid[1];
  41202. let d1 = this.MathDistance(pnt2, pnt3);
  41203. let n = 2 / d1;
  41204. let nX = -n * pY;
  41205. let nY = n * pX;
  41206. let a11 = nX * nX - nY * nY;
  41207. let a12 = 2 * nX * nY;
  41208. let a22 = nY * nY - nX * nX;
  41209. let dX = normalLeft[0] - mid[0];
  41210. let dY = normalLeft[1] - mid[1];
  41211. controlX = mid[0] + a11 * dX + a12 * dY;
  41212. controlY = mid[1] + a12 * dX + a22 * dY;
  41213. } else {
  41214. controlX = pnt3[0] + t2 * (pnt2[0] - pnt3[0]);
  41215. controlY = pnt3[1] + t2 * (pnt2[1] - pnt3[1]);
  41216. }
  41217. return [controlX, controlY];
  41218. }
  41219. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  41220. t2 = Math.max(Math.min(t2, 1), 0);
  41221. let [tp, t22] = [1 - t2, t2 * t2];
  41222. let t3 = t22 * t2;
  41223. let tp2 = tp * tp;
  41224. let tp3 = tp2 * tp;
  41225. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  41226. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  41227. return [x, y];
  41228. }
  41229. }
  41230. class DrawCurveFlag {
  41231. constructor(arg) {
  41232. this.viewer = arg.viewer;
  41233. this.Cesium = arg.Cesium;
  41234. this.identificationPoint = null;
  41235. this.CurveFlag = null;
  41236. this.CurveFlagLast = null;
  41237. this.positions = [];
  41238. this.entitiesPoint = [];
  41239. this.entitiesCurveFlag = [];
  41240. this.CurveFlagData = null;
  41241. this.DrawStartEvent = new Cesium.Event();
  41242. this.DrawEndEvent = new Cesium.Event();
  41243. this._param = {
  41244. id: "DrawStraightArrow",
  41245. polygonColor: "rgba(0,255,0,0.5)",
  41246. outlineColor: "rgba(255, 255, 255, 1)",
  41247. outlineWidth: 1
  41248. };
  41249. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41250. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41251. }
  41252. getData() {
  41253. return this.CurveFlagData;
  41254. }
  41255. computePosition(data) {
  41256. let $this = this;
  41257. var lnglatArr = [];
  41258. for (var i2 = 0; i2 < data.length; i2++) {
  41259. var lnglat = $this.cartesianToLatlng(data[i2]);
  41260. lnglatArr.push(lnglat);
  41261. }
  41262. let startPoint = lnglatArr[0];
  41263. let endPoint = lnglatArr[lnglatArr.length - 1];
  41264. let point1 = startPoint;
  41265. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41266. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41267. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41268. let point5 = [endPoint[0], startPoint[1]];
  41269. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41270. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41271. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41272. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41273. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41274. let point11 = [startPoint[0], endPoint[1]];
  41275. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41276. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41277. let componentspolygon = [];
  41278. componentspolygon = curve1.concat(curve2);
  41279. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41280. let componentspolyline = [];
  41281. componentspolyline = curve1.concat(curve2);
  41282. componentspolyline.push($this.LatlngTocartesian(point1));
  41283. componentspolyline.push($this.LatlngTocartesian(point11));
  41284. $this.CurveFlagData = lnglatArr;
  41285. return [PolygonHierarchy, componentspolyline];
  41286. }
  41287. addload(data) {
  41288. var $this = this;
  41289. if (data.length < 2)
  41290. return;
  41291. let startPoint = data[0];
  41292. let endPoint = data[data.length - 1];
  41293. let point1 = startPoint;
  41294. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41295. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41296. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41297. let point5 = [endPoint[0], startPoint[1]];
  41298. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41299. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41300. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41301. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41302. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41303. let point11 = [startPoint[0], endPoint[1]];
  41304. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41305. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41306. let componentspolygon = [];
  41307. componentspolygon = curve1.concat(curve2);
  41308. let componentspolyline = [];
  41309. componentspolyline = curve1.concat(curve2);
  41310. componentspolyline.push($this.LatlngTocartesian(point1));
  41311. componentspolyline.push($this.LatlngTocartesian(point11));
  41312. var shape = this.viewer.entities.add({
  41313. Type: "DrawCurveFlag",
  41314. Position: data,
  41315. id: data.id || $this.objId,
  41316. polygon: {
  41317. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41318. extrudedHeight: 1,
  41319. material: $this.Cesium.Color.RED
  41320. },
  41321. polyline: {
  41322. positions: componentspolyline,
  41323. show: true,
  41324. material: $this.Cesium.Color.YELLOW,
  41325. width: 5,
  41326. clampToGround: true
  41327. }
  41328. });
  41329. $this.entitiesCurveFlag.push(shape);
  41330. return shape;
  41331. }
  41332. startCreate(drawType) {
  41333. this.drawType = drawType;
  41334. var $this = this;
  41335. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41336. this.handler.setInputAction(function(evt) {
  41337. var cartesian = $this.getCatesian3FromPX(evt.position);
  41338. if ($this.positions.length == 0) {
  41339. $this.positions.push(cartesian.clone());
  41340. $this.identificationPoint = $this.createPoint(cartesian);
  41341. $this.createPoint(cartesian);
  41342. $this.positions.push(cartesian);
  41343. }
  41344. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41345. this.handler.setInputAction(function(evt) {
  41346. if ($this.positions.length < 2)
  41347. return;
  41348. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41349. if (!$this.Cesium.defined($this.CurveFlag)) {
  41350. $this.CurveFlag = $this.createCurveFlag();
  41351. }
  41352. $this.identificationPoint.position.setValue(cartesian);
  41353. if ($this.CurveFlag) {
  41354. $this.positions.pop();
  41355. $this.positions.push(cartesian);
  41356. }
  41357. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41358. this.handler.setInputAction(function(evt) {
  41359. if (!$this.CurveFlag)
  41360. return;
  41361. var cartesian = $this.getCatesian3FromPX(evt.position);
  41362. $this.positions.pop();
  41363. $this.positions.push(cartesian);
  41364. $this.createPoint(cartesian);
  41365. $this.CurveFlagData = $this.positions.concat();
  41366. $this.viewer.entities.remove($this.CurveFlag);
  41367. $this.CurveFlag = null;
  41368. $this.positions = [];
  41369. $this.identificationPoint.position.setValue(cartesian);
  41370. var lnglatArr = [];
  41371. for (var i2 = 0; i2 < $this.CurveFlagData.length; i2++) {
  41372. var lnglat = $this.cartesianToLatlng($this.CurveFlagData[i2]);
  41373. lnglatArr.push(lnglat);
  41374. }
  41375. $this.CurveFlagData = lnglatArr;
  41376. var CurveFlag = $this.addload([$this.CurveFlagData[0], $this.CurveFlagData[$this.CurveFlagData.length - 1]]);
  41377. $this.entitiesCurveFlag.push(CurveFlag);
  41378. $this.CurveFlagLast = CurveFlag;
  41379. $this.clearPoint();
  41380. $this.destroy();
  41381. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41382. }
  41383. createPoint(cartesian) {
  41384. var $this = this;
  41385. var point2 = this.viewer.entities.add({
  41386. position: cartesian,
  41387. point: {
  41388. pixelSize: 10,
  41389. color: $this.Cesium.Color.RED,
  41390. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41391. }
  41392. });
  41393. $this.entitiesPoint.push(point2);
  41394. return point2;
  41395. }
  41396. createCurveFlag() {
  41397. var $this = this;
  41398. var polygon2 = this.viewer.entities.add({
  41399. polygon: {
  41400. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41401. if ($this.positions.length < 2)
  41402. return;
  41403. let lonlat = [];
  41404. let components = [];
  41405. let length = $this.positions.length;
  41406. for (let i2 = 0; i2 < length; i2++) {
  41407. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41408. }
  41409. let startPoint = lonlat[0];
  41410. let endPoint = lonlat[lonlat.length - 1];
  41411. let point1 = startPoint;
  41412. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41413. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41414. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41415. let point5 = [endPoint[0], startPoint[1]];
  41416. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41417. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41418. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41419. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41420. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41421. [startPoint[0], endPoint[1]];
  41422. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41423. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41424. components = curve1.concat(curve2);
  41425. return new $this.Cesium.PolygonHierarchy(components);
  41426. }, false),
  41427. extrudedHeight: 1,
  41428. material: $this.Cesium.Color.RED
  41429. },
  41430. polyline: {
  41431. positions: new $this.Cesium.CallbackProperty(function() {
  41432. if ($this.positions.length < 2)
  41433. return;
  41434. let lonlat = [];
  41435. let components = [];
  41436. let length = $this.positions.length;
  41437. for (let i2 = 0; i2 < length; i2++) {
  41438. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41439. }
  41440. let startPoint = lonlat[0];
  41441. let endPoint = lonlat[lonlat.length - 1];
  41442. let point1 = startPoint;
  41443. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41444. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41445. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41446. let point5 = [endPoint[0], startPoint[1]];
  41447. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41448. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41449. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41450. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41451. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41452. let point11 = [startPoint[0], endPoint[1]];
  41453. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41454. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41455. components = curve1.concat(curve2);
  41456. components.push($this.LatlngTocartesian(point1));
  41457. components.push($this.LatlngTocartesian(point11));
  41458. return components;
  41459. }, false),
  41460. show: true,
  41461. material: $this.Cesium.Color.YELLOW,
  41462. width: 5,
  41463. clampToGround: true
  41464. }
  41465. });
  41466. $this.entitiesCurveFlag.push(polygon2);
  41467. return polygon2;
  41468. }
  41469. cartesianToLatlng(cartesian) {
  41470. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41471. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41472. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41473. return [lng, lat];
  41474. }
  41475. LatlngTocartesian(latlng) {
  41476. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41477. return cartesian3;
  41478. }
  41479. clearPoint() {
  41480. this.DrawEndEvent.raiseEvent(this.CurveFlagLast, [this.CurveFlagData[0], this.CurveFlagData[this.CurveFlagData.length - 1]], this.drawType);
  41481. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41482. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41483. }
  41484. this.entitiesPoint = [];
  41485. }
  41486. destroy() {
  41487. if (this.handler) {
  41488. this.handler.destroy();
  41489. this.handler = null;
  41490. }
  41491. }
  41492. clear() {
  41493. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41494. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41495. }
  41496. for (var i2 = 0; i2 < this.entitiesCurveFlag.length; i2++) {
  41497. this.viewer.entities.remove(this.entitiesCurveFlag[i2]);
  41498. }
  41499. this.identificationPoint = null;
  41500. this.CurveFlag = null;
  41501. this.CurveFlagLast = null;
  41502. this.positions = [];
  41503. this.entitiesPoint = [];
  41504. this.entitiesCurveFlag = [];
  41505. this.CurveFlagData = null;
  41506. }
  41507. getCatesian3FromPX(px) {
  41508. var cartesian;
  41509. var ray = this.viewer.camera.getPickRay(px);
  41510. if (!ray)
  41511. return null;
  41512. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41513. return cartesian;
  41514. }
  41515. getBezierPoints(points2) {
  41516. let $this = this;
  41517. if (points2.length <= 2) {
  41518. return points2;
  41519. } else {
  41520. let bezierPoints = [];
  41521. let n = points2.length - 1;
  41522. for (let t2 = 0; t2 <= 1; t2 += 0.01) {
  41523. let [x, y] = [0, 0];
  41524. for (let index2 = 0; index2 <= n; index2++) {
  41525. let factor = $this.getBinomialFactor(n, index2);
  41526. let a = Math.pow(t2, index2);
  41527. let b = Math.pow(1 - t2, n - index2);
  41528. x += factor * a * b * points2[index2][0];
  41529. y += factor * a * b * points2[index2][1];
  41530. }
  41531. bezierPoints.push($this.LatlngTocartesian([x, y]));
  41532. }
  41533. bezierPoints.push($this.LatlngTocartesian(points2[n]));
  41534. return bezierPoints;
  41535. }
  41536. }
  41537. getBinomialFactor(n, index2) {
  41538. return this.getFactorial(n) / (this.getFactorial(index2) * this.getFactorial(n - index2));
  41539. }
  41540. getFactorial(n) {
  41541. let result = 1;
  41542. switch (n) {
  41543. case n <= 1:
  41544. result = 1;
  41545. break;
  41546. case n === 2:
  41547. result = 2;
  41548. break;
  41549. case n === 3:
  41550. result = 6;
  41551. break;
  41552. case n === 24:
  41553. result = 24;
  41554. break;
  41555. case n === 5:
  41556. result = 120;
  41557. break;
  41558. default:
  41559. for (let i2 = 1; i2 <= n; i2++) {
  41560. result *= i2;
  41561. }
  41562. break;
  41563. }
  41564. return result;
  41565. }
  41566. }
  41567. class DrawRectFlag {
  41568. constructor(arg) {
  41569. this.viewer = arg.viewer;
  41570. this.Cesium = arg.Cesium;
  41571. this.identificationPoint = null;
  41572. this.RectFlag = null;
  41573. this.RectFlagLast = null;
  41574. this.positions = [];
  41575. this.entitiesPoint = [];
  41576. this.entitiesRectFlag = [];
  41577. this.RectFlagData = null;
  41578. this.DrawStartEvent = new Cesium.Event();
  41579. this.DrawEndEvent = new Cesium.Event();
  41580. this._param = {
  41581. id: "DrawStraightArrow",
  41582. polygonColor: "rgba(0,255,0,0.5)",
  41583. outlineColor: "rgba(255, 255, 255, 1)",
  41584. outlineWidth: 1
  41585. };
  41586. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41587. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41588. }
  41589. getData() {
  41590. return this.RectFlagData;
  41591. }
  41592. computePosition(data) {
  41593. let $this = this;
  41594. var lnglatArr = [];
  41595. for (var i2 = 0; i2 < data.length; i2++) {
  41596. var lnglat = $this.cartesianToLatlng(data[i2]);
  41597. lnglatArr.push(lnglat);
  41598. }
  41599. let startPoint = lnglatArr[0];
  41600. let endPoint = lnglatArr[lnglatArr.length - 1];
  41601. let point0 = lnglatArr[0];
  41602. var point1 = [endPoint[0], startPoint[1]];
  41603. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41604. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41605. var point4 = [startPoint[0], endPoint[1]];
  41606. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41607. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41608. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41609. $this.RectFlagData = lnglatArr;
  41610. console.log([PolygonHierarchy, componentspolyline]);
  41611. return [PolygonHierarchy, componentspolyline];
  41612. }
  41613. addload(data) {
  41614. var $this = this;
  41615. if (data.length < 2)
  41616. return;
  41617. let startPoint = data[0];
  41618. let endPoint = data[data.length - 1];
  41619. let point0 = data[0];
  41620. var point1 = [endPoint[0], startPoint[1]];
  41621. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41622. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41623. var point4 = [startPoint[0], endPoint[1]];
  41624. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41625. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41626. var shape = this.viewer.entities.add({
  41627. Type: "DrawRectFlag",
  41628. Position: data,
  41629. id: data.id || $this.objId,
  41630. polygon: {
  41631. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41632. extrudedHeight: 1,
  41633. material: $this.Cesium.Color.RED
  41634. },
  41635. polyline: {
  41636. positions: componentspolyline,
  41637. show: true,
  41638. material: $this.Cesium.Color.YELLOW,
  41639. width: 5,
  41640. clampToGround: true
  41641. }
  41642. });
  41643. $this.entitiesRectFlag.push(shape);
  41644. return shape;
  41645. }
  41646. startCreate(drawType) {
  41647. this.drawType = drawType;
  41648. var $this = this;
  41649. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41650. this.handler.setInputAction(function(evt) {
  41651. var cartesian = $this.getCatesian3FromPX(evt.position);
  41652. if ($this.positions.length == 0) {
  41653. $this.positions.push(cartesian.clone());
  41654. $this.identificationPoint = $this.createPoint(cartesian);
  41655. $this.createPoint(cartesian);
  41656. $this.positions.push(cartesian);
  41657. }
  41658. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41659. this.handler.setInputAction(function(evt) {
  41660. if ($this.positions.length < 2)
  41661. return;
  41662. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41663. if (!$this.Cesium.defined($this.RectFlag)) {
  41664. $this.RectFlag = $this.createRectFlag();
  41665. }
  41666. $this.identificationPoint.position.setValue(cartesian);
  41667. if ($this.RectFlag) {
  41668. $this.positions.pop();
  41669. $this.positions.push(cartesian);
  41670. }
  41671. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41672. this.handler.setInputAction(function(evt) {
  41673. if (!$this.RectFlag)
  41674. return;
  41675. var cartesian = $this.getCatesian3FromPX(evt.position);
  41676. $this.positions.pop();
  41677. $this.positions.push(cartesian);
  41678. $this.createPoint(cartesian);
  41679. $this.RectFlagData = $this.positions.concat();
  41680. $this.viewer.entities.remove($this.RectFlag);
  41681. $this.RectFlag = null;
  41682. $this.positions = [];
  41683. $this.identificationPoint.position.setValue(cartesian);
  41684. var lnglatArr = [];
  41685. for (var i2 = 0; i2 < $this.RectFlagData.length; i2++) {
  41686. var lnglat = $this.cartesianToLatlng($this.RectFlagData[i2]);
  41687. lnglatArr.push(lnglat);
  41688. }
  41689. $this.RectFlagData = lnglatArr;
  41690. var RectFlag = $this.addload([$this.RectFlagData[0], $this.RectFlagData[$this.RectFlagData.length - 1]]);
  41691. $this.entitiesRectFlag.push(RectFlag);
  41692. $this.RectFlagLast = RectFlag;
  41693. $this.clearPoint();
  41694. $this.destroy();
  41695. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41696. }
  41697. createPoint(cartesian) {
  41698. var $this = this;
  41699. var point2 = this.viewer.entities.add({
  41700. position: cartesian,
  41701. point: {
  41702. pixelSize: 10,
  41703. color: $this.Cesium.Color.RED,
  41704. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41705. }
  41706. });
  41707. $this.entitiesPoint.push(point2);
  41708. return point2;
  41709. }
  41710. createRectFlag() {
  41711. console.log("232323");
  41712. var $this = this;
  41713. var polygon2 = this.viewer.entities.add({
  41714. polygon: {
  41715. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41716. if ($this.positions.length < 2)
  41717. return;
  41718. let lonlat = [];
  41719. let length = $this.positions.length;
  41720. for (let i2 = 0; i2 < length; i2++) {
  41721. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41722. }
  41723. let startPoint = lonlat[0];
  41724. let endPoint = lonlat[lonlat.length - 1];
  41725. let point0 = lonlat[0];
  41726. var point1 = [endPoint[0], startPoint[1]];
  41727. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41728. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41729. [startPoint[0], endPoint[1]];
  41730. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41731. return new $this.Cesium.PolygonHierarchy(components);
  41732. }, false),
  41733. extrudedHeight: 1,
  41734. material: $this.Cesium.Color.RED
  41735. },
  41736. polyline: {
  41737. positions: new $this.Cesium.CallbackProperty(function() {
  41738. if ($this.positions.length < 2)
  41739. return;
  41740. let lonlat = [];
  41741. let length = $this.positions.length;
  41742. for (let i2 = 0; i2 < length; i2++) {
  41743. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41744. }
  41745. let startPoint = lonlat[0];
  41746. let endPoint = lonlat[lonlat.length - 1];
  41747. let point0 = lonlat[0];
  41748. var point1 = [endPoint[0], startPoint[1]];
  41749. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41750. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41751. var point4 = [startPoint[0], endPoint[1]];
  41752. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41753. return components;
  41754. }, false),
  41755. show: true,
  41756. material: $this.Cesium.Color.YELLOW,
  41757. width: 5,
  41758. clampToGround: true
  41759. }
  41760. });
  41761. $this.entitiesRectFlag.push(polygon2);
  41762. return polygon2;
  41763. }
  41764. cartesianToLatlng(cartesian) {
  41765. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41766. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41767. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41768. return [lng, lat];
  41769. }
  41770. LatlngTocartesian(latlng) {
  41771. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41772. return cartesian3;
  41773. }
  41774. clearPoint() {
  41775. this.DrawEndEvent.raiseEvent(this.RectFlagLast, [this.RectFlagData[0], this.RectFlagData[this.RectFlagData.length - 1]], this.drawType);
  41776. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41777. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41778. }
  41779. this.entitiesPoint = [];
  41780. }
  41781. destroy() {
  41782. if (this.handler) {
  41783. this.handler.destroy();
  41784. this.handler = null;
  41785. }
  41786. }
  41787. clear() {
  41788. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41789. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41790. }
  41791. for (var i2 = 0; i2 < this.entitiesRectFlag.length; i2++) {
  41792. this.viewer.entities.remove(this.entitiesRectFlag[i2]);
  41793. }
  41794. this.identificationPoint = null;
  41795. this.RectFlag = null;
  41796. this.RectFlagLast = null;
  41797. this.positions = [];
  41798. this.entitiesPoint = [];
  41799. this.entitiesRectFlag = [];
  41800. this.RectFlagData = null;
  41801. }
  41802. getCatesian3FromPX(px) {
  41803. var cartesian;
  41804. var ray = this.viewer.camera.getPickRay(px);
  41805. if (!ray)
  41806. return null;
  41807. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41808. return cartesian;
  41809. }
  41810. }
  41811. class DrawTriangleFlag {
  41812. constructor(arg) {
  41813. this.viewer = arg.viewer;
  41814. this.Cesium = arg.Cesium;
  41815. this.identificationPoint = null;
  41816. this.TriangleFlag = null;
  41817. this.TriangleFlagLast = null;
  41818. this.positions = [];
  41819. this.entitiesPoint = [];
  41820. this.entitiesTriangleFlag = [];
  41821. this.TriangleFlagData = null;
  41822. this.DrawStartEvent = new Cesium.Event();
  41823. this.DrawEndEvent = new Cesium.Event();
  41824. this._param = {
  41825. id: "DrawStraightArrow",
  41826. polygonColor: "rgba(0,255,0,0.5)",
  41827. outlineColor: "rgba(255, 255, 255, 1)",
  41828. outlineWidth: 1
  41829. };
  41830. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41831. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41832. }
  41833. getData() {
  41834. return this.TriangleFlagData;
  41835. }
  41836. computePosition(data) {
  41837. let $this = this;
  41838. var lnglatArr = [];
  41839. for (var i2 = 0; i2 < data.length; i2++) {
  41840. var lnglat = $this.cartesianToLatlng(data[i2]);
  41841. lnglatArr.push(lnglat);
  41842. }
  41843. let startPoint = lnglatArr[0];
  41844. let endPoint = lnglatArr[lnglatArr.length - 1];
  41845. let point0 = lnglatArr[0];
  41846. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41847. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41848. var point3 = [startPoint[0], endPoint[1]];
  41849. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41850. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41851. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41852. $this.TriangleFlagData = lnglatArr;
  41853. console.log([PolygonHierarchy, componentspolyline]);
  41854. return [PolygonHierarchy, componentspolyline];
  41855. }
  41856. addload(data) {
  41857. var $this = this;
  41858. if (data.length < 2)
  41859. return;
  41860. let startPoint = data[0];
  41861. let endPoint = data[data.length - 1];
  41862. let point0 = data[0];
  41863. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41864. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41865. var point3 = [startPoint[0], endPoint[1]];
  41866. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41867. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41868. var shape = this.viewer.entities.add({
  41869. Type: "DrawTriangleFlag",
  41870. Position: data,
  41871. id: data.id || $this.objId,
  41872. polygon: {
  41873. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41874. extrudedHeight: 1,
  41875. material: $this.Cesium.Color.RED
  41876. },
  41877. polyline: {
  41878. positions: componentspolyline,
  41879. show: true,
  41880. material: $this.Cesium.Color.YELLOW,
  41881. width: 5,
  41882. clampToGround: true
  41883. }
  41884. });
  41885. $this.entitiesTriangleFlag.push(shape);
  41886. return shape;
  41887. }
  41888. startCreate(drawType) {
  41889. this.drawType = drawType;
  41890. var $this = this;
  41891. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41892. this.handler.setInputAction(function(evt) {
  41893. var cartesian = $this.getCatesian3FromPX(evt.position);
  41894. if ($this.positions.length == 0) {
  41895. $this.positions.push(cartesian.clone());
  41896. $this.identificationPoint = $this.createPoint(cartesian);
  41897. $this.createPoint(cartesian);
  41898. $this.positions.push(cartesian);
  41899. }
  41900. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41901. this.handler.setInputAction(function(evt) {
  41902. if ($this.positions.length < 2)
  41903. return;
  41904. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41905. if (!$this.Cesium.defined($this.TriangleFlag)) {
  41906. $this.TriangleFlag = $this.createTriangleFlag();
  41907. }
  41908. $this.identificationPoint.position.setValue(cartesian);
  41909. if ($this.TriangleFlag) {
  41910. $this.positions.pop();
  41911. $this.positions.push(cartesian);
  41912. }
  41913. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41914. this.handler.setInputAction(function(evt) {
  41915. if (!$this.TriangleFlag)
  41916. return;
  41917. var cartesian = $this.getCatesian3FromPX(evt.position);
  41918. $this.positions.pop();
  41919. $this.positions.push(cartesian);
  41920. $this.createPoint(cartesian);
  41921. $this.TriangleFlagData = $this.positions.concat();
  41922. $this.viewer.entities.remove($this.TriangleFlag);
  41923. $this.TriangleFlag = null;
  41924. $this.positions = [];
  41925. $this.identificationPoint.position.setValue(cartesian);
  41926. var lnglatArr = [];
  41927. for (var i2 = 0; i2 < $this.TriangleFlagData.length; i2++) {
  41928. var lnglat = $this.cartesianToLatlng($this.TriangleFlagData[i2]);
  41929. lnglatArr.push(lnglat);
  41930. }
  41931. $this.TriangleFlagData = lnglatArr;
  41932. var TriangleFlag = $this.addload([$this.TriangleFlagData[0], $this.TriangleFlagData[$this.TriangleFlagData.length - 1]]);
  41933. $this.entitiesTriangleFlag.push(TriangleFlag);
  41934. $this.TriangleFlagLast = TriangleFlag;
  41935. $this.clearPoint();
  41936. $this.destroy();
  41937. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41938. }
  41939. createPoint(cartesian) {
  41940. var $this = this;
  41941. var point2 = this.viewer.entities.add({
  41942. position: cartesian,
  41943. point: {
  41944. pixelSize: 10,
  41945. color: $this.Cesium.Color.RED,
  41946. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41947. }
  41948. });
  41949. $this.entitiesPoint.push(point2);
  41950. return point2;
  41951. }
  41952. createTriangleFlag() {
  41953. console.log("232323");
  41954. var $this = this;
  41955. var polygon2 = this.viewer.entities.add({
  41956. polygon: {
  41957. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41958. if ($this.positions.length < 2)
  41959. return;
  41960. let lonlat = [];
  41961. let length = $this.positions.length;
  41962. for (let i2 = 0; i2 < length; i2++) {
  41963. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41964. }
  41965. let startPoint = lonlat[0];
  41966. let endPoint = lonlat[lonlat.length - 1];
  41967. let point0 = lonlat[0];
  41968. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41969. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41970. [startPoint[0], endPoint[1]];
  41971. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41972. return new $this.Cesium.PolygonHierarchy(components);
  41973. }, false),
  41974. extrudedHeight: 1,
  41975. material: $this.Cesium.Color.RED
  41976. },
  41977. polyline: {
  41978. positions: new $this.Cesium.CallbackProperty(function() {
  41979. if ($this.positions.length < 2)
  41980. return;
  41981. let lonlat = [];
  41982. let length = $this.positions.length;
  41983. for (let i2 = 0; i2 < length; i2++) {
  41984. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41985. }
  41986. let startPoint = lonlat[0];
  41987. let endPoint = lonlat[lonlat.length - 1];
  41988. let point0 = lonlat[0];
  41989. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41990. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41991. var point3 = [startPoint[0], endPoint[1]];
  41992. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41993. return components;
  41994. }, false),
  41995. show: true,
  41996. material: $this.Cesium.Color.YELLOW,
  41997. width: 5,
  41998. clampToGround: true
  41999. }
  42000. });
  42001. $this.entitiesTriangleFlag.push(polygon2);
  42002. return polygon2;
  42003. }
  42004. cartesianToLatlng(cartesian) {
  42005. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42006. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42007. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42008. return [lng, lat];
  42009. }
  42010. LatlngTocartesian(latlng) {
  42011. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42012. return cartesian3;
  42013. }
  42014. clearPoint() {
  42015. this.DrawEndEvent.raiseEvent(this.TriangleFlagLast, [this.TriangleFlagData[0], this.TriangleFlagData[this.TriangleFlagData.length - 1]], this.drawType);
  42016. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42017. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42018. }
  42019. this.entitiesPoint = [];
  42020. }
  42021. destroy() {
  42022. if (this.handler) {
  42023. this.handler.destroy();
  42024. this.handler = null;
  42025. }
  42026. }
  42027. clear() {
  42028. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42029. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42030. }
  42031. for (var i2 = 0; i2 < this.entitiesTriangleFlag.length; i2++) {
  42032. this.viewer.entities.remove(this.entitiesTriangleFlag[i2]);
  42033. }
  42034. this.identificationPoint = null;
  42035. this.TriangleFlag = null;
  42036. this.TriangleFlagLast = null;
  42037. this.positions = [];
  42038. this.entitiesPoint = [];
  42039. this.entitiesTriangleFlag = [];
  42040. this.TriangleFlagData = null;
  42041. }
  42042. getCatesian3FromPX(px) {
  42043. var cartesian;
  42044. var ray = this.viewer.camera.getPickRay(px);
  42045. if (!ray)
  42046. return null;
  42047. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42048. return cartesian;
  42049. }
  42050. }
  42051. class DrawPoint$1 {
  42052. constructor(arg) {
  42053. this.viewer = arg.viewer;
  42054. this.Cesium = arg.Cesium;
  42055. this._point = null;
  42056. this._pointData = null;
  42057. this._entities = [];
  42058. this.DrawStartEvent = new Cesium.Event();
  42059. this.DrawEndEvent = new Cesium.Event();
  42060. this._param = {
  42061. id: "DrawStraightArrow",
  42062. polygonColor: "rgba(0,255,0,0.5)",
  42063. outlineColor: "rgba(255, 255, 255, 1)",
  42064. outlineWidth: 1
  42065. };
  42066. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42067. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42068. }
  42069. get point() {
  42070. return this._point;
  42071. }
  42072. addload(data) {
  42073. return this.createPoint(data);
  42074. }
  42075. getData() {
  42076. return this._pointData;
  42077. }
  42078. computePosition(data) {
  42079. let $this = this;
  42080. var lnglatArr = [];
  42081. for (var i2 = 0; i2 < data.length; i2++) {
  42082. var lnglat = $this.cartesianToLatlng(data[i2]);
  42083. lnglatArr.push(lnglat);
  42084. }
  42085. $this._pointData = lnglatArr;
  42086. let point2 = lnglatArr[0];
  42087. return $this.Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  42088. }
  42089. startCreate(drawType) {
  42090. this.drawType = drawType;
  42091. var $this = this;
  42092. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42093. this.handler.setInputAction(function(evt) {
  42094. var cartesian = $this.getCatesian3FromPX(evt.position);
  42095. if (!cartesian)
  42096. return;
  42097. let latlon = $this.cartesianToLatlng(cartesian);
  42098. var point2 = $this.createPoint(latlon);
  42099. $this._pointData = cartesian;
  42100. $this._point = point2;
  42101. $this.DrawEndEvent.raiseEvent($this._point, latlon, $this.drawType);
  42102. $this.destroy();
  42103. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42104. }
  42105. createPoint(cartesian) {
  42106. var $this = this;
  42107. var point2 = this.viewer.entities.add({
  42108. Type: "DrawPoint",
  42109. Position: [cartesian],
  42110. position: $this.Cesium.Cartesian3.fromDegrees(cartesian[0], cartesian[1]),
  42111. id: cartesian.id || $this.objId,
  42112. billboard: {
  42113. image: "./static/poi2.png",
  42114. verticalOrigin: Cesium.VerticalOrigin.BOTTOM
  42115. }
  42116. });
  42117. $this._entities.push(point2);
  42118. return point2;
  42119. }
  42120. cartesianToLatlng(cartesian) {
  42121. let ellipsoid = this.viewer.scene.globe.ellipsoid;
  42122. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  42123. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  42124. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  42125. return [lng, lat];
  42126. }
  42127. destroy() {
  42128. if (this.handler) {
  42129. this.handler.destroy();
  42130. this.handler = null;
  42131. }
  42132. }
  42133. clear() {
  42134. for (var i2 = 0; i2 < this._entities.length; i2++) {
  42135. this.viewer.entities.remove(this._entities[i2]);
  42136. }
  42137. this._entities = [];
  42138. this._point = null;
  42139. }
  42140. getCatesian3FromPX(px) {
  42141. var cartesian;
  42142. var ray = this.viewer.camera.getPickRay(px);
  42143. if (!ray)
  42144. return null;
  42145. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42146. return cartesian;
  42147. }
  42148. }
  42149. class DrawPolyline {
  42150. constructor(arg) {
  42151. this.viewer = arg.viewer;
  42152. this.Cesium = arg.Cesium;
  42153. this._polyline = null;
  42154. this._polylineLast = null;
  42155. this._positions = [];
  42156. this._entities_point = [];
  42157. this._entities_line = [];
  42158. this._polylineData = null;
  42159. this.DrawStartEvent = new Cesium.Event();
  42160. this.DrawEndEvent = new Cesium.Event();
  42161. this._param = {
  42162. id: "DrawStraightArrow",
  42163. polygonColor: "rgba(0,255,0,0.5)",
  42164. outlineColor: "rgba(255, 255, 255, 1)",
  42165. outlineWidth: 1
  42166. };
  42167. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42168. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42169. }
  42170. get line() {
  42171. return this._polylineLast;
  42172. }
  42173. getData() {
  42174. return this._polylineData;
  42175. }
  42176. computePosition(data) {
  42177. let $this = this;
  42178. var lnglatArr = [];
  42179. for (var i2 = 0; i2 < data.length; i2++) {
  42180. var lnglat = $this.cartesianToLatlng(data[i2]);
  42181. lnglatArr.push(lnglat);
  42182. }
  42183. $this._polylineData = lnglatArr;
  42184. return data;
  42185. }
  42186. addload(data) {
  42187. var $this = this;
  42188. var lnglatArr = [];
  42189. for (var i2 = 0; i2 < data.length; i2++) {
  42190. var lnglat = $this.LatlngTocartesian(data[i2]);
  42191. lnglatArr.push(lnglat);
  42192. }
  42193. var polyline = this.viewer.entities.add({
  42194. Type: "DrawPolyline",
  42195. Position: data,
  42196. id: data.id || $this.objId,
  42197. polyline: {
  42198. positions: lnglatArr,
  42199. show: true,
  42200. material: $this.Cesium.Color.RED,
  42201. width: 3,
  42202. clampToGround: true
  42203. }
  42204. });
  42205. return polyline;
  42206. }
  42207. startCreate(drawType) {
  42208. this.drawType = drawType;
  42209. var $this = this;
  42210. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42211. this.handler.setInputAction(function(evt) {
  42212. var cartesian = $this.getCatesian3FromPX(evt.position);
  42213. if ($this._positions.length == 0) {
  42214. $this._positions.push(cartesian.clone());
  42215. }
  42216. $this._positions.push(cartesian);
  42217. $this.createPoint(cartesian);
  42218. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42219. this.handler.setInputAction(function(evt) {
  42220. if ($this._positions.length < 1)
  42221. return;
  42222. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42223. if (!$this.Cesium.defined($this._polyline)) {
  42224. $this._polyline = $this.createPolyline();
  42225. }
  42226. if ($this._polyline) {
  42227. $this._positions.pop();
  42228. $this._positions.push(cartesian);
  42229. }
  42230. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42231. this.handler.setInputAction(function(evt) {
  42232. if (!$this._polyline)
  42233. return;
  42234. var cartesian = $this.getCatesian3FromPX(evt.position);
  42235. $this._positions.pop();
  42236. $this.createPoint(cartesian);
  42237. $this._polylineData = $this._positions.concat();
  42238. $this.viewer.entities.remove($this._polyline);
  42239. $this._polyline = null;
  42240. $this._positions = [];
  42241. var lnglatArr = [];
  42242. for (var i2 = 0; i2 < $this._polylineData.length; i2++) {
  42243. var lnglat = $this.cartesianToLatlng($this._polylineData[i2]);
  42244. lnglatArr.push(lnglat);
  42245. }
  42246. $this._polylineData = lnglatArr;
  42247. var line = $this.addload($this._polylineData);
  42248. $this._entities_line.push(line);
  42249. $this._polylineLast = line;
  42250. $this.clearPoint();
  42251. $this.destroy();
  42252. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42253. }
  42254. createPoint(cartesian) {
  42255. var $this = this;
  42256. var point2 = this.viewer.entities.add({
  42257. position: cartesian,
  42258. point: {
  42259. pixelSize: 10,
  42260. color: $this.Cesium.Color.RED,
  42261. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42262. }
  42263. });
  42264. $this._entities_point.push(point2);
  42265. return point2;
  42266. }
  42267. createPolyline() {
  42268. var $this = this;
  42269. var polyline = this.viewer.entities.add({
  42270. polyline: {
  42271. positions: new $this.Cesium.CallbackProperty(function() {
  42272. return $this._positions;
  42273. }, false),
  42274. show: true,
  42275. material: $this.Cesium.Color.RED,
  42276. width: 3,
  42277. clampToGround: true
  42278. }
  42279. });
  42280. $this._entities_line.push(polyline);
  42281. return polyline;
  42282. }
  42283. cartesianToLatlng(cartesian) {
  42284. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42285. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42286. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42287. return [lng, lat];
  42288. }
  42289. LatlngTocartesian(latlng) {
  42290. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42291. return cartesian3;
  42292. }
  42293. clearPoint() {
  42294. this.DrawEndEvent.raiseEvent(this._polylineLast, this._polylineData, this.drawType);
  42295. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42296. this.viewer.entities.remove(this._entities_point[i2]);
  42297. }
  42298. this._entities_point = [];
  42299. }
  42300. destroy() {
  42301. if (this.handler) {
  42302. this.handler.destroy();
  42303. this.handler = null;
  42304. }
  42305. }
  42306. clear() {
  42307. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42308. this.viewer.entities.remove(this._entities_point[i2]);
  42309. }
  42310. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  42311. this.viewer.entities.remove(this._entities_line[i2]);
  42312. }
  42313. this._polyline = null;
  42314. this._positions = [];
  42315. this._entities_point = [];
  42316. this._entities_line = [];
  42317. this._polylineData = null;
  42318. this._polylineLast = null;
  42319. }
  42320. getCatesian3FromPX(px) {
  42321. var cartesian;
  42322. var ray = this.viewer.camera.getPickRay(px);
  42323. if (!ray)
  42324. return null;
  42325. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42326. return cartesian;
  42327. }
  42328. }
  42329. class DrawPolygon {
  42330. constructor(arg) {
  42331. this.viewer = arg.viewer;
  42332. this.Cesium = arg.Cesium;
  42333. this._polygon = null;
  42334. this._polygonLast = null;
  42335. this._positions = [];
  42336. this._entities_point = [];
  42337. this._entities_polygon = [];
  42338. this._polygonData = null;
  42339. this.DrawStartEvent = new Cesium.Event();
  42340. this.DrawEndEvent = new Cesium.Event();
  42341. this._param = {
  42342. id: "DrawStraightArrow",
  42343. polygonColor: "rgba(0,255,0,0.5)",
  42344. outlineColor: "rgba(255, 255, 255, 1)",
  42345. outlineWidth: 1
  42346. };
  42347. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42348. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42349. }
  42350. get polygon() {
  42351. return this._polygonLast;
  42352. }
  42353. getData() {
  42354. return this._polygonData;
  42355. }
  42356. computePosition(data) {
  42357. let $this = this;
  42358. var lnglatArr = [];
  42359. for (var i2 = 0; i2 < data.length; i2++) {
  42360. var lnglat = $this.cartesianToLatlng(data[i2]);
  42361. lnglatArr.push(lnglat);
  42362. }
  42363. $this._polygonData = lnglatArr;
  42364. return new $this.Cesium.PolygonHierarchy(data);
  42365. }
  42366. addload(data) {
  42367. var $this = this;
  42368. var lnglatArr = [];
  42369. for (var i2 = 0; i2 < data.length; i2++) {
  42370. var lnglat = $this.LatlngTocartesian(data[i2]);
  42371. lnglatArr.push(lnglat);
  42372. }
  42373. return this.viewer.entities.add({
  42374. Type: "DrawPolygon",
  42375. Position: data,
  42376. id: data.id || $this.objId,
  42377. polygon: {
  42378. hierarchy: new $this.Cesium.PolygonHierarchy(lnglatArr),
  42379. clampToGround: true,
  42380. show: true,
  42381. fill: true,
  42382. material: $this.Cesium.Color.RED.withAlpha(0.9),
  42383. width: 3,
  42384. outlineColor: $this.Cesium.Color.BLACK,
  42385. outlineWidth: 1,
  42386. outline: false
  42387. }
  42388. });
  42389. }
  42390. startCreate(drawType) {
  42391. this.drawType = drawType;
  42392. var $this = this;
  42393. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42394. this.handler.setInputAction(function(evt) {
  42395. var cartesian = $this.getCatesian3FromPX(evt.position);
  42396. if ($this._positions.length == 0) {
  42397. $this._positions.push(cartesian.clone());
  42398. }
  42399. $this.createPoint(cartesian);
  42400. $this._positions.push(cartesian);
  42401. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42402. this.handler.setInputAction(function(evt) {
  42403. if ($this._positions.length < 1)
  42404. return;
  42405. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42406. if ($this._positions.length == 3) {
  42407. if (!$this.Cesium.defined($this._polygon)) {
  42408. $this._polygon = $this.createPolygon();
  42409. }
  42410. }
  42411. $this._positions.pop();
  42412. $this._positions.push(cartesian);
  42413. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42414. this.handler.setInputAction(function(evt) {
  42415. if (!$this._polygon)
  42416. return;
  42417. var cartesian = $this.getCatesian3FromPX(evt.position);
  42418. $this._positions.pop();
  42419. $this.createPoint(cartesian);
  42420. $this._polygonData = $this._positions.concat();
  42421. $this.viewer.entities.remove($this._positions);
  42422. $this._positions = null;
  42423. $this._positions = [];
  42424. var lnglatArr = [];
  42425. for (var i2 = 0; i2 < $this._polygonData.length; i2++) {
  42426. var lnglat = $this.cartesianToLatlng($this._polygonData[i2]);
  42427. lnglatArr.push(lnglat);
  42428. }
  42429. $this._polygonData = lnglatArr;
  42430. var Polygon = $this.addload($this._polygonData);
  42431. $this._entities_polygon.push(Polygon);
  42432. $this._polygonLast = Polygon;
  42433. $this.clearPoint();
  42434. $this.destroy();
  42435. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42436. }
  42437. createPolygon() {
  42438. var $this = this;
  42439. var polygon2 = this.viewer.entities.add({
  42440. polygon: {
  42441. hierarchy: new $this.Cesium.CallbackProperty(function() {
  42442. return new $this.Cesium.PolygonHierarchy($this._positions);
  42443. }, false),
  42444. clampToGround: true,
  42445. show: true,
  42446. fill: true,
  42447. material: $this.Cesium.Color.RED.withAlpha(0.5),
  42448. width: 3,
  42449. outlineColor: $this.Cesium.Color.BLACK,
  42450. outlineWidth: 1,
  42451. outline: false
  42452. }
  42453. });
  42454. $this._entities_polygon.push(polygon2);
  42455. return polygon2;
  42456. }
  42457. cartesianToLatlng(cartesian) {
  42458. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42459. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42460. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42461. return [lng, lat];
  42462. }
  42463. LatlngTocartesian(latlng) {
  42464. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42465. return cartesian3;
  42466. }
  42467. clearPoint() {
  42468. this.DrawEndEvent.raiseEvent(this._polygonLast, this._polygonData, this.drawType);
  42469. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42470. this.viewer.entities.remove(this._entities_point[i2]);
  42471. }
  42472. this._entities_point = [];
  42473. }
  42474. createPoint(cartesian) {
  42475. var $this = this;
  42476. var point2 = this.viewer.entities.add({
  42477. position: cartesian,
  42478. point: {
  42479. pixelSize: 10,
  42480. color: $this.Cesium.Color.RED,
  42481. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42482. }
  42483. });
  42484. $this._entities_point.push(point2);
  42485. return point2;
  42486. }
  42487. destroy() {
  42488. if (this.handler) {
  42489. this.handler.destroy();
  42490. this.handler = null;
  42491. }
  42492. }
  42493. clear() {
  42494. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42495. this.viewer.entities.remove(this._entities_point[i2]);
  42496. }
  42497. for (var i2 = 0; i2 < this._entities_polygon.length; i2++) {
  42498. this.viewer.entities.remove(this._entities_polygon[i2]);
  42499. }
  42500. this._polygon = null;
  42501. this._polygonLast = null;
  42502. this._positions = [];
  42503. this._entities_point = [];
  42504. this._entities_polygon = [];
  42505. this._polygonData = null;
  42506. }
  42507. getCatesian3FromPX(px) {
  42508. var cartesian;
  42509. var ray = this.viewer.camera.getPickRay(px);
  42510. if (!ray)
  42511. return null;
  42512. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42513. return cartesian;
  42514. }
  42515. }
  42516. class DrawRectangle {
  42517. constructor(arg) {
  42518. this.viewer = arg.viewer;
  42519. this.Cesium = arg.Cesium;
  42520. this.floatingPoint = null;
  42521. this._rectangle = null;
  42522. this._rectangleLast = null;
  42523. this._positions = [];
  42524. this._entities_point = [];
  42525. this._entities_rectangle = [];
  42526. this._rectangleData = null;
  42527. this.DrawStartEvent = new Cesium.Event();
  42528. this.DrawEndEvent = new Cesium.Event();
  42529. this._param = {
  42530. id: "DrawStraightArrow",
  42531. polygonColor: "rgba(0,255,0,0.5)",
  42532. outlineColor: "rgba(255, 255, 255, 1)",
  42533. outlineWidth: 1
  42534. };
  42535. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42536. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42537. }
  42538. get line() {
  42539. return this._rectangleLast;
  42540. }
  42541. getData() {
  42542. return this._rectangleData;
  42543. }
  42544. computePosition(data) {
  42545. let $this = this;
  42546. var lnglatArr = [];
  42547. for (var i2 = 0; i2 < data.length; i2++) {
  42548. var lnglat = $this.cartesianToLatlng(data[i2]);
  42549. lnglatArr.push(lnglat);
  42550. }
  42551. $this._rectangleData = lnglatArr;
  42552. return new $this.Cesium.Rectangle.fromCartesianArray(data);
  42553. }
  42554. addload(data) {
  42555. var $this = this;
  42556. var lnglatArr = [];
  42557. for (var i2 = 0; i2 < data.length; i2++) {
  42558. var lnglat = $this.LatlngTocartesian(data[i2]);
  42559. lnglatArr.push(lnglat);
  42560. }
  42561. var shape = this.viewer.entities.add({
  42562. Type: "DrawRectangle",
  42563. Position: data,
  42564. id: data.id || $this.objId,
  42565. rectangle: {
  42566. coordinates: $this.Cesium.Rectangle.fromCartesianArray(lnglatArr),
  42567. material: $this.Cesium.Color.RED.withAlpha(0.9)
  42568. }
  42569. });
  42570. $this._entities_rectangle.push(shape);
  42571. return shape;
  42572. }
  42573. startCreate(drawType) {
  42574. this.drawType = drawType;
  42575. var $this = this;
  42576. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42577. this.handler.setInputAction(function(evt) {
  42578. var cartesian = $this.getCatesian3FromPX(evt.position);
  42579. if ($this._positions.length == 0) {
  42580. $this._positions.push(cartesian.clone());
  42581. $this.floatingPoint = $this.createPoint(cartesian);
  42582. $this.createPoint(cartesian);
  42583. $this._positions.push(cartesian);
  42584. }
  42585. if ($this._positions.length == 2) {
  42586. $this._positions.push(cartesian);
  42587. }
  42588. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42589. this.handler.setInputAction(function(evt) {
  42590. if ($this._positions.length < 3)
  42591. return;
  42592. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42593. if (!$this.Cesium.defined($this._rectangle)) {
  42594. $this._rectangle = $this.createRectangle();
  42595. }
  42596. $this.floatingPoint.position.setValue(cartesian);
  42597. if ($this._rectangle) {
  42598. $this._positions.pop();
  42599. $this._positions.push(cartesian);
  42600. }
  42601. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42602. this.handler.setInputAction(function(evt) {
  42603. if (!$this._rectangle)
  42604. return;
  42605. var cartesian = $this.getCatesian3FromPX(evt.position);
  42606. $this._positions.pop();
  42607. $this._positions.push(cartesian);
  42608. $this.createPoint(cartesian);
  42609. $this._rectangleData = $this._positions.concat();
  42610. $this.viewer.entities.remove($this._rectangle);
  42611. $this._rectangle = null;
  42612. $this._positions = [];
  42613. $this.floatingPoint.position.setValue(cartesian);
  42614. var lnglatArr = [];
  42615. for (var i2 = 0; i2 < $this._rectangleData.length; i2++) {
  42616. var lnglat = $this.cartesianToLatlng($this._rectangleData[i2]);
  42617. lnglatArr.push(lnglat);
  42618. }
  42619. $this._rectangleData = lnglatArr;
  42620. var rectangle = $this.addload([$this._rectangleData[0], $this._rectangleData[$this._rectangleData.length - 1]]);
  42621. $this._entities_rectangle.push(rectangle);
  42622. $this._rectangleLast = rectangle;
  42623. $this.clearPoint();
  42624. $this.destroy();
  42625. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42626. }
  42627. createPoint(cartesian) {
  42628. var $this = this;
  42629. var point2 = this.viewer.entities.add({
  42630. position: cartesian,
  42631. point: {
  42632. pixelSize: 10,
  42633. color: $this.Cesium.Color.RED,
  42634. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42635. }
  42636. });
  42637. $this._entities_point.push(point2);
  42638. return point2;
  42639. }
  42640. createRectangle() {
  42641. var $this = this;
  42642. var shape = this.viewer.entities.add({
  42643. name: "rectangle",
  42644. rectangle: {
  42645. coordinates: new $this.Cesium.CallbackProperty(function() {
  42646. var obj = $this.Cesium.Rectangle.fromCartesianArray($this._positions);
  42647. return obj;
  42648. }, false),
  42649. material: $this.Cesium.Color.RED.withAlpha(0.5)
  42650. }
  42651. });
  42652. $this._entities_rectangle.push(shape);
  42653. return shape;
  42654. }
  42655. cartesianToLatlng(cartesian) {
  42656. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42657. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42658. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42659. return [lng, lat];
  42660. }
  42661. LatlngTocartesian(latlng) {
  42662. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42663. return cartesian3;
  42664. }
  42665. clearPoint() {
  42666. this.DrawEndEvent.raiseEvent(this._rectangleLast, [this._rectangleData[0], this._rectangleData[this._rectangleData.length - 1]], this.drawType);
  42667. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42668. this.viewer.entities.remove(this._entities_point[i2]);
  42669. }
  42670. this._entities_point = [];
  42671. }
  42672. destroy() {
  42673. if (this.handler) {
  42674. this.handler.destroy();
  42675. this.handler = null;
  42676. }
  42677. }
  42678. clear() {
  42679. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42680. this.viewer.entities.remove(this._entities_point[i2]);
  42681. }
  42682. for (var i2 = 0; i2 < this._entities_rectangle.length; i2++) {
  42683. this.viewer.entities.remove(this._entities_rectangle[i2]);
  42684. }
  42685. this.floatingPoint = null;
  42686. this._rectangle = null;
  42687. this._rectangleLast = null;
  42688. this._positions = [];
  42689. this._entities_point = [];
  42690. this._entities_rectangle = [];
  42691. this._rectangleData = null;
  42692. }
  42693. getCatesian3FromPX(px) {
  42694. var cartesian;
  42695. var ray = this.viewer.camera.getPickRay(px);
  42696. if (!ray)
  42697. return null;
  42698. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42699. return cartesian;
  42700. }
  42701. }
  42702. class DrawCircle {
  42703. constructor(arg) {
  42704. this.viewer = arg.viewer;
  42705. this.Cesium = arg.Cesium;
  42706. this._cicle = null;
  42707. this.floatingPoint = null;
  42708. this._cicleLast = null;
  42709. this._positions = [];
  42710. this._entities_point = [];
  42711. this._entities_cicle = [];
  42712. this._cicleData = null;
  42713. this.DrawStartEvent = new Cesium.Event();
  42714. this.DrawEndEvent = new Cesium.Event();
  42715. this._param = {
  42716. id: "DrawStraightArrow",
  42717. polygonColor: "rgba(0,255,0,0.5)",
  42718. outlineColor: "rgba(255, 255, 255, 1)",
  42719. outlineWidth: 1
  42720. };
  42721. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42722. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42723. }
  42724. get cicle() {
  42725. return this._cicleLast;
  42726. }
  42727. addload(data) {
  42728. var that = this;
  42729. let lnglatArr = [];
  42730. for (var i2 = 0; i2 < data.length; i2++) {
  42731. var lnglat = that.LatlngTocartesian(data[i2]);
  42732. lnglatArr.push(lnglat);
  42733. }
  42734. var value = lnglatArr;
  42735. var r2 = Math.sqrt(
  42736. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42737. );
  42738. var position2 = value[0];
  42739. var shape = that.viewer.entities.add({
  42740. Type: "DrawCircle",
  42741. Position: [data[0], data[data.length - 1]],
  42742. position: position2,
  42743. id: data.id || that.objId,
  42744. ellipse: {
  42745. semiMinorAxis: r2,
  42746. semiMajorAxis: r2,
  42747. material: that.Cesium.Color.RED.withAlpha(0.9),
  42748. show: true,
  42749. clampToGround: true
  42750. }
  42751. });
  42752. return shape;
  42753. }
  42754. getData() {
  42755. return this._cicleData;
  42756. }
  42757. computePosition(data) {
  42758. var that = this;
  42759. let lnglatArr = [];
  42760. for (var i2 = 0; i2 < data.length; i2++) {
  42761. var lnglat = that.cartesianToLatlng(data[i2]);
  42762. lnglatArr.push(lnglat);
  42763. }
  42764. that._cicleData = lnglatArr;
  42765. var value = data;
  42766. var r2 = Math.sqrt(
  42767. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42768. );
  42769. var position2 = value[0];
  42770. return { position: position2, r: r2 };
  42771. }
  42772. startCreate(drawType) {
  42773. this.drawType = drawType;
  42774. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42775. this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42776. var $this = this;
  42777. this.handler.setInputAction(function(evt) {
  42778. $this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42779. var cartesian = $this.getCatesian3FromPX(evt.position);
  42780. if ($this._positions.length == 0) {
  42781. $this._positions.push(cartesian.clone());
  42782. $this.floatingPoint = $this.createPoint(cartesian);
  42783. $this._positions.push(cartesian);
  42784. }
  42785. if (!$this._cicle) {
  42786. $this.createPoint(cartesian);
  42787. }
  42788. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42789. this.handler.setInputAction(function(evt) {
  42790. if ($this._positions.length < 1)
  42791. return;
  42792. var cartesian = $this.viewer.scene.pickPosition(evt.endPosition);
  42793. if (!$this.Cesium.defined($this._cicle)) {
  42794. $this._cicle = $this.createCicle();
  42795. }
  42796. $this.floatingPoint.position.setValue(cartesian);
  42797. if ($this._cicle) {
  42798. $this._positions.pop();
  42799. $this._positions.push(cartesian);
  42800. }
  42801. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42802. this.handler.setInputAction(function(evt) {
  42803. if (!$this._cicle)
  42804. return;
  42805. $this.viewer.scene.globe.depthTestAgainstTerrain = false;
  42806. var cartesian = $this.viewer.scene.pickPosition(evt.position);
  42807. $this._positions.pop();
  42808. $this._positions.push(cartesian);
  42809. $this._cicleData = $this._positions.concat();
  42810. $this.viewer.entities.remove($this._cicle);
  42811. $this._cicle = null;
  42812. $this._positions = [];
  42813. $this.floatingPoint.position.setValue(cartesian);
  42814. let lnglatArr = [];
  42815. for (var i2 = 0; i2 < $this._cicleData.length; i2++) {
  42816. var lnglat = $this.cartesianToLatlng($this._cicleData[i2]);
  42817. lnglatArr.push(lnglat);
  42818. }
  42819. $this._cicleData = lnglatArr;
  42820. var cicle = $this.addload($this._cicleData);
  42821. $this._entities_cicle.push(cicle);
  42822. $this._cicleLast = cicle;
  42823. $this.clearPoint();
  42824. $this.destroy();
  42825. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42826. }
  42827. createCicle() {
  42828. var that = this;
  42829. var shape = this.viewer.entities.add({
  42830. position: that._positions[0],
  42831. ellipse: {
  42832. semiMinorAxis: new that.Cesium.CallbackProperty(function() {
  42833. var r2 = Math.sqrt(
  42834. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42835. );
  42836. return r2 ? r2 : r2 + 1;
  42837. }, false),
  42838. semiMajorAxis: new that.Cesium.CallbackProperty(function() {
  42839. var r2 = Math.sqrt(
  42840. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42841. );
  42842. return r2 ? r2 : r2 + 1;
  42843. }, false),
  42844. material: that.Cesium.Color.RED.withAlpha(0.5),
  42845. outline: true
  42846. }
  42847. });
  42848. that._entities_cicle.push(shape);
  42849. return shape;
  42850. }
  42851. createPoint(cartesian) {
  42852. var $this = this;
  42853. var point2 = this.viewer.entities.add({
  42854. position: cartesian,
  42855. point: {
  42856. pixelSize: 10,
  42857. color: $this.Cesium.Color.RED,
  42858. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42859. }
  42860. });
  42861. $this._entities_point.push(point2);
  42862. return point2;
  42863. }
  42864. getCatesian3FromPX(px) {
  42865. var cartesian;
  42866. var ray = this.viewer.camera.getPickRay(px);
  42867. if (!ray)
  42868. return null;
  42869. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42870. return cartesian;
  42871. }
  42872. cartesianToLatlng(cartesian) {
  42873. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42874. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  42875. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  42876. cartographic.height;
  42877. return [lng, lat];
  42878. }
  42879. LatlngTocartesian(latlng) {
  42880. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1], 0);
  42881. return cartesian3;
  42882. }
  42883. destroy() {
  42884. if (this.handler) {
  42885. this.handler.destroy();
  42886. this.handler = null;
  42887. }
  42888. }
  42889. clearPoint() {
  42890. this.DrawEndEvent.raiseEvent(this._cicleLast, this._cicleData, this.drawType);
  42891. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42892. this.viewer.entities.remove(this._entities_point[i2]);
  42893. }
  42894. this._entities_point = [];
  42895. }
  42896. clear() {
  42897. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42898. this.viewer.entities.remove(this._entities_point[i2]);
  42899. }
  42900. for (var i2 = 0; i2 < this._entities_cicle.length; i2++) {
  42901. this.viewer.entities.remove(this._entities_cicle[i2]);
  42902. }
  42903. this._cicle = null;
  42904. this.floatingPoint = null;
  42905. this._cicleLast = null;
  42906. this._positions = [];
  42907. this._entities_point = [];
  42908. this._entities_cicle = [];
  42909. this._cicleData = null;
  42910. }
  42911. }
  42912. let MilitaryPlot = {
  42913. DrawStraightArrow,
  42914. DrawAttackArrow,
  42915. DrawPincerArrow,
  42916. DrawGatheringPlace,
  42917. DrawClosedCurve,
  42918. DrawSector,
  42919. DrawBowLine,
  42920. DrawBowPlane,
  42921. DrawCurve,
  42922. DrawCurveFlag,
  42923. DrawRectFlag,
  42924. DrawTriangleFlag,
  42925. DrawPoint: DrawPoint$1,
  42926. DrawPolyline,
  42927. DrawPolygon,
  42928. DrawRectangle,
  42929. DrawCircle
  42930. };
  42931. class EntityEdit {
  42932. constructor(viewer2) {
  42933. this.viewer = viewer2;
  42934. this.DrawExample = "";
  42935. this.midVertexEntities = [];
  42936. this.initEventHandler();
  42937. }
  42938. initEventHandler() {
  42939. this.eventHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42940. this.EditEndEvent = new Cesium.Event();
  42941. this.EditEndEntity = new Cesium.Event();
  42942. }
  42943. activate() {
  42944. this.deactivate();
  42945. this.initLeftClickEventHandler();
  42946. }
  42947. deactivate() {
  42948. this.DrawExample = "";
  42949. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42950. this.unRegisterEvents();
  42951. this.clearAllEditVertex();
  42952. }
  42953. clearAllEditVertex() {
  42954. this.clearEditVertex();
  42955. this.clearMidVertex();
  42956. }
  42957. initLeftClickEventHandler() {
  42958. this.eventHandler.setInputAction((e) => {
  42959. let id = this.viewer.scene.pick(e.position);
  42960. if (!id || !id.id) {
  42961. this.handleEditEntity();
  42962. return;
  42963. }
  42964. if (!id.id || !id.id.Type)
  42965. return;
  42966. if (this.editEntity && this.editEntity.id == id.id.id)
  42967. return;
  42968. this.handleEditEntity();
  42969. this.handlePickEditEntity(id.id);
  42970. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42971. }
  42972. handleEditEntity() {
  42973. this.unRegisterEvents();
  42974. this.clearAllEditVertex();
  42975. let editEntity = this.editEntity;
  42976. if (!editEntity)
  42977. return;
  42978. this.closeEntityEditMode();
  42979. this.editEntity = void 0;
  42980. if (!this.isEdited)
  42981. return;
  42982. this.EditEndEvent.raiseEvent(editEntity);
  42983. this.isEdited = false;
  42984. this.isEditing = false;
  42985. }
  42986. handlePickEditEntity(pickId) {
  42987. const EditableTypes = ["DrawAttackArrow", "DrawCircle", "DrawCurve", "DrawPincerArrow", "DrawPoint", "DrawPolygon", "DrawPolyline", "DrawRectangle", "DrawStraightArrow", "DrawGatheringPlace", "DrawSector", "DrawClosedCurve", "DrawBowLine", "DrawBowPlane", "DrawRectFlag", "DrawTriangleFlag", "DrawCurveFlag"];
  42988. if (EditableTypes.indexOf(pickId.Type) == -1)
  42989. return;
  42990. this.editEntity = pickId;
  42991. this.EditEndEntity.raiseEvent(this.editEntity);
  42992. this.isEditing = false;
  42993. this.isEdited = false;
  42994. this.editPositions = this.getEditEntityPositions();
  42995. this.EditMoveCenterPositoin = this.getCenterPosition();
  42996. this.openEntityEditModel();
  42997. this.clearAllEditVertex();
  42998. this.unRegisterEvents();
  42999. this.createEditVertex();
  43000. this.createMidVertex();
  43001. this.registerEvents();
  43002. }
  43003. openEntityEditModel() {
  43004. if (this.DrawExample == "")
  43005. return;
  43006. switch (this.editEntity.Type) {
  43007. case "DrawStraightArrow":
  43008. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43009. return this.DrawExample.computePosition(this.editPositions);
  43010. }, false);
  43011. break;
  43012. case "DrawAttackArrow":
  43013. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43014. return this.DrawExample.computePosition(this.editPositions);
  43015. }, false);
  43016. break;
  43017. case "DrawPincerArrow":
  43018. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43019. return this.DrawExample.computePosition(this.editPositions);
  43020. }, false);
  43021. break;
  43022. case "DrawGatheringPlace":
  43023. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43024. return this.DrawExample.computePosition(this.editPositions);
  43025. }, false);
  43026. break;
  43027. case "DrawClosedCurve":
  43028. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43029. return this.DrawExample.computePosition(this.editPositions).PolygonHierarchy;
  43030. }, false);
  43031. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43032. return this.DrawExample.computePosition(this.editPositions).pList;
  43033. }, false);
  43034. break;
  43035. case "DrawCircle":
  43036. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43037. return this.DrawExample.computePosition(this.editPositions).position;
  43038. }, false);
  43039. this.editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty((e) => {
  43040. return this.DrawExample.computePosition(this.editPositions).r;
  43041. }, false);
  43042. this.editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty((e) => {
  43043. return this.DrawExample.computePosition(this.editPositions).r;
  43044. }, false);
  43045. break;
  43046. case "DrawCurve":
  43047. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43048. return this.DrawExample.computePosition(this.editPositions);
  43049. }, false);
  43050. break;
  43051. case "DrawPoint":
  43052. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43053. return this.editPositions[0];
  43054. }, false);
  43055. break;
  43056. case "DrawPolygon":
  43057. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43058. return this.DrawExample.computePosition(this.editPositions);
  43059. }, false);
  43060. break;
  43061. case "DrawPolyline":
  43062. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43063. return this.DrawExample.computePosition(this.editPositions);
  43064. }, false);
  43065. break;
  43066. case "DrawRectangle":
  43067. this.editEntity.rectangle.coordinates = new Cesium.CallbackProperty((e) => {
  43068. return this.DrawExample.computePosition(this.editPositions);
  43069. }, false);
  43070. break;
  43071. case "DrawSector":
  43072. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43073. return this.DrawExample.computePosition(this.editPositions);
  43074. }, false);
  43075. break;
  43076. case "DrawBowLine":
  43077. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43078. return this.DrawExample.computePosition(this.editPositions);
  43079. }, false);
  43080. break;
  43081. case "DrawBowPlane":
  43082. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43083. return this.DrawExample.computePosition(this.editPositions);
  43084. }, false);
  43085. break;
  43086. case "DrawRectFlag":
  43087. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43088. return this.DrawExample.computePosition(this.editPositions)[0];
  43089. }, false);
  43090. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43091. return this.DrawExample.computePosition(this.editPositions)[1];
  43092. }, false);
  43093. break;
  43094. case "DrawTriangleFlag":
  43095. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43096. return this.DrawExample.computePosition(this.editPositions)[0];
  43097. }, false);
  43098. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43099. return this.DrawExample.computePosition(this.editPositions)[1];
  43100. }, false);
  43101. break;
  43102. case "DrawCurveFlag":
  43103. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43104. return this.DrawExample.computePosition(this.editPositions)[0];
  43105. }, false);
  43106. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43107. return this.DrawExample.computePosition(this.editPositions)[1];
  43108. }, false);
  43109. break;
  43110. }
  43111. }
  43112. closeEntityEditMode() {
  43113. if (this.DrawExample == "")
  43114. return;
  43115. let position2 = "";
  43116. switch (this.editEntity.Type) {
  43117. case "DrawStraightArrow":
  43118. position2 = this.DrawExample.computePosition(this.editPositions);
  43119. this.editEntity.polygon.hierarchy = position2;
  43120. this.editEntity.Position = this.DrawExample.getData();
  43121. break;
  43122. case "DrawAttackArrow":
  43123. position2 = this.DrawExample.computePosition(this.editPositions);
  43124. this.editEntity.polygon.hierarchy = position2;
  43125. this.editEntity.Position = this.DrawExample.getData();
  43126. break;
  43127. case "DrawPincerArrow":
  43128. position2 = this.DrawExample.computePosition(this.editPositions);
  43129. this.editEntity.polygon.hierarchy = position2;
  43130. this.editEntity.Position = this.DrawExample.getData();
  43131. break;
  43132. case "DrawGatheringPlace":
  43133. position2 = this.DrawExample.computePosition(this.editPositions);
  43134. this.editEntity.polygon.hierarchy = position2;
  43135. this.editEntity.Position = this.DrawExample.getData();
  43136. break;
  43137. case "DrawClosedCurve":
  43138. position2 = this.DrawExample.computePosition(this.editPositions);
  43139. this.editEntity.polygon.hierarchy = position2.PolygonHierarchy;
  43140. this.editEntity.polyline.positions = position2.pList;
  43141. this.editEntity.Position = this.DrawExample.getData();
  43142. break;
  43143. case "DrawCircle":
  43144. position2 = this.DrawExample.computePosition(this.editPositions);
  43145. this.editEntity.position = position2.position;
  43146. this.editEntity.ellipse.semiMinorAxis = position2.r;
  43147. this.editEntity.ellipse.semiMajorAxis = position2.r;
  43148. this.editEntity.Position = this.DrawExample.getData();
  43149. break;
  43150. case "DrawCurve":
  43151. position2 = this.DrawExample.computePosition(this.editPositions);
  43152. this.editEntity.polyline.positions = position2;
  43153. this.editEntity.Position = this.DrawExample.getData();
  43154. break;
  43155. case "DrawPoint":
  43156. position2 = this.DrawExample.computePosition(this.editPositions);
  43157. this.editEntity.position = position2;
  43158. this.editEntity.Position = this.DrawExample.getData();
  43159. break;
  43160. case "DrawPolygon":
  43161. position2 = this.DrawExample.computePosition(this.editPositions);
  43162. this.editEntity.polygon.hierarchy = position2;
  43163. this.editEntity.Position = this.DrawExample.getData();
  43164. break;
  43165. case "DrawPolyline":
  43166. position2 = this.DrawExample.computePosition(this.editPositions);
  43167. this.editEntity.polyline.positions = position2;
  43168. this.editEntity.Position = this.DrawExample.getData();
  43169. break;
  43170. case "DrawRectangle":
  43171. position2 = this.DrawExample.computePosition(this.editPositions);
  43172. this.editEntity.rectangle.coordinates = position2;
  43173. this.editEntity.Position = this.DrawExample.getData();
  43174. break;
  43175. case "DrawSector":
  43176. position2 = this.DrawExample.computePosition(this.editPositions);
  43177. this.editEntity.polygon.hierarchy = position2;
  43178. this.editEntity.Position = this.DrawExample.getData();
  43179. break;
  43180. case "DrawBowLine":
  43181. position2 = this.DrawExample.computePosition(this.editPositions);
  43182. this.editEntity.polyline.positions = position2;
  43183. this.editEntity.Position = this.DrawExample.getData();
  43184. break;
  43185. case "DrawBowPlane":
  43186. position2 = this.DrawExample.computePosition(this.editPositions);
  43187. this.editEntity.polygon.hierarchy = position2;
  43188. this.editEntity.Position = this.DrawExample.getData();
  43189. break;
  43190. case "DrawRectFlag":
  43191. position2 = this.DrawExample.computePosition(this.editPositions);
  43192. this.editEntity.polygon.hierarchy = position2[0];
  43193. this.editEntity.polyline.positions = position2[1];
  43194. this.editEntity.Position = this.DrawExample.getData();
  43195. break;
  43196. case "DrawTriangleFlag":
  43197. position2 = this.DrawExample.computePosition(this.editPositions);
  43198. this.editEntity.polygon.hierarchy = position2[0];
  43199. this.editEntity.polyline.positions = position2[1];
  43200. this.editEntity.Position = this.DrawExample.getData();
  43201. break;
  43202. case "DrawCurveFlag":
  43203. position2 = this.DrawExample.computePosition(this.editPositions);
  43204. this.editEntity.polygon.hierarchy = position2[0];
  43205. this.editEntity.polyline.positions = position2[1];
  43206. this.editEntity.Position = this.DrawExample.getData();
  43207. break;
  43208. }
  43209. }
  43210. getEditEntityPositions() {
  43211. let position2 = this.editEntity.Position;
  43212. let positionArr = [];
  43213. switch (this.editEntity.Type) {
  43214. case "DrawAttackArrow":
  43215. for (let i2 = 0; i2 < position2.length; i2++) {
  43216. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43217. }
  43218. return positionArr;
  43219. case "DrawCircle":
  43220. for (let i2 = 0; i2 < position2.length; i2++) {
  43221. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43222. }
  43223. return positionArr;
  43224. case "DrawCurve":
  43225. for (let i2 = 0; i2 < position2.length; i2++) {
  43226. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43227. }
  43228. return positionArr;
  43229. case "DrawPincerArrow":
  43230. for (let i2 = 0; i2 < position2.length; i2++) {
  43231. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43232. }
  43233. return positionArr;
  43234. case "DrawPoint":
  43235. for (let i2 = 0; i2 < position2.length; i2++) {
  43236. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43237. }
  43238. return positionArr;
  43239. case "DrawPolygon":
  43240. for (let i2 = 0; i2 < position2.length; i2++) {
  43241. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43242. }
  43243. return positionArr;
  43244. case "DrawPolyline":
  43245. for (let i2 = 0; i2 < position2.length; i2++) {
  43246. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43247. }
  43248. return positionArr;
  43249. case "DrawRectangle":
  43250. for (let i2 = 0; i2 < position2.length; i2++) {
  43251. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43252. }
  43253. return positionArr;
  43254. case "DrawStraightArrow":
  43255. for (let i2 = 0; i2 < position2.length; i2++) {
  43256. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43257. }
  43258. return positionArr;
  43259. case "DrawGatheringPlace":
  43260. for (let i2 = 0; i2 < position2.length; i2++) {
  43261. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43262. }
  43263. return positionArr;
  43264. case "DrawSector":
  43265. for (let i2 = 0; i2 < position2.length; i2++) {
  43266. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43267. }
  43268. return positionArr;
  43269. case "DrawClosedCurve":
  43270. for (let i2 = 0; i2 < position2.length; i2++) {
  43271. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43272. }
  43273. return positionArr;
  43274. case "DrawBowLine":
  43275. for (let i2 = 0; i2 < position2.length; i2++) {
  43276. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43277. }
  43278. return positionArr;
  43279. case "DrawBowPlane":
  43280. for (let i2 = 0; i2 < position2.length; i2++) {
  43281. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43282. }
  43283. return positionArr;
  43284. case "DrawRectFlag":
  43285. for (let i2 = 0; i2 < position2.length; i2++) {
  43286. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43287. }
  43288. return positionArr;
  43289. case "DrawTriangleFlag":
  43290. for (let i2 = 0; i2 < position2.length; i2++) {
  43291. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43292. }
  43293. return positionArr;
  43294. case "DrawCurveFlag":
  43295. for (let i2 = 0; i2 < position2.length; i2++) {
  43296. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43297. }
  43298. return positionArr;
  43299. }
  43300. }
  43301. registerEvents() {
  43302. this.initLeftDownEventHandler();
  43303. this.initMouseMoveEventHandler();
  43304. this.initLeftUpEventHandler();
  43305. }
  43306. unRegisterEvents() {
  43307. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43308. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  43309. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43310. }
  43311. initLeftDownEventHandler() {
  43312. this.eventHandler.setInputAction((e) => {
  43313. let id = this.viewer.scene.pick(e.position);
  43314. if (!id || !id.id || !id.id.type)
  43315. return;
  43316. if (id.id.type == "EditVertex" || id.id.type == "EditMove") {
  43317. this.isEditing = true;
  43318. this.viewer.scene.screenSpaceCameraController.enableRotate = false;
  43319. this.viewer.enableCursorStyle = false;
  43320. this.viewer._element.style.cursor = "";
  43321. document.body.style.cursor = "move";
  43322. this.editVertext = id.id;
  43323. this.editVertext.show = false;
  43324. this.clearMidVertex();
  43325. } else if (id.id.type == "EditMidVertex") {
  43326. this.editPositions.splice(id.id.vertexIndex, 0, id.id.position._value);
  43327. this.clearAllEditVertex();
  43328. this.createEditVertex();
  43329. this.createMidVertex();
  43330. this.isEdited = true;
  43331. } else {
  43332. return;
  43333. }
  43334. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43335. }
  43336. initLeftUpEventHandler() {
  43337. this.eventHandler.setInputAction((e) => {
  43338. if (!this.isEditing)
  43339. return;
  43340. this.viewer.enableCursorStyle = true;
  43341. document.body.style.cursor = "default";
  43342. this.viewer.scene.screenSpaceCameraController.enableRotate = true;
  43343. this.editVertext.show = true;
  43344. this.isEditing = false;
  43345. this.clearMidVertex();
  43346. this.createMidVertex();
  43347. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  43348. }
  43349. initMouseMoveEventHandler() {
  43350. this.eventHandler.setInputAction((e) => {
  43351. var position2 = e.endPosition;
  43352. var ray = this.viewer.scene.camera.getPickRay(position2);
  43353. var cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  43354. if (!cartesian)
  43355. return;
  43356. if (!this.isEditing)
  43357. return;
  43358. if (this.editVertext.type == "EditMove") {
  43359. let startPosition = this.EditMoveCenterPositoin;
  43360. if (!startPosition)
  43361. return;
  43362. this.moveEntityByOffset(startPosition, cartesian);
  43363. } else if (this.editVertext.type == "EditVertex" || this.editVertext.type == "EditMidVertex") {
  43364. this.editPositions[this.editVertext.vertexIndex] = cartesian;
  43365. }
  43366. this.isEdited = true;
  43367. this.EditMoveCenterPositoin = this.getCenterPosition();
  43368. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43369. }
  43370. getCenterPosition() {
  43371. let points2 = [];
  43372. let maxHeight = 0;
  43373. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPoint" || this.editEntity.Type == "DrawSector") {
  43374. return this.editPositions[0];
  43375. }
  43376. this.editPositions.forEach((position2) => {
  43377. const point3d = this.cartesian3ToPoint3D(position2);
  43378. points2.push([point3d.x, point3d.y]);
  43379. if (maxHeight < point3d.z)
  43380. maxHeight = point3d.z;
  43381. });
  43382. let geo = lineString(points2);
  43383. let bbox2 = bbox$1(geo);
  43384. let bboxPolygon$1 = bboxPolygon(bbox2);
  43385. let pointOnFeature = center(bboxPolygon$1);
  43386. let lonLat = pointOnFeature.geometry.coordinates;
  43387. return Cesium.Cartesian3.fromDegrees(lonLat[0], lonLat[1], maxHeight);
  43388. }
  43389. moveEntityByOffset(startPosition, endPosition) {
  43390. let startPoint3d = this.cartesian3ToPoint3D(startPosition);
  43391. let endPoint3d = this.cartesian3ToPoint3D(endPosition);
  43392. let offsetX = endPoint3d.x - startPoint3d.x;
  43393. let offsetY = endPoint3d.y - startPoint3d.y;
  43394. let element;
  43395. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43396. element = this.cartesian3ToPoint3D(this.editPositions[i2]);
  43397. element.x += offsetX;
  43398. element.y += offsetY;
  43399. this.editPositions[i2] = Cesium.Cartesian3.fromDegrees(element.x, element.y, element.z);
  43400. }
  43401. }
  43402. createEditVertex() {
  43403. this.vertexEntities = [];
  43404. this.editPositions.forEach((p, index2) => {
  43405. const entity = this.viewer.entities.add({
  43406. position: new Cesium.CallbackProperty((e) => {
  43407. return this.editPositions[index2];
  43408. }, false),
  43409. type: "EditVertex",
  43410. vertexIndex: index2,
  43411. point: {
  43412. show: true,
  43413. pixelSize: 10,
  43414. color: new Cesium.Color(0, 0, 1, 1),
  43415. outlineWidth: 1,
  43416. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43417. disableDepthTestDistance: 15e11,
  43418. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43419. }
  43420. });
  43421. this.vertexEntities.push(entity);
  43422. });
  43423. if (this.editEntity.Type == "DrawCircle") {
  43424. this.vertexEntities[0].show = false;
  43425. }
  43426. if (this.editPositions.length == 1) {
  43427. return;
  43428. }
  43429. this.createEditMoveCenterEntity();
  43430. }
  43431. createEditMoveCenterEntity() {
  43432. this.EditMoveCenterEntity = this.viewer.entities.add({
  43433. position: new Cesium.CallbackProperty((e) => {
  43434. return this.EditMoveCenterPositoin;
  43435. }, false),
  43436. type: "EditMove",
  43437. point: {
  43438. show: true,
  43439. pixelSize: 12,
  43440. color: new Cesium.Color(0, 1, 0, 0.1),
  43441. outlineWidth: 2,
  43442. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43443. disableDepthTestDistance: 15e11,
  43444. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43445. }
  43446. });
  43447. }
  43448. clearEditVertex() {
  43449. if (this.vertexEntities) {
  43450. this.vertexEntities.forEach((item) => {
  43451. this.viewer.entities.remove(item);
  43452. });
  43453. }
  43454. this.vertexEntities = [];
  43455. this.viewer.entities.remove(this.EditMoveCenterEntity);
  43456. }
  43457. createMidVertex() {
  43458. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPincerArrow" || this.editEntity.Type == "DrawRectangle" || this.editEntity.Type == "DrawStraightArrow" || this.editEntity.Type == "DrawGatheringPlace" || this.editEntity.Type == "DrawSector" || this.editEntity.Type == "DrawBowLine" || this.editEntity.Type == "DrawBowPlane" || this.editEntity.Type == "DrawRectFlag" || this.editEntity.Type == "DrawTriangleFlag" || this.editEntity.Type == "DrawCurveFlag") {
  43459. return;
  43460. }
  43461. this.midVertexEntities = [];
  43462. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43463. const p1 = this.editPositions[i2];
  43464. const p2 = this.editPositions[i2 + 1];
  43465. let mideP = this.midPosition(p1, p2);
  43466. const entity = this.viewer.entities.add({
  43467. position: mideP,
  43468. type: "EditMidVertex",
  43469. vertexIndex: i2 + 1,
  43470. point: {
  43471. show: true,
  43472. pixelSize: 10,
  43473. color: new Cesium.Color(0, 1, 0, 1),
  43474. outlineWidth: 1,
  43475. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43476. disableDepthTestDistance: 15e11,
  43477. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43478. }
  43479. });
  43480. this.midVertexEntities.push(entity);
  43481. }
  43482. }
  43483. clearMidVertex() {
  43484. if (this.midVertexEntities) {
  43485. this.midVertexEntities.forEach((item) => {
  43486. this.viewer.entities.remove(item);
  43487. });
  43488. }
  43489. this.midVertexEntities = [];
  43490. }
  43491. cartesian3ToPoint3D(position2) {
  43492. const cartographic = Cesium.Cartographic.fromCartesian(position2);
  43493. const lon = Cesium.Math.toDegrees(cartographic.longitude);
  43494. const lat = Cesium.Math.toDegrees(cartographic.latitude);
  43495. return {
  43496. x: lon,
  43497. y: lat,
  43498. z: cartographic.height
  43499. };
  43500. }
  43501. midPosition(first, second) {
  43502. if (!first || !second)
  43503. return null;
  43504. let point3d1 = this.cartesian3ToPoint3D(first);
  43505. let point3d2 = this.cartesian3ToPoint3D(second);
  43506. let midLonLat = {
  43507. x: (point3d1.x + point3d2.x) / 2,
  43508. y: (point3d1.y + point3d2.y) / 2,
  43509. z: (point3d1.z + point3d2.z) / 2
  43510. };
  43511. return Cesium.Cartesian3.fromDegrees(midLonLat.x, midLonLat.y, midLonLat.z);
  43512. }
  43513. cartesianToLatlng(cartesian) {
  43514. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  43515. let lat = new Cesium.Math.toDegrees(cartographic.latitude);
  43516. let lng = new Cesium.Math.toDegrees(cartographic.longitude);
  43517. cartographic.height;
  43518. return [lng, lat];
  43519. }
  43520. LatlngTocartesian(latlng) {
  43521. let cartesian3 = new Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  43522. return cartesian3;
  43523. }
  43524. }
  43525. var _style_0$1 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  43526. `;
  43527. const _hoisted_1$1 = { class: "jt-drawing-dialog" };
  43528. const _hoisted_2$1 = {
  43529. slot: "title",
  43530. class: "header-title"
  43531. };
  43532. const _hoisted_3$1 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  43533. const _hoisted_4$1 = { class: "odin-dialog__content" };
  43534. const _hoisted_5$1 = { class: "jt-drawing-row" };
  43535. const _hoisted_6$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  43536. const _hoisted_7$1 = { class: "col-main" };
  43537. const _hoisted_8$1 = { class: "el-body-foot" };
  43538. const _sfc_main$1 = {
  43539. __name: "CrEditProperty_MilitaryPlot.ce",
  43540. props: {
  43541. params: {
  43542. id: {
  43543. type: String,
  43544. default: () => void 0
  43545. },
  43546. color: {
  43547. type: String,
  43548. default: () => "255,255,0,0.9"
  43549. },
  43550. outlineWidth: {
  43551. type: Number,
  43552. default: () => 0
  43553. },
  43554. outlineColor: {
  43555. type: String,
  43556. default: () => "255,255,0,0.9"
  43557. }
  43558. },
  43559. showDialog: {
  43560. type: Boolean,
  43561. default: () => false
  43562. }
  43563. },
  43564. emits: ["submit", "update:showDialog", "update:params", "remove"],
  43565. setup(__props, { expose: __expose, emit }) {
  43566. const props = __props;
  43567. const language = ref("zh-cn");
  43568. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  43569. const {
  43570. proxy
  43571. } = getCurrentInstance();
  43572. const predefineColors = ref([
  43573. "#ff4500",
  43574. "#ff8c00",
  43575. "#ffd700",
  43576. "#90ee90",
  43577. "#00ced1",
  43578. "#1e90ff",
  43579. "#c71585",
  43580. "rgba(255, 69, 0, 0.68)",
  43581. "rgb(255, 120, 0)",
  43582. "hsv(51, 100, 98)",
  43583. "hsva(120, 40, 94, 0.5)",
  43584. "hsl(181, 100%, 37%)",
  43585. "hsla(209, 100%, 56%, 0.73)",
  43586. "#c7158577"
  43587. ]);
  43588. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  43589. const dialogVisible = ref(props.showDialog);
  43590. ref(false);
  43591. const color2 = ref(props.params.color);
  43592. const outlineWidth = ref(0);
  43593. const outlineColor = ref(props.params.outlineColor);
  43594. updateParams(props.params);
  43595. function updateParams(params) {
  43596. proxy._params = params;
  43597. switch (params.id) {
  43598. case "DrawStraightArrow":
  43599. title.value = "\u7ED8\u5236\u76F4\u7EBF\u7BAD\u5934";
  43600. break;
  43601. case "DrawAttackArrow":
  43602. title.value = "\u7ED8\u5236\u653B\u51FB\u7BAD\u5934";
  43603. break;
  43604. case "DrawPincerArrow":
  43605. title.value = "\u7ED8\u5236\u94B3\u51FB\u7BAD\u5934";
  43606. break;
  43607. case "DrawGatheringPlace":
  43608. title.value = "\u7ED8\u5236\u96C6\u7ED3\u5730";
  43609. break;
  43610. case "DrawClosedCurve":
  43611. title.value = "\u7ED8\u5236\u95ED\u5408\u66F2\u9762";
  43612. break;
  43613. case "DrawSector":
  43614. title.value = "\u7ED8\u5236\u6247\u5F62";
  43615. break;
  43616. case "DrawBowLine":
  43617. title.value = "\u7ED8\u5236\u5F13\u5F62\u7EBF";
  43618. break;
  43619. case "DrawLune":
  43620. title.value = "\u7ED8\u5236\u5F13\u5F62\u9762";
  43621. break;
  43622. case "DrawCurve":
  43623. title.value = "\u7ED8\u5236\u66F2\u7EBF";
  43624. break;
  43625. case "DrawCurveFlag":
  43626. title.value = "\u7ED8\u5236\u66F2\u7EBF\u65D7\u5E1C";
  43627. break;
  43628. case "DrawRectFlag":
  43629. title.value = "\u7ED8\u5236\u77E9\u5F62\u76F4\u89D2\u65D7\u5E1C";
  43630. break;
  43631. case "DrawTriangleFlag":
  43632. title.value = "\u7ED8\u5236\u4E09\u89D2\u65D7\u5E1C";
  43633. break;
  43634. }
  43635. color2.value = params.color;
  43636. outlineColor.value = params.outlineColor;
  43637. outlineWidth.value = params.outlineWidth;
  43638. }
  43639. __expose({});
  43640. function submit() {
  43641. let outParam = proxy._params;
  43642. outParam.color = color2.value;
  43643. outParam.outlineColor = outlineColor.value;
  43644. outParam.outlineWidth = outlineWidth.value;
  43645. emit("submit", outParam);
  43646. }
  43647. function close() {
  43648. dialogVisible.value = false;
  43649. }
  43650. function remove2() {
  43651. emit("remove", {});
  43652. dialogVisible.value = false;
  43653. }
  43654. function closeDialog() {
  43655. emit("update:showDialog", false);
  43656. }
  43657. function openDialog() {
  43658. updateParams(props.params);
  43659. }
  43660. return (_ctx, _cache) => {
  43661. return openBlock(), createElementBlock("div", _hoisted_1$1, [
  43662. createVNode(unref(ElDialog), {
  43663. modal: false,
  43664. "destroy-on-close": false,
  43665. modelValue: dialogVisible.value,
  43666. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dialogVisible.value = $event),
  43667. title: title.value,
  43668. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  43669. onClose: closeDialog,
  43670. onOpen: openDialog,
  43671. "show-close": false
  43672. }, {
  43673. header: withCtx(() => [
  43674. createElementVNode("div", _hoisted_2$1, [
  43675. createElementVNode("span", _hoisted_3$1, toDisplayString(title.value), 1)
  43676. ])
  43677. ]),
  43678. default: withCtx(() => [
  43679. createElementVNode("div", _hoisted_4$1, [
  43680. createElementVNode("div", _hoisted_5$1, [
  43681. _hoisted_6$1,
  43682. createElementVNode("div", _hoisted_7$1, [
  43683. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  43684. default: withCtx(() => [
  43685. createVNode(unref(ElColorPicker), {
  43686. modelValue: color2.value,
  43687. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => color2.value = $event),
  43688. "show-alpha": "",
  43689. predefine: predefineColors.value,
  43690. label: "12"
  43691. }, null, 8, ["modelValue", "predefine"])
  43692. ]),
  43693. _: 1
  43694. }, 8, ["locale"])
  43695. ])
  43696. ]),
  43697. createElementVNode("div", _hoisted_8$1, [
  43698. createVNode(unref(ElButtonGroup), null, {
  43699. default: withCtx(() => [
  43700. createVNode(unref(ElButton), {
  43701. type: "primary",
  43702. icon: unref(edit_default),
  43703. onClick: _cache[1] || (_cache[1] = ($event) => submit())
  43704. }, {
  43705. default: withCtx(() => [
  43706. createTextVNode("\u4FEE\u6539")
  43707. ]),
  43708. _: 1
  43709. }, 8, ["icon"]),
  43710. createVNode(unref(ElButton), {
  43711. type: "primary",
  43712. style: { "background-color": "rgb(222, 146, 47)" },
  43713. icon: unref(delete_default),
  43714. onClick: _cache[2] || (_cache[2] = ($event) => remove2())
  43715. }, {
  43716. default: withCtx(() => [
  43717. createTextVNode("\u5220\u9664")
  43718. ]),
  43719. _: 1
  43720. }, 8, ["icon"]),
  43721. createVNode(unref(ElButton), {
  43722. type: "primary",
  43723. style: { "background-color": "rgb(126, 128, 135)" },
  43724. icon: unref(close_default),
  43725. onClick: _cache[3] || (_cache[3] = ($event) => close())
  43726. }, {
  43727. default: withCtx(() => [
  43728. createTextVNode("\u5173\u95ED")
  43729. ]),
  43730. _: 1
  43731. }, 8, ["icon"])
  43732. ]),
  43733. _: 1
  43734. })
  43735. ])
  43736. ])
  43737. ]),
  43738. _: 1
  43739. }, 8, ["modelValue", "title", "style"])
  43740. ]);
  43741. };
  43742. }
  43743. };
  43744. var DialogEditProperty$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["styles", [_style_0$1]]]);
  43745. Cesium.Entity.prototype.setParams = function(params) {
  43746. this._params = params;
  43747. };
  43748. Cesium.Entity.prototype.getParams = function() {
  43749. return this._params;
  43750. };
  43751. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  43752. this._isEdit = isEdit;
  43753. };
  43754. Cesium.Entity.prototype.getIsEdit = function() {
  43755. return this._isEdit;
  43756. };
  43757. class DrawMilitaryPlot {
  43758. constructor(options2) {
  43759. if (!options2.viewer)
  43760. throw new DeveloperError("no options.viewer object!");
  43761. if (!options2.Cesium)
  43762. throw new DeveloperError("no options.Cesium object!");
  43763. this._viewer = options2.viewer;
  43764. this.cesium = options2.Cesium;
  43765. this.drawArr = [];
  43766. this.Draw = "";
  43767. this.edit = new EntityEdit(this._viewer);
  43768. this.edit.activate();
  43769. this.edit.EditEndEntity.addEventListener((result) => {
  43770. if (result.Type) {
  43771. this.handleFirstPosition(result.Type);
  43772. this.edit.DrawExample = this.Draw;
  43773. }
  43774. this._editEntity = result;
  43775. });
  43776. }
  43777. static initEditPropertyParams() {
  43778. return {
  43779. id: void 0,
  43780. color: "rgba(0,255,0,0.75)",
  43781. outlineWidth: 0,
  43782. outlineColor: "rgba(255,255,255,1)"
  43783. };
  43784. }
  43785. editActivate() {
  43786. return this.edit;
  43787. }
  43788. handleFirstPosition(type2) {
  43789. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  43790. switch (type2) {
  43791. case "DrawStraightArrow":
  43792. this.Draw = new MilitaryPlot.DrawStraightArrow({
  43793. viewer: this._viewer,
  43794. Cesium: this.cesium
  43795. });
  43796. break;
  43797. case "DrawAttackArrow":
  43798. this.Draw = new MilitaryPlot.DrawAttackArrow({
  43799. viewer: this._viewer,
  43800. Cesium: this.cesium
  43801. });
  43802. break;
  43803. case "DrawPincerArrow":
  43804. this.Draw = new MilitaryPlot.DrawPincerArrow({
  43805. viewer: this._viewer,
  43806. Cesium: this.cesium
  43807. });
  43808. break;
  43809. case "DrawGatheringPlace":
  43810. this.Draw = new MilitaryPlot.DrawGatheringPlace({
  43811. viewer: this._viewer,
  43812. Cesium: this.cesium
  43813. });
  43814. break;
  43815. case "DrawClosedCurve":
  43816. this.Draw = new MilitaryPlot.DrawClosedCurve({
  43817. viewer: this._viewer,
  43818. Cesium: this.cesium
  43819. });
  43820. break;
  43821. case "DrawSector":
  43822. this.Draw = new MilitaryPlot.DrawSector({
  43823. viewer: this._viewer,
  43824. Cesium: this.cesium
  43825. });
  43826. break;
  43827. case "DrawBowLine":
  43828. this.Draw = new MilitaryPlot.DrawBowLine({
  43829. viewer: this._viewer,
  43830. Cesium: this.cesium
  43831. });
  43832. break;
  43833. case "DrawBowPlane":
  43834. this.Draw = new MilitaryPlot.DrawBowPlane({
  43835. viewer: this._viewer,
  43836. Cesium: this.cesium
  43837. });
  43838. break;
  43839. case "DrawCurve":
  43840. this.Draw = new MilitaryPlot.DrawCurve({
  43841. viewer: this._viewer,
  43842. Cesium: this.cesium
  43843. });
  43844. break;
  43845. case "DrawCurveFlag":
  43846. this.Draw = new MilitaryPlot.DrawCurveFlag({
  43847. viewer: this._viewer,
  43848. Cesium: this.cesium
  43849. });
  43850. break;
  43851. case "DrawRectFlag":
  43852. this.Draw = new MilitaryPlot.DrawRectFlag({
  43853. viewer: this._viewer,
  43854. Cesium: this.cesium
  43855. });
  43856. break;
  43857. case "DrawTriangleFlag":
  43858. this.Draw = new MilitaryPlot.DrawTriangleFlag({
  43859. viewer: this._viewer,
  43860. Cesium: this.cesium
  43861. });
  43862. break;
  43863. case "DrawPoint":
  43864. this.Draw = new MilitaryPlot.DrawPoint({
  43865. viewer: this._viewer,
  43866. Cesium: this.cesium
  43867. });
  43868. break;
  43869. case "DrawPolyline":
  43870. this.Draw = new MilitaryPlot.DrawPolyline({
  43871. viewer: this._viewer,
  43872. Cesium: this.cesium
  43873. });
  43874. break;
  43875. case "DrawPolygon":
  43876. this.Draw = new MilitaryPlot.DrawPolygon({
  43877. viewer: this._viewer,
  43878. Cesium: this.cesium
  43879. });
  43880. break;
  43881. case "DrawRectangle":
  43882. this.Draw = new MilitaryPlot.DrawRectangle({
  43883. viewer: this._viewer,
  43884. Cesium: this.cesium
  43885. });
  43886. break;
  43887. case "DrawCircle":
  43888. this.Draw = new MilitaryPlot.DrawCircle({
  43889. viewer: this._viewer,
  43890. Cesium: this.cesium
  43891. });
  43892. break;
  43893. }
  43894. }
  43895. addEntity(data) {
  43896. this.handleFirstPosition(data.type);
  43897. if (this.Draw) {
  43898. let entity = this.Draw.addload(data.position);
  43899. entity._id = data.id;
  43900. return entity;
  43901. }
  43902. }
  43903. }
  43904. Object.assign(DrawMilitaryPlot.prototype, {
  43905. _setMousePointerStyle() {
  43906. document.querySelector("body").style.cursor = "crosshair";
  43907. },
  43908. _setMouseDefaultStyle() {
  43909. document.querySelector("body").style.cursor = "default";
  43910. },
  43911. _registerLeftClickEvent(handler, callChange) {
  43912. let _self = this;
  43913. if (!handler)
  43914. return;
  43915. handler.setInputAction(function(event2) {
  43916. _self._lock = true;
  43917. clearTimeout(_self._timer);
  43918. _self._timer = setTimeout(function() {
  43919. if (callChange)
  43920. callChange(event2);
  43921. _self._lock = false;
  43922. }, 200);
  43923. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  43924. },
  43925. _registerMouseMoveEvent(handler, callChange) {
  43926. let _self = this;
  43927. if (!handler)
  43928. return;
  43929. handler.setInputAction(function(event2) {
  43930. if (_self._lock === void 0 || _self._lock === false) {
  43931. if (callChange)
  43932. callChange(event2);
  43933. }
  43934. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43935. },
  43936. _registerLeftDownEvent(handler, callChange) {
  43937. if (!handler)
  43938. return;
  43939. handler.setInputAction(function(event2) {
  43940. if (callChange)
  43941. callChange(event2);
  43942. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43943. },
  43944. _registerLeftUpEvent(handler, callChange) {
  43945. if (!handler)
  43946. return;
  43947. handler.setInputAction(function(event2) {
  43948. if (callChange)
  43949. callChange(event2);
  43950. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  43951. },
  43952. _clearEvent(handler) {
  43953. if (!handler)
  43954. return;
  43955. handler.destroy();
  43956. handler = null;
  43957. }
  43958. });
  43959. Object.assign(DrawMilitaryPlot.prototype, {
  43960. _setEntityIsEdit(entity) {
  43961. let _self = this;
  43962. this._closePropertyEditDialog();
  43963. entity.setIsEdit(true);
  43964. this.edit.handlePickEditEntity(entity);
  43965. this._sendShowPropertyDialog(entity);
  43966. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  43967. this._registerLeftClickEvent(handler, function(event2) {
  43968. _self._closePropertyEditDialog();
  43969. let feature2 = _self._viewer.scene.pick(event2.position);
  43970. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  43971. let editEntity = feature2.id;
  43972. if (editEntity.Type == "DrawStraightArrow" || editEntity.Type == "DrawAttackArrow" || editEntity.Type == "DrawPincerArrow" || editEntity.Type == "DrawGatheringPlace" || editEntity.Type == "DrawClosedCurve" || editEntity.Type == "DrawSector" || editEntity.Type == "DrawBowLine" || editEntity.Type == "DrawBowPlane" || editEntity.Type == "DrawCurve" || editEntity.Type == "DrawCurveFlag" || editEntity.Type == "DrawRectFlag" || editEntity.Type == "DrawTriangleFlag" || editEntity.Type == "DrawPoint" || editEntity.Type == "DrawPolyline" || editEntity.Type == "DrawPolygon" || editEntity.Type == "DrawRectangle" || editEntity.Type == "DrawCircle") {
  43973. _self._sendShowPropertyDialog(feature2.id);
  43974. }
  43975. }
  43976. });
  43977. },
  43978. _sendShowPropertyDialog(entity) {
  43979. let _self = this;
  43980. let editEntityType = entity.Type;
  43981. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  43982. return;
  43983. }
  43984. let editProperty = entity.getParams();
  43985. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  43986. editProperty.id = editEntityType;
  43987. _self._openPropertyEditDialog(
  43988. editProperty,
  43989. function(params) {
  43990. _self.updateEditEntityProperty(params);
  43991. },
  43992. function() {
  43993. _self._viewer.entities.remove(entity);
  43994. _self.edit.clearAllEditVertex();
  43995. }
  43996. );
  43997. }
  43998. },
  43999. updateEditEntityProperty: function(params) {
  44000. if (this._editEntity === void 0)
  44001. return;
  44002. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  44003. return;
  44004. let editEntityType = this._editEntity.Type;
  44005. if (editEntityType === void 0)
  44006. return;
  44007. let material = this._editEntity.polygon.material;
  44008. if (material instanceof Cesium.ColorMaterialProperty) {
  44009. let newMaterial = this._materialColorProperty({
  44010. color: params.color
  44011. });
  44012. this._editEntity.polygon.material = newMaterial;
  44013. }
  44014. if (this._editEntity.polyline !== void 0) {
  44015. let newMaterial = this._materialColorProperty({
  44016. color: params.outlineColor
  44017. });
  44018. this._editEntity.polyline.material = newMaterial;
  44019. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  44020. }
  44021. this._editEntity.setParams(params);
  44022. },
  44023. _materialColorProperty(options2) {
  44024. let mColor = "rgba(0,255,0,1)";
  44025. if (options2 !== void 0 && options2.color !== void 0)
  44026. mColor = options2.color;
  44027. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  44028. colorMaterial._param = {
  44029. color: mColor
  44030. };
  44031. return colorMaterial;
  44032. }
  44033. });
  44034. Object.assign(DrawMilitaryPlot.prototype, {
  44035. drawActivate(type2) {
  44036. this._setMousePointerStyle();
  44037. this.handleFirstPosition(type2);
  44038. this.Draw.startCreate(type2);
  44039. this.Draw.DrawEndEvent.addEventListener((entity, positions, drawType) => {
  44040. console.log({
  44041. entity,
  44042. positions,
  44043. drawType
  44044. });
  44045. this._setMouseDefaultStyle();
  44046. if (entity) {
  44047. let entityParam = DrawMilitaryPlot.initEditPropertyParams();
  44048. entity.setParams(entityParam);
  44049. this._setEntityIsEdit(entity);
  44050. }
  44051. });
  44052. this.drawArr.push(this.Draw);
  44053. return this.Draw;
  44054. },
  44055. clearOne: function() {
  44056. this.Draw.clear();
  44057. },
  44058. clearAll: function() {
  44059. for (var i2 = 0; i2 < this.drawArr.length; i2++) {
  44060. this.drawArr[i2].clear();
  44061. }
  44062. this.edit.deactivate();
  44063. this._closePropertyEditDialog();
  44064. let buttonDiv = document.getElementById("drawButtonDiv");
  44065. if (buttonDiv) {
  44066. document.body.removeChild(buttonDiv);
  44067. }
  44068. }
  44069. });
  44070. Object.assign(DrawMilitaryPlot.prototype, {
  44071. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  44072. this._editPropertyDialogDomId = "dialog-property-dom-militaryplot";
  44073. this._registerDOMPropertyEdit = "dialog-edit-property-militaryplot";
  44074. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  44075. if (PropertyEditComponent === void 0) {
  44076. PropertyEditComponent = defineCustomElement(DialogEditProperty$1);
  44077. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  44078. }
  44079. this._closePropertyEditDialog();
  44080. let dialogPropertyElement = new PropertyEditComponent({
  44081. params
  44082. });
  44083. dialogPropertyElement.id = this._editPropertyDialogDomId;
  44084. dialogPropertyElement.showDialog = true;
  44085. document.body.appendChild(dialogPropertyElement);
  44086. dialogPropertyElement.addEventListener(
  44087. "submit",
  44088. (e) => {
  44089. if (callEdit)
  44090. callEdit(e.detail[0]);
  44091. },
  44092. false
  44093. );
  44094. dialogPropertyElement.addEventListener(
  44095. "remove",
  44096. (e) => {
  44097. if (callRemove)
  44098. callRemove();
  44099. },
  44100. false
  44101. );
  44102. },
  44103. _closePropertyEditDialog() {
  44104. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  44105. if (dom2 !== null && dom2 !== void 0) {
  44106. document.body.removeChild(dom2);
  44107. }
  44108. }
  44109. });
  44110. var _style_0 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.el-input-number{line-height:30rem!important;width:150rem}.el-input-number__decrease,.el-input-number__increase{top:1rem!important;bottom:1rem!important;width:32rem!important;font-size:13rem!important;background-color:#409eff}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.el-scrollbar{color:#fff!important;background-color:#052d73!important;overflow:visible!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#409eff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;left:10rem;background:rgba(0,44,126,.68);height:calc(100% - 175rem);width:180rem;top:125rem;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .content{height:calc(100% - 120rem);width:92%;overflow-y:auto;padding:5rem 0 0;position:absolute}.jt-drawing-dialog .el-dialog .el-collapse{--el-collapse-border-color: rgb(0 44 126 / 0%);--el-collapse-header-text-color: #ffffff;--el-collapse-header-font-size: 13rem;--el-collapse-content-bg-color: rgb(0 44 126 / 0%);--el-collapse-content-font-size: 13rem;--el-collapse-content-text-color: rgb(216 240 255);--el-collapse-header-height: 40rem;--el-collapse-header-bg-color: rgb(30 130 255)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__header{background-color:#409eff;border-bottom:2px solid rgb(22,90,190)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__content{padding:10rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  44111. `;
  44112. const _hoisted_1 = { class: "jt-drawing-dialog" };
  44113. const _hoisted_2 = {
  44114. slot: "title",
  44115. class: "header-title"
  44116. };
  44117. const _hoisted_3 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  44118. const _hoisted_4 = { class: "content" };
  44119. const _hoisted_5 = {
  44120. class: "jt-drawing-row",
  44121. style: { "height": "60rem" }
  44122. };
  44123. const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5185\u5BB9", -1);
  44124. const _hoisted_7 = { class: "col-main" };
  44125. const _hoisted_8 = { class: "jt-drawing-row" };
  44126. const _hoisted_9 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53", -1);
  44127. const _hoisted_10 = { class: "col-main" };
  44128. const _hoisted_11 = { class: "jt-drawing-row" };
  44129. const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53\u5927\u5C0F", -1);
  44130. const _hoisted_13 = { class: "col-main" };
  44131. const _hoisted_14 = { class: "jt-drawing-row" };
  44132. const _hoisted_15 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u52A0\u7C97", -1);
  44133. const _hoisted_16 = { class: "col-main" };
  44134. const _hoisted_17 = { class: "jt-drawing-row" };
  44135. const _hoisted_18 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u659C\u4F53", -1);
  44136. const _hoisted_19 = { class: "col-main" };
  44137. const _hoisted_20 = { class: "jt-drawing-row" };
  44138. const _hoisted_21 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44139. const _hoisted_22 = { class: "col-main" };
  44140. const _hoisted_23 = { class: "jt-drawing-row" };
  44141. const _hoisted_24 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44142. const _hoisted_25 = { class: "col-main" };
  44143. const _hoisted_26 = { class: "jt-drawing-row" };
  44144. const _hoisted_27 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44145. const _hoisted_28 = { class: "col-main" };
  44146. const _hoisted_29 = { class: "jt-drawing-row" };
  44147. const _hoisted_30 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44148. const _hoisted_31 = { class: "col-main" };
  44149. const _hoisted_32 = { class: "jt-drawing-row" };
  44150. const _hoisted_33 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u80CC\u666F", -1);
  44151. const _hoisted_34 = { class: "col-main" };
  44152. const _hoisted_35 = { class: "jt-drawing-row" };
  44153. const _hoisted_36 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u989C\u8272", -1);
  44154. const _hoisted_37 = { class: "col-main" };
  44155. const _hoisted_38 = { class: "jt-drawing-row" };
  44156. const _hoisted_39 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u5185\u8FB9\u8DDD", -1);
  44157. const _hoisted_40 = { class: "col-main" };
  44158. const _hoisted_41 = { class: "jt-drawing-row" };
  44159. const _hoisted_42 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A2A\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44160. const _hoisted_43 = { class: "col-main" };
  44161. const _hoisted_44 = { class: "jt-drawing-row" };
  44162. const _hoisted_45 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EB5\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44163. const _hoisted_46 = { class: "col-main" };
  44164. const _hoisted_47 = { class: "jt-drawing-row" };
  44165. const _hoisted_48 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u50CF\u7D20\u5927\u5C0F", -1);
  44166. const _hoisted_49 = { class: "col-main" };
  44167. const _hoisted_50 = { class: "jt-drawing-row" };
  44168. const _hoisted_51 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44169. const _hoisted_52 = { class: "col-main" };
  44170. const _hoisted_53 = { class: "jt-drawing-row" };
  44171. const _hoisted_54 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44172. const _hoisted_55 = { class: "col-main" };
  44173. const _hoisted_56 = { class: "jt-drawing-row" };
  44174. const _hoisted_57 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44175. const _hoisted_58 = { class: "col-main" };
  44176. const _hoisted_59 = { class: "jt-drawing-row" };
  44177. const _hoisted_60 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44178. const _hoisted_61 = { class: "col-main" };
  44179. const _hoisted_62 = {
  44180. class: "jt-drawing-row",
  44181. style: { "height": "60rem" }
  44182. };
  44183. const _hoisted_63 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u56FE\u6807", -1);
  44184. const _hoisted_64 = { class: "col-main" };
  44185. const _hoisted_65 = { class: "jt-drawing-row" };
  44186. const _hoisted_66 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5927\u5C0F\u6BD4\u4F8B", -1);
  44187. const _hoisted_67 = { class: "col-main" };
  44188. const _hoisted_68 = {
  44189. class: "jt-drawing-row",
  44190. style: { "height": "60rem" }
  44191. };
  44192. const _hoisted_69 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A21\u578B\u8DEF\u5F84", -1);
  44193. const _hoisted_70 = { class: "col-main" };
  44194. const _hoisted_71 = { class: "jt-drawing-row" };
  44195. const _hoisted_72 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u900F\u660E\u5EA6", -1);
  44196. const _hoisted_73 = { class: "col-main" };
  44197. const _hoisted_74 = { class: "jt-drawing-row" };
  44198. const _hoisted_75 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6700\u5C0F\u50CF\u7D20\u5927\u5C0F", -1);
  44199. const _hoisted_76 = { class: "col-main" };
  44200. const _hoisted_77 = { class: "jt-drawing-row" };
  44201. const _hoisted_78 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44202. const _hoisted_79 = { class: "col-main" };
  44203. const _hoisted_80 = { class: "jt-drawing-row" };
  44204. const _hoisted_81 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44205. const _hoisted_82 = { class: "col-main" };
  44206. const _hoisted_83 = { class: "jt-drawing-row" };
  44207. const _hoisted_84 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44208. const _hoisted_85 = { class: "col-main" };
  44209. const _hoisted_86 = { class: "el-body-foot" };
  44210. const _sfc_main = {
  44211. __name: "CrEditProperty_Point.ce",
  44212. props: {
  44213. params: {
  44214. id: {
  44215. type: String,
  44216. default: () => void 0
  44217. },
  44218. text: {
  44219. type: String,
  44220. default: () => ""
  44221. },
  44222. font: {
  44223. type: String,
  44224. default: () => ""
  44225. },
  44226. fontSize: {
  44227. type: Number,
  44228. default: () => 24
  44229. },
  44230. color: {
  44231. type: String,
  44232. default: () => "255,255,0,0.9"
  44233. }
  44234. },
  44235. showDialog: {
  44236. type: Boolean,
  44237. default: () => false
  44238. }
  44239. },
  44240. emits: ["submit", "update:showDialog", "update:params", "remove"],
  44241. setup(__props, { emit }) {
  44242. const props = __props;
  44243. const language = ref("zh-cn");
  44244. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  44245. const {
  44246. proxy
  44247. } = getCurrentInstance();
  44248. const predefineColors = ref([
  44249. "#ff4500",
  44250. "#ff8c00",
  44251. "#ffd700",
  44252. "#90ee90",
  44253. "#00ced1",
  44254. "#1e90ff",
  44255. "#c71585",
  44256. "rgba(255, 69, 0, 0.68)",
  44257. "rgb(255, 120, 0)",
  44258. "hsv(51, 100, 98)",
  44259. "hsva(120, 40, 94, 0.5)",
  44260. "hsl(181, 100%, 37%)",
  44261. "hsla(209, 100%, 56%, 0.73)",
  44262. "#c7158577"
  44263. ]);
  44264. const selectOptionsFont = [
  44265. {
  44266. value: "Helvetica",
  44267. label: "\u9ED8\u8BA4\u5B57\u4F53"
  44268. },
  44269. {
  44270. value: "Microsoft YaHei",
  44271. label: "\u5FAE\u8F6F\u96C5\u9ED1"
  44272. },
  44273. {
  44274. value: "\u5B8B\u4F53",
  44275. label: "\u5B8B\u4F53"
  44276. },
  44277. {
  44278. value: "\u6977\u4F53",
  44279. label: "\u6977\u4F53"
  44280. },
  44281. {
  44282. value: "\u96B6\u4E66",
  44283. label: "\u96B6\u4E66"
  44284. },
  44285. {
  44286. value: "\u9ED1\u4F53",
  44287. label: "\u9ED1\u4F53"
  44288. }
  44289. ];
  44290. const activeNames = ref(["1"]);
  44291. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  44292. const dialogVisible = ref(props.showDialog);
  44293. const isShowLabelStyle = ref(false);
  44294. const isShowPointStyle = ref(false);
  44295. const isShowBillboardStyle = ref(false);
  44296. const isShowModelStyle = ref(false);
  44297. const label = ref({
  44298. content: "",
  44299. font: "",
  44300. fontSize: 0,
  44301. bolder: false,
  44302. italic: false,
  44303. fillColor: "",
  44304. showOutline: false,
  44305. outlineColor: "",
  44306. outlineWidth: 0,
  44307. showBackground: false,
  44308. backgroundColor: "",
  44309. backgroundPadding: 0,
  44310. pixelOffsetX: 0,
  44311. pixelOffsetY: 0
  44312. });
  44313. const point2 = ref({
  44314. color: "",
  44315. pixelSize: 10,
  44316. showOutline: false,
  44317. outlineColor: "",
  44318. outlineWidth: 0
  44319. });
  44320. const billboard = ref({
  44321. imgUrl: "",
  44322. alpha: 1,
  44323. scale: 1
  44324. });
  44325. const model = ref({
  44326. url: "",
  44327. alpha: 1,
  44328. showSilhouette: false,
  44329. silhouetteSize: 0,
  44330. silhouetteColor: "rgba(255,255,255,1)",
  44331. minimumPixelSize: 1,
  44332. maximumScale: 1,
  44333. heading: 0,
  44334. pitch: 0,
  44335. roll: 0
  44336. });
  44337. updateParams(props.params);
  44338. function updateParams(params) {
  44339. proxy._params = params;
  44340. _setShowControls(false);
  44341. if (params.id === DrawPoint.DrawType.Label) {
  44342. title.value = "\u6587\u5B57\u7F16\u8F91";
  44343. activeNames.value = ["\u6807\u6CE8\u6837\u5F0F"];
  44344. isShowLabelStyle.value = true;
  44345. label.value.content = params.label.text;
  44346. label.value.font = params.label.font;
  44347. label.value.fontSize = params.label.fontSize;
  44348. label.value.fillColor = params.label.fillColor;
  44349. label.value.showOutline = params.label.showOutline;
  44350. label.value.outlineColor = params.label.outlineColor;
  44351. label.value.outlineWidth = params.label.outlineWidth;
  44352. label.value.showBackground = params.label.showBackground;
  44353. label.value.backgroundColor = params.label.backgroundColor;
  44354. label.value.backgroundPadding = params.label.backgroundPadding;
  44355. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44356. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44357. } else if (params.id === DrawPoint.DrawType.Point) {
  44358. title.value = "\u70B9\u7F16\u8F91";
  44359. activeNames.value = ["\u70B9\u6837\u5F0F"];
  44360. isShowPointStyle.value = true;
  44361. point2.value.color = params.point.color;
  44362. point2.value.pixelSize = params.point.pixelSize;
  44363. point2.value.showOutline = params.point.showOutline;
  44364. point2.value.outlineColor = params.point.outlineColor;
  44365. point2.value.outlineWidth = params.point.outlineWidth;
  44366. } else if (params.id === DrawPoint.DrawType.Point2Label) {
  44367. title.value = "\u70B9\u53CA\u6587\u5B57\u7F16\u8F91";
  44368. activeNames.value = ["\u70B9\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44369. isShowPointStyle.value = true;
  44370. isShowLabelStyle.value = true;
  44371. point2.value.color = params.point.color;
  44372. point2.value.pixelSize = params.point.pixelSize;
  44373. point2.value.showOutline = params.point.showOutline;
  44374. point2.value.outlineColor = params.point.outlineColor;
  44375. point2.value.outlineWidth = params.point.outlineWidth;
  44376. label.value.content = params.label.text;
  44377. label.value.font = params.label.font;
  44378. label.value.fontSize = params.label.fontSize;
  44379. label.value.fillColor = params.label.fillColor;
  44380. label.value.showOutline = params.label.showOutline;
  44381. label.value.outlineColor = params.label.outlineColor;
  44382. label.value.outlineWidth = params.label.outlineWidth;
  44383. label.value.showBackground = params.label.showBackground;
  44384. label.value.backgroundColor = params.label.backgroundColor;
  44385. label.value.backgroundPadding = params.label.backgroundPadding;
  44386. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44387. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44388. } else if (params.id === DrawPoint.DrawType.Billboard) {
  44389. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  44390. activeNames.value = ["\u56FE\u7247\u6837\u5F0F"];
  44391. isShowBillboardStyle.value = true;
  44392. billboard.value.imgUrl = params.billboard.imgUrl;
  44393. billboard.value.alpha = params.billboard.alpha;
  44394. billboard.value.scale = params.billboard.scale;
  44395. } else if (params.id === DrawPoint.DrawType.Billboard2Label) {
  44396. title.value = "\u5E7F\u544A\u724C\u53CA\u6587\u5B57\u5706\u7F16\u8F91";
  44397. activeNames.value = ["\u56FE\u7247\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44398. isShowBillboardStyle.value = true;
  44399. isShowLabelStyle.value = true;
  44400. billboard.value.imgUrl = params.billboard.imgUrl;
  44401. billboard.value.alpha = params.billboard.alpha;
  44402. billboard.value.scale = params.billboard.scale;
  44403. label.value.content = params.label.text;
  44404. label.value.font = params.label.font;
  44405. label.value.fontSize = params.label.fontSize;
  44406. label.value.fillColor = params.label.fillColor;
  44407. label.value.showOutline = params.label.showOutline;
  44408. label.value.outlineColor = params.label.outlineColor;
  44409. label.value.outlineWidth = params.label.outlineWidth;
  44410. label.value.showBackground = params.label.showBackground;
  44411. label.value.backgroundColor = params.label.backgroundColor;
  44412. label.value.backgroundPadding = params.label.backgroundPadding;
  44413. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44414. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44415. } else if (params.id === DrawPoint.DrawType.Model) {
  44416. title.value = "\u5C0F\u6A21\u578B\u7F16\u8F91";
  44417. activeNames.value = ["\u5C0F\u6A21\u578B\u6837\u5F0F"];
  44418. isShowModelStyle.value = true;
  44419. model.value.url = params.model.url;
  44420. model.value.alpha = params.model.alpha;
  44421. model.value.showSilhouette = params.model.showSilhouette;
  44422. model.value.silhouetteColor = params.model.silhouetteColor;
  44423. model.value.silhouetteSize = params.model.silhouetteSize;
  44424. model.value.minimumPixelSize = params.model.minimumPixelSize;
  44425. model.value.maximumScale = params.model.maximumScale;
  44426. model.value.heading = params.model.heading;
  44427. model.value.pitch = params.model.pitch;
  44428. model.value.roll = params.model.roll;
  44429. }
  44430. }
  44431. function _setShowControls(isShow) {
  44432. isShowLabelStyle.value = isShow;
  44433. isShowPointStyle.value = isShow;
  44434. isShowBillboardStyle.value = isShow;
  44435. isShowModelStyle.value = isShow;
  44436. }
  44437. function submit() {
  44438. let outParam = proxy._params;
  44439. outParam = {
  44440. id: outParam.id,
  44441. label: {
  44442. text: label.value.content,
  44443. font: label.value.font,
  44444. fontSize: label.value.fontSize,
  44445. bolder: label.value.bolder,
  44446. italic: label.value.italic,
  44447. fillColor: label.value.fillColor,
  44448. showOutline: label.value.showOutline,
  44449. outlineWidth: label.value.outlineWidth,
  44450. outlineColor: label.value.outlineColor,
  44451. showBackground: label.value.showBackground,
  44452. backgroundColor: label.value.backgroundColor,
  44453. backgroundPadding: label.value.backgroundPadding,
  44454. pixelOffsetX: label.value.pixelOffsetX,
  44455. pixelOffsetY: label.value.pixelOffsetY
  44456. },
  44457. point: {
  44458. color: point2.value.color,
  44459. pixelSize: point2.value.pixelSize,
  44460. showOutline: point2.value.showOutline,
  44461. outlineWidth: point2.value.outlineWidth,
  44462. outlineColor: point2.value.outlineColor
  44463. },
  44464. billboard: {
  44465. imgUrl: billboard.value.imgUrl,
  44466. alpha: billboard.value.alpha,
  44467. scale: billboard.value.scale
  44468. },
  44469. model: {
  44470. url: model.value.url,
  44471. alpha: model.value.alpha,
  44472. showSilhouette: model.value.showSilhouette,
  44473. silhouetteColor: model.value.silhouetteColor,
  44474. silhouetteSize: model.value.silhouetteSize,
  44475. minimumPixelSize: model.value.minimumPixelSize,
  44476. maximumScale: model.value.maximumScale,
  44477. heading: model.value.heading,
  44478. pitch: model.value.pitch,
  44479. roll: model.value.roll
  44480. }
  44481. };
  44482. emit("submit", outParam);
  44483. }
  44484. function close() {
  44485. dialogVisible.value = false;
  44486. }
  44487. function remove2() {
  44488. emit("remove", {});
  44489. dialogVisible.value = false;
  44490. }
  44491. function closeDialog() {
  44492. emit("update:showDialog", false);
  44493. }
  44494. function openDialog() {
  44495. updateParams(props.params);
  44496. }
  44497. return (_ctx, _cache) => {
  44498. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  44499. return openBlock(), createElementBlock("div", _hoisted_1, [
  44500. createVNode(unref(ElDialog), {
  44501. modal: false,
  44502. "destroy-on-close": false,
  44503. modelValue: dialogVisible.value,
  44504. "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => dialogVisible.value = $event),
  44505. title: title.value,
  44506. onClose: closeDialog,
  44507. onOpen: openDialog,
  44508. "show-close": false
  44509. }, {
  44510. header: withCtx(() => [
  44511. createElementVNode("div", _hoisted_2, [
  44512. createElementVNode("span", _hoisted_3, toDisplayString(title.value), 1)
  44513. ])
  44514. ]),
  44515. default: withCtx(() => [
  44516. createVNode(_component_el_scrollbar, null, {
  44517. default: withCtx(() => [
  44518. createElementVNode("div", _hoisted_4, [
  44519. createVNode(unref(ElCollapse), {
  44520. modelValue: activeNames.value,
  44521. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => activeNames.value = $event)
  44522. }, {
  44523. default: withCtx(() => [
  44524. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u6807\u6CE8\u6837\u5F0F" }, {
  44525. title: withCtx(() => [
  44526. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44527. default: withCtx(() => [
  44528. createVNode(unref(setting_default))
  44529. ]),
  44530. _: 1
  44531. }),
  44532. createTextVNode("\u6807\u6CE8\u6837\u5F0F ")
  44533. ]),
  44534. default: withCtx(() => [
  44535. createElementVNode("div", _hoisted_5, [
  44536. _hoisted_6,
  44537. createElementVNode("div", _hoisted_7, [
  44538. createVNode(unref(ElInput), {
  44539. modelValue: label.value.content,
  44540. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label.value.content = $event),
  44541. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  44542. clearable: "",
  44543. type: "textarea",
  44544. rows: 2
  44545. }, null, 8, ["modelValue"])
  44546. ])
  44547. ]),
  44548. createElementVNode("div", _hoisted_8, [
  44549. _hoisted_9,
  44550. createElementVNode("div", _hoisted_10, [
  44551. createVNode(unref(ElSelect), {
  44552. modelValue: label.value.font,
  44553. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => label.value.font = $event),
  44554. placeholder: "\u8BF7\u9009\u62E9"
  44555. }, {
  44556. default: withCtx(() => [
  44557. (openBlock(), createElementBlock(Fragment, null, renderList(selectOptionsFont, (item) => {
  44558. return createVNode(unref(ElOption), {
  44559. key: item.value,
  44560. label: item.label,
  44561. value: item.value
  44562. }, null, 8, ["label", "value"]);
  44563. }), 64))
  44564. ]),
  44565. _: 1
  44566. }, 8, ["modelValue"])
  44567. ])
  44568. ]),
  44569. createElementVNode("div", _hoisted_11, [
  44570. _hoisted_12,
  44571. createElementVNode("div", _hoisted_13, [
  44572. createVNode(unref(ElInputNumber), {
  44573. modelValue: label.value.fontSize,
  44574. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => label.value.fontSize = $event),
  44575. min: 0,
  44576. max: 100
  44577. }, null, 8, ["modelValue"])
  44578. ])
  44579. ]),
  44580. createElementVNode("div", _hoisted_14, [
  44581. _hoisted_15,
  44582. createElementVNode("div", _hoisted_16, [
  44583. createVNode(unref(ElSwitch), {
  44584. modelValue: label.value.bolder,
  44585. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => label.value.bolder = $event)
  44586. }, null, 8, ["modelValue"])
  44587. ])
  44588. ]),
  44589. createElementVNode("div", _hoisted_17, [
  44590. _hoisted_18,
  44591. createElementVNode("div", _hoisted_19, [
  44592. createVNode(unref(ElSwitch), {
  44593. modelValue: label.value.italic,
  44594. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => label.value.italic = $event)
  44595. }, null, 8, ["modelValue"])
  44596. ])
  44597. ]),
  44598. createElementVNode("div", _hoisted_20, [
  44599. _hoisted_21,
  44600. createElementVNode("div", _hoisted_22, [
  44601. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44602. default: withCtx(() => [
  44603. createVNode(unref(ElColorPicker), {
  44604. modelValue: label.value.fillColor,
  44605. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => label.value.fillColor = $event),
  44606. "show-alpha": "",
  44607. predefine: predefineColors.value,
  44608. label: "12"
  44609. }, null, 8, ["modelValue", "predefine"])
  44610. ]),
  44611. _: 1
  44612. }, 8, ["locale"])
  44613. ])
  44614. ]),
  44615. createElementVNode("div", _hoisted_23, [
  44616. _hoisted_24,
  44617. createElementVNode("div", _hoisted_25, [
  44618. createVNode(unref(ElSwitch), {
  44619. modelValue: label.value.showOutline,
  44620. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => label.value.showOutline = $event)
  44621. }, null, 8, ["modelValue"])
  44622. ])
  44623. ]),
  44624. withDirectives(createElementVNode("div", _hoisted_26, [
  44625. _hoisted_27,
  44626. createElementVNode("div", _hoisted_28, [
  44627. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44628. default: withCtx(() => [
  44629. createVNode(unref(ElColorPicker), {
  44630. modelValue: label.value.outlineColor,
  44631. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => label.value.outlineColor = $event),
  44632. "show-alpha": "",
  44633. predefine: predefineColors.value,
  44634. label: "12"
  44635. }, null, 8, ["modelValue", "predefine"])
  44636. ]),
  44637. _: 1
  44638. }, 8, ["locale"])
  44639. ])
  44640. ], 512), [
  44641. [vShow, label.value.showOutline]
  44642. ]),
  44643. withDirectives(createElementVNode("div", _hoisted_29, [
  44644. _hoisted_30,
  44645. createElementVNode("div", _hoisted_31, [
  44646. createVNode(unref(ElInputNumber), {
  44647. modelValue: label.value.outlineWidth,
  44648. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => label.value.outlineWidth = $event),
  44649. min: 0,
  44650. max: 100
  44651. }, null, 8, ["modelValue"])
  44652. ])
  44653. ], 512), [
  44654. [vShow, label.value.showOutline]
  44655. ]),
  44656. createElementVNode("div", _hoisted_32, [
  44657. _hoisted_33,
  44658. createElementVNode("div", _hoisted_34, [
  44659. createVNode(unref(ElSwitch), {
  44660. modelValue: label.value.showBackground,
  44661. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => label.value.showBackground = $event)
  44662. }, null, 8, ["modelValue"])
  44663. ])
  44664. ]),
  44665. withDirectives(createElementVNode("div", _hoisted_35, [
  44666. _hoisted_36,
  44667. createElementVNode("div", _hoisted_37, [
  44668. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44669. default: withCtx(() => [
  44670. createVNode(unref(ElColorPicker), {
  44671. modelValue: label.value.backgroundColor,
  44672. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => label.value.backgroundColor = $event),
  44673. "show-alpha": "",
  44674. predefine: predefineColors.value,
  44675. label: "12"
  44676. }, null, 8, ["modelValue", "predefine"])
  44677. ]),
  44678. _: 1
  44679. }, 8, ["locale"])
  44680. ])
  44681. ], 512), [
  44682. [vShow, label.value.showBackground]
  44683. ]),
  44684. withDirectives(createElementVNode("div", _hoisted_38, [
  44685. _hoisted_39,
  44686. createElementVNode("div", _hoisted_40, [
  44687. createVNode(unref(ElInputNumber), {
  44688. modelValue: label.value.backgroundPadding,
  44689. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => label.value.backgroundPadding = $event),
  44690. min: -100,
  44691. max: 100
  44692. }, null, 8, ["modelValue"])
  44693. ])
  44694. ], 512), [
  44695. [vShow, label.value.showBackground]
  44696. ]),
  44697. createElementVNode("div", _hoisted_41, [
  44698. _hoisted_42,
  44699. createElementVNode("div", _hoisted_43, [
  44700. createVNode(unref(ElInputNumber), {
  44701. modelValue: label.value.pixelOffsetX,
  44702. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => label.value.pixelOffsetX = $event),
  44703. min: -100,
  44704. max: 100
  44705. }, null, 8, ["modelValue"])
  44706. ])
  44707. ]),
  44708. createElementVNode("div", _hoisted_44, [
  44709. _hoisted_45,
  44710. createElementVNode("div", _hoisted_46, [
  44711. createVNode(unref(ElInputNumber), {
  44712. modelValue: label.value.pixelOffsetY,
  44713. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => label.value.pixelOffsetY = $event),
  44714. min: -100,
  44715. max: 100
  44716. }, null, 8, ["modelValue"])
  44717. ])
  44718. ])
  44719. ]),
  44720. _: 1
  44721. }, 512), [
  44722. [vShow, isShowLabelStyle.value]
  44723. ]),
  44724. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u70B9\u6837\u5F0F" }, {
  44725. title: withCtx(() => [
  44726. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44727. default: withCtx(() => [
  44728. createVNode(unref(setting_default))
  44729. ]),
  44730. _: 1
  44731. }),
  44732. createTextVNode("\u70B9\u6837\u5F0F ")
  44733. ]),
  44734. default: withCtx(() => [
  44735. createElementVNode("div", _hoisted_47, [
  44736. _hoisted_48,
  44737. createElementVNode("div", _hoisted_49, [
  44738. createVNode(unref(ElInputNumber), {
  44739. modelValue: point2.value.pixelSize,
  44740. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => point2.value.pixelSize = $event),
  44741. min: 0,
  44742. max: 100
  44743. }, null, 8, ["modelValue"])
  44744. ])
  44745. ]),
  44746. createElementVNode("div", _hoisted_50, [
  44747. _hoisted_51,
  44748. createElementVNode("div", _hoisted_52, [
  44749. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44750. default: withCtx(() => [
  44751. createVNode(unref(ElColorPicker), {
  44752. modelValue: point2.value.color,
  44753. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => point2.value.color = $event),
  44754. "show-alpha": "",
  44755. predefine: predefineColors.value,
  44756. label: "12"
  44757. }, null, 8, ["modelValue", "predefine"])
  44758. ]),
  44759. _: 1
  44760. }, 8, ["locale"])
  44761. ])
  44762. ]),
  44763. createElementVNode("div", _hoisted_53, [
  44764. _hoisted_54,
  44765. createElementVNode("div", _hoisted_55, [
  44766. createVNode(unref(ElSwitch), {
  44767. modelValue: point2.value.showOutline,
  44768. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => point2.value.showOutline = $event)
  44769. }, null, 8, ["modelValue"])
  44770. ])
  44771. ]),
  44772. withDirectives(createElementVNode("div", _hoisted_56, [
  44773. _hoisted_57,
  44774. createElementVNode("div", _hoisted_58, [
  44775. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44776. default: withCtx(() => [
  44777. createVNode(unref(ElColorPicker), {
  44778. modelValue: point2.value.outlineColor,
  44779. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => point2.value.outlineColor = $event),
  44780. "show-alpha": "",
  44781. predefine: predefineColors.value,
  44782. label: "12"
  44783. }, null, 8, ["modelValue", "predefine"])
  44784. ]),
  44785. _: 1
  44786. }, 8, ["locale"])
  44787. ])
  44788. ], 512), [
  44789. [vShow, point2.value.showOutline]
  44790. ]),
  44791. withDirectives(createElementVNode("div", _hoisted_59, [
  44792. _hoisted_60,
  44793. createElementVNode("div", _hoisted_61, [
  44794. createVNode(unref(ElInputNumber), {
  44795. modelValue: point2.value.outlineWidth,
  44796. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => point2.value.outlineWidth = $event),
  44797. min: 0,
  44798. max: 100
  44799. }, null, 8, ["modelValue"])
  44800. ])
  44801. ], 512), [
  44802. [vShow, point2.value.showOutline]
  44803. ])
  44804. ]),
  44805. _: 1
  44806. }, 512), [
  44807. [vShow, isShowPointStyle.value]
  44808. ]),
  44809. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u56FE\u7247\u6837\u5F0F" }, {
  44810. title: withCtx(() => [
  44811. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44812. default: withCtx(() => [
  44813. createVNode(unref(setting_default))
  44814. ]),
  44815. _: 1
  44816. }),
  44817. createTextVNode("\u56FE\u7247\u6837\u5F0F ")
  44818. ]),
  44819. default: withCtx(() => [
  44820. createElementVNode("div", _hoisted_62, [
  44821. _hoisted_63,
  44822. createElementVNode("div", _hoisted_64, [
  44823. createVNode(unref(ElInput), {
  44824. modelValue: billboard.value.imgUrl,
  44825. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => billboard.value.imgUrl = $event),
  44826. placeholder: "\u8F93\u5165\u56FE\u6807\u8DEF\u5F84",
  44827. clearable: "",
  44828. type: "textarea",
  44829. rows: 2
  44830. }, null, 8, ["modelValue"])
  44831. ])
  44832. ]),
  44833. createElementVNode("div", _hoisted_65, [
  44834. _hoisted_66,
  44835. createElementVNode("div", _hoisted_67, [
  44836. createVNode(unref(ElInputNumber), {
  44837. modelValue: billboard.value.scale,
  44838. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => billboard.value.scale = $event),
  44839. min: 1,
  44840. max: 100
  44841. }, null, 8, ["modelValue"])
  44842. ])
  44843. ])
  44844. ]),
  44845. _: 1
  44846. }, 512), [
  44847. [vShow, isShowBillboardStyle.value]
  44848. ]),
  44849. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u5C0F\u6A21\u578B\u6837\u5F0F" }, {
  44850. title: withCtx(() => [
  44851. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44852. default: withCtx(() => [
  44853. createVNode(unref(setting_default))
  44854. ]),
  44855. _: 1
  44856. }),
  44857. createTextVNode("\u5C0F\u6A21\u578B\u6837\u5F0F ")
  44858. ]),
  44859. default: withCtx(() => [
  44860. createElementVNode("div", _hoisted_68, [
  44861. _hoisted_69,
  44862. createElementVNode("div", _hoisted_70, [
  44863. createVNode(unref(ElInput), {
  44864. modelValue: model.value.url,
  44865. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => model.value.url = $event),
  44866. placeholder: "\u8F93\u5165\u6A21\u578B\u8DEF\u5F84",
  44867. clearable: "",
  44868. type: "textarea",
  44869. rows: 2
  44870. }, null, 8, ["modelValue"])
  44871. ])
  44872. ]),
  44873. createElementVNode("div", _hoisted_71, [
  44874. _hoisted_72,
  44875. createElementVNode("div", _hoisted_73, [
  44876. createVNode(unref(ElInputNumber), {
  44877. modelValue: model.value.alpha,
  44878. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => model.value.alpha = $event),
  44879. step: 0.1,
  44880. min: 0,
  44881. max: 1
  44882. }, null, 8, ["modelValue"])
  44883. ])
  44884. ]),
  44885. createElementVNode("div", _hoisted_74, [
  44886. _hoisted_75,
  44887. createElementVNode("div", _hoisted_76, [
  44888. createVNode(unref(ElInputNumber), {
  44889. modelValue: model.value.minimumPixelSize,
  44890. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => model.value.minimumPixelSize = $event),
  44891. step: 1,
  44892. min: 0,
  44893. max: 2e4
  44894. }, null, 8, ["modelValue"])
  44895. ])
  44896. ]),
  44897. createElementVNode("div", _hoisted_77, [
  44898. _hoisted_78,
  44899. createElementVNode("div", _hoisted_79, [
  44900. createVNode(unref(ElSwitch), {
  44901. modelValue: model.value.showSilhouette,
  44902. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => model.value.showSilhouette = $event)
  44903. }, null, 8, ["modelValue"])
  44904. ])
  44905. ]),
  44906. withDirectives(createElementVNode("div", _hoisted_80, [
  44907. _hoisted_81,
  44908. createElementVNode("div", _hoisted_82, [
  44909. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44910. default: withCtx(() => [
  44911. createVNode(unref(ElColorPicker), {
  44912. modelValue: model.value.silhouetteColor,
  44913. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => model.value.silhouetteColor = $event),
  44914. "show-alpha": "",
  44915. predefine: predefineColors.value,
  44916. label: "12"
  44917. }, null, 8, ["modelValue", "predefine"])
  44918. ]),
  44919. _: 1
  44920. }, 8, ["locale"])
  44921. ])
  44922. ], 512), [
  44923. [vShow, model.value.showSilhouette]
  44924. ]),
  44925. withDirectives(createElementVNode("div", _hoisted_83, [
  44926. _hoisted_84,
  44927. createElementVNode("div", _hoisted_85, [
  44928. createVNode(unref(ElInputNumber), {
  44929. modelValue: model.value.silhouetteSize,
  44930. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => model.value.silhouetteSize = $event),
  44931. step: 1,
  44932. min: 0,
  44933. max: 100
  44934. }, null, 8, ["modelValue"])
  44935. ])
  44936. ], 512), [
  44937. [vShow, model.value.showSilhouette]
  44938. ])
  44939. ]),
  44940. _: 1
  44941. }, 512), [
  44942. [vShow, isShowModelStyle.value]
  44943. ])
  44944. ]),
  44945. _: 1
  44946. }, 8, ["modelValue"])
  44947. ]),
  44948. createElementVNode("div", _hoisted_86, [
  44949. createVNode(unref(ElButtonGroup), null, {
  44950. default: withCtx(() => [
  44951. createVNode(unref(ElButton), {
  44952. type: "primary",
  44953. icon: unref(edit_default),
  44954. onClick: _cache[28] || (_cache[28] = ($event) => submit())
  44955. }, {
  44956. default: withCtx(() => [
  44957. createTextVNode("\u4FEE\u6539")
  44958. ]),
  44959. _: 1
  44960. }, 8, ["icon"]),
  44961. createVNode(unref(ElButton), {
  44962. type: "primary",
  44963. style: { "background-color": "rgb(222, 146, 47)" },
  44964. icon: unref(delete_default),
  44965. onClick: _cache[29] || (_cache[29] = ($event) => remove2())
  44966. }, {
  44967. default: withCtx(() => [
  44968. createTextVNode("\u5220\u9664")
  44969. ]),
  44970. _: 1
  44971. }, 8, ["icon"]),
  44972. createVNode(unref(ElButton), {
  44973. type: "primary",
  44974. style: { "background-color": "rgb(126, 128, 135)" },
  44975. icon: unref(close_default),
  44976. onClick: _cache[30] || (_cache[30] = ($event) => close())
  44977. }, {
  44978. default: withCtx(() => [
  44979. createTextVNode("\u5173\u95ED")
  44980. ]),
  44981. _: 1
  44982. }, 8, ["icon"])
  44983. ]),
  44984. _: 1
  44985. })
  44986. ])
  44987. ]),
  44988. _: 1
  44989. })
  44990. ]),
  44991. _: 1
  44992. }, 8, ["modelValue", "title"])
  44993. ]);
  44994. };
  44995. }
  44996. };
  44997. var DialogEditProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["styles", [_style_0]]]);
  44998. Cesium.Entity.prototype.setParams = function(params) {
  44999. this._params = params;
  45000. };
  45001. Cesium.Entity.prototype.getParams = function() {
  45002. return this._params;
  45003. };
  45004. Cesium.Entity.prototype.setEntityType = function(entityType) {
  45005. this._entityType = entityType;
  45006. };
  45007. Cesium.Entity.prototype.getEntityType = function(entityType) {
  45008. return this._entityType;
  45009. };
  45010. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  45011. this._isEdit = isEdit;
  45012. };
  45013. Cesium.Entity.prototype.getIsEdit = function() {
  45014. return this._isEdit;
  45015. };
  45016. class DrawPoint {
  45017. constructor(viewer2) {
  45018. if (!viewer2)
  45019. throw new Cesium.DeveloperError("no viewer object!");
  45020. this._viewer = viewer2;
  45021. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  45022. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  45023. this._entities = [];
  45024. this._pointObject = new PointObject(viewer2);
  45025. }
  45026. static initEditPropertyParams() {
  45027. return {
  45028. id: void 0,
  45029. label: {
  45030. text: "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0",
  45031. font: "Helvetica",
  45032. fontSize: 24,
  45033. bolder: false,
  45034. italic: false,
  45035. fillColor: "rgba(0,255,0,0.75)",
  45036. showOutline: false,
  45037. outlineWidth: 0,
  45038. outlineColor: "rgba(255,255,255,1)",
  45039. showBackground: false,
  45040. backgroundPadding: 0,
  45041. backgroundColor: "rgba(255,255,255,1)",
  45042. pixelOffsetX: 0,
  45043. pixelOffsetY: 0
  45044. },
  45045. point: {
  45046. color: "rgba(0,255,0,0.75)",
  45047. pixelSize: 10,
  45048. showOutline: false,
  45049. outlineWidth: 0,
  45050. outlineColor: "rgba(255,255,255,1)"
  45051. },
  45052. billboard: {
  45053. imgUrl: "jt3dSDK/imgs/point/point3.png",
  45054. alpha: 1,
  45055. scale: 1
  45056. },
  45057. model: {
  45058. url: "jt3dSDK/gltf/pyramid.glb",
  45059. alpha: 1,
  45060. showSilhouette: false,
  45061. silhouetteColor: "rgba(255,255,255,1)",
  45062. silhouetteSize: 0,
  45063. minimumPixelSize: 128,
  45064. maximumScale: 2e4,
  45065. heading: 0,
  45066. pitch: 0,
  45067. roll: 0
  45068. }
  45069. };
  45070. }
  45071. _cartesian3ToGeo(position2) {
  45072. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45073. return {
  45074. longitude: Cesium.Math.toDegrees(g.longitude),
  45075. latitude: Cesium.Math.toDegrees(g.latitude),
  45076. height: g.height
  45077. };
  45078. }
  45079. _arcToDegree(arc) {
  45080. return arc / Math.PI * 180;
  45081. }
  45082. _getScreenClickPositionAndHeight(screenPoint) {
  45083. var lng = void 0, lat = void 0, height2 = void 0;
  45084. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  45085. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  45086. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45087. var feature2 = this._viewer.scene.pick(screenPoint);
  45088. if (feature2 == void 0) {
  45089. lng = this._arcToDegree(cartographic.longitude);
  45090. lat = this._arcToDegree(cartographic.latitude);
  45091. height2 = cartographic.height;
  45092. } else {
  45093. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  45094. if (Cesium.defined(cartesian)) {
  45095. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  45096. lng = this._arcToDegree(cartographic.longitude);
  45097. lat = this._arcToDegree(cartographic.latitude);
  45098. height2 = cartographic.height;
  45099. }
  45100. }
  45101. return {
  45102. lng,
  45103. lat,
  45104. height: height2
  45105. };
  45106. }
  45107. _transfromFromScreenPoint(screenPosition) {
  45108. let location = this._getScreenClickPositionAndHeight(screenPosition);
  45109. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  45110. return {
  45111. gLocation: location,
  45112. sLocation: cartesian
  45113. };
  45114. }
  45115. }
  45116. Object.assign(DrawPoint.prototype, {
  45117. _setMousePointerStyle() {
  45118. document.querySelector("body").style.cursor = "crosshair";
  45119. },
  45120. _setMouseDefaultStyle() {
  45121. document.querySelector("body").style.cursor = "default";
  45122. },
  45123. _registerLeftClickEvent(handler, callChange) {
  45124. let _self = this;
  45125. if (!handler)
  45126. return;
  45127. handler.setInputAction(function(event2) {
  45128. _self._lock = true;
  45129. clearTimeout(_self._timer);
  45130. _self._timer = setTimeout(function() {
  45131. if (callChange)
  45132. callChange(event2);
  45133. _self._lock = false;
  45134. }, 200);
  45135. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  45136. },
  45137. _registerMouseMoveEvent(handler, callChange) {
  45138. let _self = this;
  45139. if (!handler)
  45140. return;
  45141. handler.setInputAction(function(event2) {
  45142. if (_self._lock === void 0 || _self._lock === false) {
  45143. if (callChange)
  45144. callChange(event2);
  45145. }
  45146. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45147. },
  45148. _registerLeftDownEvent(handler, callChange) {
  45149. if (!handler)
  45150. return;
  45151. handler.setInputAction(function(event2) {
  45152. if (callChange)
  45153. callChange(event2);
  45154. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45155. },
  45156. _registerLeftUpEvent(handler, callChange) {
  45157. if (!handler)
  45158. return;
  45159. handler.setInputAction(function(event2) {
  45160. if (callChange)
  45161. callChange(event2);
  45162. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  45163. },
  45164. _clearEvent(handler) {
  45165. if (!handler)
  45166. return;
  45167. handler.destroy();
  45168. handler = null;
  45169. }
  45170. });
  45171. Object.assign(DrawPoint.prototype, {
  45172. draw: function(type2, options2) {
  45173. let _self = this;
  45174. _self._unActivateEdit();
  45175. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45176. this._drawType = type2;
  45177. switch (type2) {
  45178. case DrawPoint.DrawType.Model:
  45179. _self._sketchDrawModel(_self._drawEventHandler, options2);
  45180. break;
  45181. case DrawPoint.DrawType.Label:
  45182. _self._sketchDrawLabel(_self._drawEventHandler, options2);
  45183. break;
  45184. case DrawPoint.DrawType.Point:
  45185. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  45186. break;
  45187. case DrawPoint.DrawType.Point2Label:
  45188. _self._sketchDrawPoint2Label(_self._drawEventHandler, options2);
  45189. break;
  45190. case DrawPoint.DrawType.Billboard:
  45191. _self._sketchDrawBillboard(_self._drawEventHandler, options2);
  45192. break;
  45193. case DrawPoint.DrawType.Billboard2Label:
  45194. _self._sketchDrawBillboard2Label(_self._drawEventHandler, options2);
  45195. break;
  45196. }
  45197. },
  45198. clearAll() {
  45199. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45200. var getById = viewer.entities.getById(this._entities[i2]);
  45201. if (getById) {
  45202. this._viewer.entities.remove(getById);
  45203. }
  45204. }
  45205. this._closePropertyEditDialog();
  45206. },
  45207. _sketchDrawLabel(handler, options2) {
  45208. let _self = this;
  45209. this._registerLeftClickEvent(handler, function(event2) {
  45210. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45211. if (!Cesium.defined(loc2.sLocation))
  45212. return;
  45213. let entityParam = DrawPoint.initEditPropertyParams();
  45214. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45215. entityParam.label.pixelOffset = {
  45216. x: entityParam.label.pixelOffsetX,
  45217. y: entityParam.label.pixelOffsetY
  45218. };
  45219. _self._pointObject.addLabel(loc2.sLocation, {
  45220. label: entityParam.label
  45221. }).then((entity) => {
  45222. _self._viewer.entities.add(entity);
  45223. _self._entities.push(entity.id);
  45224. entityParam = DrawPoint.initEditPropertyParams();
  45225. _self._drawEntity = entity;
  45226. _self._drawEntity.setParams(entityParam);
  45227. _self._drawEntity.setEntityType(DrawPoint.DrawType.Label);
  45228. _self._setEntityIsEdit(_self._drawEntity);
  45229. _self._clearEvent(handler);
  45230. if (options2.onComplete)
  45231. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45232. });
  45233. });
  45234. },
  45235. _sketchDrawPoint(handler, options2) {
  45236. let _self = this;
  45237. this._registerLeftClickEvent(handler, function(event2) {
  45238. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45239. if (!Cesium.defined(loc2.sLocation))
  45240. return;
  45241. let entityParam = DrawPoint.initEditPropertyParams();
  45242. _self._pointObject.addPoint(loc2.sLocation, {
  45243. point: entityParam.point
  45244. }).then((entity) => {
  45245. _self._viewer.entities.add(entity);
  45246. _self._entities.push(entity.id);
  45247. entityParam = DrawPoint.initEditPropertyParams();
  45248. _self._drawEntity = entity;
  45249. _self._drawEntity.setParams(entityParam);
  45250. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point);
  45251. _self._setEntityIsEdit(_self._drawEntity);
  45252. _self._clearEvent(handler);
  45253. if (options2.onComplete)
  45254. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45255. });
  45256. });
  45257. },
  45258. _sketchDrawPoint2Label(handler, options2) {
  45259. let _self = this;
  45260. this._registerLeftClickEvent(handler, function(event2) {
  45261. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45262. if (!Cesium.defined(loc2.sLocation))
  45263. return;
  45264. let entityParam = DrawPoint.initEditPropertyParams();
  45265. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45266. entityParam.label.pixelOffset = {
  45267. x: entityParam.label.pixelOffsetX,
  45268. y: entityParam.label.pixelOffsetY - 10
  45269. };
  45270. _self._pointObject.addPoint(loc2.sLocation, {
  45271. point: entityParam.point,
  45272. label: entityParam.label
  45273. }).then((entity) => {
  45274. _self._viewer.entities.add(entity);
  45275. _self._entities.push(entity.id);
  45276. entityParam = DrawPoint.initEditPropertyParams();
  45277. entityParam.label.pixelOffsetY = -10;
  45278. _self._drawEntity = entity;
  45279. _self._drawEntity.setParams(entityParam);
  45280. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point2Label);
  45281. _self._setEntityIsEdit(_self._drawEntity);
  45282. _self._clearEvent(handler);
  45283. if (options2.onComplete)
  45284. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45285. });
  45286. });
  45287. },
  45288. _sketchDrawBillboard(handler, options2) {
  45289. let _self = this;
  45290. this._registerLeftClickEvent(handler, function(event2) {
  45291. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45292. if (!Cesium.defined(loc2.sLocation))
  45293. return;
  45294. let entityParam = DrawPoint.initEditPropertyParams();
  45295. _self._pointObject.addBillboard(loc2.sLocation, {
  45296. billboard: entityParam.billboard
  45297. }).then((entity) => {
  45298. _self._viewer.entities.add(entity);
  45299. _self._entities.push(entity.id);
  45300. entityParam = DrawPoint.initEditPropertyParams();
  45301. entityParam.label.pixelOffsetY = -50;
  45302. _self._drawEntity = entity;
  45303. _self._drawEntity.setParams(entityParam);
  45304. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard);
  45305. _self._setEntityIsEdit(_self._drawEntity);
  45306. _self._clearEvent(handler);
  45307. if (options2.onComplete)
  45308. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45309. });
  45310. });
  45311. },
  45312. _sketchDrawBillboard2Label(handler, options2) {
  45313. let _self = this;
  45314. this._registerLeftClickEvent(handler, function(event2) {
  45315. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45316. if (!Cesium.defined(loc2.sLocation))
  45317. return;
  45318. let entityParam = DrawPoint.initEditPropertyParams();
  45319. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45320. entityParam.label.pixelOffset = {
  45321. x: entityParam.label.pixelOffsetX,
  45322. y: entityParam.label.pixelOffsetY - 50
  45323. };
  45324. _self._pointObject.addBillboard(loc2.sLocation, {
  45325. billboard: entityParam.billboard,
  45326. label: entityParam.label
  45327. }).then((entity) => {
  45328. _self._viewer.entities.add(entity);
  45329. _self._entities.push(entity.id);
  45330. entityParam = DrawPoint.initEditPropertyParams();
  45331. _self._drawEntity = entity;
  45332. _self._drawEntity.setParams(entityParam);
  45333. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard2Label);
  45334. _self._setEntityIsEdit(_self._drawEntity);
  45335. _self._clearEvent(handler);
  45336. if (options2.onComplete)
  45337. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45338. });
  45339. });
  45340. },
  45341. _sketchDrawModel(handler, options2) {
  45342. let _self = this;
  45343. this._registerLeftClickEvent(handler, function(event2) {
  45344. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45345. if (!Cesium.defined(loc2.sLocation))
  45346. return;
  45347. let entityParam = DrawPoint.initEditPropertyParams();
  45348. _self._pointObject.addModel(loc2.sLocation, {
  45349. model: entityParam.model
  45350. }).then((entity) => {
  45351. _self._viewer.entities.add(entity);
  45352. _self._entities.push(entity.id);
  45353. entityParam = DrawPoint.initEditPropertyParams();
  45354. _self._drawEntity = entity;
  45355. _self._drawEntity.setParams(entityParam);
  45356. _self._drawEntity.setEntityType(DrawPoint.DrawType.Model);
  45357. _self._setEntityIsEdit(_self._drawEntity);
  45358. _self._clearEvent(handler);
  45359. if (options2.onComplete)
  45360. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45361. });
  45362. });
  45363. },
  45364. updateEditEntityProperty: function(params) {
  45365. if (this._editEntity === void 0)
  45366. return;
  45367. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  45368. return;
  45369. let editEntityType = this._editEntity.getEntityType();
  45370. if (editEntityType === void 0)
  45371. return;
  45372. if (editEntityType === DrawPoint.DrawType.Label) {
  45373. this._updateLabelProperty(params);
  45374. } else if (editEntityType === DrawPoint.DrawType.Point) {
  45375. this._updatePointProperty(params);
  45376. } else if (editEntityType === DrawPoint.DrawType.Point2Label) {
  45377. this._updatePoint2LabelProperty(params);
  45378. } else if (editEntityType === DrawPoint.DrawType.Billboard) {
  45379. this._updateBillboardProperty(params);
  45380. } else if (editEntityType === DrawPoint.DrawType.Billboard2Label) {
  45381. this._updateBillboard2LabelProperty(params);
  45382. } else if (editEntityType === DrawPoint.DrawType.Model) {
  45383. this._updateModelProperty(params);
  45384. }
  45385. },
  45386. _updateLabelProperty(params) {
  45387. let label = params.label;
  45388. this._editEntity.label.text = label.text;
  45389. let font = "";
  45390. if (label.italic) {
  45391. font += "italic ";
  45392. }
  45393. if (label.bolder) {
  45394. font += " bolder ";
  45395. }
  45396. font += label.fontSize + "px " + label.font;
  45397. this._editEntity.label.font = font;
  45398. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45399. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45400. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45401. this._editEntity.label.showBackground = label.showBackground;
  45402. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45403. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45404. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label.pixelOffsetX), parseFloat(label.pixelOffsetY));
  45405. this._editEntity.setParams(params);
  45406. },
  45407. _updatePointProperty(params) {
  45408. let point2 = params.point;
  45409. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45410. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45411. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45412. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45413. this._editEntity.setParams(params);
  45414. },
  45415. _updatePoint2LabelProperty(params) {
  45416. let label = params.label;
  45417. this._editEntity.label.text = label.text;
  45418. let font = "";
  45419. if (label.italic) {
  45420. font += "italic ";
  45421. }
  45422. if (label.bolder) {
  45423. font += " bolder ";
  45424. }
  45425. font += label.fontSize + "px " + label.font;
  45426. this._editEntity.label.font = font;
  45427. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45428. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45429. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45430. this._editEntity.label.showBackground = label.showBackground;
  45431. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45432. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45433. let point2 = params.point;
  45434. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45435. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45436. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45437. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45438. this._editEntity.setParams(params);
  45439. },
  45440. _updateBillboardProperty(params) {
  45441. let billboard = params.billboard;
  45442. this._editEntity.billboard.image = billboard.imgUrl;
  45443. this._editEntity.billboard.scale = billboard.scale;
  45444. this._editEntity.setParams(params);
  45445. },
  45446. _updateBillboard2LabelProperty(params) {
  45447. let label = params.label;
  45448. this._editEntity.label.text = label.text;
  45449. let font = "";
  45450. if (label.italic) {
  45451. font += "italic ";
  45452. }
  45453. if (label.bolder) {
  45454. font += " bolder ";
  45455. }
  45456. font += label.fontSize + "px " + label.font;
  45457. this._editEntity.label.font = font;
  45458. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45459. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45460. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45461. this._editEntity.label.showBackground = label.showBackground;
  45462. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45463. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45464. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label.pixelOffsetX), parseFloat(label.pixelOffsetY));
  45465. let billboard = params.billboard;
  45466. this._editEntity.billboard.image = billboard.imgUrl;
  45467. this._editEntity.billboard.scale = billboard.scale;
  45468. this._editEntity.setParams(params);
  45469. }
  45470. });
  45471. Object.assign(DrawPoint.prototype, {
  45472. _setEntityIsEdit(entity) {
  45473. let _self = this;
  45474. this._unActivateEdit();
  45475. entity.setIsEdit(true);
  45476. this._sendShowPropertyDialog(entity);
  45477. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45478. this._registerLeftClickEvent(handler, function(event2) {
  45479. _self._unActivateEdit();
  45480. let feature2 = _self._viewer.scene.pick(event2.position);
  45481. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45482. let editEntityType = feature2.id.getEntityType();
  45483. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45484. feature2.id.setIsEdit(true);
  45485. _self._sendShowPropertyDialog(feature2.id);
  45486. }
  45487. }
  45488. });
  45489. this._registerMouseMoveEvent(handler, function(event2) {
  45490. let toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45491. let feature2 = _self._viewer.scene.pick(event2.endPosition);
  45492. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45493. let editEntityType = feature2.id.getEntityType();
  45494. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45495. if (feature2.id.getIsEdit()) {
  45496. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45497. CreateRemindertip(toolTip, event2.endPosition, true);
  45498. } else {
  45499. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027";
  45500. CreateRemindertip(toolTip, event2.endPosition, true);
  45501. }
  45502. }
  45503. } else {
  45504. CreateRemindertip(toolTip, event2.endPosition, false);
  45505. }
  45506. });
  45507. },
  45508. _unActivateEdit: function() {
  45509. if (this._sketchEditHandler != void 0) {
  45510. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45511. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45512. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45513. }
  45514. this._editEntity = void 0;
  45515. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45516. var getById = this._viewer.entities.getById(this._entities[i2]);
  45517. if (getById) {
  45518. getById.setIsEdit(false);
  45519. }
  45520. }
  45521. this._closePropertyEditDialog();
  45522. },
  45523. _sendShowPropertyDialog(entity) {
  45524. let _self = this;
  45525. let editEntityType = entity.getEntityType();
  45526. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  45527. this._unActivateEdit();
  45528. return;
  45529. }
  45530. let editProperty = entity.getParams();
  45531. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  45532. editProperty.id = editEntityType;
  45533. _self._openPropertyEditDialog(
  45534. editProperty,
  45535. function(params) {
  45536. _self.updateEditEntityProperty(params);
  45537. },
  45538. function() {
  45539. _self._viewer.entities.remove(entity);
  45540. _self._editEntity = void 0;
  45541. }
  45542. );
  45543. }
  45544. this._activeteNormalEdit(entity);
  45545. },
  45546. _activeteNormalEdit: function(editEntity) {
  45547. let _self = this;
  45548. editEntity.getEntityType();
  45549. this._editEntity = editEntity;
  45550. if (this._sketchEditHandler === void 0) {
  45551. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45552. }
  45553. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  45554. const pickInfo = _self._viewer.scene.pick(event2.position);
  45555. console.log(pickInfo);
  45556. if (!pickInfo) {
  45557. return;
  45558. }
  45559. console.log("\u6309\u4E0B");
  45560. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  45561. _self._registerMouseMoveEvent(_self._sketchEditHandler, function(event3) {
  45562. console.log("\u79FB\u52A8");
  45563. const position2 = event3.endPosition;
  45564. const cartesian = _self._viewer.scene.globe.pick(_self._viewer.camera.getPickRay(position2), _self._viewer.scene);
  45565. const selectedEntity = _self._editEntity;
  45566. if (!selectedEntity) {
  45567. return false;
  45568. }
  45569. selectedEntity.position = cartesian;
  45570. });
  45571. _self._registerLeftUpEvent(_self._sketchEditHandler, function(event3) {
  45572. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45573. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45574. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  45575. console.log("\u62AC\u8D77");
  45576. });
  45577. });
  45578. },
  45579. _updateModelProperty(params) {
  45580. let model = params.model;
  45581. this._editEntity.model.uri = model.url;
  45582. this._editEntity.model.color = Cesium.Color.WHITE.withAlpha(model.alpha);
  45583. this._editEntity.model.minimumPixelSize = model.minimumPixelSize;
  45584. this._editEntity.model.maximumScale = model.maximumScale;
  45585. this._editEntity.model.silhouetteSize = model.silhouetteSize;
  45586. this._editEntity.model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  45587. var heading = Cesium.Math.toRadians(model.heading);
  45588. var pitch = model.pitch;
  45589. var roll = model.roll;
  45590. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  45591. this._editEntity.setParams(params);
  45592. }
  45593. });
  45594. Object.assign(DrawPoint.prototype, {
  45595. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  45596. this._editPropertyDialogDomId = "dialog-property-dom-point";
  45597. this._registerDOMPropertyEdit = "dialog-edit-property-point";
  45598. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  45599. if (PropertyEditComponent === void 0) {
  45600. PropertyEditComponent = defineCustomElement(DialogEditProperty);
  45601. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  45602. }
  45603. this._closePropertyEditDialog();
  45604. let dialogPropertyElement = new PropertyEditComponent({
  45605. params
  45606. });
  45607. dialogPropertyElement.id = this._editPropertyDialogDomId;
  45608. dialogPropertyElement.showDialog = true;
  45609. document.body.appendChild(dialogPropertyElement);
  45610. dialogPropertyElement.addEventListener(
  45611. "submit",
  45612. (e) => {
  45613. if (callEdit)
  45614. callEdit(e.detail[0]);
  45615. },
  45616. false
  45617. );
  45618. dialogPropertyElement.addEventListener(
  45619. "remove",
  45620. (e) => {
  45621. if (callRemove)
  45622. callRemove();
  45623. },
  45624. false
  45625. );
  45626. },
  45627. _closePropertyEditDialog() {
  45628. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  45629. if (dom2 !== null && dom2 !== void 0) {
  45630. document.body.removeChild(dom2);
  45631. }
  45632. }
  45633. });
  45634. DrawPoint.DrawType = Object.freeze({
  45635. Model: "model",
  45636. Label: "label",
  45637. Point: "point",
  45638. Point2Label: "point2Label",
  45639. Billboard: "billboard",
  45640. Billboard2Label: "billboard2Label"
  45641. });
  45642. var MultiFieldAdaptWindow$1 = "";
  45643. class MultiFieldAdaptWindow {
  45644. constructor(viewer2, position2, title, properties, offsetHeight) {
  45645. if (!viewer2)
  45646. throw new Cesium.DeveloperError("no viewer object!");
  45647. if (!position2)
  45648. throw new Cesium.DeveloperError("no position object!");
  45649. this.viewer = viewer2;
  45650. this.position = position2;
  45651. this.offsetHeight = offsetHeight;
  45652. if (position2 instanceof Cesium.Cartesian3) {
  45653. this.position = position2;
  45654. } else {
  45655. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  45656. }
  45657. if (document.getElementsByClassName("MultiField-popup").length > 0) {
  45658. document.getElementsByClassName("MultiField-popup")[0].remove();
  45659. viewer2.entities.remove(viewer2.entities.getById("MultiFieldPopupPoint"));
  45660. }
  45661. this.id = "popup_" + getGuid();
  45662. this.popupDiv = document.createElement("div");
  45663. this.popupDiv.classList.add("MultiField-popup");
  45664. this.popupDiv.id = this.id;
  45665. this.viewer.container.append(this.popupDiv);
  45666. this.popupDiv.innerHTML = this._createHtml(title, properties);
  45667. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  45668. this.initPoint();
  45669. document.getElementsByClassName("leaflet-popup-close-button")[0].onclick = () => {
  45670. this.close();
  45671. };
  45672. }
  45673. postRender() {
  45674. this.viewer.scene.canvas.height;
  45675. const windowPosition = new Cesium.Cartesian2();
  45676. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  45677. this.viewer.scene,
  45678. this.position,
  45679. windowPosition
  45680. );
  45681. let elWidth = this.popupDiv.offsetWidth;
  45682. let elHeight = this.popupDiv.offsetHeight;
  45683. if (!!this.offsetHeight) {
  45684. elHeight += this.offsetHeight;
  45685. }
  45686. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  45687. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  45688. const camerPosition = this.viewer.camera.position;
  45689. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  45690. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  45691. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  45692. this.popupDiv.style.display = "block";
  45693. } else {
  45694. this.popupDiv.style.display = "none";
  45695. }
  45696. }
  45697. _createHtml(header, content) {
  45698. let html = `
  45699. <div class="MultiField-popup-header">
  45700. ` + header + `
  45701. <span class="leaflet-popup-close-button">\xD7</span>
  45702. </div>
  45703. <div class="MultiField-popup-content">
  45704. ` + this._createTable(content) + `
  45705. </div>
  45706. <div class="MultiField-popup-tip">
  45707. </div>
  45708. `;
  45709. return html;
  45710. }
  45711. _createTable(content) {
  45712. let html = '<table class="table-popup">';
  45713. for (let key in content) {
  45714. html += `<tr><td class="title-popup">${key}</td>
  45715. <td class="value-popup">${content[key]}</td></tr>`;
  45716. }
  45717. html += "</table>";
  45718. return html;
  45719. }
  45720. initPoint() {
  45721. this.billboard = new Cesium.Entity({
  45722. id: "MultiFieldPopupPoint",
  45723. name: "popupPoint",
  45724. position: this.position,
  45725. billboard: {
  45726. image: "jt3dSDK/imgs/point/point.png",
  45727. horizontalOrigin: Cesium.HorizontalOrigin.center,
  45728. verticalOrigin: Cesium.VerticalOrigin.bottom,
  45729. scale: 1,
  45730. pixelOffset: new Cesium.Cartesian2(0, 0),
  45731. disableDepthTestDistance: Number.POSITIVE_INFINITY
  45732. }
  45733. });
  45734. this.viewer.entities.add(this.billboard);
  45735. }
  45736. }
  45737. Object.assign(MultiFieldAdaptWindow.prototype, {
  45738. close() {
  45739. this.popupDiv.remove();
  45740. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  45741. this.viewer.entities.remove(this.billboard);
  45742. }
  45743. });
  45744. var win;
  45745. if (typeof window !== "undefined") {
  45746. win = window;
  45747. } else if (typeof commonjsGlobal !== "undefined") {
  45748. win = commonjsGlobal;
  45749. } else if (typeof self !== "undefined") {
  45750. win = self;
  45751. } else {
  45752. win = {};
  45753. }
  45754. var window_1 = win;
  45755. var __viteBrowserExternal = {};
  45756. var __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45757. __proto__: null,
  45758. "default": __viteBrowserExternal
  45759. }, Symbol.toStringTag, { value: "Module" }));
  45760. var require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
  45761. var topLevel = typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : {};
  45762. var minDoc = require$$0;
  45763. var doccy;
  45764. if (typeof document !== "undefined") {
  45765. doccy = document;
  45766. } else {
  45767. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"];
  45768. if (!doccy) {
  45769. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"] = minDoc;
  45770. }
  45771. }
  45772. var document_1 = doccy;
  45773. var keycode$1 = { exports: {} };
  45774. (function(module2, exports2) {
  45775. function keyCode(searchInput) {
  45776. if (searchInput && "object" === typeof searchInput) {
  45777. var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
  45778. if (hasKeyCode)
  45779. searchInput = hasKeyCode;
  45780. }
  45781. if ("number" === typeof searchInput)
  45782. return names2[searchInput];
  45783. var search = String(searchInput);
  45784. var foundNamedKey = codes[search.toLowerCase()];
  45785. if (foundNamedKey)
  45786. return foundNamedKey;
  45787. var foundNamedKey = aliases[search.toLowerCase()];
  45788. if (foundNamedKey)
  45789. return foundNamedKey;
  45790. if (search.length === 1)
  45791. return search.charCodeAt(0);
  45792. return void 0;
  45793. }
  45794. keyCode.isEventKey = function isEventKey(event2, nameOrCode) {
  45795. if (event2 && "object" === typeof event2) {
  45796. var keyCode2 = event2.which || event2.keyCode || event2.charCode;
  45797. if (keyCode2 === null || keyCode2 === void 0) {
  45798. return false;
  45799. }
  45800. if (typeof nameOrCode === "string") {
  45801. var foundNamedKey = codes[nameOrCode.toLowerCase()];
  45802. if (foundNamedKey) {
  45803. return foundNamedKey === keyCode2;
  45804. }
  45805. var foundNamedKey = aliases[nameOrCode.toLowerCase()];
  45806. if (foundNamedKey) {
  45807. return foundNamedKey === keyCode2;
  45808. }
  45809. } else if (typeof nameOrCode === "number") {
  45810. return nameOrCode === keyCode2;
  45811. }
  45812. return false;
  45813. }
  45814. };
  45815. exports2 = module2.exports = keyCode;
  45816. var codes = exports2.code = exports2.codes = {
  45817. "backspace": 8,
  45818. "tab": 9,
  45819. "enter": 13,
  45820. "shift": 16,
  45821. "ctrl": 17,
  45822. "alt": 18,
  45823. "pause/break": 19,
  45824. "caps lock": 20,
  45825. "esc": 27,
  45826. "space": 32,
  45827. "page up": 33,
  45828. "page down": 34,
  45829. "end": 35,
  45830. "home": 36,
  45831. "left": 37,
  45832. "up": 38,
  45833. "right": 39,
  45834. "down": 40,
  45835. "insert": 45,
  45836. "delete": 46,
  45837. "command": 91,
  45838. "left command": 91,
  45839. "right command": 93,
  45840. "numpad *": 106,
  45841. "numpad +": 107,
  45842. "numpad -": 109,
  45843. "numpad .": 110,
  45844. "numpad /": 111,
  45845. "num lock": 144,
  45846. "scroll lock": 145,
  45847. "my computer": 182,
  45848. "my calculator": 183,
  45849. ";": 186,
  45850. "=": 187,
  45851. ",": 188,
  45852. "-": 189,
  45853. ".": 190,
  45854. "/": 191,
  45855. "`": 192,
  45856. "[": 219,
  45857. "\\": 220,
  45858. "]": 221,
  45859. "'": 222
  45860. };
  45861. var aliases = exports2.aliases = {
  45862. "windows": 91,
  45863. "\u21E7": 16,
  45864. "\u2325": 18,
  45865. "\u2303": 17,
  45866. "\u2318": 91,
  45867. "ctl": 17,
  45868. "control": 17,
  45869. "option": 18,
  45870. "pause": 19,
  45871. "break": 19,
  45872. "caps": 20,
  45873. "return": 13,
  45874. "escape": 27,
  45875. "spc": 32,
  45876. "spacebar": 32,
  45877. "pgup": 33,
  45878. "pgdn": 34,
  45879. "ins": 45,
  45880. "del": 46,
  45881. "cmd": 91
  45882. };
  45883. /*!
  45884. * Programatically add the following
  45885. */
  45886. for (i2 = 97; i2 < 123; i2++)
  45887. codes[String.fromCharCode(i2)] = i2 - 32;
  45888. for (var i2 = 48; i2 < 58; i2++)
  45889. codes[i2 - 48] = i2;
  45890. for (i2 = 1; i2 < 13; i2++)
  45891. codes["f" + i2] = i2 + 111;
  45892. for (i2 = 0; i2 < 10; i2++)
  45893. codes["numpad " + i2] = i2 + 96;
  45894. var names2 = exports2.names = exports2.title = {};
  45895. for (i2 in codes)
  45896. names2[codes[i2]] = i2;
  45897. for (var alias in aliases) {
  45898. codes[alias] = aliases[alias];
  45899. }
  45900. })(keycode$1, keycode$1.exports);
  45901. var keycode = keycode$1.exports;
  45902. var tuple = SafeParseTuple;
  45903. function SafeParseTuple(obj, reviver) {
  45904. var json;
  45905. var error = null;
  45906. try {
  45907. json = JSON.parse(obj, reviver);
  45908. } catch (err) {
  45909. error = err;
  45910. }
  45911. return [error, json];
  45912. }
  45913. var lib = { exports: {} };
  45914. function _extends$2() {
  45915. _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
  45916. for (var i2 = 1; i2 < arguments.length; i2++) {
  45917. var source = arguments[i2];
  45918. for (var key in source) {
  45919. if (Object.prototype.hasOwnProperty.call(source, key)) {
  45920. target[key] = source[key];
  45921. }
  45922. }
  45923. }
  45924. return target;
  45925. };
  45926. return _extends$2.apply(this, arguments);
  45927. }
  45928. var _extends$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45929. __proto__: null,
  45930. "default": _extends$2
  45931. }, Symbol.toStringTag, { value: "Module" }));
  45932. var require$$1 = /* @__PURE__ */ getAugmentedNamespace(_extends$3);
  45933. var isFunction_1 = isFunction$1;
  45934. var toString$2 = Object.prototype.toString;
  45935. function isFunction$1(fn2) {
  45936. if (!fn2) {
  45937. return false;
  45938. }
  45939. var string = toString$2.call(fn2);
  45940. return string === "[object Function]" || typeof fn2 === "function" && string !== "[object RegExp]" || typeof window !== "undefined" && (fn2 === window.setTimeout || fn2 === window.alert || fn2 === window.confirm || fn2 === window.prompt);
  45941. }
  45942. var window$3 = window_1;
  45943. var httpResponseHandler = function httpResponseHandler2(callback2, decodeResponseBody) {
  45944. if (decodeResponseBody === void 0) {
  45945. decodeResponseBody = false;
  45946. }
  45947. return function(err, response, responseBody) {
  45948. if (err) {
  45949. callback2(err);
  45950. return;
  45951. }
  45952. if (response.statusCode >= 400 && response.statusCode <= 599) {
  45953. var cause = responseBody;
  45954. if (decodeResponseBody) {
  45955. if (window$3.TextDecoder) {
  45956. var charset = getCharset(response.headers && response.headers["content-type"]);
  45957. try {
  45958. cause = new TextDecoder(charset).decode(responseBody);
  45959. } catch (e) {
  45960. }
  45961. } else {
  45962. cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));
  45963. }
  45964. }
  45965. callback2({
  45966. cause
  45967. });
  45968. return;
  45969. }
  45970. callback2(null, responseBody);
  45971. };
  45972. };
  45973. function getCharset(contentTypeHeader) {
  45974. if (contentTypeHeader === void 0) {
  45975. contentTypeHeader = "";
  45976. }
  45977. return contentTypeHeader.toLowerCase().split(";").reduce(function(charset, contentType) {
  45978. var _contentType$split = contentType.split("="), type2 = _contentType$split[0], value = _contentType$split[1];
  45979. if (type2.trim() === "charset") {
  45980. return value.trim();
  45981. }
  45982. return charset;
  45983. }, "utf-8");
  45984. }
  45985. var httpHandler = httpResponseHandler;
  45986. var window$2 = window_1;
  45987. var _extends$1 = require$$1;
  45988. var isFunction = isFunction_1;
  45989. createXHR.httpHandler = httpHandler;
  45990. /**
  45991. * @license
  45992. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  45993. * Copyright (c) 2014 David Björklund
  45994. * Available under the MIT license
  45995. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  45996. */
  45997. var parseHeaders = function parseHeaders2(headers) {
  45998. var result = {};
  45999. if (!headers) {
  46000. return result;
  46001. }
  46002. headers.trim().split("\n").forEach(function(row) {
  46003. var index2 = row.indexOf(":");
  46004. var key = row.slice(0, index2).trim().toLowerCase();
  46005. var value = row.slice(index2 + 1).trim();
  46006. if (typeof result[key] === "undefined") {
  46007. result[key] = value;
  46008. } else if (Array.isArray(result[key])) {
  46009. result[key].push(value);
  46010. } else {
  46011. result[key] = [result[key], value];
  46012. }
  46013. });
  46014. return result;
  46015. };
  46016. lib.exports = createXHR;
  46017. lib.exports.default = createXHR;
  46018. createXHR.XMLHttpRequest = window$2.XMLHttpRequest || noop$2;
  46019. createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window$2.XDomainRequest;
  46020. forEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) {
  46021. createXHR[method === "delete" ? "del" : method] = function(uri, options2, callback2) {
  46022. options2 = initParams(uri, options2, callback2);
  46023. options2.method = method.toUpperCase();
  46024. return _createXHR(options2);
  46025. };
  46026. });
  46027. function forEachArray(array, iterator) {
  46028. for (var i2 = 0; i2 < array.length; i2++) {
  46029. iterator(array[i2]);
  46030. }
  46031. }
  46032. function isEmpty(obj) {
  46033. for (var i2 in obj) {
  46034. if (obj.hasOwnProperty(i2))
  46035. return false;
  46036. }
  46037. return true;
  46038. }
  46039. function initParams(uri, options2, callback2) {
  46040. var params = uri;
  46041. if (isFunction(options2)) {
  46042. callback2 = options2;
  46043. if (typeof uri === "string") {
  46044. params = {
  46045. uri
  46046. };
  46047. }
  46048. } else {
  46049. params = _extends$1({}, options2, {
  46050. uri
  46051. });
  46052. }
  46053. params.callback = callback2;
  46054. return params;
  46055. }
  46056. function createXHR(uri, options2, callback2) {
  46057. options2 = initParams(uri, options2, callback2);
  46058. return _createXHR(options2);
  46059. }
  46060. function _createXHR(options2) {
  46061. if (typeof options2.callback === "undefined") {
  46062. throw new Error("callback argument missing");
  46063. }
  46064. var called = false;
  46065. var callback2 = function cbOnce(err, response, body2) {
  46066. if (!called) {
  46067. called = true;
  46068. options2.callback(err, response, body2);
  46069. }
  46070. };
  46071. function readystatechange() {
  46072. if (xhr.readyState === 4) {
  46073. setTimeout(loadFunc, 0);
  46074. }
  46075. }
  46076. function getBody() {
  46077. var body2 = void 0;
  46078. if (xhr.response) {
  46079. body2 = xhr.response;
  46080. } else {
  46081. body2 = xhr.responseText || getXml(xhr);
  46082. }
  46083. if (isJson) {
  46084. try {
  46085. body2 = JSON.parse(body2);
  46086. } catch (e) {
  46087. }
  46088. }
  46089. return body2;
  46090. }
  46091. function errorFunc(evt) {
  46092. clearTimeout(timeoutTimer);
  46093. if (!(evt instanceof Error)) {
  46094. evt = new Error("" + (evt || "Unknown XMLHttpRequest Error"));
  46095. }
  46096. evt.statusCode = 0;
  46097. return callback2(evt, failureResponse);
  46098. }
  46099. function loadFunc() {
  46100. if (aborted)
  46101. return;
  46102. var status;
  46103. clearTimeout(timeoutTimer);
  46104. if (options2.useXDR && xhr.status === void 0) {
  46105. status = 200;
  46106. } else {
  46107. status = xhr.status === 1223 ? 204 : xhr.status;
  46108. }
  46109. var response = failureResponse;
  46110. var err = null;
  46111. if (status !== 0) {
  46112. response = {
  46113. body: getBody(),
  46114. statusCode: status,
  46115. method,
  46116. headers: {},
  46117. url: uri,
  46118. rawRequest: xhr
  46119. };
  46120. if (xhr.getAllResponseHeaders) {
  46121. response.headers = parseHeaders(xhr.getAllResponseHeaders());
  46122. }
  46123. } else {
  46124. err = new Error("Internal XMLHttpRequest Error");
  46125. }
  46126. return callback2(err, response, response.body);
  46127. }
  46128. var xhr = options2.xhr || null;
  46129. if (!xhr) {
  46130. if (options2.cors || options2.useXDR) {
  46131. xhr = new createXHR.XDomainRequest();
  46132. } else {
  46133. xhr = new createXHR.XMLHttpRequest();
  46134. }
  46135. }
  46136. var key;
  46137. var aborted;
  46138. var uri = xhr.url = options2.uri || options2.url;
  46139. var method = xhr.method = options2.method || "GET";
  46140. var body = options2.body || options2.data;
  46141. var headers = xhr.headers = options2.headers || {};
  46142. var sync = !!options2.sync;
  46143. var isJson = false;
  46144. var timeoutTimer;
  46145. var failureResponse = {
  46146. body: void 0,
  46147. headers: {},
  46148. statusCode: 0,
  46149. method,
  46150. url: uri,
  46151. rawRequest: xhr
  46152. };
  46153. if ("json" in options2 && options2.json !== false) {
  46154. isJson = true;
  46155. headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json");
  46156. if (method !== "GET" && method !== "HEAD") {
  46157. headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json");
  46158. body = JSON.stringify(options2.json === true ? body : options2.json);
  46159. }
  46160. }
  46161. xhr.onreadystatechange = readystatechange;
  46162. xhr.onload = loadFunc;
  46163. xhr.onerror = errorFunc;
  46164. xhr.onprogress = function() {
  46165. };
  46166. xhr.onabort = function() {
  46167. aborted = true;
  46168. };
  46169. xhr.ontimeout = errorFunc;
  46170. xhr.open(method, uri, !sync, options2.username, options2.password);
  46171. if (!sync) {
  46172. xhr.withCredentials = !!options2.withCredentials;
  46173. }
  46174. if (!sync && options2.timeout > 0) {
  46175. timeoutTimer = setTimeout(function() {
  46176. if (aborted)
  46177. return;
  46178. aborted = true;
  46179. xhr.abort("timeout");
  46180. var e = new Error("XMLHttpRequest timeout");
  46181. e.code = "ETIMEDOUT";
  46182. errorFunc(e);
  46183. }, options2.timeout);
  46184. }
  46185. if (xhr.setRequestHeader) {
  46186. for (key in headers) {
  46187. if (headers.hasOwnProperty(key)) {
  46188. xhr.setRequestHeader(key, headers[key]);
  46189. }
  46190. }
  46191. } else if (options2.headers && !isEmpty(options2.headers)) {
  46192. throw new Error("Headers cannot be set on an XDomainRequest object");
  46193. }
  46194. if ("responseType" in options2) {
  46195. xhr.responseType = options2.responseType;
  46196. }
  46197. if ("beforeSend" in options2 && typeof options2.beforeSend === "function") {
  46198. options2.beforeSend(xhr);
  46199. }
  46200. xhr.send(body || null);
  46201. return xhr;
  46202. }
  46203. function getXml(xhr) {
  46204. try {
  46205. if (xhr.responseType === "document") {
  46206. return xhr.responseXML;
  46207. }
  46208. var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror";
  46209. if (xhr.responseType === "" && !firefoxBugTakenEffect) {
  46210. return xhr.responseXML;
  46211. }
  46212. } catch (e) {
  46213. }
  46214. return null;
  46215. }
  46216. function noop$2() {
  46217. }
  46218. var XHR = lib.exports;
  46219. var browserIndex = { exports: {} };
  46220. var document$1 = document_1;
  46221. var _objCreate = Object.create || function() {
  46222. function F() {
  46223. }
  46224. return function(o) {
  46225. if (arguments.length !== 1) {
  46226. throw new Error("Object.create shim only accepts one parameter.");
  46227. }
  46228. F.prototype = o;
  46229. return new F();
  46230. };
  46231. }();
  46232. function ParsingError(errorData, message) {
  46233. this.name = "ParsingError";
  46234. this.code = errorData.code;
  46235. this.message = message || errorData.message;
  46236. }
  46237. ParsingError.prototype = _objCreate(Error.prototype);
  46238. ParsingError.prototype.constructor = ParsingError;
  46239. ParsingError.Errors = {
  46240. BadSignature: {
  46241. code: 0,
  46242. message: "Malformed WebVTT signature."
  46243. },
  46244. BadTimeStamp: {
  46245. code: 1,
  46246. message: "Malformed time stamp."
  46247. }
  46248. };
  46249. function parseTimeStamp(input) {
  46250. function computeSeconds(h2, m2, s, f) {
  46251. return (h2 | 0) * 3600 + (m2 | 0) * 60 + (s | 0) + (f | 0) / 1e3;
  46252. }
  46253. var m = input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
  46254. if (!m) {
  46255. return null;
  46256. }
  46257. if (m[3]) {
  46258. return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]);
  46259. } else if (m[1] > 59) {
  46260. return computeSeconds(m[1], m[2], 0, m[4]);
  46261. } else {
  46262. return computeSeconds(0, m[1], m[2], m[4]);
  46263. }
  46264. }
  46265. function Settings() {
  46266. this.values = _objCreate(null);
  46267. }
  46268. Settings.prototype = {
  46269. set: function(k, v) {
  46270. if (!this.get(k) && v !== "") {
  46271. this.values[k] = v;
  46272. }
  46273. },
  46274. get: function(k, dflt, defaultKey) {
  46275. if (defaultKey) {
  46276. return this.has(k) ? this.values[k] : dflt[defaultKey];
  46277. }
  46278. return this.has(k) ? this.values[k] : dflt;
  46279. },
  46280. has: function(k) {
  46281. return k in this.values;
  46282. },
  46283. alt: function(k, v, a) {
  46284. for (var n = 0; n < a.length; ++n) {
  46285. if (v === a[n]) {
  46286. this.set(k, v);
  46287. break;
  46288. }
  46289. }
  46290. },
  46291. integer: function(k, v) {
  46292. if (/^-?\d+$/.test(v)) {
  46293. this.set(k, parseInt(v, 10));
  46294. }
  46295. },
  46296. percent: function(k, v) {
  46297. if (v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) {
  46298. v = parseFloat(v);
  46299. if (v >= 0 && v <= 100) {
  46300. this.set(k, v);
  46301. return true;
  46302. }
  46303. }
  46304. return false;
  46305. }
  46306. };
  46307. function parseOptions(input, callback2, keyValueDelim, groupDelim) {
  46308. var groups = groupDelim ? input.split(groupDelim) : [input];
  46309. for (var i2 in groups) {
  46310. if (typeof groups[i2] !== "string") {
  46311. continue;
  46312. }
  46313. var kv = groups[i2].split(keyValueDelim);
  46314. if (kv.length !== 2) {
  46315. continue;
  46316. }
  46317. var k = kv[0].trim();
  46318. var v = kv[1].trim();
  46319. callback2(k, v);
  46320. }
  46321. }
  46322. function parseCue(input, cue, regionList) {
  46323. var oInput = input;
  46324. function consumeTimeStamp() {
  46325. var ts3 = parseTimeStamp(input);
  46326. if (ts3 === null) {
  46327. throw new ParsingError(
  46328. ParsingError.Errors.BadTimeStamp,
  46329. "Malformed timestamp: " + oInput
  46330. );
  46331. }
  46332. input = input.replace(/^[^\sa-zA-Z-]+/, "");
  46333. return ts3;
  46334. }
  46335. function consumeCueSettings(input2, cue2) {
  46336. var settings = new Settings();
  46337. parseOptions(input2, function(k, v) {
  46338. switch (k) {
  46339. case "region":
  46340. for (var i2 = regionList.length - 1; i2 >= 0; i2--) {
  46341. if (regionList[i2].id === v) {
  46342. settings.set(k, regionList[i2].region);
  46343. break;
  46344. }
  46345. }
  46346. break;
  46347. case "vertical":
  46348. settings.alt(k, v, ["rl", "lr"]);
  46349. break;
  46350. case "line":
  46351. var vals = v.split(","), vals0 = vals[0];
  46352. settings.integer(k, vals0);
  46353. settings.percent(k, vals0) ? settings.set("snapToLines", false) : null;
  46354. settings.alt(k, vals0, ["auto"]);
  46355. if (vals.length === 2) {
  46356. settings.alt("lineAlign", vals[1], ["start", "center", "end"]);
  46357. }
  46358. break;
  46359. case "position":
  46360. vals = v.split(",");
  46361. settings.percent(k, vals[0]);
  46362. if (vals.length === 2) {
  46363. settings.alt("positionAlign", vals[1], ["start", "center", "end"]);
  46364. }
  46365. break;
  46366. case "size":
  46367. settings.percent(k, v);
  46368. break;
  46369. case "align":
  46370. settings.alt(k, v, ["start", "center", "end", "left", "right"]);
  46371. break;
  46372. }
  46373. }, /:/, /\s/);
  46374. cue2.region = settings.get("region", null);
  46375. cue2.vertical = settings.get("vertical", "");
  46376. try {
  46377. cue2.line = settings.get("line", "auto");
  46378. } catch (e) {
  46379. }
  46380. cue2.lineAlign = settings.get("lineAlign", "start");
  46381. cue2.snapToLines = settings.get("snapToLines", true);
  46382. cue2.size = settings.get("size", 100);
  46383. try {
  46384. cue2.align = settings.get("align", "center");
  46385. } catch (e) {
  46386. cue2.align = settings.get("align", "middle");
  46387. }
  46388. try {
  46389. cue2.position = settings.get("position", "auto");
  46390. } catch (e) {
  46391. cue2.position = settings.get("position", {
  46392. start: 0,
  46393. left: 0,
  46394. center: 50,
  46395. middle: 50,
  46396. end: 100,
  46397. right: 100
  46398. }, cue2.align);
  46399. }
  46400. cue2.positionAlign = settings.get("positionAlign", {
  46401. start: "start",
  46402. left: "start",
  46403. center: "center",
  46404. middle: "center",
  46405. end: "end",
  46406. right: "end"
  46407. }, cue2.align);
  46408. }
  46409. function skipWhitespace() {
  46410. input = input.replace(/^\s+/, "");
  46411. }
  46412. skipWhitespace();
  46413. cue.startTime = consumeTimeStamp();
  46414. skipWhitespace();
  46415. if (input.substr(0, 3) !== "-->") {
  46416. throw new ParsingError(
  46417. ParsingError.Errors.BadTimeStamp,
  46418. "Malformed time stamp (time stamps must be separated by '-->'): " + oInput
  46419. );
  46420. }
  46421. input = input.substr(3);
  46422. skipWhitespace();
  46423. cue.endTime = consumeTimeStamp();
  46424. skipWhitespace();
  46425. consumeCueSettings(input, cue);
  46426. }
  46427. var TEXTAREA_ELEMENT = document$1.createElement && document$1.createElement("textarea");
  46428. var TAG_NAME = {
  46429. c: "span",
  46430. i: "i",
  46431. b: "b",
  46432. u: "u",
  46433. ruby: "ruby",
  46434. rt: "rt",
  46435. v: "span",
  46436. lang: "span"
  46437. };
  46438. var DEFAULT_COLOR_CLASS = {
  46439. white: "rgba(255,255,255,1)",
  46440. lime: "rgba(0,255,0,1)",
  46441. cyan: "rgba(0,255,255,1)",
  46442. red: "rgba(255,0,0,1)",
  46443. yellow: "rgba(255,255,0,1)",
  46444. magenta: "rgba(255,0,255,1)",
  46445. blue: "rgba(0,0,255,1)",
  46446. black: "rgba(0,0,0,1)"
  46447. };
  46448. var TAG_ANNOTATION = {
  46449. v: "title",
  46450. lang: "lang"
  46451. };
  46452. var NEEDS_PARENT = {
  46453. rt: "ruby"
  46454. };
  46455. function parseContent(window2, input) {
  46456. function nextToken() {
  46457. if (!input) {
  46458. return null;
  46459. }
  46460. function consume(result) {
  46461. input = input.substr(result.length);
  46462. return result;
  46463. }
  46464. var m2 = input.match(/^([^<]*)(<[^>]*>?)?/);
  46465. return consume(m2[1] ? m2[1] : m2[2]);
  46466. }
  46467. function unescape2(s) {
  46468. TEXTAREA_ELEMENT.innerHTML = s;
  46469. s = TEXTAREA_ELEMENT.textContent;
  46470. TEXTAREA_ELEMENT.textContent = "";
  46471. return s;
  46472. }
  46473. function shouldAdd(current2, element) {
  46474. return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current2.localName;
  46475. }
  46476. function createElement(type2, annotation) {
  46477. var tagName = TAG_NAME[type2];
  46478. if (!tagName) {
  46479. return null;
  46480. }
  46481. var element = window2.document.createElement(tagName);
  46482. var name = TAG_ANNOTATION[type2];
  46483. if (name && annotation) {
  46484. element[name] = annotation.trim();
  46485. }
  46486. return element;
  46487. }
  46488. var rootDiv = window2.document.createElement("div"), current = rootDiv, t2, tagStack = [];
  46489. while ((t2 = nextToken()) !== null) {
  46490. if (t2[0] === "<") {
  46491. if (t2[1] === "/") {
  46492. if (tagStack.length && tagStack[tagStack.length - 1] === t2.substr(2).replace(">", "")) {
  46493. tagStack.pop();
  46494. current = current.parentNode;
  46495. }
  46496. continue;
  46497. }
  46498. var ts3 = parseTimeStamp(t2.substr(1, t2.length - 2));
  46499. var node;
  46500. if (ts3) {
  46501. node = window2.document.createProcessingInstruction("timestamp", ts3);
  46502. current.appendChild(node);
  46503. continue;
  46504. }
  46505. var m = t2.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
  46506. if (!m) {
  46507. continue;
  46508. }
  46509. node = createElement(m[1], m[3]);
  46510. if (!node) {
  46511. continue;
  46512. }
  46513. if (!shouldAdd(current, node)) {
  46514. continue;
  46515. }
  46516. if (m[2]) {
  46517. var classes = m[2].split(".");
  46518. classes.forEach(function(cl) {
  46519. var bgColor = /^bg_/.test(cl);
  46520. var colorName = bgColor ? cl.slice(3) : cl;
  46521. if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {
  46522. var propName = bgColor ? "background-color" : "color";
  46523. var propValue = DEFAULT_COLOR_CLASS[colorName];
  46524. node.style[propName] = propValue;
  46525. }
  46526. });
  46527. node.className = classes.join(" ");
  46528. }
  46529. tagStack.push(m[1]);
  46530. current.appendChild(node);
  46531. current = node;
  46532. continue;
  46533. }
  46534. current.appendChild(window2.document.createTextNode(unescape2(t2)));
  46535. }
  46536. return rootDiv;
  46537. }
  46538. var strongRTLRanges = [
  46539. [1470, 1470],
  46540. [1472, 1472],
  46541. [1475, 1475],
  46542. [1478, 1478],
  46543. [1488, 1514],
  46544. [1520, 1524],
  46545. [1544, 1544],
  46546. [1547, 1547],
  46547. [1549, 1549],
  46548. [1563, 1563],
  46549. [1566, 1610],
  46550. [1645, 1647],
  46551. [1649, 1749],
  46552. [1765, 1766],
  46553. [1774, 1775],
  46554. [1786, 1805],
  46555. [1807, 1808],
  46556. [1810, 1839],
  46557. [1869, 1957],
  46558. [1969, 1969],
  46559. [1984, 2026],
  46560. [2036, 2037],
  46561. [2042, 2042],
  46562. [2048, 2069],
  46563. [2074, 2074],
  46564. [2084, 2084],
  46565. [2088, 2088],
  46566. [2096, 2110],
  46567. [2112, 2136],
  46568. [2142, 2142],
  46569. [2208, 2208],
  46570. [2210, 2220],
  46571. [8207, 8207],
  46572. [64285, 64285],
  46573. [64287, 64296],
  46574. [64298, 64310],
  46575. [64312, 64316],
  46576. [64318, 64318],
  46577. [64320, 64321],
  46578. [64323, 64324],
  46579. [64326, 64449],
  46580. [64467, 64829],
  46581. [64848, 64911],
  46582. [64914, 64967],
  46583. [65008, 65020],
  46584. [65136, 65140],
  46585. [65142, 65276],
  46586. [67584, 67589],
  46587. [67592, 67592],
  46588. [67594, 67637],
  46589. [67639, 67640],
  46590. [67644, 67644],
  46591. [67647, 67669],
  46592. [67671, 67679],
  46593. [67840, 67867],
  46594. [67872, 67897],
  46595. [67903, 67903],
  46596. [67968, 68023],
  46597. [68030, 68031],
  46598. [68096, 68096],
  46599. [68112, 68115],
  46600. [68117, 68119],
  46601. [68121, 68147],
  46602. [68160, 68167],
  46603. [68176, 68184],
  46604. [68192, 68223],
  46605. [68352, 68405],
  46606. [68416, 68437],
  46607. [68440, 68466],
  46608. [68472, 68479],
  46609. [68608, 68680],
  46610. [126464, 126467],
  46611. [126469, 126495],
  46612. [126497, 126498],
  46613. [126500, 126500],
  46614. [126503, 126503],
  46615. [126505, 126514],
  46616. [126516, 126519],
  46617. [126521, 126521],
  46618. [126523, 126523],
  46619. [126530, 126530],
  46620. [126535, 126535],
  46621. [126537, 126537],
  46622. [126539, 126539],
  46623. [126541, 126543],
  46624. [126545, 126546],
  46625. [126548, 126548],
  46626. [126551, 126551],
  46627. [126553, 126553],
  46628. [126555, 126555],
  46629. [126557, 126557],
  46630. [126559, 126559],
  46631. [126561, 126562],
  46632. [126564, 126564],
  46633. [126567, 126570],
  46634. [126572, 126578],
  46635. [126580, 126583],
  46636. [126585, 126588],
  46637. [126590, 126590],
  46638. [126592, 126601],
  46639. [126603, 126619],
  46640. [126625, 126627],
  46641. [126629, 126633],
  46642. [126635, 126651],
  46643. [1114109, 1114109]
  46644. ];
  46645. function isStrongRTLChar(charCode) {
  46646. for (var i2 = 0; i2 < strongRTLRanges.length; i2++) {
  46647. var currentRange = strongRTLRanges[i2];
  46648. if (charCode >= currentRange[0] && charCode <= currentRange[1]) {
  46649. return true;
  46650. }
  46651. }
  46652. return false;
  46653. }
  46654. function determineBidi(cueDiv) {
  46655. var nodeStack = [], text = "", charCode;
  46656. if (!cueDiv || !cueDiv.childNodes) {
  46657. return "ltr";
  46658. }
  46659. function pushNodes(nodeStack2, node) {
  46660. for (var i3 = node.childNodes.length - 1; i3 >= 0; i3--) {
  46661. nodeStack2.push(node.childNodes[i3]);
  46662. }
  46663. }
  46664. function nextTextNode(nodeStack2) {
  46665. if (!nodeStack2 || !nodeStack2.length) {
  46666. return null;
  46667. }
  46668. var node = nodeStack2.pop(), text2 = node.textContent || node.innerText;
  46669. if (text2) {
  46670. var m = text2.match(/^.*(\n|\r)/);
  46671. if (m) {
  46672. nodeStack2.length = 0;
  46673. return m[0];
  46674. }
  46675. return text2;
  46676. }
  46677. if (node.tagName === "ruby") {
  46678. return nextTextNode(nodeStack2);
  46679. }
  46680. if (node.childNodes) {
  46681. pushNodes(nodeStack2, node);
  46682. return nextTextNode(nodeStack2);
  46683. }
  46684. }
  46685. pushNodes(nodeStack, cueDiv);
  46686. while (text = nextTextNode(nodeStack)) {
  46687. for (var i2 = 0; i2 < text.length; i2++) {
  46688. charCode = text.charCodeAt(i2);
  46689. if (isStrongRTLChar(charCode)) {
  46690. return "rtl";
  46691. }
  46692. }
  46693. }
  46694. return "ltr";
  46695. }
  46696. function computeLinePos(cue) {
  46697. if (typeof cue.line === "number" && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) {
  46698. return cue.line;
  46699. }
  46700. if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) {
  46701. return -1;
  46702. }
  46703. var track = cue.track, trackList = track.textTrackList, count = 0;
  46704. for (var i2 = 0; i2 < trackList.length && trackList[i2] !== track; i2++) {
  46705. if (trackList[i2].mode === "showing") {
  46706. count++;
  46707. }
  46708. }
  46709. return ++count * -1;
  46710. }
  46711. function StyleBox() {
  46712. }
  46713. StyleBox.prototype.applyStyles = function(styles, div) {
  46714. div = div || this.div;
  46715. for (var prop in styles) {
  46716. if (styles.hasOwnProperty(prop)) {
  46717. div.style[prop] = styles[prop];
  46718. }
  46719. }
  46720. };
  46721. StyleBox.prototype.formatStyle = function(val, unit) {
  46722. return val === 0 ? 0 : val + unit;
  46723. };
  46724. function CueStyleBox(window2, cue, styleOptions) {
  46725. StyleBox.call(this);
  46726. this.cue = cue;
  46727. this.cueDiv = parseContent(window2, cue.text);
  46728. var styles = {
  46729. color: "rgba(255, 255, 255, 1)",
  46730. backgroundColor: "rgba(0, 0, 0, 0.8)",
  46731. position: "relative",
  46732. left: 0,
  46733. right: 0,
  46734. top: 0,
  46735. bottom: 0,
  46736. display: "inline",
  46737. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46738. unicodeBidi: "plaintext"
  46739. };
  46740. this.applyStyles(styles, this.cueDiv);
  46741. this.div = window2.document.createElement("div");
  46742. styles = {
  46743. direction: determineBidi(this.cueDiv),
  46744. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46745. unicodeBidi: "plaintext",
  46746. textAlign: cue.align === "middle" ? "center" : cue.align,
  46747. font: styleOptions.font,
  46748. whiteSpace: "pre-line",
  46749. position: "absolute"
  46750. };
  46751. this.applyStyles(styles);
  46752. this.div.appendChild(this.cueDiv);
  46753. var textPos = 0;
  46754. switch (cue.positionAlign) {
  46755. case "start":
  46756. textPos = cue.position;
  46757. break;
  46758. case "center":
  46759. textPos = cue.position - cue.size / 2;
  46760. break;
  46761. case "end":
  46762. textPos = cue.position - cue.size;
  46763. break;
  46764. }
  46765. if (cue.vertical === "") {
  46766. this.applyStyles({
  46767. left: this.formatStyle(textPos, "%"),
  46768. width: this.formatStyle(cue.size, "%")
  46769. });
  46770. } else {
  46771. this.applyStyles({
  46772. top: this.formatStyle(textPos, "%"),
  46773. height: this.formatStyle(cue.size, "%")
  46774. });
  46775. }
  46776. this.move = function(box) {
  46777. this.applyStyles({
  46778. top: this.formatStyle(box.top, "px"),
  46779. bottom: this.formatStyle(box.bottom, "px"),
  46780. left: this.formatStyle(box.left, "px"),
  46781. right: this.formatStyle(box.right, "px"),
  46782. height: this.formatStyle(box.height, "px"),
  46783. width: this.formatStyle(box.width, "px")
  46784. });
  46785. };
  46786. }
  46787. CueStyleBox.prototype = _objCreate(StyleBox.prototype);
  46788. CueStyleBox.prototype.constructor = CueStyleBox;
  46789. function BoxPosition(obj) {
  46790. var lh, height2, width2, top;
  46791. if (obj.div) {
  46792. height2 = obj.div.offsetHeight;
  46793. width2 = obj.div.offsetWidth;
  46794. top = obj.div.offsetTop;
  46795. var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();
  46796. obj = obj.div.getBoundingClientRect();
  46797. lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;
  46798. }
  46799. this.left = obj.left;
  46800. this.right = obj.right;
  46801. this.top = obj.top || top;
  46802. this.height = obj.height || height2;
  46803. this.bottom = obj.bottom || top + (obj.height || height2);
  46804. this.width = obj.width || width2;
  46805. this.lineHeight = lh !== void 0 ? lh : obj.lineHeight;
  46806. }
  46807. BoxPosition.prototype.move = function(axis, toMove) {
  46808. toMove = toMove !== void 0 ? toMove : this.lineHeight;
  46809. switch (axis) {
  46810. case "+x":
  46811. this.left += toMove;
  46812. this.right += toMove;
  46813. break;
  46814. case "-x":
  46815. this.left -= toMove;
  46816. this.right -= toMove;
  46817. break;
  46818. case "+y":
  46819. this.top += toMove;
  46820. this.bottom += toMove;
  46821. break;
  46822. case "-y":
  46823. this.top -= toMove;
  46824. this.bottom -= toMove;
  46825. break;
  46826. }
  46827. };
  46828. BoxPosition.prototype.overlaps = function(b2) {
  46829. return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top;
  46830. };
  46831. BoxPosition.prototype.overlapsAny = function(boxes) {
  46832. for (var i2 = 0; i2 < boxes.length; i2++) {
  46833. if (this.overlaps(boxes[i2])) {
  46834. return true;
  46835. }
  46836. }
  46837. return false;
  46838. };
  46839. BoxPosition.prototype.within = function(container) {
  46840. return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right;
  46841. };
  46842. BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {
  46843. switch (axis) {
  46844. case "+x":
  46845. return this.left < container.left;
  46846. case "-x":
  46847. return this.right > container.right;
  46848. case "+y":
  46849. return this.top < container.top;
  46850. case "-y":
  46851. return this.bottom > container.bottom;
  46852. }
  46853. };
  46854. BoxPosition.prototype.intersectPercentage = function(b2) {
  46855. var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)), y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)), intersectArea = x * y;
  46856. return intersectArea / (this.height * this.width);
  46857. };
  46858. BoxPosition.prototype.toCSSCompatValues = function(reference) {
  46859. return {
  46860. top: this.top - reference.top,
  46861. bottom: reference.bottom - this.bottom,
  46862. left: this.left - reference.left,
  46863. right: reference.right - this.right,
  46864. height: this.height,
  46865. width: this.width
  46866. };
  46867. };
  46868. BoxPosition.getSimpleBoxPosition = function(obj) {
  46869. var height2 = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;
  46870. var width2 = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;
  46871. var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;
  46872. obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj;
  46873. var ret = {
  46874. left: obj.left,
  46875. right: obj.right,
  46876. top: obj.top || top,
  46877. height: obj.height || height2,
  46878. bottom: obj.bottom || top + (obj.height || height2),
  46879. width: obj.width || width2
  46880. };
  46881. return ret;
  46882. };
  46883. function moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions) {
  46884. function findBestPosition(b, axis2) {
  46885. var bestPosition2, specifiedPosition = new BoxPosition(b), percentage = 1;
  46886. for (var i2 = 0; i2 < axis2.length; i2++) {
  46887. while (b.overlapsOppositeAxis(containerBox, axis2[i2]) || b.within(containerBox) && b.overlapsAny(boxPositions)) {
  46888. b.move(axis2[i2]);
  46889. }
  46890. if (b.within(containerBox)) {
  46891. return b;
  46892. }
  46893. var p = b.intersectPercentage(containerBox);
  46894. if (percentage > p) {
  46895. bestPosition2 = new BoxPosition(b);
  46896. percentage = p;
  46897. }
  46898. b = new BoxPosition(specifiedPosition);
  46899. }
  46900. return bestPosition2 || specifiedPosition;
  46901. }
  46902. var boxPosition = new BoxPosition(styleBox), cue = styleBox.cue, linePos = computeLinePos(cue), axis = [];
  46903. if (cue.snapToLines) {
  46904. var size;
  46905. switch (cue.vertical) {
  46906. case "":
  46907. axis = ["+y", "-y"];
  46908. size = "height";
  46909. break;
  46910. case "rl":
  46911. axis = ["+x", "-x"];
  46912. size = "width";
  46913. break;
  46914. case "lr":
  46915. axis = ["-x", "+x"];
  46916. size = "width";
  46917. break;
  46918. }
  46919. var step = boxPosition.lineHeight, position2 = step * Math.round(linePos), maxPosition = containerBox[size] + step, initialAxis = axis[0];
  46920. if (Math.abs(position2) > maxPosition) {
  46921. position2 = position2 < 0 ? -1 : 1;
  46922. position2 *= Math.ceil(maxPosition / step) * step;
  46923. }
  46924. if (linePos < 0) {
  46925. position2 += cue.vertical === "" ? containerBox.height : containerBox.width;
  46926. axis = axis.reverse();
  46927. }
  46928. boxPosition.move(initialAxis, position2);
  46929. } else {
  46930. var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100;
  46931. switch (cue.lineAlign) {
  46932. case "center":
  46933. linePos -= calculatedPercentage / 2;
  46934. break;
  46935. case "end":
  46936. linePos -= calculatedPercentage;
  46937. break;
  46938. }
  46939. switch (cue.vertical) {
  46940. case "":
  46941. styleBox.applyStyles({
  46942. top: styleBox.formatStyle(linePos, "%")
  46943. });
  46944. break;
  46945. case "rl":
  46946. styleBox.applyStyles({
  46947. left: styleBox.formatStyle(linePos, "%")
  46948. });
  46949. break;
  46950. case "lr":
  46951. styleBox.applyStyles({
  46952. right: styleBox.formatStyle(linePos, "%")
  46953. });
  46954. break;
  46955. }
  46956. axis = ["+y", "-x", "+x", "-y"];
  46957. boxPosition = new BoxPosition(styleBox);
  46958. }
  46959. var bestPosition = findBestPosition(boxPosition, axis);
  46960. styleBox.move(bestPosition.toCSSCompatValues(containerBox));
  46961. }
  46962. function WebVTT$1() {
  46963. }
  46964. WebVTT$1.StringDecoder = function() {
  46965. return {
  46966. decode: function(data) {
  46967. if (!data) {
  46968. return "";
  46969. }
  46970. if (typeof data !== "string") {
  46971. throw new Error("Error - expected string data.");
  46972. }
  46973. return decodeURIComponent(encodeURIComponent(data));
  46974. }
  46975. };
  46976. };
  46977. WebVTT$1.convertCueToDOMTree = function(window2, cuetext) {
  46978. if (!window2 || !cuetext) {
  46979. return null;
  46980. }
  46981. return parseContent(window2, cuetext);
  46982. };
  46983. var FONT_SIZE_PERCENT = 0.05;
  46984. var FONT_STYLE = "sans-serif";
  46985. var CUE_BACKGROUND_PADDING = "1.5%";
  46986. WebVTT$1.processCues = function(window2, cues, overlay) {
  46987. if (!window2 || !cues || !overlay) {
  46988. return null;
  46989. }
  46990. while (overlay.firstChild) {
  46991. overlay.removeChild(overlay.firstChild);
  46992. }
  46993. var paddedOverlay = window2.document.createElement("div");
  46994. paddedOverlay.style.position = "absolute";
  46995. paddedOverlay.style.left = "0";
  46996. paddedOverlay.style.right = "0";
  46997. paddedOverlay.style.top = "0";
  46998. paddedOverlay.style.bottom = "0";
  46999. paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;
  47000. overlay.appendChild(paddedOverlay);
  47001. function shouldCompute(cues2) {
  47002. for (var i3 = 0; i3 < cues2.length; i3++) {
  47003. if (cues2[i3].hasBeenReset || !cues2[i3].displayState) {
  47004. return true;
  47005. }
  47006. }
  47007. return false;
  47008. }
  47009. if (!shouldCompute(cues)) {
  47010. for (var i2 = 0; i2 < cues.length; i2++) {
  47011. paddedOverlay.appendChild(cues[i2].displayState);
  47012. }
  47013. return;
  47014. }
  47015. var boxPositions = [], containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay), fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;
  47016. var styleOptions = {
  47017. font: fontSize + "px " + FONT_STYLE
  47018. };
  47019. (function() {
  47020. var styleBox, cue;
  47021. for (var i3 = 0; i3 < cues.length; i3++) {
  47022. cue = cues[i3];
  47023. styleBox = new CueStyleBox(window2, cue, styleOptions);
  47024. paddedOverlay.appendChild(styleBox.div);
  47025. moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions);
  47026. cue.displayState = styleBox.div;
  47027. boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));
  47028. }
  47029. })();
  47030. };
  47031. WebVTT$1.Parser = function(window2, vttjs2, decoder) {
  47032. if (!decoder) {
  47033. decoder = vttjs2;
  47034. vttjs2 = {};
  47035. }
  47036. if (!vttjs2) {
  47037. vttjs2 = {};
  47038. }
  47039. this.window = window2;
  47040. this.vttjs = vttjs2;
  47041. this.state = "INITIAL";
  47042. this.buffer = "";
  47043. this.decoder = decoder || new TextDecoder("utf8");
  47044. this.regionList = [];
  47045. };
  47046. WebVTT$1.Parser.prototype = {
  47047. reportOrThrowError: function(e) {
  47048. if (e instanceof ParsingError) {
  47049. this.onparsingerror && this.onparsingerror(e);
  47050. } else {
  47051. throw e;
  47052. }
  47053. },
  47054. parse: function(data) {
  47055. var self2 = this;
  47056. if (data) {
  47057. self2.buffer += self2.decoder.decode(data, { stream: true });
  47058. }
  47059. function collectNextLine() {
  47060. var buffer = self2.buffer;
  47061. var pos = 0;
  47062. while (pos < buffer.length && buffer[pos] !== "\r" && buffer[pos] !== "\n") {
  47063. ++pos;
  47064. }
  47065. var line2 = buffer.substr(0, pos);
  47066. if (buffer[pos] === "\r") {
  47067. ++pos;
  47068. }
  47069. if (buffer[pos] === "\n") {
  47070. ++pos;
  47071. }
  47072. self2.buffer = buffer.substr(pos);
  47073. return line2;
  47074. }
  47075. function parseRegion(input) {
  47076. var settings = new Settings();
  47077. parseOptions(input, function(k, v) {
  47078. switch (k) {
  47079. case "id":
  47080. settings.set(k, v);
  47081. break;
  47082. case "width":
  47083. settings.percent(k, v);
  47084. break;
  47085. case "lines":
  47086. settings.integer(k, v);
  47087. break;
  47088. case "regionanchor":
  47089. case "viewportanchor":
  47090. var xy = v.split(",");
  47091. if (xy.length !== 2) {
  47092. break;
  47093. }
  47094. var anchor = new Settings();
  47095. anchor.percent("x", xy[0]);
  47096. anchor.percent("y", xy[1]);
  47097. if (!anchor.has("x") || !anchor.has("y")) {
  47098. break;
  47099. }
  47100. settings.set(k + "X", anchor.get("x"));
  47101. settings.set(k + "Y", anchor.get("y"));
  47102. break;
  47103. case "scroll":
  47104. settings.alt(k, v, ["up"]);
  47105. break;
  47106. }
  47107. }, /=/, /\s/);
  47108. if (settings.has("id")) {
  47109. var region = new (self2.vttjs.VTTRegion || self2.window.VTTRegion)();
  47110. region.width = settings.get("width", 100);
  47111. region.lines = settings.get("lines", 3);
  47112. region.regionAnchorX = settings.get("regionanchorX", 0);
  47113. region.regionAnchorY = settings.get("regionanchorY", 100);
  47114. region.viewportAnchorX = settings.get("viewportanchorX", 0);
  47115. region.viewportAnchorY = settings.get("viewportanchorY", 100);
  47116. region.scroll = settings.get("scroll", "");
  47117. self2.onregion && self2.onregion(region);
  47118. self2.regionList.push({
  47119. id: settings.get("id"),
  47120. region
  47121. });
  47122. }
  47123. }
  47124. function parseTimestampMap(input) {
  47125. var settings = new Settings();
  47126. parseOptions(input, function(k, v) {
  47127. switch (k) {
  47128. case "MPEGT":
  47129. settings.integer(k + "S", v);
  47130. break;
  47131. case "LOCA":
  47132. settings.set(k + "L", parseTimeStamp(v));
  47133. break;
  47134. }
  47135. }, /[^\d]:/, /,/);
  47136. self2.ontimestampmap && self2.ontimestampmap({
  47137. "MPEGTS": settings.get("MPEGTS"),
  47138. "LOCAL": settings.get("LOCAL")
  47139. });
  47140. }
  47141. function parseHeader(input) {
  47142. if (input.match(/X-TIMESTAMP-MAP/)) {
  47143. parseOptions(input, function(k, v) {
  47144. switch (k) {
  47145. case "X-TIMESTAMP-MAP":
  47146. parseTimestampMap(v);
  47147. break;
  47148. }
  47149. }, /=/);
  47150. } else {
  47151. parseOptions(input, function(k, v) {
  47152. switch (k) {
  47153. case "Region":
  47154. parseRegion(v);
  47155. break;
  47156. }
  47157. }, /:/);
  47158. }
  47159. }
  47160. try {
  47161. var line;
  47162. if (self2.state === "INITIAL") {
  47163. if (!/\r\n|\n/.test(self2.buffer)) {
  47164. return this;
  47165. }
  47166. line = collectNextLine();
  47167. var m = line.match(/^WEBVTT([ \t].*)?$/);
  47168. if (!m || !m[0]) {
  47169. throw new ParsingError(ParsingError.Errors.BadSignature);
  47170. }
  47171. self2.state = "HEADER";
  47172. }
  47173. var alreadyCollectedLine = false;
  47174. while (self2.buffer) {
  47175. if (!/\r\n|\n/.test(self2.buffer)) {
  47176. return this;
  47177. }
  47178. if (!alreadyCollectedLine) {
  47179. line = collectNextLine();
  47180. } else {
  47181. alreadyCollectedLine = false;
  47182. }
  47183. switch (self2.state) {
  47184. case "HEADER":
  47185. if (/:/.test(line)) {
  47186. parseHeader(line);
  47187. } else if (!line) {
  47188. self2.state = "ID";
  47189. }
  47190. continue;
  47191. case "NOTE":
  47192. if (!line) {
  47193. self2.state = "ID";
  47194. }
  47195. continue;
  47196. case "ID":
  47197. if (/^NOTE($|[ \t])/.test(line)) {
  47198. self2.state = "NOTE";
  47199. break;
  47200. }
  47201. if (!line) {
  47202. continue;
  47203. }
  47204. self2.cue = new (self2.vttjs.VTTCue || self2.window.VTTCue)(0, 0, "");
  47205. try {
  47206. self2.cue.align = "center";
  47207. } catch (e) {
  47208. self2.cue.align = "middle";
  47209. }
  47210. self2.state = "CUE";
  47211. if (line.indexOf("-->") === -1) {
  47212. self2.cue.id = line;
  47213. continue;
  47214. }
  47215. case "CUE":
  47216. try {
  47217. parseCue(line, self2.cue, self2.regionList);
  47218. } catch (e) {
  47219. self2.reportOrThrowError(e);
  47220. self2.cue = null;
  47221. self2.state = "BADCUE";
  47222. continue;
  47223. }
  47224. self2.state = "CUETEXT";
  47225. continue;
  47226. case "CUETEXT":
  47227. var hasSubstring = line.indexOf("-->") !== -1;
  47228. if (!line || hasSubstring && (alreadyCollectedLine = true)) {
  47229. self2.oncue && self2.oncue(self2.cue);
  47230. self2.cue = null;
  47231. self2.state = "ID";
  47232. continue;
  47233. }
  47234. if (self2.cue.text) {
  47235. self2.cue.text += "\n";
  47236. }
  47237. self2.cue.text += line.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
  47238. continue;
  47239. case "BADCUE":
  47240. if (!line) {
  47241. self2.state = "ID";
  47242. }
  47243. continue;
  47244. }
  47245. }
  47246. } catch (e) {
  47247. self2.reportOrThrowError(e);
  47248. if (self2.state === "CUETEXT" && self2.cue && self2.oncue) {
  47249. self2.oncue(self2.cue);
  47250. }
  47251. self2.cue = null;
  47252. self2.state = self2.state === "INITIAL" ? "BADWEBVTT" : "BADCUE";
  47253. }
  47254. return this;
  47255. },
  47256. flush: function() {
  47257. var self2 = this;
  47258. try {
  47259. self2.buffer += self2.decoder.decode();
  47260. if (self2.cue || self2.state === "HEADER") {
  47261. self2.buffer += "\n\n";
  47262. self2.parse();
  47263. }
  47264. if (self2.state === "INITIAL") {
  47265. throw new ParsingError(ParsingError.Errors.BadSignature);
  47266. }
  47267. } catch (e) {
  47268. self2.reportOrThrowError(e);
  47269. }
  47270. self2.onflush && self2.onflush();
  47271. return this;
  47272. }
  47273. };
  47274. var vtt$1 = WebVTT$1;
  47275. var autoKeyword = "auto";
  47276. var directionSetting = {
  47277. "": 1,
  47278. "lr": 1,
  47279. "rl": 1
  47280. };
  47281. var alignSetting = {
  47282. "start": 1,
  47283. "center": 1,
  47284. "end": 1,
  47285. "left": 1,
  47286. "right": 1,
  47287. "auto": 1,
  47288. "line-left": 1,
  47289. "line-right": 1
  47290. };
  47291. function findDirectionSetting(value) {
  47292. if (typeof value !== "string") {
  47293. return false;
  47294. }
  47295. var dir = directionSetting[value.toLowerCase()];
  47296. return dir ? value.toLowerCase() : false;
  47297. }
  47298. function findAlignSetting(value) {
  47299. if (typeof value !== "string") {
  47300. return false;
  47301. }
  47302. var align = alignSetting[value.toLowerCase()];
  47303. return align ? value.toLowerCase() : false;
  47304. }
  47305. function VTTCue(startTime, endTime, text) {
  47306. this.hasBeenReset = false;
  47307. var _id = "";
  47308. var _pauseOnExit = false;
  47309. var _startTime = startTime;
  47310. var _endTime = endTime;
  47311. var _text = text;
  47312. var _region = null;
  47313. var _vertical = "";
  47314. var _snapToLines = true;
  47315. var _line = "auto";
  47316. var _lineAlign = "start";
  47317. var _position = "auto";
  47318. var _positionAlign = "auto";
  47319. var _size = 100;
  47320. var _align = "center";
  47321. Object.defineProperties(this, {
  47322. "id": {
  47323. enumerable: true,
  47324. get: function() {
  47325. return _id;
  47326. },
  47327. set: function(value) {
  47328. _id = "" + value;
  47329. }
  47330. },
  47331. "pauseOnExit": {
  47332. enumerable: true,
  47333. get: function() {
  47334. return _pauseOnExit;
  47335. },
  47336. set: function(value) {
  47337. _pauseOnExit = !!value;
  47338. }
  47339. },
  47340. "startTime": {
  47341. enumerable: true,
  47342. get: function() {
  47343. return _startTime;
  47344. },
  47345. set: function(value) {
  47346. if (typeof value !== "number") {
  47347. throw new TypeError("Start time must be set to a number.");
  47348. }
  47349. _startTime = value;
  47350. this.hasBeenReset = true;
  47351. }
  47352. },
  47353. "endTime": {
  47354. enumerable: true,
  47355. get: function() {
  47356. return _endTime;
  47357. },
  47358. set: function(value) {
  47359. if (typeof value !== "number") {
  47360. throw new TypeError("End time must be set to a number.");
  47361. }
  47362. _endTime = value;
  47363. this.hasBeenReset = true;
  47364. }
  47365. },
  47366. "text": {
  47367. enumerable: true,
  47368. get: function() {
  47369. return _text;
  47370. },
  47371. set: function(value) {
  47372. _text = "" + value;
  47373. this.hasBeenReset = true;
  47374. }
  47375. },
  47376. "region": {
  47377. enumerable: true,
  47378. get: function() {
  47379. return _region;
  47380. },
  47381. set: function(value) {
  47382. _region = value;
  47383. this.hasBeenReset = true;
  47384. }
  47385. },
  47386. "vertical": {
  47387. enumerable: true,
  47388. get: function() {
  47389. return _vertical;
  47390. },
  47391. set: function(value) {
  47392. var setting = findDirectionSetting(value);
  47393. if (setting === false) {
  47394. throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
  47395. }
  47396. _vertical = setting;
  47397. this.hasBeenReset = true;
  47398. }
  47399. },
  47400. "snapToLines": {
  47401. enumerable: true,
  47402. get: function() {
  47403. return _snapToLines;
  47404. },
  47405. set: function(value) {
  47406. _snapToLines = !!value;
  47407. this.hasBeenReset = true;
  47408. }
  47409. },
  47410. "line": {
  47411. enumerable: true,
  47412. get: function() {
  47413. return _line;
  47414. },
  47415. set: function(value) {
  47416. if (typeof value !== "number" && value !== autoKeyword) {
  47417. throw new SyntaxError("Line: an invalid number or illegal string was specified.");
  47418. }
  47419. _line = value;
  47420. this.hasBeenReset = true;
  47421. }
  47422. },
  47423. "lineAlign": {
  47424. enumerable: true,
  47425. get: function() {
  47426. return _lineAlign;
  47427. },
  47428. set: function(value) {
  47429. var setting = findAlignSetting(value);
  47430. if (!setting) {
  47431. console.warn("lineAlign: an invalid or illegal string was specified.");
  47432. } else {
  47433. _lineAlign = setting;
  47434. this.hasBeenReset = true;
  47435. }
  47436. }
  47437. },
  47438. "position": {
  47439. enumerable: true,
  47440. get: function() {
  47441. return _position;
  47442. },
  47443. set: function(value) {
  47444. if (value < 0 || value > 100) {
  47445. throw new Error("Position must be between 0 and 100.");
  47446. }
  47447. _position = value;
  47448. this.hasBeenReset = true;
  47449. }
  47450. },
  47451. "positionAlign": {
  47452. enumerable: true,
  47453. get: function() {
  47454. return _positionAlign;
  47455. },
  47456. set: function(value) {
  47457. var setting = findAlignSetting(value);
  47458. if (!setting) {
  47459. console.warn("positionAlign: an invalid or illegal string was specified.");
  47460. } else {
  47461. _positionAlign = setting;
  47462. this.hasBeenReset = true;
  47463. }
  47464. }
  47465. },
  47466. "size": {
  47467. enumerable: true,
  47468. get: function() {
  47469. return _size;
  47470. },
  47471. set: function(value) {
  47472. if (value < 0 || value > 100) {
  47473. throw new Error("Size must be between 0 and 100.");
  47474. }
  47475. _size = value;
  47476. this.hasBeenReset = true;
  47477. }
  47478. },
  47479. "align": {
  47480. enumerable: true,
  47481. get: function() {
  47482. return _align;
  47483. },
  47484. set: function(value) {
  47485. var setting = findAlignSetting(value);
  47486. if (!setting) {
  47487. throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
  47488. }
  47489. _align = setting;
  47490. this.hasBeenReset = true;
  47491. }
  47492. }
  47493. });
  47494. this.displayState = void 0;
  47495. }
  47496. VTTCue.prototype.getCueAsHTML = function() {
  47497. return WebVTT.convertCueToDOMTree(window, this.text);
  47498. };
  47499. var vttcue = VTTCue;
  47500. var scrollSetting = {
  47501. "": true,
  47502. "up": true
  47503. };
  47504. function findScrollSetting(value) {
  47505. if (typeof value !== "string") {
  47506. return false;
  47507. }
  47508. var scroll = scrollSetting[value.toLowerCase()];
  47509. return scroll ? value.toLowerCase() : false;
  47510. }
  47511. function isValidPercentValue(value) {
  47512. return typeof value === "number" && (value >= 0 && value <= 100);
  47513. }
  47514. function VTTRegion() {
  47515. var _width = 100;
  47516. var _lines = 3;
  47517. var _regionAnchorX = 0;
  47518. var _regionAnchorY = 100;
  47519. var _viewportAnchorX = 0;
  47520. var _viewportAnchorY = 100;
  47521. var _scroll = "";
  47522. Object.defineProperties(this, {
  47523. "width": {
  47524. enumerable: true,
  47525. get: function() {
  47526. return _width;
  47527. },
  47528. set: function(value) {
  47529. if (!isValidPercentValue(value)) {
  47530. throw new Error("Width must be between 0 and 100.");
  47531. }
  47532. _width = value;
  47533. }
  47534. },
  47535. "lines": {
  47536. enumerable: true,
  47537. get: function() {
  47538. return _lines;
  47539. },
  47540. set: function(value) {
  47541. if (typeof value !== "number") {
  47542. throw new TypeError("Lines must be set to a number.");
  47543. }
  47544. _lines = value;
  47545. }
  47546. },
  47547. "regionAnchorY": {
  47548. enumerable: true,
  47549. get: function() {
  47550. return _regionAnchorY;
  47551. },
  47552. set: function(value) {
  47553. if (!isValidPercentValue(value)) {
  47554. throw new Error("RegionAnchorX must be between 0 and 100.");
  47555. }
  47556. _regionAnchorY = value;
  47557. }
  47558. },
  47559. "regionAnchorX": {
  47560. enumerable: true,
  47561. get: function() {
  47562. return _regionAnchorX;
  47563. },
  47564. set: function(value) {
  47565. if (!isValidPercentValue(value)) {
  47566. throw new Error("RegionAnchorY must be between 0 and 100.");
  47567. }
  47568. _regionAnchorX = value;
  47569. }
  47570. },
  47571. "viewportAnchorY": {
  47572. enumerable: true,
  47573. get: function() {
  47574. return _viewportAnchorY;
  47575. },
  47576. set: function(value) {
  47577. if (!isValidPercentValue(value)) {
  47578. throw new Error("ViewportAnchorY must be between 0 and 100.");
  47579. }
  47580. _viewportAnchorY = value;
  47581. }
  47582. },
  47583. "viewportAnchorX": {
  47584. enumerable: true,
  47585. get: function() {
  47586. return _viewportAnchorX;
  47587. },
  47588. set: function(value) {
  47589. if (!isValidPercentValue(value)) {
  47590. throw new Error("ViewportAnchorX must be between 0 and 100.");
  47591. }
  47592. _viewportAnchorX = value;
  47593. }
  47594. },
  47595. "scroll": {
  47596. enumerable: true,
  47597. get: function() {
  47598. return _scroll;
  47599. },
  47600. set: function(value) {
  47601. var setting = findScrollSetting(value);
  47602. if (setting === false) {
  47603. console.warn("Scroll: an invalid or illegal string was specified.");
  47604. } else {
  47605. _scroll = setting;
  47606. }
  47607. }
  47608. }
  47609. });
  47610. }
  47611. var vttregion = VTTRegion;
  47612. var window$1 = window_1;
  47613. var vttjs = browserIndex.exports = {
  47614. WebVTT: vtt$1,
  47615. VTTCue: vttcue,
  47616. VTTRegion: vttregion
  47617. };
  47618. window$1.vttjs = vttjs;
  47619. window$1.WebVTT = vttjs.WebVTT;
  47620. var cueShim = vttjs.VTTCue;
  47621. var regionShim = vttjs.VTTRegion;
  47622. var nativeVTTCue = window$1.VTTCue;
  47623. var nativeVTTRegion = window$1.VTTRegion;
  47624. vttjs.shim = function() {
  47625. window$1.VTTCue = cueShim;
  47626. window$1.VTTRegion = regionShim;
  47627. };
  47628. vttjs.restore = function() {
  47629. window$1.VTTCue = nativeVTTCue;
  47630. window$1.VTTRegion = nativeVTTRegion;
  47631. };
  47632. if (!window$1.VTTCue) {
  47633. vttjs.shim();
  47634. }
  47635. var vtt = browserIndex.exports;
  47636. var urlToolkit = { exports: {} };
  47637. (function(module2, exports2) {
  47638. (function(root2) {
  47639. var URL_REGEX = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;
  47640. var FIRST_SEGMENT_REGEX = /^(?=([^\/?#]*))\1([^]*)$/;
  47641. var SLASH_DOT_REGEX = /(?:\/|^)\.(?=\/)/g;
  47642. var SLASH_DOT_DOT_REGEX = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;
  47643. var URLToolkit2 = {
  47644. buildAbsoluteURL: function(baseURL, relativeURL, opts) {
  47645. opts = opts || {};
  47646. baseURL = baseURL.trim();
  47647. relativeURL = relativeURL.trim();
  47648. if (!relativeURL) {
  47649. if (!opts.alwaysNormalize) {
  47650. return baseURL;
  47651. }
  47652. var basePartsForNormalise = URLToolkit2.parseURL(baseURL);
  47653. if (!basePartsForNormalise) {
  47654. throw new Error("Error trying to parse base URL.");
  47655. }
  47656. basePartsForNormalise.path = URLToolkit2.normalizePath(
  47657. basePartsForNormalise.path
  47658. );
  47659. return URLToolkit2.buildURLFromParts(basePartsForNormalise);
  47660. }
  47661. var relativeParts = URLToolkit2.parseURL(relativeURL);
  47662. if (!relativeParts) {
  47663. throw new Error("Error trying to parse relative URL.");
  47664. }
  47665. if (relativeParts.scheme) {
  47666. if (!opts.alwaysNormalize) {
  47667. return relativeURL;
  47668. }
  47669. relativeParts.path = URLToolkit2.normalizePath(relativeParts.path);
  47670. return URLToolkit2.buildURLFromParts(relativeParts);
  47671. }
  47672. var baseParts = URLToolkit2.parseURL(baseURL);
  47673. if (!baseParts) {
  47674. throw new Error("Error trying to parse base URL.");
  47675. }
  47676. if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== "/") {
  47677. var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);
  47678. baseParts.netLoc = pathParts[1];
  47679. baseParts.path = pathParts[2];
  47680. }
  47681. if (baseParts.netLoc && !baseParts.path) {
  47682. baseParts.path = "/";
  47683. }
  47684. var builtParts = {
  47685. scheme: baseParts.scheme,
  47686. netLoc: relativeParts.netLoc,
  47687. path: null,
  47688. params: relativeParts.params,
  47689. query: relativeParts.query,
  47690. fragment: relativeParts.fragment
  47691. };
  47692. if (!relativeParts.netLoc) {
  47693. builtParts.netLoc = baseParts.netLoc;
  47694. if (relativeParts.path[0] !== "/") {
  47695. if (!relativeParts.path) {
  47696. builtParts.path = baseParts.path;
  47697. if (!relativeParts.params) {
  47698. builtParts.params = baseParts.params;
  47699. if (!relativeParts.query) {
  47700. builtParts.query = baseParts.query;
  47701. }
  47702. }
  47703. } else {
  47704. var baseURLPath = baseParts.path;
  47705. var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf("/") + 1) + relativeParts.path;
  47706. builtParts.path = URLToolkit2.normalizePath(newPath);
  47707. }
  47708. }
  47709. }
  47710. if (builtParts.path === null) {
  47711. builtParts.path = opts.alwaysNormalize ? URLToolkit2.normalizePath(relativeParts.path) : relativeParts.path;
  47712. }
  47713. return URLToolkit2.buildURLFromParts(builtParts);
  47714. },
  47715. parseURL: function(url) {
  47716. var parts = URL_REGEX.exec(url);
  47717. if (!parts) {
  47718. return null;
  47719. }
  47720. return {
  47721. scheme: parts[1] || "",
  47722. netLoc: parts[2] || "",
  47723. path: parts[3] || "",
  47724. params: parts[4] || "",
  47725. query: parts[5] || "",
  47726. fragment: parts[6] || ""
  47727. };
  47728. },
  47729. normalizePath: function(path) {
  47730. path = path.split("").reverse().join("").replace(SLASH_DOT_REGEX, "");
  47731. while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, "")).length) {
  47732. }
  47733. return path.split("").reverse().join("");
  47734. },
  47735. buildURLFromParts: function(parts) {
  47736. return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;
  47737. }
  47738. };
  47739. module2.exports = URLToolkit2;
  47740. })();
  47741. })(urlToolkit);
  47742. var URLToolkit = urlToolkit.exports;
  47743. var DEFAULT_LOCATION$2 = "http://example.com";
  47744. var resolveUrl$4 = function resolveUrl(baseUrl, relativeUrl) {
  47745. if (/^[a-z]+:/i.test(relativeUrl)) {
  47746. return relativeUrl;
  47747. }
  47748. if (/^data:/.test(baseUrl)) {
  47749. baseUrl = window_1.location && window_1.location.href || "";
  47750. }
  47751. var nativeURL = typeof window_1.URL === "function";
  47752. var protocolLess = /^\/\//.test(baseUrl);
  47753. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  47754. if (nativeURL) {
  47755. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$2);
  47756. } else if (!/\/\//i.test(baseUrl)) {
  47757. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  47758. }
  47759. if (nativeURL) {
  47760. var newUrl = new URL(relativeUrl, baseUrl);
  47761. if (removeLocation) {
  47762. return newUrl.href.slice(DEFAULT_LOCATION$2.length);
  47763. } else if (protocolLess) {
  47764. return newUrl.href.slice(newUrl.protocol.length);
  47765. }
  47766. return newUrl.href;
  47767. }
  47768. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  47769. };
  47770. var Stream$1 = /* @__PURE__ */ function() {
  47771. function Stream2() {
  47772. this.listeners = {};
  47773. }
  47774. var _proto = Stream2.prototype;
  47775. _proto.on = function on3(type2, listener) {
  47776. if (!this.listeners[type2]) {
  47777. this.listeners[type2] = [];
  47778. }
  47779. this.listeners[type2].push(listener);
  47780. };
  47781. _proto.off = function off2(type2, listener) {
  47782. if (!this.listeners[type2]) {
  47783. return false;
  47784. }
  47785. var index2 = this.listeners[type2].indexOf(listener);
  47786. this.listeners[type2] = this.listeners[type2].slice(0);
  47787. this.listeners[type2].splice(index2, 1);
  47788. return index2 > -1;
  47789. };
  47790. _proto.trigger = function trigger2(type2) {
  47791. var callbacks = this.listeners[type2];
  47792. if (!callbacks) {
  47793. return;
  47794. }
  47795. if (arguments.length === 2) {
  47796. var length = callbacks.length;
  47797. for (var i2 = 0; i2 < length; ++i2) {
  47798. callbacks[i2].call(this, arguments[1]);
  47799. }
  47800. } else {
  47801. var args = Array.prototype.slice.call(arguments, 1);
  47802. var _length = callbacks.length;
  47803. for (var _i = 0; _i < _length; ++_i) {
  47804. callbacks[_i].apply(this, args);
  47805. }
  47806. }
  47807. };
  47808. _proto.dispose = function dispose() {
  47809. this.listeners = {};
  47810. };
  47811. _proto.pipe = function pipe(destination2) {
  47812. this.on("data", function(data) {
  47813. destination2.push(data);
  47814. });
  47815. };
  47816. return Stream2;
  47817. }();
  47818. var atob$2 = function atob(s) {
  47819. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  47820. };
  47821. function decodeB64ToUint8Array$2(b64Text) {
  47822. var decodedString = atob$2(b64Text);
  47823. var array = new Uint8Array(decodedString.length);
  47824. for (var i2 = 0; i2 < decodedString.length; i2++) {
  47825. array[i2] = decodedString.charCodeAt(i2);
  47826. }
  47827. return array;
  47828. }
  47829. /*! @name m3u8-parser @version 6.1.0 @license Apache-2.0 */
  47830. class LineStream$1 extends Stream$1 {
  47831. constructor() {
  47832. super();
  47833. this.buffer = "";
  47834. }
  47835. push(data) {
  47836. let nextNewline;
  47837. this.buffer += data;
  47838. nextNewline = this.buffer.indexOf("\n");
  47839. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  47840. this.trigger("data", this.buffer.substring(0, nextNewline));
  47841. this.buffer = this.buffer.substring(nextNewline + 1);
  47842. }
  47843. }
  47844. }
  47845. const TAB$1 = String.fromCharCode(9);
  47846. const parseByterange$1 = function(byterangeString) {
  47847. const match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  47848. const result = {};
  47849. if (match[1]) {
  47850. result.length = parseInt(match[1], 10);
  47851. }
  47852. if (match[2]) {
  47853. result.offset = parseInt(match[2], 10);
  47854. }
  47855. return result;
  47856. };
  47857. const attributeSeparator$1 = function() {
  47858. const key = "[^=]*";
  47859. const value = '"[^"]*"|[^,]*';
  47860. const keyvalue = "(?:" + key + ")=(?:" + value + ")";
  47861. return new RegExp("(?:^|,)(" + keyvalue + ")");
  47862. };
  47863. const parseAttributes$3 = function(attributes) {
  47864. const result = {};
  47865. if (!attributes) {
  47866. return result;
  47867. }
  47868. const attrs = attributes.split(attributeSeparator$1());
  47869. let i2 = attrs.length;
  47870. let attr;
  47871. while (i2--) {
  47872. if (attrs[i2] === "") {
  47873. continue;
  47874. }
  47875. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  47876. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  47877. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  47878. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  47879. result[attr[0]] = attr[1];
  47880. }
  47881. return result;
  47882. };
  47883. class ParseStream$1 extends Stream$1 {
  47884. constructor() {
  47885. super();
  47886. this.customParsers = [];
  47887. this.tagMappers = [];
  47888. }
  47889. push(line) {
  47890. let match;
  47891. let event2;
  47892. line = line.trim();
  47893. if (line.length === 0) {
  47894. return;
  47895. }
  47896. if (line[0] !== "#") {
  47897. this.trigger("data", {
  47898. type: "uri",
  47899. uri: line
  47900. });
  47901. return;
  47902. }
  47903. const newLines = this.tagMappers.reduce((acc, mapper) => {
  47904. const mappedLine = mapper(line);
  47905. if (mappedLine === line) {
  47906. return acc;
  47907. }
  47908. return acc.concat([mappedLine]);
  47909. }, [line]);
  47910. newLines.forEach((newLine) => {
  47911. for (let i2 = 0; i2 < this.customParsers.length; i2++) {
  47912. if (this.customParsers[i2].call(this, newLine)) {
  47913. return;
  47914. }
  47915. }
  47916. if (newLine.indexOf("#EXT") !== 0) {
  47917. this.trigger("data", {
  47918. type: "comment",
  47919. text: newLine.slice(1)
  47920. });
  47921. return;
  47922. }
  47923. newLine = newLine.replace("\r", "");
  47924. match = /^#EXTM3U/.exec(newLine);
  47925. if (match) {
  47926. this.trigger("data", {
  47927. type: "tag",
  47928. tagType: "m3u"
  47929. });
  47930. return;
  47931. }
  47932. match = /^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(newLine);
  47933. if (match) {
  47934. event2 = {
  47935. type: "tag",
  47936. tagType: "inf"
  47937. };
  47938. if (match[1]) {
  47939. event2.duration = parseFloat(match[1]);
  47940. }
  47941. if (match[2]) {
  47942. event2.title = match[2];
  47943. }
  47944. this.trigger("data", event2);
  47945. return;
  47946. }
  47947. match = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(newLine);
  47948. if (match) {
  47949. event2 = {
  47950. type: "tag",
  47951. tagType: "targetduration"
  47952. };
  47953. if (match[1]) {
  47954. event2.duration = parseInt(match[1], 10);
  47955. }
  47956. this.trigger("data", event2);
  47957. return;
  47958. }
  47959. match = /^#EXT-X-VERSION:([0-9.]*)?/.exec(newLine);
  47960. if (match) {
  47961. event2 = {
  47962. type: "tag",
  47963. tagType: "version"
  47964. };
  47965. if (match[1]) {
  47966. event2.version = parseInt(match[1], 10);
  47967. }
  47968. this.trigger("data", event2);
  47969. return;
  47970. }
  47971. match = /^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  47972. if (match) {
  47973. event2 = {
  47974. type: "tag",
  47975. tagType: "media-sequence"
  47976. };
  47977. if (match[1]) {
  47978. event2.number = parseInt(match[1], 10);
  47979. }
  47980. this.trigger("data", event2);
  47981. return;
  47982. }
  47983. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  47984. if (match) {
  47985. event2 = {
  47986. type: "tag",
  47987. tagType: "discontinuity-sequence"
  47988. };
  47989. if (match[1]) {
  47990. event2.number = parseInt(match[1], 10);
  47991. }
  47992. this.trigger("data", event2);
  47993. return;
  47994. }
  47995. match = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(newLine);
  47996. if (match) {
  47997. event2 = {
  47998. type: "tag",
  47999. tagType: "playlist-type"
  48000. };
  48001. if (match[1]) {
  48002. event2.playlistType = match[1];
  48003. }
  48004. this.trigger("data", event2);
  48005. return;
  48006. }
  48007. match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);
  48008. if (match) {
  48009. event2 = _extends$2(parseByterange$1(match[1]), {
  48010. type: "tag",
  48011. tagType: "byterange"
  48012. });
  48013. this.trigger("data", event2);
  48014. return;
  48015. }
  48016. match = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(newLine);
  48017. if (match) {
  48018. event2 = {
  48019. type: "tag",
  48020. tagType: "allow-cache"
  48021. };
  48022. if (match[1]) {
  48023. event2.allowed = !/NO/.test(match[1]);
  48024. }
  48025. this.trigger("data", event2);
  48026. return;
  48027. }
  48028. match = /^#EXT-X-MAP:(.*)$/.exec(newLine);
  48029. if (match) {
  48030. event2 = {
  48031. type: "tag",
  48032. tagType: "map"
  48033. };
  48034. if (match[1]) {
  48035. const attributes = parseAttributes$3(match[1]);
  48036. if (attributes.URI) {
  48037. event2.uri = attributes.URI;
  48038. }
  48039. if (attributes.BYTERANGE) {
  48040. event2.byterange = parseByterange$1(attributes.BYTERANGE);
  48041. }
  48042. }
  48043. this.trigger("data", event2);
  48044. return;
  48045. }
  48046. match = /^#EXT-X-STREAM-INF:(.*)$/.exec(newLine);
  48047. if (match) {
  48048. event2 = {
  48049. type: "tag",
  48050. tagType: "stream-inf"
  48051. };
  48052. if (match[1]) {
  48053. event2.attributes = parseAttributes$3(match[1]);
  48054. if (event2.attributes.RESOLUTION) {
  48055. const split2 = event2.attributes.RESOLUTION.split("x");
  48056. const resolution = {};
  48057. if (split2[0]) {
  48058. resolution.width = parseInt(split2[0], 10);
  48059. }
  48060. if (split2[1]) {
  48061. resolution.height = parseInt(split2[1], 10);
  48062. }
  48063. event2.attributes.RESOLUTION = resolution;
  48064. }
  48065. if (event2.attributes.BANDWIDTH) {
  48066. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  48067. }
  48068. if (event2.attributes["FRAME-RATE"]) {
  48069. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  48070. }
  48071. if (event2.attributes["PROGRAM-ID"]) {
  48072. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  48073. }
  48074. }
  48075. this.trigger("data", event2);
  48076. return;
  48077. }
  48078. match = /^#EXT-X-MEDIA:(.*)$/.exec(newLine);
  48079. if (match) {
  48080. event2 = {
  48081. type: "tag",
  48082. tagType: "media"
  48083. };
  48084. if (match[1]) {
  48085. event2.attributes = parseAttributes$3(match[1]);
  48086. }
  48087. this.trigger("data", event2);
  48088. return;
  48089. }
  48090. match = /^#EXT-X-ENDLIST/.exec(newLine);
  48091. if (match) {
  48092. this.trigger("data", {
  48093. type: "tag",
  48094. tagType: "endlist"
  48095. });
  48096. return;
  48097. }
  48098. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  48099. if (match) {
  48100. this.trigger("data", {
  48101. type: "tag",
  48102. tagType: "discontinuity"
  48103. });
  48104. return;
  48105. }
  48106. match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);
  48107. if (match) {
  48108. event2 = {
  48109. type: "tag",
  48110. tagType: "program-date-time"
  48111. };
  48112. if (match[1]) {
  48113. event2.dateTimeString = match[1];
  48114. event2.dateTimeObject = new Date(match[1]);
  48115. }
  48116. this.trigger("data", event2);
  48117. return;
  48118. }
  48119. match = /^#EXT-X-KEY:(.*)$/.exec(newLine);
  48120. if (match) {
  48121. event2 = {
  48122. type: "tag",
  48123. tagType: "key"
  48124. };
  48125. if (match[1]) {
  48126. event2.attributes = parseAttributes$3(match[1]);
  48127. if (event2.attributes.IV) {
  48128. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  48129. event2.attributes.IV = event2.attributes.IV.substring(2);
  48130. }
  48131. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  48132. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  48133. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  48134. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  48135. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  48136. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  48137. }
  48138. }
  48139. this.trigger("data", event2);
  48140. return;
  48141. }
  48142. match = /^#EXT-X-START:(.*)$/.exec(newLine);
  48143. if (match) {
  48144. event2 = {
  48145. type: "tag",
  48146. tagType: "start"
  48147. };
  48148. if (match[1]) {
  48149. event2.attributes = parseAttributes$3(match[1]);
  48150. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  48151. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  48152. }
  48153. this.trigger("data", event2);
  48154. return;
  48155. }
  48156. match = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(newLine);
  48157. if (match) {
  48158. event2 = {
  48159. type: "tag",
  48160. tagType: "cue-out-cont"
  48161. };
  48162. if (match[1]) {
  48163. event2.data = match[1];
  48164. } else {
  48165. event2.data = "";
  48166. }
  48167. this.trigger("data", event2);
  48168. return;
  48169. }
  48170. match = /^#EXT-X-CUE-OUT:(.*)?$/.exec(newLine);
  48171. if (match) {
  48172. event2 = {
  48173. type: "tag",
  48174. tagType: "cue-out"
  48175. };
  48176. if (match[1]) {
  48177. event2.data = match[1];
  48178. } else {
  48179. event2.data = "";
  48180. }
  48181. this.trigger("data", event2);
  48182. return;
  48183. }
  48184. match = /^#EXT-X-CUE-IN:(.*)?$/.exec(newLine);
  48185. if (match) {
  48186. event2 = {
  48187. type: "tag",
  48188. tagType: "cue-in"
  48189. };
  48190. if (match[1]) {
  48191. event2.data = match[1];
  48192. } else {
  48193. event2.data = "";
  48194. }
  48195. this.trigger("data", event2);
  48196. return;
  48197. }
  48198. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  48199. if (match && match[1]) {
  48200. event2 = {
  48201. type: "tag",
  48202. tagType: "skip"
  48203. };
  48204. event2.attributes = parseAttributes$3(match[1]);
  48205. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  48206. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  48207. }
  48208. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  48209. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB$1);
  48210. }
  48211. this.trigger("data", event2);
  48212. return;
  48213. }
  48214. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  48215. if (match && match[1]) {
  48216. event2 = {
  48217. type: "tag",
  48218. tagType: "part"
  48219. };
  48220. event2.attributes = parseAttributes$3(match[1]);
  48221. ["DURATION"].forEach(function(key) {
  48222. if (event2.attributes.hasOwnProperty(key)) {
  48223. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48224. }
  48225. });
  48226. ["INDEPENDENT", "GAP"].forEach(function(key) {
  48227. if (event2.attributes.hasOwnProperty(key)) {
  48228. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48229. }
  48230. });
  48231. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  48232. event2.attributes.byterange = parseByterange$1(event2.attributes.BYTERANGE);
  48233. }
  48234. this.trigger("data", event2);
  48235. return;
  48236. }
  48237. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  48238. if (match && match[1]) {
  48239. event2 = {
  48240. type: "tag",
  48241. tagType: "server-control"
  48242. };
  48243. event2.attributes = parseAttributes$3(match[1]);
  48244. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  48245. if (event2.attributes.hasOwnProperty(key)) {
  48246. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48247. }
  48248. });
  48249. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  48250. if (event2.attributes.hasOwnProperty(key)) {
  48251. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48252. }
  48253. });
  48254. this.trigger("data", event2);
  48255. return;
  48256. }
  48257. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  48258. if (match && match[1]) {
  48259. event2 = {
  48260. type: "tag",
  48261. tagType: "part-inf"
  48262. };
  48263. event2.attributes = parseAttributes$3(match[1]);
  48264. ["PART-TARGET"].forEach(function(key) {
  48265. if (event2.attributes.hasOwnProperty(key)) {
  48266. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48267. }
  48268. });
  48269. this.trigger("data", event2);
  48270. return;
  48271. }
  48272. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  48273. if (match && match[1]) {
  48274. event2 = {
  48275. type: "tag",
  48276. tagType: "preload-hint"
  48277. };
  48278. event2.attributes = parseAttributes$3(match[1]);
  48279. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  48280. if (event2.attributes.hasOwnProperty(key)) {
  48281. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48282. const subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  48283. event2.attributes.byterange = event2.attributes.byterange || {};
  48284. event2.attributes.byterange[subkey] = event2.attributes[key];
  48285. delete event2.attributes[key];
  48286. }
  48287. });
  48288. this.trigger("data", event2);
  48289. return;
  48290. }
  48291. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  48292. if (match && match[1]) {
  48293. event2 = {
  48294. type: "tag",
  48295. tagType: "rendition-report"
  48296. };
  48297. event2.attributes = parseAttributes$3(match[1]);
  48298. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  48299. if (event2.attributes.hasOwnProperty(key)) {
  48300. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48301. }
  48302. });
  48303. this.trigger("data", event2);
  48304. return;
  48305. }
  48306. match = /^#EXT-X-DATERANGE:(.*)$/.exec(newLine);
  48307. if (match && match[1]) {
  48308. event2 = {
  48309. type: "tag",
  48310. tagType: "daterange"
  48311. };
  48312. event2.attributes = parseAttributes$3(match[1]);
  48313. ["ID", "CLASS"].forEach(function(key) {
  48314. if (event2.attributes.hasOwnProperty(key)) {
  48315. event2.attributes[key] = String(event2.attributes[key]);
  48316. }
  48317. });
  48318. ["START-DATE", "END-DATE"].forEach(function(key) {
  48319. if (event2.attributes.hasOwnProperty(key)) {
  48320. event2.attributes[key] = new Date(event2.attributes[key]);
  48321. }
  48322. });
  48323. ["DURATION", "PLANNED-DURATION"].forEach(function(key) {
  48324. if (event2.attributes.hasOwnProperty(key)) {
  48325. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48326. }
  48327. });
  48328. ["END-ON-NEXT"].forEach(function(key) {
  48329. if (event2.attributes.hasOwnProperty(key)) {
  48330. event2.attributes[key] = /YES/i.test(event2.attributes[key]);
  48331. }
  48332. });
  48333. ["SCTE35-CMD", " SCTE35-OUT", "SCTE35-IN"].forEach(function(key) {
  48334. if (event2.attributes.hasOwnProperty(key)) {
  48335. event2.attributes[key] = event2.attributes[key].toString(16);
  48336. }
  48337. });
  48338. const clientAttributePattern = /^X-([A-Z]+-)+[A-Z]+$/;
  48339. for (const key in event2.attributes) {
  48340. if (!clientAttributePattern.test(key)) {
  48341. continue;
  48342. }
  48343. const isHexaDecimal = /[0-9A-Fa-f]{6}/g.test(event2.attributes[key]);
  48344. const isDecimalFloating = /^\d+(\.\d+)?$/.test(event2.attributes[key]);
  48345. event2.attributes[key] = isHexaDecimal ? event2.attributes[key].toString(16) : isDecimalFloating ? parseFloat(event2.attributes[key]) : String(event2.attributes[key]);
  48346. }
  48347. this.trigger("data", event2);
  48348. return;
  48349. }
  48350. this.trigger("data", {
  48351. type: "tag",
  48352. data: newLine.slice(4)
  48353. });
  48354. });
  48355. }
  48356. addParser({
  48357. expression,
  48358. customType,
  48359. dataParser,
  48360. segment
  48361. }) {
  48362. if (typeof dataParser !== "function") {
  48363. dataParser = (line) => line;
  48364. }
  48365. this.customParsers.push((line) => {
  48366. const match = expression.exec(line);
  48367. if (match) {
  48368. this.trigger("data", {
  48369. type: "custom",
  48370. data: dataParser(line),
  48371. customType,
  48372. segment
  48373. });
  48374. return true;
  48375. }
  48376. });
  48377. }
  48378. addTagMapper({
  48379. expression,
  48380. map
  48381. }) {
  48382. const mapFn = (line) => {
  48383. if (expression.test(line)) {
  48384. return map(line);
  48385. }
  48386. return line;
  48387. };
  48388. this.tagMappers.push(mapFn);
  48389. }
  48390. }
  48391. const camelCase$1 = (str) => str.toLowerCase().replace(/-(\w)/g, (a) => a[1].toUpperCase());
  48392. const camelCaseKeys$1 = function(attributes) {
  48393. const result = {};
  48394. Object.keys(attributes).forEach(function(key) {
  48395. result[camelCase$1(key)] = attributes[key];
  48396. });
  48397. return result;
  48398. };
  48399. const setHoldBack$1 = function(manifest) {
  48400. const {
  48401. serverControl,
  48402. targetDuration,
  48403. partTargetDuration
  48404. } = manifest;
  48405. if (!serverControl) {
  48406. return;
  48407. }
  48408. const tag = "#EXT-X-SERVER-CONTROL";
  48409. const hb = "holdBack";
  48410. const phb = "partHoldBack";
  48411. const minTargetDuration = targetDuration && targetDuration * 3;
  48412. const minPartDuration = partTargetDuration && partTargetDuration * 2;
  48413. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  48414. serverControl[hb] = minTargetDuration;
  48415. this.trigger("info", {
  48416. message: `${tag} defaulting HOLD-BACK to targetDuration * 3 (${minTargetDuration}).`
  48417. });
  48418. }
  48419. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  48420. this.trigger("warn", {
  48421. message: `${tag} clamping HOLD-BACK (${serverControl[hb]}) to targetDuration * 3 (${minTargetDuration})`
  48422. });
  48423. serverControl[hb] = minTargetDuration;
  48424. }
  48425. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  48426. serverControl[phb] = partTargetDuration * 3;
  48427. this.trigger("info", {
  48428. message: `${tag} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${serverControl[phb]}).`
  48429. });
  48430. }
  48431. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  48432. this.trigger("warn", {
  48433. message: `${tag} clamping PART-HOLD-BACK (${serverControl[phb]}) to partTargetDuration * 2 (${minPartDuration}).`
  48434. });
  48435. serverControl[phb] = minPartDuration;
  48436. }
  48437. };
  48438. class Parser$1 extends Stream$1 {
  48439. constructor() {
  48440. super();
  48441. this.lineStream = new LineStream$1();
  48442. this.parseStream = new ParseStream$1();
  48443. this.lineStream.pipe(this.parseStream);
  48444. const self2 = this;
  48445. const uris = [];
  48446. let currentUri = {};
  48447. let currentMap;
  48448. let key;
  48449. let hasParts = false;
  48450. const noop2 = function() {
  48451. };
  48452. const defaultMediaGroups = {
  48453. "AUDIO": {},
  48454. "VIDEO": {},
  48455. "CLOSED-CAPTIONS": {},
  48456. "SUBTITLES": {}
  48457. };
  48458. const widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  48459. let currentTimeline = 0;
  48460. this.manifest = {
  48461. allowCache: true,
  48462. discontinuityStarts: [],
  48463. segments: []
  48464. };
  48465. let lastByterangeEnd = 0;
  48466. let lastPartByterangeEnd = 0;
  48467. const daterangeTags = {};
  48468. this.on("end", () => {
  48469. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  48470. return;
  48471. }
  48472. if (!currentUri.map && currentMap) {
  48473. currentUri.map = currentMap;
  48474. }
  48475. if (!currentUri.key && key) {
  48476. currentUri.key = key;
  48477. }
  48478. if (!currentUri.timeline && typeof currentTimeline === "number") {
  48479. currentUri.timeline = currentTimeline;
  48480. }
  48481. this.manifest.preloadSegment = currentUri;
  48482. });
  48483. this.parseStream.on("data", function(entry) {
  48484. let mediaGroup;
  48485. let rendition;
  48486. ({
  48487. tag() {
  48488. ({
  48489. version() {
  48490. if (entry.version) {
  48491. this.manifest.version = entry.version;
  48492. }
  48493. },
  48494. "allow-cache"() {
  48495. this.manifest.allowCache = entry.allowed;
  48496. if (!("allowed" in entry)) {
  48497. this.trigger("info", {
  48498. message: "defaulting allowCache to YES"
  48499. });
  48500. this.manifest.allowCache = true;
  48501. }
  48502. },
  48503. byterange() {
  48504. const byterange = {};
  48505. if ("length" in entry) {
  48506. currentUri.byterange = byterange;
  48507. byterange.length = entry.length;
  48508. if (!("offset" in entry)) {
  48509. entry.offset = lastByterangeEnd;
  48510. }
  48511. }
  48512. if ("offset" in entry) {
  48513. currentUri.byterange = byterange;
  48514. byterange.offset = entry.offset;
  48515. }
  48516. lastByterangeEnd = byterange.offset + byterange.length;
  48517. },
  48518. endlist() {
  48519. this.manifest.endList = true;
  48520. },
  48521. inf() {
  48522. if (!("mediaSequence" in this.manifest)) {
  48523. this.manifest.mediaSequence = 0;
  48524. this.trigger("info", {
  48525. message: "defaulting media sequence to zero"
  48526. });
  48527. }
  48528. if (!("discontinuitySequence" in this.manifest)) {
  48529. this.manifest.discontinuitySequence = 0;
  48530. this.trigger("info", {
  48531. message: "defaulting discontinuity sequence to zero"
  48532. });
  48533. }
  48534. if (entry.duration > 0) {
  48535. currentUri.duration = entry.duration;
  48536. }
  48537. if (entry.duration === 0) {
  48538. currentUri.duration = 0.01;
  48539. this.trigger("info", {
  48540. message: "updating zero segment duration to a small value"
  48541. });
  48542. }
  48543. this.manifest.segments = uris;
  48544. },
  48545. key() {
  48546. if (!entry.attributes) {
  48547. this.trigger("warn", {
  48548. message: "ignoring key declaration without attribute list"
  48549. });
  48550. return;
  48551. }
  48552. if (entry.attributes.METHOD === "NONE") {
  48553. key = null;
  48554. return;
  48555. }
  48556. if (!entry.attributes.URI) {
  48557. this.trigger("warn", {
  48558. message: "ignoring key declaration without URI"
  48559. });
  48560. return;
  48561. }
  48562. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  48563. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48564. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  48565. attributes: entry.attributes
  48566. };
  48567. return;
  48568. }
  48569. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  48570. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48571. this.manifest.contentProtection["com.microsoft.playready"] = {
  48572. uri: entry.attributes.URI
  48573. };
  48574. return;
  48575. }
  48576. if (entry.attributes.KEYFORMAT === widevineUuid) {
  48577. const VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  48578. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  48579. this.trigger("warn", {
  48580. message: "invalid key method provided for Widevine"
  48581. });
  48582. return;
  48583. }
  48584. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  48585. this.trigger("warn", {
  48586. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  48587. });
  48588. }
  48589. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  48590. this.trigger("warn", {
  48591. message: "invalid key URI provided for Widevine"
  48592. });
  48593. return;
  48594. }
  48595. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  48596. this.trigger("warn", {
  48597. message: "invalid key ID provided for Widevine"
  48598. });
  48599. return;
  48600. }
  48601. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48602. this.manifest.contentProtection["com.widevine.alpha"] = {
  48603. attributes: {
  48604. schemeIdUri: entry.attributes.KEYFORMAT,
  48605. keyId: entry.attributes.KEYID.substring(2)
  48606. },
  48607. pssh: decodeB64ToUint8Array$2(entry.attributes.URI.split(",")[1])
  48608. };
  48609. return;
  48610. }
  48611. if (!entry.attributes.METHOD) {
  48612. this.trigger("warn", {
  48613. message: "defaulting key method to AES-128"
  48614. });
  48615. }
  48616. key = {
  48617. method: entry.attributes.METHOD || "AES-128",
  48618. uri: entry.attributes.URI
  48619. };
  48620. if (typeof entry.attributes.IV !== "undefined") {
  48621. key.iv = entry.attributes.IV;
  48622. }
  48623. },
  48624. "media-sequence"() {
  48625. if (!isFinite(entry.number)) {
  48626. this.trigger("warn", {
  48627. message: "ignoring invalid media sequence: " + entry.number
  48628. });
  48629. return;
  48630. }
  48631. this.manifest.mediaSequence = entry.number;
  48632. },
  48633. "discontinuity-sequence"() {
  48634. if (!isFinite(entry.number)) {
  48635. this.trigger("warn", {
  48636. message: "ignoring invalid discontinuity sequence: " + entry.number
  48637. });
  48638. return;
  48639. }
  48640. this.manifest.discontinuitySequence = entry.number;
  48641. currentTimeline = entry.number;
  48642. },
  48643. "playlist-type"() {
  48644. if (!/VOD|EVENT/.test(entry.playlistType)) {
  48645. this.trigger("warn", {
  48646. message: "ignoring unknown playlist type: " + entry.playlist
  48647. });
  48648. return;
  48649. }
  48650. this.manifest.playlistType = entry.playlistType;
  48651. },
  48652. map() {
  48653. currentMap = {};
  48654. if (entry.uri) {
  48655. currentMap.uri = entry.uri;
  48656. }
  48657. if (entry.byterange) {
  48658. currentMap.byterange = entry.byterange;
  48659. }
  48660. if (key) {
  48661. currentMap.key = key;
  48662. }
  48663. },
  48664. "stream-inf"() {
  48665. this.manifest.playlists = uris;
  48666. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48667. if (!entry.attributes) {
  48668. this.trigger("warn", {
  48669. message: "ignoring empty stream-inf attributes"
  48670. });
  48671. return;
  48672. }
  48673. if (!currentUri.attributes) {
  48674. currentUri.attributes = {};
  48675. }
  48676. _extends$2(currentUri.attributes, entry.attributes);
  48677. },
  48678. media() {
  48679. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48680. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  48681. this.trigger("warn", {
  48682. message: "ignoring incomplete or missing media group"
  48683. });
  48684. return;
  48685. }
  48686. const mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  48687. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  48688. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  48689. rendition = {
  48690. default: /yes/i.test(entry.attributes.DEFAULT)
  48691. };
  48692. if (rendition.default) {
  48693. rendition.autoselect = true;
  48694. } else {
  48695. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  48696. }
  48697. if (entry.attributes.LANGUAGE) {
  48698. rendition.language = entry.attributes.LANGUAGE;
  48699. }
  48700. if (entry.attributes.URI) {
  48701. rendition.uri = entry.attributes.URI;
  48702. }
  48703. if (entry.attributes["INSTREAM-ID"]) {
  48704. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  48705. }
  48706. if (entry.attributes.CHARACTERISTICS) {
  48707. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  48708. }
  48709. if (entry.attributes.FORCED) {
  48710. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  48711. }
  48712. mediaGroup[entry.attributes.NAME] = rendition;
  48713. },
  48714. discontinuity() {
  48715. currentTimeline += 1;
  48716. currentUri.discontinuity = true;
  48717. this.manifest.discontinuityStarts.push(uris.length);
  48718. },
  48719. "program-date-time"() {
  48720. if (typeof this.manifest.dateTimeString === "undefined") {
  48721. this.manifest.dateTimeString = entry.dateTimeString;
  48722. this.manifest.dateTimeObject = entry.dateTimeObject;
  48723. }
  48724. currentUri.dateTimeString = entry.dateTimeString;
  48725. currentUri.dateTimeObject = entry.dateTimeObject;
  48726. },
  48727. targetduration() {
  48728. if (!isFinite(entry.duration) || entry.duration < 0) {
  48729. this.trigger("warn", {
  48730. message: "ignoring invalid target duration: " + entry.duration
  48731. });
  48732. return;
  48733. }
  48734. this.manifest.targetDuration = entry.duration;
  48735. setHoldBack$1.call(this, this.manifest);
  48736. },
  48737. start() {
  48738. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  48739. this.trigger("warn", {
  48740. message: "ignoring start declaration without appropriate attribute list"
  48741. });
  48742. return;
  48743. }
  48744. this.manifest.start = {
  48745. timeOffset: entry.attributes["TIME-OFFSET"],
  48746. precise: entry.attributes.PRECISE
  48747. };
  48748. },
  48749. "cue-out"() {
  48750. currentUri.cueOut = entry.data;
  48751. },
  48752. "cue-out-cont"() {
  48753. currentUri.cueOutCont = entry.data;
  48754. },
  48755. "cue-in"() {
  48756. currentUri.cueIn = entry.data;
  48757. },
  48758. "skip"() {
  48759. this.manifest.skip = camelCaseKeys$1(entry.attributes);
  48760. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  48761. },
  48762. "part"() {
  48763. hasParts = true;
  48764. const segmentIndex = this.manifest.segments.length;
  48765. const part = camelCaseKeys$1(entry.attributes);
  48766. currentUri.parts = currentUri.parts || [];
  48767. currentUri.parts.push(part);
  48768. if (part.byterange) {
  48769. if (!part.byterange.hasOwnProperty("offset")) {
  48770. part.byterange.offset = lastPartByterangeEnd;
  48771. }
  48772. lastPartByterangeEnd = part.byterange.offset + part.byterange.length;
  48773. }
  48774. const partIndex = currentUri.parts.length - 1;
  48775. this.warnOnMissingAttributes_(`#EXT-X-PART #${partIndex} for segment #${segmentIndex}`, entry.attributes, ["URI", "DURATION"]);
  48776. if (this.manifest.renditionReports) {
  48777. this.manifest.renditionReports.forEach((r2, i2) => {
  48778. if (!r2.hasOwnProperty("lastPart")) {
  48779. this.trigger("warn", {
  48780. message: `#EXT-X-RENDITION-REPORT #${i2} lacks required attribute(s): LAST-PART`
  48781. });
  48782. }
  48783. });
  48784. }
  48785. },
  48786. "server-control"() {
  48787. const attrs = this.manifest.serverControl = camelCaseKeys$1(entry.attributes);
  48788. if (!attrs.hasOwnProperty("canBlockReload")) {
  48789. attrs.canBlockReload = false;
  48790. this.trigger("info", {
  48791. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  48792. });
  48793. }
  48794. setHoldBack$1.call(this, this.manifest);
  48795. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  48796. this.trigger("warn", {
  48797. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  48798. });
  48799. }
  48800. },
  48801. "preload-hint"() {
  48802. const segmentIndex = this.manifest.segments.length;
  48803. const hint = camelCaseKeys$1(entry.attributes);
  48804. const isPart = hint.type && hint.type === "PART";
  48805. currentUri.preloadHints = currentUri.preloadHints || [];
  48806. currentUri.preloadHints.push(hint);
  48807. if (hint.byterange) {
  48808. if (!hint.byterange.hasOwnProperty("offset")) {
  48809. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  48810. if (isPart) {
  48811. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  48812. }
  48813. }
  48814. }
  48815. const index2 = currentUri.preloadHints.length - 1;
  48816. this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex}`, entry.attributes, ["TYPE", "URI"]);
  48817. if (!hint.type) {
  48818. return;
  48819. }
  48820. for (let i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  48821. const otherHint = currentUri.preloadHints[i2];
  48822. if (!otherHint.type) {
  48823. continue;
  48824. }
  48825. if (otherHint.type === hint.type) {
  48826. this.trigger("warn", {
  48827. message: `#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex} has the same TYPE ${hint.type} as preload hint #${i2}`
  48828. });
  48829. }
  48830. }
  48831. },
  48832. "rendition-report"() {
  48833. const report = camelCaseKeys$1(entry.attributes);
  48834. this.manifest.renditionReports = this.manifest.renditionReports || [];
  48835. this.manifest.renditionReports.push(report);
  48836. const index2 = this.manifest.renditionReports.length - 1;
  48837. const required = ["LAST-MSN", "URI"];
  48838. if (hasParts) {
  48839. required.push("LAST-PART");
  48840. }
  48841. this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${index2}`, entry.attributes, required);
  48842. },
  48843. "part-inf"() {
  48844. this.manifest.partInf = camelCaseKeys$1(entry.attributes);
  48845. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  48846. if (this.manifest.partInf.partTarget) {
  48847. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  48848. }
  48849. setHoldBack$1.call(this, this.manifest);
  48850. },
  48851. "daterange"() {
  48852. this.manifest.daterange = this.manifest.daterange || [];
  48853. this.manifest.daterange.push(camelCaseKeys$1(entry.attributes));
  48854. const index2 = this.manifest.daterange.length - 1;
  48855. this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${index2}`, entry.attributes, ["ID", "START-DATE"]);
  48856. const daterange = this.manifest.daterange[index2];
  48857. if (daterange.endDate && daterange.startDate && new Date(daterange.endDate) < new Date(daterange.startDate)) {
  48858. this.trigger("warn", {
  48859. message: "EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"
  48860. });
  48861. }
  48862. if (daterange.duration && daterange.duration < 0) {
  48863. this.trigger("warn", {
  48864. message: "EXT-X-DATERANGE DURATION must not be negative"
  48865. });
  48866. }
  48867. if (daterange.plannedDuration && daterange.plannedDuration < 0) {
  48868. this.trigger("warn", {
  48869. message: "EXT-X-DATERANGE PLANNED-DURATION must not be negative"
  48870. });
  48871. }
  48872. const endOnNextYes = !!daterange.endOnNext;
  48873. if (endOnNextYes && !daterange.class) {
  48874. this.trigger("warn", {
  48875. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"
  48876. });
  48877. }
  48878. if (endOnNextYes && (daterange.duration || daterange.endDate)) {
  48879. this.trigger("warn", {
  48880. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"
  48881. });
  48882. }
  48883. if (daterange.duration && daterange.endDate) {
  48884. const startDate = daterange.startDate;
  48885. const newDateInSeconds = startDate.setSeconds(startDate.getSeconds() + daterange.duration);
  48886. this.manifest.daterange[index2].endDate = new Date(newDateInSeconds);
  48887. }
  48888. if (daterange && !this.manifest.dateTimeString) {
  48889. this.trigger("warn", {
  48890. message: "A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"
  48891. });
  48892. }
  48893. if (!daterangeTags[daterange.id]) {
  48894. daterangeTags[daterange.id] = daterange;
  48895. } else {
  48896. for (const attribute in daterangeTags[daterange.id]) {
  48897. if (daterangeTags[daterange.id][attribute] !== daterange[attribute]) {
  48898. this.trigger("warn", {
  48899. message: "EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values"
  48900. });
  48901. break;
  48902. }
  48903. }
  48904. }
  48905. }
  48906. }[entry.tagType] || noop2).call(self2);
  48907. },
  48908. uri() {
  48909. currentUri.uri = entry.uri;
  48910. uris.push(currentUri);
  48911. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  48912. this.trigger("warn", {
  48913. message: "defaulting segment duration to the target duration"
  48914. });
  48915. currentUri.duration = this.manifest.targetDuration;
  48916. }
  48917. if (key) {
  48918. currentUri.key = key;
  48919. }
  48920. currentUri.timeline = currentTimeline;
  48921. if (currentMap) {
  48922. currentUri.map = currentMap;
  48923. }
  48924. lastPartByterangeEnd = 0;
  48925. currentUri = {};
  48926. },
  48927. comment() {
  48928. },
  48929. custom() {
  48930. if (entry.segment) {
  48931. currentUri.custom = currentUri.custom || {};
  48932. currentUri.custom[entry.customType] = entry.data;
  48933. } else {
  48934. this.manifest.custom = this.manifest.custom || {};
  48935. this.manifest.custom[entry.customType] = entry.data;
  48936. }
  48937. }
  48938. })[entry.type].call(self2);
  48939. });
  48940. }
  48941. warnOnMissingAttributes_(identifier, attributes, required) {
  48942. const missing = [];
  48943. required.forEach(function(key) {
  48944. if (!attributes.hasOwnProperty(key)) {
  48945. missing.push(key);
  48946. }
  48947. });
  48948. if (missing.length) {
  48949. this.trigger("warn", {
  48950. message: `${identifier} lacks required attribute(s): ${missing.join(", ")}`
  48951. });
  48952. }
  48953. }
  48954. push(chunk) {
  48955. this.lineStream.push(chunk);
  48956. }
  48957. end() {
  48958. this.lineStream.push("\n");
  48959. this.trigger("end");
  48960. }
  48961. addParser(options2) {
  48962. this.parseStream.addParser(options2);
  48963. }
  48964. addTagMapper(options2) {
  48965. this.parseStream.addTagMapper(options2);
  48966. }
  48967. }
  48968. var regexs$1 = {
  48969. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  48970. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  48971. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  48972. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  48973. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  48974. text: /^(stpp.ttml.im1t)/,
  48975. muxerVideo: /^(avc0?1)/,
  48976. muxerAudio: /^(mp4a)/,
  48977. muxerText: /a^/
  48978. };
  48979. var mediaTypes$1 = ["video", "audio", "text"];
  48980. var upperMediaTypes$1 = ["Video", "Audio", "Text"];
  48981. var translateLegacyCodec$1 = function translateLegacyCodec(codec) {
  48982. if (!codec) {
  48983. return codec;
  48984. }
  48985. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  48986. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  48987. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  48988. return "avc1." + profileHex + "00" + avcLevelHex;
  48989. });
  48990. };
  48991. var parseCodecs$1 = function parseCodecs(codecString) {
  48992. if (codecString === void 0) {
  48993. codecString = "";
  48994. }
  48995. var codecs = codecString.split(",");
  48996. var result = [];
  48997. codecs.forEach(function(codec) {
  48998. codec = codec.trim();
  48999. var codecType;
  49000. mediaTypes$1.forEach(function(name) {
  49001. var match = regexs$1[name].exec(codec.toLowerCase());
  49002. if (!match || match.length <= 1) {
  49003. return;
  49004. }
  49005. codecType = name;
  49006. var type2 = codec.substring(0, match[1].length);
  49007. var details = codec.replace(type2, "");
  49008. result.push({
  49009. type: type2,
  49010. details,
  49011. mediaType: name
  49012. });
  49013. });
  49014. if (!codecType) {
  49015. result.push({
  49016. type: codec,
  49017. details: "",
  49018. mediaType: "unknown"
  49019. });
  49020. }
  49021. });
  49022. return result;
  49023. };
  49024. var codecsFromDefault$1 = function codecsFromDefault(master, audioGroupId) {
  49025. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  49026. return null;
  49027. }
  49028. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  49029. if (!audioGroup) {
  49030. return null;
  49031. }
  49032. for (var name in audioGroup) {
  49033. var audioType = audioGroup[name];
  49034. if (audioType.default && audioType.playlists) {
  49035. return parseCodecs$1(audioType.playlists[0].attributes.CODECS);
  49036. }
  49037. }
  49038. return null;
  49039. };
  49040. var isAudioCodec$1 = function isAudioCodec(codec) {
  49041. if (codec === void 0) {
  49042. codec = "";
  49043. }
  49044. return regexs$1.audio.test(codec.trim().toLowerCase());
  49045. };
  49046. var isTextCodec$1 = function isTextCodec(codec) {
  49047. if (codec === void 0) {
  49048. codec = "";
  49049. }
  49050. return regexs$1.text.test(codec.trim().toLowerCase());
  49051. };
  49052. var getMimeForCodec$1 = function getMimeForCodec(codecString) {
  49053. if (!codecString || typeof codecString !== "string") {
  49054. return;
  49055. }
  49056. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  49057. return translateLegacyCodec$1(c.trim());
  49058. });
  49059. var type2 = "video";
  49060. if (codecs.length === 1 && isAudioCodec$1(codecs[0])) {
  49061. type2 = "audio";
  49062. } else if (codecs.length === 1 && isTextCodec$1(codecs[0])) {
  49063. type2 = "application";
  49064. }
  49065. var container = "mp4";
  49066. if (codecs.every(function(c) {
  49067. return regexs$1.mp4.test(c);
  49068. })) {
  49069. container = "mp4";
  49070. } else if (codecs.every(function(c) {
  49071. return regexs$1.webm.test(c);
  49072. })) {
  49073. container = "webm";
  49074. } else if (codecs.every(function(c) {
  49075. return regexs$1.ogg.test(c);
  49076. })) {
  49077. container = "ogg";
  49078. }
  49079. return type2 + "/" + container + ';codecs="' + codecString + '"';
  49080. };
  49081. var browserSupportsCodec$1 = function browserSupportsCodec(codecString) {
  49082. if (codecString === void 0) {
  49083. codecString = "";
  49084. }
  49085. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec$1(codecString)) || false;
  49086. };
  49087. var muxerSupportsCodec$1 = function muxerSupportsCodec(codecString) {
  49088. if (codecString === void 0) {
  49089. codecString = "";
  49090. }
  49091. return codecString.toLowerCase().split(",").every(function(codec) {
  49092. codec = codec.trim();
  49093. for (var i2 = 0; i2 < upperMediaTypes$1.length; i2++) {
  49094. var type2 = upperMediaTypes$1[i2];
  49095. if (regexs$1["muxer" + type2].test(codec)) {
  49096. return true;
  49097. }
  49098. }
  49099. return false;
  49100. });
  49101. };
  49102. var DEFAULT_AUDIO_CODEC$1 = "mp4a.40.2";
  49103. var DEFAULT_VIDEO_CODEC$1 = "avc1.4d400d";
  49104. var MPEGURL_REGEX$1 = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  49105. var DASH_REGEX$1 = /^application\/dash\+xml/i;
  49106. var simpleTypeFromSourceType$1 = function simpleTypeFromSourceType(type2) {
  49107. if (MPEGURL_REGEX$1.test(type2)) {
  49108. return "hls";
  49109. }
  49110. if (DASH_REGEX$1.test(type2)) {
  49111. return "dash";
  49112. }
  49113. if (type2 === "application/vnd.videojs.vhs+json") {
  49114. return "vhs-json";
  49115. }
  49116. return null;
  49117. };
  49118. var countBits$1 = function countBits(x) {
  49119. return x.toString(2).length;
  49120. };
  49121. var countBytes$1 = function countBytes(x) {
  49122. return Math.ceil(countBits$1(x) / 8);
  49123. };
  49124. var isArrayBufferView$1 = function isArrayBufferView(obj) {
  49125. if (ArrayBuffer.isView === "function") {
  49126. return ArrayBuffer.isView(obj);
  49127. }
  49128. return obj && obj.buffer instanceof ArrayBuffer;
  49129. };
  49130. var isTypedArray$1 = function isTypedArray(obj) {
  49131. return isArrayBufferView$1(obj);
  49132. };
  49133. var toUint8$1 = function toUint8(bytes) {
  49134. if (bytes instanceof Uint8Array) {
  49135. return bytes;
  49136. }
  49137. if (!Array.isArray(bytes) && !isTypedArray$1(bytes) && !(bytes instanceof ArrayBuffer)) {
  49138. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  49139. bytes = 0;
  49140. } else {
  49141. bytes = [bytes];
  49142. }
  49143. }
  49144. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  49145. };
  49146. var BigInt$1 = window_1.BigInt || Number;
  49147. var BYTE_TABLE$1 = [BigInt$1("0x1"), BigInt$1("0x100"), BigInt$1("0x10000"), BigInt$1("0x1000000"), BigInt$1("0x100000000"), BigInt$1("0x10000000000"), BigInt$1("0x1000000000000"), BigInt$1("0x100000000000000"), BigInt$1("0x10000000000000000")];
  49148. (function() {
  49149. var a = new Uint16Array([65484]);
  49150. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  49151. if (b[0] === 255) {
  49152. return "big";
  49153. }
  49154. if (b[0] === 204) {
  49155. return "little";
  49156. }
  49157. return "unknown";
  49158. })();
  49159. var bytesToNumber$1 = function bytesToNumber(bytes, _temp) {
  49160. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  49161. bytes = toUint8$1(bytes);
  49162. var fn2 = le ? "reduce" : "reduceRight";
  49163. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  49164. var number = obj.call(bytes, function(total, byte, i2) {
  49165. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49166. return total + BigInt$1(byte) * BYTE_TABLE$1[exponent];
  49167. }, BigInt$1(0));
  49168. if (signed) {
  49169. var max2 = BYTE_TABLE$1[bytes.length] / BigInt$1(2) - BigInt$1(1);
  49170. number = BigInt$1(number);
  49171. if (number > max2) {
  49172. number -= max2;
  49173. number -= max2;
  49174. number -= BigInt$1(2);
  49175. }
  49176. }
  49177. return Number(number);
  49178. };
  49179. var numberToBytes$1 = function numberToBytes(number, _temp2) {
  49180. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  49181. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  49182. number = 0;
  49183. }
  49184. number = BigInt$1(number);
  49185. var byteCount = countBytes$1(number);
  49186. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  49187. for (var i2 = 0; i2 < byteCount; i2++) {
  49188. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49189. bytes[byteIndex] = Number(number / BYTE_TABLE$1[i2] & BigInt$1(255));
  49190. if (number < 0) {
  49191. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  49192. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  49193. }
  49194. }
  49195. return bytes;
  49196. };
  49197. var stringToBytes$1 = function stringToBytes(string, stringIsBytes) {
  49198. if (typeof string !== "string" && string && typeof string.toString === "function") {
  49199. string = string.toString();
  49200. }
  49201. if (typeof string !== "string") {
  49202. return new Uint8Array();
  49203. }
  49204. if (!stringIsBytes) {
  49205. string = unescape(encodeURIComponent(string));
  49206. }
  49207. var view = new Uint8Array(string.length);
  49208. for (var i2 = 0; i2 < string.length; i2++) {
  49209. view[i2] = string.charCodeAt(i2);
  49210. }
  49211. return view;
  49212. };
  49213. var concatTypedArrays$1 = function concatTypedArrays() {
  49214. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  49215. buffers[_key] = arguments[_key];
  49216. }
  49217. buffers = buffers.filter(function(b) {
  49218. return b && (b.byteLength || b.length) && typeof b !== "string";
  49219. });
  49220. if (buffers.length <= 1) {
  49221. return toUint8$1(buffers[0]);
  49222. }
  49223. var totalLen = buffers.reduce(function(total, buf, i2) {
  49224. return total + (buf.byteLength || buf.length);
  49225. }, 0);
  49226. var tempBuffer = new Uint8Array(totalLen);
  49227. var offset = 0;
  49228. buffers.forEach(function(buf) {
  49229. buf = toUint8$1(buf);
  49230. tempBuffer.set(buf, offset);
  49231. offset += buf.byteLength;
  49232. });
  49233. return tempBuffer;
  49234. };
  49235. var bytesMatch$1 = function bytesMatch(a, b, _temp3) {
  49236. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  49237. a = toUint8$1(a);
  49238. b = toUint8$1(b);
  49239. var fn2 = b.every ? b.every : Array.prototype.every;
  49240. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  49241. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  49242. return bByte === aByte;
  49243. });
  49244. };
  49245. var DEFAULT_LOCATION$1 = "http://example.com";
  49246. var resolveUrl$3 = function resolveUrl2(baseUrl, relativeUrl) {
  49247. if (/^[a-z]+:/i.test(relativeUrl)) {
  49248. return relativeUrl;
  49249. }
  49250. if (/^data:/.test(baseUrl)) {
  49251. baseUrl = window_1.location && window_1.location.href || "";
  49252. }
  49253. var nativeURL = typeof window_1.URL === "function";
  49254. var protocolLess = /^\/\//.test(baseUrl);
  49255. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  49256. if (nativeURL) {
  49257. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$1);
  49258. } else if (!/\/\//i.test(baseUrl)) {
  49259. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  49260. }
  49261. if (nativeURL) {
  49262. var newUrl = new URL(relativeUrl, baseUrl);
  49263. if (removeLocation) {
  49264. return newUrl.href.slice(DEFAULT_LOCATION$1.length);
  49265. } else if (protocolLess) {
  49266. return newUrl.href.slice(newUrl.protocol.length);
  49267. }
  49268. return newUrl.href;
  49269. }
  49270. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  49271. };
  49272. var forEachMediaGroup$3 = function forEachMediaGroup(master, groups, callback2) {
  49273. groups.forEach(function(mediaType) {
  49274. for (var groupKey in master.mediaGroups[mediaType]) {
  49275. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  49276. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  49277. callback2(mediaProperties, mediaType, groupKey, labelKey);
  49278. }
  49279. }
  49280. });
  49281. };
  49282. var atob$1 = function atob2(s) {
  49283. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  49284. };
  49285. function decodeB64ToUint8Array$1(b64Text) {
  49286. var decodedString = atob$1(b64Text);
  49287. var array = new Uint8Array(decodedString.length);
  49288. for (var i2 = 0; i2 < decodedString.length; i2++) {
  49289. array[i2] = decodedString.charCodeAt(i2);
  49290. }
  49291. return array;
  49292. }
  49293. var dom$1 = {};
  49294. var conventions$2 = {};
  49295. function find$1(list, predicate, ac) {
  49296. if (ac === void 0) {
  49297. ac = Array.prototype;
  49298. }
  49299. if (list && typeof ac.find === "function") {
  49300. return ac.find.call(list, predicate);
  49301. }
  49302. for (var i2 = 0; i2 < list.length; i2++) {
  49303. if (Object.prototype.hasOwnProperty.call(list, i2)) {
  49304. var item = list[i2];
  49305. if (predicate.call(void 0, item, i2, list)) {
  49306. return item;
  49307. }
  49308. }
  49309. }
  49310. }
  49311. function freeze(object, oc) {
  49312. if (oc === void 0) {
  49313. oc = Object;
  49314. }
  49315. return oc && typeof oc.freeze === "function" ? oc.freeze(object) : object;
  49316. }
  49317. function assign$1(target, source) {
  49318. if (target === null || typeof target !== "object") {
  49319. throw new TypeError("target is not an object");
  49320. }
  49321. for (var key in source) {
  49322. if (Object.prototype.hasOwnProperty.call(source, key)) {
  49323. target[key] = source[key];
  49324. }
  49325. }
  49326. return target;
  49327. }
  49328. var MIME_TYPE = freeze({
  49329. HTML: "text/html",
  49330. isHTML: function(value) {
  49331. return value === MIME_TYPE.HTML;
  49332. },
  49333. XML_APPLICATION: "application/xml",
  49334. XML_TEXT: "text/xml",
  49335. XML_XHTML_APPLICATION: "application/xhtml+xml",
  49336. XML_SVG_IMAGE: "image/svg+xml"
  49337. });
  49338. var NAMESPACE$3 = freeze({
  49339. HTML: "http://www.w3.org/1999/xhtml",
  49340. isHTML: function(uri) {
  49341. return uri === NAMESPACE$3.HTML;
  49342. },
  49343. SVG: "http://www.w3.org/2000/svg",
  49344. XML: "http://www.w3.org/XML/1998/namespace",
  49345. XMLNS: "http://www.w3.org/2000/xmlns/"
  49346. });
  49347. conventions$2.assign = assign$1;
  49348. conventions$2.find = find$1;
  49349. conventions$2.freeze = freeze;
  49350. conventions$2.MIME_TYPE = MIME_TYPE;
  49351. conventions$2.NAMESPACE = NAMESPACE$3;
  49352. var conventions$1 = conventions$2;
  49353. var find = conventions$1.find;
  49354. var NAMESPACE$2 = conventions$1.NAMESPACE;
  49355. function notEmptyString(input) {
  49356. return input !== "";
  49357. }
  49358. function splitOnASCIIWhitespace(input) {
  49359. return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : [];
  49360. }
  49361. function orderedSetReducer(current, element) {
  49362. if (!current.hasOwnProperty(element)) {
  49363. current[element] = true;
  49364. }
  49365. return current;
  49366. }
  49367. function toOrderedSet(input) {
  49368. if (!input)
  49369. return [];
  49370. var list = splitOnASCIIWhitespace(input);
  49371. return Object.keys(list.reduce(orderedSetReducer, {}));
  49372. }
  49373. function arrayIncludes(list) {
  49374. return function(element) {
  49375. return list && list.indexOf(element) !== -1;
  49376. };
  49377. }
  49378. function copy(src, dest) {
  49379. for (var p in src) {
  49380. if (Object.prototype.hasOwnProperty.call(src, p)) {
  49381. dest[p] = src[p];
  49382. }
  49383. }
  49384. }
  49385. function _extends(Class, Super) {
  49386. var pt2 = Class.prototype;
  49387. if (!(pt2 instanceof Super)) {
  49388. let t2 = function() {
  49389. };
  49390. t2.prototype = Super.prototype;
  49391. t2 = new t2();
  49392. copy(pt2, t2);
  49393. Class.prototype = pt2 = t2;
  49394. }
  49395. if (pt2.constructor != Class) {
  49396. if (typeof Class != "function") {
  49397. console.error("unknown Class:" + Class);
  49398. }
  49399. pt2.constructor = Class;
  49400. }
  49401. }
  49402. var NodeType = {};
  49403. var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
  49404. var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
  49405. var TEXT_NODE = NodeType.TEXT_NODE = 3;
  49406. var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
  49407. var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
  49408. var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
  49409. var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
  49410. var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
  49411. var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
  49412. var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
  49413. var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
  49414. var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
  49415. var ExceptionCode = {};
  49416. var ExceptionMessage = {};
  49417. ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1);
  49418. ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2);
  49419. var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3);
  49420. ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4);
  49421. ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5);
  49422. ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6);
  49423. ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7);
  49424. var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8);
  49425. ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9);
  49426. var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10);
  49427. ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11);
  49428. ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12);
  49429. ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13);
  49430. ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14);
  49431. ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15);
  49432. function DOMException(code, message) {
  49433. if (message instanceof Error) {
  49434. var error = message;
  49435. } else {
  49436. error = this;
  49437. Error.call(this, ExceptionMessage[code]);
  49438. this.message = ExceptionMessage[code];
  49439. if (Error.captureStackTrace)
  49440. Error.captureStackTrace(this, DOMException);
  49441. }
  49442. error.code = code;
  49443. if (message)
  49444. this.message = this.message + ": " + message;
  49445. return error;
  49446. }
  49447. DOMException.prototype = Error.prototype;
  49448. copy(ExceptionCode, DOMException);
  49449. function NodeList() {
  49450. }
  49451. NodeList.prototype = {
  49452. length: 0,
  49453. item: function(index2) {
  49454. return this[index2] || null;
  49455. },
  49456. toString: function(isHTML, nodeFilter) {
  49457. for (var buf = [], i2 = 0; i2 < this.length; i2++) {
  49458. serializeToString(this[i2], buf, isHTML, nodeFilter);
  49459. }
  49460. return buf.join("");
  49461. },
  49462. filter: function(predicate) {
  49463. return Array.prototype.filter.call(this, predicate);
  49464. },
  49465. indexOf: function(item) {
  49466. return Array.prototype.indexOf.call(this, item);
  49467. }
  49468. };
  49469. function LiveNodeList(node, refresh) {
  49470. this._node = node;
  49471. this._refresh = refresh;
  49472. _updateLiveList(this);
  49473. }
  49474. function _updateLiveList(list) {
  49475. var inc = list._node._inc || list._node.ownerDocument._inc;
  49476. if (list._inc != inc) {
  49477. var ls = list._refresh(list._node);
  49478. __set__(list, "length", ls.length);
  49479. copy(ls, list);
  49480. list._inc = inc;
  49481. }
  49482. }
  49483. LiveNodeList.prototype.item = function(i2) {
  49484. _updateLiveList(this);
  49485. return this[i2];
  49486. };
  49487. _extends(LiveNodeList, NodeList);
  49488. function NamedNodeMap() {
  49489. }
  49490. function _findNodeIndex(list, node) {
  49491. var i2 = list.length;
  49492. while (i2--) {
  49493. if (list[i2] === node) {
  49494. return i2;
  49495. }
  49496. }
  49497. }
  49498. function _addNamedNode(el, list, newAttr, oldAttr) {
  49499. if (oldAttr) {
  49500. list[_findNodeIndex(list, oldAttr)] = newAttr;
  49501. } else {
  49502. list[list.length++] = newAttr;
  49503. }
  49504. if (el) {
  49505. newAttr.ownerElement = el;
  49506. var doc = el.ownerDocument;
  49507. if (doc) {
  49508. oldAttr && _onRemoveAttribute(doc, el, oldAttr);
  49509. _onAddAttribute(doc, el, newAttr);
  49510. }
  49511. }
  49512. }
  49513. function _removeNamedNode(el, list, attr) {
  49514. var i2 = _findNodeIndex(list, attr);
  49515. if (i2 >= 0) {
  49516. var lastIndex = list.length - 1;
  49517. while (i2 < lastIndex) {
  49518. list[i2] = list[++i2];
  49519. }
  49520. list.length = lastIndex;
  49521. if (el) {
  49522. var doc = el.ownerDocument;
  49523. if (doc) {
  49524. _onRemoveAttribute(doc, el, attr);
  49525. attr.ownerElement = null;
  49526. }
  49527. }
  49528. } else {
  49529. throw new DOMException(NOT_FOUND_ERR, new Error(el.tagName + "@" + attr));
  49530. }
  49531. }
  49532. NamedNodeMap.prototype = {
  49533. length: 0,
  49534. item: NodeList.prototype.item,
  49535. getNamedItem: function(key) {
  49536. var i2 = this.length;
  49537. while (i2--) {
  49538. var attr = this[i2];
  49539. if (attr.nodeName == key) {
  49540. return attr;
  49541. }
  49542. }
  49543. },
  49544. setNamedItem: function(attr) {
  49545. var el = attr.ownerElement;
  49546. if (el && el != this._ownerElement) {
  49547. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49548. }
  49549. var oldAttr = this.getNamedItem(attr.nodeName);
  49550. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49551. return oldAttr;
  49552. },
  49553. setNamedItemNS: function(attr) {
  49554. var el = attr.ownerElement, oldAttr;
  49555. if (el && el != this._ownerElement) {
  49556. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49557. }
  49558. oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);
  49559. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49560. return oldAttr;
  49561. },
  49562. removeNamedItem: function(key) {
  49563. var attr = this.getNamedItem(key);
  49564. _removeNamedNode(this._ownerElement, this, attr);
  49565. return attr;
  49566. },
  49567. removeNamedItemNS: function(namespaceURI, localName) {
  49568. var attr = this.getNamedItemNS(namespaceURI, localName);
  49569. _removeNamedNode(this._ownerElement, this, attr);
  49570. return attr;
  49571. },
  49572. getNamedItemNS: function(namespaceURI, localName) {
  49573. var i2 = this.length;
  49574. while (i2--) {
  49575. var node = this[i2];
  49576. if (node.localName == localName && node.namespaceURI == namespaceURI) {
  49577. return node;
  49578. }
  49579. }
  49580. return null;
  49581. }
  49582. };
  49583. function DOMImplementation$1() {
  49584. }
  49585. DOMImplementation$1.prototype = {
  49586. hasFeature: function(feature2, version2) {
  49587. return true;
  49588. },
  49589. createDocument: function(namespaceURI, qualifiedName, doctype) {
  49590. var doc = new Document();
  49591. doc.implementation = this;
  49592. doc.childNodes = new NodeList();
  49593. doc.doctype = doctype || null;
  49594. if (doctype) {
  49595. doc.appendChild(doctype);
  49596. }
  49597. if (qualifiedName) {
  49598. var root2 = doc.createElementNS(namespaceURI, qualifiedName);
  49599. doc.appendChild(root2);
  49600. }
  49601. return doc;
  49602. },
  49603. createDocumentType: function(qualifiedName, publicId, systemId) {
  49604. var node = new DocumentType();
  49605. node.name = qualifiedName;
  49606. node.nodeName = qualifiedName;
  49607. node.publicId = publicId || "";
  49608. node.systemId = systemId || "";
  49609. return node;
  49610. }
  49611. };
  49612. function Node() {
  49613. }
  49614. Node.prototype = {
  49615. firstChild: null,
  49616. lastChild: null,
  49617. previousSibling: null,
  49618. nextSibling: null,
  49619. attributes: null,
  49620. parentNode: null,
  49621. childNodes: null,
  49622. ownerDocument: null,
  49623. nodeValue: null,
  49624. namespaceURI: null,
  49625. prefix: null,
  49626. localName: null,
  49627. insertBefore: function(newChild, refChild) {
  49628. return _insertBefore(this, newChild, refChild);
  49629. },
  49630. replaceChild: function(newChild, oldChild) {
  49631. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  49632. if (oldChild) {
  49633. this.removeChild(oldChild);
  49634. }
  49635. },
  49636. removeChild: function(oldChild) {
  49637. return _removeChild(this, oldChild);
  49638. },
  49639. appendChild: function(newChild) {
  49640. return this.insertBefore(newChild, null);
  49641. },
  49642. hasChildNodes: function() {
  49643. return this.firstChild != null;
  49644. },
  49645. cloneNode: function(deep) {
  49646. return cloneNode(this.ownerDocument || this, this, deep);
  49647. },
  49648. normalize: function() {
  49649. var child = this.firstChild;
  49650. while (child) {
  49651. var next = child.nextSibling;
  49652. if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {
  49653. this.removeChild(next);
  49654. child.appendData(next.data);
  49655. } else {
  49656. child.normalize();
  49657. child = next;
  49658. }
  49659. }
  49660. },
  49661. isSupported: function(feature2, version2) {
  49662. return this.ownerDocument.implementation.hasFeature(feature2, version2);
  49663. },
  49664. hasAttributes: function() {
  49665. return this.attributes.length > 0;
  49666. },
  49667. lookupPrefix: function(namespaceURI) {
  49668. var el = this;
  49669. while (el) {
  49670. var map = el._nsMap;
  49671. if (map) {
  49672. for (var n in map) {
  49673. if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
  49674. return n;
  49675. }
  49676. }
  49677. }
  49678. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49679. }
  49680. return null;
  49681. },
  49682. lookupNamespaceURI: function(prefix) {
  49683. var el = this;
  49684. while (el) {
  49685. var map = el._nsMap;
  49686. if (map) {
  49687. if (Object.prototype.hasOwnProperty.call(map, prefix)) {
  49688. return map[prefix];
  49689. }
  49690. }
  49691. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49692. }
  49693. return null;
  49694. },
  49695. isDefaultNamespace: function(namespaceURI) {
  49696. var prefix = this.lookupPrefix(namespaceURI);
  49697. return prefix == null;
  49698. }
  49699. };
  49700. function _xmlEncoder(c) {
  49701. return c == "<" && "&lt;" || c == ">" && "&gt;" || c == "&" && "&amp;" || c == '"' && "&quot;" || "&#" + c.charCodeAt() + ";";
  49702. }
  49703. copy(NodeType, Node);
  49704. copy(NodeType, Node.prototype);
  49705. function _visitNode(node, callback2) {
  49706. if (callback2(node)) {
  49707. return true;
  49708. }
  49709. if (node = node.firstChild) {
  49710. do {
  49711. if (_visitNode(node, callback2)) {
  49712. return true;
  49713. }
  49714. } while (node = node.nextSibling);
  49715. }
  49716. }
  49717. function Document() {
  49718. this.ownerDocument = this;
  49719. }
  49720. function _onAddAttribute(doc, el, newAttr) {
  49721. doc && doc._inc++;
  49722. var ns = newAttr.namespaceURI;
  49723. if (ns === NAMESPACE$2.XMLNS) {
  49724. el._nsMap[newAttr.prefix ? newAttr.localName : ""] = newAttr.value;
  49725. }
  49726. }
  49727. function _onRemoveAttribute(doc, el, newAttr, remove2) {
  49728. doc && doc._inc++;
  49729. var ns = newAttr.namespaceURI;
  49730. if (ns === NAMESPACE$2.XMLNS) {
  49731. delete el._nsMap[newAttr.prefix ? newAttr.localName : ""];
  49732. }
  49733. }
  49734. function _onUpdateChild(doc, el, newChild) {
  49735. if (doc && doc._inc) {
  49736. doc._inc++;
  49737. var cs = el.childNodes;
  49738. if (newChild) {
  49739. cs[cs.length++] = newChild;
  49740. } else {
  49741. var child = el.firstChild;
  49742. var i2 = 0;
  49743. while (child) {
  49744. cs[i2++] = child;
  49745. child = child.nextSibling;
  49746. }
  49747. cs.length = i2;
  49748. delete cs[cs.length];
  49749. }
  49750. }
  49751. }
  49752. function _removeChild(parentNode, child) {
  49753. var previous = child.previousSibling;
  49754. var next = child.nextSibling;
  49755. if (previous) {
  49756. previous.nextSibling = next;
  49757. } else {
  49758. parentNode.firstChild = next;
  49759. }
  49760. if (next) {
  49761. next.previousSibling = previous;
  49762. } else {
  49763. parentNode.lastChild = previous;
  49764. }
  49765. child.parentNode = null;
  49766. child.previousSibling = null;
  49767. child.nextSibling = null;
  49768. _onUpdateChild(parentNode.ownerDocument, parentNode);
  49769. return child;
  49770. }
  49771. function hasValidParentNodeType(node) {
  49772. return node && (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE);
  49773. }
  49774. function hasInsertableNodeType(node) {
  49775. return node && (isElementNode(node) || isTextNode$2(node) || isDocTypeNode(node) || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE);
  49776. }
  49777. function isDocTypeNode(node) {
  49778. return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
  49779. }
  49780. function isElementNode(node) {
  49781. return node && node.nodeType === Node.ELEMENT_NODE;
  49782. }
  49783. function isTextNode$2(node) {
  49784. return node && node.nodeType === Node.TEXT_NODE;
  49785. }
  49786. function isElementInsertionPossible(doc, child) {
  49787. var parentChildNodes = doc.childNodes || [];
  49788. if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
  49789. return false;
  49790. }
  49791. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49792. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49793. }
  49794. function isElementReplacementPossible(doc, child) {
  49795. var parentChildNodes = doc.childNodes || [];
  49796. function hasElementChildThatIsNotChild(node) {
  49797. return isElementNode(node) && node !== child;
  49798. }
  49799. if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
  49800. return false;
  49801. }
  49802. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49803. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49804. }
  49805. function assertPreInsertionValidity1to5(parent, node, child) {
  49806. if (!hasValidParentNodeType(parent)) {
  49807. throw new DOMException(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent.nodeType);
  49808. }
  49809. if (child && child.parentNode !== parent) {
  49810. throw new DOMException(NOT_FOUND_ERR, "child not in parent");
  49811. }
  49812. if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE) {
  49813. throw new DOMException(
  49814. HIERARCHY_REQUEST_ERR,
  49815. "Unexpected node type " + node.nodeType + " for parent node type " + parent.nodeType
  49816. );
  49817. }
  49818. }
  49819. function assertPreInsertionValidityInDocument(parent, node, child) {
  49820. var parentChildNodes = parent.childNodes || [];
  49821. var nodeChildNodes = node.childNodes || [];
  49822. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49823. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49824. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49825. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49826. }
  49827. if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
  49828. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49829. }
  49830. }
  49831. if (isElementNode(node)) {
  49832. if (!isElementInsertionPossible(parent, child)) {
  49833. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49834. }
  49835. }
  49836. if (isDocTypeNode(node)) {
  49837. if (find(parentChildNodes, isDocTypeNode)) {
  49838. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49839. }
  49840. var parentElementChild = find(parentChildNodes, isElementNode);
  49841. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49842. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49843. }
  49844. if (!child && parentElementChild) {
  49845. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
  49846. }
  49847. }
  49848. }
  49849. function assertPreReplacementValidityInDocument(parent, node, child) {
  49850. var parentChildNodes = parent.childNodes || [];
  49851. var nodeChildNodes = node.childNodes || [];
  49852. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49853. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49854. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49855. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49856. }
  49857. if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
  49858. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49859. }
  49860. }
  49861. if (isElementNode(node)) {
  49862. if (!isElementReplacementPossible(parent, child)) {
  49863. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49864. }
  49865. }
  49866. if (isDocTypeNode(node)) {
  49867. let hasDoctypeChildThatIsNotChild = function(node2) {
  49868. return isDocTypeNode(node2) && node2 !== child;
  49869. };
  49870. if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
  49871. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49872. }
  49873. var parentElementChild = find(parentChildNodes, isElementNode);
  49874. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49875. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49876. }
  49877. }
  49878. }
  49879. function _insertBefore(parent, node, child, _inDocumentAssertion) {
  49880. assertPreInsertionValidity1to5(parent, node, child);
  49881. if (parent.nodeType === Node.DOCUMENT_NODE) {
  49882. (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
  49883. }
  49884. var cp = node.parentNode;
  49885. if (cp) {
  49886. cp.removeChild(node);
  49887. }
  49888. if (node.nodeType === DOCUMENT_FRAGMENT_NODE) {
  49889. var newFirst = node.firstChild;
  49890. if (newFirst == null) {
  49891. return node;
  49892. }
  49893. var newLast = node.lastChild;
  49894. } else {
  49895. newFirst = newLast = node;
  49896. }
  49897. var pre = child ? child.previousSibling : parent.lastChild;
  49898. newFirst.previousSibling = pre;
  49899. newLast.nextSibling = child;
  49900. if (pre) {
  49901. pre.nextSibling = newFirst;
  49902. } else {
  49903. parent.firstChild = newFirst;
  49904. }
  49905. if (child == null) {
  49906. parent.lastChild = newLast;
  49907. } else {
  49908. child.previousSibling = newLast;
  49909. }
  49910. do {
  49911. newFirst.parentNode = parent;
  49912. } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));
  49913. _onUpdateChild(parent.ownerDocument || parent, parent);
  49914. if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49915. node.firstChild = node.lastChild = null;
  49916. }
  49917. return node;
  49918. }
  49919. function _appendSingleChild(parentNode, newChild) {
  49920. if (newChild.parentNode) {
  49921. newChild.parentNode.removeChild(newChild);
  49922. }
  49923. newChild.parentNode = parentNode;
  49924. newChild.previousSibling = parentNode.lastChild;
  49925. newChild.nextSibling = null;
  49926. if (newChild.previousSibling) {
  49927. newChild.previousSibling.nextSibling = newChild;
  49928. } else {
  49929. parentNode.firstChild = newChild;
  49930. }
  49931. parentNode.lastChild = newChild;
  49932. _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
  49933. return newChild;
  49934. }
  49935. Document.prototype = {
  49936. nodeName: "#document",
  49937. nodeType: DOCUMENT_NODE,
  49938. doctype: null,
  49939. documentElement: null,
  49940. _inc: 1,
  49941. insertBefore: function(newChild, refChild) {
  49942. if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49943. var child = newChild.firstChild;
  49944. while (child) {
  49945. var next = child.nextSibling;
  49946. this.insertBefore(child, refChild);
  49947. child = next;
  49948. }
  49949. return newChild;
  49950. }
  49951. _insertBefore(this, newChild, refChild);
  49952. newChild.ownerDocument = this;
  49953. if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
  49954. this.documentElement = newChild;
  49955. }
  49956. return newChild;
  49957. },
  49958. removeChild: function(oldChild) {
  49959. if (this.documentElement == oldChild) {
  49960. this.documentElement = null;
  49961. }
  49962. return _removeChild(this, oldChild);
  49963. },
  49964. replaceChild: function(newChild, oldChild) {
  49965. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  49966. newChild.ownerDocument = this;
  49967. if (oldChild) {
  49968. this.removeChild(oldChild);
  49969. }
  49970. if (isElementNode(newChild)) {
  49971. this.documentElement = newChild;
  49972. }
  49973. },
  49974. importNode: function(importedNode, deep) {
  49975. return importNode(this, importedNode, deep);
  49976. },
  49977. getElementById: function(id) {
  49978. var rtv = null;
  49979. _visitNode(this.documentElement, function(node) {
  49980. if (node.nodeType == ELEMENT_NODE) {
  49981. if (node.getAttribute("id") == id) {
  49982. rtv = node;
  49983. return true;
  49984. }
  49985. }
  49986. });
  49987. return rtv;
  49988. },
  49989. getElementsByClassName: function(classNames) {
  49990. var classNamesSet = toOrderedSet(classNames);
  49991. return new LiveNodeList(this, function(base2) {
  49992. var ls = [];
  49993. if (classNamesSet.length > 0) {
  49994. _visitNode(base2.documentElement, function(node) {
  49995. if (node !== base2 && node.nodeType === ELEMENT_NODE) {
  49996. var nodeClassNames = node.getAttribute("class");
  49997. if (nodeClassNames) {
  49998. var matches = classNames === nodeClassNames;
  49999. if (!matches) {
  50000. var nodeClassNamesSet = toOrderedSet(nodeClassNames);
  50001. matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));
  50002. }
  50003. if (matches) {
  50004. ls.push(node);
  50005. }
  50006. }
  50007. }
  50008. });
  50009. }
  50010. return ls;
  50011. });
  50012. },
  50013. createElement: function(tagName) {
  50014. var node = new Element$1();
  50015. node.ownerDocument = this;
  50016. node.nodeName = tagName;
  50017. node.tagName = tagName;
  50018. node.localName = tagName;
  50019. node.childNodes = new NodeList();
  50020. var attrs = node.attributes = new NamedNodeMap();
  50021. attrs._ownerElement = node;
  50022. return node;
  50023. },
  50024. createDocumentFragment: function() {
  50025. var node = new DocumentFragment();
  50026. node.ownerDocument = this;
  50027. node.childNodes = new NodeList();
  50028. return node;
  50029. },
  50030. createTextNode: function(data) {
  50031. var node = new Text();
  50032. node.ownerDocument = this;
  50033. node.appendData(data);
  50034. return node;
  50035. },
  50036. createComment: function(data) {
  50037. var node = new Comment();
  50038. node.ownerDocument = this;
  50039. node.appendData(data);
  50040. return node;
  50041. },
  50042. createCDATASection: function(data) {
  50043. var node = new CDATASection();
  50044. node.ownerDocument = this;
  50045. node.appendData(data);
  50046. return node;
  50047. },
  50048. createProcessingInstruction: function(target, data) {
  50049. var node = new ProcessingInstruction();
  50050. node.ownerDocument = this;
  50051. node.tagName = node.target = target;
  50052. node.nodeValue = node.data = data;
  50053. return node;
  50054. },
  50055. createAttribute: function(name) {
  50056. var node = new Attr();
  50057. node.ownerDocument = this;
  50058. node.name = name;
  50059. node.nodeName = name;
  50060. node.localName = name;
  50061. node.specified = true;
  50062. return node;
  50063. },
  50064. createEntityReference: function(name) {
  50065. var node = new EntityReference();
  50066. node.ownerDocument = this;
  50067. node.nodeName = name;
  50068. return node;
  50069. },
  50070. createElementNS: function(namespaceURI, qualifiedName) {
  50071. var node = new Element$1();
  50072. var pl = qualifiedName.split(":");
  50073. var attrs = node.attributes = new NamedNodeMap();
  50074. node.childNodes = new NodeList();
  50075. node.ownerDocument = this;
  50076. node.nodeName = qualifiedName;
  50077. node.tagName = qualifiedName;
  50078. node.namespaceURI = namespaceURI;
  50079. if (pl.length == 2) {
  50080. node.prefix = pl[0];
  50081. node.localName = pl[1];
  50082. } else {
  50083. node.localName = qualifiedName;
  50084. }
  50085. attrs._ownerElement = node;
  50086. return node;
  50087. },
  50088. createAttributeNS: function(namespaceURI, qualifiedName) {
  50089. var node = new Attr();
  50090. var pl = qualifiedName.split(":");
  50091. node.ownerDocument = this;
  50092. node.nodeName = qualifiedName;
  50093. node.name = qualifiedName;
  50094. node.namespaceURI = namespaceURI;
  50095. node.specified = true;
  50096. if (pl.length == 2) {
  50097. node.prefix = pl[0];
  50098. node.localName = pl[1];
  50099. } else {
  50100. node.localName = qualifiedName;
  50101. }
  50102. return node;
  50103. }
  50104. };
  50105. _extends(Document, Node);
  50106. function Element$1() {
  50107. this._nsMap = {};
  50108. }
  50109. Element$1.prototype = {
  50110. nodeType: ELEMENT_NODE,
  50111. hasAttribute: function(name) {
  50112. return this.getAttributeNode(name) != null;
  50113. },
  50114. getAttribute: function(name) {
  50115. var attr = this.getAttributeNode(name);
  50116. return attr && attr.value || "";
  50117. },
  50118. getAttributeNode: function(name) {
  50119. return this.attributes.getNamedItem(name);
  50120. },
  50121. setAttribute: function(name, value) {
  50122. var attr = this.ownerDocument.createAttribute(name);
  50123. attr.value = attr.nodeValue = "" + value;
  50124. this.setAttributeNode(attr);
  50125. },
  50126. removeAttribute: function(name) {
  50127. var attr = this.getAttributeNode(name);
  50128. attr && this.removeAttributeNode(attr);
  50129. },
  50130. appendChild: function(newChild) {
  50131. if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
  50132. return this.insertBefore(newChild, null);
  50133. } else {
  50134. return _appendSingleChild(this, newChild);
  50135. }
  50136. },
  50137. setAttributeNode: function(newAttr) {
  50138. return this.attributes.setNamedItem(newAttr);
  50139. },
  50140. setAttributeNodeNS: function(newAttr) {
  50141. return this.attributes.setNamedItemNS(newAttr);
  50142. },
  50143. removeAttributeNode: function(oldAttr) {
  50144. return this.attributes.removeNamedItem(oldAttr.nodeName);
  50145. },
  50146. removeAttributeNS: function(namespaceURI, localName) {
  50147. var old = this.getAttributeNodeNS(namespaceURI, localName);
  50148. old && this.removeAttributeNode(old);
  50149. },
  50150. hasAttributeNS: function(namespaceURI, localName) {
  50151. return this.getAttributeNodeNS(namespaceURI, localName) != null;
  50152. },
  50153. getAttributeNS: function(namespaceURI, localName) {
  50154. var attr = this.getAttributeNodeNS(namespaceURI, localName);
  50155. return attr && attr.value || "";
  50156. },
  50157. setAttributeNS: function(namespaceURI, qualifiedName, value) {
  50158. var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
  50159. attr.value = attr.nodeValue = "" + value;
  50160. this.setAttributeNode(attr);
  50161. },
  50162. getAttributeNodeNS: function(namespaceURI, localName) {
  50163. return this.attributes.getNamedItemNS(namespaceURI, localName);
  50164. },
  50165. getElementsByTagName: function(tagName) {
  50166. return new LiveNodeList(this, function(base2) {
  50167. var ls = [];
  50168. _visitNode(base2, function(node) {
  50169. if (node !== base2 && node.nodeType == ELEMENT_NODE && (tagName === "*" || node.tagName == tagName)) {
  50170. ls.push(node);
  50171. }
  50172. });
  50173. return ls;
  50174. });
  50175. },
  50176. getElementsByTagNameNS: function(namespaceURI, localName) {
  50177. return new LiveNodeList(this, function(base2) {
  50178. var ls = [];
  50179. _visitNode(base2, function(node) {
  50180. if (node !== base2 && node.nodeType === ELEMENT_NODE && (namespaceURI === "*" || node.namespaceURI === namespaceURI) && (localName === "*" || node.localName == localName)) {
  50181. ls.push(node);
  50182. }
  50183. });
  50184. return ls;
  50185. });
  50186. }
  50187. };
  50188. Document.prototype.getElementsByTagName = Element$1.prototype.getElementsByTagName;
  50189. Document.prototype.getElementsByTagNameNS = Element$1.prototype.getElementsByTagNameNS;
  50190. _extends(Element$1, Node);
  50191. function Attr() {
  50192. }
  50193. Attr.prototype.nodeType = ATTRIBUTE_NODE;
  50194. _extends(Attr, Node);
  50195. function CharacterData() {
  50196. }
  50197. CharacterData.prototype = {
  50198. data: "",
  50199. substringData: function(offset, count) {
  50200. return this.data.substring(offset, offset + count);
  50201. },
  50202. appendData: function(text) {
  50203. text = this.data + text;
  50204. this.nodeValue = this.data = text;
  50205. this.length = text.length;
  50206. },
  50207. insertData: function(offset, text) {
  50208. this.replaceData(offset, 0, text);
  50209. },
  50210. appendChild: function(newChild) {
  50211. throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);
  50212. },
  50213. deleteData: function(offset, count) {
  50214. this.replaceData(offset, count, "");
  50215. },
  50216. replaceData: function(offset, count, text) {
  50217. var start2 = this.data.substring(0, offset);
  50218. var end = this.data.substring(offset + count);
  50219. text = start2 + text + end;
  50220. this.nodeValue = this.data = text;
  50221. this.length = text.length;
  50222. }
  50223. };
  50224. _extends(CharacterData, Node);
  50225. function Text() {
  50226. }
  50227. Text.prototype = {
  50228. nodeName: "#text",
  50229. nodeType: TEXT_NODE,
  50230. splitText: function(offset) {
  50231. var text = this.data;
  50232. var newText = text.substring(offset);
  50233. text = text.substring(0, offset);
  50234. this.data = this.nodeValue = text;
  50235. this.length = text.length;
  50236. var newNode = this.ownerDocument.createTextNode(newText);
  50237. if (this.parentNode) {
  50238. this.parentNode.insertBefore(newNode, this.nextSibling);
  50239. }
  50240. return newNode;
  50241. }
  50242. };
  50243. _extends(Text, CharacterData);
  50244. function Comment() {
  50245. }
  50246. Comment.prototype = {
  50247. nodeName: "#comment",
  50248. nodeType: COMMENT_NODE
  50249. };
  50250. _extends(Comment, CharacterData);
  50251. function CDATASection() {
  50252. }
  50253. CDATASection.prototype = {
  50254. nodeName: "#cdata-section",
  50255. nodeType: CDATA_SECTION_NODE
  50256. };
  50257. _extends(CDATASection, CharacterData);
  50258. function DocumentType() {
  50259. }
  50260. DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
  50261. _extends(DocumentType, Node);
  50262. function Notation() {
  50263. }
  50264. Notation.prototype.nodeType = NOTATION_NODE;
  50265. _extends(Notation, Node);
  50266. function Entity() {
  50267. }
  50268. Entity.prototype.nodeType = ENTITY_NODE;
  50269. _extends(Entity, Node);
  50270. function EntityReference() {
  50271. }
  50272. EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
  50273. _extends(EntityReference, Node);
  50274. function DocumentFragment() {
  50275. }
  50276. DocumentFragment.prototype.nodeName = "#document-fragment";
  50277. DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
  50278. _extends(DocumentFragment, Node);
  50279. function ProcessingInstruction() {
  50280. }
  50281. ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
  50282. _extends(ProcessingInstruction, Node);
  50283. function XMLSerializer() {
  50284. }
  50285. XMLSerializer.prototype.serializeToString = function(node, isHtml, nodeFilter) {
  50286. return nodeSerializeToString.call(node, isHtml, nodeFilter);
  50287. };
  50288. Node.prototype.toString = nodeSerializeToString;
  50289. function nodeSerializeToString(isHtml, nodeFilter) {
  50290. var buf = [];
  50291. var refNode = this.nodeType == 9 && this.documentElement || this;
  50292. var prefix = refNode.prefix;
  50293. var uri = refNode.namespaceURI;
  50294. if (uri && prefix == null) {
  50295. var prefix = refNode.lookupPrefix(uri);
  50296. if (prefix == null) {
  50297. var visibleNamespaces = [
  50298. { namespace: uri, prefix: null }
  50299. ];
  50300. }
  50301. }
  50302. serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces);
  50303. return buf.join("");
  50304. }
  50305. function needNamespaceDefine(node, isHTML, visibleNamespaces) {
  50306. var prefix = node.prefix || "";
  50307. var uri = node.namespaceURI;
  50308. if (!uri) {
  50309. return false;
  50310. }
  50311. if (prefix === "xml" && uri === NAMESPACE$2.XML || uri === NAMESPACE$2.XMLNS) {
  50312. return false;
  50313. }
  50314. var i2 = visibleNamespaces.length;
  50315. while (i2--) {
  50316. var ns = visibleNamespaces[i2];
  50317. if (ns.prefix === prefix) {
  50318. return ns.namespace !== uri;
  50319. }
  50320. }
  50321. return true;
  50322. }
  50323. function addSerializedAttribute(buf, qualifiedName, value) {
  50324. buf.push(" ", qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
  50325. }
  50326. function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) {
  50327. if (!visibleNamespaces) {
  50328. visibleNamespaces = [];
  50329. }
  50330. if (nodeFilter) {
  50331. node = nodeFilter(node);
  50332. if (node) {
  50333. if (typeof node == "string") {
  50334. buf.push(node);
  50335. return;
  50336. }
  50337. } else {
  50338. return;
  50339. }
  50340. }
  50341. switch (node.nodeType) {
  50342. case ELEMENT_NODE:
  50343. var attrs = node.attributes;
  50344. var len = attrs.length;
  50345. var child = node.firstChild;
  50346. var nodeName = node.tagName;
  50347. isHTML = NAMESPACE$2.isHTML(node.namespaceURI) || isHTML;
  50348. var prefixedNodeName = nodeName;
  50349. if (!isHTML && !node.prefix && node.namespaceURI) {
  50350. var defaultNS;
  50351. for (var ai = 0; ai < attrs.length; ai++) {
  50352. if (attrs.item(ai).name === "xmlns") {
  50353. defaultNS = attrs.item(ai).value;
  50354. break;
  50355. }
  50356. }
  50357. if (!defaultNS) {
  50358. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50359. var namespace = visibleNamespaces[nsi];
  50360. if (namespace.prefix === "" && namespace.namespace === node.namespaceURI) {
  50361. defaultNS = namespace.namespace;
  50362. break;
  50363. }
  50364. }
  50365. }
  50366. if (defaultNS !== node.namespaceURI) {
  50367. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50368. var namespace = visibleNamespaces[nsi];
  50369. if (namespace.namespace === node.namespaceURI) {
  50370. if (namespace.prefix) {
  50371. prefixedNodeName = namespace.prefix + ":" + nodeName;
  50372. }
  50373. break;
  50374. }
  50375. }
  50376. }
  50377. }
  50378. buf.push("<", prefixedNodeName);
  50379. for (var i2 = 0; i2 < len; i2++) {
  50380. var attr = attrs.item(i2);
  50381. if (attr.prefix == "xmlns") {
  50382. visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
  50383. } else if (attr.nodeName == "xmlns") {
  50384. visibleNamespaces.push({ prefix: "", namespace: attr.value });
  50385. }
  50386. }
  50387. for (var i2 = 0; i2 < len; i2++) {
  50388. var attr = attrs.item(i2);
  50389. if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) {
  50390. var prefix = attr.prefix || "";
  50391. var uri = attr.namespaceURI;
  50392. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50393. visibleNamespaces.push({ prefix, namespace: uri });
  50394. }
  50395. serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces);
  50396. }
  50397. if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
  50398. var prefix = node.prefix || "";
  50399. var uri = node.namespaceURI;
  50400. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50401. visibleNamespaces.push({ prefix, namespace: uri });
  50402. }
  50403. if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
  50404. buf.push(">");
  50405. if (isHTML && /^script$/i.test(nodeName)) {
  50406. while (child) {
  50407. if (child.data) {
  50408. buf.push(child.data);
  50409. } else {
  50410. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50411. }
  50412. child = child.nextSibling;
  50413. }
  50414. } else {
  50415. while (child) {
  50416. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50417. child = child.nextSibling;
  50418. }
  50419. }
  50420. buf.push("</", prefixedNodeName, ">");
  50421. } else {
  50422. buf.push("/>");
  50423. }
  50424. return;
  50425. case DOCUMENT_NODE:
  50426. case DOCUMENT_FRAGMENT_NODE:
  50427. var child = node.firstChild;
  50428. while (child) {
  50429. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50430. child = child.nextSibling;
  50431. }
  50432. return;
  50433. case ATTRIBUTE_NODE:
  50434. return addSerializedAttribute(buf, node.name, node.value);
  50435. case TEXT_NODE:
  50436. return buf.push(
  50437. node.data.replace(/[<&>]/g, _xmlEncoder)
  50438. );
  50439. case CDATA_SECTION_NODE:
  50440. return buf.push("<![CDATA[", node.data, "]]>");
  50441. case COMMENT_NODE:
  50442. return buf.push("<!--", node.data, "-->");
  50443. case DOCUMENT_TYPE_NODE:
  50444. var pubid = node.publicId;
  50445. var sysid = node.systemId;
  50446. buf.push("<!DOCTYPE ", node.name);
  50447. if (pubid) {
  50448. buf.push(" PUBLIC ", pubid);
  50449. if (sysid && sysid != ".") {
  50450. buf.push(" ", sysid);
  50451. }
  50452. buf.push(">");
  50453. } else if (sysid && sysid != ".") {
  50454. buf.push(" SYSTEM ", sysid, ">");
  50455. } else {
  50456. var sub = node.internalSubset;
  50457. if (sub) {
  50458. buf.push(" [", sub, "]");
  50459. }
  50460. buf.push(">");
  50461. }
  50462. return;
  50463. case PROCESSING_INSTRUCTION_NODE:
  50464. return buf.push("<?", node.target, " ", node.data, "?>");
  50465. case ENTITY_REFERENCE_NODE:
  50466. return buf.push("&", node.nodeName, ";");
  50467. default:
  50468. buf.push("??", node.nodeName);
  50469. }
  50470. }
  50471. function importNode(doc, node, deep) {
  50472. var node2;
  50473. switch (node.nodeType) {
  50474. case ELEMENT_NODE:
  50475. node2 = node.cloneNode(false);
  50476. node2.ownerDocument = doc;
  50477. case DOCUMENT_FRAGMENT_NODE:
  50478. break;
  50479. case ATTRIBUTE_NODE:
  50480. deep = true;
  50481. break;
  50482. }
  50483. if (!node2) {
  50484. node2 = node.cloneNode(false);
  50485. }
  50486. node2.ownerDocument = doc;
  50487. node2.parentNode = null;
  50488. if (deep) {
  50489. var child = node.firstChild;
  50490. while (child) {
  50491. node2.appendChild(importNode(doc, child, deep));
  50492. child = child.nextSibling;
  50493. }
  50494. }
  50495. return node2;
  50496. }
  50497. function cloneNode(doc, node, deep) {
  50498. var node2 = new node.constructor();
  50499. for (var n in node) {
  50500. if (Object.prototype.hasOwnProperty.call(node, n)) {
  50501. var v = node[n];
  50502. if (typeof v != "object") {
  50503. if (v != node2[n]) {
  50504. node2[n] = v;
  50505. }
  50506. }
  50507. }
  50508. }
  50509. if (node.childNodes) {
  50510. node2.childNodes = new NodeList();
  50511. }
  50512. node2.ownerDocument = doc;
  50513. switch (node2.nodeType) {
  50514. case ELEMENT_NODE:
  50515. var attrs = node.attributes;
  50516. var attrs2 = node2.attributes = new NamedNodeMap();
  50517. var len = attrs.length;
  50518. attrs2._ownerElement = node2;
  50519. for (var i2 = 0; i2 < len; i2++) {
  50520. node2.setAttributeNode(cloneNode(doc, attrs.item(i2), true));
  50521. }
  50522. break;
  50523. case ATTRIBUTE_NODE:
  50524. deep = true;
  50525. }
  50526. if (deep) {
  50527. var child = node.firstChild;
  50528. while (child) {
  50529. node2.appendChild(cloneNode(doc, child, deep));
  50530. child = child.nextSibling;
  50531. }
  50532. }
  50533. return node2;
  50534. }
  50535. function __set__(object, key, value) {
  50536. object[key] = value;
  50537. }
  50538. try {
  50539. if (Object.defineProperty) {
  50540. let getTextContent = function(node) {
  50541. switch (node.nodeType) {
  50542. case ELEMENT_NODE:
  50543. case DOCUMENT_FRAGMENT_NODE:
  50544. var buf = [];
  50545. node = node.firstChild;
  50546. while (node) {
  50547. if (node.nodeType !== 7 && node.nodeType !== 8) {
  50548. buf.push(getTextContent(node));
  50549. }
  50550. node = node.nextSibling;
  50551. }
  50552. return buf.join("");
  50553. default:
  50554. return node.nodeValue;
  50555. }
  50556. };
  50557. Object.defineProperty(LiveNodeList.prototype, "length", {
  50558. get: function() {
  50559. _updateLiveList(this);
  50560. return this.$$length;
  50561. }
  50562. });
  50563. Object.defineProperty(Node.prototype, "textContent", {
  50564. get: function() {
  50565. return getTextContent(this);
  50566. },
  50567. set: function(data) {
  50568. switch (this.nodeType) {
  50569. case ELEMENT_NODE:
  50570. case DOCUMENT_FRAGMENT_NODE:
  50571. while (this.firstChild) {
  50572. this.removeChild(this.firstChild);
  50573. }
  50574. if (data || String(data)) {
  50575. this.appendChild(this.ownerDocument.createTextNode(data));
  50576. }
  50577. break;
  50578. default:
  50579. this.data = data;
  50580. this.value = data;
  50581. this.nodeValue = data;
  50582. }
  50583. }
  50584. });
  50585. __set__ = function(object, key, value) {
  50586. object["$$" + key] = value;
  50587. };
  50588. }
  50589. } catch (e) {
  50590. }
  50591. dom$1.DocumentType = DocumentType;
  50592. dom$1.DOMException = DOMException;
  50593. dom$1.DOMImplementation = DOMImplementation$1;
  50594. dom$1.Element = Element$1;
  50595. dom$1.Node = Node;
  50596. dom$1.NodeList = NodeList;
  50597. dom$1.XMLSerializer = XMLSerializer;
  50598. var domParser = {};
  50599. var entities$1 = {};
  50600. (function(exports2) {
  50601. var freeze2 = conventions$2.freeze;
  50602. exports2.XML_ENTITIES = freeze2({ amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' });
  50603. exports2.HTML_ENTITIES = freeze2({
  50604. lt: "<",
  50605. gt: ">",
  50606. amp: "&",
  50607. quot: '"',
  50608. apos: "'",
  50609. Agrave: "\xC0",
  50610. Aacute: "\xC1",
  50611. Acirc: "\xC2",
  50612. Atilde: "\xC3",
  50613. Auml: "\xC4",
  50614. Aring: "\xC5",
  50615. AElig: "\xC6",
  50616. Ccedil: "\xC7",
  50617. Egrave: "\xC8",
  50618. Eacute: "\xC9",
  50619. Ecirc: "\xCA",
  50620. Euml: "\xCB",
  50621. Igrave: "\xCC",
  50622. Iacute: "\xCD",
  50623. Icirc: "\xCE",
  50624. Iuml: "\xCF",
  50625. ETH: "\xD0",
  50626. Ntilde: "\xD1",
  50627. Ograve: "\xD2",
  50628. Oacute: "\xD3",
  50629. Ocirc: "\xD4",
  50630. Otilde: "\xD5",
  50631. Ouml: "\xD6",
  50632. Oslash: "\xD8",
  50633. Ugrave: "\xD9",
  50634. Uacute: "\xDA",
  50635. Ucirc: "\xDB",
  50636. Uuml: "\xDC",
  50637. Yacute: "\xDD",
  50638. THORN: "\xDE",
  50639. szlig: "\xDF",
  50640. agrave: "\xE0",
  50641. aacute: "\xE1",
  50642. acirc: "\xE2",
  50643. atilde: "\xE3",
  50644. auml: "\xE4",
  50645. aring: "\xE5",
  50646. aelig: "\xE6",
  50647. ccedil: "\xE7",
  50648. egrave: "\xE8",
  50649. eacute: "\xE9",
  50650. ecirc: "\xEA",
  50651. euml: "\xEB",
  50652. igrave: "\xEC",
  50653. iacute: "\xED",
  50654. icirc: "\xEE",
  50655. iuml: "\xEF",
  50656. eth: "\xF0",
  50657. ntilde: "\xF1",
  50658. ograve: "\xF2",
  50659. oacute: "\xF3",
  50660. ocirc: "\xF4",
  50661. otilde: "\xF5",
  50662. ouml: "\xF6",
  50663. oslash: "\xF8",
  50664. ugrave: "\xF9",
  50665. uacute: "\xFA",
  50666. ucirc: "\xFB",
  50667. uuml: "\xFC",
  50668. yacute: "\xFD",
  50669. thorn: "\xFE",
  50670. yuml: "\xFF",
  50671. nbsp: "\xA0",
  50672. iexcl: "\xA1",
  50673. cent: "\xA2",
  50674. pound: "\xA3",
  50675. curren: "\xA4",
  50676. yen: "\xA5",
  50677. brvbar: "\xA6",
  50678. sect: "\xA7",
  50679. uml: "\xA8",
  50680. copy: "\xA9",
  50681. ordf: "\xAA",
  50682. laquo: "\xAB",
  50683. not: "\xAC",
  50684. shy: "\xAD\xAD",
  50685. reg: "\xAE",
  50686. macr: "\xAF",
  50687. deg: "\xB0",
  50688. plusmn: "\xB1",
  50689. sup2: "\xB2",
  50690. sup3: "\xB3",
  50691. acute: "\xB4",
  50692. micro: "\xB5",
  50693. para: "\xB6",
  50694. middot: "\xB7",
  50695. cedil: "\xB8",
  50696. sup1: "\xB9",
  50697. ordm: "\xBA",
  50698. raquo: "\xBB",
  50699. frac14: "\xBC",
  50700. frac12: "\xBD",
  50701. frac34: "\xBE",
  50702. iquest: "\xBF",
  50703. times: "\xD7",
  50704. divide: "\xF7",
  50705. forall: "\u2200",
  50706. part: "\u2202",
  50707. exist: "\u2203",
  50708. empty: "\u2205",
  50709. nabla: "\u2207",
  50710. isin: "\u2208",
  50711. notin: "\u2209",
  50712. ni: "\u220B",
  50713. prod: "\u220F",
  50714. sum: "\u2211",
  50715. minus: "\u2212",
  50716. lowast: "\u2217",
  50717. radic: "\u221A",
  50718. prop: "\u221D",
  50719. infin: "\u221E",
  50720. ang: "\u2220",
  50721. and: "\u2227",
  50722. or: "\u2228",
  50723. cap: "\u2229",
  50724. cup: "\u222A",
  50725. "int": "\u222B",
  50726. there4: "\u2234",
  50727. sim: "\u223C",
  50728. cong: "\u2245",
  50729. asymp: "\u2248",
  50730. ne: "\u2260",
  50731. equiv: "\u2261",
  50732. le: "\u2264",
  50733. ge: "\u2265",
  50734. sub: "\u2282",
  50735. sup: "\u2283",
  50736. nsub: "\u2284",
  50737. sube: "\u2286",
  50738. supe: "\u2287",
  50739. oplus: "\u2295",
  50740. otimes: "\u2297",
  50741. perp: "\u22A5",
  50742. sdot: "\u22C5",
  50743. Alpha: "\u0391",
  50744. Beta: "\u0392",
  50745. Gamma: "\u0393",
  50746. Delta: "\u0394",
  50747. Epsilon: "\u0395",
  50748. Zeta: "\u0396",
  50749. Eta: "\u0397",
  50750. Theta: "\u0398",
  50751. Iota: "\u0399",
  50752. Kappa: "\u039A",
  50753. Lambda: "\u039B",
  50754. Mu: "\u039C",
  50755. Nu: "\u039D",
  50756. Xi: "\u039E",
  50757. Omicron: "\u039F",
  50758. Pi: "\u03A0",
  50759. Rho: "\u03A1",
  50760. Sigma: "\u03A3",
  50761. Tau: "\u03A4",
  50762. Upsilon: "\u03A5",
  50763. Phi: "\u03A6",
  50764. Chi: "\u03A7",
  50765. Psi: "\u03A8",
  50766. Omega: "\u03A9",
  50767. alpha: "\u03B1",
  50768. beta: "\u03B2",
  50769. gamma: "\u03B3",
  50770. delta: "\u03B4",
  50771. epsilon: "\u03B5",
  50772. zeta: "\u03B6",
  50773. eta: "\u03B7",
  50774. theta: "\u03B8",
  50775. iota: "\u03B9",
  50776. kappa: "\u03BA",
  50777. lambda: "\u03BB",
  50778. mu: "\u03BC",
  50779. nu: "\u03BD",
  50780. xi: "\u03BE",
  50781. omicron: "\u03BF",
  50782. pi: "\u03C0",
  50783. rho: "\u03C1",
  50784. sigmaf: "\u03C2",
  50785. sigma: "\u03C3",
  50786. tau: "\u03C4",
  50787. upsilon: "\u03C5",
  50788. phi: "\u03C6",
  50789. chi: "\u03C7",
  50790. psi: "\u03C8",
  50791. omega: "\u03C9",
  50792. thetasym: "\u03D1",
  50793. upsih: "\u03D2",
  50794. piv: "\u03D6",
  50795. OElig: "\u0152",
  50796. oelig: "\u0153",
  50797. Scaron: "\u0160",
  50798. scaron: "\u0161",
  50799. Yuml: "\u0178",
  50800. fnof: "\u0192",
  50801. circ: "\u02C6",
  50802. tilde: "\u02DC",
  50803. ensp: "\u2002",
  50804. emsp: "\u2003",
  50805. thinsp: "\u2009",
  50806. zwnj: "\u200C",
  50807. zwj: "\u200D",
  50808. lrm: "\u200E",
  50809. rlm: "\u200F",
  50810. ndash: "\u2013",
  50811. mdash: "\u2014",
  50812. lsquo: "\u2018",
  50813. rsquo: "\u2019",
  50814. sbquo: "\u201A",
  50815. ldquo: "\u201C",
  50816. rdquo: "\u201D",
  50817. bdquo: "\u201E",
  50818. dagger: "\u2020",
  50819. Dagger: "\u2021",
  50820. bull: "\u2022",
  50821. hellip: "\u2026",
  50822. permil: "\u2030",
  50823. prime: "\u2032",
  50824. Prime: "\u2033",
  50825. lsaquo: "\u2039",
  50826. rsaquo: "\u203A",
  50827. oline: "\u203E",
  50828. euro: "\u20AC",
  50829. trade: "\u2122",
  50830. larr: "\u2190",
  50831. uarr: "\u2191",
  50832. rarr: "\u2192",
  50833. darr: "\u2193",
  50834. harr: "\u2194",
  50835. crarr: "\u21B5",
  50836. lceil: "\u2308",
  50837. rceil: "\u2309",
  50838. lfloor: "\u230A",
  50839. rfloor: "\u230B",
  50840. loz: "\u25CA",
  50841. spades: "\u2660",
  50842. clubs: "\u2663",
  50843. hearts: "\u2665",
  50844. diams: "\u2666"
  50845. });
  50846. exports2.entityMap = exports2.HTML_ENTITIES;
  50847. })(entities$1);
  50848. var sax$1 = {};
  50849. var NAMESPACE$1 = conventions$2.NAMESPACE;
  50850. var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
  50851. var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
  50852. var tagNamePattern = new RegExp("^" + nameStartChar.source + nameChar.source + "*(?::" + nameStartChar.source + nameChar.source + "*)?$");
  50853. var S_TAG = 0;
  50854. var S_ATTR = 1;
  50855. var S_ATTR_SPACE = 2;
  50856. var S_EQ = 3;
  50857. var S_ATTR_NOQUOT_VALUE = 4;
  50858. var S_ATTR_END = 5;
  50859. var S_TAG_SPACE = 6;
  50860. var S_TAG_CLOSE = 7;
  50861. function ParseError$1(message, locator) {
  50862. this.message = message;
  50863. this.locator = locator;
  50864. if (Error.captureStackTrace)
  50865. Error.captureStackTrace(this, ParseError$1);
  50866. }
  50867. ParseError$1.prototype = new Error();
  50868. ParseError$1.prototype.name = ParseError$1.name;
  50869. function XMLReader$1() {
  50870. }
  50871. XMLReader$1.prototype = {
  50872. parse: function(source, defaultNSMap, entityMap) {
  50873. var domBuilder = this.domBuilder;
  50874. domBuilder.startDocument();
  50875. _copy(defaultNSMap, defaultNSMap = {});
  50876. parse$2(
  50877. source,
  50878. defaultNSMap,
  50879. entityMap,
  50880. domBuilder,
  50881. this.errorHandler
  50882. );
  50883. domBuilder.endDocument();
  50884. }
  50885. };
  50886. function parse$2(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
  50887. function fixedFromCharCode(code) {
  50888. if (code > 65535) {
  50889. code -= 65536;
  50890. var surrogate1 = 55296 + (code >> 10), surrogate2 = 56320 + (code & 1023);
  50891. return String.fromCharCode(surrogate1, surrogate2);
  50892. } else {
  50893. return String.fromCharCode(code);
  50894. }
  50895. }
  50896. function entityReplacer(a2) {
  50897. var k = a2.slice(1, -1);
  50898. if (Object.hasOwnProperty.call(entityMap, k)) {
  50899. return entityMap[k];
  50900. } else if (k.charAt(0) === "#") {
  50901. return fixedFromCharCode(parseInt(k.substr(1).replace("x", "0x")));
  50902. } else {
  50903. errorHandler.error("entity not found:" + a2);
  50904. return a2;
  50905. }
  50906. }
  50907. function appendText(end2) {
  50908. if (end2 > start2) {
  50909. var xt2 = source.substring(start2, end2).replace(/&#?\w+;/g, entityReplacer);
  50910. locator && position2(start2);
  50911. domBuilder.characters(xt2, 0, end2 - start2);
  50912. start2 = end2;
  50913. }
  50914. }
  50915. function position2(p, m) {
  50916. while (p >= lineEnd && (m = linePattern.exec(source))) {
  50917. lineStart = m.index;
  50918. lineEnd = lineStart + m[0].length;
  50919. locator.lineNumber++;
  50920. }
  50921. locator.columnNumber = p - lineStart + 1;
  50922. }
  50923. var lineStart = 0;
  50924. var lineEnd = 0;
  50925. var linePattern = /.*(?:\r\n?|\n)|.*$/g;
  50926. var locator = domBuilder.locator;
  50927. var parseStack = [{ currentNSMap: defaultNSMapCopy }];
  50928. var closeMap = {};
  50929. var start2 = 0;
  50930. while (true) {
  50931. try {
  50932. var tagStart = source.indexOf("<", start2);
  50933. if (tagStart < 0) {
  50934. if (!source.substr(start2).match(/^\s*$/)) {
  50935. var doc = domBuilder.doc;
  50936. var text = doc.createTextNode(source.substr(start2));
  50937. doc.appendChild(text);
  50938. domBuilder.currentElement = text;
  50939. }
  50940. return;
  50941. }
  50942. if (tagStart > start2) {
  50943. appendText(tagStart);
  50944. }
  50945. switch (source.charAt(tagStart + 1)) {
  50946. case "/":
  50947. var end = source.indexOf(">", tagStart + 3);
  50948. var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, "");
  50949. var config = parseStack.pop();
  50950. if (end < 0) {
  50951. tagName = source.substring(tagStart + 2).replace(/[\s<].*/, "");
  50952. errorHandler.error("end tag name: " + tagName + " is not complete:" + config.tagName);
  50953. end = tagStart + 1 + tagName.length;
  50954. } else if (tagName.match(/\s</)) {
  50955. tagName = tagName.replace(/[\s<].*/, "");
  50956. errorHandler.error("end tag name: " + tagName + " maybe not complete");
  50957. end = tagStart + 1 + tagName.length;
  50958. }
  50959. var localNSMap = config.localNSMap;
  50960. var endMatch = config.tagName == tagName;
  50961. var endIgnoreCaseMach = endMatch || config.tagName && config.tagName.toLowerCase() == tagName.toLowerCase();
  50962. if (endIgnoreCaseMach) {
  50963. domBuilder.endElement(config.uri, config.localName, tagName);
  50964. if (localNSMap) {
  50965. for (var prefix in localNSMap) {
  50966. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  50967. domBuilder.endPrefixMapping(prefix);
  50968. }
  50969. }
  50970. }
  50971. if (!endMatch) {
  50972. errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config.tagName);
  50973. }
  50974. } else {
  50975. parseStack.push(config);
  50976. }
  50977. end++;
  50978. break;
  50979. case "?":
  50980. locator && position2(tagStart);
  50981. end = parseInstruction(source, tagStart, domBuilder);
  50982. break;
  50983. case "!":
  50984. locator && position2(tagStart);
  50985. end = parseDCC(source, tagStart, domBuilder, errorHandler);
  50986. break;
  50987. default:
  50988. locator && position2(tagStart);
  50989. var el = new ElementAttributes();
  50990. var currentNSMap = parseStack[parseStack.length - 1].currentNSMap;
  50991. var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler);
  50992. var len = el.length;
  50993. if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) {
  50994. el.closed = true;
  50995. if (!entityMap.nbsp) {
  50996. errorHandler.warning("unclosed xml attribute");
  50997. }
  50998. }
  50999. if (locator && len) {
  51000. var locator2 = copyLocator(locator, {});
  51001. for (var i2 = 0; i2 < len; i2++) {
  51002. var a = el[i2];
  51003. position2(a.offset);
  51004. a.locator = copyLocator(locator, {});
  51005. }
  51006. domBuilder.locator = locator2;
  51007. if (appendElement$1(el, domBuilder, currentNSMap)) {
  51008. parseStack.push(el);
  51009. }
  51010. domBuilder.locator = locator;
  51011. } else {
  51012. if (appendElement$1(el, domBuilder, currentNSMap)) {
  51013. parseStack.push(el);
  51014. }
  51015. }
  51016. if (NAMESPACE$1.isHTML(el.uri) && !el.closed) {
  51017. end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder);
  51018. } else {
  51019. end++;
  51020. }
  51021. }
  51022. } catch (e) {
  51023. if (e instanceof ParseError$1) {
  51024. throw e;
  51025. }
  51026. errorHandler.error("element parse error: " + e);
  51027. end = -1;
  51028. }
  51029. if (end > start2) {
  51030. start2 = end;
  51031. } else {
  51032. appendText(Math.max(tagStart, start2) + 1);
  51033. }
  51034. }
  51035. }
  51036. function copyLocator(f, t2) {
  51037. t2.lineNumber = f.lineNumber;
  51038. t2.columnNumber = f.columnNumber;
  51039. return t2;
  51040. }
  51041. function parseElementStartPart(source, start2, el, currentNSMap, entityReplacer, errorHandler) {
  51042. function addAttribute(qname, value2, startIndex) {
  51043. if (el.attributeNames.hasOwnProperty(qname)) {
  51044. errorHandler.fatalError("Attribute " + qname + " redefined");
  51045. }
  51046. el.addValue(
  51047. qname,
  51048. value2.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, entityReplacer),
  51049. startIndex
  51050. );
  51051. }
  51052. var attrName;
  51053. var value;
  51054. var p = ++start2;
  51055. var s = S_TAG;
  51056. while (true) {
  51057. var c = source.charAt(p);
  51058. switch (c) {
  51059. case "=":
  51060. if (s === S_ATTR) {
  51061. attrName = source.slice(start2, p);
  51062. s = S_EQ;
  51063. } else if (s === S_ATTR_SPACE) {
  51064. s = S_EQ;
  51065. } else {
  51066. throw new Error("attribute equal must after attrName");
  51067. }
  51068. break;
  51069. case "'":
  51070. case '"':
  51071. if (s === S_EQ || s === S_ATTR) {
  51072. if (s === S_ATTR) {
  51073. errorHandler.warning('attribute value must after "="');
  51074. attrName = source.slice(start2, p);
  51075. }
  51076. start2 = p + 1;
  51077. p = source.indexOf(c, start2);
  51078. if (p > 0) {
  51079. value = source.slice(start2, p);
  51080. addAttribute(attrName, value, start2 - 1);
  51081. s = S_ATTR_END;
  51082. } else {
  51083. throw new Error("attribute value no end '" + c + "' match");
  51084. }
  51085. } else if (s == S_ATTR_NOQUOT_VALUE) {
  51086. value = source.slice(start2, p);
  51087. addAttribute(attrName, value, start2);
  51088. errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ")!!");
  51089. start2 = p + 1;
  51090. s = S_ATTR_END;
  51091. } else {
  51092. throw new Error('attribute value must after "="');
  51093. }
  51094. break;
  51095. case "/":
  51096. switch (s) {
  51097. case S_TAG:
  51098. el.setTagName(source.slice(start2, p));
  51099. case S_ATTR_END:
  51100. case S_TAG_SPACE:
  51101. case S_TAG_CLOSE:
  51102. s = S_TAG_CLOSE;
  51103. el.closed = true;
  51104. case S_ATTR_NOQUOT_VALUE:
  51105. case S_ATTR:
  51106. break;
  51107. case S_ATTR_SPACE:
  51108. el.closed = true;
  51109. break;
  51110. default:
  51111. throw new Error("attribute invalid close char('/')");
  51112. }
  51113. break;
  51114. case "":
  51115. errorHandler.error("unexpected end of input");
  51116. if (s == S_TAG) {
  51117. el.setTagName(source.slice(start2, p));
  51118. }
  51119. return p;
  51120. case ">":
  51121. switch (s) {
  51122. case S_TAG:
  51123. el.setTagName(source.slice(start2, p));
  51124. case S_ATTR_END:
  51125. case S_TAG_SPACE:
  51126. case S_TAG_CLOSE:
  51127. break;
  51128. case S_ATTR_NOQUOT_VALUE:
  51129. case S_ATTR:
  51130. value = source.slice(start2, p);
  51131. if (value.slice(-1) === "/") {
  51132. el.closed = true;
  51133. value = value.slice(0, -1);
  51134. }
  51135. case S_ATTR_SPACE:
  51136. if (s === S_ATTR_SPACE) {
  51137. value = attrName;
  51138. }
  51139. if (s == S_ATTR_NOQUOT_VALUE) {
  51140. errorHandler.warning('attribute "' + value + '" missed quot(")!');
  51141. addAttribute(attrName, value, start2);
  51142. } else {
  51143. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !value.match(/^(?:disabled|checked|selected)$/i)) {
  51144. errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!');
  51145. }
  51146. addAttribute(value, value, start2);
  51147. }
  51148. break;
  51149. case S_EQ:
  51150. throw new Error("attribute value missed!!");
  51151. }
  51152. return p;
  51153. case "\x80":
  51154. c = " ";
  51155. default:
  51156. if (c <= " ") {
  51157. switch (s) {
  51158. case S_TAG:
  51159. el.setTagName(source.slice(start2, p));
  51160. s = S_TAG_SPACE;
  51161. break;
  51162. case S_ATTR:
  51163. attrName = source.slice(start2, p);
  51164. s = S_ATTR_SPACE;
  51165. break;
  51166. case S_ATTR_NOQUOT_VALUE:
  51167. var value = source.slice(start2, p);
  51168. errorHandler.warning('attribute "' + value + '" missed quot(")!!');
  51169. addAttribute(attrName, value, start2);
  51170. case S_ATTR_END:
  51171. s = S_TAG_SPACE;
  51172. break;
  51173. }
  51174. } else {
  51175. switch (s) {
  51176. case S_ATTR_SPACE:
  51177. el.tagName;
  51178. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
  51179. errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!');
  51180. }
  51181. addAttribute(attrName, attrName, start2);
  51182. start2 = p;
  51183. s = S_ATTR;
  51184. break;
  51185. case S_ATTR_END:
  51186. errorHandler.warning('attribute space is required"' + attrName + '"!!');
  51187. case S_TAG_SPACE:
  51188. s = S_ATTR;
  51189. start2 = p;
  51190. break;
  51191. case S_EQ:
  51192. s = S_ATTR_NOQUOT_VALUE;
  51193. start2 = p;
  51194. break;
  51195. case S_TAG_CLOSE:
  51196. throw new Error("elements closed character '/' and '>' must be connected to");
  51197. }
  51198. }
  51199. }
  51200. p++;
  51201. }
  51202. }
  51203. function appendElement$1(el, domBuilder, currentNSMap) {
  51204. var tagName = el.tagName;
  51205. var localNSMap = null;
  51206. var i2 = el.length;
  51207. while (i2--) {
  51208. var a = el[i2];
  51209. var qName = a.qName;
  51210. var value = a.value;
  51211. var nsp = qName.indexOf(":");
  51212. if (nsp > 0) {
  51213. var prefix = a.prefix = qName.slice(0, nsp);
  51214. var localName = qName.slice(nsp + 1);
  51215. var nsPrefix = prefix === "xmlns" && localName;
  51216. } else {
  51217. localName = qName;
  51218. prefix = null;
  51219. nsPrefix = qName === "xmlns" && "";
  51220. }
  51221. a.localName = localName;
  51222. if (nsPrefix !== false) {
  51223. if (localNSMap == null) {
  51224. localNSMap = {};
  51225. _copy(currentNSMap, currentNSMap = {});
  51226. }
  51227. currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
  51228. a.uri = NAMESPACE$1.XMLNS;
  51229. domBuilder.startPrefixMapping(nsPrefix, value);
  51230. }
  51231. }
  51232. var i2 = el.length;
  51233. while (i2--) {
  51234. a = el[i2];
  51235. var prefix = a.prefix;
  51236. if (prefix) {
  51237. if (prefix === "xml") {
  51238. a.uri = NAMESPACE$1.XML;
  51239. }
  51240. if (prefix !== "xmlns") {
  51241. a.uri = currentNSMap[prefix || ""];
  51242. }
  51243. }
  51244. }
  51245. var nsp = tagName.indexOf(":");
  51246. if (nsp > 0) {
  51247. prefix = el.prefix = tagName.slice(0, nsp);
  51248. localName = el.localName = tagName.slice(nsp + 1);
  51249. } else {
  51250. prefix = null;
  51251. localName = el.localName = tagName;
  51252. }
  51253. var ns = el.uri = currentNSMap[prefix || ""];
  51254. domBuilder.startElement(ns, localName, tagName, el);
  51255. if (el.closed) {
  51256. domBuilder.endElement(ns, localName, tagName);
  51257. if (localNSMap) {
  51258. for (prefix in localNSMap) {
  51259. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  51260. domBuilder.endPrefixMapping(prefix);
  51261. }
  51262. }
  51263. }
  51264. } else {
  51265. el.currentNSMap = currentNSMap;
  51266. el.localNSMap = localNSMap;
  51267. return true;
  51268. }
  51269. }
  51270. function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) {
  51271. if (/^(?:script|textarea)$/i.test(tagName)) {
  51272. var elEndStart = source.indexOf("</" + tagName + ">", elStartEnd);
  51273. var text = source.substring(elStartEnd + 1, elEndStart);
  51274. if (/[&<]/.test(text)) {
  51275. if (/^script$/i.test(tagName)) {
  51276. domBuilder.characters(text, 0, text.length);
  51277. return elEndStart;
  51278. }
  51279. text = text.replace(/&#?\w+;/g, entityReplacer);
  51280. domBuilder.characters(text, 0, text.length);
  51281. return elEndStart;
  51282. }
  51283. }
  51284. return elStartEnd + 1;
  51285. }
  51286. function fixSelfClosed(source, elStartEnd, tagName, closeMap) {
  51287. var pos = closeMap[tagName];
  51288. if (pos == null) {
  51289. pos = source.lastIndexOf("</" + tagName + ">");
  51290. if (pos < elStartEnd) {
  51291. pos = source.lastIndexOf("</" + tagName);
  51292. }
  51293. closeMap[tagName] = pos;
  51294. }
  51295. return pos < elStartEnd;
  51296. }
  51297. function _copy(source, target) {
  51298. for (var n in source) {
  51299. if (Object.prototype.hasOwnProperty.call(source, n)) {
  51300. target[n] = source[n];
  51301. }
  51302. }
  51303. }
  51304. function parseDCC(source, start2, domBuilder, errorHandler) {
  51305. var next = source.charAt(start2 + 2);
  51306. switch (next) {
  51307. case "-":
  51308. if (source.charAt(start2 + 3) === "-") {
  51309. var end = source.indexOf("-->", start2 + 4);
  51310. if (end > start2) {
  51311. domBuilder.comment(source, start2 + 4, end - start2 - 4);
  51312. return end + 3;
  51313. } else {
  51314. errorHandler.error("Unclosed comment");
  51315. return -1;
  51316. }
  51317. } else {
  51318. return -1;
  51319. }
  51320. default:
  51321. if (source.substr(start2 + 3, 6) == "CDATA[") {
  51322. var end = source.indexOf("]]>", start2 + 9);
  51323. domBuilder.startCDATA();
  51324. domBuilder.characters(source, start2 + 9, end - start2 - 9);
  51325. domBuilder.endCDATA();
  51326. return end + 3;
  51327. }
  51328. var matchs = split(source, start2);
  51329. var len = matchs.length;
  51330. if (len > 1 && /!doctype/i.test(matchs[0][0])) {
  51331. var name = matchs[1][0];
  51332. var pubid = false;
  51333. var sysid = false;
  51334. if (len > 3) {
  51335. if (/^public$/i.test(matchs[2][0])) {
  51336. pubid = matchs[3][0];
  51337. sysid = len > 4 && matchs[4][0];
  51338. } else if (/^system$/i.test(matchs[2][0])) {
  51339. sysid = matchs[3][0];
  51340. }
  51341. }
  51342. var lastMatch = matchs[len - 1];
  51343. domBuilder.startDTD(name, pubid, sysid);
  51344. domBuilder.endDTD();
  51345. return lastMatch.index + lastMatch[0].length;
  51346. }
  51347. }
  51348. return -1;
  51349. }
  51350. function parseInstruction(source, start2, domBuilder) {
  51351. var end = source.indexOf("?>", start2);
  51352. if (end) {
  51353. var match = source.substring(start2, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
  51354. if (match) {
  51355. match[0].length;
  51356. domBuilder.processingInstruction(match[1], match[2]);
  51357. return end + 2;
  51358. } else {
  51359. return -1;
  51360. }
  51361. }
  51362. return -1;
  51363. }
  51364. function ElementAttributes() {
  51365. this.attributeNames = {};
  51366. }
  51367. ElementAttributes.prototype = {
  51368. setTagName: function(tagName) {
  51369. if (!tagNamePattern.test(tagName)) {
  51370. throw new Error("invalid tagName:" + tagName);
  51371. }
  51372. this.tagName = tagName;
  51373. },
  51374. addValue: function(qName, value, offset) {
  51375. if (!tagNamePattern.test(qName)) {
  51376. throw new Error("invalid attribute:" + qName);
  51377. }
  51378. this.attributeNames[qName] = this.length;
  51379. this[this.length++] = { qName, value, offset };
  51380. },
  51381. length: 0,
  51382. getLocalName: function(i2) {
  51383. return this[i2].localName;
  51384. },
  51385. getLocator: function(i2) {
  51386. return this[i2].locator;
  51387. },
  51388. getQName: function(i2) {
  51389. return this[i2].qName;
  51390. },
  51391. getURI: function(i2) {
  51392. return this[i2].uri;
  51393. },
  51394. getValue: function(i2) {
  51395. return this[i2].value;
  51396. }
  51397. };
  51398. function split(source, start2) {
  51399. var match;
  51400. var buf = [];
  51401. var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
  51402. reg.lastIndex = start2;
  51403. reg.exec(source);
  51404. while (match = reg.exec(source)) {
  51405. buf.push(match);
  51406. if (match[1])
  51407. return buf;
  51408. }
  51409. }
  51410. sax$1.XMLReader = XMLReader$1;
  51411. sax$1.ParseError = ParseError$1;
  51412. var conventions = conventions$2;
  51413. var dom = dom$1;
  51414. var entities = entities$1;
  51415. var sax = sax$1;
  51416. var DOMImplementation = dom.DOMImplementation;
  51417. var NAMESPACE = conventions.NAMESPACE;
  51418. var ParseError = sax.ParseError;
  51419. var XMLReader = sax.XMLReader;
  51420. function normalizeLineEndings(input) {
  51421. return input.replace(/\r[\n\u0085]/g, "\n").replace(/[\r\u0085\u2028]/g, "\n");
  51422. }
  51423. function DOMParser$1(options2) {
  51424. this.options = options2 || { locator: {} };
  51425. }
  51426. DOMParser$1.prototype.parseFromString = function(source, mimeType) {
  51427. var options2 = this.options;
  51428. var sax2 = new XMLReader();
  51429. var domBuilder = options2.domBuilder || new DOMHandler();
  51430. var errorHandler = options2.errorHandler;
  51431. var locator = options2.locator;
  51432. var defaultNSMap = options2.xmlns || {};
  51433. var isHTML = /\/x?html?$/.test(mimeType);
  51434. var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
  51435. if (locator) {
  51436. domBuilder.setDocumentLocator(locator);
  51437. }
  51438. sax2.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator);
  51439. sax2.domBuilder = options2.domBuilder || domBuilder;
  51440. if (isHTML) {
  51441. defaultNSMap[""] = NAMESPACE.HTML;
  51442. }
  51443. defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
  51444. var normalize = options2.normalizeLineEndings || normalizeLineEndings;
  51445. if (source && typeof source === "string") {
  51446. sax2.parse(
  51447. normalize(source),
  51448. defaultNSMap,
  51449. entityMap
  51450. );
  51451. } else {
  51452. sax2.errorHandler.error("invalid doc source");
  51453. }
  51454. return domBuilder.doc;
  51455. };
  51456. function buildErrorHandler(errorImpl, domBuilder, locator) {
  51457. if (!errorImpl) {
  51458. if (domBuilder instanceof DOMHandler) {
  51459. return domBuilder;
  51460. }
  51461. errorImpl = domBuilder;
  51462. }
  51463. var errorHandler = {};
  51464. var isCallback = errorImpl instanceof Function;
  51465. locator = locator || {};
  51466. function build(key) {
  51467. var fn2 = errorImpl[key];
  51468. if (!fn2 && isCallback) {
  51469. fn2 = errorImpl.length == 2 ? function(msg) {
  51470. errorImpl(key, msg);
  51471. } : errorImpl;
  51472. }
  51473. errorHandler[key] = fn2 && function(msg) {
  51474. fn2("[xmldom " + key + "] " + msg + _locator(locator));
  51475. } || function() {
  51476. };
  51477. }
  51478. build("warning");
  51479. build("error");
  51480. build("fatalError");
  51481. return errorHandler;
  51482. }
  51483. function DOMHandler() {
  51484. this.cdata = false;
  51485. }
  51486. function position(locator, node) {
  51487. node.lineNumber = locator.lineNumber;
  51488. node.columnNumber = locator.columnNumber;
  51489. }
  51490. DOMHandler.prototype = {
  51491. startDocument: function() {
  51492. this.doc = new DOMImplementation().createDocument(null, null, null);
  51493. if (this.locator) {
  51494. this.doc.documentURI = this.locator.systemId;
  51495. }
  51496. },
  51497. startElement: function(namespaceURI, localName, qName, attrs) {
  51498. var doc = this.doc;
  51499. var el = doc.createElementNS(namespaceURI, qName || localName);
  51500. var len = attrs.length;
  51501. appendElement(this, el);
  51502. this.currentElement = el;
  51503. this.locator && position(this.locator, el);
  51504. for (var i2 = 0; i2 < len; i2++) {
  51505. var namespaceURI = attrs.getURI(i2);
  51506. var value = attrs.getValue(i2);
  51507. var qName = attrs.getQName(i2);
  51508. var attr = doc.createAttributeNS(namespaceURI, qName);
  51509. this.locator && position(attrs.getLocator(i2), attr);
  51510. attr.value = attr.nodeValue = value;
  51511. el.setAttributeNode(attr);
  51512. }
  51513. },
  51514. endElement: function(namespaceURI, localName, qName) {
  51515. var current = this.currentElement;
  51516. current.tagName;
  51517. this.currentElement = current.parentNode;
  51518. },
  51519. startPrefixMapping: function(prefix, uri) {
  51520. },
  51521. endPrefixMapping: function(prefix) {
  51522. },
  51523. processingInstruction: function(target, data) {
  51524. var ins = this.doc.createProcessingInstruction(target, data);
  51525. this.locator && position(this.locator, ins);
  51526. appendElement(this, ins);
  51527. },
  51528. ignorableWhitespace: function(ch, start2, length) {
  51529. },
  51530. characters: function(chars, start2, length) {
  51531. chars = _toString.apply(this, arguments);
  51532. if (chars) {
  51533. if (this.cdata) {
  51534. var charNode = this.doc.createCDATASection(chars);
  51535. } else {
  51536. var charNode = this.doc.createTextNode(chars);
  51537. }
  51538. if (this.currentElement) {
  51539. this.currentElement.appendChild(charNode);
  51540. } else if (/^\s*$/.test(chars)) {
  51541. this.doc.appendChild(charNode);
  51542. }
  51543. this.locator && position(this.locator, charNode);
  51544. }
  51545. },
  51546. skippedEntity: function(name) {
  51547. },
  51548. endDocument: function() {
  51549. this.doc.normalize();
  51550. },
  51551. setDocumentLocator: function(locator) {
  51552. if (this.locator = locator) {
  51553. locator.lineNumber = 0;
  51554. }
  51555. },
  51556. comment: function(chars, start2, length) {
  51557. chars = _toString.apply(this, arguments);
  51558. var comm = this.doc.createComment(chars);
  51559. this.locator && position(this.locator, comm);
  51560. appendElement(this, comm);
  51561. },
  51562. startCDATA: function() {
  51563. this.cdata = true;
  51564. },
  51565. endCDATA: function() {
  51566. this.cdata = false;
  51567. },
  51568. startDTD: function(name, publicId, systemId) {
  51569. var impl = this.doc.implementation;
  51570. if (impl && impl.createDocumentType) {
  51571. var dt2 = impl.createDocumentType(name, publicId, systemId);
  51572. this.locator && position(this.locator, dt2);
  51573. appendElement(this, dt2);
  51574. this.doc.doctype = dt2;
  51575. }
  51576. },
  51577. warning: function(error) {
  51578. console.warn("[xmldom warning] " + error, _locator(this.locator));
  51579. },
  51580. error: function(error) {
  51581. console.error("[xmldom error] " + error, _locator(this.locator));
  51582. },
  51583. fatalError: function(error) {
  51584. throw new ParseError(error, this.locator);
  51585. }
  51586. };
  51587. function _locator(l) {
  51588. if (l) {
  51589. return "\n@" + (l.systemId || "") + "#[line:" + l.lineNumber + ",col:" + l.columnNumber + "]";
  51590. }
  51591. }
  51592. function _toString(chars, start2, length) {
  51593. if (typeof chars == "string") {
  51594. return chars.substr(start2, length);
  51595. } else {
  51596. if (chars.length >= start2 + length || start2) {
  51597. return new java.lang.String(chars, start2, length) + "";
  51598. }
  51599. return chars;
  51600. }
  51601. }
  51602. "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(key) {
  51603. DOMHandler.prototype[key] = function() {
  51604. return null;
  51605. };
  51606. });
  51607. function appendElement(hander, node) {
  51608. if (!hander.currentElement) {
  51609. hander.doc.appendChild(node);
  51610. } else {
  51611. hander.currentElement.appendChild(node);
  51612. }
  51613. }
  51614. domParser.__DOMHandler = DOMHandler;
  51615. domParser.normalizeLineEndings = normalizeLineEndings;
  51616. domParser.DOMParser = DOMParser$1;
  51617. var DOMParser = domParser.DOMParser;
  51618. /*! @name mpd-parser @version 1.1.1 @license Apache-2.0 */
  51619. const isObject$3 = (obj) => {
  51620. return !!obj && typeof obj === "object";
  51621. };
  51622. const merge$3 = (...objects) => {
  51623. return objects.reduce((result, source) => {
  51624. if (typeof source !== "object") {
  51625. return result;
  51626. }
  51627. Object.keys(source).forEach((key) => {
  51628. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  51629. result[key] = result[key].concat(source[key]);
  51630. } else if (isObject$3(result[key]) && isObject$3(source[key])) {
  51631. result[key] = merge$3(result[key], source[key]);
  51632. } else {
  51633. result[key] = source[key];
  51634. }
  51635. });
  51636. return result;
  51637. }, {});
  51638. };
  51639. const values$1 = (o) => Object.keys(o).map((k) => o[k]);
  51640. const range$1 = (start2, end) => {
  51641. const result = [];
  51642. for (let i2 = start2; i2 < end; i2++) {
  51643. result.push(i2);
  51644. }
  51645. return result;
  51646. };
  51647. const flatten$1 = (lists) => lists.reduce((x, y) => x.concat(y), []);
  51648. const from$1 = (list) => {
  51649. if (!list.length) {
  51650. return [];
  51651. }
  51652. const result = [];
  51653. for (let i2 = 0; i2 < list.length; i2++) {
  51654. result.push(list[i2]);
  51655. }
  51656. return result;
  51657. };
  51658. const findIndexes$1 = (l, key) => l.reduce((a, e, i2) => {
  51659. if (e[key]) {
  51660. a.push(i2);
  51661. }
  51662. return a;
  51663. }, []);
  51664. const union$1 = (lists, keyFunction) => {
  51665. return values$1(lists.reduce((acc, list) => {
  51666. list.forEach((el) => {
  51667. acc[keyFunction(el)] = el;
  51668. });
  51669. return acc;
  51670. }, {}));
  51671. };
  51672. var errors$1 = {
  51673. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  51674. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  51675. DASH_INVALID_XML: "DASH_INVALID_XML",
  51676. NO_BASE_URL: "NO_BASE_URL",
  51677. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  51678. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  51679. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  51680. };
  51681. const urlTypeToSegment$1 = ({
  51682. baseUrl = "",
  51683. source = "",
  51684. range: range3 = "",
  51685. indexRange = ""
  51686. }) => {
  51687. const segment = {
  51688. uri: source,
  51689. resolvedUri: resolveUrl$3(baseUrl || "", source)
  51690. };
  51691. if (range3 || indexRange) {
  51692. const rangeStr = range3 ? range3 : indexRange;
  51693. const ranges = rangeStr.split("-");
  51694. let startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  51695. let endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  51696. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  51697. startRange = Number(startRange);
  51698. }
  51699. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  51700. endRange = Number(endRange);
  51701. }
  51702. let length;
  51703. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  51704. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  51705. } else {
  51706. length = endRange - startRange + 1;
  51707. }
  51708. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  51709. length = Number(length);
  51710. }
  51711. segment.byterange = {
  51712. length,
  51713. offset: startRange
  51714. };
  51715. }
  51716. return segment;
  51717. };
  51718. const byteRangeToString$1 = (byterange) => {
  51719. let endRange;
  51720. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  51721. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  51722. } else {
  51723. endRange = byterange.offset + byterange.length - 1;
  51724. }
  51725. return `${byterange.offset}-${endRange}`;
  51726. };
  51727. const parseEndNumber$1 = (endNumber) => {
  51728. if (endNumber && typeof endNumber !== "number") {
  51729. endNumber = parseInt(endNumber, 10);
  51730. }
  51731. if (isNaN(endNumber)) {
  51732. return null;
  51733. }
  51734. return endNumber;
  51735. };
  51736. const segmentRange$1 = {
  51737. static(attributes) {
  51738. const {
  51739. duration: duration5,
  51740. timescale: timescale2 = 1,
  51741. sourceDuration,
  51742. periodDuration
  51743. } = attributes;
  51744. const endNumber = parseEndNumber$1(attributes.endNumber);
  51745. const segmentDuration = duration5 / timescale2;
  51746. if (typeof endNumber === "number") {
  51747. return {
  51748. start: 0,
  51749. end: endNumber
  51750. };
  51751. }
  51752. if (typeof periodDuration === "number") {
  51753. return {
  51754. start: 0,
  51755. end: periodDuration / segmentDuration
  51756. };
  51757. }
  51758. return {
  51759. start: 0,
  51760. end: sourceDuration / segmentDuration
  51761. };
  51762. },
  51763. dynamic(attributes) {
  51764. const {
  51765. NOW,
  51766. clientOffset,
  51767. availabilityStartTime: availabilityStartTime2,
  51768. timescale: timescale2 = 1,
  51769. duration: duration5,
  51770. periodStart = 0,
  51771. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  51772. timeShiftBufferDepth: timeShiftBufferDepth2 = Infinity
  51773. } = attributes;
  51774. const endNumber = parseEndNumber$1(attributes.endNumber);
  51775. const now2 = (NOW + clientOffset) / 1e3;
  51776. const periodStartWC = availabilityStartTime2 + periodStart;
  51777. const periodEndWC = now2 + minimumUpdatePeriod2;
  51778. const periodDuration = periodEndWC - periodStartWC;
  51779. const segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  51780. const availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  51781. const availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  51782. return {
  51783. start: Math.max(0, availableStart),
  51784. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  51785. };
  51786. }
  51787. };
  51788. const toSegments$1 = (attributes) => (number) => {
  51789. const {
  51790. duration: duration5,
  51791. timescale: timescale2 = 1,
  51792. periodStart,
  51793. startNumber: startNumber2 = 1
  51794. } = attributes;
  51795. return {
  51796. number: startNumber2 + number,
  51797. duration: duration5 / timescale2,
  51798. timeline: periodStart,
  51799. time: number * duration5
  51800. };
  51801. };
  51802. const parseByDuration$1 = (attributes) => {
  51803. const {
  51804. type: type2,
  51805. duration: duration5,
  51806. timescale: timescale2 = 1,
  51807. periodDuration,
  51808. sourceDuration
  51809. } = attributes;
  51810. const {
  51811. start: start2,
  51812. end
  51813. } = segmentRange$1[type2](attributes);
  51814. const segments = range$1(start2, end).map(toSegments$1(attributes));
  51815. if (type2 === "static") {
  51816. const index2 = segments.length - 1;
  51817. const sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  51818. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  51819. }
  51820. return segments;
  51821. };
  51822. const segmentsFromBase$1 = (attributes) => {
  51823. const {
  51824. baseUrl,
  51825. initialization = {},
  51826. sourceDuration,
  51827. indexRange = "",
  51828. periodStart,
  51829. presentationTime,
  51830. number = 0,
  51831. duration: duration5
  51832. } = attributes;
  51833. if (!baseUrl) {
  51834. throw new Error(errors$1.NO_BASE_URL);
  51835. }
  51836. const initSegment = urlTypeToSegment$1({
  51837. baseUrl,
  51838. source: initialization.sourceURL,
  51839. range: initialization.range
  51840. });
  51841. const segment = urlTypeToSegment$1({
  51842. baseUrl,
  51843. source: baseUrl,
  51844. indexRange
  51845. });
  51846. segment.map = initSegment;
  51847. if (duration5) {
  51848. const segmentTimeInfo = parseByDuration$1(attributes);
  51849. if (segmentTimeInfo.length) {
  51850. segment.duration = segmentTimeInfo[0].duration;
  51851. segment.timeline = segmentTimeInfo[0].timeline;
  51852. }
  51853. } else if (sourceDuration) {
  51854. segment.duration = sourceDuration;
  51855. segment.timeline = periodStart;
  51856. }
  51857. segment.presentationTime = presentationTime || periodStart;
  51858. segment.number = number;
  51859. return [segment];
  51860. };
  51861. const addSidxSegmentsToPlaylist$1$1 = (playlist, sidx, baseUrl) => {
  51862. const initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  51863. const sourceDuration = playlist.sidx.duration;
  51864. const timeline = playlist.timeline || 0;
  51865. const sidxByteRange = playlist.sidx.byterange;
  51866. const sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  51867. const timescale2 = sidx.timescale;
  51868. const mediaReferences = sidx.references.filter((r2) => r2.referenceType !== 1);
  51869. const segments = [];
  51870. const type2 = playlist.endList ? "static" : "dynamic";
  51871. const periodStart = playlist.sidx.timeline;
  51872. let presentationTime = periodStart;
  51873. let number = playlist.mediaSequence || 0;
  51874. let startIndex;
  51875. if (typeof sidx.firstOffset === "bigint") {
  51876. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  51877. } else {
  51878. startIndex = sidxEnd + sidx.firstOffset;
  51879. }
  51880. for (let i2 = 0; i2 < mediaReferences.length; i2++) {
  51881. const reference = sidx.references[i2];
  51882. const size = reference.referencedSize;
  51883. const duration5 = reference.subsegmentDuration;
  51884. let endIndex;
  51885. if (typeof startIndex === "bigint") {
  51886. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  51887. } else {
  51888. endIndex = startIndex + size - 1;
  51889. }
  51890. const indexRange = `${startIndex}-${endIndex}`;
  51891. const attributes = {
  51892. baseUrl,
  51893. timescale: timescale2,
  51894. timeline,
  51895. periodStart,
  51896. presentationTime,
  51897. number,
  51898. duration: duration5,
  51899. sourceDuration,
  51900. indexRange,
  51901. type: type2
  51902. };
  51903. const segment = segmentsFromBase$1(attributes)[0];
  51904. if (initSegment) {
  51905. segment.map = initSegment;
  51906. }
  51907. segments.push(segment);
  51908. if (typeof startIndex === "bigint") {
  51909. startIndex += window_1.BigInt(size);
  51910. } else {
  51911. startIndex += size;
  51912. }
  51913. presentationTime += duration5 / timescale2;
  51914. number++;
  51915. }
  51916. playlist.segments = segments;
  51917. return playlist;
  51918. };
  51919. const SUPPORTED_MEDIA_TYPES$1 = ["AUDIO", "SUBTITLES"];
  51920. const TIME_FUDGE$1 = 1 / 60;
  51921. const getUniqueTimelineStarts$1 = (timelineStarts) => {
  51922. return union$1(timelineStarts, ({
  51923. timeline
  51924. }) => timeline).sort((a, b) => a.timeline > b.timeline ? 1 : -1);
  51925. };
  51926. const findPlaylistWithName$1 = (playlists, name) => {
  51927. for (let i2 = 0; i2 < playlists.length; i2++) {
  51928. if (playlists[i2].attributes.NAME === name) {
  51929. return playlists[i2];
  51930. }
  51931. }
  51932. return null;
  51933. };
  51934. const getMediaGroupPlaylists$1 = (manifest) => {
  51935. let mediaGroupPlaylists = [];
  51936. forEachMediaGroup$3(manifest, SUPPORTED_MEDIA_TYPES$1, (properties, type2, group, label) => {
  51937. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  51938. });
  51939. return mediaGroupPlaylists;
  51940. };
  51941. const updateMediaSequenceForPlaylist$1 = ({
  51942. playlist,
  51943. mediaSequence
  51944. }) => {
  51945. playlist.mediaSequence = mediaSequence;
  51946. playlist.segments.forEach((segment, index2) => {
  51947. segment.number = playlist.mediaSequence + index2;
  51948. });
  51949. };
  51950. const updateSequenceNumbers$1 = ({
  51951. oldPlaylists,
  51952. newPlaylists,
  51953. timelineStarts
  51954. }) => {
  51955. newPlaylists.forEach((playlist) => {
  51956. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  51957. timeline
  51958. }) {
  51959. return timeline === playlist.timeline;
  51960. });
  51961. const oldPlaylist = findPlaylistWithName$1(oldPlaylists, playlist.attributes.NAME);
  51962. if (!oldPlaylist) {
  51963. return;
  51964. }
  51965. if (playlist.sidx) {
  51966. return;
  51967. }
  51968. const firstNewSegment = playlist.segments[0];
  51969. const oldMatchingSegmentIndex = oldPlaylist.segments.findIndex(function(oldSegment) {
  51970. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE$1;
  51971. });
  51972. if (oldMatchingSegmentIndex === -1) {
  51973. updateMediaSequenceForPlaylist$1({
  51974. playlist,
  51975. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  51976. });
  51977. playlist.segments[0].discontinuity = true;
  51978. playlist.discontinuityStarts.unshift(0);
  51979. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  51980. playlist.discontinuitySequence--;
  51981. }
  51982. return;
  51983. }
  51984. const oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  51985. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  51986. firstNewSegment.discontinuity = true;
  51987. playlist.discontinuityStarts.unshift(0);
  51988. playlist.discontinuitySequence--;
  51989. }
  51990. updateMediaSequenceForPlaylist$1({
  51991. playlist,
  51992. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  51993. });
  51994. });
  51995. };
  51996. const positionManifestOnTimeline$1 = ({
  51997. oldManifest,
  51998. newManifest
  51999. }) => {
  52000. const oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists$1(oldManifest));
  52001. const newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists$1(newManifest));
  52002. newManifest.timelineStarts = getUniqueTimelineStarts$1([oldManifest.timelineStarts, newManifest.timelineStarts]);
  52003. updateSequenceNumbers$1({
  52004. oldPlaylists,
  52005. newPlaylists,
  52006. timelineStarts: newManifest.timelineStarts
  52007. });
  52008. return newManifest;
  52009. };
  52010. const generateSidxKey$1 = (sidx) => sidx && sidx.uri + "-" + byteRangeToString$1(sidx.byterange);
  52011. const mergeDiscontiguousPlaylists$1 = (playlists) => {
  52012. const mergedPlaylists = values$1(playlists.reduce((acc, playlist) => {
  52013. const name = playlist.attributes.id + (playlist.attributes.lang || "");
  52014. if (!acc[name]) {
  52015. acc[name] = playlist;
  52016. acc[name].attributes.timelineStarts = [];
  52017. } else {
  52018. if (playlist.segments) {
  52019. if (playlist.segments[0]) {
  52020. playlist.segments[0].discontinuity = true;
  52021. }
  52022. acc[name].segments.push(...playlist.segments);
  52023. }
  52024. if (playlist.attributes.contentProtection) {
  52025. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  52026. }
  52027. }
  52028. acc[name].attributes.timelineStarts.push({
  52029. start: playlist.attributes.periodStart,
  52030. timeline: playlist.attributes.periodStart
  52031. });
  52032. return acc;
  52033. }, {}));
  52034. return mergedPlaylists.map((playlist) => {
  52035. playlist.discontinuityStarts = findIndexes$1(playlist.segments || [], "discontinuity");
  52036. return playlist;
  52037. });
  52038. };
  52039. const addSidxSegmentsToPlaylist$2 = (playlist, sidxMapping) => {
  52040. const sidxKey = generateSidxKey$1(playlist.sidx);
  52041. const sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  52042. if (sidxMatch) {
  52043. addSidxSegmentsToPlaylist$1$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  52044. }
  52045. return playlist;
  52046. };
  52047. const addSidxSegmentsToPlaylists$1 = (playlists, sidxMapping = {}) => {
  52048. if (!Object.keys(sidxMapping).length) {
  52049. return playlists;
  52050. }
  52051. for (const i2 in playlists) {
  52052. playlists[i2] = addSidxSegmentsToPlaylist$2(playlists[i2], sidxMapping);
  52053. }
  52054. return playlists;
  52055. };
  52056. const formatAudioPlaylist$1 = ({
  52057. attributes,
  52058. segments,
  52059. sidx,
  52060. mediaSequence,
  52061. discontinuitySequence,
  52062. discontinuityStarts
  52063. }, isAudioOnly3) => {
  52064. const playlist = {
  52065. attributes: {
  52066. NAME: attributes.id,
  52067. BANDWIDTH: attributes.bandwidth,
  52068. CODECS: attributes.codecs,
  52069. ["PROGRAM-ID"]: 1
  52070. },
  52071. uri: "",
  52072. endList: attributes.type === "static",
  52073. timeline: attributes.periodStart,
  52074. resolvedUri: "",
  52075. targetDuration: attributes.duration,
  52076. discontinuitySequence,
  52077. discontinuityStarts,
  52078. timelineStarts: attributes.timelineStarts,
  52079. mediaSequence,
  52080. segments
  52081. };
  52082. if (attributes.contentProtection) {
  52083. playlist.contentProtection = attributes.contentProtection;
  52084. }
  52085. if (sidx) {
  52086. playlist.sidx = sidx;
  52087. }
  52088. if (isAudioOnly3) {
  52089. playlist.attributes.AUDIO = "audio";
  52090. playlist.attributes.SUBTITLES = "subs";
  52091. }
  52092. return playlist;
  52093. };
  52094. const formatVttPlaylist$1 = ({
  52095. attributes,
  52096. segments,
  52097. mediaSequence,
  52098. discontinuityStarts,
  52099. discontinuitySequence
  52100. }) => {
  52101. if (typeof segments === "undefined") {
  52102. segments = [{
  52103. uri: attributes.baseUrl,
  52104. timeline: attributes.periodStart,
  52105. resolvedUri: attributes.baseUrl || "",
  52106. duration: attributes.sourceDuration,
  52107. number: 0
  52108. }];
  52109. attributes.duration = attributes.sourceDuration;
  52110. }
  52111. const m3u8Attributes = {
  52112. NAME: attributes.id,
  52113. BANDWIDTH: attributes.bandwidth,
  52114. ["PROGRAM-ID"]: 1
  52115. };
  52116. if (attributes.codecs) {
  52117. m3u8Attributes.CODECS = attributes.codecs;
  52118. }
  52119. return {
  52120. attributes: m3u8Attributes,
  52121. uri: "",
  52122. endList: attributes.type === "static",
  52123. timeline: attributes.periodStart,
  52124. resolvedUri: attributes.baseUrl || "",
  52125. targetDuration: attributes.duration,
  52126. timelineStarts: attributes.timelineStarts,
  52127. discontinuityStarts,
  52128. discontinuitySequence,
  52129. mediaSequence,
  52130. segments
  52131. };
  52132. };
  52133. const organizeAudioPlaylists$1 = (playlists, sidxMapping = {}, isAudioOnly3 = false) => {
  52134. let mainPlaylist;
  52135. const formattedPlaylists = playlists.reduce((a, playlist) => {
  52136. const role = playlist.attributes.role && playlist.attributes.role.value || "";
  52137. const language = playlist.attributes.lang || "";
  52138. let label = playlist.attributes.label || "main";
  52139. if (language && !playlist.attributes.label) {
  52140. const roleLabel = role ? ` (${role})` : "";
  52141. label = `${playlist.attributes.lang}${roleLabel}`;
  52142. }
  52143. if (!a[label]) {
  52144. a[label] = {
  52145. language,
  52146. autoselect: true,
  52147. default: role === "main",
  52148. playlists: [],
  52149. uri: ""
  52150. };
  52151. }
  52152. const formatted = addSidxSegmentsToPlaylist$2(formatAudioPlaylist$1(playlist, isAudioOnly3), sidxMapping);
  52153. a[label].playlists.push(formatted);
  52154. if (typeof mainPlaylist === "undefined" && role === "main") {
  52155. mainPlaylist = playlist;
  52156. mainPlaylist.default = true;
  52157. }
  52158. return a;
  52159. }, {});
  52160. if (!mainPlaylist) {
  52161. const firstLabel = Object.keys(formattedPlaylists)[0];
  52162. formattedPlaylists[firstLabel].default = true;
  52163. }
  52164. return formattedPlaylists;
  52165. };
  52166. const organizeVttPlaylists$1 = (playlists, sidxMapping = {}) => {
  52167. return playlists.reduce((a, playlist) => {
  52168. const label = playlist.attributes.label || playlist.attributes.lang || "text";
  52169. if (!a[label]) {
  52170. a[label] = {
  52171. language: label,
  52172. default: false,
  52173. autoselect: false,
  52174. playlists: [],
  52175. uri: ""
  52176. };
  52177. }
  52178. a[label].playlists.push(addSidxSegmentsToPlaylist$2(formatVttPlaylist$1(playlist), sidxMapping));
  52179. return a;
  52180. }, {});
  52181. };
  52182. const organizeCaptionServices$1 = (captionServices) => captionServices.reduce((svcObj, svc) => {
  52183. if (!svc) {
  52184. return svcObj;
  52185. }
  52186. svc.forEach((service) => {
  52187. const {
  52188. channel,
  52189. language
  52190. } = service;
  52191. svcObj[language] = {
  52192. autoselect: false,
  52193. default: false,
  52194. instreamId: channel,
  52195. language
  52196. };
  52197. if (service.hasOwnProperty("aspectRatio")) {
  52198. svcObj[language].aspectRatio = service.aspectRatio;
  52199. }
  52200. if (service.hasOwnProperty("easyReader")) {
  52201. svcObj[language].easyReader = service.easyReader;
  52202. }
  52203. if (service.hasOwnProperty("3D")) {
  52204. svcObj[language]["3D"] = service["3D"];
  52205. }
  52206. });
  52207. return svcObj;
  52208. }, {});
  52209. const formatVideoPlaylist$1 = ({
  52210. attributes,
  52211. segments,
  52212. sidx,
  52213. discontinuityStarts
  52214. }) => {
  52215. const playlist = {
  52216. attributes: {
  52217. NAME: attributes.id,
  52218. AUDIO: "audio",
  52219. SUBTITLES: "subs",
  52220. RESOLUTION: {
  52221. width: attributes.width,
  52222. height: attributes.height
  52223. },
  52224. CODECS: attributes.codecs,
  52225. BANDWIDTH: attributes.bandwidth,
  52226. ["PROGRAM-ID"]: 1
  52227. },
  52228. uri: "",
  52229. endList: attributes.type === "static",
  52230. timeline: attributes.periodStart,
  52231. resolvedUri: "",
  52232. targetDuration: attributes.duration,
  52233. discontinuityStarts,
  52234. timelineStarts: attributes.timelineStarts,
  52235. segments
  52236. };
  52237. if (attributes.frameRate) {
  52238. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  52239. }
  52240. if (attributes.contentProtection) {
  52241. playlist.contentProtection = attributes.contentProtection;
  52242. }
  52243. if (sidx) {
  52244. playlist.sidx = sidx;
  52245. }
  52246. return playlist;
  52247. };
  52248. const videoOnly$1 = ({
  52249. attributes
  52250. }) => attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  52251. const audioOnly$1 = ({
  52252. attributes
  52253. }) => attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  52254. const vttOnly$1 = ({
  52255. attributes
  52256. }) => attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  52257. const addMediaSequenceValues$1 = (playlists, timelineStarts) => {
  52258. playlists.forEach((playlist) => {
  52259. playlist.mediaSequence = 0;
  52260. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  52261. timeline
  52262. }) {
  52263. return timeline === playlist.timeline;
  52264. });
  52265. if (!playlist.segments) {
  52266. return;
  52267. }
  52268. playlist.segments.forEach((segment, index2) => {
  52269. segment.number = index2;
  52270. });
  52271. });
  52272. };
  52273. const flattenMediaGroupPlaylists$1 = (mediaGroupObject) => {
  52274. if (!mediaGroupObject) {
  52275. return [];
  52276. }
  52277. return Object.keys(mediaGroupObject).reduce((acc, label) => {
  52278. const labelContents = mediaGroupObject[label];
  52279. return acc.concat(labelContents.playlists);
  52280. }, []);
  52281. };
  52282. const toM3u8$1 = ({
  52283. dashPlaylists,
  52284. locations,
  52285. sidxMapping = {},
  52286. previousManifest,
  52287. eventStream
  52288. }) => {
  52289. if (!dashPlaylists.length) {
  52290. return {};
  52291. }
  52292. const {
  52293. sourceDuration: duration5,
  52294. type: type2,
  52295. suggestedPresentationDelay: suggestedPresentationDelay2,
  52296. minimumUpdatePeriod: minimumUpdatePeriod2
  52297. } = dashPlaylists[0].attributes;
  52298. const videoPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(videoOnly$1)).map(formatVideoPlaylist$1);
  52299. const audioPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(audioOnly$1));
  52300. const vttPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(vttOnly$1));
  52301. const captions = dashPlaylists.map((playlist) => playlist.attributes.captionServices).filter(Boolean);
  52302. const manifest = {
  52303. allowCache: true,
  52304. discontinuityStarts: [],
  52305. segments: [],
  52306. endList: true,
  52307. mediaGroups: {
  52308. AUDIO: {},
  52309. VIDEO: {},
  52310. ["CLOSED-CAPTIONS"]: {},
  52311. SUBTITLES: {}
  52312. },
  52313. uri: "",
  52314. duration: duration5,
  52315. playlists: addSidxSegmentsToPlaylists$1(videoPlaylists, sidxMapping)
  52316. };
  52317. if (minimumUpdatePeriod2 >= 0) {
  52318. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  52319. }
  52320. if (locations) {
  52321. manifest.locations = locations;
  52322. }
  52323. if (type2 === "dynamic") {
  52324. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  52325. }
  52326. if (eventStream && eventStream.length > 0) {
  52327. manifest.eventStream = eventStream;
  52328. }
  52329. const isAudioOnly3 = manifest.playlists.length === 0;
  52330. const organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists$1(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  52331. const organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists$1(vttPlaylists, sidxMapping) : null;
  52332. const formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists$1(organizedAudioGroup), flattenMediaGroupPlaylists$1(organizedVttGroup));
  52333. const playlistTimelineStarts = formattedPlaylists.map(({
  52334. timelineStarts
  52335. }) => timelineStarts);
  52336. manifest.timelineStarts = getUniqueTimelineStarts$1(playlistTimelineStarts);
  52337. addMediaSequenceValues$1(formattedPlaylists, manifest.timelineStarts);
  52338. if (organizedAudioGroup) {
  52339. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  52340. }
  52341. if (organizedVttGroup) {
  52342. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  52343. }
  52344. if (captions.length) {
  52345. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices$1(captions);
  52346. }
  52347. if (previousManifest) {
  52348. return positionManifestOnTimeline$1({
  52349. oldManifest: previousManifest,
  52350. newManifest: manifest
  52351. });
  52352. }
  52353. return manifest;
  52354. };
  52355. const getLiveRValue$1 = (attributes, time, duration5) => {
  52356. const {
  52357. NOW,
  52358. clientOffset,
  52359. availabilityStartTime: availabilityStartTime2,
  52360. timescale: timescale2 = 1,
  52361. periodStart = 0,
  52362. minimumUpdatePeriod: minimumUpdatePeriod2 = 0
  52363. } = attributes;
  52364. const now2 = (NOW + clientOffset) / 1e3;
  52365. const periodStartWC = availabilityStartTime2 + periodStart;
  52366. const periodEndWC = now2 + minimumUpdatePeriod2;
  52367. const periodDuration = periodEndWC - periodStartWC;
  52368. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  52369. };
  52370. const parseByTimeline$1 = (attributes, segmentTimeline) => {
  52371. const {
  52372. type: type2,
  52373. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  52374. media = "",
  52375. sourceDuration,
  52376. timescale: timescale2 = 1,
  52377. startNumber: startNumber2 = 1,
  52378. periodStart: timeline
  52379. } = attributes;
  52380. const segments = [];
  52381. let time = -1;
  52382. for (let sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  52383. const S = segmentTimeline[sIndex];
  52384. const duration5 = S.d;
  52385. const repeat = S.r || 0;
  52386. const segmentTime = S.t || 0;
  52387. if (time < 0) {
  52388. time = segmentTime;
  52389. }
  52390. if (segmentTime && segmentTime > time) {
  52391. time = segmentTime;
  52392. }
  52393. let count;
  52394. if (repeat < 0) {
  52395. const nextS = sIndex + 1;
  52396. if (nextS === segmentTimeline.length) {
  52397. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  52398. count = getLiveRValue$1(attributes, time, duration5);
  52399. } else {
  52400. count = (sourceDuration * timescale2 - time) / duration5;
  52401. }
  52402. } else {
  52403. count = (segmentTimeline[nextS].t - time) / duration5;
  52404. }
  52405. } else {
  52406. count = repeat + 1;
  52407. }
  52408. const end = startNumber2 + segments.length + count;
  52409. let number = startNumber2 + segments.length;
  52410. while (number < end) {
  52411. segments.push({
  52412. number,
  52413. duration: duration5 / timescale2,
  52414. time,
  52415. timeline
  52416. });
  52417. time += duration5;
  52418. number++;
  52419. }
  52420. }
  52421. return segments;
  52422. };
  52423. const identifierPattern$1 = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  52424. const identifierReplacement$1 = (values3) => (match, identifier, format, width2) => {
  52425. if (match === "$$") {
  52426. return "$";
  52427. }
  52428. if (typeof values3[identifier] === "undefined") {
  52429. return match;
  52430. }
  52431. const value = "" + values3[identifier];
  52432. if (identifier === "RepresentationID") {
  52433. return value;
  52434. }
  52435. if (!format) {
  52436. width2 = 1;
  52437. } else {
  52438. width2 = parseInt(width2, 10);
  52439. }
  52440. if (value.length >= width2) {
  52441. return value;
  52442. }
  52443. return `${new Array(width2 - value.length + 1).join("0")}${value}`;
  52444. };
  52445. const constructTemplateUrl$1 = (url, values3) => url.replace(identifierPattern$1, identifierReplacement$1(values3));
  52446. const parseTemplateInfo$1 = (attributes, segmentTimeline) => {
  52447. if (!attributes.duration && !segmentTimeline) {
  52448. return [{
  52449. number: attributes.startNumber || 1,
  52450. duration: attributes.sourceDuration,
  52451. time: 0,
  52452. timeline: attributes.periodStart
  52453. }];
  52454. }
  52455. if (attributes.duration) {
  52456. return parseByDuration$1(attributes);
  52457. }
  52458. return parseByTimeline$1(attributes, segmentTimeline);
  52459. };
  52460. const segmentsFromTemplate$1 = (attributes, segmentTimeline) => {
  52461. const templateValues = {
  52462. RepresentationID: attributes.id,
  52463. Bandwidth: attributes.bandwidth || 0
  52464. };
  52465. const {
  52466. initialization = {
  52467. sourceURL: "",
  52468. range: ""
  52469. }
  52470. } = attributes;
  52471. const mapSegment = urlTypeToSegment$1({
  52472. baseUrl: attributes.baseUrl,
  52473. source: constructTemplateUrl$1(initialization.sourceURL, templateValues),
  52474. range: initialization.range
  52475. });
  52476. const segments = parseTemplateInfo$1(attributes, segmentTimeline);
  52477. return segments.map((segment) => {
  52478. templateValues.Number = segment.number;
  52479. templateValues.Time = segment.time;
  52480. const uri = constructTemplateUrl$1(attributes.media || "", templateValues);
  52481. const timescale2 = attributes.timescale || 1;
  52482. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52483. const presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  52484. const map = {
  52485. uri,
  52486. timeline: segment.timeline,
  52487. duration: segment.duration,
  52488. resolvedUri: resolveUrl$3(attributes.baseUrl || "", uri),
  52489. map: mapSegment,
  52490. number: segment.number,
  52491. presentationTime
  52492. };
  52493. return map;
  52494. });
  52495. };
  52496. const SegmentURLToSegmentObject$1 = (attributes, segmentUrl) => {
  52497. const {
  52498. baseUrl,
  52499. initialization = {}
  52500. } = attributes;
  52501. const initSegment = urlTypeToSegment$1({
  52502. baseUrl,
  52503. source: initialization.sourceURL,
  52504. range: initialization.range
  52505. });
  52506. const segment = urlTypeToSegment$1({
  52507. baseUrl,
  52508. source: segmentUrl.media,
  52509. range: segmentUrl.mediaRange
  52510. });
  52511. segment.map = initSegment;
  52512. return segment;
  52513. };
  52514. const segmentsFromList$1 = (attributes, segmentTimeline) => {
  52515. const {
  52516. duration: duration5,
  52517. segmentUrls = [],
  52518. periodStart
  52519. } = attributes;
  52520. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  52521. throw new Error(errors$1.SEGMENT_TIME_UNSPECIFIED);
  52522. }
  52523. const segmentUrlMap = segmentUrls.map((segmentUrlObject) => SegmentURLToSegmentObject$1(attributes, segmentUrlObject));
  52524. let segmentTimeInfo;
  52525. if (duration5) {
  52526. segmentTimeInfo = parseByDuration$1(attributes);
  52527. }
  52528. if (segmentTimeline) {
  52529. segmentTimeInfo = parseByTimeline$1(attributes, segmentTimeline);
  52530. }
  52531. const segments = segmentTimeInfo.map((segmentTime, index2) => {
  52532. if (segmentUrlMap[index2]) {
  52533. const segment = segmentUrlMap[index2];
  52534. const timescale2 = attributes.timescale || 1;
  52535. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52536. segment.timeline = segmentTime.timeline;
  52537. segment.duration = segmentTime.duration;
  52538. segment.number = segmentTime.number;
  52539. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  52540. return segment;
  52541. }
  52542. }).filter((segment) => segment);
  52543. return segments;
  52544. };
  52545. const generateSegments$1 = ({
  52546. attributes,
  52547. segmentInfo
  52548. }) => {
  52549. let segmentAttributes;
  52550. let segmentsFn;
  52551. if (segmentInfo.template) {
  52552. segmentsFn = segmentsFromTemplate$1;
  52553. segmentAttributes = merge$3(attributes, segmentInfo.template);
  52554. } else if (segmentInfo.base) {
  52555. segmentsFn = segmentsFromBase$1;
  52556. segmentAttributes = merge$3(attributes, segmentInfo.base);
  52557. } else if (segmentInfo.list) {
  52558. segmentsFn = segmentsFromList$1;
  52559. segmentAttributes = merge$3(attributes, segmentInfo.list);
  52560. }
  52561. const segmentsInfo = {
  52562. attributes
  52563. };
  52564. if (!segmentsFn) {
  52565. return segmentsInfo;
  52566. }
  52567. const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  52568. if (segmentAttributes.duration) {
  52569. const {
  52570. duration: duration5,
  52571. timescale: timescale2 = 1
  52572. } = segmentAttributes;
  52573. segmentAttributes.duration = duration5 / timescale2;
  52574. } else if (segments.length) {
  52575. segmentAttributes.duration = segments.reduce((max2, segment) => {
  52576. return Math.max(max2, Math.ceil(segment.duration));
  52577. }, 0);
  52578. } else {
  52579. segmentAttributes.duration = 0;
  52580. }
  52581. segmentsInfo.attributes = segmentAttributes;
  52582. segmentsInfo.segments = segments;
  52583. if (segmentInfo.base && segmentAttributes.indexRange) {
  52584. segmentsInfo.sidx = segments[0];
  52585. segmentsInfo.segments = [];
  52586. }
  52587. return segmentsInfo;
  52588. };
  52589. const toPlaylists$1 = (representations) => representations.map(generateSegments$1);
  52590. const findChildren$1 = (element, name) => from$1(element.childNodes).filter(({
  52591. tagName
  52592. }) => tagName === name);
  52593. const getContent$1 = (element) => element.textContent.trim();
  52594. const parseDivisionValue$1 = (value) => {
  52595. return parseFloat(value.split("/").reduce((prev, current) => prev / current));
  52596. };
  52597. const parseDuration$1 = (str) => {
  52598. const SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  52599. const SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  52600. const SECONDS_IN_DAY = 24 * 60 * 60;
  52601. const SECONDS_IN_HOUR = 60 * 60;
  52602. const SECONDS_IN_MIN = 60;
  52603. const durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  52604. const match = durationRegex.exec(str);
  52605. if (!match) {
  52606. return 0;
  52607. }
  52608. const [year, month, day, hour, minute, second] = match.slice(1);
  52609. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  52610. };
  52611. const parseDate$1 = (str) => {
  52612. const dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  52613. if (dateRegex.test(str)) {
  52614. str += "Z";
  52615. }
  52616. return Date.parse(str);
  52617. };
  52618. const parsers$1 = {
  52619. mediaPresentationDuration(value) {
  52620. return parseDuration$1(value);
  52621. },
  52622. availabilityStartTime(value) {
  52623. return parseDate$1(value) / 1e3;
  52624. },
  52625. minimumUpdatePeriod(value) {
  52626. return parseDuration$1(value);
  52627. },
  52628. suggestedPresentationDelay(value) {
  52629. return parseDuration$1(value);
  52630. },
  52631. type(value) {
  52632. return value;
  52633. },
  52634. timeShiftBufferDepth(value) {
  52635. return parseDuration$1(value);
  52636. },
  52637. start(value) {
  52638. return parseDuration$1(value);
  52639. },
  52640. width(value) {
  52641. return parseInt(value, 10);
  52642. },
  52643. height(value) {
  52644. return parseInt(value, 10);
  52645. },
  52646. bandwidth(value) {
  52647. return parseInt(value, 10);
  52648. },
  52649. frameRate(value) {
  52650. return parseDivisionValue$1(value);
  52651. },
  52652. startNumber(value) {
  52653. return parseInt(value, 10);
  52654. },
  52655. timescale(value) {
  52656. return parseInt(value, 10);
  52657. },
  52658. presentationTimeOffset(value) {
  52659. return parseInt(value, 10);
  52660. },
  52661. duration(value) {
  52662. const parsedValue = parseInt(value, 10);
  52663. if (isNaN(parsedValue)) {
  52664. return parseDuration$1(value);
  52665. }
  52666. return parsedValue;
  52667. },
  52668. d(value) {
  52669. return parseInt(value, 10);
  52670. },
  52671. t(value) {
  52672. return parseInt(value, 10);
  52673. },
  52674. r(value) {
  52675. return parseInt(value, 10);
  52676. },
  52677. presentationTime(value) {
  52678. return parseInt(value, 10);
  52679. },
  52680. DEFAULT(value) {
  52681. return value;
  52682. }
  52683. };
  52684. const parseAttributes$2 = (el) => {
  52685. if (!(el && el.attributes)) {
  52686. return {};
  52687. }
  52688. return from$1(el.attributes).reduce((a, e) => {
  52689. const parseFn = parsers$1[e.name] || parsers$1.DEFAULT;
  52690. a[e.name] = parseFn(e.value);
  52691. return a;
  52692. }, {});
  52693. };
  52694. const keySystemsMap$1 = {
  52695. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  52696. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  52697. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  52698. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  52699. };
  52700. const buildBaseUrls$1 = (referenceUrls, baseUrlElements) => {
  52701. if (!baseUrlElements.length) {
  52702. return referenceUrls;
  52703. }
  52704. return flatten$1(referenceUrls.map(function(reference) {
  52705. return baseUrlElements.map(function(baseUrlElement) {
  52706. return resolveUrl$3(reference, getContent$1(baseUrlElement));
  52707. });
  52708. }));
  52709. };
  52710. const getSegmentInformation$1 = (adaptationSet) => {
  52711. const segmentTemplate = findChildren$1(adaptationSet, "SegmentTemplate")[0];
  52712. const segmentList = findChildren$1(adaptationSet, "SegmentList")[0];
  52713. const segmentUrls = segmentList && findChildren$1(segmentList, "SegmentURL").map((s) => merge$3({
  52714. tag: "SegmentURL"
  52715. }, parseAttributes$2(s)));
  52716. const segmentBase = findChildren$1(adaptationSet, "SegmentBase")[0];
  52717. const segmentTimelineParentNode = segmentList || segmentTemplate;
  52718. const segmentTimeline = segmentTimelineParentNode && findChildren$1(segmentTimelineParentNode, "SegmentTimeline")[0];
  52719. const segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  52720. const segmentInitialization = segmentInitializationParentNode && findChildren$1(segmentInitializationParentNode, "Initialization")[0];
  52721. const template = segmentTemplate && parseAttributes$2(segmentTemplate);
  52722. if (template && segmentInitialization) {
  52723. template.initialization = segmentInitialization && parseAttributes$2(segmentInitialization);
  52724. } else if (template && template.initialization) {
  52725. template.initialization = {
  52726. sourceURL: template.initialization
  52727. };
  52728. }
  52729. const segmentInfo = {
  52730. template,
  52731. segmentTimeline: segmentTimeline && findChildren$1(segmentTimeline, "S").map((s) => parseAttributes$2(s)),
  52732. list: segmentList && merge$3(parseAttributes$2(segmentList), {
  52733. segmentUrls,
  52734. initialization: parseAttributes$2(segmentInitialization)
  52735. }),
  52736. base: segmentBase && merge$3(parseAttributes$2(segmentBase), {
  52737. initialization: parseAttributes$2(segmentInitialization)
  52738. })
  52739. };
  52740. Object.keys(segmentInfo).forEach((key) => {
  52741. if (!segmentInfo[key]) {
  52742. delete segmentInfo[key];
  52743. }
  52744. });
  52745. return segmentInfo;
  52746. };
  52747. const inheritBaseUrls$1 = (adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) => (representation) => {
  52748. const repBaseUrlElements = findChildren$1(representation, "BaseURL");
  52749. const repBaseUrls = buildBaseUrls$1(adaptationSetBaseUrls, repBaseUrlElements);
  52750. const attributes = merge$3(adaptationSetAttributes, parseAttributes$2(representation));
  52751. const representationSegmentInfo = getSegmentInformation$1(representation);
  52752. return repBaseUrls.map((baseUrl) => {
  52753. return {
  52754. segmentInfo: merge$3(adaptationSetSegmentInfo, representationSegmentInfo),
  52755. attributes: merge$3(attributes, {
  52756. baseUrl
  52757. })
  52758. };
  52759. });
  52760. };
  52761. const generateKeySystemInformation$1 = (contentProtectionNodes) => {
  52762. return contentProtectionNodes.reduce((acc, node) => {
  52763. const attributes = parseAttributes$2(node);
  52764. if (attributes.schemeIdUri) {
  52765. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  52766. }
  52767. const keySystem = keySystemsMap$1[attributes.schemeIdUri];
  52768. if (keySystem) {
  52769. acc[keySystem] = {
  52770. attributes
  52771. };
  52772. const psshNode = findChildren$1(node, "cenc:pssh")[0];
  52773. if (psshNode) {
  52774. const pssh = getContent$1(psshNode);
  52775. acc[keySystem].pssh = pssh && decodeB64ToUint8Array$1(pssh);
  52776. }
  52777. }
  52778. return acc;
  52779. }, {});
  52780. };
  52781. const parseCaptionServiceMetadata$1 = (service) => {
  52782. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  52783. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52784. return values3.map((value) => {
  52785. let channel;
  52786. let language;
  52787. language = value;
  52788. if (/^CC\d=/.test(value)) {
  52789. [channel, language] = value.split("=");
  52790. } else if (/^CC\d$/.test(value)) {
  52791. channel = value;
  52792. }
  52793. return {
  52794. channel,
  52795. language
  52796. };
  52797. });
  52798. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  52799. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52800. return values3.map((value) => {
  52801. const flags = {
  52802. "channel": void 0,
  52803. "language": void 0,
  52804. "aspectRatio": 1,
  52805. "easyReader": 0,
  52806. "3D": 0
  52807. };
  52808. if (/=/.test(value)) {
  52809. const [channel, opts = ""] = value.split("=");
  52810. flags.channel = channel;
  52811. flags.language = value;
  52812. opts.split(",").forEach((opt) => {
  52813. const [name, val] = opt.split(":");
  52814. if (name === "lang") {
  52815. flags.language = val;
  52816. } else if (name === "er") {
  52817. flags.easyReader = Number(val);
  52818. } else if (name === "war") {
  52819. flags.aspectRatio = Number(val);
  52820. } else if (name === "3D") {
  52821. flags["3D"] = Number(val);
  52822. }
  52823. });
  52824. } else {
  52825. flags.language = value;
  52826. }
  52827. if (flags.channel) {
  52828. flags.channel = "SERVICE" + flags.channel;
  52829. }
  52830. return flags;
  52831. });
  52832. }
  52833. };
  52834. const toEventStream = (period) => {
  52835. return flatten$1(findChildren$1(period.node, "EventStream").map((eventStream) => {
  52836. const eventStreamAttributes = parseAttributes$2(eventStream);
  52837. const schemeIdUri = eventStreamAttributes.schemeIdUri;
  52838. return findChildren$1(eventStream, "Event").map((event2) => {
  52839. const eventAttributes = parseAttributes$2(event2);
  52840. const presentationTime = eventAttributes.presentationTime || 0;
  52841. const timescale2 = eventStreamAttributes.timescale || 1;
  52842. const duration5 = eventAttributes.duration || 0;
  52843. const start2 = presentationTime / timescale2 + period.attributes.start;
  52844. return {
  52845. schemeIdUri,
  52846. value: eventStreamAttributes.value,
  52847. id: eventAttributes.id,
  52848. start: start2,
  52849. end: start2 + duration5 / timescale2,
  52850. messageData: getContent$1(event2) || eventAttributes.messageData,
  52851. contentEncoding: eventStreamAttributes.contentEncoding,
  52852. presentationTimeOffset: eventStreamAttributes.presentationTimeOffset || 0
  52853. };
  52854. });
  52855. }));
  52856. };
  52857. const toRepresentations$1 = (periodAttributes, periodBaseUrls, periodSegmentInfo) => (adaptationSet) => {
  52858. const adaptationSetAttributes = parseAttributes$2(adaptationSet);
  52859. const adaptationSetBaseUrls = buildBaseUrls$1(periodBaseUrls, findChildren$1(adaptationSet, "BaseURL"));
  52860. const role = findChildren$1(adaptationSet, "Role")[0];
  52861. const roleAttributes = {
  52862. role: parseAttributes$2(role)
  52863. };
  52864. let attrs = merge$3(periodAttributes, adaptationSetAttributes, roleAttributes);
  52865. const accessibility = findChildren$1(adaptationSet, "Accessibility")[0];
  52866. const captionServices = parseCaptionServiceMetadata$1(parseAttributes$2(accessibility));
  52867. if (captionServices) {
  52868. attrs = merge$3(attrs, {
  52869. captionServices
  52870. });
  52871. }
  52872. const label = findChildren$1(adaptationSet, "Label")[0];
  52873. if (label && label.childNodes.length) {
  52874. const labelVal = label.childNodes[0].nodeValue.trim();
  52875. attrs = merge$3(attrs, {
  52876. label: labelVal
  52877. });
  52878. }
  52879. const contentProtection = generateKeySystemInformation$1(findChildren$1(adaptationSet, "ContentProtection"));
  52880. if (Object.keys(contentProtection).length) {
  52881. attrs = merge$3(attrs, {
  52882. contentProtection
  52883. });
  52884. }
  52885. const segmentInfo = getSegmentInformation$1(adaptationSet);
  52886. const representations = findChildren$1(adaptationSet, "Representation");
  52887. const adaptationSetSegmentInfo = merge$3(periodSegmentInfo, segmentInfo);
  52888. return flatten$1(representations.map(inheritBaseUrls$1(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  52889. };
  52890. const toAdaptationSets$1 = (mpdAttributes, mpdBaseUrls) => (period, index2) => {
  52891. const periodBaseUrls = buildBaseUrls$1(mpdBaseUrls, findChildren$1(period.node, "BaseURL"));
  52892. const periodAttributes = merge$3(mpdAttributes, {
  52893. periodStart: period.attributes.start
  52894. });
  52895. if (typeof period.attributes.duration === "number") {
  52896. periodAttributes.periodDuration = period.attributes.duration;
  52897. }
  52898. const adaptationSets = findChildren$1(period.node, "AdaptationSet");
  52899. const periodSegmentInfo = getSegmentInformation$1(period.node);
  52900. return flatten$1(adaptationSets.map(toRepresentations$1(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  52901. };
  52902. const getPeriodStart$1 = ({
  52903. attributes,
  52904. priorPeriodAttributes,
  52905. mpdType
  52906. }) => {
  52907. if (typeof attributes.start === "number") {
  52908. return attributes.start;
  52909. }
  52910. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  52911. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  52912. }
  52913. if (!priorPeriodAttributes && mpdType === "static") {
  52914. return 0;
  52915. }
  52916. return null;
  52917. };
  52918. const inheritAttributes$1 = (mpd, options2 = {}) => {
  52919. const {
  52920. manifestUri = "",
  52921. NOW = Date.now(),
  52922. clientOffset = 0
  52923. } = options2;
  52924. const periodNodes = findChildren$1(mpd, "Period");
  52925. if (!periodNodes.length) {
  52926. throw new Error(errors$1.INVALID_NUMBER_OF_PERIOD);
  52927. }
  52928. const locations = findChildren$1(mpd, "Location");
  52929. const mpdAttributes = parseAttributes$2(mpd);
  52930. const mpdBaseUrls = buildBaseUrls$1([manifestUri], findChildren$1(mpd, "BaseURL"));
  52931. mpdAttributes.type = mpdAttributes.type || "static";
  52932. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  52933. mpdAttributes.NOW = NOW;
  52934. mpdAttributes.clientOffset = clientOffset;
  52935. if (locations.length) {
  52936. mpdAttributes.locations = locations.map(getContent$1);
  52937. }
  52938. const periods = [];
  52939. periodNodes.forEach((node, index2) => {
  52940. const attributes = parseAttributes$2(node);
  52941. const priorPeriod = periods[index2 - 1];
  52942. attributes.start = getPeriodStart$1({
  52943. attributes,
  52944. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  52945. mpdType: mpdAttributes.type
  52946. });
  52947. periods.push({
  52948. node,
  52949. attributes
  52950. });
  52951. });
  52952. return {
  52953. locations: mpdAttributes.locations,
  52954. representationInfo: flatten$1(periods.map(toAdaptationSets$1(mpdAttributes, mpdBaseUrls))),
  52955. eventStream: flatten$1(periods.map(toEventStream))
  52956. };
  52957. };
  52958. const stringToMpdXml$1 = (manifestString) => {
  52959. if (manifestString === "") {
  52960. throw new Error(errors$1.DASH_EMPTY_MANIFEST);
  52961. }
  52962. const parser2 = new DOMParser();
  52963. let xml;
  52964. let mpd;
  52965. try {
  52966. xml = parser2.parseFromString(manifestString, "application/xml");
  52967. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  52968. } catch (e) {
  52969. }
  52970. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  52971. throw new Error(errors$1.DASH_INVALID_XML);
  52972. }
  52973. return mpd;
  52974. };
  52975. const parseUTCTimingScheme$1 = (mpd) => {
  52976. const UTCTimingNode = findChildren$1(mpd, "UTCTiming")[0];
  52977. if (!UTCTimingNode) {
  52978. return null;
  52979. }
  52980. const attributes = parseAttributes$2(UTCTimingNode);
  52981. switch (attributes.schemeIdUri) {
  52982. case "urn:mpeg:dash:utc:http-head:2014":
  52983. case "urn:mpeg:dash:utc:http-head:2012":
  52984. attributes.method = "HEAD";
  52985. break;
  52986. case "urn:mpeg:dash:utc:http-xsdate:2014":
  52987. case "urn:mpeg:dash:utc:http-iso:2014":
  52988. case "urn:mpeg:dash:utc:http-xsdate:2012":
  52989. case "urn:mpeg:dash:utc:http-iso:2012":
  52990. attributes.method = "GET";
  52991. break;
  52992. case "urn:mpeg:dash:utc:direct:2014":
  52993. case "urn:mpeg:dash:utc:direct:2012":
  52994. attributes.method = "DIRECT";
  52995. attributes.value = Date.parse(attributes.value);
  52996. break;
  52997. case "urn:mpeg:dash:utc:http-ntp:2014":
  52998. case "urn:mpeg:dash:utc:ntp:2014":
  52999. case "urn:mpeg:dash:utc:sntp:2014":
  53000. default:
  53001. throw new Error(errors$1.UNSUPPORTED_UTC_TIMING_SCHEME);
  53002. }
  53003. return attributes;
  53004. };
  53005. const parse$1 = (manifestString, options2 = {}) => {
  53006. const parsedManifestInfo = inheritAttributes$1(stringToMpdXml$1(manifestString), options2);
  53007. const playlists = toPlaylists$1(parsedManifestInfo.representationInfo);
  53008. return toM3u8$1({
  53009. dashPlaylists: playlists,
  53010. locations: parsedManifestInfo.locations,
  53011. sidxMapping: options2.sidxMapping,
  53012. previousManifest: options2.previousManifest,
  53013. eventStream: parsedManifestInfo.eventStream
  53014. });
  53015. };
  53016. const parseUTCTiming$1 = (manifestString) => parseUTCTimingScheme$1(stringToMpdXml$1(manifestString));
  53017. var MAX_UINT32$1 = Math.pow(2, 32);
  53018. var getUint64$3 = function(uint8) {
  53019. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  53020. var value;
  53021. if (dv.getBigUint64) {
  53022. value = dv.getBigUint64(0);
  53023. if (value < Number.MAX_SAFE_INTEGER) {
  53024. return Number(value);
  53025. }
  53026. return value;
  53027. }
  53028. return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);
  53029. };
  53030. var numbers$1 = {
  53031. getUint64: getUint64$3,
  53032. MAX_UINT32: MAX_UINT32$1
  53033. };
  53034. var getUint64$2 = numbers$1.getUint64;
  53035. var parseSidx$1 = function(data) {
  53036. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  53037. version: data[0],
  53038. flags: new Uint8Array(data.subarray(1, 4)),
  53039. references: [],
  53040. referenceId: view.getUint32(4),
  53041. timescale: view.getUint32(8)
  53042. }, i2 = 12;
  53043. if (result.version === 0) {
  53044. result.earliestPresentationTime = view.getUint32(i2);
  53045. result.firstOffset = view.getUint32(i2 + 4);
  53046. i2 += 8;
  53047. } else {
  53048. result.earliestPresentationTime = getUint64$2(data.subarray(i2));
  53049. result.firstOffset = getUint64$2(data.subarray(i2 + 8));
  53050. i2 += 16;
  53051. }
  53052. i2 += 2;
  53053. var referenceCount = view.getUint16(i2);
  53054. i2 += 2;
  53055. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  53056. result.references.push({
  53057. referenceType: (data[i2] & 128) >>> 7,
  53058. referencedSize: view.getUint32(i2) & 2147483647,
  53059. subsegmentDuration: view.getUint32(i2 + 4),
  53060. startsWithSap: !!(data[i2 + 8] & 128),
  53061. sapType: (data[i2 + 8] & 112) >>> 4,
  53062. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  53063. });
  53064. }
  53065. return result;
  53066. };
  53067. var parseSidx_1$1 = parseSidx$1;
  53068. var ID3$1 = toUint8$1([73, 68, 51]);
  53069. var getId3Size$1 = function getId3Size(bytes, offset) {
  53070. if (offset === void 0) {
  53071. offset = 0;
  53072. }
  53073. bytes = toUint8$1(bytes);
  53074. var flags = bytes[offset + 5];
  53075. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  53076. var footerPresent = (flags & 16) >> 4;
  53077. if (footerPresent) {
  53078. return returnSize + 20;
  53079. }
  53080. return returnSize + 10;
  53081. };
  53082. var getId3Offset$1 = function getId3Offset(bytes, offset) {
  53083. if (offset === void 0) {
  53084. offset = 0;
  53085. }
  53086. bytes = toUint8$1(bytes);
  53087. if (bytes.length - offset < 10 || !bytesMatch$1(bytes, ID3$1, {
  53088. offset
  53089. })) {
  53090. return offset;
  53091. }
  53092. offset += getId3Size$1(bytes, offset);
  53093. return getId3Offset(bytes, offset);
  53094. };
  53095. var normalizePath$3 = function normalizePath(path) {
  53096. if (typeof path === "string") {
  53097. return stringToBytes$1(path);
  53098. }
  53099. if (typeof path === "number") {
  53100. return path;
  53101. }
  53102. return path;
  53103. };
  53104. var normalizePaths$3 = function normalizePaths(paths) {
  53105. if (!Array.isArray(paths)) {
  53106. return [normalizePath$3(paths)];
  53107. }
  53108. return paths.map(function(p) {
  53109. return normalizePath$3(p);
  53110. });
  53111. };
  53112. var findBox$1 = function findBox(bytes, paths, complete) {
  53113. if (complete === void 0) {
  53114. complete = false;
  53115. }
  53116. paths = normalizePaths$3(paths);
  53117. bytes = toUint8$1(bytes);
  53118. var results = [];
  53119. if (!paths.length) {
  53120. return results;
  53121. }
  53122. var i2 = 0;
  53123. while (i2 < bytes.length) {
  53124. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  53125. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  53126. if (size === 0) {
  53127. break;
  53128. }
  53129. var end = i2 + size;
  53130. if (end > bytes.length) {
  53131. if (complete) {
  53132. break;
  53133. }
  53134. end = bytes.length;
  53135. }
  53136. var data = bytes.subarray(i2 + 8, end);
  53137. if (bytesMatch$1(type2, paths[0])) {
  53138. if (paths.length === 1) {
  53139. results.push(data);
  53140. } else {
  53141. results.push.apply(results, findBox(data, paths.slice(1), complete));
  53142. }
  53143. }
  53144. i2 = end;
  53145. }
  53146. return results;
  53147. };
  53148. var EBML_TAGS$1 = {
  53149. EBML: toUint8$1([26, 69, 223, 163]),
  53150. DocType: toUint8$1([66, 130]),
  53151. Segment: toUint8$1([24, 83, 128, 103]),
  53152. SegmentInfo: toUint8$1([21, 73, 169, 102]),
  53153. Tracks: toUint8$1([22, 84, 174, 107]),
  53154. Track: toUint8$1([174]),
  53155. TrackNumber: toUint8$1([215]),
  53156. DefaultDuration: toUint8$1([35, 227, 131]),
  53157. TrackEntry: toUint8$1([174]),
  53158. TrackType: toUint8$1([131]),
  53159. FlagDefault: toUint8$1([136]),
  53160. CodecID: toUint8$1([134]),
  53161. CodecPrivate: toUint8$1([99, 162]),
  53162. VideoTrack: toUint8$1([224]),
  53163. AudioTrack: toUint8$1([225]),
  53164. Cluster: toUint8$1([31, 67, 182, 117]),
  53165. Timestamp: toUint8$1([231]),
  53166. TimestampScale: toUint8$1([42, 215, 177]),
  53167. BlockGroup: toUint8$1([160]),
  53168. BlockDuration: toUint8$1([155]),
  53169. Block: toUint8$1([161]),
  53170. SimpleBlock: toUint8$1([163])
  53171. };
  53172. var LENGTH_TABLE$1 = [128, 64, 32, 16, 8, 4, 2, 1];
  53173. var getLength$1 = function getLength(byte) {
  53174. var len = 1;
  53175. for (var i2 = 0; i2 < LENGTH_TABLE$1.length; i2++) {
  53176. if (byte & LENGTH_TABLE$1[i2]) {
  53177. break;
  53178. }
  53179. len++;
  53180. }
  53181. return len;
  53182. };
  53183. var getvint$1 = function getvint(bytes, offset, removeLength, signed) {
  53184. if (removeLength === void 0) {
  53185. removeLength = true;
  53186. }
  53187. if (signed === void 0) {
  53188. signed = false;
  53189. }
  53190. var length = getLength$1(bytes[offset]);
  53191. var valueBytes = bytes.subarray(offset, offset + length);
  53192. if (removeLength) {
  53193. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  53194. valueBytes[0] ^= LENGTH_TABLE$1[length - 1];
  53195. }
  53196. return {
  53197. length,
  53198. value: bytesToNumber$1(valueBytes, {
  53199. signed
  53200. }),
  53201. bytes: valueBytes
  53202. };
  53203. };
  53204. var normalizePath$2 = function normalizePath2(path) {
  53205. if (typeof path === "string") {
  53206. return path.match(/.{1,2}/g).map(function(p) {
  53207. return normalizePath2(p);
  53208. });
  53209. }
  53210. if (typeof path === "number") {
  53211. return numberToBytes$1(path);
  53212. }
  53213. return path;
  53214. };
  53215. var normalizePaths$2 = function normalizePaths2(paths) {
  53216. if (!Array.isArray(paths)) {
  53217. return [normalizePath$2(paths)];
  53218. }
  53219. return paths.map(function(p) {
  53220. return normalizePath$2(p);
  53221. });
  53222. };
  53223. var getInfinityDataSize$1 = function getInfinityDataSize(id, bytes, offset) {
  53224. if (offset >= bytes.length) {
  53225. return bytes.length;
  53226. }
  53227. var innerid = getvint$1(bytes, offset, false);
  53228. if (bytesMatch$1(id.bytes, innerid.bytes)) {
  53229. return offset;
  53230. }
  53231. var dataHeader = getvint$1(bytes, offset + innerid.length);
  53232. return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  53233. };
  53234. var findEbml$1 = function findEbml(bytes, paths) {
  53235. paths = normalizePaths$2(paths);
  53236. bytes = toUint8$1(bytes);
  53237. var results = [];
  53238. if (!paths.length) {
  53239. return results;
  53240. }
  53241. var i2 = 0;
  53242. while (i2 < bytes.length) {
  53243. var id = getvint$1(bytes, i2, false);
  53244. var dataHeader = getvint$1(bytes, i2 + id.length);
  53245. var dataStart = i2 + id.length + dataHeader.length;
  53246. if (dataHeader.value === 127) {
  53247. dataHeader.value = getInfinityDataSize$1(id, bytes, dataStart);
  53248. if (dataHeader.value !== bytes.length) {
  53249. dataHeader.value -= dataStart;
  53250. }
  53251. }
  53252. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  53253. var data = bytes.subarray(dataStart, dataEnd);
  53254. if (bytesMatch$1(paths[0], id.bytes)) {
  53255. if (paths.length === 1) {
  53256. results.push(data);
  53257. } else {
  53258. results = results.concat(findEbml(data, paths.slice(1)));
  53259. }
  53260. }
  53261. var totalLength = id.length + dataHeader.length + data.length;
  53262. i2 += totalLength;
  53263. }
  53264. return results;
  53265. };
  53266. var NAL_TYPE_ONE$1 = toUint8$1([0, 0, 0, 1]);
  53267. var NAL_TYPE_TWO$1 = toUint8$1([0, 0, 1]);
  53268. var EMULATION_PREVENTION$1 = toUint8$1([0, 0, 3]);
  53269. var discardEmulationPreventionBytes$1 = function discardEmulationPreventionBytes(bytes) {
  53270. var positions = [];
  53271. var i2 = 1;
  53272. while (i2 < bytes.length - 2) {
  53273. if (bytesMatch$1(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION$1)) {
  53274. positions.push(i2 + 2);
  53275. i2++;
  53276. }
  53277. i2++;
  53278. }
  53279. if (positions.length === 0) {
  53280. return bytes;
  53281. }
  53282. var newLength = bytes.length - positions.length;
  53283. var newData = new Uint8Array(newLength);
  53284. var sourceIndex = 0;
  53285. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  53286. if (sourceIndex === positions[0]) {
  53287. sourceIndex++;
  53288. positions.shift();
  53289. }
  53290. newData[i2] = bytes[sourceIndex];
  53291. }
  53292. return newData;
  53293. };
  53294. var findNal$1 = function findNal(bytes, dataType, types, nalLimit) {
  53295. if (nalLimit === void 0) {
  53296. nalLimit = Infinity;
  53297. }
  53298. bytes = toUint8$1(bytes);
  53299. types = [].concat(types);
  53300. var i2 = 0;
  53301. var nalStart;
  53302. var nalsFound = 0;
  53303. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  53304. var nalOffset = void 0;
  53305. if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_ONE$1)) {
  53306. nalOffset = 4;
  53307. } else if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_TWO$1)) {
  53308. nalOffset = 3;
  53309. }
  53310. if (!nalOffset) {
  53311. i2++;
  53312. continue;
  53313. }
  53314. nalsFound++;
  53315. if (nalStart) {
  53316. return discardEmulationPreventionBytes$1(bytes.subarray(nalStart, i2));
  53317. }
  53318. var nalType = void 0;
  53319. if (dataType === "h264") {
  53320. nalType = bytes[i2 + nalOffset] & 31;
  53321. } else if (dataType === "h265") {
  53322. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  53323. }
  53324. if (types.indexOf(nalType) !== -1) {
  53325. nalStart = i2 + nalOffset;
  53326. }
  53327. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  53328. }
  53329. return bytes.subarray(0, 0);
  53330. };
  53331. var findH264Nal$1 = function findH264Nal(bytes, type2, nalLimit) {
  53332. return findNal$1(bytes, "h264", type2, nalLimit);
  53333. };
  53334. var findH265Nal$1 = function findH265Nal(bytes, type2, nalLimit) {
  53335. return findNal$1(bytes, "h265", type2, nalLimit);
  53336. };
  53337. var CONSTANTS$1 = {
  53338. "webm": toUint8$1([119, 101, 98, 109]),
  53339. "matroska": toUint8$1([109, 97, 116, 114, 111, 115, 107, 97]),
  53340. "flac": toUint8$1([102, 76, 97, 67]),
  53341. "ogg": toUint8$1([79, 103, 103, 83]),
  53342. "ac3": toUint8$1([11, 119]),
  53343. "riff": toUint8$1([82, 73, 70, 70]),
  53344. "avi": toUint8$1([65, 86, 73]),
  53345. "wav": toUint8$1([87, 65, 86, 69]),
  53346. "3gp": toUint8$1([102, 116, 121, 112, 51, 103]),
  53347. "mp4": toUint8$1([102, 116, 121, 112]),
  53348. "fmp4": toUint8$1([115, 116, 121, 112]),
  53349. "mov": toUint8$1([102, 116, 121, 112, 113, 116]),
  53350. "moov": toUint8$1([109, 111, 111, 118]),
  53351. "moof": toUint8$1([109, 111, 111, 102])
  53352. };
  53353. var _isLikely$1 = {
  53354. aac: function aac(bytes) {
  53355. var offset = getId3Offset$1(bytes);
  53356. return bytesMatch$1(bytes, [255, 16], {
  53357. offset,
  53358. mask: [255, 22]
  53359. });
  53360. },
  53361. mp3: function mp3(bytes) {
  53362. var offset = getId3Offset$1(bytes);
  53363. return bytesMatch$1(bytes, [255, 2], {
  53364. offset,
  53365. mask: [255, 6]
  53366. });
  53367. },
  53368. webm: function webm(bytes) {
  53369. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53370. return bytesMatch$1(docType, CONSTANTS$1.webm);
  53371. },
  53372. mkv: function mkv(bytes) {
  53373. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53374. return bytesMatch$1(docType, CONSTANTS$1.matroska);
  53375. },
  53376. mp4: function mp4(bytes) {
  53377. if (_isLikely$1["3gp"](bytes) || _isLikely$1.mov(bytes)) {
  53378. return false;
  53379. }
  53380. if (bytesMatch$1(bytes, CONSTANTS$1.mp4, {
  53381. offset: 4
  53382. }) || bytesMatch$1(bytes, CONSTANTS$1.fmp4, {
  53383. offset: 4
  53384. })) {
  53385. return true;
  53386. }
  53387. if (bytesMatch$1(bytes, CONSTANTS$1.moof, {
  53388. offset: 4
  53389. }) || bytesMatch$1(bytes, CONSTANTS$1.moov, {
  53390. offset: 4
  53391. })) {
  53392. return true;
  53393. }
  53394. },
  53395. mov: function mov(bytes) {
  53396. return bytesMatch$1(bytes, CONSTANTS$1.mov, {
  53397. offset: 4
  53398. });
  53399. },
  53400. "3gp": function gp(bytes) {
  53401. return bytesMatch$1(bytes, CONSTANTS$1["3gp"], {
  53402. offset: 4
  53403. });
  53404. },
  53405. ac3: function ac3(bytes) {
  53406. var offset = getId3Offset$1(bytes);
  53407. return bytesMatch$1(bytes, CONSTANTS$1.ac3, {
  53408. offset
  53409. });
  53410. },
  53411. ts: function ts(bytes) {
  53412. if (bytes.length < 189 && bytes.length >= 1) {
  53413. return bytes[0] === 71;
  53414. }
  53415. var i2 = 0;
  53416. while (i2 + 188 < bytes.length && i2 < 188) {
  53417. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  53418. return true;
  53419. }
  53420. i2 += 1;
  53421. }
  53422. return false;
  53423. },
  53424. flac: function flac(bytes) {
  53425. var offset = getId3Offset$1(bytes);
  53426. return bytesMatch$1(bytes, CONSTANTS$1.flac, {
  53427. offset
  53428. });
  53429. },
  53430. ogg: function ogg(bytes) {
  53431. return bytesMatch$1(bytes, CONSTANTS$1.ogg);
  53432. },
  53433. avi: function avi(bytes) {
  53434. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.avi, {
  53435. offset: 8
  53436. });
  53437. },
  53438. wav: function wav(bytes) {
  53439. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.wav, {
  53440. offset: 8
  53441. });
  53442. },
  53443. "h264": function h264(bytes) {
  53444. return findH264Nal$1(bytes, 7, 3).length;
  53445. },
  53446. "h265": function h265(bytes) {
  53447. return findH265Nal$1(bytes, [32, 33], 3).length;
  53448. }
  53449. };
  53450. var isLikelyTypes$1 = Object.keys(_isLikely$1).filter(function(t2) {
  53451. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  53452. }).concat(["ts", "h264", "h265"]);
  53453. isLikelyTypes$1.forEach(function(type2) {
  53454. var isLikelyFn = _isLikely$1[type2];
  53455. _isLikely$1[type2] = function(bytes) {
  53456. return isLikelyFn(toUint8$1(bytes));
  53457. };
  53458. });
  53459. var isLikely$1 = _isLikely$1;
  53460. var detectContainerForBytes$1 = function detectContainerForBytes(bytes) {
  53461. bytes = toUint8$1(bytes);
  53462. for (var i2 = 0; i2 < isLikelyTypes$1.length; i2++) {
  53463. var type2 = isLikelyTypes$1[i2];
  53464. if (isLikely$1[type2](bytes)) {
  53465. return type2;
  53466. }
  53467. }
  53468. return "";
  53469. };
  53470. var isLikelyFmp4MediaSegment$1 = function isLikelyFmp4MediaSegment(bytes) {
  53471. return findBox$1(bytes, ["moof"]).length > 0;
  53472. };
  53473. var ONE_SECOND_IN_TS$1 = 9e4, secondsToVideoTs$1, secondsToAudioTs$1, videoTsToSeconds$1, audioTsToSeconds$1, audioTsToVideoTs$1, videoTsToAudioTs$1, metadataTsToSeconds$1;
  53474. secondsToVideoTs$1 = function(seconds) {
  53475. return seconds * ONE_SECOND_IN_TS$1;
  53476. };
  53477. secondsToAudioTs$1 = function(seconds, sampleRate) {
  53478. return seconds * sampleRate;
  53479. };
  53480. videoTsToSeconds$1 = function(timestamp) {
  53481. return timestamp / ONE_SECOND_IN_TS$1;
  53482. };
  53483. audioTsToSeconds$1 = function(timestamp, sampleRate) {
  53484. return timestamp / sampleRate;
  53485. };
  53486. audioTsToVideoTs$1 = function(timestamp, sampleRate) {
  53487. return secondsToVideoTs$1(audioTsToSeconds$1(timestamp, sampleRate));
  53488. };
  53489. videoTsToAudioTs$1 = function(timestamp, sampleRate) {
  53490. return secondsToAudioTs$1(videoTsToSeconds$1(timestamp), sampleRate);
  53491. };
  53492. metadataTsToSeconds$1 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  53493. return videoTsToSeconds$1(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  53494. };
  53495. var clock$1 = {
  53496. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$1,
  53497. secondsToVideoTs: secondsToVideoTs$1,
  53498. secondsToAudioTs: secondsToAudioTs$1,
  53499. videoTsToSeconds: videoTsToSeconds$1,
  53500. audioTsToSeconds: audioTsToSeconds$1,
  53501. audioTsToVideoTs: audioTsToVideoTs$1,
  53502. videoTsToAudioTs: videoTsToAudioTs$1,
  53503. metadataTsToSeconds: metadataTsToSeconds$1
  53504. };
  53505. /**
  53506. * @license
  53507. * Video.js 8.3.0 <http://videojs.com/>
  53508. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  53509. * Available under Apache License Version 2.0
  53510. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  53511. *
  53512. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  53513. * Available under Apache License Version 2.0
  53514. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  53515. */
  53516. var version$6$1 = "8.3.0";
  53517. const hooks_$1 = {};
  53518. const hooks$1 = function(type2, fn2) {
  53519. hooks_$1[type2] = hooks_$1[type2] || [];
  53520. if (fn2) {
  53521. hooks_$1[type2] = hooks_$1[type2].concat(fn2);
  53522. }
  53523. return hooks_$1[type2];
  53524. };
  53525. const hook$1 = function(type2, fn2) {
  53526. hooks$1(type2, fn2);
  53527. };
  53528. const removeHook$1 = function(type2, fn2) {
  53529. const index2 = hooks$1(type2).indexOf(fn2);
  53530. if (index2 <= -1) {
  53531. return false;
  53532. }
  53533. hooks_$1[type2] = hooks_$1[type2].slice();
  53534. hooks_$1[type2].splice(index2, 1);
  53535. return true;
  53536. };
  53537. const hookOnce$1 = function(type2, fn2) {
  53538. hooks$1(type2, [].concat(fn2).map((original) => {
  53539. const wrapper = (...args) => {
  53540. removeHook$1(type2, wrapper);
  53541. return original(...args);
  53542. };
  53543. return wrapper;
  53544. }));
  53545. };
  53546. const FullscreenApi$1 = {
  53547. prefixed: true
  53548. };
  53549. const apiMap$1 = [
  53550. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  53551. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  53552. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  53553. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  53554. ];
  53555. const specApi$1 = apiMap$1[0];
  53556. let browserApi$1;
  53557. for (let i2 = 0; i2 < apiMap$1.length; i2++) {
  53558. if (apiMap$1[i2][1] in document_1) {
  53559. browserApi$1 = apiMap$1[i2];
  53560. break;
  53561. }
  53562. }
  53563. if (browserApi$1) {
  53564. for (let i2 = 0; i2 < browserApi$1.length; i2++) {
  53565. FullscreenApi$1[specApi$1[i2]] = browserApi$1[i2];
  53566. }
  53567. FullscreenApi$1.prefixed = browserApi$1[0] !== specApi$1[0];
  53568. }
  53569. let history$1 = [];
  53570. const LogByTypeFactory$1 = (name, log2) => (type2, level, args) => {
  53571. const lvl = log2.levels[level];
  53572. const lvlRegExp = new RegExp(`^(${lvl})$`);
  53573. if (type2 !== "log") {
  53574. args.unshift(type2.toUpperCase() + ":");
  53575. }
  53576. args.unshift(name + ":");
  53577. if (history$1) {
  53578. history$1.push([].concat(args));
  53579. const splice2 = history$1.length - 1e3;
  53580. history$1.splice(0, splice2 > 0 ? splice2 : 0);
  53581. }
  53582. if (!window_1.console) {
  53583. return;
  53584. }
  53585. let fn2 = window_1.console[type2];
  53586. if (!fn2 && type2 === "debug") {
  53587. fn2 = window_1.console.info || window_1.console.log;
  53588. }
  53589. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  53590. return;
  53591. }
  53592. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  53593. };
  53594. function createLogger$1$1(name) {
  53595. let level = "info";
  53596. let logByType;
  53597. const log2 = function(...args) {
  53598. logByType("log", level, args);
  53599. };
  53600. logByType = LogByTypeFactory$1(name, log2);
  53601. log2.createLogger = (subname) => createLogger$1$1(name + ": " + subname);
  53602. log2.levels = {
  53603. all: "debug|log|warn|error",
  53604. off: "",
  53605. debug: "debug|log|warn|error",
  53606. info: "log|warn|error",
  53607. warn: "warn|error",
  53608. error: "error",
  53609. DEFAULT: level
  53610. };
  53611. log2.level = (lvl) => {
  53612. if (typeof lvl === "string") {
  53613. if (!log2.levels.hasOwnProperty(lvl)) {
  53614. throw new Error(`"${lvl}" in not a valid log level`);
  53615. }
  53616. level = lvl;
  53617. }
  53618. return level;
  53619. };
  53620. log2.history = () => history$1 ? [].concat(history$1) : [];
  53621. log2.history.filter = (fname) => {
  53622. return (history$1 || []).filter((historyItem) => {
  53623. return new RegExp(`.*${fname}.*`).test(historyItem[0]);
  53624. });
  53625. };
  53626. log2.history.clear = () => {
  53627. if (history$1) {
  53628. history$1.length = 0;
  53629. }
  53630. };
  53631. log2.history.disable = () => {
  53632. if (history$1 !== null) {
  53633. history$1.length = 0;
  53634. history$1 = null;
  53635. }
  53636. };
  53637. log2.history.enable = () => {
  53638. if (history$1 === null) {
  53639. history$1 = [];
  53640. }
  53641. };
  53642. log2.error = (...args) => logByType("error", level, args);
  53643. log2.warn = (...args) => logByType("warn", level, args);
  53644. log2.debug = (...args) => logByType("debug", level, args);
  53645. return log2;
  53646. }
  53647. const log$1$1 = createLogger$1$1("VIDEOJS");
  53648. const createLogger$2 = log$1$1.createLogger;
  53649. const toString$1 = Object.prototype.toString;
  53650. const keys$1 = function(object) {
  53651. return isObject$2(object) ? Object.keys(object) : [];
  53652. };
  53653. function each$1(object, fn2) {
  53654. keys$1(object).forEach((key) => fn2(object[key], key));
  53655. }
  53656. function reduce$1(object, fn2, initial = 0) {
  53657. return keys$1(object).reduce((accum, key) => fn2(accum, object[key], key), initial);
  53658. }
  53659. function isObject$2(value) {
  53660. return !!value && typeof value === "object";
  53661. }
  53662. function isPlain$1(value) {
  53663. return isObject$2(value) && toString$1.call(value) === "[object Object]" && value.constructor === Object;
  53664. }
  53665. function merge$1(...sources) {
  53666. const result = {};
  53667. sources.forEach((source) => {
  53668. if (!source) {
  53669. return;
  53670. }
  53671. each$1(source, (value, key) => {
  53672. if (!isPlain$1(value)) {
  53673. result[key] = value;
  53674. return;
  53675. }
  53676. if (!isPlain$1(result[key])) {
  53677. result[key] = {};
  53678. }
  53679. result[key] = merge$1(result[key], value);
  53680. });
  53681. });
  53682. return result;
  53683. }
  53684. function defineLazyProperty$1(obj, key, getValue2, setter = true) {
  53685. const set4 = (value) => Object.defineProperty(obj, key, {
  53686. value,
  53687. enumerable: true,
  53688. writable: true
  53689. });
  53690. const options2 = {
  53691. configurable: true,
  53692. enumerable: true,
  53693. get() {
  53694. const value = getValue2();
  53695. set4(value);
  53696. return value;
  53697. }
  53698. };
  53699. if (setter) {
  53700. options2.set = set4;
  53701. }
  53702. return Object.defineProperty(obj, key, options2);
  53703. }
  53704. var Obj = /* @__PURE__ */ Object.freeze({
  53705. __proto__: null,
  53706. each: each$1,
  53707. reduce: reduce$1,
  53708. isObject: isObject$2,
  53709. isPlain: isPlain$1,
  53710. merge: merge$1,
  53711. defineLazyProperty: defineLazyProperty$1
  53712. });
  53713. let IS_IPOD$1 = false;
  53714. let IOS_VERSION$1 = null;
  53715. let IS_ANDROID$1 = false;
  53716. let ANDROID_VERSION$1;
  53717. let IS_FIREFOX$1 = false;
  53718. let IS_EDGE$1 = false;
  53719. let IS_CHROMIUM = false;
  53720. let IS_CHROME$1 = false;
  53721. let CHROMIUM_VERSION = null;
  53722. let CHROME_VERSION$1 = null;
  53723. let IE_VERSION$1 = null;
  53724. let IS_SAFARI$1 = false;
  53725. let IS_WINDOWS$1 = false;
  53726. let IS_IPAD$1 = false;
  53727. let IS_IPHONE$1 = false;
  53728. const TOUCH_ENABLED$1 = Boolean(isReal$1() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  53729. const UAD = window_1.navigator && window_1.navigator.userAgentData;
  53730. if (UAD) {
  53731. IS_ANDROID$1 = UAD.platform === "Android";
  53732. IS_EDGE$1 = Boolean(UAD.brands.find((b) => b.brand === "Microsoft Edge"));
  53733. IS_CHROMIUM = Boolean(UAD.brands.find((b) => b.brand === "Chromium"));
  53734. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53735. CHROMIUM_VERSION = CHROME_VERSION$1 = (UAD.brands.find((b) => b.brand === "Chromium") || {}).version || null;
  53736. IS_WINDOWS$1 = UAD.platform === "Windows";
  53737. }
  53738. if (!IS_CHROMIUM) {
  53739. const USER_AGENT2 = window_1.navigator && window_1.navigator.userAgent || "";
  53740. IS_IPOD$1 = /iPod/i.test(USER_AGENT2);
  53741. IOS_VERSION$1 = function() {
  53742. const match = USER_AGENT2.match(/OS (\d+)_/i);
  53743. if (match && match[1]) {
  53744. return match[1];
  53745. }
  53746. return null;
  53747. }();
  53748. IS_ANDROID$1 = /Android/i.test(USER_AGENT2);
  53749. ANDROID_VERSION$1 = function() {
  53750. const match = USER_AGENT2.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  53751. if (!match) {
  53752. return null;
  53753. }
  53754. const major = match[1] && parseFloat(match[1]);
  53755. const minor = match[2] && parseFloat(match[2]);
  53756. if (major && minor) {
  53757. return parseFloat(match[1] + "." + match[2]);
  53758. } else if (major) {
  53759. return major;
  53760. }
  53761. return null;
  53762. }();
  53763. IS_FIREFOX$1 = /Firefox/i.test(USER_AGENT2);
  53764. IS_EDGE$1 = /Edg/i.test(USER_AGENT2);
  53765. IS_CHROMIUM = /Chrome/i.test(USER_AGENT2) || /CriOS/i.test(USER_AGENT2);
  53766. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53767. CHROMIUM_VERSION = CHROME_VERSION$1 = function() {
  53768. const match = USER_AGENT2.match(/(Chrome|CriOS)\/(\d+)/);
  53769. if (match && match[2]) {
  53770. return parseFloat(match[2]);
  53771. }
  53772. return null;
  53773. }();
  53774. IE_VERSION$1 = function() {
  53775. const result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT2);
  53776. let version2 = result && parseFloat(result[1]);
  53777. if (!version2 && /Trident\/7.0/i.test(USER_AGENT2) && /rv:11.0/.test(USER_AGENT2)) {
  53778. version2 = 11;
  53779. }
  53780. return version2;
  53781. }();
  53782. IS_SAFARI$1 = /Safari/i.test(USER_AGENT2) && !IS_CHROME$1 && !IS_ANDROID$1 && !IS_EDGE$1;
  53783. IS_WINDOWS$1 = /Windows/i.test(USER_AGENT2);
  53784. IS_IPAD$1 = /iPad/i.test(USER_AGENT2) || IS_SAFARI$1 && TOUCH_ENABLED$1 && !/iPhone/i.test(USER_AGENT2);
  53785. IS_IPHONE$1 = /iPhone/i.test(USER_AGENT2) && !IS_IPAD$1;
  53786. }
  53787. const IS_IOS$1 = IS_IPHONE$1 || IS_IPAD$1 || IS_IPOD$1;
  53788. const IS_ANY_SAFARI$1 = (IS_SAFARI$1 || IS_IOS$1) && !IS_CHROME$1;
  53789. var browser$1 = /* @__PURE__ */ Object.freeze({
  53790. __proto__: null,
  53791. get IS_IPOD() {
  53792. return IS_IPOD$1;
  53793. },
  53794. get IOS_VERSION() {
  53795. return IOS_VERSION$1;
  53796. },
  53797. get IS_ANDROID() {
  53798. return IS_ANDROID$1;
  53799. },
  53800. get ANDROID_VERSION() {
  53801. return ANDROID_VERSION$1;
  53802. },
  53803. get IS_FIREFOX() {
  53804. return IS_FIREFOX$1;
  53805. },
  53806. get IS_EDGE() {
  53807. return IS_EDGE$1;
  53808. },
  53809. get IS_CHROMIUM() {
  53810. return IS_CHROMIUM;
  53811. },
  53812. get IS_CHROME() {
  53813. return IS_CHROME$1;
  53814. },
  53815. get CHROMIUM_VERSION() {
  53816. return CHROMIUM_VERSION;
  53817. },
  53818. get CHROME_VERSION() {
  53819. return CHROME_VERSION$1;
  53820. },
  53821. get IE_VERSION() {
  53822. return IE_VERSION$1;
  53823. },
  53824. get IS_SAFARI() {
  53825. return IS_SAFARI$1;
  53826. },
  53827. get IS_WINDOWS() {
  53828. return IS_WINDOWS$1;
  53829. },
  53830. get IS_IPAD() {
  53831. return IS_IPAD$1;
  53832. },
  53833. get IS_IPHONE() {
  53834. return IS_IPHONE$1;
  53835. },
  53836. TOUCH_ENABLED: TOUCH_ENABLED$1,
  53837. IS_IOS: IS_IOS$1,
  53838. IS_ANY_SAFARI: IS_ANY_SAFARI$1
  53839. });
  53840. function isNonBlankString$1(str) {
  53841. return typeof str === "string" && Boolean(str.trim());
  53842. }
  53843. function throwIfWhitespace$1(str) {
  53844. if (str.indexOf(" ") >= 0) {
  53845. throw new Error("class has illegal whitespace characters");
  53846. }
  53847. }
  53848. function isReal$1() {
  53849. return document_1 === window_1.document;
  53850. }
  53851. function isEl$1(value) {
  53852. return isObject$2(value) && value.nodeType === 1;
  53853. }
  53854. function isInFrame$1() {
  53855. try {
  53856. return window_1.parent !== window_1.self;
  53857. } catch (x) {
  53858. return true;
  53859. }
  53860. }
  53861. function createQuerier$1(method) {
  53862. return function(selector, context) {
  53863. if (!isNonBlankString$1(selector)) {
  53864. return document_1[method](null);
  53865. }
  53866. if (isNonBlankString$1(context)) {
  53867. context = document_1.querySelector(context);
  53868. }
  53869. const ctx = isEl$1(context) ? context : document_1;
  53870. return ctx[method] && ctx[method](selector);
  53871. };
  53872. }
  53873. function createEl$1(tagName = "div", properties = {}, attributes = {}, content) {
  53874. const el = document_1.createElement(tagName);
  53875. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  53876. const val = properties[propName];
  53877. if (propName === "textContent") {
  53878. textContent$1(el, val);
  53879. } else if (el[propName] !== val || propName === "tabIndex") {
  53880. el[propName] = val;
  53881. }
  53882. });
  53883. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53884. el.setAttribute(attrName, attributes[attrName]);
  53885. });
  53886. if (content) {
  53887. appendContent$1(el, content);
  53888. }
  53889. return el;
  53890. }
  53891. function textContent$1(el, text) {
  53892. if (typeof el.textContent === "undefined") {
  53893. el.innerText = text;
  53894. } else {
  53895. el.textContent = text;
  53896. }
  53897. return el;
  53898. }
  53899. function prependTo$1(child, parent) {
  53900. if (parent.firstChild) {
  53901. parent.insertBefore(child, parent.firstChild);
  53902. } else {
  53903. parent.appendChild(child);
  53904. }
  53905. }
  53906. function hasClass$1(element, classToCheck) {
  53907. throwIfWhitespace$1(classToCheck);
  53908. return element.classList.contains(classToCheck);
  53909. }
  53910. function addClass$1(element, ...classesToAdd) {
  53911. element.classList.add(...classesToAdd.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53912. return element;
  53913. }
  53914. function removeClass$1(element, ...classesToRemove) {
  53915. if (!element) {
  53916. log$1$1.warn("removeClass was called with an element that doesn't exist");
  53917. return null;
  53918. }
  53919. element.classList.remove(...classesToRemove.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53920. return element;
  53921. }
  53922. function toggleClass$1(element, classToToggle, predicate) {
  53923. if (typeof predicate === "function") {
  53924. predicate = predicate(element, classToToggle);
  53925. }
  53926. if (typeof predicate !== "boolean") {
  53927. predicate = void 0;
  53928. }
  53929. classToToggle.split(/\s+/).forEach((className) => element.classList.toggle(className, predicate));
  53930. return element;
  53931. }
  53932. function setAttributes$1(el, attributes) {
  53933. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53934. const attrValue = attributes[attrName];
  53935. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  53936. el.removeAttribute(attrName);
  53937. } else {
  53938. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  53939. }
  53940. });
  53941. }
  53942. function getAttributes$1(tag) {
  53943. const obj = {};
  53944. const knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  53945. if (tag && tag.attributes && tag.attributes.length > 0) {
  53946. const attrs = tag.attributes;
  53947. for (let i2 = attrs.length - 1; i2 >= 0; i2--) {
  53948. const attrName = attrs[i2].name;
  53949. let attrVal = attrs[i2].value;
  53950. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  53951. attrVal = attrVal !== null ? true : false;
  53952. }
  53953. obj[attrName] = attrVal;
  53954. }
  53955. }
  53956. return obj;
  53957. }
  53958. function getAttribute$1(el, attribute) {
  53959. return el.getAttribute(attribute);
  53960. }
  53961. function setAttribute$1(el, attribute, value) {
  53962. el.setAttribute(attribute, value);
  53963. }
  53964. function removeAttribute$1(el, attribute) {
  53965. el.removeAttribute(attribute);
  53966. }
  53967. function blockTextSelection$1() {
  53968. document_1.body.focus();
  53969. document_1.onselectstart = function() {
  53970. return false;
  53971. };
  53972. }
  53973. function unblockTextSelection$1() {
  53974. document_1.onselectstart = function() {
  53975. return true;
  53976. };
  53977. }
  53978. function getBoundingClientRect$1(el) {
  53979. if (el && el.getBoundingClientRect && el.parentNode) {
  53980. const rect = el.getBoundingClientRect();
  53981. const result = {};
  53982. ["bottom", "height", "left", "right", "top", "width"].forEach((k) => {
  53983. if (rect[k] !== void 0) {
  53984. result[k] = rect[k];
  53985. }
  53986. });
  53987. if (!result.height) {
  53988. result.height = parseFloat(computedStyle$1(el, "height"));
  53989. }
  53990. if (!result.width) {
  53991. result.width = parseFloat(computedStyle$1(el, "width"));
  53992. }
  53993. return result;
  53994. }
  53995. }
  53996. function findPosition$1(el) {
  53997. if (!el || el && !el.offsetParent) {
  53998. return {
  53999. left: 0,
  54000. top: 0,
  54001. width: 0,
  54002. height: 0
  54003. };
  54004. }
  54005. const width2 = el.offsetWidth;
  54006. const height2 = el.offsetHeight;
  54007. let left = 0;
  54008. let top = 0;
  54009. while (el.offsetParent && el !== document_1[FullscreenApi$1.fullscreenElement]) {
  54010. left += el.offsetLeft;
  54011. top += el.offsetTop;
  54012. el = el.offsetParent;
  54013. }
  54014. return {
  54015. left,
  54016. top,
  54017. width: width2,
  54018. height: height2
  54019. };
  54020. }
  54021. function getPointerPosition$1(el, event2) {
  54022. const translated = {
  54023. x: 0,
  54024. y: 0
  54025. };
  54026. if (IS_IOS$1) {
  54027. let item = el;
  54028. while (item && item.nodeName.toLowerCase() !== "html") {
  54029. const transform3 = computedStyle$1(item, "transform");
  54030. if (/^matrix/.test(transform3)) {
  54031. const values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  54032. translated.x += values3[4];
  54033. translated.y += values3[5];
  54034. } else if (/^matrix3d/.test(transform3)) {
  54035. const values3 = transform3.slice(9, -1).split(/,\s/).map(Number);
  54036. translated.x += values3[12];
  54037. translated.y += values3[13];
  54038. }
  54039. item = item.parentNode;
  54040. }
  54041. }
  54042. const position2 = {};
  54043. const boxTarget = findPosition$1(event2.target);
  54044. const box = findPosition$1(el);
  54045. const boxW = box.width;
  54046. const boxH = box.height;
  54047. let offsetY = event2.offsetY - (box.top - boxTarget.top);
  54048. let offsetX = event2.offsetX - (box.left - boxTarget.left);
  54049. if (event2.changedTouches) {
  54050. offsetX = event2.changedTouches[0].pageX - box.left;
  54051. offsetY = event2.changedTouches[0].pageY + box.top;
  54052. if (IS_IOS$1) {
  54053. offsetX -= translated.x;
  54054. offsetY -= translated.y;
  54055. }
  54056. }
  54057. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  54058. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  54059. return position2;
  54060. }
  54061. function isTextNode$1(value) {
  54062. return isObject$2(value) && value.nodeType === 3;
  54063. }
  54064. function emptyEl$1(el) {
  54065. while (el.firstChild) {
  54066. el.removeChild(el.firstChild);
  54067. }
  54068. return el;
  54069. }
  54070. function normalizeContent$1(content) {
  54071. if (typeof content === "function") {
  54072. content = content();
  54073. }
  54074. return (Array.isArray(content) ? content : [content]).map((value) => {
  54075. if (typeof value === "function") {
  54076. value = value();
  54077. }
  54078. if (isEl$1(value) || isTextNode$1(value)) {
  54079. return value;
  54080. }
  54081. if (typeof value === "string" && /\S/.test(value)) {
  54082. return document_1.createTextNode(value);
  54083. }
  54084. }).filter((value) => value);
  54085. }
  54086. function appendContent$1(el, content) {
  54087. normalizeContent$1(content).forEach((node) => el.appendChild(node));
  54088. return el;
  54089. }
  54090. function insertContent$1(el, content) {
  54091. return appendContent$1(emptyEl$1(el), content);
  54092. }
  54093. function isSingleLeftClick$1(event2) {
  54094. if (event2.button === void 0 && event2.buttons === void 0) {
  54095. return true;
  54096. }
  54097. if (event2.button === 0 && event2.buttons === void 0) {
  54098. return true;
  54099. }
  54100. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  54101. return true;
  54102. }
  54103. if (event2.button !== 0 || event2.buttons !== 1) {
  54104. return false;
  54105. }
  54106. return true;
  54107. }
  54108. const $$1 = createQuerier$1("querySelector");
  54109. const $$$1 = createQuerier$1("querySelectorAll");
  54110. function computedStyle$1(el, prop) {
  54111. if (!el || !prop) {
  54112. return "";
  54113. }
  54114. if (typeof window_1.getComputedStyle === "function") {
  54115. let computedStyleValue;
  54116. try {
  54117. computedStyleValue = window_1.getComputedStyle(el);
  54118. } catch (e) {
  54119. return "";
  54120. }
  54121. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  54122. }
  54123. return "";
  54124. }
  54125. var Dom$2 = /* @__PURE__ */ Object.freeze({
  54126. __proto__: null,
  54127. isReal: isReal$1,
  54128. isEl: isEl$1,
  54129. isInFrame: isInFrame$1,
  54130. createEl: createEl$1,
  54131. textContent: textContent$1,
  54132. prependTo: prependTo$1,
  54133. hasClass: hasClass$1,
  54134. addClass: addClass$1,
  54135. removeClass: removeClass$1,
  54136. toggleClass: toggleClass$1,
  54137. setAttributes: setAttributes$1,
  54138. getAttributes: getAttributes$1,
  54139. getAttribute: getAttribute$1,
  54140. setAttribute: setAttribute$1,
  54141. removeAttribute: removeAttribute$1,
  54142. blockTextSelection: blockTextSelection$1,
  54143. unblockTextSelection: unblockTextSelection$1,
  54144. getBoundingClientRect: getBoundingClientRect$1,
  54145. findPosition: findPosition$1,
  54146. getPointerPosition: getPointerPosition$1,
  54147. isTextNode: isTextNode$1,
  54148. emptyEl: emptyEl$1,
  54149. normalizeContent: normalizeContent$1,
  54150. appendContent: appendContent$1,
  54151. insertContent: insertContent$1,
  54152. isSingleLeftClick: isSingleLeftClick$1,
  54153. $: $$1,
  54154. $$: $$$1,
  54155. computedStyle: computedStyle$1
  54156. });
  54157. let _windowLoaded$1 = false;
  54158. let videojs$1$1;
  54159. const autoSetup$1 = function() {
  54160. if (videojs$1$1.options.autoSetup === false) {
  54161. return;
  54162. }
  54163. const vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  54164. const audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  54165. const divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  54166. const mediaEls = vids.concat(audios, divs);
  54167. if (mediaEls && mediaEls.length > 0) {
  54168. for (let i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  54169. const mediaEl = mediaEls[i2];
  54170. if (mediaEl && mediaEl.getAttribute) {
  54171. if (mediaEl.player === void 0) {
  54172. const options2 = mediaEl.getAttribute("data-setup");
  54173. if (options2 !== null) {
  54174. videojs$1$1(mediaEl);
  54175. }
  54176. }
  54177. } else {
  54178. autoSetupTimeout$1(1);
  54179. break;
  54180. }
  54181. }
  54182. } else if (!_windowLoaded$1) {
  54183. autoSetupTimeout$1(1);
  54184. }
  54185. };
  54186. function autoSetupTimeout$1(wait, vjs) {
  54187. if (!isReal$1()) {
  54188. return;
  54189. }
  54190. if (vjs) {
  54191. videojs$1$1 = vjs;
  54192. }
  54193. window_1.setTimeout(autoSetup$1, wait);
  54194. }
  54195. function setWindowLoaded$1() {
  54196. _windowLoaded$1 = true;
  54197. window_1.removeEventListener("load", setWindowLoaded$1);
  54198. }
  54199. if (isReal$1()) {
  54200. if (document_1.readyState === "complete") {
  54201. setWindowLoaded$1();
  54202. } else {
  54203. window_1.addEventListener("load", setWindowLoaded$1);
  54204. }
  54205. }
  54206. const createStyleElement$1 = function(className) {
  54207. const style = document_1.createElement("style");
  54208. style.className = className;
  54209. return style;
  54210. };
  54211. const setTextContent$1 = function(el, content) {
  54212. if (el.styleSheet) {
  54213. el.styleSheet.cssText = content;
  54214. } else {
  54215. el.textContent = content;
  54216. }
  54217. };
  54218. var DomData$1 = /* @__PURE__ */ new WeakMap();
  54219. const _initialGuid$1 = 3;
  54220. let _guid$1 = _initialGuid$1;
  54221. function newGUID$1() {
  54222. return _guid$1++;
  54223. }
  54224. function _cleanUpEvents$1(elem, type2) {
  54225. if (!DomData$1.has(elem)) {
  54226. return;
  54227. }
  54228. const data = DomData$1.get(elem);
  54229. if (data.handlers[type2].length === 0) {
  54230. delete data.handlers[type2];
  54231. if (elem.removeEventListener) {
  54232. elem.removeEventListener(type2, data.dispatcher, false);
  54233. } else if (elem.detachEvent) {
  54234. elem.detachEvent("on" + type2, data.dispatcher);
  54235. }
  54236. }
  54237. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  54238. delete data.handlers;
  54239. delete data.dispatcher;
  54240. delete data.disabled;
  54241. }
  54242. if (Object.getOwnPropertyNames(data).length === 0) {
  54243. DomData$1.delete(elem);
  54244. }
  54245. }
  54246. function _handleMultipleEvents$1(fn2, elem, types, callback2) {
  54247. types.forEach(function(type2) {
  54248. fn2(elem, type2, callback2);
  54249. });
  54250. }
  54251. function fixEvent$1(event2) {
  54252. if (event2.fixed_) {
  54253. return event2;
  54254. }
  54255. function returnTrue() {
  54256. return true;
  54257. }
  54258. function returnFalse() {
  54259. return false;
  54260. }
  54261. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  54262. const old = event2 || window_1.event;
  54263. event2 = {};
  54264. for (const key in old) {
  54265. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  54266. if (!(key === "returnValue" && old.preventDefault)) {
  54267. event2[key] = old[key];
  54268. }
  54269. }
  54270. }
  54271. if (!event2.target) {
  54272. event2.target = event2.srcElement || document_1;
  54273. }
  54274. if (!event2.relatedTarget) {
  54275. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  54276. }
  54277. event2.preventDefault = function() {
  54278. if (old.preventDefault) {
  54279. old.preventDefault();
  54280. }
  54281. event2.returnValue = false;
  54282. old.returnValue = false;
  54283. event2.defaultPrevented = true;
  54284. };
  54285. event2.defaultPrevented = false;
  54286. event2.stopPropagation = function() {
  54287. if (old.stopPropagation) {
  54288. old.stopPropagation();
  54289. }
  54290. event2.cancelBubble = true;
  54291. old.cancelBubble = true;
  54292. event2.isPropagationStopped = returnTrue;
  54293. };
  54294. event2.isPropagationStopped = returnFalse;
  54295. event2.stopImmediatePropagation = function() {
  54296. if (old.stopImmediatePropagation) {
  54297. old.stopImmediatePropagation();
  54298. }
  54299. event2.isImmediatePropagationStopped = returnTrue;
  54300. event2.stopPropagation();
  54301. };
  54302. event2.isImmediatePropagationStopped = returnFalse;
  54303. if (event2.clientX !== null && event2.clientX !== void 0) {
  54304. const doc = document_1.documentElement;
  54305. const body = document_1.body;
  54306. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  54307. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  54308. }
  54309. event2.which = event2.charCode || event2.keyCode;
  54310. if (event2.button !== null && event2.button !== void 0) {
  54311. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  54312. }
  54313. }
  54314. event2.fixed_ = true;
  54315. return event2;
  54316. }
  54317. let _supportsPassive$1;
  54318. const supportsPassive$1 = function() {
  54319. if (typeof _supportsPassive$1 !== "boolean") {
  54320. _supportsPassive$1 = false;
  54321. try {
  54322. const opts = Object.defineProperty({}, "passive", {
  54323. get() {
  54324. _supportsPassive$1 = true;
  54325. }
  54326. });
  54327. window_1.addEventListener("test", null, opts);
  54328. window_1.removeEventListener("test", null, opts);
  54329. } catch (e) {
  54330. }
  54331. }
  54332. return _supportsPassive$1;
  54333. };
  54334. const passiveEvents$1 = ["touchstart", "touchmove"];
  54335. function on$1(elem, type2, fn2) {
  54336. if (Array.isArray(type2)) {
  54337. return _handleMultipleEvents$1(on$1, elem, type2, fn2);
  54338. }
  54339. if (!DomData$1.has(elem)) {
  54340. DomData$1.set(elem, {});
  54341. }
  54342. const data = DomData$1.get(elem);
  54343. if (!data.handlers) {
  54344. data.handlers = {};
  54345. }
  54346. if (!data.handlers[type2]) {
  54347. data.handlers[type2] = [];
  54348. }
  54349. if (!fn2.guid) {
  54350. fn2.guid = newGUID$1();
  54351. }
  54352. data.handlers[type2].push(fn2);
  54353. if (!data.dispatcher) {
  54354. data.disabled = false;
  54355. data.dispatcher = function(event2, hash) {
  54356. if (data.disabled) {
  54357. return;
  54358. }
  54359. event2 = fixEvent$1(event2);
  54360. const handlers = data.handlers[event2.type];
  54361. if (handlers) {
  54362. const handlersCopy = handlers.slice(0);
  54363. for (let m = 0, n = handlersCopy.length; m < n; m++) {
  54364. if (event2.isImmediatePropagationStopped()) {
  54365. break;
  54366. } else {
  54367. try {
  54368. handlersCopy[m].call(elem, event2, hash);
  54369. } catch (e) {
  54370. log$1$1.error(e);
  54371. }
  54372. }
  54373. }
  54374. }
  54375. };
  54376. }
  54377. if (data.handlers[type2].length === 1) {
  54378. if (elem.addEventListener) {
  54379. let options2 = false;
  54380. if (supportsPassive$1() && passiveEvents$1.indexOf(type2) > -1) {
  54381. options2 = {
  54382. passive: true
  54383. };
  54384. }
  54385. elem.addEventListener(type2, data.dispatcher, options2);
  54386. } else if (elem.attachEvent) {
  54387. elem.attachEvent("on" + type2, data.dispatcher);
  54388. }
  54389. }
  54390. }
  54391. function off$1(elem, type2, fn2) {
  54392. if (!DomData$1.has(elem)) {
  54393. return;
  54394. }
  54395. const data = DomData$1.get(elem);
  54396. if (!data.handlers) {
  54397. return;
  54398. }
  54399. if (Array.isArray(type2)) {
  54400. return _handleMultipleEvents$1(off$1, elem, type2, fn2);
  54401. }
  54402. const removeType = function(el, t2) {
  54403. data.handlers[t2] = [];
  54404. _cleanUpEvents$1(el, t2);
  54405. };
  54406. if (type2 === void 0) {
  54407. for (const t2 in data.handlers) {
  54408. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  54409. removeType(elem, t2);
  54410. }
  54411. }
  54412. return;
  54413. }
  54414. const handlers = data.handlers[type2];
  54415. if (!handlers) {
  54416. return;
  54417. }
  54418. if (!fn2) {
  54419. removeType(elem, type2);
  54420. return;
  54421. }
  54422. if (fn2.guid) {
  54423. for (let n = 0; n < handlers.length; n++) {
  54424. if (handlers[n].guid === fn2.guid) {
  54425. handlers.splice(n--, 1);
  54426. }
  54427. }
  54428. }
  54429. _cleanUpEvents$1(elem, type2);
  54430. }
  54431. function trigger$1(elem, event2, hash) {
  54432. const elemData = DomData$1.has(elem) ? DomData$1.get(elem) : {};
  54433. const parent = elem.parentNode || elem.ownerDocument;
  54434. if (typeof event2 === "string") {
  54435. event2 = {
  54436. type: event2,
  54437. target: elem
  54438. };
  54439. } else if (!event2.target) {
  54440. event2.target = elem;
  54441. }
  54442. event2 = fixEvent$1(event2);
  54443. if (elemData.dispatcher) {
  54444. elemData.dispatcher.call(elem, event2, hash);
  54445. }
  54446. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  54447. trigger$1.call(null, parent, event2, hash);
  54448. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  54449. if (!DomData$1.has(event2.target)) {
  54450. DomData$1.set(event2.target, {});
  54451. }
  54452. const targetData = DomData$1.get(event2.target);
  54453. if (event2.target[event2.type]) {
  54454. targetData.disabled = true;
  54455. if (typeof event2.target[event2.type] === "function") {
  54456. event2.target[event2.type]();
  54457. }
  54458. targetData.disabled = false;
  54459. }
  54460. }
  54461. return !event2.defaultPrevented;
  54462. }
  54463. function one$1(elem, type2, fn2) {
  54464. if (Array.isArray(type2)) {
  54465. return _handleMultipleEvents$1(one$1, elem, type2, fn2);
  54466. }
  54467. const func = function() {
  54468. off$1(elem, type2, func);
  54469. fn2.apply(this, arguments);
  54470. };
  54471. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54472. on$1(elem, type2, func);
  54473. }
  54474. function any$1(elem, type2, fn2) {
  54475. const func = function() {
  54476. off$1(elem, type2, func);
  54477. fn2.apply(this, arguments);
  54478. };
  54479. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54480. on$1(elem, type2, func);
  54481. }
  54482. var Events$1 = /* @__PURE__ */ Object.freeze({
  54483. __proto__: null,
  54484. fixEvent: fixEvent$1,
  54485. on: on$1,
  54486. off: off$1,
  54487. trigger: trigger$1,
  54488. one: one$1,
  54489. any: any$1
  54490. });
  54491. const UPDATE_REFRESH_INTERVAL$1 = 30;
  54492. const bind_ = function(context, fn2, uid) {
  54493. if (!fn2.guid) {
  54494. fn2.guid = newGUID$1();
  54495. }
  54496. const bound = fn2.bind(context);
  54497. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  54498. return bound;
  54499. };
  54500. const throttle$1 = function(fn2, wait) {
  54501. let last = window_1.performance.now();
  54502. const throttled = function(...args) {
  54503. const now2 = window_1.performance.now();
  54504. if (now2 - last >= wait) {
  54505. fn2(...args);
  54506. last = now2;
  54507. }
  54508. };
  54509. return throttled;
  54510. };
  54511. const debounce$1 = function(func, wait, immediate, context = window_1) {
  54512. let timeout;
  54513. const cancel = () => {
  54514. context.clearTimeout(timeout);
  54515. timeout = null;
  54516. };
  54517. const debounced = function() {
  54518. const self2 = this;
  54519. const args = arguments;
  54520. let later = function() {
  54521. timeout = null;
  54522. later = null;
  54523. if (!immediate) {
  54524. func.apply(self2, args);
  54525. }
  54526. };
  54527. if (!timeout && immediate) {
  54528. func.apply(self2, args);
  54529. }
  54530. context.clearTimeout(timeout);
  54531. timeout = context.setTimeout(later, wait);
  54532. };
  54533. debounced.cancel = cancel;
  54534. return debounced;
  54535. };
  54536. var Fn = /* @__PURE__ */ Object.freeze({
  54537. __proto__: null,
  54538. UPDATE_REFRESH_INTERVAL: UPDATE_REFRESH_INTERVAL$1,
  54539. bind_,
  54540. throttle: throttle$1,
  54541. debounce: debounce$1
  54542. });
  54543. let EVENT_MAP$1;
  54544. class EventTarget$2$1 {
  54545. on(type2, fn2) {
  54546. const ael = this.addEventListener;
  54547. this.addEventListener = () => {
  54548. };
  54549. on$1(this, type2, fn2);
  54550. this.addEventListener = ael;
  54551. }
  54552. off(type2, fn2) {
  54553. off$1(this, type2, fn2);
  54554. }
  54555. one(type2, fn2) {
  54556. const ael = this.addEventListener;
  54557. this.addEventListener = () => {
  54558. };
  54559. one$1(this, type2, fn2);
  54560. this.addEventListener = ael;
  54561. }
  54562. any(type2, fn2) {
  54563. const ael = this.addEventListener;
  54564. this.addEventListener = () => {
  54565. };
  54566. any$1(this, type2, fn2);
  54567. this.addEventListener = ael;
  54568. }
  54569. trigger(event2) {
  54570. const type2 = event2.type || event2;
  54571. if (typeof event2 === "string") {
  54572. event2 = {
  54573. type: type2
  54574. };
  54575. }
  54576. event2 = fixEvent$1(event2);
  54577. if (this.allowedEvents_[type2] && this["on" + type2]) {
  54578. this["on" + type2](event2);
  54579. }
  54580. trigger$1(this, event2);
  54581. }
  54582. queueTrigger(event2) {
  54583. if (!EVENT_MAP$1) {
  54584. EVENT_MAP$1 = /* @__PURE__ */ new Map();
  54585. }
  54586. const type2 = event2.type || event2;
  54587. let map = EVENT_MAP$1.get(this);
  54588. if (!map) {
  54589. map = /* @__PURE__ */ new Map();
  54590. EVENT_MAP$1.set(this, map);
  54591. }
  54592. const oldTimeout = map.get(type2);
  54593. map.delete(type2);
  54594. window_1.clearTimeout(oldTimeout);
  54595. const timeout = window_1.setTimeout(() => {
  54596. map.delete(type2);
  54597. if (map.size === 0) {
  54598. map = null;
  54599. EVENT_MAP$1.delete(this);
  54600. }
  54601. this.trigger(event2);
  54602. }, 0);
  54603. map.set(type2, timeout);
  54604. }
  54605. }
  54606. EventTarget$2$1.prototype.allowedEvents_ = {};
  54607. EventTarget$2$1.prototype.addEventListener = EventTarget$2$1.prototype.on;
  54608. EventTarget$2$1.prototype.removeEventListener = EventTarget$2$1.prototype.off;
  54609. EventTarget$2$1.prototype.dispatchEvent = EventTarget$2$1.prototype.trigger;
  54610. const objName$1 = (obj) => {
  54611. if (typeof obj.name === "function") {
  54612. return obj.name();
  54613. }
  54614. if (typeof obj.name === "string") {
  54615. return obj.name;
  54616. }
  54617. if (obj.name_) {
  54618. return obj.name_;
  54619. }
  54620. if (obj.constructor && obj.constructor.name) {
  54621. return obj.constructor.name;
  54622. }
  54623. return typeof obj;
  54624. };
  54625. const isEvented$1 = (object) => object instanceof EventTarget$2$1 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every((k) => typeof object[k] === "function");
  54626. const addEventedCallback$1 = (target, callback2) => {
  54627. if (isEvented$1(target)) {
  54628. callback2();
  54629. } else {
  54630. if (!target.eventedCallbacks) {
  54631. target.eventedCallbacks = [];
  54632. }
  54633. target.eventedCallbacks.push(callback2);
  54634. }
  54635. };
  54636. const isValidEventType$1 = (type2) => typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  54637. const validateTarget$1 = (target, obj, fnName) => {
  54638. if (!target || !target.nodeName && !isEvented$1(target)) {
  54639. throw new Error(`Invalid target for ${objName$1(obj)}#${fnName}; must be a DOM node or evented object.`);
  54640. }
  54641. };
  54642. const validateEventType$1 = (type2, obj, fnName) => {
  54643. if (!isValidEventType$1(type2)) {
  54644. throw new Error(`Invalid event type for ${objName$1(obj)}#${fnName}; must be a non-empty string or array.`);
  54645. }
  54646. };
  54647. const validateListener$1 = (listener, obj, fnName) => {
  54648. if (typeof listener !== "function") {
  54649. throw new Error(`Invalid listener for ${objName$1(obj)}#${fnName}; must be a function.`);
  54650. }
  54651. };
  54652. const normalizeListenArgs$1 = (self2, args, fnName) => {
  54653. const isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  54654. let target;
  54655. let type2;
  54656. let listener;
  54657. if (isTargetingSelf) {
  54658. target = self2.eventBusEl_;
  54659. if (args.length >= 3) {
  54660. args.shift();
  54661. }
  54662. [type2, listener] = args;
  54663. } else {
  54664. [target, type2, listener] = args;
  54665. }
  54666. validateTarget$1(target, self2, fnName);
  54667. validateEventType$1(type2, self2, fnName);
  54668. validateListener$1(listener, self2, fnName);
  54669. listener = bind_(self2, listener);
  54670. return {
  54671. isTargetingSelf,
  54672. target,
  54673. type: type2,
  54674. listener
  54675. };
  54676. };
  54677. const listen$1 = (target, method, type2, listener) => {
  54678. validateTarget$1(target, target, method);
  54679. if (target.nodeName) {
  54680. Events$1[method](target, type2, listener);
  54681. } else {
  54682. target[method](type2, listener);
  54683. }
  54684. };
  54685. const EventedMixin$1 = {
  54686. on(...args) {
  54687. const {
  54688. isTargetingSelf,
  54689. target,
  54690. type: type2,
  54691. listener
  54692. } = normalizeListenArgs$1(this, args, "on");
  54693. listen$1(target, "on", type2, listener);
  54694. if (!isTargetingSelf) {
  54695. const removeListenerOnDispose = () => this.off(target, type2, listener);
  54696. removeListenerOnDispose.guid = listener.guid;
  54697. const removeRemoverOnTargetDispose = () => this.off("dispose", removeListenerOnDispose);
  54698. removeRemoverOnTargetDispose.guid = listener.guid;
  54699. listen$1(this, "on", "dispose", removeListenerOnDispose);
  54700. listen$1(target, "on", "dispose", removeRemoverOnTargetDispose);
  54701. }
  54702. },
  54703. one(...args) {
  54704. const {
  54705. isTargetingSelf,
  54706. target,
  54707. type: type2,
  54708. listener
  54709. } = normalizeListenArgs$1(this, args, "one");
  54710. if (isTargetingSelf) {
  54711. listen$1(target, "one", type2, listener);
  54712. } else {
  54713. const wrapper = (...largs) => {
  54714. this.off(target, type2, wrapper);
  54715. listener.apply(null, largs);
  54716. };
  54717. wrapper.guid = listener.guid;
  54718. listen$1(target, "one", type2, wrapper);
  54719. }
  54720. },
  54721. any(...args) {
  54722. const {
  54723. isTargetingSelf,
  54724. target,
  54725. type: type2,
  54726. listener
  54727. } = normalizeListenArgs$1(this, args, "any");
  54728. if (isTargetingSelf) {
  54729. listen$1(target, "any", type2, listener);
  54730. } else {
  54731. const wrapper = (...largs) => {
  54732. this.off(target, type2, wrapper);
  54733. listener.apply(null, largs);
  54734. };
  54735. wrapper.guid = listener.guid;
  54736. listen$1(target, "any", type2, wrapper);
  54737. }
  54738. },
  54739. off(targetOrType, typeOrListener, listener) {
  54740. if (!targetOrType || isValidEventType$1(targetOrType)) {
  54741. off$1(this.eventBusEl_, targetOrType, typeOrListener);
  54742. } else {
  54743. const target = targetOrType;
  54744. const type2 = typeOrListener;
  54745. validateTarget$1(target, this, "off");
  54746. validateEventType$1(type2, this, "off");
  54747. validateListener$1(listener, this, "off");
  54748. listener = bind_(this, listener);
  54749. this.off("dispose", listener);
  54750. if (target.nodeName) {
  54751. off$1(target, type2, listener);
  54752. off$1(target, "dispose", listener);
  54753. } else if (isEvented$1(target)) {
  54754. target.off(type2, listener);
  54755. target.off("dispose", listener);
  54756. }
  54757. }
  54758. },
  54759. trigger(event2, hash) {
  54760. validateTarget$1(this.eventBusEl_, this, "trigger");
  54761. const type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  54762. if (!isValidEventType$1(type2)) {
  54763. throw new Error(`Invalid event type for ${objName$1(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);
  54764. }
  54765. return trigger$1(this.eventBusEl_, event2, hash);
  54766. }
  54767. };
  54768. function evented$1(target, options2 = {}) {
  54769. const {
  54770. eventBusKey
  54771. } = options2;
  54772. if (eventBusKey) {
  54773. if (!target[eventBusKey].nodeName) {
  54774. throw new Error(`The eventBusKey "${eventBusKey}" does not refer to an element.`);
  54775. }
  54776. target.eventBusEl_ = target[eventBusKey];
  54777. } else {
  54778. target.eventBusEl_ = createEl$1("span", {
  54779. className: "vjs-event-bus"
  54780. });
  54781. }
  54782. Object.assign(target, EventedMixin$1);
  54783. if (target.eventedCallbacks) {
  54784. target.eventedCallbacks.forEach((callback2) => {
  54785. callback2();
  54786. });
  54787. }
  54788. target.on("dispose", () => {
  54789. target.off();
  54790. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  54791. if (val && DomData$1.has(val)) {
  54792. DomData$1.delete(val);
  54793. }
  54794. });
  54795. window_1.setTimeout(() => {
  54796. target.eventBusEl_ = null;
  54797. }, 0);
  54798. });
  54799. return target;
  54800. }
  54801. const StatefulMixin$1 = {
  54802. state: {},
  54803. setState(stateUpdates) {
  54804. if (typeof stateUpdates === "function") {
  54805. stateUpdates = stateUpdates();
  54806. }
  54807. let changes;
  54808. each$1(stateUpdates, (value, key) => {
  54809. if (this.state[key] !== value) {
  54810. changes = changes || {};
  54811. changes[key] = {
  54812. from: this.state[key],
  54813. to: value
  54814. };
  54815. }
  54816. this.state[key] = value;
  54817. });
  54818. if (changes && isEvented$1(this)) {
  54819. this.trigger({
  54820. changes,
  54821. type: "statechanged"
  54822. });
  54823. }
  54824. return changes;
  54825. }
  54826. };
  54827. function stateful$1(target, defaultState) {
  54828. Object.assign(target, StatefulMixin$1);
  54829. target.state = Object.assign({}, target.state, defaultState);
  54830. if (typeof target.handleStateChanged === "function" && isEvented$1(target)) {
  54831. target.on("statechanged", target.handleStateChanged);
  54832. }
  54833. return target;
  54834. }
  54835. const toLowerCase$1 = function(string) {
  54836. if (typeof string !== "string") {
  54837. return string;
  54838. }
  54839. return string.replace(/./, (w) => w.toLowerCase());
  54840. };
  54841. const toTitleCase$1$1 = function(string) {
  54842. if (typeof string !== "string") {
  54843. return string;
  54844. }
  54845. return string.replace(/./, (w) => w.toUpperCase());
  54846. };
  54847. const titleCaseEquals$1 = function(str1, str2) {
  54848. return toTitleCase$1$1(str1) === toTitleCase$1$1(str2);
  54849. };
  54850. var Str = /* @__PURE__ */ Object.freeze({
  54851. __proto__: null,
  54852. toLowerCase: toLowerCase$1,
  54853. toTitleCase: toTitleCase$1$1,
  54854. titleCaseEquals: titleCaseEquals$1
  54855. });
  54856. class Component$1$1 {
  54857. constructor(player, options2, ready) {
  54858. if (!player && this.play) {
  54859. this.player_ = player = this;
  54860. } else {
  54861. this.player_ = player;
  54862. }
  54863. this.isDisposed_ = false;
  54864. this.parentComponent_ = null;
  54865. this.options_ = merge$1({}, this.options_);
  54866. options2 = this.options_ = merge$1(this.options_, options2);
  54867. this.id_ = options2.id || options2.el && options2.el.id;
  54868. if (!this.id_) {
  54869. const id = player && player.id && player.id() || "no_player";
  54870. this.id_ = `${id}_component_${newGUID$1()}`;
  54871. }
  54872. this.name_ = options2.name || null;
  54873. if (options2.el) {
  54874. this.el_ = options2.el;
  54875. } else if (options2.createEl !== false) {
  54876. this.el_ = this.createEl();
  54877. }
  54878. if (options2.className && this.el_) {
  54879. options2.className.split(" ").forEach((c) => this.addClass(c));
  54880. }
  54881. ["on", "off", "one", "any", "trigger"].forEach((fn2) => {
  54882. this[fn2] = void 0;
  54883. });
  54884. if (options2.evented !== false) {
  54885. evented$1(this, {
  54886. eventBusKey: this.el_ ? "el_" : null
  54887. });
  54888. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  54889. this.on(this.player_, "languagechange", this.handleLanguagechange);
  54890. }
  54891. stateful$1(this, this.constructor.defaultState);
  54892. this.children_ = [];
  54893. this.childIndex_ = {};
  54894. this.childNameIndex_ = {};
  54895. this.setTimeoutIds_ = /* @__PURE__ */ new Set();
  54896. this.setIntervalIds_ = /* @__PURE__ */ new Set();
  54897. this.rafIds_ = /* @__PURE__ */ new Set();
  54898. this.namedRafs_ = /* @__PURE__ */ new Map();
  54899. this.clearingTimersOnDispose_ = false;
  54900. if (options2.initChildren !== false) {
  54901. this.initChildren();
  54902. }
  54903. this.ready(ready);
  54904. if (options2.reportTouchActivity !== false) {
  54905. this.enableTouchActivity();
  54906. }
  54907. }
  54908. on(type2, fn2) {
  54909. }
  54910. off(type2, fn2) {
  54911. }
  54912. one(type2, fn2) {
  54913. }
  54914. any(type2, fn2) {
  54915. }
  54916. trigger(event2) {
  54917. }
  54918. dispose(options2 = {}) {
  54919. if (this.isDisposed_) {
  54920. return;
  54921. }
  54922. if (this.readyQueue_) {
  54923. this.readyQueue_.length = 0;
  54924. }
  54925. this.trigger({
  54926. type: "dispose",
  54927. bubbles: false
  54928. });
  54929. this.isDisposed_ = true;
  54930. if (this.children_) {
  54931. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  54932. if (this.children_[i2].dispose) {
  54933. this.children_[i2].dispose();
  54934. }
  54935. }
  54936. }
  54937. this.children_ = null;
  54938. this.childIndex_ = null;
  54939. this.childNameIndex_ = null;
  54940. this.parentComponent_ = null;
  54941. if (this.el_) {
  54942. if (this.el_.parentNode) {
  54943. if (options2.restoreEl) {
  54944. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  54945. } else {
  54946. this.el_.parentNode.removeChild(this.el_);
  54947. }
  54948. }
  54949. this.el_ = null;
  54950. }
  54951. this.player_ = null;
  54952. }
  54953. isDisposed() {
  54954. return Boolean(this.isDisposed_);
  54955. }
  54956. player() {
  54957. return this.player_;
  54958. }
  54959. options(obj) {
  54960. if (!obj) {
  54961. return this.options_;
  54962. }
  54963. this.options_ = merge$1(this.options_, obj);
  54964. return this.options_;
  54965. }
  54966. el() {
  54967. return this.el_;
  54968. }
  54969. createEl(tagName, properties, attributes) {
  54970. return createEl$1(tagName, properties, attributes);
  54971. }
  54972. localize(string, tokens, defaultValue2 = string) {
  54973. const code = this.player_.language && this.player_.language();
  54974. const languages = this.player_.languages && this.player_.languages();
  54975. const language = languages && languages[code];
  54976. const primaryCode = code && code.split("-")[0];
  54977. const primaryLang = languages && languages[primaryCode];
  54978. let localizedString = defaultValue2;
  54979. if (language && language[string]) {
  54980. localizedString = language[string];
  54981. } else if (primaryLang && primaryLang[string]) {
  54982. localizedString = primaryLang[string];
  54983. }
  54984. if (tokens) {
  54985. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  54986. const value = tokens[index2 - 1];
  54987. let ret = value;
  54988. if (typeof value === "undefined") {
  54989. ret = match;
  54990. }
  54991. return ret;
  54992. });
  54993. }
  54994. return localizedString;
  54995. }
  54996. handleLanguagechange() {
  54997. }
  54998. contentEl() {
  54999. return this.contentEl_ || this.el_;
  55000. }
  55001. id() {
  55002. return this.id_;
  55003. }
  55004. name() {
  55005. return this.name_;
  55006. }
  55007. children() {
  55008. return this.children_;
  55009. }
  55010. getChildById(id) {
  55011. return this.childIndex_[id];
  55012. }
  55013. getChild(name) {
  55014. if (!name) {
  55015. return;
  55016. }
  55017. return this.childNameIndex_[name];
  55018. }
  55019. getDescendant(...names2) {
  55020. names2 = names2.reduce((acc, n) => acc.concat(n), []);
  55021. let currentChild = this;
  55022. for (let i2 = 0; i2 < names2.length; i2++) {
  55023. currentChild = currentChild.getChild(names2[i2]);
  55024. if (!currentChild || !currentChild.getChild) {
  55025. return;
  55026. }
  55027. }
  55028. return currentChild;
  55029. }
  55030. addChild(child, options2 = {}, index2 = this.children_.length) {
  55031. let component;
  55032. let componentName;
  55033. if (typeof child === "string") {
  55034. componentName = toTitleCase$1$1(child);
  55035. const componentClassName = options2.componentClass || componentName;
  55036. options2.name = componentName;
  55037. const ComponentClass = Component$1$1.getComponent(componentClassName);
  55038. if (!ComponentClass) {
  55039. throw new Error(`Component ${componentClassName} does not exist`);
  55040. }
  55041. if (typeof ComponentClass !== "function") {
  55042. return null;
  55043. }
  55044. component = new ComponentClass(this.player_ || this, options2);
  55045. } else {
  55046. component = child;
  55047. }
  55048. if (component.parentComponent_) {
  55049. component.parentComponent_.removeChild(component);
  55050. }
  55051. this.children_.splice(index2, 0, component);
  55052. component.parentComponent_ = this;
  55053. if (typeof component.id === "function") {
  55054. this.childIndex_[component.id()] = component;
  55055. }
  55056. componentName = componentName || component.name && toTitleCase$1$1(component.name());
  55057. if (componentName) {
  55058. this.childNameIndex_[componentName] = component;
  55059. this.childNameIndex_[toLowerCase$1(componentName)] = component;
  55060. }
  55061. if (typeof component.el === "function" && component.el()) {
  55062. let refNode = null;
  55063. if (this.children_[index2 + 1]) {
  55064. if (this.children_[index2 + 1].el_) {
  55065. refNode = this.children_[index2 + 1].el_;
  55066. } else if (isEl$1(this.children_[index2 + 1])) {
  55067. refNode = this.children_[index2 + 1];
  55068. }
  55069. }
  55070. this.contentEl().insertBefore(component.el(), refNode);
  55071. }
  55072. return component;
  55073. }
  55074. removeChild(component) {
  55075. if (typeof component === "string") {
  55076. component = this.getChild(component);
  55077. }
  55078. if (!component || !this.children_) {
  55079. return;
  55080. }
  55081. let childFound = false;
  55082. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  55083. if (this.children_[i2] === component) {
  55084. childFound = true;
  55085. this.children_.splice(i2, 1);
  55086. break;
  55087. }
  55088. }
  55089. if (!childFound) {
  55090. return;
  55091. }
  55092. component.parentComponent_ = null;
  55093. this.childIndex_[component.id()] = null;
  55094. this.childNameIndex_[toTitleCase$1$1(component.name())] = null;
  55095. this.childNameIndex_[toLowerCase$1(component.name())] = null;
  55096. const compEl = component.el();
  55097. if (compEl && compEl.parentNode === this.contentEl()) {
  55098. this.contentEl().removeChild(component.el());
  55099. }
  55100. }
  55101. initChildren() {
  55102. const children = this.options_.children;
  55103. if (children) {
  55104. const parentOptions = this.options_;
  55105. const handleAdd = (child) => {
  55106. const name = child.name;
  55107. let opts = child.opts;
  55108. if (parentOptions[name] !== void 0) {
  55109. opts = parentOptions[name];
  55110. }
  55111. if (opts === false) {
  55112. return;
  55113. }
  55114. if (opts === true) {
  55115. opts = {};
  55116. }
  55117. opts.playerOptions = this.options_.playerOptions;
  55118. const newChild = this.addChild(name, opts);
  55119. if (newChild) {
  55120. this[name] = newChild;
  55121. }
  55122. };
  55123. let workingChildren;
  55124. const Tech2 = Component$1$1.getComponent("Tech");
  55125. if (Array.isArray(children)) {
  55126. workingChildren = children;
  55127. } else {
  55128. workingChildren = Object.keys(children);
  55129. }
  55130. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  55131. return !workingChildren.some(function(wchild) {
  55132. if (typeof wchild === "string") {
  55133. return child === wchild;
  55134. }
  55135. return child === wchild.name;
  55136. });
  55137. })).map((child) => {
  55138. let name;
  55139. let opts;
  55140. if (typeof child === "string") {
  55141. name = child;
  55142. opts = children[name] || this.options_[name] || {};
  55143. } else {
  55144. name = child.name;
  55145. opts = child;
  55146. }
  55147. return {
  55148. name,
  55149. opts
  55150. };
  55151. }).filter((child) => {
  55152. const c = Component$1$1.getComponent(child.opts.componentClass || toTitleCase$1$1(child.name));
  55153. return c && !Tech2.isTech(c);
  55154. }).forEach(handleAdd);
  55155. }
  55156. }
  55157. buildCSSClass() {
  55158. return "";
  55159. }
  55160. ready(fn2, sync = false) {
  55161. if (!fn2) {
  55162. return;
  55163. }
  55164. if (!this.isReady_) {
  55165. this.readyQueue_ = this.readyQueue_ || [];
  55166. this.readyQueue_.push(fn2);
  55167. return;
  55168. }
  55169. if (sync) {
  55170. fn2.call(this);
  55171. } else {
  55172. this.setTimeout(fn2, 1);
  55173. }
  55174. }
  55175. triggerReady() {
  55176. this.isReady_ = true;
  55177. this.setTimeout(function() {
  55178. const readyQueue = this.readyQueue_;
  55179. this.readyQueue_ = [];
  55180. if (readyQueue && readyQueue.length > 0) {
  55181. readyQueue.forEach(function(fn2) {
  55182. fn2.call(this);
  55183. }, this);
  55184. }
  55185. this.trigger("ready");
  55186. }, 1);
  55187. }
  55188. $(selector, context) {
  55189. return $$1(selector, context || this.contentEl());
  55190. }
  55191. $$(selector, context) {
  55192. return $$$1(selector, context || this.contentEl());
  55193. }
  55194. hasClass(classToCheck) {
  55195. return hasClass$1(this.el_, classToCheck);
  55196. }
  55197. addClass(...classesToAdd) {
  55198. addClass$1(this.el_, ...classesToAdd);
  55199. }
  55200. removeClass(...classesToRemove) {
  55201. removeClass$1(this.el_, ...classesToRemove);
  55202. }
  55203. toggleClass(classToToggle, predicate) {
  55204. toggleClass$1(this.el_, classToToggle, predicate);
  55205. }
  55206. show() {
  55207. this.removeClass("vjs-hidden");
  55208. }
  55209. hide() {
  55210. this.addClass("vjs-hidden");
  55211. }
  55212. lockShowing() {
  55213. this.addClass("vjs-lock-showing");
  55214. }
  55215. unlockShowing() {
  55216. this.removeClass("vjs-lock-showing");
  55217. }
  55218. getAttribute(attribute) {
  55219. return getAttribute$1(this.el_, attribute);
  55220. }
  55221. setAttribute(attribute, value) {
  55222. setAttribute$1(this.el_, attribute, value);
  55223. }
  55224. removeAttribute(attribute) {
  55225. removeAttribute$1(this.el_, attribute);
  55226. }
  55227. width(num, skipListeners) {
  55228. return this.dimension("width", num, skipListeners);
  55229. }
  55230. height(num, skipListeners) {
  55231. return this.dimension("height", num, skipListeners);
  55232. }
  55233. dimensions(width2, height2) {
  55234. this.width(width2, true);
  55235. this.height(height2);
  55236. }
  55237. dimension(widthOrHeight, num, skipListeners) {
  55238. if (num !== void 0) {
  55239. if (num === null || num !== num) {
  55240. num = 0;
  55241. }
  55242. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  55243. this.el_.style[widthOrHeight] = num;
  55244. } else if (num === "auto") {
  55245. this.el_.style[widthOrHeight] = "";
  55246. } else {
  55247. this.el_.style[widthOrHeight] = num + "px";
  55248. }
  55249. if (!skipListeners) {
  55250. this.trigger("componentresize");
  55251. }
  55252. return;
  55253. }
  55254. if (!this.el_) {
  55255. return 0;
  55256. }
  55257. const val = this.el_.style[widthOrHeight];
  55258. const pxIndex = val.indexOf("px");
  55259. if (pxIndex !== -1) {
  55260. return parseInt(val.slice(0, pxIndex), 10);
  55261. }
  55262. return parseInt(this.el_["offset" + toTitleCase$1$1(widthOrHeight)], 10);
  55263. }
  55264. currentDimension(widthOrHeight) {
  55265. let computedWidthOrHeight = 0;
  55266. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  55267. throw new Error("currentDimension only accepts width or height value");
  55268. }
  55269. computedWidthOrHeight = computedStyle$1(this.el_, widthOrHeight);
  55270. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  55271. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  55272. const rule = `offset${toTitleCase$1$1(widthOrHeight)}`;
  55273. computedWidthOrHeight = this.el_[rule];
  55274. }
  55275. return computedWidthOrHeight;
  55276. }
  55277. currentDimensions() {
  55278. return {
  55279. width: this.currentDimension("width"),
  55280. height: this.currentDimension("height")
  55281. };
  55282. }
  55283. currentWidth() {
  55284. return this.currentDimension("width");
  55285. }
  55286. currentHeight() {
  55287. return this.currentDimension("height");
  55288. }
  55289. focus() {
  55290. this.el_.focus();
  55291. }
  55292. blur() {
  55293. this.el_.blur();
  55294. }
  55295. handleKeyDown(event2) {
  55296. if (this.player_) {
  55297. if (!keycode.isEventKey(event2, "Tab")) {
  55298. event2.stopPropagation();
  55299. }
  55300. this.player_.handleKeyDown(event2);
  55301. }
  55302. }
  55303. handleKeyPress(event2) {
  55304. this.handleKeyDown(event2);
  55305. }
  55306. emitTapEvents() {
  55307. let touchStart = 0;
  55308. let firstTouch = null;
  55309. const tapMovementThreshold = 10;
  55310. const touchTimeThreshold = 200;
  55311. let couldBeTap;
  55312. this.on("touchstart", function(event2) {
  55313. if (event2.touches.length === 1) {
  55314. firstTouch = {
  55315. pageX: event2.touches[0].pageX,
  55316. pageY: event2.touches[0].pageY
  55317. };
  55318. touchStart = window_1.performance.now();
  55319. couldBeTap = true;
  55320. }
  55321. });
  55322. this.on("touchmove", function(event2) {
  55323. if (event2.touches.length > 1) {
  55324. couldBeTap = false;
  55325. } else if (firstTouch) {
  55326. const xdiff = event2.touches[0].pageX - firstTouch.pageX;
  55327. const ydiff = event2.touches[0].pageY - firstTouch.pageY;
  55328. const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  55329. if (touchDistance > tapMovementThreshold) {
  55330. couldBeTap = false;
  55331. }
  55332. }
  55333. });
  55334. const noTap = function() {
  55335. couldBeTap = false;
  55336. };
  55337. this.on("touchleave", noTap);
  55338. this.on("touchcancel", noTap);
  55339. this.on("touchend", function(event2) {
  55340. firstTouch = null;
  55341. if (couldBeTap === true) {
  55342. const touchTime = window_1.performance.now() - touchStart;
  55343. if (touchTime < touchTimeThreshold) {
  55344. event2.preventDefault();
  55345. this.trigger("tap");
  55346. }
  55347. }
  55348. });
  55349. }
  55350. enableTouchActivity() {
  55351. if (!this.player() || !this.player().reportUserActivity) {
  55352. return;
  55353. }
  55354. const report = bind_(this.player(), this.player().reportUserActivity);
  55355. let touchHolding;
  55356. this.on("touchstart", function() {
  55357. report();
  55358. this.clearInterval(touchHolding);
  55359. touchHolding = this.setInterval(report, 250);
  55360. });
  55361. const touchEnd = function(event2) {
  55362. report();
  55363. this.clearInterval(touchHolding);
  55364. };
  55365. this.on("touchmove", report);
  55366. this.on("touchend", touchEnd);
  55367. this.on("touchcancel", touchEnd);
  55368. }
  55369. setTimeout(fn2, timeout) {
  55370. var timeoutId;
  55371. fn2 = bind_(this, fn2);
  55372. this.clearTimersOnDispose_();
  55373. timeoutId = window_1.setTimeout(() => {
  55374. if (this.setTimeoutIds_.has(timeoutId)) {
  55375. this.setTimeoutIds_.delete(timeoutId);
  55376. }
  55377. fn2();
  55378. }, timeout);
  55379. this.setTimeoutIds_.add(timeoutId);
  55380. return timeoutId;
  55381. }
  55382. clearTimeout(timeoutId) {
  55383. if (this.setTimeoutIds_.has(timeoutId)) {
  55384. this.setTimeoutIds_.delete(timeoutId);
  55385. window_1.clearTimeout(timeoutId);
  55386. }
  55387. return timeoutId;
  55388. }
  55389. setInterval(fn2, interval) {
  55390. fn2 = bind_(this, fn2);
  55391. this.clearTimersOnDispose_();
  55392. const intervalId = window_1.setInterval(fn2, interval);
  55393. this.setIntervalIds_.add(intervalId);
  55394. return intervalId;
  55395. }
  55396. clearInterval(intervalId) {
  55397. if (this.setIntervalIds_.has(intervalId)) {
  55398. this.setIntervalIds_.delete(intervalId);
  55399. window_1.clearInterval(intervalId);
  55400. }
  55401. return intervalId;
  55402. }
  55403. requestAnimationFrame(fn2) {
  55404. this.clearTimersOnDispose_();
  55405. var id;
  55406. fn2 = bind_(this, fn2);
  55407. id = window_1.requestAnimationFrame(() => {
  55408. if (this.rafIds_.has(id)) {
  55409. this.rafIds_.delete(id);
  55410. }
  55411. fn2();
  55412. });
  55413. this.rafIds_.add(id);
  55414. return id;
  55415. }
  55416. requestNamedAnimationFrame(name, fn2) {
  55417. if (this.namedRafs_.has(name)) {
  55418. return;
  55419. }
  55420. this.clearTimersOnDispose_();
  55421. fn2 = bind_(this, fn2);
  55422. const id = this.requestAnimationFrame(() => {
  55423. fn2();
  55424. if (this.namedRafs_.has(name)) {
  55425. this.namedRafs_.delete(name);
  55426. }
  55427. });
  55428. this.namedRafs_.set(name, id);
  55429. return name;
  55430. }
  55431. cancelNamedAnimationFrame(name) {
  55432. if (!this.namedRafs_.has(name)) {
  55433. return;
  55434. }
  55435. this.cancelAnimationFrame(this.namedRafs_.get(name));
  55436. this.namedRafs_.delete(name);
  55437. }
  55438. cancelAnimationFrame(id) {
  55439. if (this.rafIds_.has(id)) {
  55440. this.rafIds_.delete(id);
  55441. window_1.cancelAnimationFrame(id);
  55442. }
  55443. return id;
  55444. }
  55445. clearTimersOnDispose_() {
  55446. if (this.clearingTimersOnDispose_) {
  55447. return;
  55448. }
  55449. this.clearingTimersOnDispose_ = true;
  55450. this.one("dispose", () => {
  55451. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(([idName, cancelName]) => {
  55452. this[idName].forEach((val, key) => this[cancelName](key));
  55453. });
  55454. this.clearingTimersOnDispose_ = false;
  55455. });
  55456. }
  55457. static registerComponent(name, ComponentToRegister) {
  55458. if (typeof name !== "string" || !name) {
  55459. throw new Error(`Illegal component name, "${name}"; must be a non-empty string.`);
  55460. }
  55461. const Tech2 = Component$1$1.getComponent("Tech");
  55462. const isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  55463. const isComp = Component$1$1 === ComponentToRegister || Component$1$1.prototype.isPrototypeOf(ComponentToRegister.prototype);
  55464. if (isTech || !isComp) {
  55465. let reason;
  55466. if (isTech) {
  55467. reason = "techs must be registered using Tech.registerTech()";
  55468. } else {
  55469. reason = "must be a Component subclass";
  55470. }
  55471. throw new Error(`Illegal component, "${name}"; ${reason}.`);
  55472. }
  55473. name = toTitleCase$1$1(name);
  55474. if (!Component$1$1.components_) {
  55475. Component$1$1.components_ = {};
  55476. }
  55477. const Player2 = Component$1$1.getComponent("Player");
  55478. if (name === "Player" && Player2 && Player2.players) {
  55479. const players = Player2.players;
  55480. const playerNames = Object.keys(players);
  55481. if (players && playerNames.length > 0 && playerNames.map((pname) => players[pname]).every(Boolean)) {
  55482. throw new Error("Can not register Player component after player has been created.");
  55483. }
  55484. }
  55485. Component$1$1.components_[name] = ComponentToRegister;
  55486. Component$1$1.components_[toLowerCase$1(name)] = ComponentToRegister;
  55487. return ComponentToRegister;
  55488. }
  55489. static getComponent(name) {
  55490. if (!name || !Component$1$1.components_) {
  55491. return;
  55492. }
  55493. return Component$1$1.components_[name];
  55494. }
  55495. }
  55496. Component$1$1.registerComponent("Component", Component$1$1);
  55497. function rangeCheck$1(fnName, index2, maxIndex) {
  55498. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  55499. throw new Error(`Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index2}) is non-numeric or out of bounds (0-${maxIndex}).`);
  55500. }
  55501. }
  55502. function getRange$1(fnName, valueIndex, ranges, rangeIndex) {
  55503. rangeCheck$1(fnName, rangeIndex, ranges.length - 1);
  55504. return ranges[rangeIndex][valueIndex];
  55505. }
  55506. function createTimeRangesObj$1(ranges) {
  55507. let timeRangesObj;
  55508. if (ranges === void 0 || ranges.length === 0) {
  55509. timeRangesObj = {
  55510. length: 0,
  55511. start() {
  55512. throw new Error("This TimeRanges object is empty");
  55513. },
  55514. end() {
  55515. throw new Error("This TimeRanges object is empty");
  55516. }
  55517. };
  55518. } else {
  55519. timeRangesObj = {
  55520. length: ranges.length,
  55521. start: getRange$1.bind(null, "start", 0, ranges),
  55522. end: getRange$1.bind(null, "end", 1, ranges)
  55523. };
  55524. }
  55525. if (window_1.Symbol && window_1.Symbol.iterator) {
  55526. timeRangesObj[window_1.Symbol.iterator] = () => (ranges || []).values();
  55527. }
  55528. return timeRangesObj;
  55529. }
  55530. function createTimeRanges$1(start2, end) {
  55531. if (Array.isArray(start2)) {
  55532. return createTimeRangesObj$1(start2);
  55533. } else if (start2 === void 0 || end === void 0) {
  55534. return createTimeRangesObj$1();
  55535. }
  55536. return createTimeRangesObj$1([[start2, end]]);
  55537. }
  55538. const defaultImplementation$1 = function(seconds, guide) {
  55539. seconds = seconds < 0 ? 0 : seconds;
  55540. let s = Math.floor(seconds % 60);
  55541. let m = Math.floor(seconds / 60 % 60);
  55542. let h2 = Math.floor(seconds / 3600);
  55543. const gm = Math.floor(guide / 60 % 60);
  55544. const gh = Math.floor(guide / 3600);
  55545. if (isNaN(seconds) || seconds === Infinity) {
  55546. h2 = m = s = "-";
  55547. }
  55548. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  55549. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  55550. s = s < 10 ? "0" + s : s;
  55551. return h2 + m + s;
  55552. };
  55553. let implementation$1 = defaultImplementation$1;
  55554. function setFormatTime$1(customImplementation) {
  55555. implementation$1 = customImplementation;
  55556. }
  55557. function resetFormatTime$1() {
  55558. implementation$1 = defaultImplementation$1;
  55559. }
  55560. function formatTime$1(seconds, guide = seconds) {
  55561. return implementation$1(seconds, guide);
  55562. }
  55563. var Time = /* @__PURE__ */ Object.freeze({
  55564. __proto__: null,
  55565. createTimeRanges: createTimeRanges$1,
  55566. createTimeRange: createTimeRanges$1,
  55567. setFormatTime: setFormatTime$1,
  55568. resetFormatTime: resetFormatTime$1,
  55569. formatTime: formatTime$1
  55570. });
  55571. function bufferedPercent$1(buffered, duration5) {
  55572. let bufferedDuration = 0;
  55573. let start2;
  55574. let end;
  55575. if (!duration5) {
  55576. return 0;
  55577. }
  55578. if (!buffered || !buffered.length) {
  55579. buffered = createTimeRanges$1(0, 0);
  55580. }
  55581. for (let i2 = 0; i2 < buffered.length; i2++) {
  55582. start2 = buffered.start(i2);
  55583. end = buffered.end(i2);
  55584. if (end > duration5) {
  55585. end = duration5;
  55586. }
  55587. bufferedDuration += end - start2;
  55588. }
  55589. return bufferedDuration / duration5;
  55590. }
  55591. function MediaError$1(value) {
  55592. if (value instanceof MediaError$1) {
  55593. return value;
  55594. }
  55595. if (typeof value === "number") {
  55596. this.code = value;
  55597. } else if (typeof value === "string") {
  55598. this.message = value;
  55599. } else if (isObject$2(value)) {
  55600. if (typeof value.code === "number") {
  55601. this.code = value.code;
  55602. }
  55603. Object.assign(this, value);
  55604. }
  55605. if (!this.message) {
  55606. this.message = MediaError$1.defaultMessages[this.code] || "";
  55607. }
  55608. }
  55609. MediaError$1.prototype.code = 0;
  55610. MediaError$1.prototype.message = "";
  55611. MediaError$1.prototype.status = null;
  55612. MediaError$1.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  55613. MediaError$1.defaultMessages = {
  55614. 1: "You aborted the media playback",
  55615. 2: "A network error caused the media download to fail part-way.",
  55616. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  55617. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  55618. 5: "The media is encrypted and we do not have the keys to decrypt it."
  55619. };
  55620. for (let errNum = 0; errNum < MediaError$1.errorTypes.length; errNum++) {
  55621. MediaError$1[MediaError$1.errorTypes[errNum]] = errNum;
  55622. MediaError$1.prototype[MediaError$1.errorTypes[errNum]] = errNum;
  55623. }
  55624. function isPromise$1(value) {
  55625. return value !== void 0 && value !== null && typeof value.then === "function";
  55626. }
  55627. function silencePromise$1(value) {
  55628. if (isPromise$1(value)) {
  55629. value.then(null, (e) => {
  55630. });
  55631. }
  55632. }
  55633. const trackToJson_$1 = function(track) {
  55634. const ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce((acc, prop, i2) => {
  55635. if (track[prop]) {
  55636. acc[prop] = track[prop];
  55637. }
  55638. return acc;
  55639. }, {
  55640. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  55641. return {
  55642. startTime: cue.startTime,
  55643. endTime: cue.endTime,
  55644. text: cue.text,
  55645. id: cue.id
  55646. };
  55647. })
  55648. });
  55649. return ret;
  55650. };
  55651. const textTracksToJson$1 = function(tech) {
  55652. const trackEls = tech.$$("track");
  55653. const trackObjs = Array.prototype.map.call(trackEls, (t2) => t2.track);
  55654. const tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  55655. const json = trackToJson_$1(trackEl.track);
  55656. if (trackEl.src) {
  55657. json.src = trackEl.src;
  55658. }
  55659. return json;
  55660. });
  55661. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  55662. return trackObjs.indexOf(track) === -1;
  55663. }).map(trackToJson_$1));
  55664. };
  55665. const jsonToTextTracks$1 = function(json, tech) {
  55666. json.forEach(function(track) {
  55667. const addedTrack = tech.addRemoteTextTrack(track).track;
  55668. if (!track.src && track.cues) {
  55669. track.cues.forEach((cue) => addedTrack.addCue(cue));
  55670. }
  55671. });
  55672. return tech.textTracks();
  55673. };
  55674. var textTrackConverter$1 = {
  55675. textTracksToJson: textTracksToJson$1,
  55676. jsonToTextTracks: jsonToTextTracks$1,
  55677. trackToJson_: trackToJson_$1
  55678. };
  55679. const MODAL_CLASS_NAME$1 = "vjs-modal-dialog";
  55680. class ModalDialog$1 extends Component$1$1 {
  55681. constructor(player, options2) {
  55682. super(player, options2);
  55683. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  55684. this.close_ = (e) => this.close(e);
  55685. this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = false;
  55686. this.closeable(!this.options_.uncloseable);
  55687. this.content(this.options_.content);
  55688. this.contentEl_ = createEl$1("div", {
  55689. className: `${MODAL_CLASS_NAME$1}-content`
  55690. }, {
  55691. role: "document"
  55692. });
  55693. this.descEl_ = createEl$1("p", {
  55694. className: `${MODAL_CLASS_NAME$1}-description vjs-control-text`,
  55695. id: this.el().getAttribute("aria-describedby")
  55696. });
  55697. textContent$1(this.descEl_, this.description());
  55698. this.el_.appendChild(this.descEl_);
  55699. this.el_.appendChild(this.contentEl_);
  55700. }
  55701. createEl() {
  55702. return super.createEl("div", {
  55703. className: this.buildCSSClass(),
  55704. tabIndex: -1
  55705. }, {
  55706. "aria-describedby": `${this.id()}_description`,
  55707. "aria-hidden": "true",
  55708. "aria-label": this.label(),
  55709. "role": "dialog"
  55710. });
  55711. }
  55712. dispose() {
  55713. this.contentEl_ = null;
  55714. this.descEl_ = null;
  55715. this.previouslyActiveEl_ = null;
  55716. super.dispose();
  55717. }
  55718. buildCSSClass() {
  55719. return `${MODAL_CLASS_NAME$1} vjs-hidden ${super.buildCSSClass()}`;
  55720. }
  55721. label() {
  55722. return this.localize(this.options_.label || "Modal Window");
  55723. }
  55724. description() {
  55725. let desc = this.options_.description || this.localize("This is a modal window.");
  55726. if (this.closeable()) {
  55727. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  55728. }
  55729. return desc;
  55730. }
  55731. open() {
  55732. if (!this.opened_) {
  55733. const player = this.player();
  55734. this.trigger("beforemodalopen");
  55735. this.opened_ = true;
  55736. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  55737. this.fill();
  55738. }
  55739. this.wasPlaying_ = !player.paused();
  55740. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  55741. player.pause();
  55742. }
  55743. this.on("keydown", this.handleKeyDown_);
  55744. this.hadControls_ = player.controls();
  55745. player.controls(false);
  55746. this.show();
  55747. this.conditionalFocus_();
  55748. this.el().setAttribute("aria-hidden", "false");
  55749. this.trigger("modalopen");
  55750. this.hasBeenOpened_ = true;
  55751. }
  55752. }
  55753. opened(value) {
  55754. if (typeof value === "boolean") {
  55755. this[value ? "open" : "close"]();
  55756. }
  55757. return this.opened_;
  55758. }
  55759. close() {
  55760. if (!this.opened_) {
  55761. return;
  55762. }
  55763. const player = this.player();
  55764. this.trigger("beforemodalclose");
  55765. this.opened_ = false;
  55766. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  55767. player.play();
  55768. }
  55769. this.off("keydown", this.handleKeyDown_);
  55770. if (this.hadControls_) {
  55771. player.controls(true);
  55772. }
  55773. this.hide();
  55774. this.el().setAttribute("aria-hidden", "true");
  55775. this.trigger("modalclose");
  55776. this.conditionalBlur_();
  55777. if (this.options_.temporary) {
  55778. this.dispose();
  55779. }
  55780. }
  55781. closeable(value) {
  55782. if (typeof value === "boolean") {
  55783. const closeable = this.closeable_ = !!value;
  55784. let close = this.getChild("closeButton");
  55785. if (closeable && !close) {
  55786. const temp = this.contentEl_;
  55787. this.contentEl_ = this.el_;
  55788. close = this.addChild("closeButton", {
  55789. controlText: "Close Modal Dialog"
  55790. });
  55791. this.contentEl_ = temp;
  55792. this.on(close, "close", this.close_);
  55793. }
  55794. if (!closeable && close) {
  55795. this.off(close, "close", this.close_);
  55796. this.removeChild(close);
  55797. close.dispose();
  55798. }
  55799. }
  55800. return this.closeable_;
  55801. }
  55802. fill() {
  55803. this.fillWith(this.content());
  55804. }
  55805. fillWith(content) {
  55806. const contentEl = this.contentEl();
  55807. const parentEl = contentEl.parentNode;
  55808. const nextSiblingEl = contentEl.nextSibling;
  55809. this.trigger("beforemodalfill");
  55810. this.hasBeenFilled_ = true;
  55811. parentEl.removeChild(contentEl);
  55812. this.empty();
  55813. insertContent$1(contentEl, content);
  55814. this.trigger("modalfill");
  55815. if (nextSiblingEl) {
  55816. parentEl.insertBefore(contentEl, nextSiblingEl);
  55817. } else {
  55818. parentEl.appendChild(contentEl);
  55819. }
  55820. const closeButton = this.getChild("closeButton");
  55821. if (closeButton) {
  55822. parentEl.appendChild(closeButton.el_);
  55823. }
  55824. }
  55825. empty() {
  55826. this.trigger("beforemodalempty");
  55827. emptyEl$1(this.contentEl());
  55828. this.trigger("modalempty");
  55829. }
  55830. content(value) {
  55831. if (typeof value !== "undefined") {
  55832. this.content_ = value;
  55833. }
  55834. return this.content_;
  55835. }
  55836. conditionalFocus_() {
  55837. const activeEl = document_1.activeElement;
  55838. const playerEl = this.player_.el_;
  55839. this.previouslyActiveEl_ = null;
  55840. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  55841. this.previouslyActiveEl_ = activeEl;
  55842. this.focus();
  55843. }
  55844. }
  55845. conditionalBlur_() {
  55846. if (this.previouslyActiveEl_) {
  55847. this.previouslyActiveEl_.focus();
  55848. this.previouslyActiveEl_ = null;
  55849. }
  55850. }
  55851. handleKeyDown(event2) {
  55852. event2.stopPropagation();
  55853. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  55854. event2.preventDefault();
  55855. this.close();
  55856. return;
  55857. }
  55858. if (!keycode.isEventKey(event2, "Tab")) {
  55859. return;
  55860. }
  55861. const focusableEls = this.focusableEls_();
  55862. const activeEl = this.el_.querySelector(":focus");
  55863. let focusIndex;
  55864. for (let i2 = 0; i2 < focusableEls.length; i2++) {
  55865. if (activeEl === focusableEls[i2]) {
  55866. focusIndex = i2;
  55867. break;
  55868. }
  55869. }
  55870. if (document_1.activeElement === this.el_) {
  55871. focusIndex = 0;
  55872. }
  55873. if (event2.shiftKey && focusIndex === 0) {
  55874. focusableEls[focusableEls.length - 1].focus();
  55875. event2.preventDefault();
  55876. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  55877. focusableEls[0].focus();
  55878. event2.preventDefault();
  55879. }
  55880. }
  55881. focusableEls_() {
  55882. const allChildren = this.el_.querySelectorAll("*");
  55883. return Array.prototype.filter.call(allChildren, (child) => {
  55884. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  55885. });
  55886. }
  55887. }
  55888. ModalDialog$1.prototype.options_ = {
  55889. pauseOnOpen: true,
  55890. temporary: true
  55891. };
  55892. Component$1$1.registerComponent("ModalDialog", ModalDialog$1);
  55893. class TrackList$1 extends EventTarget$2$1 {
  55894. constructor(tracks = []) {
  55895. super();
  55896. this.tracks_ = [];
  55897. Object.defineProperty(this, "length", {
  55898. get() {
  55899. return this.tracks_.length;
  55900. }
  55901. });
  55902. for (let i2 = 0; i2 < tracks.length; i2++) {
  55903. this.addTrack(tracks[i2]);
  55904. }
  55905. }
  55906. addTrack(track) {
  55907. const index2 = this.tracks_.length;
  55908. if (!("" + index2 in this)) {
  55909. Object.defineProperty(this, index2, {
  55910. get() {
  55911. return this.tracks_[index2];
  55912. }
  55913. });
  55914. }
  55915. if (this.tracks_.indexOf(track) === -1) {
  55916. this.tracks_.push(track);
  55917. this.trigger({
  55918. track,
  55919. type: "addtrack",
  55920. target: this
  55921. });
  55922. }
  55923. track.labelchange_ = () => {
  55924. this.trigger({
  55925. track,
  55926. type: "labelchange",
  55927. target: this
  55928. });
  55929. };
  55930. if (isEvented$1(track)) {
  55931. track.addEventListener("labelchange", track.labelchange_);
  55932. }
  55933. }
  55934. removeTrack(rtrack) {
  55935. let track;
  55936. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  55937. if (this[i2] === rtrack) {
  55938. track = this[i2];
  55939. if (track.off) {
  55940. track.off();
  55941. }
  55942. this.tracks_.splice(i2, 1);
  55943. break;
  55944. }
  55945. }
  55946. if (!track) {
  55947. return;
  55948. }
  55949. this.trigger({
  55950. track,
  55951. type: "removetrack",
  55952. target: this
  55953. });
  55954. }
  55955. getTrackById(id) {
  55956. let result = null;
  55957. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  55958. const track = this[i2];
  55959. if (track.id === id) {
  55960. result = track;
  55961. break;
  55962. }
  55963. }
  55964. return result;
  55965. }
  55966. }
  55967. TrackList$1.prototype.allowedEvents_ = {
  55968. change: "change",
  55969. addtrack: "addtrack",
  55970. removetrack: "removetrack",
  55971. labelchange: "labelchange"
  55972. };
  55973. for (const event2 in TrackList$1.prototype.allowedEvents_) {
  55974. TrackList$1.prototype["on" + event2] = null;
  55975. }
  55976. const disableOthers$1$1 = function(list, track) {
  55977. for (let i2 = 0; i2 < list.length; i2++) {
  55978. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  55979. continue;
  55980. }
  55981. list[i2].enabled = false;
  55982. }
  55983. };
  55984. class AudioTrackList$1 extends TrackList$1 {
  55985. constructor(tracks = []) {
  55986. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  55987. if (tracks[i2].enabled) {
  55988. disableOthers$1$1(tracks, tracks[i2]);
  55989. break;
  55990. }
  55991. }
  55992. super(tracks);
  55993. this.changing_ = false;
  55994. }
  55995. addTrack(track) {
  55996. if (track.enabled) {
  55997. disableOthers$1$1(this, track);
  55998. }
  55999. super.addTrack(track);
  56000. if (!track.addEventListener) {
  56001. return;
  56002. }
  56003. track.enabledChange_ = () => {
  56004. if (this.changing_) {
  56005. return;
  56006. }
  56007. this.changing_ = true;
  56008. disableOthers$1$1(this, track);
  56009. this.changing_ = false;
  56010. this.trigger("change");
  56011. };
  56012. track.addEventListener("enabledchange", track.enabledChange_);
  56013. }
  56014. removeTrack(rtrack) {
  56015. super.removeTrack(rtrack);
  56016. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  56017. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  56018. rtrack.enabledChange_ = null;
  56019. }
  56020. }
  56021. }
  56022. const disableOthers$2 = function(list, track) {
  56023. for (let i2 = 0; i2 < list.length; i2++) {
  56024. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  56025. continue;
  56026. }
  56027. list[i2].selected = false;
  56028. }
  56029. };
  56030. class VideoTrackList$1 extends TrackList$1 {
  56031. constructor(tracks = []) {
  56032. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  56033. if (tracks[i2].selected) {
  56034. disableOthers$2(tracks, tracks[i2]);
  56035. break;
  56036. }
  56037. }
  56038. super(tracks);
  56039. this.changing_ = false;
  56040. Object.defineProperty(this, "selectedIndex", {
  56041. get() {
  56042. for (let i2 = 0; i2 < this.length; i2++) {
  56043. if (this[i2].selected) {
  56044. return i2;
  56045. }
  56046. }
  56047. return -1;
  56048. },
  56049. set() {
  56050. }
  56051. });
  56052. }
  56053. addTrack(track) {
  56054. if (track.selected) {
  56055. disableOthers$2(this, track);
  56056. }
  56057. super.addTrack(track);
  56058. if (!track.addEventListener) {
  56059. return;
  56060. }
  56061. track.selectedChange_ = () => {
  56062. if (this.changing_) {
  56063. return;
  56064. }
  56065. this.changing_ = true;
  56066. disableOthers$2(this, track);
  56067. this.changing_ = false;
  56068. this.trigger("change");
  56069. };
  56070. track.addEventListener("selectedchange", track.selectedChange_);
  56071. }
  56072. removeTrack(rtrack) {
  56073. super.removeTrack(rtrack);
  56074. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  56075. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  56076. rtrack.selectedChange_ = null;
  56077. }
  56078. }
  56079. }
  56080. class TextTrackList$1 extends TrackList$1 {
  56081. addTrack(track) {
  56082. super.addTrack(track);
  56083. if (!this.queueChange_) {
  56084. this.queueChange_ = () => this.queueTrigger("change");
  56085. }
  56086. if (!this.triggerSelectedlanguagechange) {
  56087. this.triggerSelectedlanguagechange_ = () => this.trigger("selectedlanguagechange");
  56088. }
  56089. track.addEventListener("modechange", this.queueChange_);
  56090. const nonLanguageTextTrackKind = ["metadata", "chapters"];
  56091. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  56092. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  56093. }
  56094. }
  56095. removeTrack(rtrack) {
  56096. super.removeTrack(rtrack);
  56097. if (rtrack.removeEventListener) {
  56098. if (this.queueChange_) {
  56099. rtrack.removeEventListener("modechange", this.queueChange_);
  56100. }
  56101. if (this.selectedlanguagechange_) {
  56102. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  56103. }
  56104. }
  56105. }
  56106. }
  56107. class HtmlTrackElementList$1 {
  56108. constructor(trackElements = []) {
  56109. this.trackElements_ = [];
  56110. Object.defineProperty(this, "length", {
  56111. get() {
  56112. return this.trackElements_.length;
  56113. }
  56114. });
  56115. for (let i2 = 0, length = trackElements.length; i2 < length; i2++) {
  56116. this.addTrackElement_(trackElements[i2]);
  56117. }
  56118. }
  56119. addTrackElement_(trackElement) {
  56120. const index2 = this.trackElements_.length;
  56121. if (!("" + index2 in this)) {
  56122. Object.defineProperty(this, index2, {
  56123. get() {
  56124. return this.trackElements_[index2];
  56125. }
  56126. });
  56127. }
  56128. if (this.trackElements_.indexOf(trackElement) === -1) {
  56129. this.trackElements_.push(trackElement);
  56130. }
  56131. }
  56132. getTrackElementByTrack_(track) {
  56133. let trackElement_;
  56134. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56135. if (track === this.trackElements_[i2].track) {
  56136. trackElement_ = this.trackElements_[i2];
  56137. break;
  56138. }
  56139. }
  56140. return trackElement_;
  56141. }
  56142. removeTrackElement_(trackElement) {
  56143. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56144. if (trackElement === this.trackElements_[i2]) {
  56145. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  56146. this.trackElements_[i2].track.off();
  56147. }
  56148. if (typeof this.trackElements_[i2].off === "function") {
  56149. this.trackElements_[i2].off();
  56150. }
  56151. this.trackElements_.splice(i2, 1);
  56152. break;
  56153. }
  56154. }
  56155. }
  56156. }
  56157. class TextTrackCueList$1 {
  56158. constructor(cues) {
  56159. TextTrackCueList$1.prototype.setCues_.call(this, cues);
  56160. Object.defineProperty(this, "length", {
  56161. get() {
  56162. return this.length_;
  56163. }
  56164. });
  56165. }
  56166. setCues_(cues) {
  56167. const oldLength = this.length || 0;
  56168. let i2 = 0;
  56169. const l = cues.length;
  56170. this.cues_ = cues;
  56171. this.length_ = cues.length;
  56172. const defineProp = function(index2) {
  56173. if (!("" + index2 in this)) {
  56174. Object.defineProperty(this, "" + index2, {
  56175. get() {
  56176. return this.cues_[index2];
  56177. }
  56178. });
  56179. }
  56180. };
  56181. if (oldLength < l) {
  56182. i2 = oldLength;
  56183. for (; i2 < l; i2++) {
  56184. defineProp.call(this, i2);
  56185. }
  56186. }
  56187. }
  56188. getCueById(id) {
  56189. let result = null;
  56190. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  56191. const cue = this[i2];
  56192. if (cue.id === id) {
  56193. result = cue;
  56194. break;
  56195. }
  56196. }
  56197. return result;
  56198. }
  56199. }
  56200. const VideoTrackKind$1 = {
  56201. alternative: "alternative",
  56202. captions: "captions",
  56203. main: "main",
  56204. sign: "sign",
  56205. subtitles: "subtitles",
  56206. commentary: "commentary"
  56207. };
  56208. const AudioTrackKind$1 = {
  56209. "alternative": "alternative",
  56210. "descriptions": "descriptions",
  56211. "main": "main",
  56212. "main-desc": "main-desc",
  56213. "translation": "translation",
  56214. "commentary": "commentary"
  56215. };
  56216. const TextTrackKind$1 = {
  56217. subtitles: "subtitles",
  56218. captions: "captions",
  56219. descriptions: "descriptions",
  56220. chapters: "chapters",
  56221. metadata: "metadata"
  56222. };
  56223. const TextTrackMode$1 = {
  56224. disabled: "disabled",
  56225. hidden: "hidden",
  56226. showing: "showing"
  56227. };
  56228. class Track$1 extends EventTarget$2$1 {
  56229. constructor(options2 = {}) {
  56230. super();
  56231. const trackProps = {
  56232. id: options2.id || "vjs_track_" + newGUID$1(),
  56233. kind: options2.kind || "",
  56234. language: options2.language || ""
  56235. };
  56236. let label = options2.label || "";
  56237. for (const key in trackProps) {
  56238. Object.defineProperty(this, key, {
  56239. get() {
  56240. return trackProps[key];
  56241. },
  56242. set() {
  56243. }
  56244. });
  56245. }
  56246. Object.defineProperty(this, "label", {
  56247. get() {
  56248. return label;
  56249. },
  56250. set(newLabel) {
  56251. if (newLabel !== label) {
  56252. label = newLabel;
  56253. this.trigger("labelchange");
  56254. }
  56255. }
  56256. });
  56257. }
  56258. }
  56259. const parseUrl$1 = function(url) {
  56260. const props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  56261. const a = document_1.createElement("a");
  56262. a.href = url;
  56263. const details = {};
  56264. for (let i2 = 0; i2 < props.length; i2++) {
  56265. details[props[i2]] = a[props[i2]];
  56266. }
  56267. if (details.protocol === "http:") {
  56268. details.host = details.host.replace(/:80$/, "");
  56269. }
  56270. if (details.protocol === "https:") {
  56271. details.host = details.host.replace(/:443$/, "");
  56272. }
  56273. if (!details.protocol) {
  56274. details.protocol = window_1.location.protocol;
  56275. }
  56276. if (!details.host) {
  56277. details.host = window_1.location.host;
  56278. }
  56279. return details;
  56280. };
  56281. const getAbsoluteURL$1 = function(url) {
  56282. if (!url.match(/^https?:\/\//)) {
  56283. const a = document_1.createElement("a");
  56284. a.href = url;
  56285. url = a.href;
  56286. }
  56287. return url;
  56288. };
  56289. const getFileExtension$1 = function(path) {
  56290. if (typeof path === "string") {
  56291. const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  56292. const pathParts = splitPathRe.exec(path);
  56293. if (pathParts) {
  56294. return pathParts.pop().toLowerCase();
  56295. }
  56296. }
  56297. return "";
  56298. };
  56299. const isCrossOrigin$1 = function(url, winLoc = window_1.location) {
  56300. const urlInfo = parseUrl$1(url);
  56301. const srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  56302. const crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  56303. return crossOrigin;
  56304. };
  56305. var Url$2 = /* @__PURE__ */ Object.freeze({
  56306. __proto__: null,
  56307. parseUrl: parseUrl$1,
  56308. getAbsoluteURL: getAbsoluteURL$1,
  56309. getFileExtension: getFileExtension$1,
  56310. isCrossOrigin: isCrossOrigin$1
  56311. });
  56312. const parseCues$1 = function(srcContent, track) {
  56313. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  56314. const errors2 = [];
  56315. parser2.oncue = function(cue) {
  56316. track.addCue(cue);
  56317. };
  56318. parser2.onparsingerror = function(error) {
  56319. errors2.push(error);
  56320. };
  56321. parser2.onflush = function() {
  56322. track.trigger({
  56323. type: "loadeddata",
  56324. target: track
  56325. });
  56326. };
  56327. parser2.parse(srcContent);
  56328. if (errors2.length > 0) {
  56329. if (window_1.console && window_1.console.groupCollapsed) {
  56330. window_1.console.groupCollapsed(`Text Track parsing errors for ${track.src}`);
  56331. }
  56332. errors2.forEach((error) => log$1$1.error(error));
  56333. if (window_1.console && window_1.console.groupEnd) {
  56334. window_1.console.groupEnd();
  56335. }
  56336. }
  56337. parser2.flush();
  56338. };
  56339. const loadTrack$1 = function(src, track) {
  56340. const opts = {
  56341. uri: src
  56342. };
  56343. const crossOrigin = isCrossOrigin$1(src);
  56344. if (crossOrigin) {
  56345. opts.cors = crossOrigin;
  56346. }
  56347. const withCredentials = track.tech_.crossOrigin() === "use-credentials";
  56348. if (withCredentials) {
  56349. opts.withCredentials = withCredentials;
  56350. }
  56351. XHR(opts, bind_(this, function(err, response, responseBody) {
  56352. if (err) {
  56353. return log$1$1.error(err, response);
  56354. }
  56355. track.loaded_ = true;
  56356. if (typeof window_1.WebVTT !== "function") {
  56357. if (track.tech_) {
  56358. track.tech_.any(["vttjsloaded", "vttjserror"], (event2) => {
  56359. if (event2.type === "vttjserror") {
  56360. log$1$1.error(`vttjs failed to load, stopping trying to process ${track.src}`);
  56361. return;
  56362. }
  56363. return parseCues$1(responseBody, track);
  56364. });
  56365. }
  56366. } else {
  56367. parseCues$1(responseBody, track);
  56368. }
  56369. }));
  56370. };
  56371. class TextTrack$1 extends Track$1 {
  56372. constructor(options2 = {}) {
  56373. if (!options2.tech) {
  56374. throw new Error("A tech was not provided.");
  56375. }
  56376. const settings = merge$1(options2, {
  56377. kind: TextTrackKind$1[options2.kind] || "subtitles",
  56378. language: options2.language || options2.srclang || ""
  56379. });
  56380. let mode = TextTrackMode$1[settings.mode] || "disabled";
  56381. const default_ = settings.default;
  56382. if (settings.kind === "metadata" || settings.kind === "chapters") {
  56383. mode = "hidden";
  56384. }
  56385. super(settings);
  56386. this.tech_ = settings.tech;
  56387. this.cues_ = [];
  56388. this.activeCues_ = [];
  56389. this.preload_ = this.tech_.preloadTextTracks !== false;
  56390. const cues = new TextTrackCueList$1(this.cues_);
  56391. const activeCues = new TextTrackCueList$1(this.activeCues_);
  56392. let changed = false;
  56393. this.timeupdateHandler = bind_(this, function(event2 = {}) {
  56394. if (this.tech_.isDisposed()) {
  56395. return;
  56396. }
  56397. if (!this.tech_.isReady_) {
  56398. if (event2.type !== "timeupdate") {
  56399. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56400. }
  56401. return;
  56402. }
  56403. this.activeCues = this.activeCues;
  56404. if (changed) {
  56405. this.trigger("cuechange");
  56406. changed = false;
  56407. }
  56408. if (event2.type !== "timeupdate") {
  56409. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56410. }
  56411. });
  56412. const disposeHandler = () => {
  56413. this.stopTracking();
  56414. };
  56415. this.tech_.one("dispose", disposeHandler);
  56416. if (mode !== "disabled") {
  56417. this.startTracking();
  56418. }
  56419. Object.defineProperties(this, {
  56420. default: {
  56421. get() {
  56422. return default_;
  56423. },
  56424. set() {
  56425. }
  56426. },
  56427. mode: {
  56428. get() {
  56429. return mode;
  56430. },
  56431. set(newMode) {
  56432. if (!TextTrackMode$1[newMode]) {
  56433. return;
  56434. }
  56435. if (mode === newMode) {
  56436. return;
  56437. }
  56438. mode = newMode;
  56439. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  56440. loadTrack$1(this.src, this);
  56441. }
  56442. this.stopTracking();
  56443. if (mode !== "disabled") {
  56444. this.startTracking();
  56445. }
  56446. this.trigger("modechange");
  56447. }
  56448. },
  56449. cues: {
  56450. get() {
  56451. if (!this.loaded_) {
  56452. return null;
  56453. }
  56454. return cues;
  56455. },
  56456. set() {
  56457. }
  56458. },
  56459. activeCues: {
  56460. get() {
  56461. if (!this.loaded_) {
  56462. return null;
  56463. }
  56464. if (this.cues.length === 0) {
  56465. return activeCues;
  56466. }
  56467. const ct2 = this.tech_.currentTime();
  56468. const active = [];
  56469. for (let i2 = 0, l = this.cues.length; i2 < l; i2++) {
  56470. const cue = this.cues[i2];
  56471. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  56472. active.push(cue);
  56473. }
  56474. }
  56475. changed = false;
  56476. if (active.length !== this.activeCues_.length) {
  56477. changed = true;
  56478. } else {
  56479. for (let i2 = 0; i2 < active.length; i2++) {
  56480. if (this.activeCues_.indexOf(active[i2]) === -1) {
  56481. changed = true;
  56482. }
  56483. }
  56484. }
  56485. this.activeCues_ = active;
  56486. activeCues.setCues_(this.activeCues_);
  56487. return activeCues;
  56488. },
  56489. set() {
  56490. }
  56491. }
  56492. });
  56493. if (settings.src) {
  56494. this.src = settings.src;
  56495. if (!this.preload_) {
  56496. this.loaded_ = true;
  56497. }
  56498. if (this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  56499. loadTrack$1(this.src, this);
  56500. }
  56501. } else {
  56502. this.loaded_ = true;
  56503. }
  56504. }
  56505. startTracking() {
  56506. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56507. this.tech_.on("timeupdate", this.timeupdateHandler);
  56508. }
  56509. stopTracking() {
  56510. if (this.rvf_) {
  56511. this.tech_.cancelVideoFrameCallback(this.rvf_);
  56512. this.rvf_ = void 0;
  56513. }
  56514. this.tech_.off("timeupdate", this.timeupdateHandler);
  56515. }
  56516. addCue(originalCue) {
  56517. let cue = originalCue;
  56518. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  56519. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  56520. for (const prop in originalCue) {
  56521. if (!(prop in cue)) {
  56522. cue[prop] = originalCue[prop];
  56523. }
  56524. }
  56525. cue.id = originalCue.id;
  56526. cue.originalCue_ = originalCue;
  56527. }
  56528. const tracks = this.tech_.textTracks();
  56529. for (let i2 = 0; i2 < tracks.length; i2++) {
  56530. if (tracks[i2] !== this) {
  56531. tracks[i2].removeCue(cue);
  56532. }
  56533. }
  56534. this.cues_.push(cue);
  56535. this.cues.setCues_(this.cues_);
  56536. }
  56537. removeCue(removeCue) {
  56538. let i2 = this.cues_.length;
  56539. while (i2--) {
  56540. const cue = this.cues_[i2];
  56541. if (cue === removeCue || cue.originalCue_ && cue.originalCue_ === removeCue) {
  56542. this.cues_.splice(i2, 1);
  56543. this.cues.setCues_(this.cues_);
  56544. break;
  56545. }
  56546. }
  56547. }
  56548. }
  56549. TextTrack$1.prototype.allowedEvents_ = {
  56550. cuechange: "cuechange"
  56551. };
  56552. class AudioTrack$1 extends Track$1 {
  56553. constructor(options2 = {}) {
  56554. const settings = merge$1(options2, {
  56555. kind: AudioTrackKind$1[options2.kind] || ""
  56556. });
  56557. super(settings);
  56558. let enabled = false;
  56559. Object.defineProperty(this, "enabled", {
  56560. get() {
  56561. return enabled;
  56562. },
  56563. set(newEnabled) {
  56564. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  56565. return;
  56566. }
  56567. enabled = newEnabled;
  56568. this.trigger("enabledchange");
  56569. }
  56570. });
  56571. if (settings.enabled) {
  56572. this.enabled = settings.enabled;
  56573. }
  56574. this.loaded_ = true;
  56575. }
  56576. }
  56577. class VideoTrack$1 extends Track$1 {
  56578. constructor(options2 = {}) {
  56579. const settings = merge$1(options2, {
  56580. kind: VideoTrackKind$1[options2.kind] || ""
  56581. });
  56582. super(settings);
  56583. let selected = false;
  56584. Object.defineProperty(this, "selected", {
  56585. get() {
  56586. return selected;
  56587. },
  56588. set(newSelected) {
  56589. if (typeof newSelected !== "boolean" || newSelected === selected) {
  56590. return;
  56591. }
  56592. selected = newSelected;
  56593. this.trigger("selectedchange");
  56594. }
  56595. });
  56596. if (settings.selected) {
  56597. this.selected = settings.selected;
  56598. }
  56599. }
  56600. }
  56601. class HTMLTrackElement$1 extends EventTarget$2$1 {
  56602. constructor(options2 = {}) {
  56603. super();
  56604. let readyState;
  56605. const track = new TextTrack$1(options2);
  56606. this.kind = track.kind;
  56607. this.src = track.src;
  56608. this.srclang = track.language;
  56609. this.label = track.label;
  56610. this.default = track.default;
  56611. Object.defineProperties(this, {
  56612. readyState: {
  56613. get() {
  56614. return readyState;
  56615. }
  56616. },
  56617. track: {
  56618. get() {
  56619. return track;
  56620. }
  56621. }
  56622. });
  56623. readyState = HTMLTrackElement$1.NONE;
  56624. track.addEventListener("loadeddata", () => {
  56625. readyState = HTMLTrackElement$1.LOADED;
  56626. this.trigger({
  56627. type: "load",
  56628. target: this
  56629. });
  56630. });
  56631. }
  56632. }
  56633. HTMLTrackElement$1.prototype.allowedEvents_ = {
  56634. load: "load"
  56635. };
  56636. HTMLTrackElement$1.NONE = 0;
  56637. HTMLTrackElement$1.LOADING = 1;
  56638. HTMLTrackElement$1.LOADED = 2;
  56639. HTMLTrackElement$1.ERROR = 3;
  56640. const NORMAL$1 = {
  56641. audio: {
  56642. ListClass: AudioTrackList$1,
  56643. TrackClass: AudioTrack$1,
  56644. capitalName: "Audio"
  56645. },
  56646. video: {
  56647. ListClass: VideoTrackList$1,
  56648. TrackClass: VideoTrack$1,
  56649. capitalName: "Video"
  56650. },
  56651. text: {
  56652. ListClass: TextTrackList$1,
  56653. TrackClass: TextTrack$1,
  56654. capitalName: "Text"
  56655. }
  56656. };
  56657. Object.keys(NORMAL$1).forEach(function(type2) {
  56658. NORMAL$1[type2].getterName = `${type2}Tracks`;
  56659. NORMAL$1[type2].privateName = `${type2}Tracks_`;
  56660. });
  56661. const REMOTE$1 = {
  56662. remoteText: {
  56663. ListClass: TextTrackList$1,
  56664. TrackClass: TextTrack$1,
  56665. capitalName: "RemoteText",
  56666. getterName: "remoteTextTracks",
  56667. privateName: "remoteTextTracks_"
  56668. },
  56669. remoteTextEl: {
  56670. ListClass: HtmlTrackElementList$1,
  56671. TrackClass: HTMLTrackElement$1,
  56672. capitalName: "RemoteTextTrackEls",
  56673. getterName: "remoteTextTrackEls",
  56674. privateName: "remoteTextTrackEls_"
  56675. }
  56676. };
  56677. const ALL$1 = Object.assign({}, NORMAL$1, REMOTE$1);
  56678. REMOTE$1.names = Object.keys(REMOTE$1);
  56679. NORMAL$1.names = Object.keys(NORMAL$1);
  56680. ALL$1.names = [].concat(REMOTE$1.names).concat(NORMAL$1.names);
  56681. function createTrackHelper$1(self2, kind, label, language, options2 = {}) {
  56682. const tracks = self2.textTracks();
  56683. options2.kind = kind;
  56684. if (label) {
  56685. options2.label = label;
  56686. }
  56687. if (language) {
  56688. options2.language = language;
  56689. }
  56690. options2.tech = self2;
  56691. const track = new ALL$1.text.TrackClass(options2);
  56692. tracks.addTrack(track);
  56693. return track;
  56694. }
  56695. class Tech$2 extends Component$1$1 {
  56696. constructor(options2 = {}, ready = function() {
  56697. }) {
  56698. options2.reportTouchActivity = false;
  56699. super(null, options2, ready);
  56700. this.onDurationChange_ = (e) => this.onDurationChange(e);
  56701. this.trackProgress_ = (e) => this.trackProgress(e);
  56702. this.trackCurrentTime_ = (e) => this.trackCurrentTime(e);
  56703. this.stopTrackingCurrentTime_ = (e) => this.stopTrackingCurrentTime(e);
  56704. this.disposeSourceHandler_ = (e) => this.disposeSourceHandler(e);
  56705. this.queuedHanders_ = /* @__PURE__ */ new Set();
  56706. this.hasStarted_ = false;
  56707. this.on("playing", function() {
  56708. this.hasStarted_ = true;
  56709. });
  56710. this.on("loadstart", function() {
  56711. this.hasStarted_ = false;
  56712. });
  56713. ALL$1.names.forEach((name) => {
  56714. const props = ALL$1[name];
  56715. if (options2 && options2[props.getterName]) {
  56716. this[props.privateName] = options2[props.getterName];
  56717. }
  56718. });
  56719. if (!this.featuresProgressEvents) {
  56720. this.manualProgressOn();
  56721. }
  56722. if (!this.featuresTimeupdateEvents) {
  56723. this.manualTimeUpdatesOn();
  56724. }
  56725. ["Text", "Audio", "Video"].forEach((track) => {
  56726. if (options2[`native${track}Tracks`] === false) {
  56727. this[`featuresNative${track}Tracks`] = false;
  56728. }
  56729. });
  56730. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  56731. this.featuresNativeTextTracks = false;
  56732. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  56733. this.featuresNativeTextTracks = true;
  56734. }
  56735. if (!this.featuresNativeTextTracks) {
  56736. this.emulateTextTracks();
  56737. }
  56738. this.preloadTextTracks = options2.preloadTextTracks !== false;
  56739. this.autoRemoteTextTracks_ = new ALL$1.text.ListClass();
  56740. this.initTrackListeners();
  56741. if (!options2.nativeControlsForTouch) {
  56742. this.emitTapEvents();
  56743. }
  56744. if (this.constructor) {
  56745. this.name_ = this.constructor.name || "Unknown Tech";
  56746. }
  56747. }
  56748. triggerSourceset(src) {
  56749. if (!this.isReady_) {
  56750. this.one("ready", () => this.setTimeout(() => this.triggerSourceset(src), 1));
  56751. }
  56752. this.trigger({
  56753. src,
  56754. type: "sourceset"
  56755. });
  56756. }
  56757. manualProgressOn() {
  56758. this.on("durationchange", this.onDurationChange_);
  56759. this.manualProgress = true;
  56760. this.one("ready", this.trackProgress_);
  56761. }
  56762. manualProgressOff() {
  56763. this.manualProgress = false;
  56764. this.stopTrackingProgress();
  56765. this.off("durationchange", this.onDurationChange_);
  56766. }
  56767. trackProgress(event2) {
  56768. this.stopTrackingProgress();
  56769. this.progressInterval = this.setInterval(bind_(this, function() {
  56770. const numBufferedPercent = this.bufferedPercent();
  56771. if (this.bufferedPercent_ !== numBufferedPercent) {
  56772. this.trigger("progress");
  56773. }
  56774. this.bufferedPercent_ = numBufferedPercent;
  56775. if (numBufferedPercent === 1) {
  56776. this.stopTrackingProgress();
  56777. }
  56778. }), 500);
  56779. }
  56780. onDurationChange(event2) {
  56781. this.duration_ = this.duration();
  56782. }
  56783. buffered() {
  56784. return createTimeRanges$1(0, 0);
  56785. }
  56786. bufferedPercent() {
  56787. return bufferedPercent$1(this.buffered(), this.duration_);
  56788. }
  56789. stopTrackingProgress() {
  56790. this.clearInterval(this.progressInterval);
  56791. }
  56792. manualTimeUpdatesOn() {
  56793. this.manualTimeUpdates = true;
  56794. this.on("play", this.trackCurrentTime_);
  56795. this.on("pause", this.stopTrackingCurrentTime_);
  56796. }
  56797. manualTimeUpdatesOff() {
  56798. this.manualTimeUpdates = false;
  56799. this.stopTrackingCurrentTime();
  56800. this.off("play", this.trackCurrentTime_);
  56801. this.off("pause", this.stopTrackingCurrentTime_);
  56802. }
  56803. trackCurrentTime() {
  56804. if (this.currentTimeInterval) {
  56805. this.stopTrackingCurrentTime();
  56806. }
  56807. this.currentTimeInterval = this.setInterval(function() {
  56808. this.trigger({
  56809. type: "timeupdate",
  56810. target: this,
  56811. manuallyTriggered: true
  56812. });
  56813. }, 250);
  56814. }
  56815. stopTrackingCurrentTime() {
  56816. this.clearInterval(this.currentTimeInterval);
  56817. this.trigger({
  56818. type: "timeupdate",
  56819. target: this,
  56820. manuallyTriggered: true
  56821. });
  56822. }
  56823. dispose() {
  56824. this.clearTracks(NORMAL$1.names);
  56825. if (this.manualProgress) {
  56826. this.manualProgressOff();
  56827. }
  56828. if (this.manualTimeUpdates) {
  56829. this.manualTimeUpdatesOff();
  56830. }
  56831. super.dispose();
  56832. }
  56833. clearTracks(types) {
  56834. types = [].concat(types);
  56835. types.forEach((type2) => {
  56836. const list = this[`${type2}Tracks`]() || [];
  56837. let i2 = list.length;
  56838. while (i2--) {
  56839. const track = list[i2];
  56840. if (type2 === "text") {
  56841. this.removeRemoteTextTrack(track);
  56842. }
  56843. list.removeTrack(track);
  56844. }
  56845. });
  56846. }
  56847. cleanupAutoTextTracks() {
  56848. const list = this.autoRemoteTextTracks_ || [];
  56849. let i2 = list.length;
  56850. while (i2--) {
  56851. const track = list[i2];
  56852. this.removeRemoteTextTrack(track);
  56853. }
  56854. }
  56855. reset() {
  56856. }
  56857. crossOrigin() {
  56858. }
  56859. setCrossOrigin() {
  56860. }
  56861. error(err) {
  56862. if (err !== void 0) {
  56863. this.error_ = new MediaError$1(err);
  56864. this.trigger("error");
  56865. }
  56866. return this.error_;
  56867. }
  56868. played() {
  56869. if (this.hasStarted_) {
  56870. return createTimeRanges$1(0, 0);
  56871. }
  56872. return createTimeRanges$1();
  56873. }
  56874. play() {
  56875. }
  56876. setScrubbing(_isScrubbing) {
  56877. }
  56878. scrubbing() {
  56879. }
  56880. setCurrentTime(_seconds) {
  56881. if (this.manualTimeUpdates) {
  56882. this.trigger({
  56883. type: "timeupdate",
  56884. target: this,
  56885. manuallyTriggered: true
  56886. });
  56887. }
  56888. }
  56889. initTrackListeners() {
  56890. NORMAL$1.names.forEach((name) => {
  56891. const props = NORMAL$1[name];
  56892. const trackListChanges = () => {
  56893. this.trigger(`${name}trackchange`);
  56894. };
  56895. const tracks = this[props.getterName]();
  56896. tracks.addEventListener("removetrack", trackListChanges);
  56897. tracks.addEventListener("addtrack", trackListChanges);
  56898. this.on("dispose", () => {
  56899. tracks.removeEventListener("removetrack", trackListChanges);
  56900. tracks.removeEventListener("addtrack", trackListChanges);
  56901. });
  56902. });
  56903. }
  56904. addWebVttScript_() {
  56905. if (window_1.WebVTT) {
  56906. return;
  56907. }
  56908. if (document_1.body.contains(this.el())) {
  56909. if (!this.options_["vtt.js"] && isPlain$1(vtt) && Object.keys(vtt).length > 0) {
  56910. this.trigger("vttjsloaded");
  56911. return;
  56912. }
  56913. const script = document_1.createElement("script");
  56914. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  56915. script.onload = () => {
  56916. this.trigger("vttjsloaded");
  56917. };
  56918. script.onerror = () => {
  56919. this.trigger("vttjserror");
  56920. };
  56921. this.on("dispose", () => {
  56922. script.onload = null;
  56923. script.onerror = null;
  56924. });
  56925. window_1.WebVTT = true;
  56926. this.el().parentNode.appendChild(script);
  56927. } else {
  56928. this.ready(this.addWebVttScript_);
  56929. }
  56930. }
  56931. emulateTextTracks() {
  56932. const tracks = this.textTracks();
  56933. const remoteTracks = this.remoteTextTracks();
  56934. const handleAddTrack = (e) => tracks.addTrack(e.track);
  56935. const handleRemoveTrack = (e) => tracks.removeTrack(e.track);
  56936. remoteTracks.on("addtrack", handleAddTrack);
  56937. remoteTracks.on("removetrack", handleRemoveTrack);
  56938. this.addWebVttScript_();
  56939. const updateDisplay = () => this.trigger("texttrackchange");
  56940. const textTracksChanges = () => {
  56941. updateDisplay();
  56942. for (let i2 = 0; i2 < tracks.length; i2++) {
  56943. const track = tracks[i2];
  56944. track.removeEventListener("cuechange", updateDisplay);
  56945. if (track.mode === "showing") {
  56946. track.addEventListener("cuechange", updateDisplay);
  56947. }
  56948. }
  56949. };
  56950. textTracksChanges();
  56951. tracks.addEventListener("change", textTracksChanges);
  56952. tracks.addEventListener("addtrack", textTracksChanges);
  56953. tracks.addEventListener("removetrack", textTracksChanges);
  56954. this.on("dispose", function() {
  56955. remoteTracks.off("addtrack", handleAddTrack);
  56956. remoteTracks.off("removetrack", handleRemoveTrack);
  56957. tracks.removeEventListener("change", textTracksChanges);
  56958. tracks.removeEventListener("addtrack", textTracksChanges);
  56959. tracks.removeEventListener("removetrack", textTracksChanges);
  56960. for (let i2 = 0; i2 < tracks.length; i2++) {
  56961. const track = tracks[i2];
  56962. track.removeEventListener("cuechange", updateDisplay);
  56963. }
  56964. });
  56965. }
  56966. addTextTrack(kind, label, language) {
  56967. if (!kind) {
  56968. throw new Error("TextTrack kind is required but was not provided");
  56969. }
  56970. return createTrackHelper$1(this, kind, label, language);
  56971. }
  56972. createRemoteTextTrack(options2) {
  56973. const track = merge$1(options2, {
  56974. tech: this
  56975. });
  56976. return new REMOTE$1.remoteTextEl.TrackClass(track);
  56977. }
  56978. addRemoteTextTrack(options2 = {}, manualCleanup) {
  56979. const htmlTrackElement = this.createRemoteTextTrack(options2);
  56980. if (typeof manualCleanup !== "boolean") {
  56981. manualCleanup = false;
  56982. }
  56983. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  56984. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  56985. if (manualCleanup === false) {
  56986. this.ready(() => this.autoRemoteTextTracks_.addTrack(htmlTrackElement.track));
  56987. }
  56988. return htmlTrackElement;
  56989. }
  56990. removeRemoteTextTrack(track) {
  56991. const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  56992. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  56993. this.remoteTextTracks().removeTrack(track);
  56994. this.autoRemoteTextTracks_.removeTrack(track);
  56995. }
  56996. getVideoPlaybackQuality() {
  56997. return {};
  56998. }
  56999. requestPictureInPicture() {
  57000. return Promise.reject();
  57001. }
  57002. disablePictureInPicture() {
  57003. return true;
  57004. }
  57005. setDisablePictureInPicture() {
  57006. }
  57007. requestVideoFrameCallback(cb) {
  57008. const id = newGUID$1();
  57009. if (!this.isReady_ || this.paused()) {
  57010. this.queuedHanders_.add(id);
  57011. this.one("playing", () => {
  57012. if (this.queuedHanders_.has(id)) {
  57013. this.queuedHanders_.delete(id);
  57014. cb();
  57015. }
  57016. });
  57017. } else {
  57018. this.requestNamedAnimationFrame(id, cb);
  57019. }
  57020. return id;
  57021. }
  57022. cancelVideoFrameCallback(id) {
  57023. if (this.queuedHanders_.has(id)) {
  57024. this.queuedHanders_.delete(id);
  57025. } else {
  57026. this.cancelNamedAnimationFrame(id);
  57027. }
  57028. }
  57029. setPoster() {
  57030. }
  57031. playsinline() {
  57032. }
  57033. setPlaysinline() {
  57034. }
  57035. overrideNativeAudioTracks(override) {
  57036. }
  57037. overrideNativeVideoTracks(override) {
  57038. }
  57039. canPlayType(_type) {
  57040. return "";
  57041. }
  57042. static canPlayType(_type) {
  57043. return "";
  57044. }
  57045. static canPlaySource(srcObj, options2) {
  57046. return Tech$2.canPlayType(srcObj.type);
  57047. }
  57048. static isTech(component) {
  57049. return component.prototype instanceof Tech$2 || component instanceof Tech$2 || component === Tech$2;
  57050. }
  57051. static registerTech(name, tech) {
  57052. if (!Tech$2.techs_) {
  57053. Tech$2.techs_ = {};
  57054. }
  57055. if (!Tech$2.isTech(tech)) {
  57056. throw new Error(`Tech ${name} must be a Tech`);
  57057. }
  57058. if (!Tech$2.canPlayType) {
  57059. throw new Error("Techs must have a static canPlayType method on them");
  57060. }
  57061. if (!Tech$2.canPlaySource) {
  57062. throw new Error("Techs must have a static canPlaySource method on them");
  57063. }
  57064. name = toTitleCase$1$1(name);
  57065. Tech$2.techs_[name] = tech;
  57066. Tech$2.techs_[toLowerCase$1(name)] = tech;
  57067. if (name !== "Tech") {
  57068. Tech$2.defaultTechOrder_.push(name);
  57069. }
  57070. return tech;
  57071. }
  57072. static getTech(name) {
  57073. if (!name) {
  57074. return;
  57075. }
  57076. if (Tech$2.techs_ && Tech$2.techs_[name]) {
  57077. return Tech$2.techs_[name];
  57078. }
  57079. name = toTitleCase$1$1(name);
  57080. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  57081. log$1$1.warn(`The ${name} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);
  57082. return window_1.videojs[name];
  57083. }
  57084. }
  57085. }
  57086. ALL$1.names.forEach(function(name) {
  57087. const props = ALL$1[name];
  57088. Tech$2.prototype[props.getterName] = function() {
  57089. this[props.privateName] = this[props.privateName] || new props.ListClass();
  57090. return this[props.privateName];
  57091. };
  57092. });
  57093. Tech$2.prototype.featuresVolumeControl = true;
  57094. Tech$2.prototype.featuresMuteControl = true;
  57095. Tech$2.prototype.featuresFullscreenResize = false;
  57096. Tech$2.prototype.featuresPlaybackRate = false;
  57097. Tech$2.prototype.featuresProgressEvents = false;
  57098. Tech$2.prototype.featuresSourceset = false;
  57099. Tech$2.prototype.featuresTimeupdateEvents = false;
  57100. Tech$2.prototype.featuresNativeTextTracks = false;
  57101. Tech$2.prototype.featuresVideoFrameCallback = false;
  57102. Tech$2.withSourceHandlers = function(_Tech) {
  57103. _Tech.registerSourceHandler = function(handler, index2) {
  57104. let handlers = _Tech.sourceHandlers;
  57105. if (!handlers) {
  57106. handlers = _Tech.sourceHandlers = [];
  57107. }
  57108. if (index2 === void 0) {
  57109. index2 = handlers.length;
  57110. }
  57111. handlers.splice(index2, 0, handler);
  57112. };
  57113. _Tech.canPlayType = function(type2) {
  57114. const handlers = _Tech.sourceHandlers || [];
  57115. let can;
  57116. for (let i2 = 0; i2 < handlers.length; i2++) {
  57117. can = handlers[i2].canPlayType(type2);
  57118. if (can) {
  57119. return can;
  57120. }
  57121. }
  57122. return "";
  57123. };
  57124. _Tech.selectSourceHandler = function(source, options2) {
  57125. const handlers = _Tech.sourceHandlers || [];
  57126. let can;
  57127. for (let i2 = 0; i2 < handlers.length; i2++) {
  57128. can = handlers[i2].canHandleSource(source, options2);
  57129. if (can) {
  57130. return handlers[i2];
  57131. }
  57132. }
  57133. return null;
  57134. };
  57135. _Tech.canPlaySource = function(srcObj, options2) {
  57136. const sh = _Tech.selectSourceHandler(srcObj, options2);
  57137. if (sh) {
  57138. return sh.canHandleSource(srcObj, options2);
  57139. }
  57140. return "";
  57141. };
  57142. const deferrable = ["seekable", "seeking", "duration"];
  57143. deferrable.forEach(function(fnName) {
  57144. const originalFn = this[fnName];
  57145. if (typeof originalFn !== "function") {
  57146. return;
  57147. }
  57148. this[fnName] = function() {
  57149. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  57150. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  57151. }
  57152. return originalFn.apply(this, arguments);
  57153. };
  57154. }, _Tech.prototype);
  57155. _Tech.prototype.setSource = function(source) {
  57156. let sh = _Tech.selectSourceHandler(source, this.options_);
  57157. if (!sh) {
  57158. if (_Tech.nativeSourceHandler) {
  57159. sh = _Tech.nativeSourceHandler;
  57160. } else {
  57161. log$1$1.error("No source handler found for the current source.");
  57162. }
  57163. }
  57164. this.disposeSourceHandler();
  57165. this.off("dispose", this.disposeSourceHandler_);
  57166. if (sh !== _Tech.nativeSourceHandler) {
  57167. this.currentSource_ = source;
  57168. }
  57169. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  57170. this.one("dispose", this.disposeSourceHandler_);
  57171. };
  57172. _Tech.prototype.disposeSourceHandler = function() {
  57173. if (this.currentSource_) {
  57174. this.clearTracks(["audio", "video"]);
  57175. this.currentSource_ = null;
  57176. }
  57177. this.cleanupAutoTextTracks();
  57178. if (this.sourceHandler_) {
  57179. if (this.sourceHandler_.dispose) {
  57180. this.sourceHandler_.dispose();
  57181. }
  57182. this.sourceHandler_ = null;
  57183. }
  57184. };
  57185. };
  57186. Component$1$1.registerComponent("Tech", Tech$2);
  57187. Tech$2.registerTech("Tech", Tech$2);
  57188. Tech$2.defaultTechOrder_ = [];
  57189. const middlewares$1 = {};
  57190. const middlewareInstances$1 = {};
  57191. const TERMINATOR$1 = {};
  57192. function use$1(type2, middleware) {
  57193. middlewares$1[type2] = middlewares$1[type2] || [];
  57194. middlewares$1[type2].push(middleware);
  57195. }
  57196. function setSource$1(player, src, next) {
  57197. player.setTimeout(() => setSourceHelper$1(src, middlewares$1[src.type], next, player), 1);
  57198. }
  57199. function setTech$1(middleware, tech) {
  57200. middleware.forEach((mw) => mw.setTech && mw.setTech(tech));
  57201. }
  57202. function get$1(middleware, tech, method) {
  57203. return middleware.reduceRight(middlewareIterator$1(method), tech[method]());
  57204. }
  57205. function set$1(middleware, tech, method, arg) {
  57206. return tech[method](middleware.reduce(middlewareIterator$1(method), arg));
  57207. }
  57208. function mediate$1(middleware, tech, method, arg = null) {
  57209. const callMethod = "call" + toTitleCase$1$1(method);
  57210. const middlewareValue = middleware.reduce(middlewareIterator$1(callMethod), arg);
  57211. const terminated = middlewareValue === TERMINATOR$1;
  57212. const returnValue = terminated ? null : tech[method](middlewareValue);
  57213. executeRight$1(middleware, method, returnValue, terminated);
  57214. return returnValue;
  57215. }
  57216. const allowedGetters$1 = {
  57217. buffered: 1,
  57218. currentTime: 1,
  57219. duration: 1,
  57220. muted: 1,
  57221. played: 1,
  57222. paused: 1,
  57223. seekable: 1,
  57224. volume: 1,
  57225. ended: 1
  57226. };
  57227. const allowedSetters$1 = {
  57228. setCurrentTime: 1,
  57229. setMuted: 1,
  57230. setVolume: 1
  57231. };
  57232. const allowedMediators$1 = {
  57233. play: 1,
  57234. pause: 1
  57235. };
  57236. function middlewareIterator$1(method) {
  57237. return (value, mw) => {
  57238. if (value === TERMINATOR$1) {
  57239. return TERMINATOR$1;
  57240. }
  57241. if (mw[method]) {
  57242. return mw[method](value);
  57243. }
  57244. return value;
  57245. };
  57246. }
  57247. function executeRight$1(mws, method, value, terminated) {
  57248. for (let i2 = mws.length - 1; i2 >= 0; i2--) {
  57249. const mw = mws[i2];
  57250. if (mw[method]) {
  57251. mw[method](terminated, value);
  57252. }
  57253. }
  57254. }
  57255. function clearCacheForPlayer$1(player) {
  57256. middlewareInstances$1[player.id()] = null;
  57257. }
  57258. function getOrCreateFactory$1(player, mwFactory) {
  57259. const mws = middlewareInstances$1[player.id()];
  57260. let mw = null;
  57261. if (mws === void 0 || mws === null) {
  57262. mw = mwFactory(player);
  57263. middlewareInstances$1[player.id()] = [[mwFactory, mw]];
  57264. return mw;
  57265. }
  57266. for (let i2 = 0; i2 < mws.length; i2++) {
  57267. const [mwf, mwi] = mws[i2];
  57268. if (mwf !== mwFactory) {
  57269. continue;
  57270. }
  57271. mw = mwi;
  57272. }
  57273. if (mw === null) {
  57274. mw = mwFactory(player);
  57275. mws.push([mwFactory, mw]);
  57276. }
  57277. return mw;
  57278. }
  57279. function setSourceHelper$1(src = {}, middleware = [], next, player, acc = [], lastRun = false) {
  57280. const [mwFactory, ...mwrest] = middleware;
  57281. if (typeof mwFactory === "string") {
  57282. setSourceHelper$1(src, middlewares$1[mwFactory], next, player, acc, lastRun);
  57283. } else if (mwFactory) {
  57284. const mw = getOrCreateFactory$1(player, mwFactory);
  57285. if (!mw.setSource) {
  57286. acc.push(mw);
  57287. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57288. }
  57289. mw.setSource(Object.assign({}, src), function(err, _src) {
  57290. if (err) {
  57291. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57292. }
  57293. acc.push(mw);
  57294. setSourceHelper$1(_src, src.type === _src.type ? mwrest : middlewares$1[_src.type], next, player, acc, lastRun);
  57295. });
  57296. } else if (mwrest.length) {
  57297. setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57298. } else if (lastRun) {
  57299. next(src, acc);
  57300. } else {
  57301. setSourceHelper$1(src, middlewares$1["*"], next, player, acc, true);
  57302. }
  57303. }
  57304. const MimetypesKind$1 = {
  57305. opus: "video/ogg",
  57306. ogv: "video/ogg",
  57307. mp4: "video/mp4",
  57308. mov: "video/mp4",
  57309. m4v: "video/mp4",
  57310. mkv: "video/x-matroska",
  57311. m4a: "audio/mp4",
  57312. mp3: "audio/mpeg",
  57313. aac: "audio/aac",
  57314. caf: "audio/x-caf",
  57315. flac: "audio/flac",
  57316. oga: "audio/ogg",
  57317. wav: "audio/wav",
  57318. m3u8: "application/x-mpegURL",
  57319. mpd: "application/dash+xml",
  57320. jpg: "image/jpeg",
  57321. jpeg: "image/jpeg",
  57322. gif: "image/gif",
  57323. png: "image/png",
  57324. svg: "image/svg+xml",
  57325. webp: "image/webp"
  57326. };
  57327. const getMimetype$1 = function(src = "") {
  57328. const ext = getFileExtension$1(src);
  57329. const mimetype = MimetypesKind$1[ext.toLowerCase()];
  57330. return mimetype || "";
  57331. };
  57332. const findMimetype$1 = (player, src) => {
  57333. if (!src) {
  57334. return "";
  57335. }
  57336. if (player.cache_.source.src === src && player.cache_.source.type) {
  57337. return player.cache_.source.type;
  57338. }
  57339. const matchingSources = player.cache_.sources.filter((s) => s.src === src);
  57340. if (matchingSources.length) {
  57341. return matchingSources[0].type;
  57342. }
  57343. const sources = player.$$("source");
  57344. for (let i2 = 0; i2 < sources.length; i2++) {
  57345. const s = sources[i2];
  57346. if (s.type && s.src && s.src === src) {
  57347. return s.type;
  57348. }
  57349. }
  57350. return getMimetype$1(src);
  57351. };
  57352. const filterSource$1 = function(src) {
  57353. if (Array.isArray(src)) {
  57354. let newsrc = [];
  57355. src.forEach(function(srcobj) {
  57356. srcobj = filterSource$1(srcobj);
  57357. if (Array.isArray(srcobj)) {
  57358. newsrc = newsrc.concat(srcobj);
  57359. } else if (isObject$2(srcobj)) {
  57360. newsrc.push(srcobj);
  57361. }
  57362. });
  57363. src = newsrc;
  57364. } else if (typeof src === "string" && src.trim()) {
  57365. src = [fixSource$1({
  57366. src
  57367. })];
  57368. } else if (isObject$2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  57369. src = [fixSource$1(src)];
  57370. } else {
  57371. src = [];
  57372. }
  57373. return src;
  57374. };
  57375. function fixSource$1(src) {
  57376. if (!src.type) {
  57377. const mimetype = getMimetype$1(src.src);
  57378. if (mimetype) {
  57379. src.type = mimetype;
  57380. }
  57381. }
  57382. return src;
  57383. }
  57384. class MediaLoader$1 extends Component$1$1 {
  57385. constructor(player, options2, ready) {
  57386. const options_ = merge$1({
  57387. createEl: false
  57388. }, options2);
  57389. super(player, options_, ready);
  57390. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  57391. for (let i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  57392. const techName = toTitleCase$1$1(j[i2]);
  57393. let tech = Tech$2.getTech(techName);
  57394. if (!techName) {
  57395. tech = Component$1$1.getComponent(techName);
  57396. }
  57397. if (tech && tech.isSupported()) {
  57398. player.loadTech_(techName);
  57399. break;
  57400. }
  57401. }
  57402. } else {
  57403. player.src(options2.playerOptions.sources);
  57404. }
  57405. }
  57406. }
  57407. Component$1$1.registerComponent("MediaLoader", MediaLoader$1);
  57408. class ClickableComponent$1 extends Component$1$1 {
  57409. constructor(player, options2) {
  57410. super(player, options2);
  57411. if (this.options_.controlText) {
  57412. this.controlText(this.options_.controlText);
  57413. }
  57414. this.handleMouseOver_ = (e) => this.handleMouseOver(e);
  57415. this.handleMouseOut_ = (e) => this.handleMouseOut(e);
  57416. this.handleClick_ = (e) => this.handleClick(e);
  57417. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  57418. this.emitTapEvents();
  57419. this.enable();
  57420. }
  57421. createEl(tag = "div", props = {}, attributes = {}) {
  57422. props = Object.assign({
  57423. className: this.buildCSSClass(),
  57424. tabIndex: 0
  57425. }, props);
  57426. if (tag === "button") {
  57427. log$1$1.error(`Creating a ClickableComponent with an HTML element of ${tag} is not supported; use a Button instead.`);
  57428. }
  57429. attributes = Object.assign({
  57430. role: "button"
  57431. }, attributes);
  57432. this.tabIndex_ = props.tabIndex;
  57433. const el = createEl$1(tag, props, attributes);
  57434. el.appendChild(createEl$1("span", {
  57435. className: "vjs-icon-placeholder"
  57436. }, {
  57437. "aria-hidden": true
  57438. }));
  57439. this.createControlTextEl(el);
  57440. return el;
  57441. }
  57442. dispose() {
  57443. this.controlTextEl_ = null;
  57444. super.dispose();
  57445. }
  57446. createControlTextEl(el) {
  57447. this.controlTextEl_ = createEl$1("span", {
  57448. className: "vjs-control-text"
  57449. }, {
  57450. "aria-live": "polite"
  57451. });
  57452. if (el) {
  57453. el.appendChild(this.controlTextEl_);
  57454. }
  57455. this.controlText(this.controlText_, el);
  57456. return this.controlTextEl_;
  57457. }
  57458. controlText(text, el = this.el()) {
  57459. if (text === void 0) {
  57460. return this.controlText_ || "Need Text";
  57461. }
  57462. const localizedText = this.localize(text);
  57463. this.controlText_ = text;
  57464. textContent$1(this.controlTextEl_, localizedText);
  57465. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  57466. el.setAttribute("title", localizedText);
  57467. }
  57468. }
  57469. buildCSSClass() {
  57470. return `vjs-control vjs-button ${super.buildCSSClass()}`;
  57471. }
  57472. enable() {
  57473. if (!this.enabled_) {
  57474. this.enabled_ = true;
  57475. this.removeClass("vjs-disabled");
  57476. this.el_.setAttribute("aria-disabled", "false");
  57477. if (typeof this.tabIndex_ !== "undefined") {
  57478. this.el_.setAttribute("tabIndex", this.tabIndex_);
  57479. }
  57480. this.on(["tap", "click"], this.handleClick_);
  57481. this.on("keydown", this.handleKeyDown_);
  57482. }
  57483. }
  57484. disable() {
  57485. this.enabled_ = false;
  57486. this.addClass("vjs-disabled");
  57487. this.el_.setAttribute("aria-disabled", "true");
  57488. if (typeof this.tabIndex_ !== "undefined") {
  57489. this.el_.removeAttribute("tabIndex");
  57490. }
  57491. this.off("mouseover", this.handleMouseOver_);
  57492. this.off("mouseout", this.handleMouseOut_);
  57493. this.off(["tap", "click"], this.handleClick_);
  57494. this.off("keydown", this.handleKeyDown_);
  57495. }
  57496. handleLanguagechange() {
  57497. this.controlText(this.controlText_);
  57498. }
  57499. handleClick(event2) {
  57500. if (this.options_.clickHandler) {
  57501. this.options_.clickHandler.call(this, arguments);
  57502. }
  57503. }
  57504. handleKeyDown(event2) {
  57505. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57506. event2.preventDefault();
  57507. event2.stopPropagation();
  57508. this.trigger("click");
  57509. } else {
  57510. super.handleKeyDown(event2);
  57511. }
  57512. }
  57513. }
  57514. Component$1$1.registerComponent("ClickableComponent", ClickableComponent$1);
  57515. class PosterImage$1 extends ClickableComponent$1 {
  57516. constructor(player, options2) {
  57517. super(player, options2);
  57518. this.update();
  57519. this.update_ = (e) => this.update(e);
  57520. player.on("posterchange", this.update_);
  57521. }
  57522. dispose() {
  57523. this.player().off("posterchange", this.update_);
  57524. super.dispose();
  57525. }
  57526. createEl() {
  57527. return createEl$1("div", {
  57528. className: "vjs-poster"
  57529. });
  57530. }
  57531. crossOrigin(value) {
  57532. if (typeof value === "undefined") {
  57533. if (this.$("img")) {
  57534. return this.$("img").crossOrigin;
  57535. } else if (this.player_.tech_ && this.player_.tech_.isReady_) {
  57536. return this.player_.crossOrigin();
  57537. }
  57538. return this.player_.options_.crossOrigin || this.player_.options_.crossorigin || null;
  57539. }
  57540. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  57541. this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  57542. return;
  57543. }
  57544. if (this.$("img")) {
  57545. this.$("img").crossOrigin = value;
  57546. }
  57547. return;
  57548. }
  57549. update(event2) {
  57550. const url = this.player().poster();
  57551. this.setSrc(url);
  57552. if (url) {
  57553. this.show();
  57554. } else {
  57555. this.hide();
  57556. }
  57557. }
  57558. setSrc(url) {
  57559. if (!url) {
  57560. this.el_.textContent = "";
  57561. return;
  57562. }
  57563. if (!this.$("img")) {
  57564. this.el_.appendChild(createEl$1("picture", {
  57565. className: "vjs-poster",
  57566. tabIndex: -1
  57567. }, {}, createEl$1("img", {
  57568. loading: "lazy",
  57569. crossOrigin: this.crossOrigin()
  57570. }, {
  57571. alt: ""
  57572. })));
  57573. }
  57574. this.$("img").src = url;
  57575. }
  57576. handleClick(event2) {
  57577. if (!this.player_.controls()) {
  57578. return;
  57579. }
  57580. if (this.player_.tech(true)) {
  57581. this.player_.tech(true).focus();
  57582. }
  57583. if (this.player_.paused()) {
  57584. silencePromise$1(this.player_.play());
  57585. } else {
  57586. this.player_.pause();
  57587. }
  57588. }
  57589. }
  57590. PosterImage$1.prototype.crossorigin = PosterImage$1.prototype.crossOrigin;
  57591. Component$1$1.registerComponent("PosterImage", PosterImage$1);
  57592. const darkGray$1 = "#222";
  57593. const lightGray$1 = "#ccc";
  57594. const fontMap$1 = {
  57595. monospace: "monospace",
  57596. sansSerif: "sans-serif",
  57597. serif: "serif",
  57598. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  57599. monospaceSerif: '"Courier New", monospace',
  57600. proportionalSansSerif: "sans-serif",
  57601. proportionalSerif: "serif",
  57602. casual: '"Comic Sans MS", Impact, fantasy',
  57603. script: '"Monotype Corsiva", cursive',
  57604. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  57605. };
  57606. function constructColor$1(color2, opacity) {
  57607. let hex;
  57608. if (color2.length === 4) {
  57609. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  57610. } else if (color2.length === 7) {
  57611. hex = color2.slice(1);
  57612. } else {
  57613. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  57614. }
  57615. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  57616. }
  57617. function tryUpdateStyle$1(el, style, rule) {
  57618. try {
  57619. el.style[style] = rule;
  57620. } catch (e) {
  57621. return;
  57622. }
  57623. }
  57624. class TextTrackDisplay$1 extends Component$1$1 {
  57625. constructor(player, options2, ready) {
  57626. super(player, options2, ready);
  57627. const updateDisplayHandler = (e) => this.updateDisplay(e);
  57628. player.on("loadstart", (e) => this.toggleDisplay(e));
  57629. player.on("texttrackchange", updateDisplayHandler);
  57630. player.on("loadedmetadata", (e) => this.preselectTrack(e));
  57631. player.ready(bind_(this, function() {
  57632. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  57633. this.hide();
  57634. return;
  57635. }
  57636. player.on("fullscreenchange", updateDisplayHandler);
  57637. player.on("playerresize", updateDisplayHandler);
  57638. const screenOrientation = window_1.screen.orientation || window_1;
  57639. const changeOrientationEvent = window_1.screen.orientation ? "change" : "orientationchange";
  57640. screenOrientation.addEventListener(changeOrientationEvent, updateDisplayHandler);
  57641. player.on("dispose", () => screenOrientation.removeEventListener(changeOrientationEvent, updateDisplayHandler));
  57642. const tracks = this.options_.playerOptions.tracks || [];
  57643. for (let i2 = 0; i2 < tracks.length; i2++) {
  57644. this.player_.addRemoteTextTrack(tracks[i2], true);
  57645. }
  57646. this.preselectTrack();
  57647. }));
  57648. }
  57649. preselectTrack() {
  57650. const modes = {
  57651. captions: 1,
  57652. subtitles: 1
  57653. };
  57654. const trackList = this.player_.textTracks();
  57655. const userPref = this.player_.cache_.selectedLanguage;
  57656. let firstDesc;
  57657. let firstCaptions;
  57658. let preferredTrack;
  57659. for (let i2 = 0; i2 < trackList.length; i2++) {
  57660. const track = trackList[i2];
  57661. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  57662. if (track.kind === userPref.kind) {
  57663. preferredTrack = track;
  57664. } else if (!preferredTrack) {
  57665. preferredTrack = track;
  57666. }
  57667. } else if (userPref && !userPref.enabled) {
  57668. preferredTrack = null;
  57669. firstDesc = null;
  57670. firstCaptions = null;
  57671. } else if (track.default) {
  57672. if (track.kind === "descriptions" && !firstDesc) {
  57673. firstDesc = track;
  57674. } else if (track.kind in modes && !firstCaptions) {
  57675. firstCaptions = track;
  57676. }
  57677. }
  57678. }
  57679. if (preferredTrack) {
  57680. preferredTrack.mode = "showing";
  57681. } else if (firstCaptions) {
  57682. firstCaptions.mode = "showing";
  57683. } else if (firstDesc) {
  57684. firstDesc.mode = "showing";
  57685. }
  57686. }
  57687. toggleDisplay() {
  57688. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  57689. this.hide();
  57690. } else {
  57691. this.show();
  57692. }
  57693. }
  57694. createEl() {
  57695. return super.createEl("div", {
  57696. className: "vjs-text-track-display"
  57697. }, {
  57698. "translate": "yes",
  57699. "aria-live": "off",
  57700. "aria-atomic": "true"
  57701. });
  57702. }
  57703. clearDisplay() {
  57704. if (typeof window_1.WebVTT === "function") {
  57705. window_1.WebVTT.processCues(window_1, [], this.el_);
  57706. }
  57707. }
  57708. updateDisplay() {
  57709. const tracks = this.player_.textTracks();
  57710. const allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  57711. this.clearDisplay();
  57712. if (allowMultipleShowingTracks) {
  57713. const showingTracks = [];
  57714. for (let i3 = 0; i3 < tracks.length; ++i3) {
  57715. const track = tracks[i3];
  57716. if (track.mode !== "showing") {
  57717. continue;
  57718. }
  57719. showingTracks.push(track);
  57720. }
  57721. this.updateForTrack(showingTracks);
  57722. return;
  57723. }
  57724. let descriptionsTrack = null;
  57725. let captionsSubtitlesTrack = null;
  57726. let i2 = tracks.length;
  57727. while (i2--) {
  57728. const track = tracks[i2];
  57729. if (track.mode === "showing") {
  57730. if (track.kind === "descriptions") {
  57731. descriptionsTrack = track;
  57732. } else {
  57733. captionsSubtitlesTrack = track;
  57734. }
  57735. }
  57736. }
  57737. if (captionsSubtitlesTrack) {
  57738. if (this.getAttribute("aria-live") !== "off") {
  57739. this.setAttribute("aria-live", "off");
  57740. }
  57741. this.updateForTrack(captionsSubtitlesTrack);
  57742. } else if (descriptionsTrack) {
  57743. if (this.getAttribute("aria-live") !== "assertive") {
  57744. this.setAttribute("aria-live", "assertive");
  57745. }
  57746. this.updateForTrack(descriptionsTrack);
  57747. }
  57748. }
  57749. updateDisplayState(track) {
  57750. const overrides = this.player_.textTrackSettings.getValues();
  57751. const cues = track.activeCues;
  57752. let i2 = cues.length;
  57753. while (i2--) {
  57754. const cue = cues[i2];
  57755. if (!cue) {
  57756. continue;
  57757. }
  57758. const cueDiv = cue.displayState;
  57759. if (overrides.color) {
  57760. cueDiv.firstChild.style.color = overrides.color;
  57761. }
  57762. if (overrides.textOpacity) {
  57763. tryUpdateStyle$1(cueDiv.firstChild, "color", constructColor$1(overrides.color || "#fff", overrides.textOpacity));
  57764. }
  57765. if (overrides.backgroundColor) {
  57766. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  57767. }
  57768. if (overrides.backgroundOpacity) {
  57769. tryUpdateStyle$1(cueDiv.firstChild, "backgroundColor", constructColor$1(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  57770. }
  57771. if (overrides.windowColor) {
  57772. if (overrides.windowOpacity) {
  57773. tryUpdateStyle$1(cueDiv, "backgroundColor", constructColor$1(overrides.windowColor, overrides.windowOpacity));
  57774. } else {
  57775. cueDiv.style.backgroundColor = overrides.windowColor;
  57776. }
  57777. }
  57778. if (overrides.edgeStyle) {
  57779. if (overrides.edgeStyle === "dropshadow") {
  57780. cueDiv.firstChild.style.textShadow = `2px 2px 3px ${darkGray$1}, 2px 2px 4px ${darkGray$1}, 2px 2px 5px ${darkGray$1}`;
  57781. } else if (overrides.edgeStyle === "raised") {
  57782. cueDiv.firstChild.style.textShadow = `1px 1px ${darkGray$1}, 2px 2px ${darkGray$1}, 3px 3px ${darkGray$1}`;
  57783. } else if (overrides.edgeStyle === "depressed") {
  57784. cueDiv.firstChild.style.textShadow = `1px 1px ${lightGray$1}, 0 1px ${lightGray$1}, -1px -1px ${darkGray$1}, 0 -1px ${darkGray$1}`;
  57785. } else if (overrides.edgeStyle === "uniform") {
  57786. cueDiv.firstChild.style.textShadow = `0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}`;
  57787. }
  57788. }
  57789. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  57790. const fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  57791. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  57792. cueDiv.style.height = "auto";
  57793. cueDiv.style.top = "auto";
  57794. }
  57795. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  57796. if (overrides.fontFamily === "small-caps") {
  57797. cueDiv.firstChild.style.fontVariant = "small-caps";
  57798. } else {
  57799. cueDiv.firstChild.style.fontFamily = fontMap$1[overrides.fontFamily];
  57800. }
  57801. }
  57802. }
  57803. }
  57804. updateForTrack(tracks) {
  57805. if (!Array.isArray(tracks)) {
  57806. tracks = [tracks];
  57807. }
  57808. if (typeof window_1.WebVTT !== "function" || tracks.every((track) => {
  57809. return !track.activeCues;
  57810. })) {
  57811. return;
  57812. }
  57813. const cues = [];
  57814. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57815. const track = tracks[i2];
  57816. for (let j = 0; j < track.activeCues.length; ++j) {
  57817. cues.push(track.activeCues[j]);
  57818. }
  57819. }
  57820. window_1.WebVTT.processCues(window_1, cues, this.el_);
  57821. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57822. const track = tracks[i2];
  57823. for (let j = 0; j < track.activeCues.length; ++j) {
  57824. const cueEl = track.activeCues[j].displayState;
  57825. addClass$1(cueEl, "vjs-text-track-cue", "vjs-text-track-cue-" + (track.language ? track.language : i2));
  57826. if (track.language) {
  57827. setAttribute$1(cueEl, "lang", track.language);
  57828. }
  57829. }
  57830. if (this.player_.textTrackSettings) {
  57831. this.updateDisplayState(track);
  57832. }
  57833. }
  57834. }
  57835. }
  57836. Component$1$1.registerComponent("TextTrackDisplay", TextTrackDisplay$1);
  57837. class LoadingSpinner$1 extends Component$1$1 {
  57838. createEl() {
  57839. const isAudio = this.player_.isAudio();
  57840. const playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  57841. const controlText = createEl$1("span", {
  57842. className: "vjs-control-text",
  57843. textContent: this.localize("{1} is loading.", [playerType])
  57844. });
  57845. const el = super.createEl("div", {
  57846. className: "vjs-loading-spinner",
  57847. dir: "ltr"
  57848. });
  57849. el.appendChild(controlText);
  57850. return el;
  57851. }
  57852. handleLanguagechange() {
  57853. this.$(".vjs-control-text").textContent = this.localize("{1} is loading.", [this.player_.isAudio() ? "Audio Player" : "Video Player"]);
  57854. }
  57855. }
  57856. Component$1$1.registerComponent("LoadingSpinner", LoadingSpinner$1);
  57857. class Button$1 extends ClickableComponent$1 {
  57858. createEl(tag, props = {}, attributes = {}) {
  57859. tag = "button";
  57860. props = Object.assign({
  57861. className: this.buildCSSClass()
  57862. }, props);
  57863. attributes = Object.assign({
  57864. type: "button"
  57865. }, attributes);
  57866. const el = createEl$1(tag, props, attributes);
  57867. el.appendChild(createEl$1("span", {
  57868. className: "vjs-icon-placeholder"
  57869. }, {
  57870. "aria-hidden": true
  57871. }));
  57872. this.createControlTextEl(el);
  57873. return el;
  57874. }
  57875. addChild(child, options2 = {}) {
  57876. const className = this.constructor.name;
  57877. log$1$1.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);
  57878. return Component$1$1.prototype.addChild.call(this, child, options2);
  57879. }
  57880. enable() {
  57881. super.enable();
  57882. this.el_.removeAttribute("disabled");
  57883. }
  57884. disable() {
  57885. super.disable();
  57886. this.el_.setAttribute("disabled", "disabled");
  57887. }
  57888. handleKeyDown(event2) {
  57889. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57890. event2.stopPropagation();
  57891. return;
  57892. }
  57893. super.handleKeyDown(event2);
  57894. }
  57895. }
  57896. Component$1$1.registerComponent("Button", Button$1);
  57897. class BigPlayButton$1 extends Button$1 {
  57898. constructor(player, options2) {
  57899. super(player, options2);
  57900. this.mouseused_ = false;
  57901. this.on("mousedown", (e) => this.handleMouseDown(e));
  57902. }
  57903. buildCSSClass() {
  57904. return "vjs-big-play-button";
  57905. }
  57906. handleClick(event2) {
  57907. const playPromise = this.player_.play();
  57908. if (this.mouseused_ && event2.clientX && event2.clientY) {
  57909. silencePromise$1(playPromise);
  57910. if (this.player_.tech(true)) {
  57911. this.player_.tech(true).focus();
  57912. }
  57913. return;
  57914. }
  57915. const cb = this.player_.getChild("controlBar");
  57916. const playToggle = cb && cb.getChild("playToggle");
  57917. if (!playToggle) {
  57918. this.player_.tech(true).focus();
  57919. return;
  57920. }
  57921. const playFocus = () => playToggle.focus();
  57922. if (isPromise$1(playPromise)) {
  57923. playPromise.then(playFocus, () => {
  57924. });
  57925. } else {
  57926. this.setTimeout(playFocus, 1);
  57927. }
  57928. }
  57929. handleKeyDown(event2) {
  57930. this.mouseused_ = false;
  57931. super.handleKeyDown(event2);
  57932. }
  57933. handleMouseDown(event2) {
  57934. this.mouseused_ = true;
  57935. }
  57936. }
  57937. BigPlayButton$1.prototype.controlText_ = "Play Video";
  57938. Component$1$1.registerComponent("BigPlayButton", BigPlayButton$1);
  57939. class CloseButton$1 extends Button$1 {
  57940. constructor(player, options2) {
  57941. super(player, options2);
  57942. this.controlText(options2 && options2.controlText || this.localize("Close"));
  57943. }
  57944. buildCSSClass() {
  57945. return `vjs-close-button ${super.buildCSSClass()}`;
  57946. }
  57947. handleClick(event2) {
  57948. this.trigger({
  57949. type: "close",
  57950. bubbles: false
  57951. });
  57952. }
  57953. handleKeyDown(event2) {
  57954. if (keycode.isEventKey(event2, "Esc")) {
  57955. event2.preventDefault();
  57956. event2.stopPropagation();
  57957. this.trigger("click");
  57958. } else {
  57959. super.handleKeyDown(event2);
  57960. }
  57961. }
  57962. }
  57963. Component$1$1.registerComponent("CloseButton", CloseButton$1);
  57964. class PlayToggle$1 extends Button$1 {
  57965. constructor(player, options2 = {}) {
  57966. super(player, options2);
  57967. options2.replay = options2.replay === void 0 || options2.replay;
  57968. this.on(player, "play", (e) => this.handlePlay(e));
  57969. this.on(player, "pause", (e) => this.handlePause(e));
  57970. if (options2.replay) {
  57971. this.on(player, "ended", (e) => this.handleEnded(e));
  57972. }
  57973. }
  57974. buildCSSClass() {
  57975. return `vjs-play-control ${super.buildCSSClass()}`;
  57976. }
  57977. handleClick(event2) {
  57978. if (this.player_.paused()) {
  57979. silencePromise$1(this.player_.play());
  57980. } else {
  57981. this.player_.pause();
  57982. }
  57983. }
  57984. handleSeeked(event2) {
  57985. this.removeClass("vjs-ended");
  57986. if (this.player_.paused()) {
  57987. this.handlePause(event2);
  57988. } else {
  57989. this.handlePlay(event2);
  57990. }
  57991. }
  57992. handlePlay(event2) {
  57993. this.removeClass("vjs-ended", "vjs-paused");
  57994. this.addClass("vjs-playing");
  57995. this.controlText("Pause");
  57996. }
  57997. handlePause(event2) {
  57998. this.removeClass("vjs-playing");
  57999. this.addClass("vjs-paused");
  58000. this.controlText("Play");
  58001. }
  58002. handleEnded(event2) {
  58003. this.removeClass("vjs-playing");
  58004. this.addClass("vjs-ended");
  58005. this.controlText("Replay");
  58006. this.one(this.player_, "seeked", (e) => this.handleSeeked(e));
  58007. }
  58008. }
  58009. PlayToggle$1.prototype.controlText_ = "Play";
  58010. Component$1$1.registerComponent("PlayToggle", PlayToggle$1);
  58011. class TimeDisplay$1 extends Component$1$1 {
  58012. constructor(player, options2) {
  58013. super(player, options2);
  58014. this.on(player, ["timeupdate", "ended"], (e) => this.updateContent(e));
  58015. this.updateTextNode_();
  58016. }
  58017. createEl() {
  58018. const className = this.buildCSSClass();
  58019. const el = super.createEl("div", {
  58020. className: `${className} vjs-time-control vjs-control`
  58021. });
  58022. const span = createEl$1("span", {
  58023. className: "vjs-control-text",
  58024. textContent: `${this.localize(this.labelText_)}\xA0`
  58025. }, {
  58026. role: "presentation"
  58027. });
  58028. el.appendChild(span);
  58029. this.contentEl_ = createEl$1("span", {
  58030. className: `${className}-display`
  58031. }, {
  58032. role: "presentation"
  58033. });
  58034. el.appendChild(this.contentEl_);
  58035. return el;
  58036. }
  58037. dispose() {
  58038. this.contentEl_ = null;
  58039. this.textNode_ = null;
  58040. super.dispose();
  58041. }
  58042. updateTextNode_(time = 0) {
  58043. time = formatTime$1(time);
  58044. if (this.formattedTime_ === time) {
  58045. return;
  58046. }
  58047. this.formattedTime_ = time;
  58048. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", () => {
  58049. if (!this.contentEl_) {
  58050. return;
  58051. }
  58052. let oldNode = this.textNode_;
  58053. if (oldNode && this.contentEl_.firstChild !== oldNode) {
  58054. oldNode = null;
  58055. log$1$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  58056. }
  58057. this.textNode_ = document_1.createTextNode(this.formattedTime_);
  58058. if (!this.textNode_) {
  58059. return;
  58060. }
  58061. if (oldNode) {
  58062. this.contentEl_.replaceChild(this.textNode_, oldNode);
  58063. } else {
  58064. this.contentEl_.appendChild(this.textNode_);
  58065. }
  58066. });
  58067. }
  58068. updateContent(event2) {
  58069. }
  58070. }
  58071. TimeDisplay$1.prototype.labelText_ = "Time";
  58072. TimeDisplay$1.prototype.controlText_ = "Time";
  58073. Component$1$1.registerComponent("TimeDisplay", TimeDisplay$1);
  58074. class CurrentTimeDisplay$1 extends TimeDisplay$1 {
  58075. buildCSSClass() {
  58076. return "vjs-current-time";
  58077. }
  58078. updateContent(event2) {
  58079. let time;
  58080. if (this.player_.ended()) {
  58081. time = this.player_.duration();
  58082. } else {
  58083. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58084. }
  58085. this.updateTextNode_(time);
  58086. }
  58087. }
  58088. CurrentTimeDisplay$1.prototype.labelText_ = "Current Time";
  58089. CurrentTimeDisplay$1.prototype.controlText_ = "Current Time";
  58090. Component$1$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay$1);
  58091. class DurationDisplay$1 extends TimeDisplay$1 {
  58092. constructor(player, options2) {
  58093. super(player, options2);
  58094. const updateContent = (e) => this.updateContent(e);
  58095. this.on(player, "durationchange", updateContent);
  58096. this.on(player, "loadstart", updateContent);
  58097. this.on(player, "loadedmetadata", updateContent);
  58098. }
  58099. buildCSSClass() {
  58100. return "vjs-duration";
  58101. }
  58102. updateContent(event2) {
  58103. const duration5 = this.player_.duration();
  58104. this.updateTextNode_(duration5);
  58105. }
  58106. }
  58107. DurationDisplay$1.prototype.labelText_ = "Duration";
  58108. DurationDisplay$1.prototype.controlText_ = "Duration";
  58109. Component$1$1.registerComponent("DurationDisplay", DurationDisplay$1);
  58110. class TimeDivider$1 extends Component$1$1 {
  58111. createEl() {
  58112. const el = super.createEl("div", {
  58113. className: "vjs-time-control vjs-time-divider"
  58114. }, {
  58115. "aria-hidden": true
  58116. });
  58117. const div = super.createEl("div");
  58118. const span = super.createEl("span", {
  58119. textContent: "/"
  58120. });
  58121. div.appendChild(span);
  58122. el.appendChild(div);
  58123. return el;
  58124. }
  58125. }
  58126. Component$1$1.registerComponent("TimeDivider", TimeDivider$1);
  58127. class RemainingTimeDisplay$1 extends TimeDisplay$1 {
  58128. constructor(player, options2) {
  58129. super(player, options2);
  58130. this.on(player, "durationchange", (e) => this.updateContent(e));
  58131. }
  58132. buildCSSClass() {
  58133. return "vjs-remaining-time";
  58134. }
  58135. createEl() {
  58136. const el = super.createEl();
  58137. if (this.options_.displayNegative !== false) {
  58138. el.insertBefore(createEl$1("span", {}, {
  58139. "aria-hidden": true
  58140. }, "-"), this.contentEl_);
  58141. }
  58142. return el;
  58143. }
  58144. updateContent(event2) {
  58145. if (typeof this.player_.duration() !== "number") {
  58146. return;
  58147. }
  58148. let time;
  58149. if (this.player_.ended()) {
  58150. time = 0;
  58151. } else if (this.player_.remainingTimeDisplay) {
  58152. time = this.player_.remainingTimeDisplay();
  58153. } else {
  58154. time = this.player_.remainingTime();
  58155. }
  58156. this.updateTextNode_(time);
  58157. }
  58158. }
  58159. RemainingTimeDisplay$1.prototype.labelText_ = "Remaining Time";
  58160. RemainingTimeDisplay$1.prototype.controlText_ = "Remaining Time";
  58161. Component$1$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay$1);
  58162. class LiveDisplay$1 extends Component$1$1 {
  58163. constructor(player, options2) {
  58164. super(player, options2);
  58165. this.updateShowing();
  58166. this.on(this.player(), "durationchange", (e) => this.updateShowing(e));
  58167. }
  58168. createEl() {
  58169. const el = super.createEl("div", {
  58170. className: "vjs-live-control vjs-control"
  58171. });
  58172. this.contentEl_ = createEl$1("div", {
  58173. className: "vjs-live-display"
  58174. }, {
  58175. "aria-live": "off"
  58176. });
  58177. this.contentEl_.appendChild(createEl$1("span", {
  58178. className: "vjs-control-text",
  58179. textContent: `${this.localize("Stream Type")}\xA0`
  58180. }));
  58181. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  58182. el.appendChild(this.contentEl_);
  58183. return el;
  58184. }
  58185. dispose() {
  58186. this.contentEl_ = null;
  58187. super.dispose();
  58188. }
  58189. updateShowing(event2) {
  58190. if (this.player().duration() === Infinity) {
  58191. this.show();
  58192. } else {
  58193. this.hide();
  58194. }
  58195. }
  58196. }
  58197. Component$1$1.registerComponent("LiveDisplay", LiveDisplay$1);
  58198. class SeekToLive$1 extends Button$1 {
  58199. constructor(player, options2) {
  58200. super(player, options2);
  58201. this.updateLiveEdgeStatus();
  58202. if (this.player_.liveTracker) {
  58203. this.updateLiveEdgeStatusHandler_ = (e) => this.updateLiveEdgeStatus(e);
  58204. this.on(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58205. }
  58206. }
  58207. createEl() {
  58208. const el = super.createEl("button", {
  58209. className: "vjs-seek-to-live-control vjs-control"
  58210. });
  58211. this.textEl_ = createEl$1("span", {
  58212. className: "vjs-seek-to-live-text",
  58213. textContent: this.localize("LIVE")
  58214. }, {
  58215. "aria-hidden": "true"
  58216. });
  58217. el.appendChild(this.textEl_);
  58218. return el;
  58219. }
  58220. updateLiveEdgeStatus() {
  58221. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  58222. this.setAttribute("aria-disabled", true);
  58223. this.addClass("vjs-at-live-edge");
  58224. this.controlText("Seek to live, currently playing live");
  58225. } else {
  58226. this.setAttribute("aria-disabled", false);
  58227. this.removeClass("vjs-at-live-edge");
  58228. this.controlText("Seek to live, currently behind live");
  58229. }
  58230. }
  58231. handleClick() {
  58232. this.player_.liveTracker.seekToLiveEdge();
  58233. }
  58234. dispose() {
  58235. if (this.player_.liveTracker) {
  58236. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58237. }
  58238. this.textEl_ = null;
  58239. super.dispose();
  58240. }
  58241. }
  58242. SeekToLive$1.prototype.controlText_ = "Seek to live, currently playing live";
  58243. Component$1$1.registerComponent("SeekToLive", SeekToLive$1);
  58244. function clamp$1(number, min2, max2) {
  58245. number = Number(number);
  58246. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  58247. }
  58248. var Num = /* @__PURE__ */ Object.freeze({
  58249. __proto__: null,
  58250. clamp: clamp$1
  58251. });
  58252. class Slider$1 extends Component$1$1 {
  58253. constructor(player, options2) {
  58254. super(player, options2);
  58255. this.handleMouseDown_ = (e) => this.handleMouseDown(e);
  58256. this.handleMouseUp_ = (e) => this.handleMouseUp(e);
  58257. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  58258. this.handleClick_ = (e) => this.handleClick(e);
  58259. this.handleMouseMove_ = (e) => this.handleMouseMove(e);
  58260. this.update_ = (e) => this.update(e);
  58261. this.bar = this.getChild(this.options_.barName);
  58262. this.vertical(!!this.options_.vertical);
  58263. this.enable();
  58264. }
  58265. enabled() {
  58266. return this.enabled_;
  58267. }
  58268. enable() {
  58269. if (this.enabled()) {
  58270. return;
  58271. }
  58272. this.on("mousedown", this.handleMouseDown_);
  58273. this.on("touchstart", this.handleMouseDown_);
  58274. this.on("keydown", this.handleKeyDown_);
  58275. this.on("click", this.handleClick_);
  58276. this.on(this.player_, "controlsvisible", this.update);
  58277. if (this.playerEvent) {
  58278. this.on(this.player_, this.playerEvent, this.update);
  58279. }
  58280. this.removeClass("disabled");
  58281. this.setAttribute("tabindex", 0);
  58282. this.enabled_ = true;
  58283. }
  58284. disable() {
  58285. if (!this.enabled()) {
  58286. return;
  58287. }
  58288. const doc = this.bar.el_.ownerDocument;
  58289. this.off("mousedown", this.handleMouseDown_);
  58290. this.off("touchstart", this.handleMouseDown_);
  58291. this.off("keydown", this.handleKeyDown_);
  58292. this.off("click", this.handleClick_);
  58293. this.off(this.player_, "controlsvisible", this.update_);
  58294. this.off(doc, "mousemove", this.handleMouseMove_);
  58295. this.off(doc, "mouseup", this.handleMouseUp_);
  58296. this.off(doc, "touchmove", this.handleMouseMove_);
  58297. this.off(doc, "touchend", this.handleMouseUp_);
  58298. this.removeAttribute("tabindex");
  58299. this.addClass("disabled");
  58300. if (this.playerEvent) {
  58301. this.off(this.player_, this.playerEvent, this.update);
  58302. }
  58303. this.enabled_ = false;
  58304. }
  58305. createEl(type2, props = {}, attributes = {}) {
  58306. props.className = props.className + " vjs-slider";
  58307. props = Object.assign({
  58308. tabIndex: 0
  58309. }, props);
  58310. attributes = Object.assign({
  58311. "role": "slider",
  58312. "aria-valuenow": 0,
  58313. "aria-valuemin": 0,
  58314. "aria-valuemax": 100
  58315. }, attributes);
  58316. return super.createEl(type2, props, attributes);
  58317. }
  58318. handleMouseDown(event2) {
  58319. const doc = this.bar.el_.ownerDocument;
  58320. if (event2.type === "mousedown") {
  58321. event2.preventDefault();
  58322. }
  58323. if (event2.type === "touchstart" && !IS_CHROME$1) {
  58324. event2.preventDefault();
  58325. }
  58326. blockTextSelection$1();
  58327. this.addClass("vjs-sliding");
  58328. this.trigger("slideractive");
  58329. this.on(doc, "mousemove", this.handleMouseMove_);
  58330. this.on(doc, "mouseup", this.handleMouseUp_);
  58331. this.on(doc, "touchmove", this.handleMouseMove_);
  58332. this.on(doc, "touchend", this.handleMouseUp_);
  58333. this.handleMouseMove(event2, true);
  58334. }
  58335. handleMouseMove(event2) {
  58336. }
  58337. handleMouseUp(event2) {
  58338. const doc = this.bar.el_.ownerDocument;
  58339. unblockTextSelection$1();
  58340. this.removeClass("vjs-sliding");
  58341. this.trigger("sliderinactive");
  58342. this.off(doc, "mousemove", this.handleMouseMove_);
  58343. this.off(doc, "mouseup", this.handleMouseUp_);
  58344. this.off(doc, "touchmove", this.handleMouseMove_);
  58345. this.off(doc, "touchend", this.handleMouseUp_);
  58346. this.update();
  58347. }
  58348. update() {
  58349. if (!this.el_ || !this.bar) {
  58350. return;
  58351. }
  58352. const progress = this.getProgress();
  58353. if (progress === this.progress_) {
  58354. return progress;
  58355. }
  58356. this.progress_ = progress;
  58357. this.requestNamedAnimationFrame("Slider#update", () => {
  58358. const sizeKey = this.vertical() ? "height" : "width";
  58359. this.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  58360. });
  58361. return progress;
  58362. }
  58363. getProgress() {
  58364. return Number(clamp$1(this.getPercent(), 0, 1).toFixed(4));
  58365. }
  58366. calculateDistance(event2) {
  58367. const position2 = getPointerPosition$1(this.el_, event2);
  58368. if (this.vertical()) {
  58369. return position2.y;
  58370. }
  58371. return position2.x;
  58372. }
  58373. handleKeyDown(event2) {
  58374. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  58375. event2.preventDefault();
  58376. event2.stopPropagation();
  58377. this.stepBack();
  58378. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  58379. event2.preventDefault();
  58380. event2.stopPropagation();
  58381. this.stepForward();
  58382. } else {
  58383. super.handleKeyDown(event2);
  58384. }
  58385. }
  58386. handleClick(event2) {
  58387. event2.stopPropagation();
  58388. event2.preventDefault();
  58389. }
  58390. vertical(bool) {
  58391. if (bool === void 0) {
  58392. return this.vertical_ || false;
  58393. }
  58394. this.vertical_ = !!bool;
  58395. if (this.vertical_) {
  58396. this.addClass("vjs-slider-vertical");
  58397. } else {
  58398. this.addClass("vjs-slider-horizontal");
  58399. }
  58400. }
  58401. }
  58402. Component$1$1.registerComponent("Slider", Slider$1);
  58403. const percentify$1 = (time, end) => clamp$1(time / end * 100, 0, 100).toFixed(2) + "%";
  58404. class LoadProgressBar$1 extends Component$1$1 {
  58405. constructor(player, options2) {
  58406. super(player, options2);
  58407. this.partEls_ = [];
  58408. this.on(player, "progress", (e) => this.update(e));
  58409. }
  58410. createEl() {
  58411. const el = super.createEl("div", {
  58412. className: "vjs-load-progress"
  58413. });
  58414. const wrapper = createEl$1("span", {
  58415. className: "vjs-control-text"
  58416. });
  58417. const loadedText = createEl$1("span", {
  58418. textContent: this.localize("Loaded")
  58419. });
  58420. const separator = document_1.createTextNode(": ");
  58421. this.percentageEl_ = createEl$1("span", {
  58422. className: "vjs-control-text-loaded-percentage",
  58423. textContent: "0%"
  58424. });
  58425. el.appendChild(wrapper);
  58426. wrapper.appendChild(loadedText);
  58427. wrapper.appendChild(separator);
  58428. wrapper.appendChild(this.percentageEl_);
  58429. return el;
  58430. }
  58431. dispose() {
  58432. this.partEls_ = null;
  58433. this.percentageEl_ = null;
  58434. super.dispose();
  58435. }
  58436. update(event2) {
  58437. this.requestNamedAnimationFrame("LoadProgressBar#update", () => {
  58438. const liveTracker = this.player_.liveTracker;
  58439. const buffered = this.player_.buffered();
  58440. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  58441. const bufferedEnd = this.player_.bufferedEnd();
  58442. const children = this.partEls_;
  58443. const percent = percentify$1(bufferedEnd, duration5);
  58444. if (this.percent_ !== percent) {
  58445. this.el_.style.width = percent;
  58446. textContent$1(this.percentageEl_, percent);
  58447. this.percent_ = percent;
  58448. }
  58449. for (let i2 = 0; i2 < buffered.length; i2++) {
  58450. const start2 = buffered.start(i2);
  58451. const end = buffered.end(i2);
  58452. let part = children[i2];
  58453. if (!part) {
  58454. part = this.el_.appendChild(createEl$1());
  58455. children[i2] = part;
  58456. }
  58457. if (part.dataset.start === start2 && part.dataset.end === end) {
  58458. continue;
  58459. }
  58460. part.dataset.start = start2;
  58461. part.dataset.end = end;
  58462. part.style.left = percentify$1(start2, bufferedEnd);
  58463. part.style.width = percentify$1(end - start2, bufferedEnd);
  58464. }
  58465. for (let i2 = children.length; i2 > buffered.length; i2--) {
  58466. this.el_.removeChild(children[i2 - 1]);
  58467. }
  58468. children.length = buffered.length;
  58469. });
  58470. }
  58471. }
  58472. Component$1$1.registerComponent("LoadProgressBar", LoadProgressBar$1);
  58473. class TimeTooltip$1 extends Component$1$1 {
  58474. constructor(player, options2) {
  58475. super(player, options2);
  58476. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58477. }
  58478. createEl() {
  58479. return super.createEl("div", {
  58480. className: "vjs-time-tooltip"
  58481. }, {
  58482. "aria-hidden": "true"
  58483. });
  58484. }
  58485. update(seekBarRect, seekBarPoint, content) {
  58486. const tooltipRect = findPosition$1(this.el_);
  58487. const playerRect = getBoundingClientRect$1(this.player_.el());
  58488. const seekBarPointPx = seekBarRect.width * seekBarPoint;
  58489. if (!playerRect || !tooltipRect) {
  58490. return;
  58491. }
  58492. const spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  58493. const spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  58494. let pullTooltipBy = tooltipRect.width / 2;
  58495. if (spaceLeftOfPoint < pullTooltipBy) {
  58496. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  58497. } else if (spaceRightOfPoint < pullTooltipBy) {
  58498. pullTooltipBy = spaceRightOfPoint;
  58499. }
  58500. if (pullTooltipBy < 0) {
  58501. pullTooltipBy = 0;
  58502. } else if (pullTooltipBy > tooltipRect.width) {
  58503. pullTooltipBy = tooltipRect.width;
  58504. }
  58505. pullTooltipBy = Math.round(pullTooltipBy);
  58506. this.el_.style.right = `-${pullTooltipBy}px`;
  58507. this.write(content);
  58508. }
  58509. write(content) {
  58510. textContent$1(this.el_, content);
  58511. }
  58512. updateTime(seekBarRect, seekBarPoint, time, cb) {
  58513. this.requestNamedAnimationFrame("TimeTooltip#updateTime", () => {
  58514. let content;
  58515. const duration5 = this.player_.duration();
  58516. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58517. const liveWindow = this.player_.liveTracker.liveWindow();
  58518. const secondsBehind = liveWindow - seekBarPoint * liveWindow;
  58519. content = (secondsBehind < 1 ? "" : "-") + formatTime$1(secondsBehind, liveWindow);
  58520. } else {
  58521. content = formatTime$1(time, duration5);
  58522. }
  58523. this.update(seekBarRect, seekBarPoint, content);
  58524. if (cb) {
  58525. cb();
  58526. }
  58527. });
  58528. }
  58529. }
  58530. Component$1$1.registerComponent("TimeTooltip", TimeTooltip$1);
  58531. class PlayProgressBar$1 extends Component$1$1 {
  58532. constructor(player, options2) {
  58533. super(player, options2);
  58534. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58535. }
  58536. createEl() {
  58537. return super.createEl("div", {
  58538. className: "vjs-play-progress vjs-slider-bar"
  58539. }, {
  58540. "aria-hidden": "true"
  58541. });
  58542. }
  58543. update(seekBarRect, seekBarPoint) {
  58544. const timeTooltip = this.getChild("timeTooltip");
  58545. if (!timeTooltip) {
  58546. return;
  58547. }
  58548. const time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58549. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  58550. }
  58551. }
  58552. PlayProgressBar$1.prototype.options_ = {
  58553. children: []
  58554. };
  58555. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58556. PlayProgressBar$1.prototype.options_.children.push("timeTooltip");
  58557. }
  58558. Component$1$1.registerComponent("PlayProgressBar", PlayProgressBar$1);
  58559. class MouseTimeDisplay$1 extends Component$1$1 {
  58560. constructor(player, options2) {
  58561. super(player, options2);
  58562. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58563. }
  58564. createEl() {
  58565. return super.createEl("div", {
  58566. className: "vjs-mouse-display"
  58567. });
  58568. }
  58569. update(seekBarRect, seekBarPoint) {
  58570. const time = seekBarPoint * this.player_.duration();
  58571. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, () => {
  58572. this.el_.style.left = `${seekBarRect.width * seekBarPoint}px`;
  58573. });
  58574. }
  58575. }
  58576. MouseTimeDisplay$1.prototype.options_ = {
  58577. children: ["timeTooltip"]
  58578. };
  58579. Component$1$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay$1);
  58580. const STEP_SECONDS$1 = 5;
  58581. const PAGE_KEY_MULTIPLIER$1 = 12;
  58582. class SeekBar$1 extends Slider$1 {
  58583. constructor(player, options2) {
  58584. super(player, options2);
  58585. this.setEventHandlers_();
  58586. }
  58587. setEventHandlers_() {
  58588. this.update_ = bind_(this, this.update);
  58589. this.update = throttle$1(this.update_, UPDATE_REFRESH_INTERVAL$1);
  58590. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58591. if (this.player_.liveTracker) {
  58592. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  58593. }
  58594. this.updateInterval = null;
  58595. this.enableIntervalHandler_ = (e) => this.enableInterval_(e);
  58596. this.disableIntervalHandler_ = (e) => this.disableInterval_(e);
  58597. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  58598. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58599. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58600. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  58601. }
  58602. }
  58603. toggleVisibility_(e) {
  58604. if (document_1.visibilityState === "hidden") {
  58605. this.cancelNamedAnimationFrame("SeekBar#update");
  58606. this.cancelNamedAnimationFrame("Slider#update");
  58607. this.disableInterval_(e);
  58608. } else {
  58609. if (!this.player_.ended() && !this.player_.paused()) {
  58610. this.enableInterval_();
  58611. }
  58612. this.update();
  58613. }
  58614. }
  58615. enableInterval_() {
  58616. if (this.updateInterval) {
  58617. return;
  58618. }
  58619. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL$1);
  58620. }
  58621. disableInterval_(e) {
  58622. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  58623. return;
  58624. }
  58625. if (!this.updateInterval) {
  58626. return;
  58627. }
  58628. this.clearInterval(this.updateInterval);
  58629. this.updateInterval = null;
  58630. }
  58631. createEl() {
  58632. return super.createEl("div", {
  58633. className: "vjs-progress-holder"
  58634. }, {
  58635. "aria-label": this.localize("Progress Bar")
  58636. });
  58637. }
  58638. update(event2) {
  58639. if (document_1.visibilityState === "hidden") {
  58640. return;
  58641. }
  58642. const percent = super.update();
  58643. this.requestNamedAnimationFrame("SeekBar#update", () => {
  58644. const currentTime = this.player_.ended() ? this.player_.duration() : this.getCurrentTime_();
  58645. const liveTracker = this.player_.liveTracker;
  58646. let duration5 = this.player_.duration();
  58647. if (liveTracker && liveTracker.isLive()) {
  58648. duration5 = this.player_.liveTracker.liveCurrentTime();
  58649. }
  58650. if (this.percent_ !== percent) {
  58651. this.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  58652. this.percent_ = percent;
  58653. }
  58654. if (this.currentTime_ !== currentTime || this.duration_ !== duration5) {
  58655. this.el_.setAttribute("aria-valuetext", this.localize("progress bar timing: currentTime={1} duration={2}", [formatTime$1(currentTime, duration5), formatTime$1(duration5, duration5)], "{1} of {2}"));
  58656. this.currentTime_ = currentTime;
  58657. this.duration_ = duration5;
  58658. }
  58659. if (this.bar) {
  58660. this.bar.update(getBoundingClientRect$1(this.el()), this.getProgress());
  58661. }
  58662. });
  58663. return percent;
  58664. }
  58665. userSeek_(ct2) {
  58666. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58667. this.player_.liveTracker.nextSeekedFromUser();
  58668. }
  58669. this.player_.currentTime(ct2);
  58670. }
  58671. getCurrentTime_() {
  58672. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58673. }
  58674. getPercent() {
  58675. const currentTime = this.getCurrentTime_();
  58676. let percent;
  58677. const liveTracker = this.player_.liveTracker;
  58678. if (liveTracker && liveTracker.isLive()) {
  58679. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  58680. if (liveTracker.atLiveEdge()) {
  58681. percent = 1;
  58682. }
  58683. } else {
  58684. percent = currentTime / this.player_.duration();
  58685. }
  58686. return percent;
  58687. }
  58688. handleMouseDown(event2) {
  58689. if (!isSingleLeftClick$1(event2)) {
  58690. return;
  58691. }
  58692. event2.stopPropagation();
  58693. this.videoWasPlaying = !this.player_.paused();
  58694. this.player_.pause();
  58695. super.handleMouseDown(event2);
  58696. }
  58697. handleMouseMove(event2, mouseDown = false) {
  58698. if (!isSingleLeftClick$1(event2)) {
  58699. return;
  58700. }
  58701. if (!mouseDown && !this.player_.scrubbing()) {
  58702. this.player_.scrubbing(true);
  58703. }
  58704. let newTime;
  58705. const distance2 = this.calculateDistance(event2);
  58706. const liveTracker = this.player_.liveTracker;
  58707. if (!liveTracker || !liveTracker.isLive()) {
  58708. newTime = distance2 * this.player_.duration();
  58709. if (newTime === this.player_.duration()) {
  58710. newTime = newTime - 0.1;
  58711. }
  58712. } else {
  58713. if (distance2 >= 0.99) {
  58714. liveTracker.seekToLiveEdge();
  58715. return;
  58716. }
  58717. const seekableStart = liveTracker.seekableStart();
  58718. const seekableEnd = liveTracker.liveCurrentTime();
  58719. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  58720. if (newTime >= seekableEnd) {
  58721. newTime = seekableEnd;
  58722. }
  58723. if (newTime <= seekableStart) {
  58724. newTime = seekableStart + 0.1;
  58725. }
  58726. if (newTime === Infinity) {
  58727. return;
  58728. }
  58729. }
  58730. this.userSeek_(newTime);
  58731. }
  58732. enable() {
  58733. super.enable();
  58734. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58735. if (!mouseTimeDisplay) {
  58736. return;
  58737. }
  58738. mouseTimeDisplay.show();
  58739. }
  58740. disable() {
  58741. super.disable();
  58742. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58743. if (!mouseTimeDisplay) {
  58744. return;
  58745. }
  58746. mouseTimeDisplay.hide();
  58747. }
  58748. handleMouseUp(event2) {
  58749. super.handleMouseUp(event2);
  58750. if (event2) {
  58751. event2.stopPropagation();
  58752. }
  58753. this.player_.scrubbing(false);
  58754. this.player_.trigger({
  58755. type: "timeupdate",
  58756. target: this,
  58757. manuallyTriggered: true
  58758. });
  58759. if (this.videoWasPlaying) {
  58760. silencePromise$1(this.player_.play());
  58761. } else {
  58762. this.update_();
  58763. }
  58764. }
  58765. stepForward() {
  58766. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1);
  58767. }
  58768. stepBack() {
  58769. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1);
  58770. }
  58771. handleAction(event2) {
  58772. if (this.player_.paused()) {
  58773. this.player_.play();
  58774. } else {
  58775. this.player_.pause();
  58776. }
  58777. }
  58778. handleKeyDown(event2) {
  58779. const liveTracker = this.player_.liveTracker;
  58780. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  58781. event2.preventDefault();
  58782. event2.stopPropagation();
  58783. this.handleAction(event2);
  58784. } else if (keycode.isEventKey(event2, "Home")) {
  58785. event2.preventDefault();
  58786. event2.stopPropagation();
  58787. this.userSeek_(0);
  58788. } else if (keycode.isEventKey(event2, "End")) {
  58789. event2.preventDefault();
  58790. event2.stopPropagation();
  58791. if (liveTracker && liveTracker.isLive()) {
  58792. this.userSeek_(liveTracker.liveCurrentTime());
  58793. } else {
  58794. this.userSeek_(this.player_.duration());
  58795. }
  58796. } else if (/^[0-9]$/.test(keycode(event2))) {
  58797. event2.preventDefault();
  58798. event2.stopPropagation();
  58799. const gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  58800. if (liveTracker && liveTracker.isLive()) {
  58801. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  58802. } else {
  58803. this.userSeek_(this.player_.duration() * gotoFraction);
  58804. }
  58805. } else if (keycode.isEventKey(event2, "PgDn")) {
  58806. event2.preventDefault();
  58807. event2.stopPropagation();
  58808. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58809. } else if (keycode.isEventKey(event2, "PgUp")) {
  58810. event2.preventDefault();
  58811. event2.stopPropagation();
  58812. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58813. } else {
  58814. super.handleKeyDown(event2);
  58815. }
  58816. }
  58817. dispose() {
  58818. this.disableInterval_();
  58819. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58820. if (this.player_.liveTracker) {
  58821. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  58822. }
  58823. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  58824. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58825. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58826. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  58827. }
  58828. super.dispose();
  58829. }
  58830. }
  58831. SeekBar$1.prototype.options_ = {
  58832. children: ["loadProgressBar", "playProgressBar"],
  58833. barName: "playProgressBar"
  58834. };
  58835. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58836. SeekBar$1.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  58837. }
  58838. Component$1$1.registerComponent("SeekBar", SeekBar$1);
  58839. class ProgressControl$1 extends Component$1$1 {
  58840. constructor(player, options2) {
  58841. super(player, options2);
  58842. this.handleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  58843. this.throttledHandleMouseSeek = throttle$1(bind_(this, this.handleMouseSeek), UPDATE_REFRESH_INTERVAL$1);
  58844. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  58845. this.handleMouseDownHandler_ = (e) => this.handleMouseDown(e);
  58846. this.enable();
  58847. }
  58848. createEl() {
  58849. return super.createEl("div", {
  58850. className: "vjs-progress-control vjs-control"
  58851. });
  58852. }
  58853. handleMouseMove(event2) {
  58854. const seekBar = this.getChild("seekBar");
  58855. if (!seekBar) {
  58856. return;
  58857. }
  58858. const playProgressBar = seekBar.getChild("playProgressBar");
  58859. const mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  58860. if (!playProgressBar && !mouseTimeDisplay) {
  58861. return;
  58862. }
  58863. const seekBarEl = seekBar.el();
  58864. const seekBarRect = findPosition$1(seekBarEl);
  58865. let seekBarPoint = getPointerPosition$1(seekBarEl, event2).x;
  58866. seekBarPoint = clamp$1(seekBarPoint, 0, 1);
  58867. if (mouseTimeDisplay) {
  58868. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  58869. }
  58870. if (playProgressBar) {
  58871. playProgressBar.update(seekBarRect, seekBar.getProgress());
  58872. }
  58873. }
  58874. handleMouseSeek(event2) {
  58875. const seekBar = this.getChild("seekBar");
  58876. if (seekBar) {
  58877. seekBar.handleMouseMove(event2);
  58878. }
  58879. }
  58880. enabled() {
  58881. return this.enabled_;
  58882. }
  58883. disable() {
  58884. this.children().forEach((child) => child.disable && child.disable());
  58885. if (!this.enabled()) {
  58886. return;
  58887. }
  58888. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58889. this.off(this.el_, "mousemove", this.handleMouseMove);
  58890. this.removeListenersAddedOnMousedownAndTouchstart();
  58891. this.addClass("disabled");
  58892. this.enabled_ = false;
  58893. if (this.player_.scrubbing()) {
  58894. const seekBar = this.getChild("seekBar");
  58895. this.player_.scrubbing(false);
  58896. if (seekBar.videoWasPlaying) {
  58897. silencePromise$1(this.player_.play());
  58898. }
  58899. }
  58900. }
  58901. enable() {
  58902. this.children().forEach((child) => child.enable && child.enable());
  58903. if (this.enabled()) {
  58904. return;
  58905. }
  58906. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58907. this.on(this.el_, "mousemove", this.handleMouseMove);
  58908. this.removeClass("disabled");
  58909. this.enabled_ = true;
  58910. }
  58911. removeListenersAddedOnMousedownAndTouchstart() {
  58912. const doc = this.el_.ownerDocument;
  58913. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  58914. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  58915. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  58916. this.off(doc, "touchend", this.handleMouseUpHandler_);
  58917. }
  58918. handleMouseDown(event2) {
  58919. const doc = this.el_.ownerDocument;
  58920. const seekBar = this.getChild("seekBar");
  58921. if (seekBar) {
  58922. seekBar.handleMouseDown(event2);
  58923. }
  58924. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  58925. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  58926. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  58927. this.on(doc, "touchend", this.handleMouseUpHandler_);
  58928. }
  58929. handleMouseUp(event2) {
  58930. const seekBar = this.getChild("seekBar");
  58931. if (seekBar) {
  58932. seekBar.handleMouseUp(event2);
  58933. }
  58934. this.removeListenersAddedOnMousedownAndTouchstart();
  58935. }
  58936. }
  58937. ProgressControl$1.prototype.options_ = {
  58938. children: ["seekBar"]
  58939. };
  58940. Component$1$1.registerComponent("ProgressControl", ProgressControl$1);
  58941. class PictureInPictureToggle$1 extends Button$1 {
  58942. constructor(player, options2) {
  58943. super(player, options2);
  58944. this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], (e) => this.handlePictureInPictureChange(e));
  58945. this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], (e) => this.handlePictureInPictureEnabledChange(e));
  58946. this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], () => {
  58947. const isSourceAudio = player.currentType().substring(0, 5) === "audio";
  58948. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  58949. if (player.isInPictureInPicture()) {
  58950. player.exitPictureInPicture();
  58951. }
  58952. this.hide();
  58953. } else {
  58954. this.show();
  58955. }
  58956. });
  58957. this.disable();
  58958. }
  58959. buildCSSClass() {
  58960. return `vjs-picture-in-picture-control ${super.buildCSSClass()}`;
  58961. }
  58962. handlePictureInPictureEnabledChange() {
  58963. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false || this.player_.options_.enableDocumentPictureInPicture && "documentPictureInPicture" in window_1) {
  58964. this.enable();
  58965. } else {
  58966. this.disable();
  58967. }
  58968. }
  58969. handlePictureInPictureChange(event2) {
  58970. if (this.player_.isInPictureInPicture()) {
  58971. this.controlText("Exit Picture-in-Picture");
  58972. } else {
  58973. this.controlText("Picture-in-Picture");
  58974. }
  58975. this.handlePictureInPictureEnabledChange();
  58976. }
  58977. handleClick(event2) {
  58978. if (!this.player_.isInPictureInPicture()) {
  58979. this.player_.requestPictureInPicture();
  58980. } else {
  58981. this.player_.exitPictureInPicture();
  58982. }
  58983. }
  58984. }
  58985. PictureInPictureToggle$1.prototype.controlText_ = "Picture-in-Picture";
  58986. Component$1$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle$1);
  58987. class FullscreenToggle$1 extends Button$1 {
  58988. constructor(player, options2) {
  58989. super(player, options2);
  58990. this.on(player, "fullscreenchange", (e) => this.handleFullscreenChange(e));
  58991. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  58992. this.disable();
  58993. }
  58994. }
  58995. buildCSSClass() {
  58996. return `vjs-fullscreen-control ${super.buildCSSClass()}`;
  58997. }
  58998. handleFullscreenChange(event2) {
  58999. if (this.player_.isFullscreen()) {
  59000. this.controlText("Exit Fullscreen");
  59001. } else {
  59002. this.controlText("Fullscreen");
  59003. }
  59004. }
  59005. handleClick(event2) {
  59006. if (!this.player_.isFullscreen()) {
  59007. this.player_.requestFullscreen();
  59008. } else {
  59009. this.player_.exitFullscreen();
  59010. }
  59011. }
  59012. }
  59013. FullscreenToggle$1.prototype.controlText_ = "Fullscreen";
  59014. Component$1$1.registerComponent("FullscreenToggle", FullscreenToggle$1);
  59015. const checkVolumeSupport$1 = function(self2, player) {
  59016. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  59017. self2.addClass("vjs-hidden");
  59018. }
  59019. self2.on(player, "loadstart", function() {
  59020. if (!player.tech_.featuresVolumeControl) {
  59021. self2.addClass("vjs-hidden");
  59022. } else {
  59023. self2.removeClass("vjs-hidden");
  59024. }
  59025. });
  59026. };
  59027. class VolumeLevel$1 extends Component$1$1 {
  59028. createEl() {
  59029. const el = super.createEl("div", {
  59030. className: "vjs-volume-level"
  59031. });
  59032. el.appendChild(super.createEl("span", {
  59033. className: "vjs-control-text"
  59034. }));
  59035. return el;
  59036. }
  59037. }
  59038. Component$1$1.registerComponent("VolumeLevel", VolumeLevel$1);
  59039. class VolumeLevelTooltip$1 extends Component$1$1 {
  59040. constructor(player, options2) {
  59041. super(player, options2);
  59042. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59043. }
  59044. createEl() {
  59045. return super.createEl("div", {
  59046. className: "vjs-volume-tooltip"
  59047. }, {
  59048. "aria-hidden": "true"
  59049. });
  59050. }
  59051. update(rangeBarRect, rangeBarPoint, vertical, content) {
  59052. if (!vertical) {
  59053. const tooltipRect = getBoundingClientRect$1(this.el_);
  59054. const playerRect = getBoundingClientRect$1(this.player_.el());
  59055. const volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  59056. if (!playerRect || !tooltipRect) {
  59057. return;
  59058. }
  59059. const spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  59060. const spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  59061. let pullTooltipBy = tooltipRect.width / 2;
  59062. if (spaceLeftOfPoint < pullTooltipBy) {
  59063. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  59064. } else if (spaceRightOfPoint < pullTooltipBy) {
  59065. pullTooltipBy = spaceRightOfPoint;
  59066. }
  59067. if (pullTooltipBy < 0) {
  59068. pullTooltipBy = 0;
  59069. } else if (pullTooltipBy > tooltipRect.width) {
  59070. pullTooltipBy = tooltipRect.width;
  59071. }
  59072. this.el_.style.right = `-${pullTooltipBy}px`;
  59073. }
  59074. this.write(`${content}%`);
  59075. }
  59076. write(content) {
  59077. textContent$1(this.el_, content);
  59078. }
  59079. updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  59080. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", () => {
  59081. this.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  59082. if (cb) {
  59083. cb();
  59084. }
  59085. });
  59086. }
  59087. }
  59088. Component$1$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip$1);
  59089. class MouseVolumeLevelDisplay$1 extends Component$1$1 {
  59090. constructor(player, options2) {
  59091. super(player, options2);
  59092. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59093. }
  59094. createEl() {
  59095. return super.createEl("div", {
  59096. className: "vjs-mouse-display"
  59097. });
  59098. }
  59099. update(rangeBarRect, rangeBarPoint, vertical) {
  59100. const volume = 100 * rangeBarPoint;
  59101. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, () => {
  59102. if (vertical) {
  59103. this.el_.style.bottom = `${rangeBarRect.height * rangeBarPoint}px`;
  59104. } else {
  59105. this.el_.style.left = `${rangeBarRect.width * rangeBarPoint}px`;
  59106. }
  59107. });
  59108. }
  59109. }
  59110. MouseVolumeLevelDisplay$1.prototype.options_ = {
  59111. children: ["volumeLevelTooltip"]
  59112. };
  59113. Component$1$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay$1);
  59114. class VolumeBar$1 extends Slider$1 {
  59115. constructor(player, options2) {
  59116. super(player, options2);
  59117. this.on("slideractive", (e) => this.updateLastVolume_(e));
  59118. this.on(player, "volumechange", (e) => this.updateARIAAttributes(e));
  59119. player.ready(() => this.updateARIAAttributes());
  59120. }
  59121. createEl() {
  59122. return super.createEl("div", {
  59123. className: "vjs-volume-bar vjs-slider-bar"
  59124. }, {
  59125. "aria-label": this.localize("Volume Level"),
  59126. "aria-live": "polite"
  59127. });
  59128. }
  59129. handleMouseDown(event2) {
  59130. if (!isSingleLeftClick$1(event2)) {
  59131. return;
  59132. }
  59133. super.handleMouseDown(event2);
  59134. }
  59135. handleMouseMove(event2) {
  59136. const mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  59137. if (mouseVolumeLevelDisplay) {
  59138. const volumeBarEl = this.el();
  59139. const volumeBarRect = getBoundingClientRect$1(volumeBarEl);
  59140. const vertical = this.vertical();
  59141. let volumeBarPoint = getPointerPosition$1(volumeBarEl, event2);
  59142. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  59143. volumeBarPoint = clamp$1(volumeBarPoint, 0, 1);
  59144. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  59145. }
  59146. if (!isSingleLeftClick$1(event2)) {
  59147. return;
  59148. }
  59149. this.checkMuted();
  59150. this.player_.volume(this.calculateDistance(event2));
  59151. }
  59152. checkMuted() {
  59153. if (this.player_.muted()) {
  59154. this.player_.muted(false);
  59155. }
  59156. }
  59157. getPercent() {
  59158. if (this.player_.muted()) {
  59159. return 0;
  59160. }
  59161. return this.player_.volume();
  59162. }
  59163. stepForward() {
  59164. this.checkMuted();
  59165. this.player_.volume(this.player_.volume() + 0.1);
  59166. }
  59167. stepBack() {
  59168. this.checkMuted();
  59169. this.player_.volume(this.player_.volume() - 0.1);
  59170. }
  59171. updateARIAAttributes(event2) {
  59172. const ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  59173. this.el_.setAttribute("aria-valuenow", ariaValue);
  59174. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  59175. }
  59176. volumeAsPercentage_() {
  59177. return Math.round(this.player_.volume() * 100);
  59178. }
  59179. updateLastVolume_() {
  59180. const volumeBeforeDrag = this.player_.volume();
  59181. this.one("sliderinactive", () => {
  59182. if (this.player_.volume() === 0) {
  59183. this.player_.lastVolume_(volumeBeforeDrag);
  59184. }
  59185. });
  59186. }
  59187. }
  59188. VolumeBar$1.prototype.options_ = {
  59189. children: ["volumeLevel"],
  59190. barName: "volumeLevel"
  59191. };
  59192. if (!IS_IOS$1 && !IS_ANDROID$1) {
  59193. VolumeBar$1.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  59194. }
  59195. VolumeBar$1.prototype.playerEvent = "volumechange";
  59196. Component$1$1.registerComponent("VolumeBar", VolumeBar$1);
  59197. class VolumeControl$1 extends Component$1$1 {
  59198. constructor(player, options2 = {}) {
  59199. options2.vertical = options2.vertical || false;
  59200. if (typeof options2.volumeBar === "undefined" || isPlain$1(options2.volumeBar)) {
  59201. options2.volumeBar = options2.volumeBar || {};
  59202. options2.volumeBar.vertical = options2.vertical;
  59203. }
  59204. super(player, options2);
  59205. checkVolumeSupport$1(this, player);
  59206. this.throttledHandleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  59207. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  59208. this.on("mousedown", (e) => this.handleMouseDown(e));
  59209. this.on("touchstart", (e) => this.handleMouseDown(e));
  59210. this.on("mousemove", (e) => this.handleMouseMove(e));
  59211. this.on(this.volumeBar, ["focus", "slideractive"], () => {
  59212. this.volumeBar.addClass("vjs-slider-active");
  59213. this.addClass("vjs-slider-active");
  59214. this.trigger("slideractive");
  59215. });
  59216. this.on(this.volumeBar, ["blur", "sliderinactive"], () => {
  59217. this.volumeBar.removeClass("vjs-slider-active");
  59218. this.removeClass("vjs-slider-active");
  59219. this.trigger("sliderinactive");
  59220. });
  59221. }
  59222. createEl() {
  59223. let orientationClass = "vjs-volume-horizontal";
  59224. if (this.options_.vertical) {
  59225. orientationClass = "vjs-volume-vertical";
  59226. }
  59227. return super.createEl("div", {
  59228. className: `vjs-volume-control vjs-control ${orientationClass}`
  59229. });
  59230. }
  59231. handleMouseDown(event2) {
  59232. const doc = this.el_.ownerDocument;
  59233. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  59234. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  59235. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  59236. this.on(doc, "touchend", this.handleMouseUpHandler_);
  59237. }
  59238. handleMouseUp(event2) {
  59239. const doc = this.el_.ownerDocument;
  59240. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  59241. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  59242. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  59243. this.off(doc, "touchend", this.handleMouseUpHandler_);
  59244. }
  59245. handleMouseMove(event2) {
  59246. this.volumeBar.handleMouseMove(event2);
  59247. }
  59248. }
  59249. VolumeControl$1.prototype.options_ = {
  59250. children: ["volumeBar"]
  59251. };
  59252. Component$1$1.registerComponent("VolumeControl", VolumeControl$1);
  59253. const checkMuteSupport$1 = function(self2, player) {
  59254. if (player.tech_ && !player.tech_.featuresMuteControl) {
  59255. self2.addClass("vjs-hidden");
  59256. }
  59257. self2.on(player, "loadstart", function() {
  59258. if (!player.tech_.featuresMuteControl) {
  59259. self2.addClass("vjs-hidden");
  59260. } else {
  59261. self2.removeClass("vjs-hidden");
  59262. }
  59263. });
  59264. };
  59265. class MuteToggle$1 extends Button$1 {
  59266. constructor(player, options2) {
  59267. super(player, options2);
  59268. checkMuteSupport$1(this, player);
  59269. this.on(player, ["loadstart", "volumechange"], (e) => this.update(e));
  59270. }
  59271. buildCSSClass() {
  59272. return `vjs-mute-control ${super.buildCSSClass()}`;
  59273. }
  59274. handleClick(event2) {
  59275. const vol = this.player_.volume();
  59276. const lastVolume = this.player_.lastVolume_();
  59277. if (vol === 0) {
  59278. const volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  59279. this.player_.volume(volumeToSet);
  59280. this.player_.muted(false);
  59281. } else {
  59282. this.player_.muted(this.player_.muted() ? false : true);
  59283. }
  59284. }
  59285. update(event2) {
  59286. this.updateIcon_();
  59287. this.updateControlText_();
  59288. }
  59289. updateIcon_() {
  59290. const vol = this.player_.volume();
  59291. let level = 3;
  59292. if (IS_IOS$1 && this.player_.tech_ && this.player_.tech_.el_) {
  59293. this.player_.muted(this.player_.tech_.el_.muted);
  59294. }
  59295. if (vol === 0 || this.player_.muted()) {
  59296. level = 0;
  59297. } else if (vol < 0.33) {
  59298. level = 1;
  59299. } else if (vol < 0.67) {
  59300. level = 2;
  59301. }
  59302. removeClass$1(this.el_, [0, 1, 2, 3].reduce((str, i2) => str + `${i2 ? " " : ""}vjs-vol-${i2}`, ""));
  59303. addClass$1(this.el_, `vjs-vol-${level}`);
  59304. }
  59305. updateControlText_() {
  59306. const soundOff = this.player_.muted() || this.player_.volume() === 0;
  59307. const text = soundOff ? "Unmute" : "Mute";
  59308. if (this.controlText() !== text) {
  59309. this.controlText(text);
  59310. }
  59311. }
  59312. }
  59313. MuteToggle$1.prototype.controlText_ = "Mute";
  59314. Component$1$1.registerComponent("MuteToggle", MuteToggle$1);
  59315. class VolumePanel$1 extends Component$1$1 {
  59316. constructor(player, options2 = {}) {
  59317. if (typeof options2.inline !== "undefined") {
  59318. options2.inline = options2.inline;
  59319. } else {
  59320. options2.inline = true;
  59321. }
  59322. if (typeof options2.volumeControl === "undefined" || isPlain$1(options2.volumeControl)) {
  59323. options2.volumeControl = options2.volumeControl || {};
  59324. options2.volumeControl.vertical = !options2.inline;
  59325. }
  59326. super(player, options2);
  59327. this.handleKeyPressHandler_ = (e) => this.handleKeyPress(e);
  59328. this.on(player, ["loadstart"], (e) => this.volumePanelState_(e));
  59329. this.on(this.muteToggle, "keyup", (e) => this.handleKeyPress(e));
  59330. this.on(this.volumeControl, "keyup", (e) => this.handleVolumeControlKeyUp(e));
  59331. this.on("keydown", (e) => this.handleKeyPress(e));
  59332. this.on("mouseover", (e) => this.handleMouseOver(e));
  59333. this.on("mouseout", (e) => this.handleMouseOut(e));
  59334. this.on(this.volumeControl, ["slideractive"], this.sliderActive_);
  59335. this.on(this.volumeControl, ["sliderinactive"], this.sliderInactive_);
  59336. }
  59337. sliderActive_() {
  59338. this.addClass("vjs-slider-active");
  59339. }
  59340. sliderInactive_() {
  59341. this.removeClass("vjs-slider-active");
  59342. }
  59343. volumePanelState_() {
  59344. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  59345. this.addClass("vjs-hidden");
  59346. }
  59347. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  59348. this.addClass("vjs-mute-toggle-only");
  59349. }
  59350. }
  59351. createEl() {
  59352. let orientationClass = "vjs-volume-panel-horizontal";
  59353. if (!this.options_.inline) {
  59354. orientationClass = "vjs-volume-panel-vertical";
  59355. }
  59356. return super.createEl("div", {
  59357. className: `vjs-volume-panel vjs-control ${orientationClass}`
  59358. });
  59359. }
  59360. dispose() {
  59361. this.handleMouseOut();
  59362. super.dispose();
  59363. }
  59364. handleVolumeControlKeyUp(event2) {
  59365. if (keycode.isEventKey(event2, "Esc")) {
  59366. this.muteToggle.focus();
  59367. }
  59368. }
  59369. handleMouseOver(event2) {
  59370. this.addClass("vjs-hover");
  59371. on$1(document_1, "keyup", this.handleKeyPressHandler_);
  59372. }
  59373. handleMouseOut(event2) {
  59374. this.removeClass("vjs-hover");
  59375. off$1(document_1, "keyup", this.handleKeyPressHandler_);
  59376. }
  59377. handleKeyPress(event2) {
  59378. if (keycode.isEventKey(event2, "Esc")) {
  59379. this.handleMouseOut();
  59380. }
  59381. }
  59382. }
  59383. VolumePanel$1.prototype.options_ = {
  59384. children: ["muteToggle", "volumeControl"]
  59385. };
  59386. Component$1$1.registerComponent("VolumePanel", VolumePanel$1);
  59387. class SkipForward extends Button$1 {
  59388. constructor(player, options2) {
  59389. super(player, options2);
  59390. this.validOptions = [5, 10, 30];
  59391. this.skipTime = this.getSkipForwardTime();
  59392. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59393. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59394. this.show();
  59395. } else {
  59396. this.hide();
  59397. }
  59398. }
  59399. getSkipForwardTime() {
  59400. const playerOptions = this.options_.playerOptions;
  59401. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.forward;
  59402. }
  59403. buildCSSClass() {
  59404. return `vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`;
  59405. }
  59406. handleClick(event2) {
  59407. const currentVideoTime = this.player_.currentTime();
  59408. const liveTracker = this.player_.liveTracker;
  59409. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  59410. let newTime;
  59411. if (currentVideoTime + this.skipTime <= duration5) {
  59412. newTime = currentVideoTime + this.skipTime;
  59413. } else {
  59414. newTime = duration5;
  59415. }
  59416. this.player_.currentTime(newTime);
  59417. }
  59418. handleLanguagechange() {
  59419. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59420. }
  59421. }
  59422. Component$1$1.registerComponent("SkipForward", SkipForward);
  59423. class SkipBackward extends Button$1 {
  59424. constructor(player, options2) {
  59425. super(player, options2);
  59426. this.validOptions = [5, 10, 30];
  59427. this.skipTime = this.getSkipBackwardTime();
  59428. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59429. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59430. this.show();
  59431. } else {
  59432. this.hide();
  59433. }
  59434. }
  59435. getSkipBackwardTime() {
  59436. const playerOptions = this.options_.playerOptions;
  59437. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.backward;
  59438. }
  59439. buildCSSClass() {
  59440. return `vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`;
  59441. }
  59442. handleClick(event2) {
  59443. const currentVideoTime = this.player_.currentTime();
  59444. const liveTracker = this.player_.liveTracker;
  59445. const seekableStart = liveTracker && liveTracker.isLive() && liveTracker.seekableStart();
  59446. let newTime;
  59447. if (seekableStart && currentVideoTime - this.skipTime <= seekableStart) {
  59448. newTime = seekableStart;
  59449. } else if (currentVideoTime >= this.skipTime) {
  59450. newTime = currentVideoTime - this.skipTime;
  59451. } else {
  59452. newTime = 0;
  59453. }
  59454. this.player_.currentTime(newTime);
  59455. }
  59456. handleLanguagechange() {
  59457. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59458. }
  59459. }
  59460. SkipBackward.prototype.controlText_ = "Skip Backward";
  59461. Component$1$1.registerComponent("SkipBackward", SkipBackward);
  59462. class Menu$1 extends Component$1$1 {
  59463. constructor(player, options2) {
  59464. super(player, options2);
  59465. if (options2) {
  59466. this.menuButton_ = options2.menuButton;
  59467. }
  59468. this.focusedChild_ = -1;
  59469. this.on("keydown", (e) => this.handleKeyDown(e));
  59470. this.boundHandleBlur_ = (e) => this.handleBlur(e);
  59471. this.boundHandleTapClick_ = (e) => this.handleTapClick(e);
  59472. }
  59473. addEventListenerForItem(component) {
  59474. if (!(component instanceof Component$1$1)) {
  59475. return;
  59476. }
  59477. this.on(component, "blur", this.boundHandleBlur_);
  59478. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  59479. }
  59480. removeEventListenerForItem(component) {
  59481. if (!(component instanceof Component$1$1)) {
  59482. return;
  59483. }
  59484. this.off(component, "blur", this.boundHandleBlur_);
  59485. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  59486. }
  59487. removeChild(component) {
  59488. if (typeof component === "string") {
  59489. component = this.getChild(component);
  59490. }
  59491. this.removeEventListenerForItem(component);
  59492. super.removeChild(component);
  59493. }
  59494. addItem(component) {
  59495. const childComponent = this.addChild(component);
  59496. if (childComponent) {
  59497. this.addEventListenerForItem(childComponent);
  59498. }
  59499. }
  59500. createEl() {
  59501. const contentElType = this.options_.contentElType || "ul";
  59502. this.contentEl_ = createEl$1(contentElType, {
  59503. className: "vjs-menu-content"
  59504. });
  59505. this.contentEl_.setAttribute("role", "menu");
  59506. const el = super.createEl("div", {
  59507. append: this.contentEl_,
  59508. className: "vjs-menu"
  59509. });
  59510. el.appendChild(this.contentEl_);
  59511. on$1(el, "click", function(event2) {
  59512. event2.preventDefault();
  59513. event2.stopImmediatePropagation();
  59514. });
  59515. return el;
  59516. }
  59517. dispose() {
  59518. this.contentEl_ = null;
  59519. this.boundHandleBlur_ = null;
  59520. this.boundHandleTapClick_ = null;
  59521. super.dispose();
  59522. }
  59523. handleBlur(event2) {
  59524. const relatedTarget = event2.relatedTarget || document_1.activeElement;
  59525. if (!this.children().some((element) => {
  59526. return element.el() === relatedTarget;
  59527. })) {
  59528. const btn = this.menuButton_;
  59529. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  59530. btn.unpressButton();
  59531. }
  59532. }
  59533. }
  59534. handleTapClick(event2) {
  59535. if (this.menuButton_) {
  59536. this.menuButton_.unpressButton();
  59537. const childComponents = this.children();
  59538. if (!Array.isArray(childComponents)) {
  59539. return;
  59540. }
  59541. const foundComponent = childComponents.filter((component) => component.el() === event2.target)[0];
  59542. if (!foundComponent) {
  59543. return;
  59544. }
  59545. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  59546. this.menuButton_.focus();
  59547. }
  59548. }
  59549. }
  59550. handleKeyDown(event2) {
  59551. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  59552. event2.preventDefault();
  59553. event2.stopPropagation();
  59554. this.stepForward();
  59555. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  59556. event2.preventDefault();
  59557. event2.stopPropagation();
  59558. this.stepBack();
  59559. }
  59560. }
  59561. stepForward() {
  59562. let stepChild = 0;
  59563. if (this.focusedChild_ !== void 0) {
  59564. stepChild = this.focusedChild_ + 1;
  59565. }
  59566. this.focus(stepChild);
  59567. }
  59568. stepBack() {
  59569. let stepChild = 0;
  59570. if (this.focusedChild_ !== void 0) {
  59571. stepChild = this.focusedChild_ - 1;
  59572. }
  59573. this.focus(stepChild);
  59574. }
  59575. focus(item = 0) {
  59576. const children = this.children().slice();
  59577. const haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  59578. if (haveTitle) {
  59579. children.shift();
  59580. }
  59581. if (children.length > 0) {
  59582. if (item < 0) {
  59583. item = 0;
  59584. } else if (item >= children.length) {
  59585. item = children.length - 1;
  59586. }
  59587. this.focusedChild_ = item;
  59588. children[item].el_.focus();
  59589. }
  59590. }
  59591. }
  59592. Component$1$1.registerComponent("Menu", Menu$1);
  59593. class MenuButton$1 extends Component$1$1 {
  59594. constructor(player, options2 = {}) {
  59595. super(player, options2);
  59596. this.menuButton_ = new Button$1(player, options2);
  59597. this.menuButton_.controlText(this.controlText_);
  59598. this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  59599. const buttonClass = Button$1.prototype.buildCSSClass();
  59600. this.menuButton_.el_.className = this.buildCSSClass() + " " + buttonClass;
  59601. this.menuButton_.removeClass("vjs-control");
  59602. this.addChild(this.menuButton_);
  59603. this.update();
  59604. this.enabled_ = true;
  59605. const handleClick = (e) => this.handleClick(e);
  59606. this.handleMenuKeyUp_ = (e) => this.handleMenuKeyUp(e);
  59607. this.on(this.menuButton_, "tap", handleClick);
  59608. this.on(this.menuButton_, "click", handleClick);
  59609. this.on(this.menuButton_, "keydown", (e) => this.handleKeyDown(e));
  59610. this.on(this.menuButton_, "mouseenter", () => {
  59611. this.addClass("vjs-hover");
  59612. this.menu.show();
  59613. on$1(document_1, "keyup", this.handleMenuKeyUp_);
  59614. });
  59615. this.on("mouseleave", (e) => this.handleMouseLeave(e));
  59616. this.on("keydown", (e) => this.handleSubmenuKeyDown(e));
  59617. }
  59618. update() {
  59619. const menu = this.createMenu();
  59620. if (this.menu) {
  59621. this.menu.dispose();
  59622. this.removeChild(this.menu);
  59623. }
  59624. this.menu = menu;
  59625. this.addChild(menu);
  59626. this.buttonPressed_ = false;
  59627. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59628. if (this.items && this.items.length <= this.hideThreshold_) {
  59629. this.hide();
  59630. this.menu.contentEl_.removeAttribute("role");
  59631. } else {
  59632. this.show();
  59633. this.menu.contentEl_.setAttribute("role", "menu");
  59634. }
  59635. }
  59636. createMenu() {
  59637. const menu = new Menu$1(this.player_, {
  59638. menuButton: this
  59639. });
  59640. this.hideThreshold_ = 0;
  59641. if (this.options_.title) {
  59642. const titleEl = createEl$1("li", {
  59643. className: "vjs-menu-title",
  59644. textContent: toTitleCase$1$1(this.options_.title),
  59645. tabIndex: -1
  59646. });
  59647. const titleComponent = new Component$1$1(this.player_, {
  59648. el: titleEl
  59649. });
  59650. menu.addItem(titleComponent);
  59651. }
  59652. this.items = this.createItems();
  59653. if (this.items) {
  59654. for (let i2 = 0; i2 < this.items.length; i2++) {
  59655. menu.addItem(this.items[i2]);
  59656. }
  59657. }
  59658. return menu;
  59659. }
  59660. createItems() {
  59661. }
  59662. createEl() {
  59663. return super.createEl("div", {
  59664. className: this.buildWrapperCSSClass()
  59665. }, {});
  59666. }
  59667. buildWrapperCSSClass() {
  59668. let menuButtonClass = "vjs-menu-button";
  59669. if (this.options_.inline === true) {
  59670. menuButtonClass += "-inline";
  59671. } else {
  59672. menuButtonClass += "-popup";
  59673. }
  59674. const buttonClass = Button$1.prototype.buildCSSClass();
  59675. return `vjs-menu-button ${menuButtonClass} ${buttonClass} ${super.buildCSSClass()}`;
  59676. }
  59677. buildCSSClass() {
  59678. let menuButtonClass = "vjs-menu-button";
  59679. if (this.options_.inline === true) {
  59680. menuButtonClass += "-inline";
  59681. } else {
  59682. menuButtonClass += "-popup";
  59683. }
  59684. return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;
  59685. }
  59686. controlText(text, el = this.menuButton_.el()) {
  59687. return this.menuButton_.controlText(text, el);
  59688. }
  59689. dispose() {
  59690. this.handleMouseLeave();
  59691. super.dispose();
  59692. }
  59693. handleClick(event2) {
  59694. if (this.buttonPressed_) {
  59695. this.unpressButton();
  59696. } else {
  59697. this.pressButton();
  59698. }
  59699. }
  59700. handleMouseLeave(event2) {
  59701. this.removeClass("vjs-hover");
  59702. off$1(document_1, "keyup", this.handleMenuKeyUp_);
  59703. }
  59704. focus() {
  59705. this.menuButton_.focus();
  59706. }
  59707. blur() {
  59708. this.menuButton_.blur();
  59709. }
  59710. handleKeyDown(event2) {
  59711. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59712. if (this.buttonPressed_) {
  59713. this.unpressButton();
  59714. }
  59715. if (!keycode.isEventKey(event2, "Tab")) {
  59716. event2.preventDefault();
  59717. this.menuButton_.focus();
  59718. }
  59719. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  59720. if (!this.buttonPressed_) {
  59721. event2.preventDefault();
  59722. this.pressButton();
  59723. }
  59724. }
  59725. }
  59726. handleMenuKeyUp(event2) {
  59727. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59728. this.removeClass("vjs-hover");
  59729. }
  59730. }
  59731. handleSubmenuKeyPress(event2) {
  59732. this.handleSubmenuKeyDown(event2);
  59733. }
  59734. handleSubmenuKeyDown(event2) {
  59735. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59736. if (this.buttonPressed_) {
  59737. this.unpressButton();
  59738. }
  59739. if (!keycode.isEventKey(event2, "Tab")) {
  59740. event2.preventDefault();
  59741. this.menuButton_.focus();
  59742. }
  59743. }
  59744. }
  59745. pressButton() {
  59746. if (this.enabled_) {
  59747. this.buttonPressed_ = true;
  59748. this.menu.show();
  59749. this.menu.lockShowing();
  59750. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  59751. if (IS_IOS$1 && isInFrame$1()) {
  59752. return;
  59753. }
  59754. this.menu.focus();
  59755. }
  59756. }
  59757. unpressButton() {
  59758. if (this.enabled_) {
  59759. this.buttonPressed_ = false;
  59760. this.menu.unlockShowing();
  59761. this.menu.hide();
  59762. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59763. }
  59764. }
  59765. disable() {
  59766. this.unpressButton();
  59767. this.enabled_ = false;
  59768. this.addClass("vjs-disabled");
  59769. this.menuButton_.disable();
  59770. }
  59771. enable() {
  59772. this.enabled_ = true;
  59773. this.removeClass("vjs-disabled");
  59774. this.menuButton_.enable();
  59775. }
  59776. }
  59777. Component$1$1.registerComponent("MenuButton", MenuButton$1);
  59778. class TrackButton$1 extends MenuButton$1 {
  59779. constructor(player, options2) {
  59780. const tracks = options2.tracks;
  59781. super(player, options2);
  59782. if (this.items.length <= 1) {
  59783. this.hide();
  59784. }
  59785. if (!tracks) {
  59786. return;
  59787. }
  59788. const updateHandler = bind_(this, this.update);
  59789. tracks.addEventListener("removetrack", updateHandler);
  59790. tracks.addEventListener("addtrack", updateHandler);
  59791. tracks.addEventListener("labelchange", updateHandler);
  59792. this.player_.on("ready", updateHandler);
  59793. this.player_.on("dispose", function() {
  59794. tracks.removeEventListener("removetrack", updateHandler);
  59795. tracks.removeEventListener("addtrack", updateHandler);
  59796. tracks.removeEventListener("labelchange", updateHandler);
  59797. });
  59798. }
  59799. }
  59800. Component$1$1.registerComponent("TrackButton", TrackButton$1);
  59801. const MenuKeys$1 = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  59802. class MenuItem$1 extends ClickableComponent$1 {
  59803. constructor(player, options2) {
  59804. super(player, options2);
  59805. this.selectable = options2.selectable;
  59806. this.isSelected_ = options2.selected || false;
  59807. this.multiSelectable = options2.multiSelectable;
  59808. this.selected(this.isSelected_);
  59809. if (this.selectable) {
  59810. if (this.multiSelectable) {
  59811. this.el_.setAttribute("role", "menuitemcheckbox");
  59812. } else {
  59813. this.el_.setAttribute("role", "menuitemradio");
  59814. }
  59815. } else {
  59816. this.el_.setAttribute("role", "menuitem");
  59817. }
  59818. }
  59819. createEl(type2, props, attrs) {
  59820. this.nonIconControl = true;
  59821. const el = super.createEl("li", Object.assign({
  59822. className: "vjs-menu-item",
  59823. tabIndex: -1
  59824. }, props), attrs);
  59825. el.replaceChild(createEl$1("span", {
  59826. className: "vjs-menu-item-text",
  59827. textContent: this.localize(this.options_.label)
  59828. }), el.querySelector(".vjs-icon-placeholder"));
  59829. return el;
  59830. }
  59831. handleKeyDown(event2) {
  59832. if (!MenuKeys$1.some((key) => keycode.isEventKey(event2, key))) {
  59833. super.handleKeyDown(event2);
  59834. }
  59835. }
  59836. handleClick(event2) {
  59837. this.selected(true);
  59838. }
  59839. selected(selected) {
  59840. if (this.selectable) {
  59841. if (selected) {
  59842. this.addClass("vjs-selected");
  59843. this.el_.setAttribute("aria-checked", "true");
  59844. this.controlText(", selected");
  59845. this.isSelected_ = true;
  59846. } else {
  59847. this.removeClass("vjs-selected");
  59848. this.el_.setAttribute("aria-checked", "false");
  59849. this.controlText("");
  59850. this.isSelected_ = false;
  59851. }
  59852. }
  59853. }
  59854. }
  59855. Component$1$1.registerComponent("MenuItem", MenuItem$1);
  59856. class TextTrackMenuItem$1 extends MenuItem$1 {
  59857. constructor(player, options2) {
  59858. const track = options2.track;
  59859. const tracks = player.textTracks();
  59860. options2.label = track.label || track.language || "Unknown";
  59861. options2.selected = track.mode === "showing";
  59862. super(player, options2);
  59863. this.track = track;
  59864. this.kinds = (options2.kinds || [options2.kind || this.track.kind]).filter(Boolean);
  59865. const changeHandler = (...args) => {
  59866. this.handleTracksChange.apply(this, args);
  59867. };
  59868. const selectedLanguageChangeHandler = (...args) => {
  59869. this.handleSelectedLanguageChange.apply(this, args);
  59870. };
  59871. player.on(["loadstart", "texttrackchange"], changeHandler);
  59872. tracks.addEventListener("change", changeHandler);
  59873. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59874. this.on("dispose", function() {
  59875. player.off(["loadstart", "texttrackchange"], changeHandler);
  59876. tracks.removeEventListener("change", changeHandler);
  59877. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59878. });
  59879. if (tracks.onchange === void 0) {
  59880. let event2;
  59881. this.on(["tap", "click"], function() {
  59882. if (typeof window_1.Event !== "object") {
  59883. try {
  59884. event2 = new window_1.Event("change");
  59885. } catch (err) {
  59886. }
  59887. }
  59888. if (!event2) {
  59889. event2 = document_1.createEvent("Event");
  59890. event2.initEvent("change", true, true);
  59891. }
  59892. tracks.dispatchEvent(event2);
  59893. });
  59894. }
  59895. this.handleTracksChange();
  59896. }
  59897. handleClick(event2) {
  59898. const referenceTrack = this.track;
  59899. const tracks = this.player_.textTracks();
  59900. super.handleClick(event2);
  59901. if (!tracks) {
  59902. return;
  59903. }
  59904. for (let i2 = 0; i2 < tracks.length; i2++) {
  59905. const track = tracks[i2];
  59906. if (this.kinds.indexOf(track.kind) === -1) {
  59907. continue;
  59908. }
  59909. if (track === referenceTrack) {
  59910. if (track.mode !== "showing") {
  59911. track.mode = "showing";
  59912. }
  59913. } else if (track.mode !== "disabled") {
  59914. track.mode = "disabled";
  59915. }
  59916. }
  59917. }
  59918. handleTracksChange(event2) {
  59919. const shouldBeSelected = this.track.mode === "showing";
  59920. if (shouldBeSelected !== this.isSelected_) {
  59921. this.selected(shouldBeSelected);
  59922. }
  59923. }
  59924. handleSelectedLanguageChange(event2) {
  59925. if (this.track.mode === "showing") {
  59926. const selectedLanguage = this.player_.cache_.selectedLanguage;
  59927. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  59928. return;
  59929. }
  59930. this.player_.cache_.selectedLanguage = {
  59931. enabled: true,
  59932. language: this.track.language,
  59933. kind: this.track.kind
  59934. };
  59935. }
  59936. }
  59937. dispose() {
  59938. this.track = null;
  59939. super.dispose();
  59940. }
  59941. }
  59942. Component$1$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem$1);
  59943. class OffTextTrackMenuItem$1 extends TextTrackMenuItem$1 {
  59944. constructor(player, options2) {
  59945. options2.track = {
  59946. player,
  59947. kind: options2.kind,
  59948. kinds: options2.kinds,
  59949. default: false,
  59950. mode: "disabled"
  59951. };
  59952. if (!options2.kinds) {
  59953. options2.kinds = [options2.kind];
  59954. }
  59955. if (options2.label) {
  59956. options2.track.label = options2.label;
  59957. } else {
  59958. options2.track.label = options2.kinds.join(" and ") + " off";
  59959. }
  59960. options2.selectable = true;
  59961. options2.multiSelectable = false;
  59962. super(player, options2);
  59963. }
  59964. handleTracksChange(event2) {
  59965. const tracks = this.player().textTracks();
  59966. let shouldBeSelected = true;
  59967. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  59968. const track = tracks[i2];
  59969. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  59970. shouldBeSelected = false;
  59971. break;
  59972. }
  59973. }
  59974. if (shouldBeSelected !== this.isSelected_) {
  59975. this.selected(shouldBeSelected);
  59976. }
  59977. }
  59978. handleSelectedLanguageChange(event2) {
  59979. const tracks = this.player().textTracks();
  59980. let allHidden = true;
  59981. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  59982. const track = tracks[i2];
  59983. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  59984. allHidden = false;
  59985. break;
  59986. }
  59987. }
  59988. if (allHidden) {
  59989. this.player_.cache_.selectedLanguage = {
  59990. enabled: false
  59991. };
  59992. }
  59993. }
  59994. handleLanguagechange() {
  59995. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.label);
  59996. super.handleLanguagechange();
  59997. }
  59998. }
  59999. Component$1$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem$1);
  60000. class TextTrackButton$1 extends TrackButton$1 {
  60001. constructor(player, options2 = {}) {
  60002. options2.tracks = player.textTracks();
  60003. super(player, options2);
  60004. }
  60005. createItems(items = [], TrackMenuItem = TextTrackMenuItem$1) {
  60006. let label;
  60007. if (this.label_) {
  60008. label = `${this.label_} off`;
  60009. }
  60010. items.push(new OffTextTrackMenuItem$1(this.player_, {
  60011. kinds: this.kinds_,
  60012. kind: this.kind_,
  60013. label
  60014. }));
  60015. this.hideThreshold_ += 1;
  60016. const tracks = this.player_.textTracks();
  60017. if (!Array.isArray(this.kinds_)) {
  60018. this.kinds_ = [this.kind_];
  60019. }
  60020. for (let i2 = 0; i2 < tracks.length; i2++) {
  60021. const track = tracks[i2];
  60022. if (this.kinds_.indexOf(track.kind) > -1) {
  60023. const item = new TrackMenuItem(this.player_, {
  60024. track,
  60025. kinds: this.kinds_,
  60026. kind: this.kind_,
  60027. selectable: true,
  60028. multiSelectable: false
  60029. });
  60030. item.addClass(`vjs-${track.kind}-menu-item`);
  60031. items.push(item);
  60032. }
  60033. }
  60034. return items;
  60035. }
  60036. }
  60037. Component$1$1.registerComponent("TextTrackButton", TextTrackButton$1);
  60038. class ChaptersTrackMenuItem$1 extends MenuItem$1 {
  60039. constructor(player, options2) {
  60040. const track = options2.track;
  60041. const cue = options2.cue;
  60042. const currentTime = player.currentTime();
  60043. options2.selectable = true;
  60044. options2.multiSelectable = false;
  60045. options2.label = cue.text;
  60046. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  60047. super(player, options2);
  60048. this.track = track;
  60049. this.cue = cue;
  60050. }
  60051. handleClick(event2) {
  60052. super.handleClick();
  60053. this.player_.currentTime(this.cue.startTime);
  60054. }
  60055. }
  60056. Component$1$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem$1);
  60057. class ChaptersButton$1 extends TextTrackButton$1 {
  60058. constructor(player, options2, ready) {
  60059. super(player, options2, ready);
  60060. this.selectCurrentItem_ = () => {
  60061. this.items.forEach((item) => {
  60062. item.selected(this.track_.activeCues[0] === item.cue);
  60063. });
  60064. };
  60065. }
  60066. buildCSSClass() {
  60067. return `vjs-chapters-button ${super.buildCSSClass()}`;
  60068. }
  60069. buildWrapperCSSClass() {
  60070. return `vjs-chapters-button ${super.buildWrapperCSSClass()}`;
  60071. }
  60072. update(event2) {
  60073. if (event2 && event2.track && event2.track.kind !== "chapters") {
  60074. return;
  60075. }
  60076. const track = this.findChaptersTrack();
  60077. if (track !== this.track_) {
  60078. this.setTrack(track);
  60079. super.update();
  60080. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  60081. super.update();
  60082. }
  60083. }
  60084. setTrack(track) {
  60085. if (this.track_ === track) {
  60086. return;
  60087. }
  60088. if (!this.updateHandler_) {
  60089. this.updateHandler_ = this.update.bind(this);
  60090. }
  60091. if (this.track_) {
  60092. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60093. if (remoteTextTrackEl) {
  60094. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  60095. }
  60096. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  60097. this.track_ = null;
  60098. }
  60099. this.track_ = track;
  60100. if (this.track_) {
  60101. this.track_.mode = "hidden";
  60102. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60103. if (remoteTextTrackEl) {
  60104. remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  60105. }
  60106. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  60107. }
  60108. }
  60109. findChaptersTrack() {
  60110. const tracks = this.player_.textTracks() || [];
  60111. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  60112. const track = tracks[i2];
  60113. if (track.kind === this.kind_) {
  60114. return track;
  60115. }
  60116. }
  60117. }
  60118. getMenuCaption() {
  60119. if (this.track_ && this.track_.label) {
  60120. return this.track_.label;
  60121. }
  60122. return this.localize(toTitleCase$1$1(this.kind_));
  60123. }
  60124. createMenu() {
  60125. this.options_.title = this.getMenuCaption();
  60126. return super.createMenu();
  60127. }
  60128. createItems() {
  60129. const items = [];
  60130. if (!this.track_) {
  60131. return items;
  60132. }
  60133. const cues = this.track_.cues;
  60134. if (!cues) {
  60135. return items;
  60136. }
  60137. for (let i2 = 0, l = cues.length; i2 < l; i2++) {
  60138. const cue = cues[i2];
  60139. const mi = new ChaptersTrackMenuItem$1(this.player_, {
  60140. track: this.track_,
  60141. cue
  60142. });
  60143. items.push(mi);
  60144. }
  60145. return items;
  60146. }
  60147. }
  60148. ChaptersButton$1.prototype.kind_ = "chapters";
  60149. ChaptersButton$1.prototype.controlText_ = "Chapters";
  60150. Component$1$1.registerComponent("ChaptersButton", ChaptersButton$1);
  60151. class DescriptionsButton$1 extends TextTrackButton$1 {
  60152. constructor(player, options2, ready) {
  60153. super(player, options2, ready);
  60154. const tracks = player.textTracks();
  60155. const changeHandler = bind_(this, this.handleTracksChange);
  60156. tracks.addEventListener("change", changeHandler);
  60157. this.on("dispose", function() {
  60158. tracks.removeEventListener("change", changeHandler);
  60159. });
  60160. }
  60161. handleTracksChange(event2) {
  60162. const tracks = this.player().textTracks();
  60163. let disabled = false;
  60164. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  60165. const track = tracks[i2];
  60166. if (track.kind !== this.kind_ && track.mode === "showing") {
  60167. disabled = true;
  60168. break;
  60169. }
  60170. }
  60171. if (disabled) {
  60172. this.disable();
  60173. } else {
  60174. this.enable();
  60175. }
  60176. }
  60177. buildCSSClass() {
  60178. return `vjs-descriptions-button ${super.buildCSSClass()}`;
  60179. }
  60180. buildWrapperCSSClass() {
  60181. return `vjs-descriptions-button ${super.buildWrapperCSSClass()}`;
  60182. }
  60183. }
  60184. DescriptionsButton$1.prototype.kind_ = "descriptions";
  60185. DescriptionsButton$1.prototype.controlText_ = "Descriptions";
  60186. Component$1$1.registerComponent("DescriptionsButton", DescriptionsButton$1);
  60187. class SubtitlesButton$1 extends TextTrackButton$1 {
  60188. constructor(player, options2, ready) {
  60189. super(player, options2, ready);
  60190. }
  60191. buildCSSClass() {
  60192. return `vjs-subtitles-button ${super.buildCSSClass()}`;
  60193. }
  60194. buildWrapperCSSClass() {
  60195. return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`;
  60196. }
  60197. }
  60198. SubtitlesButton$1.prototype.kind_ = "subtitles";
  60199. SubtitlesButton$1.prototype.controlText_ = "Subtitles";
  60200. Component$1$1.registerComponent("SubtitlesButton", SubtitlesButton$1);
  60201. class CaptionSettingsMenuItem$1 extends TextTrackMenuItem$1 {
  60202. constructor(player, options2) {
  60203. options2.track = {
  60204. player,
  60205. kind: options2.kind,
  60206. label: options2.kind + " settings",
  60207. selectable: false,
  60208. default: false,
  60209. mode: "disabled"
  60210. };
  60211. options2.selectable = false;
  60212. options2.name = "CaptionSettingsMenuItem";
  60213. super(player, options2);
  60214. this.addClass("vjs-texttrack-settings");
  60215. this.controlText(", opens " + options2.kind + " settings dialog");
  60216. }
  60217. handleClick(event2) {
  60218. this.player().getChild("textTrackSettings").open();
  60219. }
  60220. handleLanguagechange() {
  60221. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.kind + " settings");
  60222. super.handleLanguagechange();
  60223. }
  60224. }
  60225. Component$1$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem$1);
  60226. class CaptionsButton$1 extends TextTrackButton$1 {
  60227. constructor(player, options2, ready) {
  60228. super(player, options2, ready);
  60229. }
  60230. buildCSSClass() {
  60231. return `vjs-captions-button ${super.buildCSSClass()}`;
  60232. }
  60233. buildWrapperCSSClass() {
  60234. return `vjs-captions-button ${super.buildWrapperCSSClass()}`;
  60235. }
  60236. createItems() {
  60237. const items = [];
  60238. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60239. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60240. kind: this.kind_
  60241. }));
  60242. this.hideThreshold_ += 1;
  60243. }
  60244. return super.createItems(items);
  60245. }
  60246. }
  60247. CaptionsButton$1.prototype.kind_ = "captions";
  60248. CaptionsButton$1.prototype.controlText_ = "Captions";
  60249. Component$1$1.registerComponent("CaptionsButton", CaptionsButton$1);
  60250. class SubsCapsMenuItem$1 extends TextTrackMenuItem$1 {
  60251. createEl(type2, props, attrs) {
  60252. const el = super.createEl(type2, props, attrs);
  60253. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60254. if (this.options_.track.kind === "captions") {
  60255. parentSpan.appendChild(createEl$1("span", {
  60256. className: "vjs-icon-placeholder"
  60257. }, {
  60258. "aria-hidden": true
  60259. }));
  60260. parentSpan.appendChild(createEl$1("span", {
  60261. className: "vjs-control-text",
  60262. textContent: ` ${this.localize("Captions")}`
  60263. }));
  60264. }
  60265. return el;
  60266. }
  60267. }
  60268. Component$1$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem$1);
  60269. class SubsCapsButton$1 extends TextTrackButton$1 {
  60270. constructor(player, options2 = {}) {
  60271. super(player, options2);
  60272. this.label_ = "subtitles";
  60273. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(this.player_.language_) > -1) {
  60274. this.label_ = "captions";
  60275. }
  60276. this.menuButton_.controlText(toTitleCase$1$1(this.label_));
  60277. }
  60278. buildCSSClass() {
  60279. return `vjs-subs-caps-button ${super.buildCSSClass()}`;
  60280. }
  60281. buildWrapperCSSClass() {
  60282. return `vjs-subs-caps-button ${super.buildWrapperCSSClass()}`;
  60283. }
  60284. createItems() {
  60285. let items = [];
  60286. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60287. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60288. kind: this.label_
  60289. }));
  60290. this.hideThreshold_ += 1;
  60291. }
  60292. items = super.createItems(items, SubsCapsMenuItem$1);
  60293. return items;
  60294. }
  60295. }
  60296. SubsCapsButton$1.prototype.kinds_ = ["captions", "subtitles"];
  60297. SubsCapsButton$1.prototype.controlText_ = "Subtitles";
  60298. Component$1$1.registerComponent("SubsCapsButton", SubsCapsButton$1);
  60299. class AudioTrackMenuItem$1 extends MenuItem$1 {
  60300. constructor(player, options2) {
  60301. const track = options2.track;
  60302. const tracks = player.audioTracks();
  60303. options2.label = track.label || track.language || "Unknown";
  60304. options2.selected = track.enabled;
  60305. super(player, options2);
  60306. this.track = track;
  60307. this.addClass(`vjs-${track.kind}-menu-item`);
  60308. const changeHandler = (...args) => {
  60309. this.handleTracksChange.apply(this, args);
  60310. };
  60311. tracks.addEventListener("change", changeHandler);
  60312. this.on("dispose", () => {
  60313. tracks.removeEventListener("change", changeHandler);
  60314. });
  60315. }
  60316. createEl(type2, props, attrs) {
  60317. const el = super.createEl(type2, props, attrs);
  60318. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60319. if (this.options_.track.kind === "main-desc") {
  60320. parentSpan.appendChild(createEl$1("span", {
  60321. className: "vjs-icon-placeholder"
  60322. }, {
  60323. "aria-hidden": true
  60324. }));
  60325. parentSpan.appendChild(createEl$1("span", {
  60326. className: "vjs-control-text",
  60327. textContent: " " + this.localize("Descriptions")
  60328. }));
  60329. }
  60330. return el;
  60331. }
  60332. handleClick(event2) {
  60333. super.handleClick(event2);
  60334. this.track.enabled = true;
  60335. if (this.player_.tech_.featuresNativeAudioTracks) {
  60336. const tracks = this.player_.audioTracks();
  60337. for (let i2 = 0; i2 < tracks.length; i2++) {
  60338. const track = tracks[i2];
  60339. if (track === this.track) {
  60340. continue;
  60341. }
  60342. track.enabled = track === this.track;
  60343. }
  60344. }
  60345. }
  60346. handleTracksChange(event2) {
  60347. this.selected(this.track.enabled);
  60348. }
  60349. }
  60350. Component$1$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem$1);
  60351. class AudioTrackButton$1 extends TrackButton$1 {
  60352. constructor(player, options2 = {}) {
  60353. options2.tracks = player.audioTracks();
  60354. super(player, options2);
  60355. }
  60356. buildCSSClass() {
  60357. return `vjs-audio-button ${super.buildCSSClass()}`;
  60358. }
  60359. buildWrapperCSSClass() {
  60360. return `vjs-audio-button ${super.buildWrapperCSSClass()}`;
  60361. }
  60362. createItems(items = []) {
  60363. this.hideThreshold_ = 1;
  60364. const tracks = this.player_.audioTracks();
  60365. for (let i2 = 0; i2 < tracks.length; i2++) {
  60366. const track = tracks[i2];
  60367. items.push(new AudioTrackMenuItem$1(this.player_, {
  60368. track,
  60369. selectable: true,
  60370. multiSelectable: false
  60371. }));
  60372. }
  60373. return items;
  60374. }
  60375. }
  60376. AudioTrackButton$1.prototype.controlText_ = "Audio Track";
  60377. Component$1$1.registerComponent("AudioTrackButton", AudioTrackButton$1);
  60378. class PlaybackRateMenuItem$1 extends MenuItem$1 {
  60379. constructor(player, options2) {
  60380. const label = options2.rate;
  60381. const rate = parseFloat(label, 10);
  60382. options2.label = label;
  60383. options2.selected = rate === player.playbackRate();
  60384. options2.selectable = true;
  60385. options2.multiSelectable = false;
  60386. super(player, options2);
  60387. this.label = label;
  60388. this.rate = rate;
  60389. this.on(player, "ratechange", (e) => this.update(e));
  60390. }
  60391. handleClick(event2) {
  60392. super.handleClick();
  60393. this.player().playbackRate(this.rate);
  60394. }
  60395. update(event2) {
  60396. this.selected(this.player().playbackRate() === this.rate);
  60397. }
  60398. }
  60399. PlaybackRateMenuItem$1.prototype.contentElType = "button";
  60400. Component$1$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem$1);
  60401. class PlaybackRateMenuButton$1 extends MenuButton$1 {
  60402. constructor(player, options2) {
  60403. super(player, options2);
  60404. this.menuButton_.el_.setAttribute("aria-describedby", this.labelElId_);
  60405. this.updateVisibility();
  60406. this.updateLabel();
  60407. this.on(player, "loadstart", (e) => this.updateVisibility(e));
  60408. this.on(player, "ratechange", (e) => this.updateLabel(e));
  60409. this.on(player, "playbackrateschange", (e) => this.handlePlaybackRateschange(e));
  60410. }
  60411. createEl() {
  60412. const el = super.createEl();
  60413. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  60414. this.labelEl_ = createEl$1("div", {
  60415. className: "vjs-playback-rate-value",
  60416. id: this.labelElId_,
  60417. textContent: "1x"
  60418. });
  60419. el.appendChild(this.labelEl_);
  60420. return el;
  60421. }
  60422. dispose() {
  60423. this.labelEl_ = null;
  60424. super.dispose();
  60425. }
  60426. buildCSSClass() {
  60427. return `vjs-playback-rate ${super.buildCSSClass()}`;
  60428. }
  60429. buildWrapperCSSClass() {
  60430. return `vjs-playback-rate ${super.buildWrapperCSSClass()}`;
  60431. }
  60432. createItems() {
  60433. const rates = this.playbackRates();
  60434. const items = [];
  60435. for (let i2 = rates.length - 1; i2 >= 0; i2--) {
  60436. items.push(new PlaybackRateMenuItem$1(this.player(), {
  60437. rate: rates[i2] + "x"
  60438. }));
  60439. }
  60440. return items;
  60441. }
  60442. handlePlaybackRateschange(event2) {
  60443. this.update();
  60444. }
  60445. playbackRates() {
  60446. const player = this.player();
  60447. return player.playbackRates && player.playbackRates() || [];
  60448. }
  60449. playbackRateSupported() {
  60450. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  60451. }
  60452. updateVisibility(event2) {
  60453. if (this.playbackRateSupported()) {
  60454. this.removeClass("vjs-hidden");
  60455. } else {
  60456. this.addClass("vjs-hidden");
  60457. }
  60458. }
  60459. updateLabel(event2) {
  60460. if (this.playbackRateSupported()) {
  60461. this.labelEl_.textContent = this.player().playbackRate() + "x";
  60462. }
  60463. }
  60464. }
  60465. PlaybackRateMenuButton$1.prototype.controlText_ = "Playback Rate";
  60466. Component$1$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton$1);
  60467. class Spacer$1 extends Component$1$1 {
  60468. buildCSSClass() {
  60469. return `vjs-spacer ${super.buildCSSClass()}`;
  60470. }
  60471. createEl(tag = "div", props = {}, attributes = {}) {
  60472. if (!props.className) {
  60473. props.className = this.buildCSSClass();
  60474. }
  60475. return super.createEl(tag, props, attributes);
  60476. }
  60477. }
  60478. Component$1$1.registerComponent("Spacer", Spacer$1);
  60479. class CustomControlSpacer$1 extends Spacer$1 {
  60480. buildCSSClass() {
  60481. return `vjs-custom-control-spacer ${super.buildCSSClass()}`;
  60482. }
  60483. createEl() {
  60484. return super.createEl("div", {
  60485. className: this.buildCSSClass(),
  60486. textContent: "\xA0"
  60487. });
  60488. }
  60489. }
  60490. Component$1$1.registerComponent("CustomControlSpacer", CustomControlSpacer$1);
  60491. class ControlBar$1 extends Component$1$1 {
  60492. createEl() {
  60493. return super.createEl("div", {
  60494. className: "vjs-control-bar",
  60495. dir: "ltr"
  60496. });
  60497. }
  60498. }
  60499. ControlBar$1.prototype.options_ = {
  60500. children: ["playToggle", "skipBackward", "skipForward", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  60501. };
  60502. if ("exitPictureInPicture" in document_1) {
  60503. ControlBar$1.prototype.options_.children.splice(ControlBar$1.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  60504. }
  60505. Component$1$1.registerComponent("ControlBar", ControlBar$1);
  60506. class ErrorDisplay$1 extends ModalDialog$1 {
  60507. constructor(player, options2) {
  60508. super(player, options2);
  60509. this.on(player, "error", (e) => this.open(e));
  60510. }
  60511. buildCSSClass() {
  60512. return `vjs-error-display ${super.buildCSSClass()}`;
  60513. }
  60514. content() {
  60515. const error = this.player().error();
  60516. return error ? this.localize(error.message) : "";
  60517. }
  60518. }
  60519. ErrorDisplay$1.prototype.options_ = Object.assign({}, ModalDialog$1.prototype.options_, {
  60520. pauseOnOpen: false,
  60521. fillAlways: true,
  60522. temporary: false,
  60523. uncloseable: true
  60524. });
  60525. Component$1$1.registerComponent("ErrorDisplay", ErrorDisplay$1);
  60526. const LOCAL_STORAGE_KEY$1$1 = "vjs-text-track-settings";
  60527. const COLOR_BLACK$1 = ["#000", "Black"];
  60528. const COLOR_BLUE$1 = ["#00F", "Blue"];
  60529. const COLOR_CYAN$1 = ["#0FF", "Cyan"];
  60530. const COLOR_GREEN$1 = ["#0F0", "Green"];
  60531. const COLOR_MAGENTA$1 = ["#F0F", "Magenta"];
  60532. const COLOR_RED$1 = ["#F00", "Red"];
  60533. const COLOR_WHITE$1 = ["#FFF", "White"];
  60534. const COLOR_YELLOW$1 = ["#FF0", "Yellow"];
  60535. const OPACITY_OPAQUE$1 = ["1", "Opaque"];
  60536. const OPACITY_SEMI$1 = ["0.5", "Semi-Transparent"];
  60537. const OPACITY_TRANS$1 = ["0", "Transparent"];
  60538. const selectConfigs$1 = {
  60539. backgroundColor: {
  60540. selector: ".vjs-bg-color > select",
  60541. id: "captions-background-color-%s",
  60542. label: "Color",
  60543. options: [COLOR_BLACK$1, COLOR_WHITE$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60544. },
  60545. backgroundOpacity: {
  60546. selector: ".vjs-bg-opacity > select",
  60547. id: "captions-background-opacity-%s",
  60548. label: "Opacity",
  60549. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1, OPACITY_TRANS$1]
  60550. },
  60551. color: {
  60552. selector: ".vjs-text-color > select",
  60553. id: "captions-foreground-color-%s",
  60554. label: "Color",
  60555. options: [COLOR_WHITE$1, COLOR_BLACK$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60556. },
  60557. edgeStyle: {
  60558. selector: ".vjs-edge-style > select",
  60559. id: "%s",
  60560. label: "Text Edge Style",
  60561. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  60562. },
  60563. fontFamily: {
  60564. selector: ".vjs-font-family > select",
  60565. id: "captions-font-family-%s",
  60566. label: "Font Family",
  60567. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  60568. },
  60569. fontPercent: {
  60570. selector: ".vjs-font-percent > select",
  60571. id: "captions-font-size-%s",
  60572. label: "Font Size",
  60573. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  60574. default: 2,
  60575. parser: (v) => v === "1.00" ? null : Number(v)
  60576. },
  60577. textOpacity: {
  60578. selector: ".vjs-text-opacity > select",
  60579. id: "captions-foreground-opacity-%s",
  60580. label: "Opacity",
  60581. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1]
  60582. },
  60583. windowColor: {
  60584. selector: ".vjs-window-color > select",
  60585. id: "captions-window-color-%s",
  60586. label: "Color"
  60587. },
  60588. windowOpacity: {
  60589. selector: ".vjs-window-opacity > select",
  60590. id: "captions-window-opacity-%s",
  60591. label: "Opacity",
  60592. options: [OPACITY_TRANS$1, OPACITY_SEMI$1, OPACITY_OPAQUE$1]
  60593. }
  60594. };
  60595. selectConfigs$1.windowColor.options = selectConfigs$1.backgroundColor.options;
  60596. function parseOptionValue$1(value, parser2) {
  60597. if (parser2) {
  60598. value = parser2(value);
  60599. }
  60600. if (value && value !== "none") {
  60601. return value;
  60602. }
  60603. }
  60604. function getSelectedOptionValue$1(el, parser2) {
  60605. const value = el.options[el.options.selectedIndex].value;
  60606. return parseOptionValue$1(value, parser2);
  60607. }
  60608. function setSelectedOption$1(el, value, parser2) {
  60609. if (!value) {
  60610. return;
  60611. }
  60612. for (let i2 = 0; i2 < el.options.length; i2++) {
  60613. if (parseOptionValue$1(el.options[i2].value, parser2) === value) {
  60614. el.selectedIndex = i2;
  60615. break;
  60616. }
  60617. }
  60618. }
  60619. class TextTrackSettings$1 extends ModalDialog$1 {
  60620. constructor(player, options2) {
  60621. options2.temporary = false;
  60622. super(player, options2);
  60623. this.updateDisplay = this.updateDisplay.bind(this);
  60624. this.fill();
  60625. this.hasBeenOpened_ = this.hasBeenFilled_ = true;
  60626. this.endDialog = createEl$1("p", {
  60627. className: "vjs-control-text",
  60628. textContent: this.localize("End of dialog window.")
  60629. });
  60630. this.el().appendChild(this.endDialog);
  60631. this.setDefaults();
  60632. if (options2.persistTextTrackSettings === void 0) {
  60633. this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings;
  60634. }
  60635. this.on(this.$(".vjs-done-button"), "click", () => {
  60636. this.saveSettings();
  60637. this.close();
  60638. });
  60639. this.on(this.$(".vjs-default-button"), "click", () => {
  60640. this.setDefaults();
  60641. this.updateDisplay();
  60642. });
  60643. each$1(selectConfigs$1, (config) => {
  60644. this.on(this.$(config.selector), "change", this.updateDisplay);
  60645. });
  60646. if (this.options_.persistTextTrackSettings) {
  60647. this.restoreSettings();
  60648. }
  60649. }
  60650. dispose() {
  60651. this.endDialog = null;
  60652. super.dispose();
  60653. }
  60654. createElSelect_(key, legendId = "", type2 = "label") {
  60655. const config = selectConfigs$1[key];
  60656. const id = config.id.replace("%s", this.id_);
  60657. const selectLabelledbyIds = [legendId, id].join(" ").trim();
  60658. return [`<${type2} id="${id}" class="${type2 === "label" ? "vjs-label" : ""}">`, this.localize(config.label), `</${type2}>`, `<select aria-labelledby="${selectLabelledbyIds}">`].concat(config.options.map((o) => {
  60659. const optionId = id + "-" + o[1].replace(/\W+/g, "");
  60660. return [`<option id="${optionId}" value="${o[0]}" `, `aria-labelledby="${selectLabelledbyIds} ${optionId}">`, this.localize(o[1]), "</option>"].join("");
  60661. })).concat("</select>").join("");
  60662. }
  60663. createElFgColor_() {
  60664. const legendId = `captions-text-legend-${this.id_}`;
  60665. return ['<fieldset class="vjs-fg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text"), "</legend>", '<span class="vjs-text-color">', this.createElSelect_("color", legendId), "</span>", '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  60666. }
  60667. createElBgColor_() {
  60668. const legendId = `captions-background-${this.id_}`;
  60669. return ['<fieldset class="vjs-bg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text Background"), "</legend>", '<span class="vjs-bg-color">', this.createElSelect_("backgroundColor", legendId), "</span>", '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  60670. }
  60671. createElWinColor_() {
  60672. const legendId = `captions-window-${this.id_}`;
  60673. return ['<fieldset class="vjs-window vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Caption Area Background"), "</legend>", '<span class="vjs-window-color">', this.createElSelect_("windowColor", legendId), "</span>", '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  60674. }
  60675. createElColors_() {
  60676. return createEl$1("div", {
  60677. className: "vjs-track-settings-colors",
  60678. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  60679. });
  60680. }
  60681. createElFont_() {
  60682. return createEl$1("div", {
  60683. className: "vjs-track-settings-font",
  60684. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  60685. });
  60686. }
  60687. createElControls_() {
  60688. const defaultsDescription = this.localize("restore all settings to the default values");
  60689. return createEl$1("div", {
  60690. className: "vjs-track-settings-controls",
  60691. innerHTML: [`<button type="button" class="vjs-default-button" title="${defaultsDescription}">`, this.localize("Reset"), `<span class="vjs-control-text"> ${defaultsDescription}</span>`, "</button>", `<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")
  60692. });
  60693. }
  60694. content() {
  60695. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  60696. }
  60697. label() {
  60698. return this.localize("Caption Settings Dialog");
  60699. }
  60700. description() {
  60701. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  60702. }
  60703. buildCSSClass() {
  60704. return super.buildCSSClass() + " vjs-text-track-settings";
  60705. }
  60706. getValues() {
  60707. return reduce$1(selectConfigs$1, (accum, config, key) => {
  60708. const value = getSelectedOptionValue$1(this.$(config.selector), config.parser);
  60709. if (value !== void 0) {
  60710. accum[key] = value;
  60711. }
  60712. return accum;
  60713. }, {});
  60714. }
  60715. setValues(values3) {
  60716. each$1(selectConfigs$1, (config, key) => {
  60717. setSelectedOption$1(this.$(config.selector), values3[key], config.parser);
  60718. });
  60719. }
  60720. setDefaults() {
  60721. each$1(selectConfigs$1, (config) => {
  60722. const index2 = config.hasOwnProperty("default") ? config.default : 0;
  60723. this.$(config.selector).selectedIndex = index2;
  60724. });
  60725. }
  60726. restoreSettings() {
  60727. let values3;
  60728. try {
  60729. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1$1));
  60730. } catch (err) {
  60731. log$1$1.warn(err);
  60732. }
  60733. if (values3) {
  60734. this.setValues(values3);
  60735. }
  60736. }
  60737. saveSettings() {
  60738. if (!this.options_.persistTextTrackSettings) {
  60739. return;
  60740. }
  60741. const values3 = this.getValues();
  60742. try {
  60743. if (Object.keys(values3).length) {
  60744. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1$1, JSON.stringify(values3));
  60745. } else {
  60746. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1$1);
  60747. }
  60748. } catch (err) {
  60749. log$1$1.warn(err);
  60750. }
  60751. }
  60752. updateDisplay() {
  60753. const ttDisplay = this.player_.getChild("textTrackDisplay");
  60754. if (ttDisplay) {
  60755. ttDisplay.updateDisplay();
  60756. }
  60757. }
  60758. conditionalBlur_() {
  60759. this.previouslyActiveEl_ = null;
  60760. const cb = this.player_.controlBar;
  60761. const subsCapsBtn = cb && cb.subsCapsButton;
  60762. const ccBtn = cb && cb.captionsButton;
  60763. if (subsCapsBtn) {
  60764. subsCapsBtn.focus();
  60765. } else if (ccBtn) {
  60766. ccBtn.focus();
  60767. }
  60768. }
  60769. handleLanguagechange() {
  60770. this.fill();
  60771. }
  60772. }
  60773. Component$1$1.registerComponent("TextTrackSettings", TextTrackSettings$1);
  60774. class ResizeManager$1 extends Component$1$1 {
  60775. constructor(player, options2) {
  60776. let RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  60777. if (options2.ResizeObserver === null) {
  60778. RESIZE_OBSERVER_AVAILABLE = false;
  60779. }
  60780. const options_ = merge$1({
  60781. createEl: !RESIZE_OBSERVER_AVAILABLE,
  60782. reportTouchActivity: false
  60783. }, options2);
  60784. super(player, options_);
  60785. this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  60786. this.loadListener_ = null;
  60787. this.resizeObserver_ = null;
  60788. this.debouncedHandler_ = debounce$1(() => {
  60789. this.resizeHandler();
  60790. }, 100, false, this);
  60791. if (RESIZE_OBSERVER_AVAILABLE) {
  60792. this.resizeObserver_ = new this.ResizeObserver(this.debouncedHandler_);
  60793. this.resizeObserver_.observe(player.el());
  60794. } else {
  60795. this.loadListener_ = () => {
  60796. if (!this.el_ || !this.el_.contentWindow) {
  60797. return;
  60798. }
  60799. const debouncedHandler_ = this.debouncedHandler_;
  60800. let unloadListener_ = this.unloadListener_ = function() {
  60801. off$1(this, "resize", debouncedHandler_);
  60802. off$1(this, "unload", unloadListener_);
  60803. unloadListener_ = null;
  60804. };
  60805. on$1(this.el_.contentWindow, "unload", unloadListener_);
  60806. on$1(this.el_.contentWindow, "resize", debouncedHandler_);
  60807. };
  60808. this.one("load", this.loadListener_);
  60809. }
  60810. }
  60811. createEl() {
  60812. return super.createEl("iframe", {
  60813. className: "vjs-resize-manager",
  60814. tabIndex: -1,
  60815. title: this.localize("No content")
  60816. }, {
  60817. "aria-hidden": "true"
  60818. });
  60819. }
  60820. resizeHandler() {
  60821. if (!this.player_ || !this.player_.trigger) {
  60822. return;
  60823. }
  60824. this.player_.trigger("playerresize");
  60825. }
  60826. dispose() {
  60827. if (this.debouncedHandler_) {
  60828. this.debouncedHandler_.cancel();
  60829. }
  60830. if (this.resizeObserver_) {
  60831. if (this.player_.el()) {
  60832. this.resizeObserver_.unobserve(this.player_.el());
  60833. }
  60834. this.resizeObserver_.disconnect();
  60835. }
  60836. if (this.loadListener_) {
  60837. this.off("load", this.loadListener_);
  60838. }
  60839. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  60840. this.unloadListener_.call(this.el_.contentWindow);
  60841. }
  60842. this.ResizeObserver = null;
  60843. this.resizeObserver = null;
  60844. this.debouncedHandler_ = null;
  60845. this.loadListener_ = null;
  60846. super.dispose();
  60847. }
  60848. }
  60849. Component$1$1.registerComponent("ResizeManager", ResizeManager$1);
  60850. const defaults$2 = {
  60851. trackingThreshold: 20,
  60852. liveTolerance: 15
  60853. };
  60854. class LiveTracker$1 extends Component$1$1 {
  60855. constructor(player, options2) {
  60856. const options_ = merge$1(defaults$2, options2, {
  60857. createEl: false
  60858. });
  60859. super(player, options_);
  60860. this.trackLiveHandler_ = () => this.trackLive_();
  60861. this.handlePlay_ = (e) => this.handlePlay(e);
  60862. this.handleFirstTimeupdate_ = (e) => this.handleFirstTimeupdate(e);
  60863. this.handleSeeked_ = (e) => this.handleSeeked(e);
  60864. this.seekToLiveEdge_ = (e) => this.seekToLiveEdge(e);
  60865. this.reset_();
  60866. this.on(this.player_, "durationchange", (e) => this.handleDurationchange(e));
  60867. this.on(this.player_, "canplay", () => this.toggleTracking());
  60868. }
  60869. trackLive_() {
  60870. const seekable3 = this.player_.seekable();
  60871. if (!seekable3 || !seekable3.length) {
  60872. return;
  60873. }
  60874. const newTime = Number(window_1.performance.now().toFixed(4));
  60875. const deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  60876. this.lastTime_ = newTime;
  60877. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  60878. const liveCurrentTime = this.liveCurrentTime();
  60879. const currentTime = this.player_.currentTime();
  60880. let isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  60881. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  60882. isBehind = false;
  60883. }
  60884. if (isBehind !== this.behindLiveEdge_) {
  60885. this.behindLiveEdge_ = isBehind;
  60886. this.trigger("liveedgechange");
  60887. }
  60888. }
  60889. handleDurationchange() {
  60890. this.toggleTracking();
  60891. }
  60892. toggleTracking() {
  60893. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  60894. if (this.player_.options_.liveui) {
  60895. this.player_.addClass("vjs-liveui");
  60896. }
  60897. this.startTracking();
  60898. } else {
  60899. this.player_.removeClass("vjs-liveui");
  60900. this.stopTracking();
  60901. }
  60902. }
  60903. startTracking() {
  60904. if (this.isTracking()) {
  60905. return;
  60906. }
  60907. if (!this.timeupdateSeen_) {
  60908. this.timeupdateSeen_ = this.player_.hasStarted();
  60909. }
  60910. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL$1);
  60911. this.trackLive_();
  60912. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60913. if (!this.timeupdateSeen_) {
  60914. this.one(this.player_, "play", this.handlePlay_);
  60915. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60916. } else {
  60917. this.on(this.player_, "seeked", this.handleSeeked_);
  60918. }
  60919. }
  60920. handleFirstTimeupdate() {
  60921. this.timeupdateSeen_ = true;
  60922. this.on(this.player_, "seeked", this.handleSeeked_);
  60923. }
  60924. handleSeeked() {
  60925. const timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  60926. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  60927. this.nextSeekedFromUser_ = false;
  60928. this.trackLive_();
  60929. }
  60930. handlePlay() {
  60931. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  60932. }
  60933. reset_() {
  60934. this.lastTime_ = -1;
  60935. this.pastSeekEnd_ = 0;
  60936. this.lastSeekEnd_ = -1;
  60937. this.behindLiveEdge_ = true;
  60938. this.timeupdateSeen_ = false;
  60939. this.seekedBehindLive_ = false;
  60940. this.nextSeekedFromUser_ = false;
  60941. this.clearInterval(this.trackingInterval_);
  60942. this.trackingInterval_ = null;
  60943. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60944. this.off(this.player_, "seeked", this.handleSeeked_);
  60945. this.off(this.player_, "play", this.handlePlay_);
  60946. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60947. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  60948. }
  60949. nextSeekedFromUser() {
  60950. this.nextSeekedFromUser_ = true;
  60951. }
  60952. stopTracking() {
  60953. if (!this.isTracking()) {
  60954. return;
  60955. }
  60956. this.reset_();
  60957. this.trigger("liveedgechange");
  60958. }
  60959. seekableEnd() {
  60960. const seekable3 = this.player_.seekable();
  60961. const seekableEnds = [];
  60962. let i2 = seekable3 ? seekable3.length : 0;
  60963. while (i2--) {
  60964. seekableEnds.push(seekable3.end(i2));
  60965. }
  60966. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  60967. }
  60968. seekableStart() {
  60969. const seekable3 = this.player_.seekable();
  60970. const seekableStarts = [];
  60971. let i2 = seekable3 ? seekable3.length : 0;
  60972. while (i2--) {
  60973. seekableStarts.push(seekable3.start(i2));
  60974. }
  60975. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  60976. }
  60977. liveWindow() {
  60978. const liveCurrentTime = this.liveCurrentTime();
  60979. if (liveCurrentTime === Infinity) {
  60980. return 0;
  60981. }
  60982. return liveCurrentTime - this.seekableStart();
  60983. }
  60984. isLive() {
  60985. return this.isTracking();
  60986. }
  60987. atLiveEdge() {
  60988. return !this.behindLiveEdge();
  60989. }
  60990. liveCurrentTime() {
  60991. return this.pastSeekEnd() + this.seekableEnd();
  60992. }
  60993. pastSeekEnd() {
  60994. const seekableEnd = this.seekableEnd();
  60995. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  60996. this.pastSeekEnd_ = 0;
  60997. }
  60998. this.lastSeekEnd_ = seekableEnd;
  60999. return this.pastSeekEnd_;
  61000. }
  61001. behindLiveEdge() {
  61002. return this.behindLiveEdge_;
  61003. }
  61004. isTracking() {
  61005. return typeof this.trackingInterval_ === "number";
  61006. }
  61007. seekToLiveEdge() {
  61008. this.seekedBehindLive_ = false;
  61009. if (this.atLiveEdge()) {
  61010. return;
  61011. }
  61012. this.nextSeekedFromUser_ = false;
  61013. this.player_.currentTime(this.liveCurrentTime());
  61014. }
  61015. dispose() {
  61016. this.stopTracking();
  61017. super.dispose();
  61018. }
  61019. }
  61020. Component$1$1.registerComponent("LiveTracker", LiveTracker$1);
  61021. class TitleBar extends Component$1$1 {
  61022. constructor(player, options2) {
  61023. super(player, options2);
  61024. this.on("statechanged", (e) => this.updateDom_());
  61025. this.updateDom_();
  61026. }
  61027. createEl() {
  61028. this.els = {
  61029. title: createEl$1("div", {
  61030. className: "vjs-title-bar-title",
  61031. id: `vjs-title-bar-title-${newGUID$1()}`
  61032. }),
  61033. description: createEl$1("div", {
  61034. className: "vjs-title-bar-description",
  61035. id: `vjs-title-bar-description-${newGUID$1()}`
  61036. })
  61037. };
  61038. return createEl$1("div", {
  61039. className: "vjs-title-bar"
  61040. }, {}, Object.values(this.els));
  61041. }
  61042. updateDom_() {
  61043. const tech = this.player_.tech_;
  61044. const techEl = tech && tech.el_;
  61045. const techAriaAttrs = {
  61046. title: "aria-labelledby",
  61047. description: "aria-describedby"
  61048. };
  61049. ["title", "description"].forEach((k) => {
  61050. const value = this.state[k];
  61051. const el = this.els[k];
  61052. const techAriaAttr = techAriaAttrs[k];
  61053. emptyEl$1(el);
  61054. if (value) {
  61055. textContent$1(el, value);
  61056. }
  61057. if (techEl) {
  61058. techEl.removeAttribute(techAriaAttr);
  61059. if (value) {
  61060. techEl.setAttribute(techAriaAttr, el.id);
  61061. }
  61062. }
  61063. });
  61064. if (this.state.title || this.state.description) {
  61065. this.show();
  61066. } else {
  61067. this.hide();
  61068. }
  61069. }
  61070. update(options2) {
  61071. this.setState(options2);
  61072. }
  61073. dispose() {
  61074. const tech = this.player_.tech_;
  61075. const techEl = tech && tech.el_;
  61076. if (techEl) {
  61077. techEl.removeAttribute("aria-labelledby");
  61078. techEl.removeAttribute("aria-describedby");
  61079. }
  61080. super.dispose();
  61081. this.els = null;
  61082. }
  61083. }
  61084. Component$1$1.registerComponent("TitleBar", TitleBar);
  61085. const sourcesetLoad$1 = (tech) => {
  61086. const el = tech.el();
  61087. if (el.hasAttribute("src")) {
  61088. tech.triggerSourceset(el.src);
  61089. return true;
  61090. }
  61091. const sources = tech.$$("source");
  61092. const srcUrls = [];
  61093. let src = "";
  61094. if (!sources.length) {
  61095. return false;
  61096. }
  61097. for (let i2 = 0; i2 < sources.length; i2++) {
  61098. const url = sources[i2].src;
  61099. if (url && srcUrls.indexOf(url) === -1) {
  61100. srcUrls.push(url);
  61101. }
  61102. }
  61103. if (!srcUrls.length) {
  61104. return false;
  61105. }
  61106. if (srcUrls.length === 1) {
  61107. src = srcUrls[0];
  61108. }
  61109. tech.triggerSourceset(src);
  61110. return true;
  61111. };
  61112. const innerHTMLDescriptorPolyfill$1 = Object.defineProperty({}, "innerHTML", {
  61113. get() {
  61114. return this.cloneNode(true).innerHTML;
  61115. },
  61116. set(v) {
  61117. const dummy = document_1.createElement(this.nodeName.toLowerCase());
  61118. dummy.innerHTML = v;
  61119. const docFrag = document_1.createDocumentFragment();
  61120. while (dummy.childNodes.length) {
  61121. docFrag.appendChild(dummy.childNodes[0]);
  61122. }
  61123. this.innerText = "";
  61124. window_1.Element.prototype.appendChild.call(this, docFrag);
  61125. return this.innerHTML;
  61126. }
  61127. });
  61128. const getDescriptor$1 = (priority, prop) => {
  61129. let descriptor = {};
  61130. for (let i2 = 0; i2 < priority.length; i2++) {
  61131. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  61132. if (descriptor && descriptor.set && descriptor.get) {
  61133. break;
  61134. }
  61135. }
  61136. descriptor.enumerable = true;
  61137. descriptor.configurable = true;
  61138. return descriptor;
  61139. };
  61140. const getInnerHTMLDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill$1], "innerHTML");
  61141. const firstSourceWatch$1 = function(tech) {
  61142. const el = tech.el();
  61143. if (el.resetSourceWatch_) {
  61144. return;
  61145. }
  61146. const old = {};
  61147. const innerDescriptor = getInnerHTMLDescriptor$1(tech);
  61148. const appendWrapper = (appendFn) => (...args) => {
  61149. const retval = appendFn.apply(el, args);
  61150. sourcesetLoad$1(tech);
  61151. return retval;
  61152. };
  61153. ["append", "appendChild", "insertAdjacentHTML"].forEach((k) => {
  61154. if (!el[k]) {
  61155. return;
  61156. }
  61157. old[k] = el[k];
  61158. el[k] = appendWrapper(old[k]);
  61159. });
  61160. Object.defineProperty(el, "innerHTML", merge$1(innerDescriptor, {
  61161. set: appendWrapper(innerDescriptor.set)
  61162. }));
  61163. el.resetSourceWatch_ = () => {
  61164. el.resetSourceWatch_ = null;
  61165. Object.keys(old).forEach((k) => {
  61166. el[k] = old[k];
  61167. });
  61168. Object.defineProperty(el, "innerHTML", innerDescriptor);
  61169. };
  61170. tech.one("sourceset", el.resetSourceWatch_);
  61171. };
  61172. const srcDescriptorPolyfill$1 = Object.defineProperty({}, "src", {
  61173. get() {
  61174. if (this.hasAttribute("src")) {
  61175. return getAbsoluteURL$1(window_1.Element.prototype.getAttribute.call(this, "src"));
  61176. }
  61177. return "";
  61178. },
  61179. set(v) {
  61180. window_1.Element.prototype.setAttribute.call(this, "src", v);
  61181. return v;
  61182. }
  61183. });
  61184. const getSrcDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill$1], "src");
  61185. const setupSourceset$1 = function(tech) {
  61186. if (!tech.featuresSourceset) {
  61187. return;
  61188. }
  61189. const el = tech.el();
  61190. if (el.resetSourceset_) {
  61191. return;
  61192. }
  61193. const srcDescriptor = getSrcDescriptor$1(tech);
  61194. const oldSetAttribute = el.setAttribute;
  61195. const oldLoad = el.load;
  61196. Object.defineProperty(el, "src", merge$1(srcDescriptor, {
  61197. set: (v) => {
  61198. const retval = srcDescriptor.set.call(el, v);
  61199. tech.triggerSourceset(el.src);
  61200. return retval;
  61201. }
  61202. }));
  61203. el.setAttribute = (n, v) => {
  61204. const retval = oldSetAttribute.call(el, n, v);
  61205. if (/src/i.test(n)) {
  61206. tech.triggerSourceset(el.src);
  61207. }
  61208. return retval;
  61209. };
  61210. el.load = () => {
  61211. const retval = oldLoad.call(el);
  61212. if (!sourcesetLoad$1(tech)) {
  61213. tech.triggerSourceset("");
  61214. firstSourceWatch$1(tech);
  61215. }
  61216. return retval;
  61217. };
  61218. if (el.currentSrc) {
  61219. tech.triggerSourceset(el.currentSrc);
  61220. } else if (!sourcesetLoad$1(tech)) {
  61221. firstSourceWatch$1(tech);
  61222. }
  61223. el.resetSourceset_ = () => {
  61224. el.resetSourceset_ = null;
  61225. el.load = oldLoad;
  61226. el.setAttribute = oldSetAttribute;
  61227. Object.defineProperty(el, "src", srcDescriptor);
  61228. if (el.resetSourceWatch_) {
  61229. el.resetSourceWatch_();
  61230. }
  61231. };
  61232. };
  61233. class Html5$2 extends Tech$2 {
  61234. constructor(options2, ready) {
  61235. super(options2, ready);
  61236. const source = options2.source;
  61237. let crossoriginTracks = false;
  61238. this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === "VIDEO";
  61239. if (source && (this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  61240. this.setSource(source);
  61241. } else {
  61242. this.handleLateInit_(this.el_);
  61243. }
  61244. if (options2.enableSourceset) {
  61245. this.setupSourcesetHandling_();
  61246. }
  61247. this.isScrubbing_ = false;
  61248. if (this.el_.hasChildNodes()) {
  61249. const nodes = this.el_.childNodes;
  61250. let nodesLength = nodes.length;
  61251. const removeNodes = [];
  61252. while (nodesLength--) {
  61253. const node = nodes[nodesLength];
  61254. const nodeName = node.nodeName.toLowerCase();
  61255. if (nodeName === "track") {
  61256. if (!this.featuresNativeTextTracks) {
  61257. removeNodes.push(node);
  61258. } else {
  61259. this.remoteTextTrackEls().addTrackElement_(node);
  61260. this.remoteTextTracks().addTrack(node.track);
  61261. this.textTracks().addTrack(node.track);
  61262. if (!crossoriginTracks && !this.el_.hasAttribute("crossorigin") && isCrossOrigin$1(node.src)) {
  61263. crossoriginTracks = true;
  61264. }
  61265. }
  61266. }
  61267. }
  61268. for (let i2 = 0; i2 < removeNodes.length; i2++) {
  61269. this.el_.removeChild(removeNodes[i2]);
  61270. }
  61271. }
  61272. this.proxyNativeTracks_();
  61273. if (this.featuresNativeTextTracks && crossoriginTracks) {
  61274. log$1$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  61275. }
  61276. this.restoreMetadataTracksInIOSNativePlayer_();
  61277. if ((TOUCH_ENABLED$1 || IS_IPHONE$1) && options2.nativeControlsForTouch === true) {
  61278. this.setControls(true);
  61279. }
  61280. this.proxyWebkitFullscreen_();
  61281. this.triggerReady();
  61282. }
  61283. dispose() {
  61284. if (this.el_ && this.el_.resetSourceset_) {
  61285. this.el_.resetSourceset_();
  61286. }
  61287. Html5$2.disposeMediaElement(this.el_);
  61288. this.options_ = null;
  61289. super.dispose();
  61290. }
  61291. setupSourcesetHandling_() {
  61292. setupSourceset$1(this);
  61293. }
  61294. restoreMetadataTracksInIOSNativePlayer_() {
  61295. const textTracks = this.textTracks();
  61296. let metadataTracksPreFullscreenState;
  61297. const takeMetadataTrackSnapshot = () => {
  61298. metadataTracksPreFullscreenState = [];
  61299. for (let i2 = 0; i2 < textTracks.length; i2++) {
  61300. const track = textTracks[i2];
  61301. if (track.kind === "metadata") {
  61302. metadataTracksPreFullscreenState.push({
  61303. track,
  61304. storedMode: track.mode
  61305. });
  61306. }
  61307. }
  61308. };
  61309. takeMetadataTrackSnapshot();
  61310. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61311. this.on("dispose", () => textTracks.removeEventListener("change", takeMetadataTrackSnapshot));
  61312. const restoreTrackMode = () => {
  61313. for (let i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  61314. const storedTrack = metadataTracksPreFullscreenState[i2];
  61315. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  61316. storedTrack.track.mode = storedTrack.storedMode;
  61317. }
  61318. }
  61319. textTracks.removeEventListener("change", restoreTrackMode);
  61320. };
  61321. this.on("webkitbeginfullscreen", () => {
  61322. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61323. textTracks.removeEventListener("change", restoreTrackMode);
  61324. textTracks.addEventListener("change", restoreTrackMode);
  61325. });
  61326. this.on("webkitendfullscreen", () => {
  61327. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61328. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61329. textTracks.removeEventListener("change", restoreTrackMode);
  61330. });
  61331. }
  61332. overrideNative_(type2, override) {
  61333. if (override !== this[`featuresNative${type2}Tracks`]) {
  61334. return;
  61335. }
  61336. const lowerCaseType = type2.toLowerCase();
  61337. if (this[`${lowerCaseType}TracksListeners_`]) {
  61338. Object.keys(this[`${lowerCaseType}TracksListeners_`]).forEach((eventName) => {
  61339. const elTracks = this.el()[`${lowerCaseType}Tracks`];
  61340. elTracks.removeEventListener(eventName, this[`${lowerCaseType}TracksListeners_`][eventName]);
  61341. });
  61342. }
  61343. this[`featuresNative${type2}Tracks`] = !override;
  61344. this[`${lowerCaseType}TracksListeners_`] = null;
  61345. this.proxyNativeTracksForType_(lowerCaseType);
  61346. }
  61347. overrideNativeAudioTracks(override) {
  61348. this.overrideNative_("Audio", override);
  61349. }
  61350. overrideNativeVideoTracks(override) {
  61351. this.overrideNative_("Video", override);
  61352. }
  61353. proxyNativeTracksForType_(name) {
  61354. const props = NORMAL$1[name];
  61355. const elTracks = this.el()[props.getterName];
  61356. const techTracks = this[props.getterName]();
  61357. if (!this[`featuresNative${props.capitalName}Tracks`] || !elTracks || !elTracks.addEventListener) {
  61358. return;
  61359. }
  61360. const listeners = {
  61361. change: (e) => {
  61362. const event2 = {
  61363. type: "change",
  61364. target: techTracks,
  61365. currentTarget: techTracks,
  61366. srcElement: techTracks
  61367. };
  61368. techTracks.trigger(event2);
  61369. if (name === "text") {
  61370. this[REMOTE$1.remoteText.getterName]().trigger(event2);
  61371. }
  61372. },
  61373. addtrack(e) {
  61374. techTracks.addTrack(e.track);
  61375. },
  61376. removetrack(e) {
  61377. techTracks.removeTrack(e.track);
  61378. }
  61379. };
  61380. const removeOldTracks = function() {
  61381. const removeTracks = [];
  61382. for (let i2 = 0; i2 < techTracks.length; i2++) {
  61383. let found = false;
  61384. for (let j = 0; j < elTracks.length; j++) {
  61385. if (elTracks[j] === techTracks[i2]) {
  61386. found = true;
  61387. break;
  61388. }
  61389. }
  61390. if (!found) {
  61391. removeTracks.push(techTracks[i2]);
  61392. }
  61393. }
  61394. while (removeTracks.length) {
  61395. techTracks.removeTrack(removeTracks.shift());
  61396. }
  61397. };
  61398. this[props.getterName + "Listeners_"] = listeners;
  61399. Object.keys(listeners).forEach((eventName) => {
  61400. const listener = listeners[eventName];
  61401. elTracks.addEventListener(eventName, listener);
  61402. this.on("dispose", (e) => elTracks.removeEventListener(eventName, listener));
  61403. });
  61404. this.on("loadstart", removeOldTracks);
  61405. this.on("dispose", (e) => this.off("loadstart", removeOldTracks));
  61406. }
  61407. proxyNativeTracks_() {
  61408. NORMAL$1.names.forEach((name) => {
  61409. this.proxyNativeTracksForType_(name);
  61410. });
  61411. }
  61412. createEl() {
  61413. let el = this.options_.tag;
  61414. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  61415. if (el) {
  61416. const clone = el.cloneNode(true);
  61417. if (el.parentNode) {
  61418. el.parentNode.insertBefore(clone, el);
  61419. }
  61420. Html5$2.disposeMediaElement(el);
  61421. el = clone;
  61422. } else {
  61423. el = document_1.createElement("video");
  61424. const tagAttributes = this.options_.tag && getAttributes$1(this.options_.tag);
  61425. const attributes = merge$1({}, tagAttributes);
  61426. if (!TOUCH_ENABLED$1 || this.options_.nativeControlsForTouch !== true) {
  61427. delete attributes.controls;
  61428. }
  61429. setAttributes$1(el, Object.assign(attributes, {
  61430. id: this.options_.techId,
  61431. class: "vjs-tech"
  61432. }));
  61433. }
  61434. el.playerId = this.options_.playerId;
  61435. }
  61436. if (typeof this.options_.preload !== "undefined") {
  61437. setAttribute$1(el, "preload", this.options_.preload);
  61438. }
  61439. if (this.options_.disablePictureInPicture !== void 0) {
  61440. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  61441. }
  61442. const settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  61443. for (let i2 = 0; i2 < settingsAttrs.length; i2++) {
  61444. const attr = settingsAttrs[i2];
  61445. const value = this.options_[attr];
  61446. if (typeof value !== "undefined") {
  61447. if (value) {
  61448. setAttribute$1(el, attr, attr);
  61449. } else {
  61450. removeAttribute$1(el, attr);
  61451. }
  61452. el[attr] = value;
  61453. }
  61454. }
  61455. return el;
  61456. }
  61457. handleLateInit_(el) {
  61458. if (el.networkState === 0 || el.networkState === 3) {
  61459. return;
  61460. }
  61461. if (el.readyState === 0) {
  61462. let loadstartFired = false;
  61463. const setLoadstartFired = function() {
  61464. loadstartFired = true;
  61465. };
  61466. this.on("loadstart", setLoadstartFired);
  61467. const triggerLoadstart = function() {
  61468. if (!loadstartFired) {
  61469. this.trigger("loadstart");
  61470. }
  61471. };
  61472. this.on("loadedmetadata", triggerLoadstart);
  61473. this.ready(function() {
  61474. this.off("loadstart", setLoadstartFired);
  61475. this.off("loadedmetadata", triggerLoadstart);
  61476. if (!loadstartFired) {
  61477. this.trigger("loadstart");
  61478. }
  61479. });
  61480. return;
  61481. }
  61482. const eventsToTrigger = ["loadstart"];
  61483. eventsToTrigger.push("loadedmetadata");
  61484. if (el.readyState >= 2) {
  61485. eventsToTrigger.push("loadeddata");
  61486. }
  61487. if (el.readyState >= 3) {
  61488. eventsToTrigger.push("canplay");
  61489. }
  61490. if (el.readyState >= 4) {
  61491. eventsToTrigger.push("canplaythrough");
  61492. }
  61493. this.ready(function() {
  61494. eventsToTrigger.forEach(function(type2) {
  61495. this.trigger(type2);
  61496. }, this);
  61497. });
  61498. }
  61499. setScrubbing(isScrubbing) {
  61500. this.isScrubbing_ = isScrubbing;
  61501. }
  61502. scrubbing() {
  61503. return this.isScrubbing_;
  61504. }
  61505. setCurrentTime(seconds) {
  61506. try {
  61507. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI$1) {
  61508. this.el_.fastSeek(seconds);
  61509. } else {
  61510. this.el_.currentTime = seconds;
  61511. }
  61512. } catch (e) {
  61513. log$1$1(e, "Video is not ready. (Video.js)");
  61514. }
  61515. }
  61516. duration() {
  61517. if (this.el_.duration === Infinity && IS_ANDROID$1 && IS_CHROME$1 && this.el_.currentTime === 0) {
  61518. const checkProgress = () => {
  61519. if (this.el_.currentTime > 0) {
  61520. if (this.el_.duration === Infinity) {
  61521. this.trigger("durationchange");
  61522. }
  61523. this.off("timeupdate", checkProgress);
  61524. }
  61525. };
  61526. this.on("timeupdate", checkProgress);
  61527. return NaN;
  61528. }
  61529. return this.el_.duration || NaN;
  61530. }
  61531. width() {
  61532. return this.el_.offsetWidth;
  61533. }
  61534. height() {
  61535. return this.el_.offsetHeight;
  61536. }
  61537. proxyWebkitFullscreen_() {
  61538. if (!("webkitDisplayingFullscreen" in this.el_)) {
  61539. return;
  61540. }
  61541. const endFn = function() {
  61542. this.trigger("fullscreenchange", {
  61543. isFullscreen: false
  61544. });
  61545. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  61546. this.el_.controls = false;
  61547. }
  61548. };
  61549. const beginFn = function() {
  61550. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  61551. this.one("webkitendfullscreen", endFn);
  61552. this.trigger("fullscreenchange", {
  61553. isFullscreen: true,
  61554. nativeIOSFullscreen: true
  61555. });
  61556. }
  61557. };
  61558. this.on("webkitbeginfullscreen", beginFn);
  61559. this.on("dispose", () => {
  61560. this.off("webkitbeginfullscreen", beginFn);
  61561. this.off("webkitendfullscreen", endFn);
  61562. });
  61563. }
  61564. supportsFullScreen() {
  61565. return typeof this.el_.webkitEnterFullScreen === "function";
  61566. }
  61567. enterFullScreen() {
  61568. const video = this.el_;
  61569. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  61570. silencePromise$1(this.el_.play());
  61571. this.setTimeout(function() {
  61572. video.pause();
  61573. try {
  61574. video.webkitEnterFullScreen();
  61575. } catch (e) {
  61576. this.trigger("fullscreenerror", e);
  61577. }
  61578. }, 0);
  61579. } else {
  61580. try {
  61581. video.webkitEnterFullScreen();
  61582. } catch (e) {
  61583. this.trigger("fullscreenerror", e);
  61584. }
  61585. }
  61586. }
  61587. exitFullScreen() {
  61588. if (!this.el_.webkitDisplayingFullscreen) {
  61589. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  61590. return;
  61591. }
  61592. this.el_.webkitExitFullScreen();
  61593. }
  61594. requestPictureInPicture() {
  61595. return this.el_.requestPictureInPicture();
  61596. }
  61597. requestVideoFrameCallback(cb) {
  61598. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61599. return this.el_.requestVideoFrameCallback(cb);
  61600. }
  61601. return super.requestVideoFrameCallback(cb);
  61602. }
  61603. cancelVideoFrameCallback(id) {
  61604. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61605. this.el_.cancelVideoFrameCallback(id);
  61606. } else {
  61607. super.cancelVideoFrameCallback(id);
  61608. }
  61609. }
  61610. src(src) {
  61611. if (src === void 0) {
  61612. return this.el_.src;
  61613. }
  61614. this.setSrc(src);
  61615. }
  61616. reset() {
  61617. Html5$2.resetMediaElement(this.el_);
  61618. }
  61619. currentSrc() {
  61620. if (this.currentSource_) {
  61621. return this.currentSource_.src;
  61622. }
  61623. return this.el_.currentSrc;
  61624. }
  61625. setControls(val) {
  61626. this.el_.controls = !!val;
  61627. }
  61628. addTextTrack(kind, label, language) {
  61629. if (!this.featuresNativeTextTracks) {
  61630. return super.addTextTrack(kind, label, language);
  61631. }
  61632. return this.el_.addTextTrack(kind, label, language);
  61633. }
  61634. createRemoteTextTrack(options2) {
  61635. if (!this.featuresNativeTextTracks) {
  61636. return super.createRemoteTextTrack(options2);
  61637. }
  61638. const htmlTrackElement = document_1.createElement("track");
  61639. if (options2.kind) {
  61640. htmlTrackElement.kind = options2.kind;
  61641. }
  61642. if (options2.label) {
  61643. htmlTrackElement.label = options2.label;
  61644. }
  61645. if (options2.language || options2.srclang) {
  61646. htmlTrackElement.srclang = options2.language || options2.srclang;
  61647. }
  61648. if (options2.default) {
  61649. htmlTrackElement.default = options2.default;
  61650. }
  61651. if (options2.id) {
  61652. htmlTrackElement.id = options2.id;
  61653. }
  61654. if (options2.src) {
  61655. htmlTrackElement.src = options2.src;
  61656. }
  61657. return htmlTrackElement;
  61658. }
  61659. addRemoteTextTrack(options2, manualCleanup) {
  61660. const htmlTrackElement = super.addRemoteTextTrack(options2, manualCleanup);
  61661. if (this.featuresNativeTextTracks) {
  61662. this.el().appendChild(htmlTrackElement);
  61663. }
  61664. return htmlTrackElement;
  61665. }
  61666. removeRemoteTextTrack(track) {
  61667. super.removeRemoteTextTrack(track);
  61668. if (this.featuresNativeTextTracks) {
  61669. const tracks = this.$$("track");
  61670. let i2 = tracks.length;
  61671. while (i2--) {
  61672. if (track === tracks[i2] || track === tracks[i2].track) {
  61673. this.el().removeChild(tracks[i2]);
  61674. }
  61675. }
  61676. }
  61677. }
  61678. getVideoPlaybackQuality() {
  61679. if (typeof this.el().getVideoPlaybackQuality === "function") {
  61680. return this.el().getVideoPlaybackQuality();
  61681. }
  61682. const videoPlaybackQuality = {};
  61683. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  61684. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  61685. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  61686. }
  61687. if (window_1.performance) {
  61688. videoPlaybackQuality.creationTime = window_1.performance.now();
  61689. }
  61690. return videoPlaybackQuality;
  61691. }
  61692. }
  61693. defineLazyProperty$1(Html5$2, "TEST_VID", function() {
  61694. if (!isReal$1()) {
  61695. return;
  61696. }
  61697. const video = document_1.createElement("video");
  61698. const track = document_1.createElement("track");
  61699. track.kind = "captions";
  61700. track.srclang = "en";
  61701. track.label = "English";
  61702. video.appendChild(track);
  61703. return video;
  61704. });
  61705. Html5$2.isSupported = function() {
  61706. try {
  61707. Html5$2.TEST_VID.volume = 0.5;
  61708. } catch (e) {
  61709. return false;
  61710. }
  61711. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.canPlayType);
  61712. };
  61713. Html5$2.canPlayType = function(type2) {
  61714. return Html5$2.TEST_VID.canPlayType(type2);
  61715. };
  61716. Html5$2.canPlaySource = function(srcObj, options2) {
  61717. return Html5$2.canPlayType(srcObj.type);
  61718. };
  61719. Html5$2.canControlVolume = function() {
  61720. try {
  61721. const volume = Html5$2.TEST_VID.volume;
  61722. Html5$2.TEST_VID.volume = volume / 2 + 0.1;
  61723. const canControl = volume !== Html5$2.TEST_VID.volume;
  61724. if (canControl && IS_IOS$1) {
  61725. window_1.setTimeout(() => {
  61726. if (Html5$2 && Html5$2.prototype) {
  61727. Html5$2.prototype.featuresVolumeControl = volume !== Html5$2.TEST_VID.volume;
  61728. }
  61729. });
  61730. return false;
  61731. }
  61732. return canControl;
  61733. } catch (e) {
  61734. return false;
  61735. }
  61736. };
  61737. Html5$2.canMuteVolume = function() {
  61738. try {
  61739. const muted = Html5$2.TEST_VID.muted;
  61740. Html5$2.TEST_VID.muted = !muted;
  61741. if (Html5$2.TEST_VID.muted) {
  61742. setAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61743. } else {
  61744. removeAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61745. }
  61746. return muted !== Html5$2.TEST_VID.muted;
  61747. } catch (e) {
  61748. return false;
  61749. }
  61750. };
  61751. Html5$2.canControlPlaybackRate = function() {
  61752. if (IS_ANDROID$1 && IS_CHROME$1 && CHROME_VERSION$1 < 58) {
  61753. return false;
  61754. }
  61755. try {
  61756. const playbackRate = Html5$2.TEST_VID.playbackRate;
  61757. Html5$2.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  61758. return playbackRate !== Html5$2.TEST_VID.playbackRate;
  61759. } catch (e) {
  61760. return false;
  61761. }
  61762. };
  61763. Html5$2.canOverrideAttributes = function() {
  61764. try {
  61765. const noop2 = () => {
  61766. };
  61767. Object.defineProperty(document_1.createElement("video"), "src", {
  61768. get: noop2,
  61769. set: noop2
  61770. });
  61771. Object.defineProperty(document_1.createElement("audio"), "src", {
  61772. get: noop2,
  61773. set: noop2
  61774. });
  61775. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  61776. get: noop2,
  61777. set: noop2
  61778. });
  61779. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  61780. get: noop2,
  61781. set: noop2
  61782. });
  61783. } catch (e) {
  61784. return false;
  61785. }
  61786. return true;
  61787. };
  61788. Html5$2.supportsNativeTextTracks = function() {
  61789. return IS_ANY_SAFARI$1 || IS_IOS$1 && IS_CHROME$1;
  61790. };
  61791. Html5$2.supportsNativeVideoTracks = function() {
  61792. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.videoTracks);
  61793. };
  61794. Html5$2.supportsNativeAudioTracks = function() {
  61795. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.audioTracks);
  61796. };
  61797. Html5$2.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  61798. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function([key, fn2]) {
  61799. defineLazyProperty$1(Html5$2.prototype, key, () => Html5$2[fn2](), true);
  61800. });
  61801. Html5$2.prototype.featuresVolumeControl = Html5$2.canControlVolume();
  61802. Html5$2.prototype.movingMediaElementInDOM = !IS_IOS$1;
  61803. Html5$2.prototype.featuresFullscreenResize = true;
  61804. Html5$2.prototype.featuresProgressEvents = true;
  61805. Html5$2.prototype.featuresTimeupdateEvents = true;
  61806. Html5$2.prototype.featuresVideoFrameCallback = !!(Html5$2.TEST_VID && Html5$2.TEST_VID.requestVideoFrameCallback);
  61807. Html5$2.disposeMediaElement = function(el) {
  61808. if (!el) {
  61809. return;
  61810. }
  61811. if (el.parentNode) {
  61812. el.parentNode.removeChild(el);
  61813. }
  61814. while (el.hasChildNodes()) {
  61815. el.removeChild(el.firstChild);
  61816. }
  61817. el.removeAttribute("src");
  61818. if (typeof el.load === "function") {
  61819. (function() {
  61820. try {
  61821. el.load();
  61822. } catch (e) {
  61823. }
  61824. })();
  61825. }
  61826. };
  61827. Html5$2.resetMediaElement = function(el) {
  61828. if (!el) {
  61829. return;
  61830. }
  61831. const sources = el.querySelectorAll("source");
  61832. let i2 = sources.length;
  61833. while (i2--) {
  61834. el.removeChild(sources[i2]);
  61835. }
  61836. el.removeAttribute("src");
  61837. if (typeof el.load === "function") {
  61838. (function() {
  61839. try {
  61840. el.load();
  61841. } catch (e) {
  61842. }
  61843. })();
  61844. }
  61845. };
  61846. [
  61847. "muted",
  61848. "defaultMuted",
  61849. "autoplay",
  61850. "controls",
  61851. "loop",
  61852. "playsinline"
  61853. ].forEach(function(prop) {
  61854. Html5$2.prototype[prop] = function() {
  61855. return this.el_[prop] || this.el_.hasAttribute(prop);
  61856. };
  61857. });
  61858. [
  61859. "muted",
  61860. "defaultMuted",
  61861. "autoplay",
  61862. "loop",
  61863. "playsinline"
  61864. ].forEach(function(prop) {
  61865. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61866. this.el_[prop] = v;
  61867. if (v) {
  61868. this.el_.setAttribute(prop, prop);
  61869. } else {
  61870. this.el_.removeAttribute(prop);
  61871. }
  61872. };
  61873. });
  61874. [
  61875. "paused",
  61876. "currentTime",
  61877. "buffered",
  61878. "volume",
  61879. "poster",
  61880. "preload",
  61881. "error",
  61882. "seeking",
  61883. "seekable",
  61884. "ended",
  61885. "playbackRate",
  61886. "defaultPlaybackRate",
  61887. "disablePictureInPicture",
  61888. "played",
  61889. "networkState",
  61890. "readyState",
  61891. "videoWidth",
  61892. "videoHeight",
  61893. "crossOrigin"
  61894. ].forEach(function(prop) {
  61895. Html5$2.prototype[prop] = function() {
  61896. return this.el_[prop];
  61897. };
  61898. });
  61899. [
  61900. "volume",
  61901. "src",
  61902. "poster",
  61903. "preload",
  61904. "playbackRate",
  61905. "defaultPlaybackRate",
  61906. "disablePictureInPicture",
  61907. "crossOrigin"
  61908. ].forEach(function(prop) {
  61909. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61910. this.el_[prop] = v;
  61911. };
  61912. });
  61913. [
  61914. "pause",
  61915. "load",
  61916. "play"
  61917. ].forEach(function(prop) {
  61918. Html5$2.prototype[prop] = function() {
  61919. return this.el_[prop]();
  61920. };
  61921. });
  61922. Tech$2.withSourceHandlers(Html5$2);
  61923. Html5$2.nativeSourceHandler = {};
  61924. Html5$2.nativeSourceHandler.canPlayType = function(type2) {
  61925. try {
  61926. return Html5$2.TEST_VID.canPlayType(type2);
  61927. } catch (e) {
  61928. return "";
  61929. }
  61930. };
  61931. Html5$2.nativeSourceHandler.canHandleSource = function(source, options2) {
  61932. if (source.type) {
  61933. return Html5$2.nativeSourceHandler.canPlayType(source.type);
  61934. } else if (source.src) {
  61935. const ext = getFileExtension$1(source.src);
  61936. return Html5$2.nativeSourceHandler.canPlayType(`video/${ext}`);
  61937. }
  61938. return "";
  61939. };
  61940. Html5$2.nativeSourceHandler.handleSource = function(source, tech, options2) {
  61941. tech.setSrc(source.src);
  61942. };
  61943. Html5$2.nativeSourceHandler.dispose = function() {
  61944. };
  61945. Html5$2.registerSourceHandler(Html5$2.nativeSourceHandler);
  61946. Tech$2.registerTech("Html5", Html5$2);
  61947. const TECH_EVENTS_RETRIGGER$1 = [
  61948. "progress",
  61949. "abort",
  61950. "suspend",
  61951. "emptied",
  61952. "stalled",
  61953. "loadedmetadata",
  61954. "loadeddata",
  61955. "timeupdate",
  61956. "resize",
  61957. "volumechange",
  61958. "texttrackchange"
  61959. ];
  61960. const TECH_EVENTS_QUEUE$1 = {
  61961. canplay: "CanPlay",
  61962. canplaythrough: "CanPlayThrough",
  61963. playing: "Playing",
  61964. seeked: "Seeked"
  61965. };
  61966. const BREAKPOINT_ORDER$1 = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  61967. const BREAKPOINT_CLASSES$1 = {};
  61968. BREAKPOINT_ORDER$1.forEach((k) => {
  61969. const v = k.charAt(0) === "x" ? `x-${k.substring(1)}` : k;
  61970. BREAKPOINT_CLASSES$1[k] = `vjs-layout-${v}`;
  61971. });
  61972. const DEFAULT_BREAKPOINTS$1 = {
  61973. tiny: 210,
  61974. xsmall: 320,
  61975. small: 425,
  61976. medium: 768,
  61977. large: 1440,
  61978. xlarge: 2560,
  61979. huge: Infinity
  61980. };
  61981. class Player$1 extends Component$1$1 {
  61982. constructor(tag, options2, ready) {
  61983. tag.id = tag.id || options2.id || `vjs_video_${newGUID$1()}`;
  61984. options2 = Object.assign(Player$1.getTagSettings(tag), options2);
  61985. options2.initChildren = false;
  61986. options2.createEl = false;
  61987. options2.evented = false;
  61988. options2.reportTouchActivity = false;
  61989. if (!options2.language) {
  61990. const closest = tag.closest("[lang]");
  61991. if (closest) {
  61992. options2.language = closest.getAttribute("lang");
  61993. }
  61994. }
  61995. super(null, options2, ready);
  61996. this.boundDocumentFullscreenChange_ = (e) => this.documentFullscreenChange_(e);
  61997. this.boundFullWindowOnEscKey_ = (e) => this.fullWindowOnEscKey(e);
  61998. this.boundUpdateStyleEl_ = (e) => this.updateStyleEl_(e);
  61999. this.boundApplyInitTime_ = (e) => this.applyInitTime_(e);
  62000. this.boundUpdateCurrentBreakpoint_ = (e) => this.updateCurrentBreakpoint_(e);
  62001. this.boundHandleTechClick_ = (e) => this.handleTechClick_(e);
  62002. this.boundHandleTechDoubleClick_ = (e) => this.handleTechDoubleClick_(e);
  62003. this.boundHandleTechTouchStart_ = (e) => this.handleTechTouchStart_(e);
  62004. this.boundHandleTechTouchMove_ = (e) => this.handleTechTouchMove_(e);
  62005. this.boundHandleTechTouchEnd_ = (e) => this.handleTechTouchEnd_(e);
  62006. this.boundHandleTechTap_ = (e) => this.handleTechTap_(e);
  62007. this.isFullscreen_ = false;
  62008. this.log = createLogger$2(this.id_);
  62009. this.fsApi_ = FullscreenApi$1;
  62010. this.isPosterFromTech_ = false;
  62011. this.queuedCallbacks_ = [];
  62012. this.isReady_ = false;
  62013. this.hasStarted_ = false;
  62014. this.userActive_ = false;
  62015. this.debugEnabled_ = false;
  62016. this.audioOnlyMode_ = false;
  62017. this.audioPosterMode_ = false;
  62018. this.audioOnlyCache_ = {
  62019. playerHeight: null,
  62020. hiddenChildren: []
  62021. };
  62022. if (!this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) {
  62023. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  62024. }
  62025. this.tag = tag;
  62026. this.tagAttributes = tag && getAttributes$1(tag);
  62027. this.language(this.options_.language);
  62028. if (options2.languages) {
  62029. const languagesToLower = {};
  62030. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  62031. languagesToLower[name.toLowerCase()] = options2.languages[name];
  62032. });
  62033. this.languages_ = languagesToLower;
  62034. } else {
  62035. this.languages_ = Player$1.prototype.options_.languages;
  62036. }
  62037. this.resetCache_();
  62038. this.poster_ = options2.poster || "";
  62039. this.controls_ = !!options2.controls;
  62040. tag.controls = false;
  62041. tag.removeAttribute("controls");
  62042. this.changingSrc_ = false;
  62043. this.playCallbacks_ = [];
  62044. this.playTerminatedQueue_ = [];
  62045. if (tag.hasAttribute("autoplay")) {
  62046. this.autoplay(true);
  62047. } else {
  62048. this.autoplay(this.options_.autoplay);
  62049. }
  62050. if (options2.plugins) {
  62051. Object.keys(options2.plugins).forEach((name) => {
  62052. if (typeof this[name] !== "function") {
  62053. throw new Error(`plugin "${name}" does not exist`);
  62054. }
  62055. });
  62056. }
  62057. this.scrubbing_ = false;
  62058. this.el_ = this.createEl();
  62059. evented$1(this, {
  62060. eventBusKey: "el_"
  62061. });
  62062. if (this.fsApi_.requestFullscreen) {
  62063. on$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62064. this.on(this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62065. }
  62066. if (this.fluid_) {
  62067. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62068. }
  62069. const playerOptionsCopy = merge$1(this.options_);
  62070. if (options2.plugins) {
  62071. Object.keys(options2.plugins).forEach((name) => {
  62072. this[name](options2.plugins[name]);
  62073. });
  62074. }
  62075. if (options2.debug) {
  62076. this.debug(true);
  62077. }
  62078. this.options_.playerOptions = playerOptionsCopy;
  62079. this.middleware_ = [];
  62080. this.playbackRates(options2.playbackRates);
  62081. this.initChildren();
  62082. this.isAudio(tag.nodeName.toLowerCase() === "audio");
  62083. if (this.controls()) {
  62084. this.addClass("vjs-controls-enabled");
  62085. } else {
  62086. this.addClass("vjs-controls-disabled");
  62087. }
  62088. this.el_.setAttribute("role", "region");
  62089. if (this.isAudio()) {
  62090. this.el_.setAttribute("aria-label", this.localize("Audio Player"));
  62091. } else {
  62092. this.el_.setAttribute("aria-label", this.localize("Video Player"));
  62093. }
  62094. if (this.isAudio()) {
  62095. this.addClass("vjs-audio");
  62096. }
  62097. if (TOUCH_ENABLED$1) {
  62098. this.addClass("vjs-touch-enabled");
  62099. }
  62100. if (!IS_IOS$1) {
  62101. this.addClass("vjs-workinghover");
  62102. }
  62103. Player$1.players[this.id_] = this;
  62104. const majorVersion = version$6$1.split(".")[0];
  62105. this.addClass(`vjs-v${majorVersion}`);
  62106. this.userActive(true);
  62107. this.reportUserActivity();
  62108. this.one("play", (e) => this.listenForUserActivity_(e));
  62109. this.on("keydown", (e) => this.handleKeyDown(e));
  62110. this.on("languagechange", (e) => this.handleLanguagechange(e));
  62111. this.breakpoints(this.options_.breakpoints);
  62112. this.responsive(this.options_.responsive);
  62113. this.on("ready", () => {
  62114. this.audioPosterMode(this.options_.audioPosterMode);
  62115. this.audioOnlyMode(this.options_.audioOnlyMode);
  62116. });
  62117. }
  62118. dispose() {
  62119. this.trigger("dispose");
  62120. this.off("dispose");
  62121. off$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62122. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  62123. if (this.styleEl_ && this.styleEl_.parentNode) {
  62124. this.styleEl_.parentNode.removeChild(this.styleEl_);
  62125. this.styleEl_ = null;
  62126. }
  62127. Player$1.players[this.id_] = null;
  62128. if (this.tag && this.tag.player) {
  62129. this.tag.player = null;
  62130. }
  62131. if (this.el_ && this.el_.player) {
  62132. this.el_.player = null;
  62133. }
  62134. if (this.tech_) {
  62135. this.tech_.dispose();
  62136. this.isPosterFromTech_ = false;
  62137. this.poster_ = "";
  62138. }
  62139. if (this.playerElIngest_) {
  62140. this.playerElIngest_ = null;
  62141. }
  62142. if (this.tag) {
  62143. this.tag = null;
  62144. }
  62145. clearCacheForPlayer$1(this);
  62146. ALL$1.names.forEach((name) => {
  62147. const props = ALL$1[name];
  62148. const list = this[props.getterName]();
  62149. if (list && list.off) {
  62150. list.off();
  62151. }
  62152. });
  62153. super.dispose({
  62154. restoreEl: this.options_.restoreEl
  62155. });
  62156. }
  62157. createEl() {
  62158. let tag = this.tag;
  62159. let el;
  62160. let playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  62161. const divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  62162. if (playerElIngest) {
  62163. el = this.el_ = tag.parentNode;
  62164. } else if (!divEmbed) {
  62165. el = this.el_ = super.createEl("div");
  62166. }
  62167. const attrs = getAttributes$1(tag);
  62168. if (divEmbed) {
  62169. el = this.el_ = tag;
  62170. tag = this.tag = document_1.createElement("video");
  62171. while (el.children.length) {
  62172. tag.appendChild(el.firstChild);
  62173. }
  62174. if (!hasClass$1(el, "video-js")) {
  62175. addClass$1(el, "video-js");
  62176. }
  62177. el.appendChild(tag);
  62178. playerElIngest = this.playerElIngest_ = el;
  62179. Object.keys(el).forEach((k) => {
  62180. try {
  62181. tag[k] = el[k];
  62182. } catch (e) {
  62183. }
  62184. });
  62185. }
  62186. tag.setAttribute("tabindex", "-1");
  62187. attrs.tabindex = "-1";
  62188. if (IS_CHROME$1 && IS_WINDOWS$1) {
  62189. tag.setAttribute("role", "application");
  62190. attrs.role = "application";
  62191. }
  62192. tag.removeAttribute("width");
  62193. tag.removeAttribute("height");
  62194. if ("width" in attrs) {
  62195. delete attrs.width;
  62196. }
  62197. if ("height" in attrs) {
  62198. delete attrs.height;
  62199. }
  62200. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  62201. if (!(divEmbed && attr === "class")) {
  62202. el.setAttribute(attr, attrs[attr]);
  62203. }
  62204. if (divEmbed) {
  62205. tag.setAttribute(attr, attrs[attr]);
  62206. }
  62207. });
  62208. tag.playerId = tag.id;
  62209. tag.id += "_html5_api";
  62210. tag.className = "vjs-tech";
  62211. tag.player = el.player = this;
  62212. this.addClass("vjs-paused");
  62213. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  62214. this.styleEl_ = createStyleElement$1("vjs-styles-dimensions");
  62215. const defaultsStyleEl = $$1(".vjs-styles-defaults");
  62216. const head = $$1("head");
  62217. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  62218. }
  62219. this.fill_ = false;
  62220. this.fluid_ = false;
  62221. this.width(this.options_.width);
  62222. this.height(this.options_.height);
  62223. this.fill(this.options_.fill);
  62224. this.fluid(this.options_.fluid);
  62225. this.aspectRatio(this.options_.aspectRatio);
  62226. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  62227. const links = tag.getElementsByTagName("a");
  62228. for (let i2 = 0; i2 < links.length; i2++) {
  62229. const linkEl = links.item(i2);
  62230. addClass$1(linkEl, "vjs-hidden");
  62231. linkEl.setAttribute("hidden", "hidden");
  62232. }
  62233. tag.initNetworkState_ = tag.networkState;
  62234. if (tag.parentNode && !playerElIngest) {
  62235. tag.parentNode.insertBefore(el, tag);
  62236. }
  62237. prependTo$1(tag, el);
  62238. this.children_.unshift(tag);
  62239. this.el_.setAttribute("lang", this.language_);
  62240. this.el_.setAttribute("translate", "no");
  62241. this.el_ = el;
  62242. return el;
  62243. }
  62244. crossOrigin(value) {
  62245. if (typeof value === "undefined") {
  62246. return this.techGet_("crossOrigin");
  62247. }
  62248. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  62249. log$1$1.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  62250. return;
  62251. }
  62252. this.techCall_("setCrossOrigin", value);
  62253. if (this.posterImage) {
  62254. this.posterImage.crossOrigin(value);
  62255. }
  62256. return;
  62257. }
  62258. width(value) {
  62259. return this.dimension("width", value);
  62260. }
  62261. height(value) {
  62262. return this.dimension("height", value);
  62263. }
  62264. dimension(dimension, value) {
  62265. const privDimension = dimension + "_";
  62266. if (value === void 0) {
  62267. return this[privDimension] || 0;
  62268. }
  62269. if (value === "" || value === "auto") {
  62270. this[privDimension] = void 0;
  62271. this.updateStyleEl_();
  62272. return;
  62273. }
  62274. const parsedVal = parseFloat(value);
  62275. if (isNaN(parsedVal)) {
  62276. log$1$1.error(`Improper value "${value}" supplied for for ${dimension}`);
  62277. return;
  62278. }
  62279. this[privDimension] = parsedVal;
  62280. this.updateStyleEl_();
  62281. }
  62282. fluid(bool) {
  62283. if (bool === void 0) {
  62284. return !!this.fluid_;
  62285. }
  62286. this.fluid_ = !!bool;
  62287. if (isEvented$1(this)) {
  62288. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62289. }
  62290. if (bool) {
  62291. this.addClass("vjs-fluid");
  62292. this.fill(false);
  62293. addEventedCallback$1(this, () => {
  62294. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62295. });
  62296. } else {
  62297. this.removeClass("vjs-fluid");
  62298. }
  62299. this.updateStyleEl_();
  62300. }
  62301. fill(bool) {
  62302. if (bool === void 0) {
  62303. return !!this.fill_;
  62304. }
  62305. this.fill_ = !!bool;
  62306. if (bool) {
  62307. this.addClass("vjs-fill");
  62308. this.fluid(false);
  62309. } else {
  62310. this.removeClass("vjs-fill");
  62311. }
  62312. }
  62313. aspectRatio(ratio) {
  62314. if (ratio === void 0) {
  62315. return this.aspectRatio_;
  62316. }
  62317. if (!/^\d+\:\d+$/.test(ratio)) {
  62318. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  62319. }
  62320. this.aspectRatio_ = ratio;
  62321. this.fluid(true);
  62322. this.updateStyleEl_();
  62323. }
  62324. updateStyleEl_() {
  62325. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  62326. const width3 = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  62327. const height3 = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  62328. const techEl = this.tech_ && this.tech_.el();
  62329. if (techEl) {
  62330. if (width3 >= 0) {
  62331. techEl.width = width3;
  62332. }
  62333. if (height3 >= 0) {
  62334. techEl.height = height3;
  62335. }
  62336. }
  62337. return;
  62338. }
  62339. let width2;
  62340. let height2;
  62341. let aspectRatio;
  62342. let idClass;
  62343. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  62344. aspectRatio = this.aspectRatio_;
  62345. } else if (this.videoWidth() > 0) {
  62346. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  62347. } else {
  62348. aspectRatio = "16:9";
  62349. }
  62350. const ratioParts = aspectRatio.split(":");
  62351. const ratioMultiplier = ratioParts[1] / ratioParts[0];
  62352. if (this.width_ !== void 0) {
  62353. width2 = this.width_;
  62354. } else if (this.height_ !== void 0) {
  62355. width2 = this.height_ / ratioMultiplier;
  62356. } else {
  62357. width2 = this.videoWidth() || 300;
  62358. }
  62359. if (this.height_ !== void 0) {
  62360. height2 = this.height_;
  62361. } else {
  62362. height2 = width2 * ratioMultiplier;
  62363. }
  62364. if (/^[^a-zA-Z]/.test(this.id())) {
  62365. idClass = "dimensions-" + this.id();
  62366. } else {
  62367. idClass = this.id() + "-dimensions";
  62368. }
  62369. this.addClass(idClass);
  62370. setTextContent$1(this.styleEl_, `
  62371. .${idClass} {
  62372. width: ${width2}px;
  62373. height: ${height2}px;
  62374. }
  62375. .${idClass}.vjs-fluid:not(.vjs-audio-only-mode) {
  62376. padding-top: ${ratioMultiplier * 100}%;
  62377. }
  62378. `);
  62379. }
  62380. loadTech_(techName, source) {
  62381. if (this.tech_) {
  62382. this.unloadTech_();
  62383. }
  62384. const titleTechName = toTitleCase$1$1(techName);
  62385. const camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  62386. if (titleTechName !== "Html5" && this.tag) {
  62387. Tech$2.getTech("Html5").disposeMediaElement(this.tag);
  62388. this.tag.player = null;
  62389. this.tag = null;
  62390. }
  62391. this.techName_ = titleTechName;
  62392. this.isReady_ = false;
  62393. let autoplay = this.autoplay();
  62394. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  62395. autoplay = false;
  62396. }
  62397. const techOptions = {
  62398. source,
  62399. autoplay,
  62400. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  62401. "playerId": this.id(),
  62402. "techId": `${this.id()}_${camelTechName}_api`,
  62403. "playsinline": this.options_.playsinline,
  62404. "preload": this.options_.preload,
  62405. "loop": this.options_.loop,
  62406. "disablePictureInPicture": this.options_.disablePictureInPicture,
  62407. "muted": this.options_.muted,
  62408. "poster": this.poster(),
  62409. "language": this.language(),
  62410. "playerElIngest": this.playerElIngest_ || false,
  62411. "vtt.js": this.options_["vtt.js"],
  62412. "canOverridePoster": !!this.options_.techCanOverridePoster,
  62413. "enableSourceset": this.options_.enableSourceset
  62414. };
  62415. ALL$1.names.forEach((name) => {
  62416. const props = ALL$1[name];
  62417. techOptions[props.getterName] = this[props.privateName];
  62418. });
  62419. Object.assign(techOptions, this.options_[titleTechName]);
  62420. Object.assign(techOptions, this.options_[camelTechName]);
  62421. Object.assign(techOptions, this.options_[techName.toLowerCase()]);
  62422. if (this.tag) {
  62423. techOptions.tag = this.tag;
  62424. }
  62425. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  62426. techOptions.startTime = this.cache_.currentTime;
  62427. }
  62428. const TechClass = Tech$2.getTech(techName);
  62429. if (!TechClass) {
  62430. throw new Error(`No Tech named '${titleTechName}' exists! '${titleTechName}' should be registered using videojs.registerTech()'`);
  62431. }
  62432. this.tech_ = new TechClass(techOptions);
  62433. this.tech_.ready(bind_(this, this.handleTechReady_), true);
  62434. textTrackConverter$1.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  62435. TECH_EVENTS_RETRIGGER$1.forEach((event2) => {
  62436. this.on(this.tech_, event2, (e) => this[`handleTech${toTitleCase$1$1(event2)}_`](e));
  62437. });
  62438. Object.keys(TECH_EVENTS_QUEUE$1).forEach((event2) => {
  62439. this.on(this.tech_, event2, (eventObj) => {
  62440. if (this.tech_.playbackRate() === 0 && this.tech_.seeking()) {
  62441. this.queuedCallbacks_.push({
  62442. callback: this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`].bind(this),
  62443. event: eventObj
  62444. });
  62445. return;
  62446. }
  62447. this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`](eventObj);
  62448. });
  62449. });
  62450. this.on(this.tech_, "loadstart", (e) => this.handleTechLoadStart_(e));
  62451. this.on(this.tech_, "sourceset", (e) => this.handleTechSourceset_(e));
  62452. this.on(this.tech_, "waiting", (e) => this.handleTechWaiting_(e));
  62453. this.on(this.tech_, "ended", (e) => this.handleTechEnded_(e));
  62454. this.on(this.tech_, "seeking", (e) => this.handleTechSeeking_(e));
  62455. this.on(this.tech_, "play", (e) => this.handleTechPlay_(e));
  62456. this.on(this.tech_, "pause", (e) => this.handleTechPause_(e));
  62457. this.on(this.tech_, "durationchange", (e) => this.handleTechDurationChange_(e));
  62458. this.on(this.tech_, "fullscreenchange", (e, data) => this.handleTechFullscreenChange_(e, data));
  62459. this.on(this.tech_, "fullscreenerror", (e, err) => this.handleTechFullscreenError_(e, err));
  62460. this.on(this.tech_, "enterpictureinpicture", (e) => this.handleTechEnterPictureInPicture_(e));
  62461. this.on(this.tech_, "leavepictureinpicture", (e) => this.handleTechLeavePictureInPicture_(e));
  62462. this.on(this.tech_, "error", (e) => this.handleTechError_(e));
  62463. this.on(this.tech_, "posterchange", (e) => this.handleTechPosterChange_(e));
  62464. this.on(this.tech_, "textdata", (e) => this.handleTechTextData_(e));
  62465. this.on(this.tech_, "ratechange", (e) => this.handleTechRateChange_(e));
  62466. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  62467. this.usingNativeControls(this.techGet_("controls"));
  62468. if (this.controls() && !this.usingNativeControls()) {
  62469. this.addTechControlsListeners_();
  62470. }
  62471. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  62472. prependTo$1(this.tech_.el(), this.el());
  62473. }
  62474. if (this.tag) {
  62475. this.tag.player = null;
  62476. this.tag = null;
  62477. }
  62478. }
  62479. unloadTech_() {
  62480. ALL$1.names.forEach((name) => {
  62481. const props = ALL$1[name];
  62482. this[props.privateName] = this[props.getterName]();
  62483. });
  62484. this.textTracksJson_ = textTrackConverter$1.textTracksToJson(this.tech_);
  62485. this.isReady_ = false;
  62486. this.tech_.dispose();
  62487. this.tech_ = false;
  62488. if (this.isPosterFromTech_) {
  62489. this.poster_ = "";
  62490. this.trigger("posterchange");
  62491. }
  62492. this.isPosterFromTech_ = false;
  62493. }
  62494. tech(safety) {
  62495. if (safety === void 0) {
  62496. log$1$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  62497. }
  62498. return this.tech_;
  62499. }
  62500. addTechControlsListeners_() {
  62501. this.removeTechControlsListeners_();
  62502. this.on(this.tech_, "click", this.boundHandleTechClick_);
  62503. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62504. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62505. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62506. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62507. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  62508. }
  62509. removeTechControlsListeners_() {
  62510. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  62511. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62512. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62513. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62514. this.off(this.tech_, "click", this.boundHandleTechClick_);
  62515. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62516. }
  62517. handleTechReady_() {
  62518. this.triggerReady();
  62519. if (this.cache_.volume) {
  62520. this.techCall_("setVolume", this.cache_.volume);
  62521. }
  62522. this.handleTechPosterChange_();
  62523. this.handleTechDurationChange_();
  62524. }
  62525. handleTechLoadStart_() {
  62526. this.removeClass("vjs-ended", "vjs-seeking");
  62527. this.error(null);
  62528. this.handleTechDurationChange_();
  62529. if (!this.paused()) {
  62530. this.trigger("loadstart");
  62531. } else {
  62532. this.hasStarted(false);
  62533. this.trigger("loadstart");
  62534. }
  62535. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  62536. }
  62537. manualAutoplay_(type2) {
  62538. if (!this.tech_ || typeof type2 !== "string") {
  62539. return;
  62540. }
  62541. const resolveMuted = () => {
  62542. const previouslyMuted = this.muted();
  62543. this.muted(true);
  62544. const restoreMuted = () => {
  62545. this.muted(previouslyMuted);
  62546. };
  62547. this.playTerminatedQueue_.push(restoreMuted);
  62548. const mutedPromise = this.play();
  62549. if (!isPromise$1(mutedPromise)) {
  62550. return;
  62551. }
  62552. return mutedPromise.catch((err) => {
  62553. restoreMuted();
  62554. throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${err ? err : ""}`);
  62555. });
  62556. };
  62557. let promise;
  62558. if (type2 === "any" && !this.muted()) {
  62559. promise = this.play();
  62560. if (isPromise$1(promise)) {
  62561. promise = promise.catch(resolveMuted);
  62562. }
  62563. } else if (type2 === "muted" && !this.muted()) {
  62564. promise = resolveMuted();
  62565. } else {
  62566. promise = this.play();
  62567. }
  62568. if (!isPromise$1(promise)) {
  62569. return;
  62570. }
  62571. return promise.then(() => {
  62572. this.trigger({
  62573. type: "autoplay-success",
  62574. autoplay: type2
  62575. });
  62576. }).catch(() => {
  62577. this.trigger({
  62578. type: "autoplay-failure",
  62579. autoplay: type2
  62580. });
  62581. });
  62582. }
  62583. updateSourceCaches_(srcObj = "") {
  62584. let src = srcObj;
  62585. let type2 = "";
  62586. if (typeof src !== "string") {
  62587. src = srcObj.src;
  62588. type2 = srcObj.type;
  62589. }
  62590. this.cache_.source = this.cache_.source || {};
  62591. this.cache_.sources = this.cache_.sources || [];
  62592. if (src && !type2) {
  62593. type2 = findMimetype$1(this, src);
  62594. }
  62595. this.cache_.source = merge$1({}, srcObj, {
  62596. src,
  62597. type: type2
  62598. });
  62599. const matchingSources = this.cache_.sources.filter((s) => s.src && s.src === src);
  62600. const sourceElSources = [];
  62601. const sourceEls = this.$$("source");
  62602. const matchingSourceEls = [];
  62603. for (let i2 = 0; i2 < sourceEls.length; i2++) {
  62604. const sourceObj = getAttributes$1(sourceEls[i2]);
  62605. sourceElSources.push(sourceObj);
  62606. if (sourceObj.src && sourceObj.src === src) {
  62607. matchingSourceEls.push(sourceObj.src);
  62608. }
  62609. }
  62610. if (matchingSourceEls.length && !matchingSources.length) {
  62611. this.cache_.sources = sourceElSources;
  62612. } else if (!matchingSources.length) {
  62613. this.cache_.sources = [this.cache_.source];
  62614. }
  62615. this.cache_.src = src;
  62616. }
  62617. handleTechSourceset_(event2) {
  62618. if (!this.changingSrc_) {
  62619. let updateSourceCaches = (src) => this.updateSourceCaches_(src);
  62620. const playerSrc = this.currentSource().src;
  62621. const eventSrc = event2.src;
  62622. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  62623. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  62624. updateSourceCaches = () => {
  62625. };
  62626. }
  62627. }
  62628. updateSourceCaches(eventSrc);
  62629. if (!event2.src) {
  62630. this.tech_.any(["sourceset", "loadstart"], (e) => {
  62631. if (e.type === "sourceset") {
  62632. return;
  62633. }
  62634. const techSrc = this.techGet("currentSrc");
  62635. this.lastSource_.tech = techSrc;
  62636. this.updateSourceCaches_(techSrc);
  62637. });
  62638. }
  62639. }
  62640. this.lastSource_ = {
  62641. player: this.currentSource().src,
  62642. tech: event2.src
  62643. };
  62644. this.trigger({
  62645. src: event2.src,
  62646. type: "sourceset"
  62647. });
  62648. }
  62649. hasStarted(request) {
  62650. if (request === void 0) {
  62651. return this.hasStarted_;
  62652. }
  62653. if (request === this.hasStarted_) {
  62654. return;
  62655. }
  62656. this.hasStarted_ = request;
  62657. if (this.hasStarted_) {
  62658. this.addClass("vjs-has-started");
  62659. } else {
  62660. this.removeClass("vjs-has-started");
  62661. }
  62662. }
  62663. handleTechPlay_() {
  62664. this.removeClass("vjs-ended", "vjs-paused");
  62665. this.addClass("vjs-playing");
  62666. this.hasStarted(true);
  62667. this.trigger("play");
  62668. }
  62669. handleTechRateChange_() {
  62670. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  62671. this.queuedCallbacks_.forEach((queued) => queued.callback(queued.event));
  62672. this.queuedCallbacks_ = [];
  62673. }
  62674. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  62675. this.trigger("ratechange");
  62676. }
  62677. handleTechWaiting_() {
  62678. this.addClass("vjs-waiting");
  62679. this.trigger("waiting");
  62680. const timeWhenWaiting = this.currentTime();
  62681. const timeUpdateListener = () => {
  62682. if (timeWhenWaiting !== this.currentTime()) {
  62683. this.removeClass("vjs-waiting");
  62684. this.off("timeupdate", timeUpdateListener);
  62685. }
  62686. };
  62687. this.on("timeupdate", timeUpdateListener);
  62688. }
  62689. handleTechCanPlay_() {
  62690. this.removeClass("vjs-waiting");
  62691. this.trigger("canplay");
  62692. }
  62693. handleTechCanPlayThrough_() {
  62694. this.removeClass("vjs-waiting");
  62695. this.trigger("canplaythrough");
  62696. }
  62697. handleTechPlaying_() {
  62698. this.removeClass("vjs-waiting");
  62699. this.trigger("playing");
  62700. }
  62701. handleTechSeeking_() {
  62702. this.addClass("vjs-seeking");
  62703. this.trigger("seeking");
  62704. }
  62705. handleTechSeeked_() {
  62706. this.removeClass("vjs-seeking", "vjs-ended");
  62707. this.trigger("seeked");
  62708. }
  62709. handleTechPause_() {
  62710. this.removeClass("vjs-playing");
  62711. this.addClass("vjs-paused");
  62712. this.trigger("pause");
  62713. }
  62714. handleTechEnded_() {
  62715. this.addClass("vjs-ended");
  62716. this.removeClass("vjs-waiting");
  62717. if (this.options_.loop) {
  62718. this.currentTime(0);
  62719. this.play();
  62720. } else if (!this.paused()) {
  62721. this.pause();
  62722. }
  62723. this.trigger("ended");
  62724. }
  62725. handleTechDurationChange_() {
  62726. this.duration(this.techGet_("duration"));
  62727. }
  62728. handleTechClick_(event2) {
  62729. if (!this.controls_) {
  62730. return;
  62731. }
  62732. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  62733. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  62734. this.options_.userActions.click.call(this, event2);
  62735. } else if (this.paused()) {
  62736. silencePromise$1(this.play());
  62737. } else {
  62738. this.pause();
  62739. }
  62740. }
  62741. }
  62742. handleTechDoubleClick_(event2) {
  62743. if (!this.controls_) {
  62744. return;
  62745. }
  62746. const inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), (el) => el.contains(event2.target));
  62747. if (!inAllowedEls) {
  62748. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  62749. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  62750. this.options_.userActions.doubleClick.call(this, event2);
  62751. } else if (this.isFullscreen()) {
  62752. this.exitFullscreen();
  62753. } else {
  62754. this.requestFullscreen();
  62755. }
  62756. }
  62757. }
  62758. }
  62759. handleTechTap_() {
  62760. this.userActive(!this.userActive());
  62761. }
  62762. handleTechTouchStart_() {
  62763. this.userWasActive = this.userActive();
  62764. }
  62765. handleTechTouchMove_() {
  62766. if (this.userWasActive) {
  62767. this.reportUserActivity();
  62768. }
  62769. }
  62770. handleTechTouchEnd_(event2) {
  62771. if (event2.cancelable) {
  62772. event2.preventDefault();
  62773. }
  62774. }
  62775. toggleFullscreenClass_() {
  62776. if (this.isFullscreen()) {
  62777. this.addClass("vjs-fullscreen");
  62778. } else {
  62779. this.removeClass("vjs-fullscreen");
  62780. }
  62781. }
  62782. documentFullscreenChange_(e) {
  62783. const targetPlayer = e.target.player;
  62784. if (targetPlayer && targetPlayer !== this) {
  62785. return;
  62786. }
  62787. const el = this.el();
  62788. let isFs = document_1[this.fsApi_.fullscreenElement] === el;
  62789. if (!isFs && el.matches) {
  62790. isFs = el.matches(":" + this.fsApi_.fullscreen);
  62791. } else if (!isFs && el.msMatchesSelector) {
  62792. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  62793. }
  62794. this.isFullscreen(isFs);
  62795. }
  62796. handleTechFullscreenChange_(event2, data) {
  62797. if (data) {
  62798. if (data.nativeIOSFullscreen) {
  62799. this.addClass("vjs-ios-native-fs");
  62800. this.tech_.one("webkitendfullscreen", () => {
  62801. this.removeClass("vjs-ios-native-fs");
  62802. });
  62803. }
  62804. this.isFullscreen(data.isFullscreen);
  62805. }
  62806. }
  62807. handleTechFullscreenError_(event2, err) {
  62808. this.trigger("fullscreenerror", err);
  62809. }
  62810. togglePictureInPictureClass_() {
  62811. if (this.isInPictureInPicture()) {
  62812. this.addClass("vjs-picture-in-picture");
  62813. } else {
  62814. this.removeClass("vjs-picture-in-picture");
  62815. }
  62816. }
  62817. handleTechEnterPictureInPicture_(event2) {
  62818. this.isInPictureInPicture(true);
  62819. }
  62820. handleTechLeavePictureInPicture_(event2) {
  62821. this.isInPictureInPicture(false);
  62822. }
  62823. handleTechError_() {
  62824. const error = this.tech_.error();
  62825. this.error(error);
  62826. }
  62827. handleTechTextData_() {
  62828. let data = null;
  62829. if (arguments.length > 1) {
  62830. data = arguments[1];
  62831. }
  62832. this.trigger("textdata", data);
  62833. }
  62834. getCache() {
  62835. return this.cache_;
  62836. }
  62837. resetCache_() {
  62838. this.cache_ = {
  62839. currentTime: 0,
  62840. initTime: 0,
  62841. inactivityTimeout: this.options_.inactivityTimeout,
  62842. duration: NaN,
  62843. lastVolume: 1,
  62844. lastPlaybackRate: this.defaultPlaybackRate(),
  62845. media: null,
  62846. src: "",
  62847. source: {},
  62848. sources: [],
  62849. playbackRates: [],
  62850. volume: 1
  62851. };
  62852. }
  62853. techCall_(method, arg) {
  62854. this.ready(function() {
  62855. if (method in allowedSetters$1) {
  62856. return set$1(this.middleware_, this.tech_, method, arg);
  62857. } else if (method in allowedMediators$1) {
  62858. return mediate$1(this.middleware_, this.tech_, method, arg);
  62859. }
  62860. try {
  62861. if (this.tech_) {
  62862. this.tech_[method](arg);
  62863. }
  62864. } catch (e) {
  62865. log$1$1(e);
  62866. throw e;
  62867. }
  62868. }, true);
  62869. }
  62870. techGet_(method) {
  62871. if (!this.tech_ || !this.tech_.isReady_) {
  62872. return;
  62873. }
  62874. if (method in allowedGetters$1) {
  62875. return get$1(this.middleware_, this.tech_, method);
  62876. } else if (method in allowedMediators$1) {
  62877. return mediate$1(this.middleware_, this.tech_, method);
  62878. }
  62879. try {
  62880. return this.tech_[method]();
  62881. } catch (e) {
  62882. if (this.tech_[method] === void 0) {
  62883. log$1$1(`Video.js: ${method} method not defined for ${this.techName_} playback technology.`, e);
  62884. throw e;
  62885. }
  62886. if (e.name === "TypeError") {
  62887. log$1$1(`Video.js: ${method} unavailable on ${this.techName_} playback technology element.`, e);
  62888. this.tech_.isReady_ = false;
  62889. throw e;
  62890. }
  62891. log$1$1(e);
  62892. throw e;
  62893. }
  62894. }
  62895. play() {
  62896. return new Promise((resolve2) => {
  62897. this.play_(resolve2);
  62898. });
  62899. }
  62900. play_(callback2 = silencePromise$1) {
  62901. this.playCallbacks_.push(callback2);
  62902. const isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  62903. const isSafariOrIOS = Boolean(IS_ANY_SAFARI$1 || IS_IOS$1);
  62904. if (this.waitToPlay_) {
  62905. this.off(["ready", "loadstart"], this.waitToPlay_);
  62906. this.waitToPlay_ = null;
  62907. }
  62908. if (!this.isReady_ || !isSrcReady) {
  62909. this.waitToPlay_ = (e) => {
  62910. this.play_();
  62911. };
  62912. this.one(["ready", "loadstart"], this.waitToPlay_);
  62913. if (!isSrcReady && isSafariOrIOS) {
  62914. this.load();
  62915. }
  62916. return;
  62917. }
  62918. const val = this.techGet_("play");
  62919. const isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  62920. if (isNativeReplay) {
  62921. this.resetProgressBar_();
  62922. }
  62923. if (val === null) {
  62924. this.runPlayTerminatedQueue_();
  62925. } else {
  62926. this.runPlayCallbacks_(val);
  62927. }
  62928. }
  62929. runPlayTerminatedQueue_() {
  62930. const queue = this.playTerminatedQueue_.slice(0);
  62931. this.playTerminatedQueue_ = [];
  62932. queue.forEach(function(q2) {
  62933. q2();
  62934. });
  62935. }
  62936. runPlayCallbacks_(val) {
  62937. const callbacks = this.playCallbacks_.slice(0);
  62938. this.playCallbacks_ = [];
  62939. this.playTerminatedQueue_ = [];
  62940. callbacks.forEach(function(cb) {
  62941. cb(val);
  62942. });
  62943. }
  62944. pause() {
  62945. this.techCall_("pause");
  62946. }
  62947. paused() {
  62948. return this.techGet_("paused") === false ? false : true;
  62949. }
  62950. played() {
  62951. return this.techGet_("played") || createTimeRanges$1(0, 0);
  62952. }
  62953. scrubbing(isScrubbing) {
  62954. if (typeof isScrubbing === "undefined") {
  62955. return this.scrubbing_;
  62956. }
  62957. this.scrubbing_ = !!isScrubbing;
  62958. this.techCall_("setScrubbing", this.scrubbing_);
  62959. if (isScrubbing) {
  62960. this.addClass("vjs-scrubbing");
  62961. } else {
  62962. this.removeClass("vjs-scrubbing");
  62963. }
  62964. }
  62965. currentTime(seconds) {
  62966. if (typeof seconds !== "undefined") {
  62967. if (seconds < 0) {
  62968. seconds = 0;
  62969. }
  62970. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  62971. this.cache_.initTime = seconds;
  62972. this.off("canplay", this.boundApplyInitTime_);
  62973. this.one("canplay", this.boundApplyInitTime_);
  62974. return;
  62975. }
  62976. this.techCall_("setCurrentTime", seconds);
  62977. this.cache_.initTime = 0;
  62978. return;
  62979. }
  62980. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  62981. return this.cache_.currentTime;
  62982. }
  62983. applyInitTime_() {
  62984. this.currentTime(this.cache_.initTime);
  62985. }
  62986. duration(seconds) {
  62987. if (seconds === void 0) {
  62988. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  62989. }
  62990. seconds = parseFloat(seconds);
  62991. if (seconds < 0) {
  62992. seconds = Infinity;
  62993. }
  62994. if (seconds !== this.cache_.duration) {
  62995. this.cache_.duration = seconds;
  62996. if (seconds === Infinity) {
  62997. this.addClass("vjs-live");
  62998. } else {
  62999. this.removeClass("vjs-live");
  63000. }
  63001. if (!isNaN(seconds)) {
  63002. this.trigger("durationchange");
  63003. }
  63004. }
  63005. }
  63006. remainingTime() {
  63007. return this.duration() - this.currentTime();
  63008. }
  63009. remainingTimeDisplay() {
  63010. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  63011. }
  63012. buffered() {
  63013. let buffered = this.techGet_("buffered");
  63014. if (!buffered || !buffered.length) {
  63015. buffered = createTimeRanges$1(0, 0);
  63016. }
  63017. return buffered;
  63018. }
  63019. bufferedPercent() {
  63020. return bufferedPercent$1(this.buffered(), this.duration());
  63021. }
  63022. bufferedEnd() {
  63023. const buffered = this.buffered();
  63024. const duration5 = this.duration();
  63025. let end = buffered.end(buffered.length - 1);
  63026. if (end > duration5) {
  63027. end = duration5;
  63028. }
  63029. return end;
  63030. }
  63031. volume(percentAsDecimal) {
  63032. let vol;
  63033. if (percentAsDecimal !== void 0) {
  63034. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  63035. this.cache_.volume = vol;
  63036. this.techCall_("setVolume", vol);
  63037. if (vol > 0) {
  63038. this.lastVolume_(vol);
  63039. }
  63040. return;
  63041. }
  63042. vol = parseFloat(this.techGet_("volume"));
  63043. return isNaN(vol) ? 1 : vol;
  63044. }
  63045. muted(muted) {
  63046. if (muted !== void 0) {
  63047. this.techCall_("setMuted", muted);
  63048. return;
  63049. }
  63050. return this.techGet_("muted") || false;
  63051. }
  63052. defaultMuted(defaultMuted) {
  63053. if (defaultMuted !== void 0) {
  63054. return this.techCall_("setDefaultMuted", defaultMuted);
  63055. }
  63056. return this.techGet_("defaultMuted") || false;
  63057. }
  63058. lastVolume_(percentAsDecimal) {
  63059. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  63060. this.cache_.lastVolume = percentAsDecimal;
  63061. return;
  63062. }
  63063. return this.cache_.lastVolume;
  63064. }
  63065. supportsFullScreen() {
  63066. return this.techGet_("supportsFullScreen") || false;
  63067. }
  63068. isFullscreen(isFS) {
  63069. if (isFS !== void 0) {
  63070. const oldValue = this.isFullscreen_;
  63071. this.isFullscreen_ = Boolean(isFS);
  63072. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  63073. this.trigger("fullscreenchange");
  63074. }
  63075. this.toggleFullscreenClass_();
  63076. return;
  63077. }
  63078. return this.isFullscreen_;
  63079. }
  63080. requestFullscreen(fullscreenOptions) {
  63081. if (this.isInPictureInPicture()) {
  63082. this.exitPictureInPicture();
  63083. }
  63084. const self2 = this;
  63085. return new Promise((resolve2, reject2) => {
  63086. function offHandler() {
  63087. self2.off("fullscreenerror", errorHandler);
  63088. self2.off("fullscreenchange", changeHandler);
  63089. }
  63090. function changeHandler() {
  63091. offHandler();
  63092. resolve2();
  63093. }
  63094. function errorHandler(e, err) {
  63095. offHandler();
  63096. reject2(err);
  63097. }
  63098. self2.one("fullscreenchange", changeHandler);
  63099. self2.one("fullscreenerror", errorHandler);
  63100. const promise = self2.requestFullscreenHelper_(fullscreenOptions);
  63101. if (promise) {
  63102. promise.then(offHandler, offHandler);
  63103. promise.then(resolve2, reject2);
  63104. }
  63105. });
  63106. }
  63107. requestFullscreenHelper_(fullscreenOptions) {
  63108. let fsOptions;
  63109. if (!this.fsApi_.prefixed) {
  63110. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  63111. if (fullscreenOptions !== void 0) {
  63112. fsOptions = fullscreenOptions;
  63113. }
  63114. }
  63115. if (this.fsApi_.requestFullscreen) {
  63116. const promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  63117. if (promise) {
  63118. promise.then(() => this.isFullscreen(true), () => this.isFullscreen(false));
  63119. }
  63120. return promise;
  63121. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63122. this.techCall_("enterFullScreen");
  63123. } else {
  63124. this.enterFullWindow();
  63125. }
  63126. }
  63127. exitFullscreen() {
  63128. const self2 = this;
  63129. return new Promise((resolve2, reject2) => {
  63130. function offHandler() {
  63131. self2.off("fullscreenerror", errorHandler);
  63132. self2.off("fullscreenchange", changeHandler);
  63133. }
  63134. function changeHandler() {
  63135. offHandler();
  63136. resolve2();
  63137. }
  63138. function errorHandler(e, err) {
  63139. offHandler();
  63140. reject2(err);
  63141. }
  63142. self2.one("fullscreenchange", changeHandler);
  63143. self2.one("fullscreenerror", errorHandler);
  63144. const promise = self2.exitFullscreenHelper_();
  63145. if (promise) {
  63146. promise.then(offHandler, offHandler);
  63147. promise.then(resolve2, reject2);
  63148. }
  63149. });
  63150. }
  63151. exitFullscreenHelper_() {
  63152. if (this.fsApi_.requestFullscreen) {
  63153. const promise = document_1[this.fsApi_.exitFullscreen]();
  63154. if (promise) {
  63155. silencePromise$1(promise.then(() => this.isFullscreen(false)));
  63156. }
  63157. return promise;
  63158. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63159. this.techCall_("exitFullScreen");
  63160. } else {
  63161. this.exitFullWindow();
  63162. }
  63163. }
  63164. enterFullWindow() {
  63165. this.isFullscreen(true);
  63166. this.isFullWindow = true;
  63167. this.docOrigOverflow = document_1.documentElement.style.overflow;
  63168. on$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63169. document_1.documentElement.style.overflow = "hidden";
  63170. addClass$1(document_1.body, "vjs-full-window");
  63171. this.trigger("enterFullWindow");
  63172. }
  63173. fullWindowOnEscKey(event2) {
  63174. if (keycode.isEventKey(event2, "Esc")) {
  63175. if (this.isFullscreen() === true) {
  63176. if (!this.isFullWindow) {
  63177. this.exitFullscreen();
  63178. } else {
  63179. this.exitFullWindow();
  63180. }
  63181. }
  63182. }
  63183. }
  63184. exitFullWindow() {
  63185. this.isFullscreen(false);
  63186. this.isFullWindow = false;
  63187. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63188. document_1.documentElement.style.overflow = this.docOrigOverflow;
  63189. removeClass$1(document_1.body, "vjs-full-window");
  63190. this.trigger("exitFullWindow");
  63191. }
  63192. disablePictureInPicture(value) {
  63193. if (value === void 0) {
  63194. return this.techGet_("disablePictureInPicture");
  63195. }
  63196. this.techCall_("setDisablePictureInPicture", value);
  63197. this.options_.disablePictureInPicture = value;
  63198. this.trigger("disablepictureinpicturechanged");
  63199. }
  63200. isInPictureInPicture(isPiP) {
  63201. if (isPiP !== void 0) {
  63202. this.isInPictureInPicture_ = !!isPiP;
  63203. this.togglePictureInPictureClass_();
  63204. return;
  63205. }
  63206. return !!this.isInPictureInPicture_;
  63207. }
  63208. requestPictureInPicture() {
  63209. if (this.options_.enableDocumentPictureInPicture && window_1.documentPictureInPicture) {
  63210. const pipContainer = document_1.createElement(this.el().tagName);
  63211. pipContainer.classList = this.el().classList;
  63212. pipContainer.classList.add("vjs-pip-container");
  63213. if (this.posterImage) {
  63214. pipContainer.appendChild(this.posterImage.el().cloneNode(true));
  63215. }
  63216. if (this.titleBar) {
  63217. pipContainer.appendChild(this.titleBar.el().cloneNode(true));
  63218. }
  63219. pipContainer.appendChild(createEl$1("p", {
  63220. className: "vjs-pip-text"
  63221. }, {}, this.localize("Playing in picture-in-picture")));
  63222. return window_1.documentPictureInPicture.requestWindow({
  63223. initialAspectRatio: this.videoWidth() / this.videoHeight(),
  63224. copyStyleSheets: true
  63225. }).then((pipWindow) => {
  63226. this.el_.parentNode.insertBefore(pipContainer, this.el_);
  63227. pipWindow.document.body.append(this.el_);
  63228. pipWindow.document.body.classList.add("vjs-pip-window");
  63229. this.player_.isInPictureInPicture(true);
  63230. this.player_.trigger("enterpictureinpicture");
  63231. pipWindow.addEventListener("unload", (event2) => {
  63232. const pipVideo = event2.target.querySelector(".video-js");
  63233. pipContainer.replaceWith(pipVideo);
  63234. this.player_.isInPictureInPicture(false);
  63235. this.player_.trigger("leavepictureinpicture");
  63236. });
  63237. return pipWindow;
  63238. });
  63239. }
  63240. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  63241. return this.techGet_("requestPictureInPicture");
  63242. }
  63243. return Promise.reject("No PiP mode is available");
  63244. }
  63245. exitPictureInPicture() {
  63246. if (window_1.documentPictureInPicture && window_1.documentPictureInPicture.window) {
  63247. window_1.documentPictureInPicture.window.close();
  63248. return Promise.resolve();
  63249. }
  63250. if ("pictureInPictureEnabled" in document_1) {
  63251. return document_1.exitPictureInPicture();
  63252. }
  63253. }
  63254. handleKeyDown(event2) {
  63255. const {
  63256. userActions
  63257. } = this.options_;
  63258. if (!userActions || !userActions.hotkeys) {
  63259. return;
  63260. }
  63261. const excludeElement = (el) => {
  63262. const tagName = el.tagName.toLowerCase();
  63263. if (el.isContentEditable) {
  63264. return true;
  63265. }
  63266. const allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  63267. if (tagName === "input") {
  63268. return allowedInputTypes.indexOf(el.type) === -1;
  63269. }
  63270. const excludedTags = ["textarea"];
  63271. return excludedTags.indexOf(tagName) !== -1;
  63272. };
  63273. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  63274. return;
  63275. }
  63276. if (typeof userActions.hotkeys === "function") {
  63277. userActions.hotkeys.call(this, event2);
  63278. } else {
  63279. this.handleHotkeys(event2);
  63280. }
  63281. }
  63282. handleHotkeys(event2) {
  63283. const hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  63284. const {
  63285. fullscreenKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "f"),
  63286. muteKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "m"),
  63287. playPauseKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space")
  63288. } = hotkeys;
  63289. if (fullscreenKey.call(this, event2)) {
  63290. event2.preventDefault();
  63291. event2.stopPropagation();
  63292. const FSToggle = Component$1$1.getComponent("FullscreenToggle");
  63293. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  63294. FSToggle.prototype.handleClick.call(this, event2);
  63295. }
  63296. } else if (muteKey.call(this, event2)) {
  63297. event2.preventDefault();
  63298. event2.stopPropagation();
  63299. const MuteToggle2 = Component$1$1.getComponent("MuteToggle");
  63300. MuteToggle2.prototype.handleClick.call(this, event2);
  63301. } else if (playPauseKey.call(this, event2)) {
  63302. event2.preventDefault();
  63303. event2.stopPropagation();
  63304. const PlayToggle2 = Component$1$1.getComponent("PlayToggle");
  63305. PlayToggle2.prototype.handleClick.call(this, event2);
  63306. }
  63307. }
  63308. canPlayType(type2) {
  63309. let can;
  63310. for (let i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  63311. const techName = j[i2];
  63312. let tech = Tech$2.getTech(techName);
  63313. if (!tech) {
  63314. tech = Component$1$1.getComponent(techName);
  63315. }
  63316. if (!tech) {
  63317. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63318. continue;
  63319. }
  63320. if (tech.isSupported()) {
  63321. can = tech.canPlayType(type2);
  63322. if (can) {
  63323. return can;
  63324. }
  63325. }
  63326. }
  63327. return "";
  63328. }
  63329. selectSource(sources) {
  63330. const techs = this.options_.techOrder.map((techName) => {
  63331. return [techName, Tech$2.getTech(techName)];
  63332. }).filter(([techName, tech]) => {
  63333. if (tech) {
  63334. return tech.isSupported();
  63335. }
  63336. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63337. return false;
  63338. });
  63339. const findFirstPassingTechSourcePair = function(outerArray, innerArray, tester) {
  63340. let found;
  63341. outerArray.some((outerChoice) => {
  63342. return innerArray.some((innerChoice) => {
  63343. found = tester(outerChoice, innerChoice);
  63344. if (found) {
  63345. return true;
  63346. }
  63347. });
  63348. });
  63349. return found;
  63350. };
  63351. let foundSourceAndTech;
  63352. const flip = (fn2) => (a, b) => fn2(b, a);
  63353. const finder = ([techName, tech], source) => {
  63354. if (tech.canPlaySource(source, this.options_[techName.toLowerCase()])) {
  63355. return {
  63356. source,
  63357. tech: techName
  63358. };
  63359. }
  63360. };
  63361. if (this.options_.sourceOrder) {
  63362. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  63363. } else {
  63364. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  63365. }
  63366. return foundSourceAndTech || false;
  63367. }
  63368. handleSrc_(source, isRetry) {
  63369. if (typeof source === "undefined") {
  63370. return this.cache_.src || "";
  63371. }
  63372. if (this.resetRetryOnError_) {
  63373. this.resetRetryOnError_();
  63374. }
  63375. const sources = filterSource$1(source);
  63376. if (!sources.length) {
  63377. this.setTimeout(function() {
  63378. this.error({
  63379. code: 4,
  63380. message: this.options_.notSupportedMessage
  63381. });
  63382. }, 0);
  63383. return;
  63384. }
  63385. this.changingSrc_ = true;
  63386. if (!isRetry) {
  63387. this.cache_.sources = sources;
  63388. }
  63389. this.updateSourceCaches_(sources[0]);
  63390. setSource$1(this, sources[0], (middlewareSource, mws) => {
  63391. this.middleware_ = mws;
  63392. if (!isRetry) {
  63393. this.cache_.sources = sources;
  63394. }
  63395. this.updateSourceCaches_(middlewareSource);
  63396. const err = this.src_(middlewareSource);
  63397. if (err) {
  63398. if (sources.length > 1) {
  63399. return this.handleSrc_(sources.slice(1));
  63400. }
  63401. this.changingSrc_ = false;
  63402. this.setTimeout(function() {
  63403. this.error({
  63404. code: 4,
  63405. message: this.options_.notSupportedMessage
  63406. });
  63407. }, 0);
  63408. this.triggerReady();
  63409. return;
  63410. }
  63411. setTech$1(mws, this.tech_);
  63412. });
  63413. if (sources.length > 1) {
  63414. const retry = () => {
  63415. this.error(null);
  63416. this.handleSrc_(sources.slice(1), true);
  63417. };
  63418. const stopListeningForErrors = () => {
  63419. this.off("error", retry);
  63420. };
  63421. this.one("error", retry);
  63422. this.one("playing", stopListeningForErrors);
  63423. this.resetRetryOnError_ = () => {
  63424. this.off("error", retry);
  63425. this.off("playing", stopListeningForErrors);
  63426. };
  63427. }
  63428. }
  63429. src(source) {
  63430. return this.handleSrc_(source, false);
  63431. }
  63432. src_(source) {
  63433. const sourceTech = this.selectSource([source]);
  63434. if (!sourceTech) {
  63435. return true;
  63436. }
  63437. if (!titleCaseEquals$1(sourceTech.tech, this.techName_)) {
  63438. this.changingSrc_ = true;
  63439. this.loadTech_(sourceTech.tech, sourceTech.source);
  63440. this.tech_.ready(() => {
  63441. this.changingSrc_ = false;
  63442. });
  63443. return false;
  63444. }
  63445. this.ready(function() {
  63446. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  63447. this.techCall_("setSource", source);
  63448. } else {
  63449. this.techCall_("src", source.src);
  63450. }
  63451. this.changingSrc_ = false;
  63452. }, true);
  63453. return false;
  63454. }
  63455. load() {
  63456. this.techCall_("load");
  63457. }
  63458. reset() {
  63459. if (this.paused()) {
  63460. this.doReset_();
  63461. } else {
  63462. const playPromise = this.play();
  63463. silencePromise$1(playPromise.then(() => this.doReset_()));
  63464. }
  63465. }
  63466. doReset_() {
  63467. if (this.tech_) {
  63468. this.tech_.clearTracks("text");
  63469. }
  63470. this.resetCache_();
  63471. this.poster("");
  63472. this.loadTech_(this.options_.techOrder[0], null);
  63473. this.techCall_("reset");
  63474. this.resetControlBarUI_();
  63475. if (isEvented$1(this)) {
  63476. this.trigger("playerreset");
  63477. }
  63478. }
  63479. resetControlBarUI_() {
  63480. this.resetProgressBar_();
  63481. this.resetPlaybackRate_();
  63482. this.resetVolumeBar_();
  63483. }
  63484. resetProgressBar_() {
  63485. this.currentTime(0);
  63486. const {
  63487. currentTimeDisplay,
  63488. durationDisplay,
  63489. progressControl,
  63490. remainingTimeDisplay
  63491. } = this.controlBar || {};
  63492. const {
  63493. seekBar
  63494. } = progressControl || {};
  63495. if (currentTimeDisplay) {
  63496. currentTimeDisplay.updateContent();
  63497. }
  63498. if (durationDisplay) {
  63499. durationDisplay.updateContent();
  63500. }
  63501. if (remainingTimeDisplay) {
  63502. remainingTimeDisplay.updateContent();
  63503. }
  63504. if (seekBar) {
  63505. seekBar.update();
  63506. if (seekBar.loadProgressBar) {
  63507. seekBar.loadProgressBar.update();
  63508. }
  63509. }
  63510. }
  63511. resetPlaybackRate_() {
  63512. this.playbackRate(this.defaultPlaybackRate());
  63513. this.handleTechRateChange_();
  63514. }
  63515. resetVolumeBar_() {
  63516. this.volume(1);
  63517. this.trigger("volumechange");
  63518. }
  63519. currentSources() {
  63520. const source = this.currentSource();
  63521. const sources = [];
  63522. if (Object.keys(source).length !== 0) {
  63523. sources.push(source);
  63524. }
  63525. return this.cache_.sources || sources;
  63526. }
  63527. currentSource() {
  63528. return this.cache_.source || {};
  63529. }
  63530. currentSrc() {
  63531. return this.currentSource() && this.currentSource().src || "";
  63532. }
  63533. currentType() {
  63534. return this.currentSource() && this.currentSource().type || "";
  63535. }
  63536. preload(value) {
  63537. if (value !== void 0) {
  63538. this.techCall_("setPreload", value);
  63539. this.options_.preload = value;
  63540. return;
  63541. }
  63542. return this.techGet_("preload");
  63543. }
  63544. autoplay(value) {
  63545. if (value === void 0) {
  63546. return this.options_.autoplay || false;
  63547. }
  63548. let techAutoplay;
  63549. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  63550. this.options_.autoplay = value;
  63551. this.manualAutoplay_(typeof value === "string" ? value : "play");
  63552. techAutoplay = false;
  63553. } else if (!value) {
  63554. this.options_.autoplay = false;
  63555. } else {
  63556. this.options_.autoplay = true;
  63557. }
  63558. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  63559. if (this.tech_) {
  63560. this.techCall_("setAutoplay", techAutoplay);
  63561. }
  63562. }
  63563. playsinline(value) {
  63564. if (value !== void 0) {
  63565. this.techCall_("setPlaysinline", value);
  63566. this.options_.playsinline = value;
  63567. return this;
  63568. }
  63569. return this.techGet_("playsinline");
  63570. }
  63571. loop(value) {
  63572. if (value !== void 0) {
  63573. this.techCall_("setLoop", value);
  63574. this.options_.loop = value;
  63575. return;
  63576. }
  63577. return this.techGet_("loop");
  63578. }
  63579. poster(src) {
  63580. if (src === void 0) {
  63581. return this.poster_;
  63582. }
  63583. if (!src) {
  63584. src = "";
  63585. }
  63586. if (src === this.poster_) {
  63587. return;
  63588. }
  63589. this.poster_ = src;
  63590. this.techCall_("setPoster", src);
  63591. this.isPosterFromTech_ = false;
  63592. this.trigger("posterchange");
  63593. }
  63594. handleTechPosterChange_() {
  63595. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  63596. const newPoster = this.tech_.poster() || "";
  63597. if (newPoster !== this.poster_) {
  63598. this.poster_ = newPoster;
  63599. this.isPosterFromTech_ = true;
  63600. this.trigger("posterchange");
  63601. }
  63602. }
  63603. }
  63604. controls(bool) {
  63605. if (bool === void 0) {
  63606. return !!this.controls_;
  63607. }
  63608. bool = !!bool;
  63609. if (this.controls_ === bool) {
  63610. return;
  63611. }
  63612. this.controls_ = bool;
  63613. if (this.usingNativeControls()) {
  63614. this.techCall_("setControls", bool);
  63615. }
  63616. if (this.controls_) {
  63617. this.removeClass("vjs-controls-disabled");
  63618. this.addClass("vjs-controls-enabled");
  63619. this.trigger("controlsenabled");
  63620. if (!this.usingNativeControls()) {
  63621. this.addTechControlsListeners_();
  63622. }
  63623. } else {
  63624. this.removeClass("vjs-controls-enabled");
  63625. this.addClass("vjs-controls-disabled");
  63626. this.trigger("controlsdisabled");
  63627. if (!this.usingNativeControls()) {
  63628. this.removeTechControlsListeners_();
  63629. }
  63630. }
  63631. }
  63632. usingNativeControls(bool) {
  63633. if (bool === void 0) {
  63634. return !!this.usingNativeControls_;
  63635. }
  63636. bool = !!bool;
  63637. if (this.usingNativeControls_ === bool) {
  63638. return;
  63639. }
  63640. this.usingNativeControls_ = bool;
  63641. if (this.usingNativeControls_) {
  63642. this.addClass("vjs-using-native-controls");
  63643. this.trigger("usingnativecontrols");
  63644. } else {
  63645. this.removeClass("vjs-using-native-controls");
  63646. this.trigger("usingcustomcontrols");
  63647. }
  63648. }
  63649. error(err) {
  63650. if (err === void 0) {
  63651. return this.error_ || null;
  63652. }
  63653. hooks$1("beforeerror").forEach((hookFunction) => {
  63654. const newErr = hookFunction(this, err);
  63655. if (!(isObject$2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  63656. this.log.error("please return a value that MediaError expects in beforeerror hooks");
  63657. return;
  63658. }
  63659. err = newErr;
  63660. });
  63661. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  63662. const triggerSuppressedError = function() {
  63663. this.error(err);
  63664. };
  63665. this.options_.suppressNotSupportedError = false;
  63666. this.any(["click", "touchstart"], triggerSuppressedError);
  63667. this.one("loadstart", function() {
  63668. this.off(["click", "touchstart"], triggerSuppressedError);
  63669. });
  63670. return;
  63671. }
  63672. if (err === null) {
  63673. this.error_ = err;
  63674. this.removeClass("vjs-error");
  63675. if (this.errorDisplay) {
  63676. this.errorDisplay.close();
  63677. }
  63678. return;
  63679. }
  63680. this.error_ = new MediaError$1(err);
  63681. this.addClass("vjs-error");
  63682. log$1$1.error(`(CODE:${this.error_.code} ${MediaError$1.errorTypes[this.error_.code]})`, this.error_.message, this.error_);
  63683. this.trigger("error");
  63684. hooks$1("error").forEach((hookFunction) => hookFunction(this, this.error_));
  63685. return;
  63686. }
  63687. reportUserActivity(event2) {
  63688. this.userActivity_ = true;
  63689. }
  63690. userActive(bool) {
  63691. if (bool === void 0) {
  63692. return this.userActive_;
  63693. }
  63694. bool = !!bool;
  63695. if (bool === this.userActive_) {
  63696. return;
  63697. }
  63698. this.userActive_ = bool;
  63699. if (this.userActive_) {
  63700. this.userActivity_ = true;
  63701. this.removeClass("vjs-user-inactive");
  63702. this.addClass("vjs-user-active");
  63703. this.trigger("useractive");
  63704. return;
  63705. }
  63706. if (this.tech_) {
  63707. this.tech_.one("mousemove", function(e) {
  63708. e.stopPropagation();
  63709. e.preventDefault();
  63710. });
  63711. }
  63712. this.userActivity_ = false;
  63713. this.removeClass("vjs-user-active");
  63714. this.addClass("vjs-user-inactive");
  63715. this.trigger("userinactive");
  63716. }
  63717. listenForUserActivity_() {
  63718. let mouseInProgress;
  63719. let lastMoveX;
  63720. let lastMoveY;
  63721. const handleActivity = bind_(this, this.reportUserActivity);
  63722. const handleMouseMove = function(e) {
  63723. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  63724. lastMoveX = e.screenX;
  63725. lastMoveY = e.screenY;
  63726. handleActivity();
  63727. }
  63728. };
  63729. const handleMouseDown = function() {
  63730. handleActivity();
  63731. this.clearInterval(mouseInProgress);
  63732. mouseInProgress = this.setInterval(handleActivity, 250);
  63733. };
  63734. const handleMouseUpAndMouseLeave = function(event2) {
  63735. handleActivity();
  63736. this.clearInterval(mouseInProgress);
  63737. };
  63738. this.on("mousedown", handleMouseDown);
  63739. this.on("mousemove", handleMouseMove);
  63740. this.on("mouseup", handleMouseUpAndMouseLeave);
  63741. this.on("mouseleave", handleMouseUpAndMouseLeave);
  63742. const controlBar = this.getChild("controlBar");
  63743. if (controlBar && !IS_IOS$1 && !IS_ANDROID$1) {
  63744. controlBar.on("mouseenter", function(event2) {
  63745. if (this.player().options_.inactivityTimeout !== 0) {
  63746. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  63747. }
  63748. this.player().options_.inactivityTimeout = 0;
  63749. });
  63750. controlBar.on("mouseleave", function(event2) {
  63751. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  63752. });
  63753. }
  63754. this.on("keydown", handleActivity);
  63755. this.on("keyup", handleActivity);
  63756. let inactivityTimeout;
  63757. this.setInterval(function() {
  63758. if (!this.userActivity_) {
  63759. return;
  63760. }
  63761. this.userActivity_ = false;
  63762. this.userActive(true);
  63763. this.clearTimeout(inactivityTimeout);
  63764. const timeout = this.options_.inactivityTimeout;
  63765. if (timeout <= 0) {
  63766. return;
  63767. }
  63768. inactivityTimeout = this.setTimeout(function() {
  63769. if (!this.userActivity_) {
  63770. this.userActive(false);
  63771. }
  63772. }, timeout);
  63773. }, 250);
  63774. }
  63775. playbackRate(rate) {
  63776. if (rate !== void 0) {
  63777. this.techCall_("setPlaybackRate", rate);
  63778. return;
  63779. }
  63780. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63781. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  63782. }
  63783. return 1;
  63784. }
  63785. defaultPlaybackRate(rate) {
  63786. if (rate !== void 0) {
  63787. return this.techCall_("setDefaultPlaybackRate", rate);
  63788. }
  63789. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63790. return this.techGet_("defaultPlaybackRate");
  63791. }
  63792. return 1;
  63793. }
  63794. isAudio(bool) {
  63795. if (bool !== void 0) {
  63796. this.isAudio_ = !!bool;
  63797. return;
  63798. }
  63799. return !!this.isAudio_;
  63800. }
  63801. enableAudioOnlyUI_() {
  63802. this.addClass("vjs-audio-only-mode");
  63803. const playerChildren = this.children();
  63804. const controlBar = this.getChild("ControlBar");
  63805. const controlBarHeight = controlBar && controlBar.currentHeight();
  63806. playerChildren.forEach((child) => {
  63807. if (child === controlBar) {
  63808. return;
  63809. }
  63810. if (child.el_ && !child.hasClass("vjs-hidden")) {
  63811. child.hide();
  63812. this.audioOnlyCache_.hiddenChildren.push(child);
  63813. }
  63814. });
  63815. this.audioOnlyCache_.playerHeight = this.currentHeight();
  63816. this.height(controlBarHeight);
  63817. this.trigger("audioonlymodechange");
  63818. }
  63819. disableAudioOnlyUI_() {
  63820. this.removeClass("vjs-audio-only-mode");
  63821. this.audioOnlyCache_.hiddenChildren.forEach((child) => child.show());
  63822. this.height(this.audioOnlyCache_.playerHeight);
  63823. this.trigger("audioonlymodechange");
  63824. }
  63825. audioOnlyMode(value) {
  63826. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  63827. return this.audioOnlyMode_;
  63828. }
  63829. this.audioOnlyMode_ = value;
  63830. if (value) {
  63831. const exitPromises = [];
  63832. if (this.isInPictureInPicture()) {
  63833. exitPromises.push(this.exitPictureInPicture());
  63834. }
  63835. if (this.isFullscreen()) {
  63836. exitPromises.push(this.exitFullscreen());
  63837. }
  63838. if (this.audioPosterMode()) {
  63839. exitPromises.push(this.audioPosterMode(false));
  63840. }
  63841. return Promise.all(exitPromises).then(() => this.enableAudioOnlyUI_());
  63842. }
  63843. return Promise.resolve().then(() => this.disableAudioOnlyUI_());
  63844. }
  63845. enablePosterModeUI_() {
  63846. const tech = this.tech_ && this.tech_;
  63847. tech.hide();
  63848. this.addClass("vjs-audio-poster-mode");
  63849. this.trigger("audiopostermodechange");
  63850. }
  63851. disablePosterModeUI_() {
  63852. const tech = this.tech_ && this.tech_;
  63853. tech.show();
  63854. this.removeClass("vjs-audio-poster-mode");
  63855. this.trigger("audiopostermodechange");
  63856. }
  63857. audioPosterMode(value) {
  63858. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  63859. return this.audioPosterMode_;
  63860. }
  63861. this.audioPosterMode_ = value;
  63862. if (value) {
  63863. if (this.audioOnlyMode()) {
  63864. const audioOnlyModePromise = this.audioOnlyMode(false);
  63865. return audioOnlyModePromise.then(() => {
  63866. this.enablePosterModeUI_();
  63867. });
  63868. }
  63869. return Promise.resolve().then(() => {
  63870. this.enablePosterModeUI_();
  63871. });
  63872. }
  63873. return Promise.resolve().then(() => {
  63874. this.disablePosterModeUI_();
  63875. });
  63876. }
  63877. addTextTrack(kind, label, language) {
  63878. if (this.tech_) {
  63879. return this.tech_.addTextTrack(kind, label, language);
  63880. }
  63881. }
  63882. addRemoteTextTrack(options2, manualCleanup) {
  63883. if (this.tech_) {
  63884. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  63885. }
  63886. }
  63887. removeRemoteTextTrack(obj = {}) {
  63888. let {
  63889. track
  63890. } = obj;
  63891. if (!track) {
  63892. track = obj;
  63893. }
  63894. if (this.tech_) {
  63895. return this.tech_.removeRemoteTextTrack(track);
  63896. }
  63897. }
  63898. getVideoPlaybackQuality() {
  63899. return this.techGet_("getVideoPlaybackQuality");
  63900. }
  63901. videoWidth() {
  63902. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  63903. }
  63904. videoHeight() {
  63905. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  63906. }
  63907. language(code) {
  63908. if (code === void 0) {
  63909. return this.language_;
  63910. }
  63911. if (this.language_ !== String(code).toLowerCase()) {
  63912. this.language_ = String(code).toLowerCase();
  63913. if (isEvented$1(this)) {
  63914. this.trigger("languagechange");
  63915. }
  63916. }
  63917. }
  63918. languages() {
  63919. return merge$1(Player$1.prototype.options_.languages, this.languages_);
  63920. }
  63921. toJSON() {
  63922. const options2 = merge$1(this.options_);
  63923. const tracks = options2.tracks;
  63924. options2.tracks = [];
  63925. for (let i2 = 0; i2 < tracks.length; i2++) {
  63926. let track = tracks[i2];
  63927. track = merge$1(track);
  63928. track.player = void 0;
  63929. options2.tracks[i2] = track;
  63930. }
  63931. return options2;
  63932. }
  63933. createModal(content, options2) {
  63934. options2 = options2 || {};
  63935. options2.content = content || "";
  63936. const modal = new ModalDialog$1(this, options2);
  63937. this.addChild(modal);
  63938. modal.on("dispose", () => {
  63939. this.removeChild(modal);
  63940. });
  63941. modal.open();
  63942. return modal;
  63943. }
  63944. updateCurrentBreakpoint_() {
  63945. if (!this.responsive()) {
  63946. return;
  63947. }
  63948. const currentBreakpoint = this.currentBreakpoint();
  63949. const currentWidth = this.currentWidth();
  63950. for (let i2 = 0; i2 < BREAKPOINT_ORDER$1.length; i2++) {
  63951. const candidateBreakpoint = BREAKPOINT_ORDER$1[i2];
  63952. const maxWidth = this.breakpoints_[candidateBreakpoint];
  63953. if (currentWidth <= maxWidth) {
  63954. if (currentBreakpoint === candidateBreakpoint) {
  63955. return;
  63956. }
  63957. if (currentBreakpoint) {
  63958. this.removeClass(BREAKPOINT_CLASSES$1[currentBreakpoint]);
  63959. }
  63960. this.addClass(BREAKPOINT_CLASSES$1[candidateBreakpoint]);
  63961. this.breakpoint_ = candidateBreakpoint;
  63962. break;
  63963. }
  63964. }
  63965. }
  63966. removeCurrentBreakpoint_() {
  63967. const className = this.currentBreakpointClass();
  63968. this.breakpoint_ = "";
  63969. if (className) {
  63970. this.removeClass(className);
  63971. }
  63972. }
  63973. breakpoints(breakpoints) {
  63974. if (breakpoints === void 0) {
  63975. return Object.assign(this.breakpoints_);
  63976. }
  63977. this.breakpoint_ = "";
  63978. this.breakpoints_ = Object.assign({}, DEFAULT_BREAKPOINTS$1, breakpoints);
  63979. this.updateCurrentBreakpoint_();
  63980. return Object.assign(this.breakpoints_);
  63981. }
  63982. responsive(value) {
  63983. if (value === void 0) {
  63984. return this.responsive_;
  63985. }
  63986. value = Boolean(value);
  63987. const current = this.responsive_;
  63988. if (value === current) {
  63989. return;
  63990. }
  63991. this.responsive_ = value;
  63992. if (value) {
  63993. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  63994. this.updateCurrentBreakpoint_();
  63995. } else {
  63996. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  63997. this.removeCurrentBreakpoint_();
  63998. }
  63999. return value;
  64000. }
  64001. currentBreakpoint() {
  64002. return this.breakpoint_;
  64003. }
  64004. currentBreakpointClass() {
  64005. return BREAKPOINT_CLASSES$1[this.breakpoint_] || "";
  64006. }
  64007. loadMedia(media, ready) {
  64008. if (!media || typeof media !== "object") {
  64009. return;
  64010. }
  64011. this.reset();
  64012. this.cache_.media = merge$1(media);
  64013. const {
  64014. artist,
  64015. artwork,
  64016. description,
  64017. poster,
  64018. src,
  64019. textTracks,
  64020. title
  64021. } = this.cache_.media;
  64022. if (!artwork && poster) {
  64023. this.cache_.media.artwork = [{
  64024. src: poster,
  64025. type: getMimetype$1(poster)
  64026. }];
  64027. }
  64028. if (src) {
  64029. this.src(src);
  64030. }
  64031. if (poster) {
  64032. this.poster(poster);
  64033. }
  64034. if (Array.isArray(textTracks)) {
  64035. textTracks.forEach((tt2) => this.addRemoteTextTrack(tt2, false));
  64036. }
  64037. if (this.titleBar) {
  64038. this.titleBar.update({
  64039. title,
  64040. description: description || artist || ""
  64041. });
  64042. }
  64043. this.ready(ready);
  64044. }
  64045. getMedia() {
  64046. if (!this.cache_.media) {
  64047. const poster = this.poster();
  64048. const src = this.currentSources();
  64049. const textTracks = Array.prototype.map.call(this.remoteTextTracks(), (tt2) => ({
  64050. kind: tt2.kind,
  64051. label: tt2.label,
  64052. language: tt2.language,
  64053. src: tt2.src
  64054. }));
  64055. const media = {
  64056. src,
  64057. textTracks
  64058. };
  64059. if (poster) {
  64060. media.poster = poster;
  64061. media.artwork = [{
  64062. src: media.poster,
  64063. type: getMimetype$1(media.poster)
  64064. }];
  64065. }
  64066. return media;
  64067. }
  64068. return merge$1(this.cache_.media);
  64069. }
  64070. static getTagSettings(tag) {
  64071. const baseOptions = {
  64072. sources: [],
  64073. tracks: []
  64074. };
  64075. const tagOptions = getAttributes$1(tag);
  64076. const dataSetup = tagOptions["data-setup"];
  64077. if (hasClass$1(tag, "vjs-fill")) {
  64078. tagOptions.fill = true;
  64079. }
  64080. if (hasClass$1(tag, "vjs-fluid")) {
  64081. tagOptions.fluid = true;
  64082. }
  64083. if (dataSetup !== null) {
  64084. const [err, data] = tuple(dataSetup || "{}");
  64085. if (err) {
  64086. log$1$1.error(err);
  64087. }
  64088. Object.assign(tagOptions, data);
  64089. }
  64090. Object.assign(baseOptions, tagOptions);
  64091. if (tag.hasChildNodes()) {
  64092. const children = tag.childNodes;
  64093. for (let i2 = 0, j = children.length; i2 < j; i2++) {
  64094. const child = children[i2];
  64095. const childName = child.nodeName.toLowerCase();
  64096. if (childName === "source") {
  64097. baseOptions.sources.push(getAttributes$1(child));
  64098. } else if (childName === "track") {
  64099. baseOptions.tracks.push(getAttributes$1(child));
  64100. }
  64101. }
  64102. }
  64103. return baseOptions;
  64104. }
  64105. debug(enabled) {
  64106. if (enabled === void 0) {
  64107. return this.debugEnabled_;
  64108. }
  64109. if (enabled) {
  64110. this.trigger("debugon");
  64111. this.previousLogLevel_ = this.log.level;
  64112. this.log.level("debug");
  64113. this.debugEnabled_ = true;
  64114. } else {
  64115. this.trigger("debugoff");
  64116. this.log.level(this.previousLogLevel_);
  64117. this.previousLogLevel_ = void 0;
  64118. this.debugEnabled_ = false;
  64119. }
  64120. }
  64121. playbackRates(newRates) {
  64122. if (newRates === void 0) {
  64123. return this.cache_.playbackRates;
  64124. }
  64125. if (!Array.isArray(newRates)) {
  64126. return;
  64127. }
  64128. if (!newRates.every((rate) => typeof rate === "number")) {
  64129. return;
  64130. }
  64131. this.cache_.playbackRates = newRates;
  64132. this.trigger("playbackrateschange");
  64133. }
  64134. }
  64135. ALL$1.names.forEach(function(name) {
  64136. const props = ALL$1[name];
  64137. Player$1.prototype[props.getterName] = function() {
  64138. if (this.tech_) {
  64139. return this.tech_[props.getterName]();
  64140. }
  64141. this[props.privateName] = this[props.privateName] || new props.ListClass();
  64142. return this[props.privateName];
  64143. };
  64144. });
  64145. Player$1.prototype.crossorigin = Player$1.prototype.crossOrigin;
  64146. Player$1.players = {};
  64147. const navigator$3 = window_1.navigator;
  64148. Player$1.prototype.options_ = {
  64149. techOrder: Tech$2.defaultTechOrder_,
  64150. html5: {},
  64151. enableSourceset: true,
  64152. inactivityTimeout: 2e3,
  64153. playbackRates: [],
  64154. liveui: false,
  64155. children: ["mediaLoader", "posterImage", "titleBar", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  64156. language: navigator$3 && (navigator$3.languages && navigator$3.languages[0] || navigator$3.userLanguage || navigator$3.language) || "en",
  64157. languages: {},
  64158. notSupportedMessage: "No compatible source was found for this media.",
  64159. normalizeAutoplay: false,
  64160. fullscreen: {
  64161. options: {
  64162. navigationUI: "hide"
  64163. }
  64164. },
  64165. breakpoints: {},
  64166. responsive: false,
  64167. audioOnlyMode: false,
  64168. audioPosterMode: false
  64169. };
  64170. [
  64171. "ended",
  64172. "seeking",
  64173. "seekable",
  64174. "networkState",
  64175. "readyState"
  64176. ].forEach(function(fn2) {
  64177. Player$1.prototype[fn2] = function() {
  64178. return this.techGet_(fn2);
  64179. };
  64180. });
  64181. TECH_EVENTS_RETRIGGER$1.forEach(function(event2) {
  64182. Player$1.prototype[`handleTech${toTitleCase$1$1(event2)}_`] = function() {
  64183. return this.trigger(event2);
  64184. };
  64185. });
  64186. Component$1$1.registerComponent("Player", Player$1);
  64187. const BASE_PLUGIN_NAME$1 = "plugin";
  64188. const PLUGIN_CACHE_KEY$1 = "activePlugins_";
  64189. const pluginStorage$1 = {};
  64190. const pluginExists$1 = (name) => pluginStorage$1.hasOwnProperty(name);
  64191. const getPlugin$1 = (name) => pluginExists$1(name) ? pluginStorage$1[name] : void 0;
  64192. const markPluginAsActive$1 = (player, name) => {
  64193. player[PLUGIN_CACHE_KEY$1] = player[PLUGIN_CACHE_KEY$1] || {};
  64194. player[PLUGIN_CACHE_KEY$1][name] = true;
  64195. };
  64196. const triggerSetupEvent$1 = (player, hash, before) => {
  64197. const eventName = (before ? "before" : "") + "pluginsetup";
  64198. player.trigger(eventName, hash);
  64199. player.trigger(eventName + ":" + hash.name, hash);
  64200. };
  64201. const createBasicPlugin$1 = function(name, plugin) {
  64202. const basicPluginWrapper = function() {
  64203. triggerSetupEvent$1(this, {
  64204. name,
  64205. plugin,
  64206. instance: null
  64207. }, true);
  64208. const instance = plugin.apply(this, arguments);
  64209. markPluginAsActive$1(this, name);
  64210. triggerSetupEvent$1(this, {
  64211. name,
  64212. plugin,
  64213. instance
  64214. });
  64215. return instance;
  64216. };
  64217. Object.keys(plugin).forEach(function(prop) {
  64218. basicPluginWrapper[prop] = plugin[prop];
  64219. });
  64220. return basicPluginWrapper;
  64221. };
  64222. const createPluginFactory$1 = (name, PluginSubClass) => {
  64223. PluginSubClass.prototype.name = name;
  64224. return function(...args) {
  64225. triggerSetupEvent$1(this, {
  64226. name,
  64227. plugin: PluginSubClass,
  64228. instance: null
  64229. }, true);
  64230. const instance = new PluginSubClass(...[this, ...args]);
  64231. this[name] = () => instance;
  64232. triggerSetupEvent$1(this, instance.getEventHash());
  64233. return instance;
  64234. };
  64235. };
  64236. class Plugin$1 {
  64237. constructor(player) {
  64238. if (this.constructor === Plugin$1) {
  64239. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  64240. }
  64241. this.player = player;
  64242. if (!this.log) {
  64243. this.log = this.player.log.createLogger(this.name);
  64244. }
  64245. evented$1(this);
  64246. delete this.trigger;
  64247. stateful$1(this, this.constructor.defaultState);
  64248. markPluginAsActive$1(player, this.name);
  64249. this.dispose = this.dispose.bind(this);
  64250. player.on("dispose", this.dispose);
  64251. }
  64252. version() {
  64253. return this.constructor.VERSION;
  64254. }
  64255. getEventHash(hash = {}) {
  64256. hash.name = this.name;
  64257. hash.plugin = this.constructor;
  64258. hash.instance = this;
  64259. return hash;
  64260. }
  64261. trigger(event2, hash = {}) {
  64262. return trigger$1(this.eventBusEl_, event2, this.getEventHash(hash));
  64263. }
  64264. handleStateChanged(e) {
  64265. }
  64266. dispose() {
  64267. const {
  64268. name,
  64269. player
  64270. } = this;
  64271. this.trigger("dispose");
  64272. this.off();
  64273. player.off("dispose", this.dispose);
  64274. player[PLUGIN_CACHE_KEY$1][name] = false;
  64275. this.player = this.state = null;
  64276. player[name] = createPluginFactory$1(name, pluginStorage$1[name]);
  64277. }
  64278. static isBasic(plugin) {
  64279. const p = typeof plugin === "string" ? getPlugin$1(plugin) : plugin;
  64280. return typeof p === "function" && !Plugin$1.prototype.isPrototypeOf(p.prototype);
  64281. }
  64282. static registerPlugin(name, plugin) {
  64283. if (typeof name !== "string") {
  64284. throw new Error(`Illegal plugin name, "${name}", must be a string, was ${typeof name}.`);
  64285. }
  64286. if (pluginExists$1(name)) {
  64287. log$1$1.warn(`A plugin named "${name}" already exists. You may want to avoid re-registering plugins!`);
  64288. } else if (Player$1.prototype.hasOwnProperty(name)) {
  64289. throw new Error(`Illegal plugin name, "${name}", cannot share a name with an existing player method!`);
  64290. }
  64291. if (typeof plugin !== "function") {
  64292. throw new Error(`Illegal plugin for "${name}", must be a function, was ${typeof plugin}.`);
  64293. }
  64294. pluginStorage$1[name] = plugin;
  64295. if (name !== BASE_PLUGIN_NAME$1) {
  64296. if (Plugin$1.isBasic(plugin)) {
  64297. Player$1.prototype[name] = createBasicPlugin$1(name, plugin);
  64298. } else {
  64299. Player$1.prototype[name] = createPluginFactory$1(name, plugin);
  64300. }
  64301. }
  64302. return plugin;
  64303. }
  64304. static deregisterPlugin(name) {
  64305. if (name === BASE_PLUGIN_NAME$1) {
  64306. throw new Error("Cannot de-register base plugin.");
  64307. }
  64308. if (pluginExists$1(name)) {
  64309. delete pluginStorage$1[name];
  64310. delete Player$1.prototype[name];
  64311. }
  64312. }
  64313. static getPlugins(names2 = Object.keys(pluginStorage$1)) {
  64314. let result;
  64315. names2.forEach((name) => {
  64316. const plugin = getPlugin$1(name);
  64317. if (plugin) {
  64318. result = result || {};
  64319. result[name] = plugin;
  64320. }
  64321. });
  64322. return result;
  64323. }
  64324. static getPluginVersion(name) {
  64325. const plugin = getPlugin$1(name);
  64326. return plugin && plugin.VERSION || "";
  64327. }
  64328. }
  64329. Plugin$1.getPlugin = getPlugin$1;
  64330. Plugin$1.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME$1;
  64331. Plugin$1.registerPlugin(BASE_PLUGIN_NAME$1, Plugin$1);
  64332. Player$1.prototype.usingPlugin = function(name) {
  64333. return !!this[PLUGIN_CACHE_KEY$1] && this[PLUGIN_CACHE_KEY$1][name] === true;
  64334. };
  64335. Player$1.prototype.hasPlugin = function(name) {
  64336. return !!pluginExists$1(name);
  64337. };
  64338. function deprecate(message, fn2) {
  64339. let warned = false;
  64340. return function(...args) {
  64341. if (!warned) {
  64342. log$1$1.warn(message);
  64343. }
  64344. warned = true;
  64345. return fn2.apply(this, args);
  64346. };
  64347. }
  64348. function deprecateForMajor(major, oldName, newName, fn2) {
  64349. return deprecate(`${oldName} is deprecated and will be removed in ${major}.0; please use ${newName} instead.`, fn2);
  64350. }
  64351. const normalizeId$1 = (id) => id.indexOf("#") === 0 ? id.slice(1) : id;
  64352. function videojs$2(id, options2, ready) {
  64353. let player = videojs$2.getPlayer(id);
  64354. if (player) {
  64355. if (options2) {
  64356. log$1$1.warn(`Player "${id}" is already initialised. Options will not be applied.`);
  64357. }
  64358. if (ready) {
  64359. player.ready(ready);
  64360. }
  64361. return player;
  64362. }
  64363. const el = typeof id === "string" ? $$1("#" + normalizeId$1(id)) : id;
  64364. if (!isEl$1(el)) {
  64365. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  64366. }
  64367. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  64368. log$1$1.warn("The element supplied is not included in the DOM");
  64369. }
  64370. options2 = options2 || {};
  64371. if (options2.restoreEl === true) {
  64372. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  64373. }
  64374. hooks$1("beforesetup").forEach((hookFunction) => {
  64375. const opts = hookFunction(el, merge$1(options2));
  64376. if (!isObject$2(opts) || Array.isArray(opts)) {
  64377. log$1$1.error("please return an object in beforesetup hooks");
  64378. return;
  64379. }
  64380. options2 = merge$1(options2, opts);
  64381. });
  64382. const PlayerComponent = Component$1$1.getComponent("Player");
  64383. player = new PlayerComponent(el, options2, ready);
  64384. hooks$1("setup").forEach((hookFunction) => hookFunction(player));
  64385. return player;
  64386. }
  64387. videojs$2.hooks_ = hooks_$1;
  64388. videojs$2.hooks = hooks$1;
  64389. videojs$2.hook = hook$1;
  64390. videojs$2.hookOnce = hookOnce$1;
  64391. videojs$2.removeHook = removeHook$1;
  64392. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal$1()) {
  64393. let style = $$1(".vjs-styles-defaults");
  64394. if (!style) {
  64395. style = createStyleElement$1("vjs-styles-defaults");
  64396. const head = $$1("head");
  64397. if (head) {
  64398. head.insertBefore(style, head.firstChild);
  64399. }
  64400. setTextContent$1(style, `
  64401. .video-js {
  64402. width: 300px;
  64403. height: 150px;
  64404. }
  64405. .vjs-fluid:not(.vjs-audio-only-mode) {
  64406. padding-top: 56.25%
  64407. }
  64408. `);
  64409. }
  64410. }
  64411. autoSetupTimeout$1(1, videojs$2);
  64412. videojs$2.VERSION = version$6$1;
  64413. videojs$2.options = Player$1.prototype.options_;
  64414. videojs$2.getPlayers = () => Player$1.players;
  64415. videojs$2.getPlayer = (id) => {
  64416. const players = Player$1.players;
  64417. let tag;
  64418. if (typeof id === "string") {
  64419. const nId = normalizeId$1(id);
  64420. const player = players[nId];
  64421. if (player) {
  64422. return player;
  64423. }
  64424. tag = $$1("#" + nId);
  64425. } else {
  64426. tag = id;
  64427. }
  64428. if (isEl$1(tag)) {
  64429. const {
  64430. player,
  64431. playerId
  64432. } = tag;
  64433. if (player || players[playerId]) {
  64434. return player || players[playerId];
  64435. }
  64436. }
  64437. };
  64438. videojs$2.getAllPlayers = () => Object.keys(Player$1.players).map((k) => Player$1.players[k]).filter(Boolean);
  64439. videojs$2.players = Player$1.players;
  64440. videojs$2.getComponent = Component$1$1.getComponent;
  64441. videojs$2.registerComponent = (name, comp) => {
  64442. if (Tech$2.isTech(comp)) {
  64443. log$1$1.warn(`The ${name} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);
  64444. }
  64445. Component$1$1.registerComponent.call(Component$1$1, name, comp);
  64446. };
  64447. videojs$2.getTech = Tech$2.getTech;
  64448. videojs$2.registerTech = Tech$2.registerTech;
  64449. videojs$2.use = use$1;
  64450. Object.defineProperty(videojs$2, "middleware", {
  64451. value: {},
  64452. writeable: false,
  64453. enumerable: true
  64454. });
  64455. Object.defineProperty(videojs$2.middleware, "TERMINATOR", {
  64456. value: TERMINATOR$1,
  64457. writeable: false,
  64458. enumerable: true
  64459. });
  64460. videojs$2.browser = browser$1;
  64461. videojs$2.obj = Obj;
  64462. videojs$2.mergeOptions = deprecateForMajor(9, "videojs.mergeOptions", "videojs.obj.merge", merge$1);
  64463. videojs$2.defineLazyProperty = deprecateForMajor(9, "videojs.defineLazyProperty", "videojs.obj.defineLazyProperty", defineLazyProperty$1);
  64464. videojs$2.bind = deprecateForMajor(9, "videojs.bind", "native Function.prototype.bind", bind_);
  64465. videojs$2.registerPlugin = Plugin$1.registerPlugin;
  64466. videojs$2.deregisterPlugin = Plugin$1.deregisterPlugin;
  64467. videojs$2.plugin = (name, plugin) => {
  64468. log$1$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  64469. return Plugin$1.registerPlugin(name, plugin);
  64470. };
  64471. videojs$2.getPlugins = Plugin$1.getPlugins;
  64472. videojs$2.getPlugin = Plugin$1.getPlugin;
  64473. videojs$2.getPluginVersion = Plugin$1.getPluginVersion;
  64474. videojs$2.addLanguage = function(code, data) {
  64475. code = ("" + code).toLowerCase();
  64476. videojs$2.options.languages = merge$1(videojs$2.options.languages, {
  64477. [code]: data
  64478. });
  64479. return videojs$2.options.languages[code];
  64480. };
  64481. videojs$2.log = log$1$1;
  64482. videojs$2.createLogger = createLogger$2;
  64483. videojs$2.time = Time;
  64484. videojs$2.createTimeRange = deprecateForMajor(9, "videojs.createTimeRange", "videojs.time.createTimeRanges", createTimeRanges$1);
  64485. videojs$2.createTimeRanges = deprecateForMajor(9, "videojs.createTimeRanges", "videojs.time.createTimeRanges", createTimeRanges$1);
  64486. videojs$2.formatTime = deprecateForMajor(9, "videojs.formatTime", "videojs.time.formatTime", formatTime$1);
  64487. videojs$2.setFormatTime = deprecateForMajor(9, "videojs.setFormatTime", "videojs.time.setFormatTime", setFormatTime$1);
  64488. videojs$2.resetFormatTime = deprecateForMajor(9, "videojs.resetFormatTime", "videojs.time.resetFormatTime", resetFormatTime$1);
  64489. videojs$2.parseUrl = deprecateForMajor(9, "videojs.parseUrl", "videojs.url.parseUrl", parseUrl$1);
  64490. videojs$2.isCrossOrigin = deprecateForMajor(9, "videojs.isCrossOrigin", "videojs.url.isCrossOrigin", isCrossOrigin$1);
  64491. videojs$2.EventTarget = EventTarget$2$1;
  64492. videojs$2.any = any$1;
  64493. videojs$2.on = on$1;
  64494. videojs$2.one = one$1;
  64495. videojs$2.off = off$1;
  64496. videojs$2.trigger = trigger$1;
  64497. videojs$2.xhr = XHR;
  64498. videojs$2.TextTrack = TextTrack$1;
  64499. videojs$2.AudioTrack = AudioTrack$1;
  64500. videojs$2.VideoTrack = VideoTrack$1;
  64501. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach((k) => {
  64502. videojs$2[k] = function() {
  64503. log$1$1.warn(`videojs.${k}() is deprecated; use videojs.dom.${k}() instead`);
  64504. return Dom$2[k].apply(null, arguments);
  64505. };
  64506. });
  64507. videojs$2.computedStyle = deprecateForMajor(9, "videojs.computedStyle", "videojs.dom.computedStyle", computedStyle$1);
  64508. videojs$2.dom = Dom$2;
  64509. videojs$2.fn = Fn;
  64510. videojs$2.num = Num;
  64511. videojs$2.str = Str;
  64512. videojs$2.url = Url$2;
  64513. /*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */
  64514. class QualityLevel {
  64515. constructor(representation) {
  64516. let level = this;
  64517. level.id = representation.id;
  64518. level.label = level.id;
  64519. level.width = representation.width;
  64520. level.height = representation.height;
  64521. level.bitrate = representation.bandwidth;
  64522. level.frameRate = representation.frameRate;
  64523. level.enabled_ = representation.enabled;
  64524. Object.defineProperty(level, "enabled", {
  64525. get() {
  64526. return level.enabled_();
  64527. },
  64528. set(enable) {
  64529. level.enabled_(enable);
  64530. }
  64531. });
  64532. return level;
  64533. }
  64534. }
  64535. class QualityLevelList extends videojs$2.EventTarget {
  64536. constructor() {
  64537. super();
  64538. let list = this;
  64539. list.levels_ = [];
  64540. list.selectedIndex_ = -1;
  64541. Object.defineProperty(list, "selectedIndex", {
  64542. get() {
  64543. return list.selectedIndex_;
  64544. }
  64545. });
  64546. Object.defineProperty(list, "length", {
  64547. get() {
  64548. return list.levels_.length;
  64549. }
  64550. });
  64551. return list;
  64552. }
  64553. addQualityLevel(representation) {
  64554. let qualityLevel = this.getQualityLevelById(representation.id);
  64555. if (qualityLevel) {
  64556. return qualityLevel;
  64557. }
  64558. const index2 = this.levels_.length;
  64559. qualityLevel = new QualityLevel(representation);
  64560. if (!("" + index2 in this)) {
  64561. Object.defineProperty(this, index2, {
  64562. get() {
  64563. return this.levels_[index2];
  64564. }
  64565. });
  64566. }
  64567. this.levels_.push(qualityLevel);
  64568. this.trigger({
  64569. qualityLevel,
  64570. type: "addqualitylevel"
  64571. });
  64572. return qualityLevel;
  64573. }
  64574. removeQualityLevel(qualityLevel) {
  64575. let removed = null;
  64576. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64577. if (this[i2] === qualityLevel) {
  64578. removed = this.levels_.splice(i2, 1)[0];
  64579. if (this.selectedIndex_ === i2) {
  64580. this.selectedIndex_ = -1;
  64581. } else if (this.selectedIndex_ > i2) {
  64582. this.selectedIndex_--;
  64583. }
  64584. break;
  64585. }
  64586. }
  64587. if (removed) {
  64588. this.trigger({
  64589. qualityLevel,
  64590. type: "removequalitylevel"
  64591. });
  64592. }
  64593. return removed;
  64594. }
  64595. getQualityLevelById(id) {
  64596. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64597. const level = this[i2];
  64598. if (level.id === id) {
  64599. return level;
  64600. }
  64601. }
  64602. return null;
  64603. }
  64604. dispose() {
  64605. this.selectedIndex_ = -1;
  64606. this.levels_.length = 0;
  64607. }
  64608. }
  64609. QualityLevelList.prototype.allowedEvents_ = {
  64610. change: "change",
  64611. addqualitylevel: "addqualitylevel",
  64612. removequalitylevel: "removequalitylevel"
  64613. };
  64614. for (const event2 in QualityLevelList.prototype.allowedEvents_) {
  64615. QualityLevelList.prototype["on" + event2] = null;
  64616. }
  64617. var version$5$1 = "3.0.0";
  64618. const registerPlugin$1 = videojs$2.registerPlugin || videojs$2.plugin;
  64619. const initPlugin$1 = function(player, options2) {
  64620. const originalPluginFn = player.qualityLevels;
  64621. const qualityLevelList = new QualityLevelList();
  64622. const disposeHandler = function() {
  64623. qualityLevelList.dispose();
  64624. player.qualityLevels = originalPluginFn;
  64625. player.off("dispose", disposeHandler);
  64626. };
  64627. player.on("dispose", disposeHandler);
  64628. player.qualityLevels = () => qualityLevelList;
  64629. player.qualityLevels.VERSION = version$5$1;
  64630. return qualityLevelList;
  64631. };
  64632. const qualityLevels = function(options2) {
  64633. return initPlugin$1(this, videojs$2.mergeOptions({}, options2));
  64634. };
  64635. registerPlugin$1("qualityLevels", qualityLevels);
  64636. qualityLevels.VERSION = version$5$1;
  64637. /*! @name @videojs/http-streaming @version 3.0.2 @license Apache-2.0 */
  64638. const resolveUrl$2 = resolveUrl$4;
  64639. const resolveManifestRedirect$1 = (url, req) => {
  64640. if (req && req.responseURL && url !== req.responseURL) {
  64641. return req.responseURL;
  64642. }
  64643. return url;
  64644. };
  64645. const logger$1 = (source) => {
  64646. if (videojs$2.log.debug) {
  64647. return videojs$2.log.debug.bind(videojs$2, "VHS:", `${source} >`);
  64648. }
  64649. return function() {
  64650. };
  64651. };
  64652. function merge$2(...args) {
  64653. const context = videojs$2.obj || videojs$2;
  64654. const fn2 = context.merge || context.mergeOptions;
  64655. return fn2.apply(context, args);
  64656. }
  64657. function createTimeRanges$2(...args) {
  64658. const context = videojs$2.time || videojs$2;
  64659. const fn2 = context.createTimeRanges || context.createTimeRanges;
  64660. return fn2.apply(context, args);
  64661. }
  64662. const TIME_FUDGE_FACTOR$1 = 1 / 30;
  64663. const SAFE_TIME_DELTA$1 = TIME_FUDGE_FACTOR$1 * 3;
  64664. const filterRanges$1 = function(timeRanges, predicate) {
  64665. const results = [];
  64666. let i2;
  64667. if (timeRanges && timeRanges.length) {
  64668. for (i2 = 0; i2 < timeRanges.length; i2++) {
  64669. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  64670. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  64671. }
  64672. }
  64673. }
  64674. return createTimeRanges$2(results);
  64675. };
  64676. const findRange$1 = function(buffered, time) {
  64677. return filterRanges$1(buffered, function(start2, end) {
  64678. return start2 - SAFE_TIME_DELTA$1 <= time && end + SAFE_TIME_DELTA$1 >= time;
  64679. });
  64680. };
  64681. const findNextRange$1 = function(timeRanges, time) {
  64682. return filterRanges$1(timeRanges, function(start2) {
  64683. return start2 - TIME_FUDGE_FACTOR$1 >= time;
  64684. });
  64685. };
  64686. const findGaps$1 = function(buffered) {
  64687. if (buffered.length < 2) {
  64688. return createTimeRanges$2();
  64689. }
  64690. const ranges = [];
  64691. for (let i2 = 1; i2 < buffered.length; i2++) {
  64692. const start2 = buffered.end(i2 - 1);
  64693. const end = buffered.start(i2);
  64694. ranges.push([start2, end]);
  64695. }
  64696. return createTimeRanges$2(ranges);
  64697. };
  64698. const bufferIntersection$1 = function(bufferA, bufferB) {
  64699. let start2 = null;
  64700. let end = null;
  64701. let arity = 0;
  64702. const extents = [];
  64703. const ranges = [];
  64704. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  64705. return createTimeRanges$2();
  64706. }
  64707. let count = bufferA.length;
  64708. while (count--) {
  64709. extents.push({
  64710. time: bufferA.start(count),
  64711. type: "start"
  64712. });
  64713. extents.push({
  64714. time: bufferA.end(count),
  64715. type: "end"
  64716. });
  64717. }
  64718. count = bufferB.length;
  64719. while (count--) {
  64720. extents.push({
  64721. time: bufferB.start(count),
  64722. type: "start"
  64723. });
  64724. extents.push({
  64725. time: bufferB.end(count),
  64726. type: "end"
  64727. });
  64728. }
  64729. extents.sort(function(a, b) {
  64730. return a.time - b.time;
  64731. });
  64732. for (count = 0; count < extents.length; count++) {
  64733. if (extents[count].type === "start") {
  64734. arity++;
  64735. if (arity === 2) {
  64736. start2 = extents[count].time;
  64737. }
  64738. } else if (extents[count].type === "end") {
  64739. arity--;
  64740. if (arity === 1) {
  64741. end = extents[count].time;
  64742. }
  64743. }
  64744. if (start2 !== null && end !== null) {
  64745. ranges.push([start2, end]);
  64746. start2 = null;
  64747. end = null;
  64748. }
  64749. }
  64750. return createTimeRanges$2(ranges);
  64751. };
  64752. const printableRange$1 = (range3) => {
  64753. const strArr = [];
  64754. if (!range3 || !range3.length) {
  64755. return "";
  64756. }
  64757. for (let i2 = 0; i2 < range3.length; i2++) {
  64758. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  64759. }
  64760. return strArr.join(", ");
  64761. };
  64762. const timeUntilRebuffer$1 = function(buffered, currentTime, playbackRate = 1) {
  64763. const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  64764. return (bufferedEnd - currentTime) / playbackRate;
  64765. };
  64766. const timeRangesToArray$1 = (timeRanges) => {
  64767. const timeRangesList = [];
  64768. for (let i2 = 0; i2 < timeRanges.length; i2++) {
  64769. timeRangesList.push({
  64770. start: timeRanges.start(i2),
  64771. end: timeRanges.end(i2)
  64772. });
  64773. }
  64774. return timeRangesList;
  64775. };
  64776. const isRangeDifferent$1 = function(a, b) {
  64777. if (a === b) {
  64778. return false;
  64779. }
  64780. if (!a && b || !b && a) {
  64781. return true;
  64782. }
  64783. if (a.length !== b.length) {
  64784. return true;
  64785. }
  64786. for (let i2 = 0; i2 < a.length; i2++) {
  64787. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  64788. return true;
  64789. }
  64790. }
  64791. return false;
  64792. };
  64793. const lastBufferedEnd$1 = function(a) {
  64794. if (!a || !a.length || !a.end) {
  64795. return;
  64796. }
  64797. return a.end(a.length - 1);
  64798. };
  64799. const timeAheadOf$1 = function(range3, startTime) {
  64800. let time = 0;
  64801. if (!range3 || !range3.length) {
  64802. return time;
  64803. }
  64804. for (let i2 = 0; i2 < range3.length; i2++) {
  64805. const start2 = range3.start(i2);
  64806. const end = range3.end(i2);
  64807. if (startTime > end) {
  64808. continue;
  64809. }
  64810. if (startTime > start2 && startTime <= end) {
  64811. time += end - startTime;
  64812. continue;
  64813. }
  64814. time += end - start2;
  64815. }
  64816. return time;
  64817. };
  64818. const segmentDurationWithParts$1 = (playlist, segment) => {
  64819. if (!segment.preload) {
  64820. return segment.duration;
  64821. }
  64822. let result = 0;
  64823. (segment.parts || []).forEach(function(p) {
  64824. result += p.duration;
  64825. });
  64826. (segment.preloadHints || []).forEach(function(p) {
  64827. if (p.type === "PART") {
  64828. result += playlist.partTargetDuration;
  64829. }
  64830. });
  64831. return result;
  64832. };
  64833. const getPartsAndSegments$1 = (playlist) => (playlist.segments || []).reduce((acc, segment, si) => {
  64834. if (segment.parts) {
  64835. segment.parts.forEach(function(part, pi) {
  64836. acc.push({
  64837. duration: part.duration,
  64838. segmentIndex: si,
  64839. partIndex: pi,
  64840. part,
  64841. segment
  64842. });
  64843. });
  64844. } else {
  64845. acc.push({
  64846. duration: segment.duration,
  64847. segmentIndex: si,
  64848. partIndex: null,
  64849. segment,
  64850. part: null
  64851. });
  64852. }
  64853. return acc;
  64854. }, []);
  64855. const getLastParts$1 = (media) => {
  64856. const lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  64857. return lastSegment && lastSegment.parts || [];
  64858. };
  64859. const getKnownPartCount$1 = ({
  64860. preloadSegment
  64861. }) => {
  64862. if (!preloadSegment) {
  64863. return;
  64864. }
  64865. const {
  64866. parts,
  64867. preloadHints
  64868. } = preloadSegment;
  64869. let partCount = (preloadHints || []).reduce((count, hint) => count + (hint.type === "PART" ? 1 : 0), 0);
  64870. partCount += parts && parts.length ? parts.length : 0;
  64871. return partCount;
  64872. };
  64873. const liveEdgeDelay$1 = (main, media) => {
  64874. if (media.endList) {
  64875. return 0;
  64876. }
  64877. if (main && main.suggestedPresentationDelay) {
  64878. return main.suggestedPresentationDelay;
  64879. }
  64880. const hasParts = getLastParts$1(media).length > 0;
  64881. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  64882. return media.serverControl.partHoldBack;
  64883. } else if (hasParts && media.partTargetDuration) {
  64884. return media.partTargetDuration * 3;
  64885. } else if (media.serverControl && media.serverControl.holdBack) {
  64886. return media.serverControl.holdBack;
  64887. } else if (media.targetDuration) {
  64888. return media.targetDuration * 3;
  64889. }
  64890. return 0;
  64891. };
  64892. const backwardDuration$1 = function(playlist, endSequence) {
  64893. let result = 0;
  64894. let i2 = endSequence - playlist.mediaSequence;
  64895. let segment = playlist.segments[i2];
  64896. if (segment) {
  64897. if (typeof segment.start !== "undefined") {
  64898. return {
  64899. result: segment.start,
  64900. precise: true
  64901. };
  64902. }
  64903. if (typeof segment.end !== "undefined") {
  64904. return {
  64905. result: segment.end - segment.duration,
  64906. precise: true
  64907. };
  64908. }
  64909. }
  64910. while (i2--) {
  64911. segment = playlist.segments[i2];
  64912. if (typeof segment.end !== "undefined") {
  64913. return {
  64914. result: result + segment.end,
  64915. precise: true
  64916. };
  64917. }
  64918. result += segmentDurationWithParts$1(playlist, segment);
  64919. if (typeof segment.start !== "undefined") {
  64920. return {
  64921. result: result + segment.start,
  64922. precise: true
  64923. };
  64924. }
  64925. }
  64926. return {
  64927. result,
  64928. precise: false
  64929. };
  64930. };
  64931. const forwardDuration$1 = function(playlist, endSequence) {
  64932. let result = 0;
  64933. let segment;
  64934. let i2 = endSequence - playlist.mediaSequence;
  64935. for (; i2 < playlist.segments.length; i2++) {
  64936. segment = playlist.segments[i2];
  64937. if (typeof segment.start !== "undefined") {
  64938. return {
  64939. result: segment.start - result,
  64940. precise: true
  64941. };
  64942. }
  64943. result += segmentDurationWithParts$1(playlist, segment);
  64944. if (typeof segment.end !== "undefined") {
  64945. return {
  64946. result: segment.end - result,
  64947. precise: true
  64948. };
  64949. }
  64950. }
  64951. return {
  64952. result: -1,
  64953. precise: false
  64954. };
  64955. };
  64956. const intervalDuration$1 = function(playlist, endSequence, expired) {
  64957. if (typeof endSequence === "undefined") {
  64958. endSequence = playlist.mediaSequence + playlist.segments.length;
  64959. }
  64960. if (endSequence < playlist.mediaSequence) {
  64961. return 0;
  64962. }
  64963. const backward = backwardDuration$1(playlist, endSequence);
  64964. if (backward.precise) {
  64965. return backward.result;
  64966. }
  64967. const forward = forwardDuration$1(playlist, endSequence);
  64968. if (forward.precise) {
  64969. return forward.result;
  64970. }
  64971. return backward.result + expired;
  64972. };
  64973. const duration$1 = function(playlist, endSequence, expired) {
  64974. if (!playlist) {
  64975. return 0;
  64976. }
  64977. if (typeof expired !== "number") {
  64978. expired = 0;
  64979. }
  64980. if (typeof endSequence === "undefined") {
  64981. if (playlist.totalDuration) {
  64982. return playlist.totalDuration;
  64983. }
  64984. if (!playlist.endList) {
  64985. return window_1.Infinity;
  64986. }
  64987. }
  64988. return intervalDuration$1(playlist, endSequence, expired);
  64989. };
  64990. const sumDurations$1 = function({
  64991. defaultDuration,
  64992. durationList,
  64993. startIndex,
  64994. endIndex
  64995. }) {
  64996. let durations = 0;
  64997. if (startIndex > endIndex) {
  64998. [startIndex, endIndex] = [endIndex, startIndex];
  64999. }
  65000. if (startIndex < 0) {
  65001. for (let i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  65002. durations += defaultDuration;
  65003. }
  65004. startIndex = 0;
  65005. }
  65006. for (let i2 = startIndex; i2 < endIndex; i2++) {
  65007. durations += durationList[i2].duration;
  65008. }
  65009. return durations;
  65010. };
  65011. const playlistEnd$1 = function(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  65012. if (!playlist || !playlist.segments) {
  65013. return null;
  65014. }
  65015. if (playlist.endList) {
  65016. return duration$1(playlist);
  65017. }
  65018. if (expired === null) {
  65019. return null;
  65020. }
  65021. expired = expired || 0;
  65022. let lastSegmentEndTime = intervalDuration$1(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  65023. if (useSafeLiveEnd) {
  65024. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay$1(null, playlist);
  65025. lastSegmentEndTime -= liveEdgePadding;
  65026. }
  65027. return Math.max(0, lastSegmentEndTime);
  65028. };
  65029. const seekable$1 = function(playlist, expired, liveEdgePadding) {
  65030. const useSafeLiveEnd = true;
  65031. const seekableStart = expired || 0;
  65032. const seekableEnd = playlistEnd$1(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  65033. if (seekableEnd === null) {
  65034. return createTimeRanges$2();
  65035. }
  65036. return createTimeRanges$2(seekableStart, seekableEnd);
  65037. };
  65038. const getMediaInfoForTime$1 = function({
  65039. playlist,
  65040. currentTime,
  65041. startingSegmentIndex,
  65042. startingPartIndex,
  65043. startTime,
  65044. exactManifestTimings
  65045. }) {
  65046. let time = currentTime - startTime;
  65047. const partsAndSegments = getPartsAndSegments$1(playlist);
  65048. let startIndex = 0;
  65049. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  65050. const partAndSegment = partsAndSegments[i2];
  65051. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  65052. continue;
  65053. }
  65054. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  65055. continue;
  65056. }
  65057. startIndex = i2;
  65058. break;
  65059. }
  65060. if (time < 0) {
  65061. if (startIndex > 0) {
  65062. for (let i2 = startIndex - 1; i2 >= 0; i2--) {
  65063. const partAndSegment = partsAndSegments[i2];
  65064. time += partAndSegment.duration;
  65065. if (exactManifestTimings) {
  65066. if (time < 0) {
  65067. continue;
  65068. }
  65069. } else if (time + TIME_FUDGE_FACTOR$1 <= 0) {
  65070. continue;
  65071. }
  65072. return {
  65073. partIndex: partAndSegment.partIndex,
  65074. segmentIndex: partAndSegment.segmentIndex,
  65075. startTime: startTime - sumDurations$1({
  65076. defaultDuration: playlist.targetDuration,
  65077. durationList: partsAndSegments,
  65078. startIndex,
  65079. endIndex: i2
  65080. })
  65081. };
  65082. }
  65083. }
  65084. return {
  65085. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65086. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65087. startTime: currentTime
  65088. };
  65089. }
  65090. if (startIndex < 0) {
  65091. for (let i2 = startIndex; i2 < 0; i2++) {
  65092. time -= playlist.targetDuration;
  65093. if (time < 0) {
  65094. return {
  65095. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65096. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65097. startTime: currentTime
  65098. };
  65099. }
  65100. }
  65101. startIndex = 0;
  65102. }
  65103. for (let i2 = startIndex; i2 < partsAndSegments.length; i2++) {
  65104. const partAndSegment = partsAndSegments[i2];
  65105. time -= partAndSegment.duration;
  65106. if (exactManifestTimings) {
  65107. if (time > 0) {
  65108. continue;
  65109. }
  65110. } else if (time - TIME_FUDGE_FACTOR$1 >= 0) {
  65111. continue;
  65112. }
  65113. return {
  65114. partIndex: partAndSegment.partIndex,
  65115. segmentIndex: partAndSegment.segmentIndex,
  65116. startTime: startTime + sumDurations$1({
  65117. defaultDuration: playlist.targetDuration,
  65118. durationList: partsAndSegments,
  65119. startIndex,
  65120. endIndex: i2
  65121. })
  65122. };
  65123. }
  65124. return {
  65125. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  65126. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  65127. startTime: currentTime
  65128. };
  65129. };
  65130. const isExcluded = function(playlist) {
  65131. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  65132. };
  65133. const isIncompatible$1 = function(playlist) {
  65134. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  65135. };
  65136. const isEnabled$1 = function(playlist) {
  65137. const excluded = isExcluded(playlist);
  65138. return !playlist.disabled && !excluded;
  65139. };
  65140. const isDisabled$1 = function(playlist) {
  65141. return playlist.disabled;
  65142. };
  65143. const isAes$1 = function(media) {
  65144. for (let i2 = 0; i2 < media.segments.length; i2++) {
  65145. if (media.segments[i2].key) {
  65146. return true;
  65147. }
  65148. }
  65149. return false;
  65150. };
  65151. const hasAttribute$1 = function(attr, playlist) {
  65152. return playlist.attributes && playlist.attributes[attr];
  65153. };
  65154. const estimateSegmentRequestTime$1 = function(segmentDuration, bandwidth2, playlist, bytesReceived = 0) {
  65155. if (!hasAttribute$1("BANDWIDTH", playlist)) {
  65156. return NaN;
  65157. }
  65158. const size = segmentDuration * playlist.attributes.BANDWIDTH;
  65159. return (size - bytesReceived * 8) / bandwidth2;
  65160. };
  65161. const isLowestEnabledRendition$1 = (main, media) => {
  65162. if (main.playlists.length === 1) {
  65163. return true;
  65164. }
  65165. const currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  65166. return main.playlists.filter((playlist) => {
  65167. if (!isEnabled$1(playlist)) {
  65168. return false;
  65169. }
  65170. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  65171. }).length === 0;
  65172. };
  65173. const playlistMatch$1 = (a, b) => {
  65174. if (!a && !b || !a && b || a && !b) {
  65175. return false;
  65176. }
  65177. if (a === b) {
  65178. return true;
  65179. }
  65180. if (a.id && b.id && a.id === b.id) {
  65181. return true;
  65182. }
  65183. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  65184. return true;
  65185. }
  65186. if (a.uri && b.uri && a.uri === b.uri) {
  65187. return true;
  65188. }
  65189. return false;
  65190. };
  65191. const someAudioVariant$1 = function(main, callback2) {
  65192. const AUDIO5 = main && main.mediaGroups && main.mediaGroups.AUDIO || {};
  65193. let found = false;
  65194. for (const groupName in AUDIO5) {
  65195. for (const label in AUDIO5[groupName]) {
  65196. found = callback2(AUDIO5[groupName][label]);
  65197. if (found) {
  65198. break;
  65199. }
  65200. }
  65201. if (found) {
  65202. break;
  65203. }
  65204. }
  65205. return !!found;
  65206. };
  65207. const isAudioOnly$1 = (main) => {
  65208. if (!main || !main.playlists || !main.playlists.length) {
  65209. const found = someAudioVariant$1(main, (variant) => variant.playlists && variant.playlists.length || variant.uri);
  65210. return found;
  65211. }
  65212. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65213. const playlist = main.playlists[i2];
  65214. const CODECS = playlist.attributes && playlist.attributes.CODECS;
  65215. if (CODECS && CODECS.split(",").every((c) => isAudioCodec$1(c))) {
  65216. continue;
  65217. }
  65218. const found = someAudioVariant$1(main, (variant) => playlistMatch$1(playlist, variant));
  65219. if (found) {
  65220. continue;
  65221. }
  65222. return false;
  65223. }
  65224. return true;
  65225. };
  65226. var Playlist$1 = {
  65227. liveEdgeDelay: liveEdgeDelay$1,
  65228. duration: duration$1,
  65229. seekable: seekable$1,
  65230. getMediaInfoForTime: getMediaInfoForTime$1,
  65231. isEnabled: isEnabled$1,
  65232. isDisabled: isDisabled$1,
  65233. isExcluded,
  65234. isIncompatible: isIncompatible$1,
  65235. playlistEnd: playlistEnd$1,
  65236. isAes: isAes$1,
  65237. hasAttribute: hasAttribute$1,
  65238. estimateSegmentRequestTime: estimateSegmentRequestTime$1,
  65239. isLowestEnabledRendition: isLowestEnabledRendition$1,
  65240. isAudioOnly: isAudioOnly$1,
  65241. playlistMatch: playlistMatch$1,
  65242. segmentDurationWithParts: segmentDurationWithParts$1
  65243. };
  65244. const {
  65245. log: log$2
  65246. } = videojs$2;
  65247. const createPlaylistID$1 = (index2, uri) => {
  65248. return `${index2}-${uri}`;
  65249. };
  65250. const groupID$1 = (type2, group, label) => {
  65251. return `placeholder-uri-${type2}-${group}-${label}`;
  65252. };
  65253. const parseManifest$1 = ({
  65254. onwarn,
  65255. oninfo,
  65256. manifestString,
  65257. customTagParsers = [],
  65258. customTagMappers = [],
  65259. llhls
  65260. }) => {
  65261. const parser2 = new Parser$1();
  65262. if (onwarn) {
  65263. parser2.on("warn", onwarn);
  65264. }
  65265. if (oninfo) {
  65266. parser2.on("info", oninfo);
  65267. }
  65268. customTagParsers.forEach((customParser) => parser2.addParser(customParser));
  65269. customTagMappers.forEach((mapper) => parser2.addTagMapper(mapper));
  65270. parser2.push(manifestString);
  65271. parser2.end();
  65272. const manifest = parser2.manifest;
  65273. if (!llhls) {
  65274. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  65275. if (manifest.hasOwnProperty(k)) {
  65276. delete manifest[k];
  65277. }
  65278. });
  65279. if (manifest.segments) {
  65280. manifest.segments.forEach(function(segment) {
  65281. ["parts", "preloadHints"].forEach(function(k) {
  65282. if (segment.hasOwnProperty(k)) {
  65283. delete segment[k];
  65284. }
  65285. });
  65286. });
  65287. }
  65288. }
  65289. if (!manifest.targetDuration) {
  65290. let targetDuration = 10;
  65291. if (manifest.segments && manifest.segments.length) {
  65292. targetDuration = manifest.segments.reduce((acc, s) => Math.max(acc, s.duration), 0);
  65293. }
  65294. if (onwarn) {
  65295. onwarn(`manifest has no targetDuration defaulting to ${targetDuration}`);
  65296. }
  65297. manifest.targetDuration = targetDuration;
  65298. }
  65299. const parts = getLastParts$1(manifest);
  65300. if (parts.length && !manifest.partTargetDuration) {
  65301. const partTargetDuration = parts.reduce((acc, p) => Math.max(acc, p.duration), 0);
  65302. if (onwarn) {
  65303. onwarn(`manifest has no partTargetDuration defaulting to ${partTargetDuration}`);
  65304. log$2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  65305. }
  65306. manifest.partTargetDuration = partTargetDuration;
  65307. }
  65308. return manifest;
  65309. };
  65310. const forEachMediaGroup$2 = (main, callback2) => {
  65311. if (!main.mediaGroups) {
  65312. return;
  65313. }
  65314. ["AUDIO", "SUBTITLES"].forEach((mediaType) => {
  65315. if (!main.mediaGroups[mediaType]) {
  65316. return;
  65317. }
  65318. for (const groupKey in main.mediaGroups[mediaType]) {
  65319. for (const labelKey in main.mediaGroups[mediaType][groupKey]) {
  65320. const mediaProperties = main.mediaGroups[mediaType][groupKey][labelKey];
  65321. callback2(mediaProperties, mediaType, groupKey, labelKey);
  65322. }
  65323. }
  65324. });
  65325. };
  65326. const setupMediaPlaylist$1 = ({
  65327. playlist,
  65328. uri,
  65329. id
  65330. }) => {
  65331. playlist.id = id;
  65332. playlist.playlistErrors_ = 0;
  65333. if (uri) {
  65334. playlist.uri = uri;
  65335. }
  65336. playlist.attributes = playlist.attributes || {};
  65337. };
  65338. const setupMediaPlaylists$1 = (main) => {
  65339. let i2 = main.playlists.length;
  65340. while (i2--) {
  65341. const playlist = main.playlists[i2];
  65342. setupMediaPlaylist$1({
  65343. playlist,
  65344. id: createPlaylistID$1(i2, playlist.uri)
  65345. });
  65346. playlist.resolvedUri = resolveUrl$2(main.uri, playlist.uri);
  65347. main.playlists[playlist.id] = playlist;
  65348. main.playlists[playlist.uri] = playlist;
  65349. if (!playlist.attributes.BANDWIDTH) {
  65350. log$2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  65351. }
  65352. }
  65353. };
  65354. const resolveMediaGroupUris$1 = (main) => {
  65355. forEachMediaGroup$2(main, (properties) => {
  65356. if (properties.uri) {
  65357. properties.resolvedUri = resolveUrl$2(main.uri, properties.uri);
  65358. }
  65359. });
  65360. };
  65361. const mainForMedia = (media, uri) => {
  65362. const id = createPlaylistID$1(0, uri);
  65363. const main = {
  65364. mediaGroups: {
  65365. "AUDIO": {},
  65366. "VIDEO": {},
  65367. "CLOSED-CAPTIONS": {},
  65368. "SUBTITLES": {}
  65369. },
  65370. uri: window_1.location.href,
  65371. resolvedUri: window_1.location.href,
  65372. playlists: [{
  65373. uri,
  65374. id,
  65375. resolvedUri: uri,
  65376. attributes: {}
  65377. }]
  65378. };
  65379. main.playlists[id] = main.playlists[0];
  65380. main.playlists[uri] = main.playlists[0];
  65381. return main;
  65382. };
  65383. const addPropertiesToMain = (main, uri, createGroupID = groupID$1) => {
  65384. main.uri = uri;
  65385. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65386. if (!main.playlists[i2].uri) {
  65387. const phonyUri = `placeholder-uri-${i2}`;
  65388. main.playlists[i2].uri = phonyUri;
  65389. }
  65390. }
  65391. const audioOnlyMain = isAudioOnly$1(main);
  65392. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65393. if (!properties.playlists || !properties.playlists.length) {
  65394. if (audioOnlyMain && mediaType === "AUDIO" && !properties.uri) {
  65395. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65396. const p = main.playlists[i2];
  65397. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  65398. return;
  65399. }
  65400. }
  65401. }
  65402. properties.playlists = [_extends$2({}, properties)];
  65403. }
  65404. properties.playlists.forEach(function(p, i2) {
  65405. const groupId = createGroupID(mediaType, groupKey, labelKey, p);
  65406. const id = createPlaylistID$1(i2, groupId);
  65407. if (p.uri) {
  65408. p.resolvedUri = p.resolvedUri || resolveUrl$2(main.uri, p.uri);
  65409. } else {
  65410. p.uri = i2 === 0 ? groupId : id;
  65411. p.resolvedUri = p.uri;
  65412. }
  65413. p.id = p.id || id;
  65414. p.attributes = p.attributes || {};
  65415. main.playlists[p.id] = p;
  65416. main.playlists[p.uri] = p;
  65417. });
  65418. });
  65419. setupMediaPlaylists$1(main);
  65420. resolveMediaGroupUris$1(main);
  65421. };
  65422. const {
  65423. EventTarget: EventTarget$1$1
  65424. } = videojs$2;
  65425. const addLLHLSQueryDirectives$1 = (uri, media) => {
  65426. if (media.endList || !media.serverControl) {
  65427. return uri;
  65428. }
  65429. const parameters = {};
  65430. if (media.serverControl.canBlockReload) {
  65431. const {
  65432. preloadSegment
  65433. } = media;
  65434. let nextMSN = media.mediaSequence + media.segments.length;
  65435. if (preloadSegment) {
  65436. const parts = preloadSegment.parts || [];
  65437. const nextPart = getKnownPartCount$1(media) - 1;
  65438. if (nextPart > -1 && nextPart !== parts.length - 1) {
  65439. parameters._HLS_part = nextPart;
  65440. }
  65441. if (nextPart > -1 || parts.length) {
  65442. nextMSN--;
  65443. }
  65444. }
  65445. parameters._HLS_msn = nextMSN;
  65446. }
  65447. if (media.serverControl && media.serverControl.canSkipUntil) {
  65448. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  65449. }
  65450. if (Object.keys(parameters).length) {
  65451. const parsedUri = new window_1.URL(uri);
  65452. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  65453. if (!parameters.hasOwnProperty(name)) {
  65454. return;
  65455. }
  65456. parsedUri.searchParams.set(name, parameters[name]);
  65457. });
  65458. uri = parsedUri.toString();
  65459. }
  65460. return uri;
  65461. };
  65462. const updateSegment$1 = (a, b) => {
  65463. if (!a) {
  65464. return b;
  65465. }
  65466. const result = merge$2(a, b);
  65467. if (a.preloadHints && !b.preloadHints) {
  65468. delete result.preloadHints;
  65469. }
  65470. if (a.parts && !b.parts) {
  65471. delete result.parts;
  65472. } else if (a.parts && b.parts) {
  65473. for (let i2 = 0; i2 < b.parts.length; i2++) {
  65474. if (a.parts && a.parts[i2]) {
  65475. result.parts[i2] = merge$2(a.parts[i2], b.parts[i2]);
  65476. }
  65477. }
  65478. }
  65479. if (!a.skipped && b.skipped) {
  65480. result.skipped = false;
  65481. }
  65482. if (a.preload && !b.preload) {
  65483. result.preload = false;
  65484. }
  65485. return result;
  65486. };
  65487. const updateSegments$1 = (original, update, offset) => {
  65488. const oldSegments = original.slice();
  65489. const newSegments = update.slice();
  65490. offset = offset || 0;
  65491. const result = [];
  65492. let currentMap;
  65493. for (let newIndex = 0; newIndex < newSegments.length; newIndex++) {
  65494. const oldSegment = oldSegments[newIndex + offset];
  65495. const newSegment = newSegments[newIndex];
  65496. if (oldSegment) {
  65497. currentMap = oldSegment.map || currentMap;
  65498. result.push(updateSegment$1(oldSegment, newSegment));
  65499. } else {
  65500. if (currentMap && !newSegment.map) {
  65501. newSegment.map = currentMap;
  65502. }
  65503. result.push(newSegment);
  65504. }
  65505. }
  65506. return result;
  65507. };
  65508. const resolveSegmentUris$1 = (segment, baseUri) => {
  65509. if (!segment.resolvedUri && segment.uri) {
  65510. segment.resolvedUri = resolveUrl$2(baseUri, segment.uri);
  65511. }
  65512. if (segment.key && !segment.key.resolvedUri) {
  65513. segment.key.resolvedUri = resolveUrl$2(baseUri, segment.key.uri);
  65514. }
  65515. if (segment.map && !segment.map.resolvedUri) {
  65516. segment.map.resolvedUri = resolveUrl$2(baseUri, segment.map.uri);
  65517. }
  65518. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  65519. segment.map.key.resolvedUri = resolveUrl$2(baseUri, segment.map.key.uri);
  65520. }
  65521. if (segment.parts && segment.parts.length) {
  65522. segment.parts.forEach((p) => {
  65523. if (p.resolvedUri) {
  65524. return;
  65525. }
  65526. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65527. });
  65528. }
  65529. if (segment.preloadHints && segment.preloadHints.length) {
  65530. segment.preloadHints.forEach((p) => {
  65531. if (p.resolvedUri) {
  65532. return;
  65533. }
  65534. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65535. });
  65536. }
  65537. };
  65538. const getAllSegments$1 = function(media) {
  65539. const segments = media.segments || [];
  65540. const preloadSegment = media.preloadSegment;
  65541. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  65542. if (preloadSegment.preloadHints) {
  65543. for (let i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  65544. if (preloadSegment.preloadHints[i2].type === "MAP") {
  65545. return segments;
  65546. }
  65547. }
  65548. }
  65549. preloadSegment.duration = media.targetDuration;
  65550. preloadSegment.preload = true;
  65551. segments.push(preloadSegment);
  65552. }
  65553. return segments;
  65554. };
  65555. const isPlaylistUnchanged$1 = (a, b) => a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  65556. const updateMain$1 = (main, newMedia, unchangedCheck = isPlaylistUnchanged$1) => {
  65557. const result = merge$2(main, {});
  65558. const oldMedia = result.playlists[newMedia.id];
  65559. if (!oldMedia) {
  65560. return null;
  65561. }
  65562. if (unchangedCheck(oldMedia, newMedia)) {
  65563. return null;
  65564. }
  65565. newMedia.segments = getAllSegments$1(newMedia);
  65566. const mergedPlaylist = merge$2(oldMedia, newMedia);
  65567. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  65568. delete mergedPlaylist.preloadSegment;
  65569. }
  65570. if (oldMedia.segments) {
  65571. if (newMedia.skip) {
  65572. newMedia.segments = newMedia.segments || [];
  65573. for (let i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  65574. newMedia.segments.unshift({
  65575. skipped: true
  65576. });
  65577. }
  65578. }
  65579. mergedPlaylist.segments = updateSegments$1(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  65580. }
  65581. mergedPlaylist.segments.forEach((segment) => {
  65582. resolveSegmentUris$1(segment, mergedPlaylist.resolvedUri);
  65583. });
  65584. for (let i2 = 0; i2 < result.playlists.length; i2++) {
  65585. if (result.playlists[i2].id === newMedia.id) {
  65586. result.playlists[i2] = mergedPlaylist;
  65587. }
  65588. }
  65589. result.playlists[newMedia.id] = mergedPlaylist;
  65590. result.playlists[newMedia.uri] = mergedPlaylist;
  65591. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65592. if (!properties.playlists) {
  65593. return;
  65594. }
  65595. for (let i2 = 0; i2 < properties.playlists.length; i2++) {
  65596. if (newMedia.id === properties.playlists[i2].id) {
  65597. properties.playlists[i2] = mergedPlaylist;
  65598. }
  65599. }
  65600. });
  65601. return result;
  65602. };
  65603. const refreshDelay$1 = (media, update) => {
  65604. const segments = media.segments || [];
  65605. const lastSegment = segments[segments.length - 1];
  65606. const lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  65607. const lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  65608. if (update && lastDuration) {
  65609. return lastDuration * 1e3;
  65610. }
  65611. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  65612. };
  65613. class PlaylistLoader$1 extends EventTarget$1$1 {
  65614. constructor(src, vhs, options2 = {}) {
  65615. super();
  65616. if (!src) {
  65617. throw new Error("A non-empty playlist URL or object is required");
  65618. }
  65619. this.logger_ = logger$1("PlaylistLoader");
  65620. const {
  65621. withCredentials = false
  65622. } = options2;
  65623. this.src = src;
  65624. this.vhs_ = vhs;
  65625. this.withCredentials = withCredentials;
  65626. const vhsOptions = vhs.options_;
  65627. this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  65628. this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  65629. this.llhls = vhsOptions && vhsOptions.llhls;
  65630. this.state = "HAVE_NOTHING";
  65631. this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this);
  65632. this.on("mediaupdatetimeout", this.handleMediaupdatetimeout_);
  65633. }
  65634. handleMediaupdatetimeout_() {
  65635. if (this.state !== "HAVE_METADATA") {
  65636. return;
  65637. }
  65638. const media = this.media();
  65639. let uri = resolveUrl$2(this.main.uri, media.uri);
  65640. if (this.llhls) {
  65641. uri = addLLHLSQueryDirectives$1(uri, media);
  65642. }
  65643. this.state = "HAVE_CURRENT_METADATA";
  65644. this.request = this.vhs_.xhr({
  65645. uri,
  65646. withCredentials: this.withCredentials
  65647. }, (error, req) => {
  65648. if (!this.request) {
  65649. return;
  65650. }
  65651. if (error) {
  65652. return this.playlistRequestError(this.request, this.media(), "HAVE_METADATA");
  65653. }
  65654. this.haveMetadata({
  65655. playlistString: this.request.responseText,
  65656. url: this.media().uri,
  65657. id: this.media().id
  65658. });
  65659. });
  65660. }
  65661. playlistRequestError(xhr, playlist, startingState) {
  65662. const {
  65663. uri,
  65664. id
  65665. } = playlist;
  65666. this.request = null;
  65667. if (startingState) {
  65668. this.state = startingState;
  65669. }
  65670. this.error = {
  65671. playlist: this.main.playlists[id],
  65672. status: xhr.status,
  65673. message: `HLS playlist request error at URL: ${uri}.`,
  65674. responseText: xhr.responseText,
  65675. code: xhr.status >= 500 ? 4 : 2
  65676. };
  65677. this.trigger("error");
  65678. }
  65679. parseManifest_({
  65680. url,
  65681. manifestString
  65682. }) {
  65683. return parseManifest$1({
  65684. onwarn: ({
  65685. message
  65686. }) => this.logger_(`m3u8-parser warn for ${url}: ${message}`),
  65687. oninfo: ({
  65688. message
  65689. }) => this.logger_(`m3u8-parser info for ${url}: ${message}`),
  65690. manifestString,
  65691. customTagParsers: this.customTagParsers,
  65692. customTagMappers: this.customTagMappers,
  65693. llhls: this.llhls
  65694. });
  65695. }
  65696. haveMetadata({
  65697. playlistString,
  65698. playlistObject,
  65699. url,
  65700. id
  65701. }) {
  65702. this.request = null;
  65703. this.state = "HAVE_METADATA";
  65704. const playlist = playlistObject || this.parseManifest_({
  65705. url,
  65706. manifestString: playlistString
  65707. });
  65708. playlist.lastRequest = Date.now();
  65709. setupMediaPlaylist$1({
  65710. playlist,
  65711. uri: url,
  65712. id
  65713. });
  65714. const update = updateMain$1(this.main, playlist);
  65715. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  65716. this.pendingMedia_ = null;
  65717. if (update) {
  65718. this.main = update;
  65719. this.media_ = this.main.playlists[id];
  65720. } else {
  65721. this.trigger("playlistunchanged");
  65722. }
  65723. this.updateMediaUpdateTimeout_(refreshDelay$1(this.media(), !!update));
  65724. this.trigger("loadedplaylist");
  65725. }
  65726. dispose() {
  65727. this.trigger("dispose");
  65728. this.stopRequest();
  65729. window_1.clearTimeout(this.mediaUpdateTimeout);
  65730. window_1.clearTimeout(this.finalRenditionTimeout);
  65731. this.off();
  65732. }
  65733. stopRequest() {
  65734. if (this.request) {
  65735. const oldRequest = this.request;
  65736. this.request = null;
  65737. oldRequest.onreadystatechange = null;
  65738. oldRequest.abort();
  65739. }
  65740. }
  65741. media(playlist, shouldDelay) {
  65742. if (!playlist) {
  65743. return this.media_;
  65744. }
  65745. if (this.state === "HAVE_NOTHING") {
  65746. throw new Error("Cannot switch media playlist from " + this.state);
  65747. }
  65748. if (typeof playlist === "string") {
  65749. if (!this.main.playlists[playlist]) {
  65750. throw new Error("Unknown playlist URI: " + playlist);
  65751. }
  65752. playlist = this.main.playlists[playlist];
  65753. }
  65754. window_1.clearTimeout(this.finalRenditionTimeout);
  65755. if (shouldDelay) {
  65756. const delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  65757. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  65758. return;
  65759. }
  65760. const startingState = this.state;
  65761. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  65762. const mainPlaylistRef = this.main.playlists[playlist.id];
  65763. if (mainPlaylistRef && mainPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  65764. if (this.request) {
  65765. this.request.onreadystatechange = null;
  65766. this.request.abort();
  65767. this.request = null;
  65768. }
  65769. this.state = "HAVE_METADATA";
  65770. this.media_ = playlist;
  65771. if (mediaChange) {
  65772. this.trigger("mediachanging");
  65773. if (startingState === "HAVE_MAIN_MANIFEST") {
  65774. this.trigger("loadedmetadata");
  65775. } else {
  65776. this.trigger("mediachange");
  65777. }
  65778. }
  65779. return;
  65780. }
  65781. this.updateMediaUpdateTimeout_(refreshDelay$1(playlist, true));
  65782. if (!mediaChange) {
  65783. return;
  65784. }
  65785. this.state = "SWITCHING_MEDIA";
  65786. if (this.request) {
  65787. if (playlist.resolvedUri === this.request.url) {
  65788. return;
  65789. }
  65790. this.request.onreadystatechange = null;
  65791. this.request.abort();
  65792. this.request = null;
  65793. }
  65794. if (this.media_) {
  65795. this.trigger("mediachanging");
  65796. }
  65797. this.pendingMedia_ = playlist;
  65798. this.request = this.vhs_.xhr({
  65799. uri: playlist.resolvedUri,
  65800. withCredentials: this.withCredentials
  65801. }, (error, req) => {
  65802. if (!this.request) {
  65803. return;
  65804. }
  65805. playlist.lastRequest = Date.now();
  65806. playlist.resolvedUri = resolveManifestRedirect$1(playlist.resolvedUri, req);
  65807. if (error) {
  65808. return this.playlistRequestError(this.request, playlist, startingState);
  65809. }
  65810. this.haveMetadata({
  65811. playlistString: req.responseText,
  65812. url: playlist.uri,
  65813. id: playlist.id
  65814. });
  65815. if (startingState === "HAVE_MAIN_MANIFEST") {
  65816. this.trigger("loadedmetadata");
  65817. } else {
  65818. this.trigger("mediachange");
  65819. }
  65820. });
  65821. }
  65822. pause() {
  65823. if (this.mediaUpdateTimeout) {
  65824. window_1.clearTimeout(this.mediaUpdateTimeout);
  65825. this.mediaUpdateTimeout = null;
  65826. }
  65827. this.stopRequest();
  65828. if (this.state === "HAVE_NOTHING") {
  65829. this.started = false;
  65830. }
  65831. if (this.state === "SWITCHING_MEDIA") {
  65832. if (this.media_) {
  65833. this.state = "HAVE_METADATA";
  65834. } else {
  65835. this.state = "HAVE_MAIN_MANIFEST";
  65836. }
  65837. } else if (this.state === "HAVE_CURRENT_METADATA") {
  65838. this.state = "HAVE_METADATA";
  65839. }
  65840. }
  65841. load(shouldDelay) {
  65842. if (this.mediaUpdateTimeout) {
  65843. window_1.clearTimeout(this.mediaUpdateTimeout);
  65844. this.mediaUpdateTimeout = null;
  65845. }
  65846. const media = this.media();
  65847. if (shouldDelay) {
  65848. const delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  65849. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65850. this.mediaUpdateTimeout = null;
  65851. this.load();
  65852. }, delay);
  65853. return;
  65854. }
  65855. if (!this.started) {
  65856. this.start();
  65857. return;
  65858. }
  65859. if (media && !media.endList) {
  65860. this.trigger("mediaupdatetimeout");
  65861. } else {
  65862. this.trigger("loadedplaylist");
  65863. }
  65864. }
  65865. updateMediaUpdateTimeout_(delay) {
  65866. if (this.mediaUpdateTimeout) {
  65867. window_1.clearTimeout(this.mediaUpdateTimeout);
  65868. this.mediaUpdateTimeout = null;
  65869. }
  65870. if (!this.media() || this.media().endList) {
  65871. return;
  65872. }
  65873. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65874. this.mediaUpdateTimeout = null;
  65875. this.trigger("mediaupdatetimeout");
  65876. this.updateMediaUpdateTimeout_(delay);
  65877. }, delay);
  65878. }
  65879. start() {
  65880. this.started = true;
  65881. if (typeof this.src === "object") {
  65882. if (!this.src.uri) {
  65883. this.src.uri = window_1.location.href;
  65884. }
  65885. this.src.resolvedUri = this.src.uri;
  65886. setTimeout(() => {
  65887. this.setupInitialPlaylist(this.src);
  65888. }, 0);
  65889. return;
  65890. }
  65891. this.request = this.vhs_.xhr({
  65892. uri: this.src,
  65893. withCredentials: this.withCredentials
  65894. }, (error, req) => {
  65895. if (!this.request) {
  65896. return;
  65897. }
  65898. this.request = null;
  65899. if (error) {
  65900. this.error = {
  65901. status: req.status,
  65902. message: `HLS playlist request error at URL: ${this.src}.`,
  65903. responseText: req.responseText,
  65904. code: 2
  65905. };
  65906. if (this.state === "HAVE_NOTHING") {
  65907. this.started = false;
  65908. }
  65909. return this.trigger("error");
  65910. }
  65911. this.src = resolveManifestRedirect$1(this.src, req);
  65912. const manifest = this.parseManifest_({
  65913. manifestString: req.responseText,
  65914. url: this.src
  65915. });
  65916. this.setupInitialPlaylist(manifest);
  65917. });
  65918. }
  65919. srcUri() {
  65920. return typeof this.src === "string" ? this.src : this.src.uri;
  65921. }
  65922. setupInitialPlaylist(manifest) {
  65923. this.state = "HAVE_MAIN_MANIFEST";
  65924. if (manifest.playlists) {
  65925. this.main = manifest;
  65926. addPropertiesToMain(this.main, this.srcUri());
  65927. manifest.playlists.forEach((playlist) => {
  65928. playlist.segments = getAllSegments$1(playlist);
  65929. playlist.segments.forEach((segment) => {
  65930. resolveSegmentUris$1(segment, playlist.resolvedUri);
  65931. });
  65932. });
  65933. this.trigger("loadedplaylist");
  65934. if (!this.request) {
  65935. this.media(this.main.playlists[0]);
  65936. }
  65937. return;
  65938. }
  65939. const uri = this.srcUri() || window_1.location.href;
  65940. this.main = mainForMedia(manifest, uri);
  65941. this.haveMetadata({
  65942. playlistObject: manifest,
  65943. url: uri,
  65944. id: this.main.playlists[0].id
  65945. });
  65946. this.trigger("loadedmetadata");
  65947. }
  65948. }
  65949. const {
  65950. xhr: videojsXHR$1
  65951. } = videojs$2;
  65952. const callbackWrapper$1 = function(request, error, response, callback2) {
  65953. const reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  65954. if (!error && reqResponse) {
  65955. request.responseTime = Date.now();
  65956. request.roundTripTime = request.responseTime - request.requestTime;
  65957. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  65958. if (!request.bandwidth) {
  65959. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  65960. }
  65961. }
  65962. if (response.headers) {
  65963. request.responseHeaders = response.headers;
  65964. }
  65965. if (error && error.code === "ETIMEDOUT") {
  65966. request.timedout = true;
  65967. }
  65968. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  65969. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  65970. }
  65971. callback2(error, request);
  65972. };
  65973. const xhrFactory$1 = function() {
  65974. const xhr = function XhrFunction(options2, callback2) {
  65975. options2 = merge$2({
  65976. timeout: 45e3
  65977. }, options2);
  65978. const beforeRequest = XhrFunction.beforeRequest || videojs$2.Vhs.xhr.beforeRequest;
  65979. if (beforeRequest && typeof beforeRequest === "function") {
  65980. const newOptions = beforeRequest(options2);
  65981. if (newOptions) {
  65982. options2 = newOptions;
  65983. }
  65984. }
  65985. const xhrMethod = videojs$2.Vhs.xhr.original === true ? videojsXHR$1 : videojs$2.Vhs.xhr;
  65986. const request = xhrMethod(options2, function(error, response) {
  65987. return callbackWrapper$1(request, error, response, callback2);
  65988. });
  65989. const originalAbort = request.abort;
  65990. request.abort = function() {
  65991. request.aborted = true;
  65992. return originalAbort.apply(request, arguments);
  65993. };
  65994. request.uri = options2.uri;
  65995. request.requestTime = Date.now();
  65996. return request;
  65997. };
  65998. xhr.original = true;
  65999. return xhr;
  66000. };
  66001. const byterangeStr$1 = function(byterange) {
  66002. let byterangeEnd;
  66003. const byterangeStart = byterange.offset;
  66004. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  66005. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  66006. } else {
  66007. byterangeEnd = byterange.offset + byterange.length - 1;
  66008. }
  66009. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  66010. };
  66011. const segmentXhrHeaders$1 = function(segment) {
  66012. const headers = {};
  66013. if (segment.byterange) {
  66014. headers.Range = byterangeStr$1(segment.byterange);
  66015. }
  66016. return headers;
  66017. };
  66018. const textRange$1 = function(range3, i2) {
  66019. return range3.start(i2) + "-" + range3.end(i2);
  66020. };
  66021. const formatHexString$1 = function(e, i2) {
  66022. const value = e.toString(16);
  66023. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  66024. };
  66025. const formatAsciiString$1 = function(e) {
  66026. if (e >= 32 && e < 126) {
  66027. return String.fromCharCode(e);
  66028. }
  66029. return ".";
  66030. };
  66031. const createTransferableMessage$1 = function(message) {
  66032. const transferable = {};
  66033. Object.keys(message).forEach((key) => {
  66034. const value = message[key];
  66035. if (isArrayBufferView$1(value)) {
  66036. transferable[key] = {
  66037. bytes: value.buffer,
  66038. byteOffset: value.byteOffset,
  66039. byteLength: value.byteLength
  66040. };
  66041. } else {
  66042. transferable[key] = value;
  66043. }
  66044. });
  66045. return transferable;
  66046. };
  66047. const initSegmentId$1 = function(initSegment) {
  66048. const byterange = initSegment.byterange || {
  66049. length: Infinity,
  66050. offset: 0
  66051. };
  66052. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  66053. };
  66054. const segmentKeyId$1 = function(key) {
  66055. return key.resolvedUri;
  66056. };
  66057. const hexDump$1 = (data) => {
  66058. const bytes = Array.prototype.slice.call(data);
  66059. const step = 16;
  66060. let result = "";
  66061. let hex;
  66062. let ascii;
  66063. for (let j = 0; j < bytes.length / step; j++) {
  66064. hex = bytes.slice(j * step, j * step + step).map(formatHexString$1).join("");
  66065. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString$1).join("");
  66066. result += hex + " " + ascii + "\n";
  66067. }
  66068. return result;
  66069. };
  66070. const tagDump$1 = ({
  66071. bytes
  66072. }) => hexDump$1(bytes);
  66073. const textRanges$1 = (ranges) => {
  66074. let result = "";
  66075. let i2;
  66076. for (i2 = 0; i2 < ranges.length; i2++) {
  66077. result += textRange$1(ranges, i2) + " ";
  66078. }
  66079. return result;
  66080. };
  66081. var utils$1 = /* @__PURE__ */ Object.freeze({
  66082. __proto__: null,
  66083. createTransferableMessage: createTransferableMessage$1,
  66084. initSegmentId: initSegmentId$1,
  66085. segmentKeyId: segmentKeyId$1,
  66086. hexDump: hexDump$1,
  66087. tagDump: tagDump$1,
  66088. textRanges: textRanges$1
  66089. });
  66090. const SEGMENT_END_FUDGE_PERCENT$1 = 0.25;
  66091. const playerTimeToProgramTime$1 = (playerTime, segment) => {
  66092. if (!segment.dateTimeObject) {
  66093. return null;
  66094. }
  66095. const transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  66096. const transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  66097. const startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  66098. const offsetFromSegmentStart = playerTime - startOfSegment;
  66099. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  66100. };
  66101. const originalSegmentVideoDuration$1 = (videoTimingInfo) => {
  66102. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  66103. };
  66104. const findSegmentForProgramTime$1 = (programTime, playlist) => {
  66105. let dateTimeObject;
  66106. try {
  66107. dateTimeObject = new Date(programTime);
  66108. } catch (e) {
  66109. return null;
  66110. }
  66111. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66112. return null;
  66113. }
  66114. let segment = playlist.segments[0];
  66115. if (dateTimeObject < segment.dateTimeObject) {
  66116. return null;
  66117. }
  66118. for (let i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  66119. segment = playlist.segments[i2];
  66120. const nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  66121. if (dateTimeObject < nextSegmentStart) {
  66122. break;
  66123. }
  66124. }
  66125. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66126. const lastSegmentStart = lastSegment.dateTimeObject;
  66127. const lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration$1(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1;
  66128. const lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  66129. if (dateTimeObject > lastSegmentEnd) {
  66130. return null;
  66131. }
  66132. if (dateTimeObject > lastSegmentStart) {
  66133. segment = lastSegment;
  66134. }
  66135. return {
  66136. segment,
  66137. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist$1.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  66138. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66139. };
  66140. };
  66141. const findSegmentForPlayerTime$1 = (time, playlist) => {
  66142. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66143. return null;
  66144. }
  66145. let segmentEnd = 0;
  66146. let segment;
  66147. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66148. segment = playlist.segments[i2];
  66149. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  66150. if (time <= segmentEnd) {
  66151. break;
  66152. }
  66153. }
  66154. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66155. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  66156. return null;
  66157. }
  66158. if (time > segmentEnd) {
  66159. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1) {
  66160. return null;
  66161. }
  66162. segment = lastSegment;
  66163. }
  66164. return {
  66165. segment,
  66166. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  66167. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66168. };
  66169. };
  66170. const getOffsetFromTimestamp$1 = (comparisonTimeStamp, programTime) => {
  66171. let segmentDateTime;
  66172. let programDateTime;
  66173. try {
  66174. segmentDateTime = new Date(comparisonTimeStamp);
  66175. programDateTime = new Date(programTime);
  66176. } catch (e) {
  66177. }
  66178. const segmentTimeEpoch = segmentDateTime.getTime();
  66179. const programTimeEpoch = programDateTime.getTime();
  66180. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  66181. };
  66182. const verifyProgramDateTimeTags$1 = (playlist) => {
  66183. if (!playlist.segments || playlist.segments.length === 0) {
  66184. return false;
  66185. }
  66186. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66187. const segment = playlist.segments[i2];
  66188. if (!segment.dateTimeObject) {
  66189. return false;
  66190. }
  66191. }
  66192. return true;
  66193. };
  66194. const getProgramTime$1 = ({
  66195. playlist,
  66196. time = void 0,
  66197. callback: callback2
  66198. }) => {
  66199. if (!callback2) {
  66200. throw new Error("getProgramTime: callback must be provided");
  66201. }
  66202. if (!playlist || time === void 0) {
  66203. return callback2({
  66204. message: "getProgramTime: playlist and time must be provided"
  66205. });
  66206. }
  66207. const matchedSegment = findSegmentForPlayerTime$1(time, playlist);
  66208. if (!matchedSegment) {
  66209. return callback2({
  66210. message: "valid programTime was not found"
  66211. });
  66212. }
  66213. if (matchedSegment.type === "estimate") {
  66214. return callback2({
  66215. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  66216. seekTime: matchedSegment.estimatedStart
  66217. });
  66218. }
  66219. const programTimeObject = {
  66220. mediaSeconds: time
  66221. };
  66222. const programTime = playerTimeToProgramTime$1(time, matchedSegment.segment);
  66223. if (programTime) {
  66224. programTimeObject.programDateTime = programTime.toISOString();
  66225. }
  66226. return callback2(null, programTimeObject);
  66227. };
  66228. const seekToProgramTime$1 = ({
  66229. programTime,
  66230. playlist,
  66231. retryCount = 2,
  66232. seekTo,
  66233. pauseAfterSeek = true,
  66234. tech,
  66235. callback: callback2
  66236. }) => {
  66237. if (!callback2) {
  66238. throw new Error("seekToProgramTime: callback must be provided");
  66239. }
  66240. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  66241. return callback2({
  66242. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  66243. });
  66244. }
  66245. if (!playlist.endList && !tech.hasStarted_) {
  66246. return callback2({
  66247. message: "player must be playing a live stream to start buffering"
  66248. });
  66249. }
  66250. if (!verifyProgramDateTimeTags$1(playlist)) {
  66251. return callback2({
  66252. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  66253. });
  66254. }
  66255. const matchedSegment = findSegmentForProgramTime$1(programTime, playlist);
  66256. if (!matchedSegment) {
  66257. return callback2({
  66258. message: `${programTime} was not found in the stream`
  66259. });
  66260. }
  66261. const segment = matchedSegment.segment;
  66262. const mediaOffset = getOffsetFromTimestamp$1(segment.dateTimeObject, programTime);
  66263. if (matchedSegment.type === "estimate") {
  66264. if (retryCount === 0) {
  66265. return callback2({
  66266. message: `${programTime} is not buffered yet. Try again`
  66267. });
  66268. }
  66269. seekTo(matchedSegment.estimatedStart + mediaOffset);
  66270. tech.one("seeked", () => {
  66271. seekToProgramTime$1({
  66272. programTime,
  66273. playlist,
  66274. retryCount: retryCount - 1,
  66275. seekTo,
  66276. pauseAfterSeek,
  66277. tech,
  66278. callback: callback2
  66279. });
  66280. });
  66281. return;
  66282. }
  66283. const seekToTime = segment.start + mediaOffset;
  66284. const seekedCallback = () => {
  66285. return callback2(null, tech.currentTime());
  66286. };
  66287. tech.one("seeked", seekedCallback);
  66288. if (pauseAfterSeek) {
  66289. tech.pause();
  66290. }
  66291. seekTo(seekToTime);
  66292. };
  66293. const callbackOnCompleted$1 = (request, cb) => {
  66294. if (request.readyState === 4) {
  66295. return cb();
  66296. }
  66297. return;
  66298. };
  66299. const containerRequest$1 = (uri, xhr, cb) => {
  66300. let bytes = [];
  66301. let id3Offset;
  66302. let finished = false;
  66303. const endRequestAndCallback = function(err, req, type2, _bytes) {
  66304. req.abort();
  66305. finished = true;
  66306. return cb(err, req, type2, _bytes);
  66307. };
  66308. const progressListener = function(error, request2) {
  66309. if (finished) {
  66310. return;
  66311. }
  66312. if (error) {
  66313. return endRequestAndCallback(error, request2, "", bytes);
  66314. }
  66315. const newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  66316. bytes = concatTypedArrays$1(bytes, stringToBytes$1(newPart, true));
  66317. id3Offset = id3Offset || getId3Offset$1(bytes);
  66318. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  66319. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66320. }
  66321. const type2 = detectContainerForBytes$1(bytes);
  66322. if (type2 === "ts" && bytes.length < 188) {
  66323. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66324. }
  66325. if (!type2 && bytes.length < 376) {
  66326. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66327. }
  66328. return endRequestAndCallback(null, request2, type2, bytes);
  66329. };
  66330. const options2 = {
  66331. uri,
  66332. beforeSend(request2) {
  66333. request2.overrideMimeType("text/plain; charset=x-user-defined");
  66334. request2.addEventListener("progress", function({
  66335. total,
  66336. loaded
  66337. }) {
  66338. return callbackWrapper$1(request2, null, {
  66339. statusCode: request2.status
  66340. }, progressListener);
  66341. });
  66342. }
  66343. };
  66344. const request = xhr(options2, function(error, response) {
  66345. return callbackWrapper$1(request, error, response, progressListener);
  66346. });
  66347. return request;
  66348. };
  66349. const {
  66350. EventTarget: EventTarget$3
  66351. } = videojs$2;
  66352. const dashPlaylistUnchanged$1 = function(a, b) {
  66353. if (!isPlaylistUnchanged$1(a, b)) {
  66354. return false;
  66355. }
  66356. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  66357. return false;
  66358. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  66359. return false;
  66360. }
  66361. if (a.segments && !b.segments || !a.segments && b.segments) {
  66362. return false;
  66363. }
  66364. if (!a.segments && !b.segments) {
  66365. return true;
  66366. }
  66367. for (let i2 = 0; i2 < a.segments.length; i2++) {
  66368. const aSegment = a.segments[i2];
  66369. const bSegment = b.segments[i2];
  66370. if (aSegment.uri !== bSegment.uri) {
  66371. return false;
  66372. }
  66373. if (!aSegment.byterange && !bSegment.byterange) {
  66374. continue;
  66375. }
  66376. const aByterange = aSegment.byterange;
  66377. const bByterange = bSegment.byterange;
  66378. if (aByterange && !bByterange || !aByterange && bByterange) {
  66379. return false;
  66380. }
  66381. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  66382. return false;
  66383. }
  66384. }
  66385. return true;
  66386. };
  66387. const dashGroupId$1 = (type2, group, label, playlist) => {
  66388. const playlistId = playlist.attributes.NAME || label;
  66389. return `placeholder-uri-${type2}-${group}-${playlistId}`;
  66390. };
  66391. const parseMainXml = ({
  66392. mainXml,
  66393. srcUrl,
  66394. clientOffset,
  66395. sidxMapping,
  66396. previousManifest
  66397. }) => {
  66398. const manifest = parse$1(mainXml, {
  66399. manifestUri: srcUrl,
  66400. clientOffset,
  66401. sidxMapping,
  66402. previousManifest
  66403. });
  66404. addPropertiesToMain(manifest, srcUrl, dashGroupId$1);
  66405. return manifest;
  66406. };
  66407. const removeOldMediaGroupLabels$1 = (update, newMain) => {
  66408. forEachMediaGroup$2(update, (properties, type2, group, label) => {
  66409. if (!(label in newMain.mediaGroups[type2][group])) {
  66410. delete update.mediaGroups[type2][group][label];
  66411. }
  66412. });
  66413. };
  66414. const updateMain = (oldMain, newMain, sidxMapping) => {
  66415. let noChanges = true;
  66416. let update = merge$2(oldMain, {
  66417. duration: newMain.duration,
  66418. minimumUpdatePeriod: newMain.minimumUpdatePeriod,
  66419. timelineStarts: newMain.timelineStarts
  66420. });
  66421. for (let i2 = 0; i2 < newMain.playlists.length; i2++) {
  66422. const playlist = newMain.playlists[i2];
  66423. if (playlist.sidx) {
  66424. const sidxKey = generateSidxKey$1(playlist.sidx);
  66425. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  66426. addSidxSegmentsToPlaylist$1$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  66427. }
  66428. }
  66429. const playlistUpdate = updateMain$1(update, playlist, dashPlaylistUnchanged$1);
  66430. if (playlistUpdate) {
  66431. update = playlistUpdate;
  66432. noChanges = false;
  66433. }
  66434. }
  66435. forEachMediaGroup$2(newMain, (properties, type2, group, label) => {
  66436. if (properties.playlists && properties.playlists.length) {
  66437. const id = properties.playlists[0].id;
  66438. const playlistUpdate = updateMain$1(update, properties.playlists[0], dashPlaylistUnchanged$1);
  66439. if (playlistUpdate) {
  66440. update = playlistUpdate;
  66441. if (!(label in update.mediaGroups[type2][group])) {
  66442. update.mediaGroups[type2][group][label] = properties;
  66443. }
  66444. update.mediaGroups[type2][group][label].playlists[0] = update.playlists[id];
  66445. noChanges = false;
  66446. }
  66447. }
  66448. });
  66449. removeOldMediaGroupLabels$1(update, newMain);
  66450. if (newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66451. noChanges = false;
  66452. }
  66453. if (noChanges) {
  66454. return null;
  66455. }
  66456. return update;
  66457. };
  66458. const equivalentSidx$1 = (a, b) => {
  66459. const neitherMap = Boolean(!a.map && !b.map);
  66460. const equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  66461. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  66462. };
  66463. const compareSidxEntry$1 = (playlists, oldSidxMapping) => {
  66464. const newSidxMapping = {};
  66465. for (const id in playlists) {
  66466. const playlist = playlists[id];
  66467. const currentSidxInfo = playlist.sidx;
  66468. if (currentSidxInfo) {
  66469. const key = generateSidxKey$1(currentSidxInfo);
  66470. if (!oldSidxMapping[key]) {
  66471. break;
  66472. }
  66473. const savedSidxInfo = oldSidxMapping[key].sidxInfo;
  66474. if (equivalentSidx$1(savedSidxInfo, currentSidxInfo)) {
  66475. newSidxMapping[key] = oldSidxMapping[key];
  66476. }
  66477. }
  66478. }
  66479. return newSidxMapping;
  66480. };
  66481. const filterChangedSidxMappings$1 = (main, oldSidxMapping) => {
  66482. const videoSidx = compareSidxEntry$1(main.playlists, oldSidxMapping);
  66483. let mediaGroupSidx = videoSidx;
  66484. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  66485. if (properties.playlists && properties.playlists.length) {
  66486. const playlists = properties.playlists;
  66487. mediaGroupSidx = merge$2(mediaGroupSidx, compareSidxEntry$1(playlists, oldSidxMapping));
  66488. }
  66489. });
  66490. return mediaGroupSidx;
  66491. };
  66492. class DashPlaylistLoader$1 extends EventTarget$3 {
  66493. constructor(srcUrlOrPlaylist, vhs, options2 = {}, mainPlaylistLoader) {
  66494. super();
  66495. this.mainPlaylistLoader_ = mainPlaylistLoader || this;
  66496. if (!mainPlaylistLoader) {
  66497. this.isMain_ = true;
  66498. }
  66499. const {
  66500. withCredentials = false
  66501. } = options2;
  66502. this.vhs_ = vhs;
  66503. this.withCredentials = withCredentials;
  66504. if (!srcUrlOrPlaylist) {
  66505. throw new Error("A non-empty playlist URL or object is required");
  66506. }
  66507. this.on("minimumUpdatePeriod", () => {
  66508. this.refreshXml_();
  66509. });
  66510. this.on("mediaupdatetimeout", () => {
  66511. this.refreshMedia_(this.media().id);
  66512. });
  66513. this.state = "HAVE_NOTHING";
  66514. this.loadedPlaylists_ = {};
  66515. this.logger_ = logger$1("DashPlaylistLoader");
  66516. if (this.isMain_) {
  66517. this.mainPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  66518. this.mainPlaylistLoader_.sidxMapping_ = {};
  66519. } else {
  66520. this.childPlaylist_ = srcUrlOrPlaylist;
  66521. }
  66522. }
  66523. requestErrored_(err, request, startingState) {
  66524. if (!this.request) {
  66525. return true;
  66526. }
  66527. this.request = null;
  66528. if (err) {
  66529. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  66530. status: request.status,
  66531. message: "DASH request error at URL: " + request.uri,
  66532. response: request.response,
  66533. code: 2
  66534. };
  66535. if (startingState) {
  66536. this.state = startingState;
  66537. }
  66538. this.trigger("error");
  66539. return true;
  66540. }
  66541. }
  66542. addSidxSegments_(playlist, startingState, cb) {
  66543. const sidxKey = playlist.sidx && generateSidxKey$1(playlist.sidx);
  66544. if (!playlist.sidx || !sidxKey || this.mainPlaylistLoader_.sidxMapping_[sidxKey]) {
  66545. this.mediaRequest_ = window_1.setTimeout(() => cb(false), 0);
  66546. return;
  66547. }
  66548. const uri = resolveManifestRedirect$1(playlist.sidx.resolvedUri);
  66549. const fin = (err, request) => {
  66550. if (this.requestErrored_(err, request, startingState)) {
  66551. return;
  66552. }
  66553. const sidxMapping = this.mainPlaylistLoader_.sidxMapping_;
  66554. let sidx;
  66555. try {
  66556. sidx = parseSidx_1$1(toUint8$1(request.response).subarray(8));
  66557. } catch (e) {
  66558. this.requestErrored_(e, request, startingState);
  66559. return;
  66560. }
  66561. sidxMapping[sidxKey] = {
  66562. sidxInfo: playlist.sidx,
  66563. sidx
  66564. };
  66565. addSidxSegmentsToPlaylist$1$1(playlist, sidx, playlist.sidx.resolvedUri);
  66566. return cb(true);
  66567. };
  66568. this.request = containerRequest$1(uri, this.vhs_.xhr, (err, request, container, bytes) => {
  66569. if (err) {
  66570. return fin(err, request);
  66571. }
  66572. if (!container || container !== "mp4") {
  66573. return fin({
  66574. status: request.status,
  66575. message: `Unsupported ${container || "unknown"} container type for sidx segment at URL: ${uri}`,
  66576. response: "",
  66577. playlist,
  66578. internal: true,
  66579. playlistExclusionDuration: Infinity,
  66580. code: 2
  66581. }, request);
  66582. }
  66583. const {
  66584. offset,
  66585. length
  66586. } = playlist.sidx.byterange;
  66587. if (bytes.length >= length + offset) {
  66588. return fin(err, {
  66589. response: bytes.subarray(offset, offset + length),
  66590. status: request.status,
  66591. uri: request.uri
  66592. });
  66593. }
  66594. this.request = this.vhs_.xhr({
  66595. uri,
  66596. responseType: "arraybuffer",
  66597. headers: segmentXhrHeaders$1({
  66598. byterange: playlist.sidx.byterange
  66599. })
  66600. }, fin);
  66601. });
  66602. }
  66603. dispose() {
  66604. this.trigger("dispose");
  66605. this.stopRequest();
  66606. this.loadedPlaylists_ = {};
  66607. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  66608. window_1.clearTimeout(this.mediaRequest_);
  66609. window_1.clearTimeout(this.mediaUpdateTimeout);
  66610. this.mediaUpdateTimeout = null;
  66611. this.mediaRequest_ = null;
  66612. this.minimumUpdatePeriodTimeout_ = null;
  66613. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66614. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66615. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66616. }
  66617. this.off();
  66618. }
  66619. hasPendingRequest() {
  66620. return this.request || this.mediaRequest_;
  66621. }
  66622. stopRequest() {
  66623. if (this.request) {
  66624. const oldRequest = this.request;
  66625. this.request = null;
  66626. oldRequest.onreadystatechange = null;
  66627. oldRequest.abort();
  66628. }
  66629. }
  66630. media(playlist) {
  66631. if (!playlist) {
  66632. return this.media_;
  66633. }
  66634. if (this.state === "HAVE_NOTHING") {
  66635. throw new Error("Cannot switch media playlist from " + this.state);
  66636. }
  66637. const startingState = this.state;
  66638. if (typeof playlist === "string") {
  66639. if (!this.mainPlaylistLoader_.main.playlists[playlist]) {
  66640. throw new Error("Unknown playlist URI: " + playlist);
  66641. }
  66642. playlist = this.mainPlaylistLoader_.main.playlists[playlist];
  66643. }
  66644. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  66645. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  66646. this.state = "HAVE_METADATA";
  66647. this.media_ = playlist;
  66648. if (mediaChange) {
  66649. this.trigger("mediachanging");
  66650. this.trigger("mediachange");
  66651. }
  66652. return;
  66653. }
  66654. if (!mediaChange) {
  66655. return;
  66656. }
  66657. if (this.media_) {
  66658. this.trigger("mediachanging");
  66659. }
  66660. this.addSidxSegments_(playlist, startingState, (sidxChanged) => {
  66661. this.haveMetadata({
  66662. startingState,
  66663. playlist
  66664. });
  66665. });
  66666. }
  66667. haveMetadata({
  66668. startingState,
  66669. playlist
  66670. }) {
  66671. this.state = "HAVE_METADATA";
  66672. this.loadedPlaylists_[playlist.id] = playlist;
  66673. this.mediaRequest_ = null;
  66674. this.refreshMedia_(playlist.id);
  66675. if (startingState === "HAVE_MAIN_MANIFEST") {
  66676. this.trigger("loadedmetadata");
  66677. } else {
  66678. this.trigger("mediachange");
  66679. }
  66680. }
  66681. pause() {
  66682. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66683. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66684. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66685. }
  66686. this.stopRequest();
  66687. window_1.clearTimeout(this.mediaUpdateTimeout);
  66688. this.mediaUpdateTimeout = null;
  66689. if (this.isMain_) {
  66690. window_1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);
  66691. this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  66692. }
  66693. if (this.state === "HAVE_NOTHING") {
  66694. this.started = false;
  66695. }
  66696. }
  66697. load(isFinalRendition) {
  66698. window_1.clearTimeout(this.mediaUpdateTimeout);
  66699. this.mediaUpdateTimeout = null;
  66700. const media = this.media();
  66701. if (isFinalRendition) {
  66702. const delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  66703. this.mediaUpdateTimeout = window_1.setTimeout(() => this.load(), delay);
  66704. return;
  66705. }
  66706. if (!this.started) {
  66707. this.start();
  66708. return;
  66709. }
  66710. if (media && !media.endList) {
  66711. if (this.isMain_ && !this.minimumUpdatePeriodTimeout_) {
  66712. this.trigger("minimumUpdatePeriod");
  66713. this.updateMinimumUpdatePeriodTimeout_();
  66714. }
  66715. this.trigger("mediaupdatetimeout");
  66716. } else {
  66717. this.trigger("loadedplaylist");
  66718. }
  66719. }
  66720. start() {
  66721. this.started = true;
  66722. if (!this.isMain_) {
  66723. this.mediaRequest_ = window_1.setTimeout(() => this.haveMain_(), 0);
  66724. return;
  66725. }
  66726. this.requestMain_((req, mainChanged) => {
  66727. this.haveMain_();
  66728. if (!this.hasPendingRequest() && !this.media_) {
  66729. this.media(this.mainPlaylistLoader_.main.playlists[0]);
  66730. }
  66731. });
  66732. }
  66733. requestMain_(cb) {
  66734. this.request = this.vhs_.xhr({
  66735. uri: this.mainPlaylistLoader_.srcUrl,
  66736. withCredentials: this.withCredentials
  66737. }, (error, req) => {
  66738. if (this.requestErrored_(error, req)) {
  66739. if (this.state === "HAVE_NOTHING") {
  66740. this.started = false;
  66741. }
  66742. return;
  66743. }
  66744. const mainChanged = req.responseText !== this.mainPlaylistLoader_.mainXml_;
  66745. this.mainPlaylistLoader_.mainXml_ = req.responseText;
  66746. if (req.responseHeaders && req.responseHeaders.date) {
  66747. this.mainLoaded_ = Date.parse(req.responseHeaders.date);
  66748. } else {
  66749. this.mainLoaded_ = Date.now();
  66750. }
  66751. this.mainPlaylistLoader_.srcUrl = resolveManifestRedirect$1(this.mainPlaylistLoader_.srcUrl, req);
  66752. if (mainChanged) {
  66753. this.handleMain_();
  66754. this.syncClientServerClock_(() => {
  66755. return cb(req, mainChanged);
  66756. });
  66757. return;
  66758. }
  66759. return cb(req, mainChanged);
  66760. });
  66761. }
  66762. syncClientServerClock_(done) {
  66763. const utcTiming = parseUTCTiming$1(this.mainPlaylistLoader_.mainXml_);
  66764. if (utcTiming === null) {
  66765. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66766. return done();
  66767. }
  66768. if (utcTiming.method === "DIRECT") {
  66769. this.mainPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  66770. return done();
  66771. }
  66772. this.request = this.vhs_.xhr({
  66773. uri: resolveUrl$2(this.mainPlaylistLoader_.srcUrl, utcTiming.value),
  66774. method: utcTiming.method,
  66775. withCredentials: this.withCredentials
  66776. }, (error, req) => {
  66777. if (!this.request) {
  66778. return;
  66779. }
  66780. if (error) {
  66781. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66782. return done();
  66783. }
  66784. let serverTime;
  66785. if (utcTiming.method === "HEAD") {
  66786. if (!req.responseHeaders || !req.responseHeaders.date) {
  66787. serverTime = this.mainLoaded_;
  66788. } else {
  66789. serverTime = Date.parse(req.responseHeaders.date);
  66790. }
  66791. } else {
  66792. serverTime = Date.parse(req.responseText);
  66793. }
  66794. this.mainPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  66795. done();
  66796. });
  66797. }
  66798. haveMain_() {
  66799. this.state = "HAVE_MAIN_MANIFEST";
  66800. if (this.isMain_) {
  66801. this.trigger("loadedplaylist");
  66802. } else if (!this.media_) {
  66803. this.media(this.childPlaylist_);
  66804. }
  66805. }
  66806. handleMain_() {
  66807. this.mediaRequest_ = null;
  66808. const oldMain = this.mainPlaylistLoader_.main;
  66809. let newMain = parseMainXml({
  66810. mainXml: this.mainPlaylistLoader_.mainXml_,
  66811. srcUrl: this.mainPlaylistLoader_.srcUrl,
  66812. clientOffset: this.mainPlaylistLoader_.clientOffset_,
  66813. sidxMapping: this.mainPlaylistLoader_.sidxMapping_,
  66814. previousManifest: oldMain
  66815. });
  66816. if (oldMain) {
  66817. newMain = updateMain(oldMain, newMain, this.mainPlaylistLoader_.sidxMapping_);
  66818. }
  66819. this.mainPlaylistLoader_.main = newMain ? newMain : oldMain;
  66820. const location = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0];
  66821. if (location && location !== this.mainPlaylistLoader_.srcUrl) {
  66822. this.mainPlaylistLoader_.srcUrl = location;
  66823. }
  66824. if (!oldMain || newMain && newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66825. this.updateMinimumUpdatePeriodTimeout_();
  66826. }
  66827. return Boolean(newMain);
  66828. }
  66829. updateMinimumUpdatePeriodTimeout_() {
  66830. const mpl = this.mainPlaylistLoader_;
  66831. if (mpl.createMupOnMedia_) {
  66832. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  66833. mpl.createMupOnMedia_ = null;
  66834. }
  66835. if (mpl.minimumUpdatePeriodTimeout_) {
  66836. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  66837. mpl.minimumUpdatePeriodTimeout_ = null;
  66838. }
  66839. let mup = mpl.main && mpl.main.minimumUpdatePeriod;
  66840. if (mup === 0) {
  66841. if (mpl.media()) {
  66842. mup = mpl.media().targetDuration * 1e3;
  66843. } else {
  66844. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  66845. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  66846. }
  66847. }
  66848. if (typeof mup !== "number" || mup <= 0) {
  66849. if (mup < 0) {
  66850. this.logger_(`found invalid minimumUpdatePeriod of ${mup}, not setting a timeout`);
  66851. }
  66852. return;
  66853. }
  66854. this.createMUPTimeout_(mup);
  66855. }
  66856. createMUPTimeout_(mup) {
  66857. const mpl = this.mainPlaylistLoader_;
  66858. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(() => {
  66859. mpl.minimumUpdatePeriodTimeout_ = null;
  66860. mpl.trigger("minimumUpdatePeriod");
  66861. mpl.createMUPTimeout_(mup);
  66862. }, mup);
  66863. }
  66864. refreshXml_() {
  66865. this.requestMain_((req, mainChanged) => {
  66866. if (!mainChanged) {
  66867. return;
  66868. }
  66869. if (this.media_) {
  66870. this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id];
  66871. }
  66872. this.mainPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_);
  66873. this.addSidxSegments_(this.media(), this.state, (sidxChanged) => {
  66874. this.refreshMedia_(this.media().id);
  66875. });
  66876. });
  66877. }
  66878. refreshMedia_(mediaID) {
  66879. if (!mediaID) {
  66880. throw new Error("refreshMedia_ must take a media id");
  66881. }
  66882. if (this.media_ && this.isMain_) {
  66883. this.handleMain_();
  66884. }
  66885. const playlists = this.mainPlaylistLoader_.main.playlists;
  66886. const mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  66887. if (mediaChanged) {
  66888. this.media_ = playlists[mediaID];
  66889. } else {
  66890. this.trigger("playlistunchanged");
  66891. }
  66892. if (!this.mediaUpdateTimeout) {
  66893. const createMediaUpdateTimeout = () => {
  66894. if (this.media().endList) {
  66895. return;
  66896. }
  66897. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  66898. this.trigger("mediaupdatetimeout");
  66899. createMediaUpdateTimeout();
  66900. }, refreshDelay$1(this.media(), Boolean(mediaChanged)));
  66901. };
  66902. createMediaUpdateTimeout();
  66903. }
  66904. this.trigger("loadedplaylist");
  66905. }
  66906. }
  66907. var Config$1 = {
  66908. GOAL_BUFFER_LENGTH: 30,
  66909. MAX_GOAL_BUFFER_LENGTH: 60,
  66910. BACK_BUFFER_LENGTH: 30,
  66911. GOAL_BUFFER_LENGTH_RATE: 1,
  66912. INITIAL_BANDWIDTH: 4194304,
  66913. BANDWIDTH_VARIANCE: 1.2,
  66914. BUFFER_LOW_WATER_LINE: 0,
  66915. MAX_BUFFER_LOW_WATER_LINE: 30,
  66916. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  66917. BUFFER_LOW_WATER_LINE_RATE: 1,
  66918. BUFFER_HIGH_WATER_LINE: 30
  66919. };
  66920. const stringToArrayBuffer$1 = (string) => {
  66921. const view = new Uint8Array(new ArrayBuffer(string.length));
  66922. for (let i2 = 0; i2 < string.length; i2++) {
  66923. view[i2] = string.charCodeAt(i2);
  66924. }
  66925. return view.buffer;
  66926. };
  66927. const browserWorkerPolyFill$1 = function(workerObj) {
  66928. workerObj.on = workerObj.addEventListener;
  66929. workerObj.off = workerObj.removeEventListener;
  66930. return workerObj;
  66931. };
  66932. const createObjectURL$1 = function(str) {
  66933. try {
  66934. return URL.createObjectURL(new Blob([str], {
  66935. type: "application/javascript"
  66936. }));
  66937. } catch (e) {
  66938. const blob = new BlobBuilder();
  66939. blob.append(str);
  66940. return URL.createObjectURL(blob.getBlob());
  66941. }
  66942. };
  66943. const factory$1 = function(code) {
  66944. return function() {
  66945. const objectUrl = createObjectURL$1(code);
  66946. const worker = browserWorkerPolyFill$1(new Worker(objectUrl));
  66947. worker.objURL = objectUrl;
  66948. const terminate = worker.terminate;
  66949. worker.on = worker.addEventListener;
  66950. worker.off = worker.removeEventListener;
  66951. worker.terminate = function() {
  66952. URL.revokeObjectURL(objectUrl);
  66953. return terminate.call(this);
  66954. };
  66955. return worker;
  66956. };
  66957. };
  66958. const transform$1 = function(code) {
  66959. return `var browserWorkerPolyFill = ${browserWorkerPolyFill$1.toString()};
  66960. browserWorkerPolyFill(self);
  66961. ` + code;
  66962. };
  66963. const getWorkerString$1 = function(fn2) {
  66964. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  66965. };
  66966. const workerCode$1$1 = transform$1(getWorkerString$1(function() {
  66967. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  66968. var Stream$8 = function() {
  66969. this.init = function() {
  66970. var listeners = {};
  66971. this.on = function(type3, listener) {
  66972. if (!listeners[type3]) {
  66973. listeners[type3] = [];
  66974. }
  66975. listeners[type3] = listeners[type3].concat(listener);
  66976. };
  66977. this.off = function(type3, listener) {
  66978. var index2;
  66979. if (!listeners[type3]) {
  66980. return false;
  66981. }
  66982. index2 = listeners[type3].indexOf(listener);
  66983. listeners[type3] = listeners[type3].slice();
  66984. listeners[type3].splice(index2, 1);
  66985. return index2 > -1;
  66986. };
  66987. this.trigger = function(type3) {
  66988. var callbacks, i2, length, args;
  66989. callbacks = listeners[type3];
  66990. if (!callbacks) {
  66991. return;
  66992. }
  66993. if (arguments.length === 2) {
  66994. length = callbacks.length;
  66995. for (i2 = 0; i2 < length; ++i2) {
  66996. callbacks[i2].call(this, arguments[1]);
  66997. }
  66998. } else {
  66999. args = [];
  67000. i2 = arguments.length;
  67001. for (i2 = 1; i2 < arguments.length; ++i2) {
  67002. args.push(arguments[i2]);
  67003. }
  67004. length = callbacks.length;
  67005. for (i2 = 0; i2 < length; ++i2) {
  67006. callbacks[i2].apply(this, args);
  67007. }
  67008. }
  67009. };
  67010. this.dispose = function() {
  67011. listeners = {};
  67012. };
  67013. };
  67014. };
  67015. Stream$8.prototype.pipe = function(destination2) {
  67016. this.on("data", function(data) {
  67017. destination2.push(data);
  67018. });
  67019. this.on("done", function(flushSource) {
  67020. destination2.flush(flushSource);
  67021. });
  67022. this.on("partialdone", function(flushSource) {
  67023. destination2.partialFlush(flushSource);
  67024. });
  67025. this.on("endedtimeline", function(flushSource) {
  67026. destination2.endTimeline(flushSource);
  67027. });
  67028. this.on("reset", function(flushSource) {
  67029. destination2.reset(flushSource);
  67030. });
  67031. return destination2;
  67032. };
  67033. Stream$8.prototype.push = function(data) {
  67034. this.trigger("data", data);
  67035. };
  67036. Stream$8.prototype.flush = function(flushSource) {
  67037. this.trigger("done", flushSource);
  67038. };
  67039. Stream$8.prototype.partialFlush = function(flushSource) {
  67040. this.trigger("partialdone", flushSource);
  67041. };
  67042. Stream$8.prototype.endTimeline = function(flushSource) {
  67043. this.trigger("endedtimeline", flushSource);
  67044. };
  67045. Stream$8.prototype.reset = function(flushSource) {
  67046. this.trigger("reset", flushSource);
  67047. };
  67048. var stream = Stream$8;
  67049. var MAX_UINT32$12 = Math.pow(2, 32);
  67050. var getUint64$32 = function(uint8) {
  67051. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  67052. var value;
  67053. if (dv.getBigUint64) {
  67054. value = dv.getBigUint64(0);
  67055. if (value < Number.MAX_SAFE_INTEGER) {
  67056. return Number(value);
  67057. }
  67058. return value;
  67059. }
  67060. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  67061. };
  67062. var numbers2 = {
  67063. getUint64: getUint64$32,
  67064. MAX_UINT32: MAX_UINT32$12
  67065. };
  67066. var MAX_UINT322 = numbers2.MAX_UINT32;
  67067. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  67068. (function() {
  67069. var i2;
  67070. types = {
  67071. avc1: [],
  67072. avcC: [],
  67073. btrt: [],
  67074. dinf: [],
  67075. dref: [],
  67076. esds: [],
  67077. ftyp: [],
  67078. hdlr: [],
  67079. mdat: [],
  67080. mdhd: [],
  67081. mdia: [],
  67082. mfhd: [],
  67083. minf: [],
  67084. moof: [],
  67085. moov: [],
  67086. mp4a: [],
  67087. mvex: [],
  67088. mvhd: [],
  67089. pasp: [],
  67090. sdtp: [],
  67091. smhd: [],
  67092. stbl: [],
  67093. stco: [],
  67094. stsc: [],
  67095. stsd: [],
  67096. stsz: [],
  67097. stts: [],
  67098. styp: [],
  67099. tfdt: [],
  67100. tfhd: [],
  67101. traf: [],
  67102. trak: [],
  67103. trun: [],
  67104. trex: [],
  67105. tkhd: [],
  67106. vmhd: []
  67107. };
  67108. if (typeof Uint8Array === "undefined") {
  67109. return;
  67110. }
  67111. for (i2 in types) {
  67112. if (types.hasOwnProperty(i2)) {
  67113. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  67114. }
  67115. }
  67116. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  67117. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  67118. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  67119. VIDEO_HDLR = new Uint8Array([
  67120. 0,
  67121. 0,
  67122. 0,
  67123. 0,
  67124. 0,
  67125. 0,
  67126. 0,
  67127. 0,
  67128. 118,
  67129. 105,
  67130. 100,
  67131. 101,
  67132. 0,
  67133. 0,
  67134. 0,
  67135. 0,
  67136. 0,
  67137. 0,
  67138. 0,
  67139. 0,
  67140. 0,
  67141. 0,
  67142. 0,
  67143. 0,
  67144. 86,
  67145. 105,
  67146. 100,
  67147. 101,
  67148. 111,
  67149. 72,
  67150. 97,
  67151. 110,
  67152. 100,
  67153. 108,
  67154. 101,
  67155. 114,
  67156. 0
  67157. ]);
  67158. AUDIO_HDLR = new Uint8Array([
  67159. 0,
  67160. 0,
  67161. 0,
  67162. 0,
  67163. 0,
  67164. 0,
  67165. 0,
  67166. 0,
  67167. 115,
  67168. 111,
  67169. 117,
  67170. 110,
  67171. 0,
  67172. 0,
  67173. 0,
  67174. 0,
  67175. 0,
  67176. 0,
  67177. 0,
  67178. 0,
  67179. 0,
  67180. 0,
  67181. 0,
  67182. 0,
  67183. 83,
  67184. 111,
  67185. 117,
  67186. 110,
  67187. 100,
  67188. 72,
  67189. 97,
  67190. 110,
  67191. 100,
  67192. 108,
  67193. 101,
  67194. 114,
  67195. 0
  67196. ]);
  67197. HDLR_TYPES = {
  67198. video: VIDEO_HDLR,
  67199. audio: AUDIO_HDLR
  67200. };
  67201. DREF = new Uint8Array([
  67202. 0,
  67203. 0,
  67204. 0,
  67205. 0,
  67206. 0,
  67207. 0,
  67208. 0,
  67209. 1,
  67210. 0,
  67211. 0,
  67212. 0,
  67213. 12,
  67214. 117,
  67215. 114,
  67216. 108,
  67217. 32,
  67218. 0,
  67219. 0,
  67220. 0,
  67221. 1
  67222. ]);
  67223. SMHD = new Uint8Array([
  67224. 0,
  67225. 0,
  67226. 0,
  67227. 0,
  67228. 0,
  67229. 0,
  67230. 0,
  67231. 0
  67232. ]);
  67233. STCO = new Uint8Array([
  67234. 0,
  67235. 0,
  67236. 0,
  67237. 0,
  67238. 0,
  67239. 0,
  67240. 0,
  67241. 0
  67242. ]);
  67243. STSC = STCO;
  67244. STSZ = new Uint8Array([
  67245. 0,
  67246. 0,
  67247. 0,
  67248. 0,
  67249. 0,
  67250. 0,
  67251. 0,
  67252. 0,
  67253. 0,
  67254. 0,
  67255. 0,
  67256. 0
  67257. ]);
  67258. STTS = STCO;
  67259. VMHD = new Uint8Array([
  67260. 0,
  67261. 0,
  67262. 0,
  67263. 1,
  67264. 0,
  67265. 0,
  67266. 0,
  67267. 0,
  67268. 0,
  67269. 0,
  67270. 0,
  67271. 0
  67272. ]);
  67273. })();
  67274. box = function(type3) {
  67275. var payload = [], size = 0, i2, result, view;
  67276. for (i2 = 1; i2 < arguments.length; i2++) {
  67277. payload.push(arguments[i2]);
  67278. }
  67279. i2 = payload.length;
  67280. while (i2--) {
  67281. size += payload[i2].byteLength;
  67282. }
  67283. result = new Uint8Array(size + 8);
  67284. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  67285. view.setUint32(0, result.byteLength);
  67286. result.set(type3, 4);
  67287. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  67288. result.set(payload[i2], size);
  67289. size += payload[i2].byteLength;
  67290. }
  67291. return result;
  67292. };
  67293. dinf = function() {
  67294. return box(types.dinf, box(types.dref, DREF));
  67295. };
  67296. esds = function(track) {
  67297. return box(types.esds, new Uint8Array([
  67298. 0,
  67299. 0,
  67300. 0,
  67301. 0,
  67302. 3,
  67303. 25,
  67304. 0,
  67305. 0,
  67306. 0,
  67307. 4,
  67308. 17,
  67309. 64,
  67310. 21,
  67311. 0,
  67312. 6,
  67313. 0,
  67314. 0,
  67315. 0,
  67316. 218,
  67317. 192,
  67318. 0,
  67319. 0,
  67320. 218,
  67321. 192,
  67322. 5,
  67323. 2,
  67324. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  67325. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  67326. 6,
  67327. 1,
  67328. 2
  67329. ]));
  67330. };
  67331. ftyp = function() {
  67332. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  67333. };
  67334. hdlr = function(type3) {
  67335. return box(types.hdlr, HDLR_TYPES[type3]);
  67336. };
  67337. mdat = function(data) {
  67338. return box(types.mdat, data);
  67339. };
  67340. mdhd = function(track) {
  67341. var result = new Uint8Array([
  67342. 0,
  67343. 0,
  67344. 0,
  67345. 0,
  67346. 0,
  67347. 0,
  67348. 0,
  67349. 2,
  67350. 0,
  67351. 0,
  67352. 0,
  67353. 3,
  67354. 0,
  67355. 1,
  67356. 95,
  67357. 144,
  67358. track.duration >>> 24 & 255,
  67359. track.duration >>> 16 & 255,
  67360. track.duration >>> 8 & 255,
  67361. track.duration & 255,
  67362. 85,
  67363. 196,
  67364. 0,
  67365. 0
  67366. ]);
  67367. if (track.samplerate) {
  67368. result[12] = track.samplerate >>> 24 & 255;
  67369. result[13] = track.samplerate >>> 16 & 255;
  67370. result[14] = track.samplerate >>> 8 & 255;
  67371. result[15] = track.samplerate & 255;
  67372. }
  67373. return box(types.mdhd, result);
  67374. };
  67375. mdia = function(track) {
  67376. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  67377. };
  67378. mfhd = function(sequenceNumber) {
  67379. return box(types.mfhd, new Uint8Array([
  67380. 0,
  67381. 0,
  67382. 0,
  67383. 0,
  67384. (sequenceNumber & 4278190080) >> 24,
  67385. (sequenceNumber & 16711680) >> 16,
  67386. (sequenceNumber & 65280) >> 8,
  67387. sequenceNumber & 255
  67388. ]));
  67389. };
  67390. minf = function(track) {
  67391. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  67392. };
  67393. moof = function(sequenceNumber, tracks) {
  67394. var trackFragments = [], i2 = tracks.length;
  67395. while (i2--) {
  67396. trackFragments[i2] = traf(tracks[i2]);
  67397. }
  67398. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  67399. };
  67400. moov = function(tracks) {
  67401. var i2 = tracks.length, boxes = [];
  67402. while (i2--) {
  67403. boxes[i2] = trak(tracks[i2]);
  67404. }
  67405. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  67406. };
  67407. mvex = function(tracks) {
  67408. var i2 = tracks.length, boxes = [];
  67409. while (i2--) {
  67410. boxes[i2] = trex(tracks[i2]);
  67411. }
  67412. return box.apply(null, [types.mvex].concat(boxes));
  67413. };
  67414. mvhd = function(duration5) {
  67415. var bytes = new Uint8Array([
  67416. 0,
  67417. 0,
  67418. 0,
  67419. 0,
  67420. 0,
  67421. 0,
  67422. 0,
  67423. 1,
  67424. 0,
  67425. 0,
  67426. 0,
  67427. 2,
  67428. 0,
  67429. 1,
  67430. 95,
  67431. 144,
  67432. (duration5 & 4278190080) >> 24,
  67433. (duration5 & 16711680) >> 16,
  67434. (duration5 & 65280) >> 8,
  67435. duration5 & 255,
  67436. 0,
  67437. 1,
  67438. 0,
  67439. 0,
  67440. 1,
  67441. 0,
  67442. 0,
  67443. 0,
  67444. 0,
  67445. 0,
  67446. 0,
  67447. 0,
  67448. 0,
  67449. 0,
  67450. 0,
  67451. 0,
  67452. 0,
  67453. 1,
  67454. 0,
  67455. 0,
  67456. 0,
  67457. 0,
  67458. 0,
  67459. 0,
  67460. 0,
  67461. 0,
  67462. 0,
  67463. 0,
  67464. 0,
  67465. 0,
  67466. 0,
  67467. 0,
  67468. 0,
  67469. 1,
  67470. 0,
  67471. 0,
  67472. 0,
  67473. 0,
  67474. 0,
  67475. 0,
  67476. 0,
  67477. 0,
  67478. 0,
  67479. 0,
  67480. 0,
  67481. 0,
  67482. 0,
  67483. 0,
  67484. 64,
  67485. 0,
  67486. 0,
  67487. 0,
  67488. 0,
  67489. 0,
  67490. 0,
  67491. 0,
  67492. 0,
  67493. 0,
  67494. 0,
  67495. 0,
  67496. 0,
  67497. 0,
  67498. 0,
  67499. 0,
  67500. 0,
  67501. 0,
  67502. 0,
  67503. 0,
  67504. 0,
  67505. 0,
  67506. 0,
  67507. 0,
  67508. 0,
  67509. 0,
  67510. 0,
  67511. 0,
  67512. 255,
  67513. 255,
  67514. 255,
  67515. 255
  67516. ]);
  67517. return box(types.mvhd, bytes);
  67518. };
  67519. sdtp = function(track) {
  67520. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  67521. for (i2 = 0; i2 < samples.length; i2++) {
  67522. flags = samples[i2].flags;
  67523. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  67524. }
  67525. return box(types.sdtp, bytes);
  67526. };
  67527. stbl = function(track) {
  67528. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  67529. };
  67530. (function() {
  67531. var videoSample, audioSample;
  67532. stsd = function(track) {
  67533. return box(types.stsd, new Uint8Array([
  67534. 0,
  67535. 0,
  67536. 0,
  67537. 0,
  67538. 0,
  67539. 0,
  67540. 0,
  67541. 1
  67542. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  67543. };
  67544. videoSample = function(track) {
  67545. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  67546. for (i2 = 0; i2 < sps.length; i2++) {
  67547. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  67548. sequenceParameterSets.push(sps[i2].byteLength & 255);
  67549. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  67550. }
  67551. for (i2 = 0; i2 < pps.length; i2++) {
  67552. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  67553. pictureParameterSets.push(pps[i2].byteLength & 255);
  67554. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  67555. }
  67556. avc1Box = [types.avc1, new Uint8Array([
  67557. 0,
  67558. 0,
  67559. 0,
  67560. 0,
  67561. 0,
  67562. 0,
  67563. 0,
  67564. 1,
  67565. 0,
  67566. 0,
  67567. 0,
  67568. 0,
  67569. 0,
  67570. 0,
  67571. 0,
  67572. 0,
  67573. 0,
  67574. 0,
  67575. 0,
  67576. 0,
  67577. 0,
  67578. 0,
  67579. 0,
  67580. 0,
  67581. (track.width & 65280) >> 8,
  67582. track.width & 255,
  67583. (track.height & 65280) >> 8,
  67584. track.height & 255,
  67585. 0,
  67586. 72,
  67587. 0,
  67588. 0,
  67589. 0,
  67590. 72,
  67591. 0,
  67592. 0,
  67593. 0,
  67594. 0,
  67595. 0,
  67596. 0,
  67597. 0,
  67598. 1,
  67599. 19,
  67600. 118,
  67601. 105,
  67602. 100,
  67603. 101,
  67604. 111,
  67605. 106,
  67606. 115,
  67607. 45,
  67608. 99,
  67609. 111,
  67610. 110,
  67611. 116,
  67612. 114,
  67613. 105,
  67614. 98,
  67615. 45,
  67616. 104,
  67617. 108,
  67618. 115,
  67619. 0,
  67620. 0,
  67621. 0,
  67622. 0,
  67623. 0,
  67624. 0,
  67625. 0,
  67626. 0,
  67627. 0,
  67628. 0,
  67629. 0,
  67630. 0,
  67631. 0,
  67632. 24,
  67633. 17,
  67634. 17
  67635. ]), box(types.avcC, new Uint8Array([
  67636. 1,
  67637. track.profileIdc,
  67638. track.profileCompatibility,
  67639. track.levelIdc,
  67640. 255
  67641. ].concat(
  67642. [sps.length],
  67643. sequenceParameterSets,
  67644. [pps.length],
  67645. pictureParameterSets
  67646. ))), box(types.btrt, new Uint8Array([
  67647. 0,
  67648. 28,
  67649. 156,
  67650. 128,
  67651. 0,
  67652. 45,
  67653. 198,
  67654. 192,
  67655. 0,
  67656. 45,
  67657. 198,
  67658. 192
  67659. ]))];
  67660. if (track.sarRatio) {
  67661. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  67662. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  67663. }
  67664. return box.apply(null, avc1Box);
  67665. };
  67666. audioSample = function(track) {
  67667. return box(types.mp4a, new Uint8Array([
  67668. 0,
  67669. 0,
  67670. 0,
  67671. 0,
  67672. 0,
  67673. 0,
  67674. 0,
  67675. 1,
  67676. 0,
  67677. 0,
  67678. 0,
  67679. 0,
  67680. 0,
  67681. 0,
  67682. 0,
  67683. 0,
  67684. (track.channelcount & 65280) >> 8,
  67685. track.channelcount & 255,
  67686. (track.samplesize & 65280) >> 8,
  67687. track.samplesize & 255,
  67688. 0,
  67689. 0,
  67690. 0,
  67691. 0,
  67692. (track.samplerate & 65280) >> 8,
  67693. track.samplerate & 255,
  67694. 0,
  67695. 0
  67696. ]), esds(track));
  67697. };
  67698. })();
  67699. tkhd = function(track) {
  67700. var result = new Uint8Array([
  67701. 0,
  67702. 0,
  67703. 0,
  67704. 7,
  67705. 0,
  67706. 0,
  67707. 0,
  67708. 0,
  67709. 0,
  67710. 0,
  67711. 0,
  67712. 0,
  67713. (track.id & 4278190080) >> 24,
  67714. (track.id & 16711680) >> 16,
  67715. (track.id & 65280) >> 8,
  67716. track.id & 255,
  67717. 0,
  67718. 0,
  67719. 0,
  67720. 0,
  67721. (track.duration & 4278190080) >> 24,
  67722. (track.duration & 16711680) >> 16,
  67723. (track.duration & 65280) >> 8,
  67724. track.duration & 255,
  67725. 0,
  67726. 0,
  67727. 0,
  67728. 0,
  67729. 0,
  67730. 0,
  67731. 0,
  67732. 0,
  67733. 0,
  67734. 0,
  67735. 0,
  67736. 0,
  67737. 1,
  67738. 0,
  67739. 0,
  67740. 0,
  67741. 0,
  67742. 1,
  67743. 0,
  67744. 0,
  67745. 0,
  67746. 0,
  67747. 0,
  67748. 0,
  67749. 0,
  67750. 0,
  67751. 0,
  67752. 0,
  67753. 0,
  67754. 0,
  67755. 0,
  67756. 0,
  67757. 0,
  67758. 1,
  67759. 0,
  67760. 0,
  67761. 0,
  67762. 0,
  67763. 0,
  67764. 0,
  67765. 0,
  67766. 0,
  67767. 0,
  67768. 0,
  67769. 0,
  67770. 0,
  67771. 0,
  67772. 0,
  67773. 64,
  67774. 0,
  67775. 0,
  67776. 0,
  67777. (track.width & 65280) >> 8,
  67778. track.width & 255,
  67779. 0,
  67780. 0,
  67781. (track.height & 65280) >> 8,
  67782. track.height & 255,
  67783. 0,
  67784. 0
  67785. ]);
  67786. return box(types.tkhd, result);
  67787. };
  67788. traf = function(track) {
  67789. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  67790. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  67791. 0,
  67792. 0,
  67793. 0,
  67794. 58,
  67795. (track.id & 4278190080) >> 24,
  67796. (track.id & 16711680) >> 16,
  67797. (track.id & 65280) >> 8,
  67798. track.id & 255,
  67799. 0,
  67800. 0,
  67801. 0,
  67802. 1,
  67803. 0,
  67804. 0,
  67805. 0,
  67806. 0,
  67807. 0,
  67808. 0,
  67809. 0,
  67810. 0,
  67811. 0,
  67812. 0,
  67813. 0,
  67814. 0
  67815. ]));
  67816. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  67817. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  67818. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  67819. 1,
  67820. 0,
  67821. 0,
  67822. 0,
  67823. upperWordBaseMediaDecodeTime >>> 24 & 255,
  67824. upperWordBaseMediaDecodeTime >>> 16 & 255,
  67825. upperWordBaseMediaDecodeTime >>> 8 & 255,
  67826. upperWordBaseMediaDecodeTime & 255,
  67827. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  67828. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  67829. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  67830. lowerWordBaseMediaDecodeTime & 255
  67831. ]));
  67832. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  67833. if (track.type === "audio") {
  67834. trackFragmentRun = trun$1(track, dataOffset);
  67835. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  67836. }
  67837. sampleDependencyTable = sdtp(track);
  67838. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  67839. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  67840. };
  67841. trak = function(track) {
  67842. track.duration = track.duration || 4294967295;
  67843. return box(types.trak, tkhd(track), mdia(track));
  67844. };
  67845. trex = function(track) {
  67846. var result = new Uint8Array([
  67847. 0,
  67848. 0,
  67849. 0,
  67850. 0,
  67851. (track.id & 4278190080) >> 24,
  67852. (track.id & 16711680) >> 16,
  67853. (track.id & 65280) >> 8,
  67854. track.id & 255,
  67855. 0,
  67856. 0,
  67857. 0,
  67858. 1,
  67859. 0,
  67860. 0,
  67861. 0,
  67862. 0,
  67863. 0,
  67864. 0,
  67865. 0,
  67866. 0,
  67867. 0,
  67868. 1,
  67869. 0,
  67870. 1
  67871. ]);
  67872. if (track.type !== "video") {
  67873. result[result.length - 1] = 0;
  67874. }
  67875. return box(types.trex, result);
  67876. };
  67877. (function() {
  67878. var audioTrun, videoTrun, trunHeader;
  67879. trunHeader = function(samples, offset) {
  67880. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  67881. if (samples.length) {
  67882. if (samples[0].duration !== void 0) {
  67883. durationPresent = 1;
  67884. }
  67885. if (samples[0].size !== void 0) {
  67886. sizePresent = 2;
  67887. }
  67888. if (samples[0].flags !== void 0) {
  67889. flagsPresent = 4;
  67890. }
  67891. if (samples[0].compositionTimeOffset !== void 0) {
  67892. compositionTimeOffset = 8;
  67893. }
  67894. }
  67895. return [
  67896. 0,
  67897. 0,
  67898. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  67899. 1,
  67900. (samples.length & 4278190080) >>> 24,
  67901. (samples.length & 16711680) >>> 16,
  67902. (samples.length & 65280) >>> 8,
  67903. samples.length & 255,
  67904. (offset & 4278190080) >>> 24,
  67905. (offset & 16711680) >>> 16,
  67906. (offset & 65280) >>> 8,
  67907. offset & 255
  67908. ];
  67909. };
  67910. videoTrun = function(track, offset) {
  67911. var bytesOffest, bytes, header, samples, sample, i2;
  67912. samples = track.samples || [];
  67913. offset += 8 + 12 + 16 * samples.length;
  67914. header = trunHeader(samples, offset);
  67915. bytes = new Uint8Array(header.length + samples.length * 16);
  67916. bytes.set(header);
  67917. bytesOffest = header.length;
  67918. for (i2 = 0; i2 < samples.length; i2++) {
  67919. sample = samples[i2];
  67920. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67921. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  67922. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  67923. bytes[bytesOffest++] = sample.duration & 255;
  67924. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  67925. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  67926. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  67927. bytes[bytesOffest++] = sample.size & 255;
  67928. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  67929. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  67930. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  67931. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  67932. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  67933. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  67934. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  67935. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  67936. }
  67937. return box(types.trun, bytes);
  67938. };
  67939. audioTrun = function(track, offset) {
  67940. var bytes, bytesOffest, header, samples, sample, i2;
  67941. samples = track.samples || [];
  67942. offset += 8 + 12 + 8 * samples.length;
  67943. header = trunHeader(samples, offset);
  67944. bytes = new Uint8Array(header.length + samples.length * 8);
  67945. bytes.set(header);
  67946. bytesOffest = header.length;
  67947. for (i2 = 0; i2 < samples.length; i2++) {
  67948. sample = samples[i2];
  67949. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67950. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  67951. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  67952. bytes[bytesOffest++] = sample.duration & 255;
  67953. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  67954. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  67955. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  67956. bytes[bytesOffest++] = sample.size & 255;
  67957. }
  67958. return box(types.trun, bytes);
  67959. };
  67960. trun$1 = function(track, offset) {
  67961. if (track.type === "audio") {
  67962. return audioTrun(track, offset);
  67963. }
  67964. return videoTrun(track, offset);
  67965. };
  67966. })();
  67967. var mp4Generator = {
  67968. ftyp,
  67969. mdat,
  67970. moof,
  67971. moov,
  67972. initSegment: function(tracks) {
  67973. var fileType = ftyp(), movie = moov(tracks), result;
  67974. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  67975. result.set(fileType);
  67976. result.set(movie, fileType.byteLength);
  67977. return result;
  67978. }
  67979. };
  67980. var groupNalsIntoFrames = function(nalUnits) {
  67981. var i2, currentNal, currentFrame = [], frames = [];
  67982. frames.byteLength = 0;
  67983. frames.nalCount = 0;
  67984. frames.duration = 0;
  67985. currentFrame.byteLength = 0;
  67986. for (i2 = 0; i2 < nalUnits.length; i2++) {
  67987. currentNal = nalUnits[i2];
  67988. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  67989. if (currentFrame.length) {
  67990. currentFrame.duration = currentNal.dts - currentFrame.dts;
  67991. frames.byteLength += currentFrame.byteLength;
  67992. frames.nalCount += currentFrame.length;
  67993. frames.duration += currentFrame.duration;
  67994. frames.push(currentFrame);
  67995. }
  67996. currentFrame = [currentNal];
  67997. currentFrame.byteLength = currentNal.data.byteLength;
  67998. currentFrame.pts = currentNal.pts;
  67999. currentFrame.dts = currentNal.dts;
  68000. } else {
  68001. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  68002. currentFrame.keyFrame = true;
  68003. }
  68004. currentFrame.duration = currentNal.dts - currentFrame.dts;
  68005. currentFrame.byteLength += currentNal.data.byteLength;
  68006. currentFrame.push(currentNal);
  68007. }
  68008. }
  68009. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  68010. currentFrame.duration = frames[frames.length - 1].duration;
  68011. }
  68012. frames.byteLength += currentFrame.byteLength;
  68013. frames.nalCount += currentFrame.length;
  68014. frames.duration += currentFrame.duration;
  68015. frames.push(currentFrame);
  68016. return frames;
  68017. };
  68018. var groupFramesIntoGops = function(frames) {
  68019. var i2, currentFrame, currentGop = [], gops = [];
  68020. currentGop.byteLength = 0;
  68021. currentGop.nalCount = 0;
  68022. currentGop.duration = 0;
  68023. currentGop.pts = frames[0].pts;
  68024. currentGop.dts = frames[0].dts;
  68025. gops.byteLength = 0;
  68026. gops.nalCount = 0;
  68027. gops.duration = 0;
  68028. gops.pts = frames[0].pts;
  68029. gops.dts = frames[0].dts;
  68030. for (i2 = 0; i2 < frames.length; i2++) {
  68031. currentFrame = frames[i2];
  68032. if (currentFrame.keyFrame) {
  68033. if (currentGop.length) {
  68034. gops.push(currentGop);
  68035. gops.byteLength += currentGop.byteLength;
  68036. gops.nalCount += currentGop.nalCount;
  68037. gops.duration += currentGop.duration;
  68038. }
  68039. currentGop = [currentFrame];
  68040. currentGop.nalCount = currentFrame.length;
  68041. currentGop.byteLength = currentFrame.byteLength;
  68042. currentGop.pts = currentFrame.pts;
  68043. currentGop.dts = currentFrame.dts;
  68044. currentGop.duration = currentFrame.duration;
  68045. } else {
  68046. currentGop.duration += currentFrame.duration;
  68047. currentGop.nalCount += currentFrame.length;
  68048. currentGop.byteLength += currentFrame.byteLength;
  68049. currentGop.push(currentFrame);
  68050. }
  68051. }
  68052. if (gops.length && currentGop.duration <= 0) {
  68053. currentGop.duration = gops[gops.length - 1].duration;
  68054. }
  68055. gops.byteLength += currentGop.byteLength;
  68056. gops.nalCount += currentGop.nalCount;
  68057. gops.duration += currentGop.duration;
  68058. gops.push(currentGop);
  68059. return gops;
  68060. };
  68061. var extendFirstKeyFrame = function(gops) {
  68062. var currentGop;
  68063. if (!gops[0][0].keyFrame && gops.length > 1) {
  68064. currentGop = gops.shift();
  68065. gops.byteLength -= currentGop.byteLength;
  68066. gops.nalCount -= currentGop.nalCount;
  68067. gops[0][0].dts = currentGop.dts;
  68068. gops[0][0].pts = currentGop.pts;
  68069. gops[0][0].duration += currentGop.duration;
  68070. }
  68071. return gops;
  68072. };
  68073. var createDefaultSample = function() {
  68074. return {
  68075. size: 0,
  68076. flags: {
  68077. isLeading: 0,
  68078. dependsOn: 1,
  68079. isDependedOn: 0,
  68080. hasRedundancy: 0,
  68081. degradationPriority: 0,
  68082. isNonSyncSample: 1
  68083. }
  68084. };
  68085. };
  68086. var sampleForFrame = function(frame, dataOffset) {
  68087. var sample = createDefaultSample();
  68088. sample.dataOffset = dataOffset;
  68089. sample.compositionTimeOffset = frame.pts - frame.dts;
  68090. sample.duration = frame.duration;
  68091. sample.size = 4 * frame.length;
  68092. sample.size += frame.byteLength;
  68093. if (frame.keyFrame) {
  68094. sample.flags.dependsOn = 2;
  68095. sample.flags.isNonSyncSample = 0;
  68096. }
  68097. return sample;
  68098. };
  68099. var generateSampleTable$1 = function(gops, baseDataOffset) {
  68100. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  68101. for (h2 = 0; h2 < gops.length; h2++) {
  68102. currentGop = gops[h2];
  68103. for (i2 = 0; i2 < currentGop.length; i2++) {
  68104. currentFrame = currentGop[i2];
  68105. sample = sampleForFrame(currentFrame, dataOffset);
  68106. dataOffset += sample.size;
  68107. samples.push(sample);
  68108. }
  68109. }
  68110. return samples;
  68111. };
  68112. var concatenateNalData = function(gops) {
  68113. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68114. for (h2 = 0; h2 < gops.length; h2++) {
  68115. currentGop = gops[h2];
  68116. for (i2 = 0; i2 < currentGop.length; i2++) {
  68117. currentFrame = currentGop[i2];
  68118. for (j = 0; j < currentFrame.length; j++) {
  68119. currentNal = currentFrame[j];
  68120. view.setUint32(dataOffset, currentNal.data.byteLength);
  68121. dataOffset += 4;
  68122. data.set(currentNal.data, dataOffset);
  68123. dataOffset += currentNal.data.byteLength;
  68124. }
  68125. }
  68126. }
  68127. return data;
  68128. };
  68129. var generateSampleTableForFrame = function(frame, baseDataOffset) {
  68130. var sample, dataOffset = baseDataOffset || 0, samples = [];
  68131. sample = sampleForFrame(frame, dataOffset);
  68132. samples.push(sample);
  68133. return samples;
  68134. };
  68135. var concatenateNalDataForFrame = function(frame) {
  68136. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68137. for (i2 = 0; i2 < frame.length; i2++) {
  68138. currentNal = frame[i2];
  68139. view.setUint32(dataOffset, currentNal.data.byteLength);
  68140. dataOffset += 4;
  68141. data.set(currentNal.data, dataOffset);
  68142. dataOffset += currentNal.data.byteLength;
  68143. }
  68144. return data;
  68145. };
  68146. var frameUtils$1 = {
  68147. groupNalsIntoFrames,
  68148. groupFramesIntoGops,
  68149. extendFirstKeyFrame,
  68150. generateSampleTable: generateSampleTable$1,
  68151. concatenateNalData,
  68152. generateSampleTableForFrame,
  68153. concatenateNalDataForFrame
  68154. };
  68155. var highPrefix = [33, 16, 5, 32, 164, 27];
  68156. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  68157. var zeroFill = function(count) {
  68158. var a = [];
  68159. while (count--) {
  68160. a.push(0);
  68161. }
  68162. return a;
  68163. };
  68164. var makeTable = function(metaTable) {
  68165. return Object.keys(metaTable).reduce(function(obj, key) {
  68166. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  68167. return arr.concat(part);
  68168. }, []));
  68169. return obj;
  68170. }, {});
  68171. };
  68172. var silence;
  68173. var silence_1 = function() {
  68174. if (!silence) {
  68175. var coneOfSilence2 = {
  68176. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  68177. 88200: [highPrefix, [231], zeroFill(170), [56]],
  68178. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  68179. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  68180. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  68181. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  68182. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  68183. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  68184. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  68185. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  68186. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  68187. };
  68188. silence = makeTable(coneOfSilence2);
  68189. }
  68190. return silence;
  68191. };
  68192. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  68193. secondsToVideoTs2 = function(seconds) {
  68194. return seconds * ONE_SECOND_IN_TS$4;
  68195. };
  68196. secondsToAudioTs2 = function(seconds, sampleRate) {
  68197. return seconds * sampleRate;
  68198. };
  68199. videoTsToSeconds2 = function(timestamp) {
  68200. return timestamp / ONE_SECOND_IN_TS$4;
  68201. };
  68202. audioTsToSeconds2 = function(timestamp, sampleRate) {
  68203. return timestamp / sampleRate;
  68204. };
  68205. audioTsToVideoTs2 = function(timestamp, sampleRate) {
  68206. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  68207. };
  68208. videoTsToAudioTs2 = function(timestamp, sampleRate) {
  68209. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  68210. };
  68211. metadataTsToSeconds2 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  68212. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  68213. };
  68214. var clock$2 = {
  68215. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  68216. secondsToVideoTs: secondsToVideoTs2,
  68217. secondsToAudioTs: secondsToAudioTs2,
  68218. videoTsToSeconds: videoTsToSeconds2,
  68219. audioTsToSeconds: audioTsToSeconds2,
  68220. audioTsToVideoTs: audioTsToVideoTs2,
  68221. videoTsToAudioTs: videoTsToAudioTs2,
  68222. metadataTsToSeconds: metadataTsToSeconds2
  68223. };
  68224. var coneOfSilence = silence_1;
  68225. var clock$12 = clock$2;
  68226. var sumFrameByteLengths = function(array) {
  68227. var i2, currentObj, sum = 0;
  68228. for (i2 = 0; i2 < array.length; i2++) {
  68229. currentObj = array[i2];
  68230. sum += currentObj.data.byteLength;
  68231. }
  68232. return sum;
  68233. };
  68234. var prefixWithSilence = function(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  68235. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  68236. if (!frames.length) {
  68237. return;
  68238. }
  68239. baseMediaDecodeTimeTs = clock$12.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  68240. frameDuration = Math.ceil(clock$12.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  68241. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  68242. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  68243. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  68244. audioFillDuration = audioFillFrameCount * frameDuration;
  68245. }
  68246. if (audioFillFrameCount < 1 || audioFillDuration > clock$12.ONE_SECOND_IN_TS / 2) {
  68247. return;
  68248. }
  68249. silentFrame = coneOfSilence()[track.samplerate];
  68250. if (!silentFrame) {
  68251. silentFrame = frames[0].data;
  68252. }
  68253. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  68254. firstFrame = frames[0];
  68255. frames.splice(0, 0, {
  68256. data: silentFrame,
  68257. dts: firstFrame.dts - frameDuration,
  68258. pts: firstFrame.pts - frameDuration
  68259. });
  68260. }
  68261. track.baseMediaDecodeTime -= Math.floor(clock$12.videoTsToAudioTs(audioFillDuration, track.samplerate));
  68262. return audioFillDuration;
  68263. };
  68264. var trimAdtsFramesByEarliestDts = function(adtsFrames, track, earliestAllowedDts) {
  68265. if (track.minSegmentDts >= earliestAllowedDts) {
  68266. return adtsFrames;
  68267. }
  68268. track.minSegmentDts = Infinity;
  68269. return adtsFrames.filter(function(currentFrame) {
  68270. if (currentFrame.dts >= earliestAllowedDts) {
  68271. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  68272. track.minSegmentPts = track.minSegmentDts;
  68273. return true;
  68274. }
  68275. return false;
  68276. });
  68277. };
  68278. var generateSampleTable = function(frames) {
  68279. var i2, currentFrame, samples = [];
  68280. for (i2 = 0; i2 < frames.length; i2++) {
  68281. currentFrame = frames[i2];
  68282. samples.push({
  68283. size: currentFrame.data.byteLength,
  68284. duration: 1024
  68285. });
  68286. }
  68287. return samples;
  68288. };
  68289. var concatenateFrameData = function(frames) {
  68290. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  68291. for (i2 = 0; i2 < frames.length; i2++) {
  68292. currentFrame = frames[i2];
  68293. data.set(currentFrame.data, dataOffset);
  68294. dataOffset += currentFrame.data.byteLength;
  68295. }
  68296. return data;
  68297. };
  68298. var audioFrameUtils$1 = {
  68299. prefixWithSilence,
  68300. trimAdtsFramesByEarliestDts,
  68301. generateSampleTable,
  68302. concatenateFrameData
  68303. };
  68304. var ONE_SECOND_IN_TS$3 = clock$2.ONE_SECOND_IN_TS;
  68305. var collectDtsInfo = function(track, data) {
  68306. if (typeof data.pts === "number") {
  68307. if (track.timelineStartInfo.pts === void 0) {
  68308. track.timelineStartInfo.pts = data.pts;
  68309. }
  68310. if (track.minSegmentPts === void 0) {
  68311. track.minSegmentPts = data.pts;
  68312. } else {
  68313. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  68314. }
  68315. if (track.maxSegmentPts === void 0) {
  68316. track.maxSegmentPts = data.pts;
  68317. } else {
  68318. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  68319. }
  68320. }
  68321. if (typeof data.dts === "number") {
  68322. if (track.timelineStartInfo.dts === void 0) {
  68323. track.timelineStartInfo.dts = data.dts;
  68324. }
  68325. if (track.minSegmentDts === void 0) {
  68326. track.minSegmentDts = data.dts;
  68327. } else {
  68328. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  68329. }
  68330. if (track.maxSegmentDts === void 0) {
  68331. track.maxSegmentDts = data.dts;
  68332. } else {
  68333. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  68334. }
  68335. }
  68336. };
  68337. var clearDtsInfo = function(track) {
  68338. delete track.minSegmentDts;
  68339. delete track.maxSegmentDts;
  68340. delete track.minSegmentPts;
  68341. delete track.maxSegmentPts;
  68342. };
  68343. var calculateTrackBaseMediaDecodeTime = function(track, keepOriginalTimestamps) {
  68344. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  68345. if (!keepOriginalTimestamps) {
  68346. minSegmentDts -= track.timelineStartInfo.dts;
  68347. }
  68348. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  68349. baseMediaDecodeTime += minSegmentDts;
  68350. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  68351. if (track.type === "audio") {
  68352. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  68353. baseMediaDecodeTime *= scale;
  68354. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  68355. }
  68356. return baseMediaDecodeTime;
  68357. };
  68358. var trackDecodeInfo$1 = {
  68359. clearDtsInfo,
  68360. calculateTrackBaseMediaDecodeTime,
  68361. collectDtsInfo
  68362. };
  68363. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  68364. var parseSei = function(bytes) {
  68365. var i2 = 0, result = {
  68366. payloadType: -1,
  68367. payloadSize: 0
  68368. }, payloadType = 0, payloadSize = 0;
  68369. while (i2 < bytes.byteLength) {
  68370. if (bytes[i2] === RBSP_TRAILING_BITS) {
  68371. break;
  68372. }
  68373. while (bytes[i2] === 255) {
  68374. payloadType += 255;
  68375. i2++;
  68376. }
  68377. payloadType += bytes[i2++];
  68378. while (bytes[i2] === 255) {
  68379. payloadSize += 255;
  68380. i2++;
  68381. }
  68382. payloadSize += bytes[i2++];
  68383. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  68384. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  68385. if (userIdentifier === "GA94") {
  68386. result.payloadType = payloadType;
  68387. result.payloadSize = payloadSize;
  68388. result.payload = bytes.subarray(i2, i2 + payloadSize);
  68389. break;
  68390. } else {
  68391. result.payload = void 0;
  68392. }
  68393. }
  68394. i2 += payloadSize;
  68395. payloadType = 0;
  68396. payloadSize = 0;
  68397. }
  68398. return result;
  68399. };
  68400. var parseUserData = function(sei) {
  68401. if (sei.payload[0] !== 181) {
  68402. return null;
  68403. }
  68404. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  68405. return null;
  68406. }
  68407. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  68408. return null;
  68409. }
  68410. if (sei.payload[7] !== 3) {
  68411. return null;
  68412. }
  68413. return sei.payload.subarray(8, sei.payload.length - 1);
  68414. };
  68415. var parseCaptionPackets = function(pts, userData) {
  68416. var results = [], i2, count, offset, data;
  68417. if (!(userData[0] & 64)) {
  68418. return results;
  68419. }
  68420. count = userData[0] & 31;
  68421. for (i2 = 0; i2 < count; i2++) {
  68422. offset = i2 * 3;
  68423. data = {
  68424. type: userData[offset + 2] & 3,
  68425. pts
  68426. };
  68427. if (userData[offset + 2] & 4) {
  68428. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  68429. results.push(data);
  68430. }
  68431. }
  68432. return results;
  68433. };
  68434. var discardEmulationPreventionBytes$12 = function(data) {
  68435. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  68436. while (i2 < length - 2) {
  68437. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  68438. emulationPreventionBytesPositions.push(i2 + 2);
  68439. i2 += 2;
  68440. } else {
  68441. i2++;
  68442. }
  68443. }
  68444. if (emulationPreventionBytesPositions.length === 0) {
  68445. return data;
  68446. }
  68447. newLength = length - emulationPreventionBytesPositions.length;
  68448. newData = new Uint8Array(newLength);
  68449. var sourceIndex = 0;
  68450. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  68451. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  68452. sourceIndex++;
  68453. emulationPreventionBytesPositions.shift();
  68454. }
  68455. newData[i2] = data[sourceIndex];
  68456. }
  68457. return newData;
  68458. };
  68459. var captionPacketParser = {
  68460. parseSei,
  68461. parseUserData,
  68462. parseCaptionPackets,
  68463. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  68464. USER_DATA_REGISTERED_ITU_T_T35
  68465. };
  68466. var Stream$7 = stream;
  68467. var cea708Parser = captionPacketParser;
  68468. var CaptionStream$2 = function(options2) {
  68469. options2 = options2 || {};
  68470. CaptionStream$2.prototype.init.call(this);
  68471. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  68472. this.captionPackets_ = [];
  68473. this.ccStreams_ = [
  68474. new Cea608Stream(0, 0),
  68475. new Cea608Stream(0, 1),
  68476. new Cea608Stream(1, 0),
  68477. new Cea608Stream(1, 1)
  68478. ];
  68479. if (this.parse708captions_) {
  68480. this.cc708Stream_ = new Cea708Stream({
  68481. captionServices: options2.captionServices
  68482. });
  68483. }
  68484. this.reset();
  68485. this.ccStreams_.forEach(function(cc) {
  68486. cc.on("data", this.trigger.bind(this, "data"));
  68487. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  68488. cc.on("done", this.trigger.bind(this, "done"));
  68489. }, this);
  68490. if (this.parse708captions_) {
  68491. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  68492. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  68493. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  68494. }
  68495. };
  68496. CaptionStream$2.prototype = new Stream$7();
  68497. CaptionStream$2.prototype.push = function(event2) {
  68498. var sei, userData, newCaptionPackets;
  68499. if (event2.nalUnitType !== "sei_rbsp") {
  68500. return;
  68501. }
  68502. sei = cea708Parser.parseSei(event2.escapedRBSP);
  68503. if (!sei.payload) {
  68504. return;
  68505. }
  68506. if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {
  68507. return;
  68508. }
  68509. userData = cea708Parser.parseUserData(sei);
  68510. if (!userData) {
  68511. return;
  68512. }
  68513. if (event2.dts < this.latestDts_) {
  68514. this.ignoreNextEqualDts_ = true;
  68515. return;
  68516. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  68517. this.numSameDts_--;
  68518. if (!this.numSameDts_) {
  68519. this.ignoreNextEqualDts_ = false;
  68520. }
  68521. return;
  68522. }
  68523. newCaptionPackets = cea708Parser.parseCaptionPackets(event2.pts, userData);
  68524. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  68525. if (this.latestDts_ !== event2.dts) {
  68526. this.numSameDts_ = 0;
  68527. }
  68528. this.numSameDts_++;
  68529. this.latestDts_ = event2.dts;
  68530. };
  68531. CaptionStream$2.prototype.flushCCStreams = function(flushType) {
  68532. this.ccStreams_.forEach(function(cc) {
  68533. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  68534. }, this);
  68535. };
  68536. CaptionStream$2.prototype.flushStream = function(flushType) {
  68537. if (!this.captionPackets_.length) {
  68538. this.flushCCStreams(flushType);
  68539. return;
  68540. }
  68541. this.captionPackets_.forEach(function(elem, idx) {
  68542. elem.presortIndex = idx;
  68543. });
  68544. this.captionPackets_.sort(function(a, b) {
  68545. if (a.pts === b.pts) {
  68546. return a.presortIndex - b.presortIndex;
  68547. }
  68548. return a.pts - b.pts;
  68549. });
  68550. this.captionPackets_.forEach(function(packet) {
  68551. if (packet.type < 2) {
  68552. this.dispatchCea608Packet(packet);
  68553. } else {
  68554. this.dispatchCea708Packet(packet);
  68555. }
  68556. }, this);
  68557. this.captionPackets_.length = 0;
  68558. this.flushCCStreams(flushType);
  68559. };
  68560. CaptionStream$2.prototype.flush = function() {
  68561. return this.flushStream("flush");
  68562. };
  68563. CaptionStream$2.prototype.partialFlush = function() {
  68564. return this.flushStream("partialFlush");
  68565. };
  68566. CaptionStream$2.prototype.reset = function() {
  68567. this.latestDts_ = null;
  68568. this.ignoreNextEqualDts_ = false;
  68569. this.numSameDts_ = 0;
  68570. this.activeCea608Channel_ = [null, null];
  68571. this.ccStreams_.forEach(function(ccStream) {
  68572. ccStream.reset();
  68573. });
  68574. };
  68575. CaptionStream$2.prototype.dispatchCea608Packet = function(packet) {
  68576. if (this.setsTextOrXDSActive(packet)) {
  68577. this.activeCea608Channel_[packet.type] = null;
  68578. } else if (this.setsChannel1Active(packet)) {
  68579. this.activeCea608Channel_[packet.type] = 0;
  68580. } else if (this.setsChannel2Active(packet)) {
  68581. this.activeCea608Channel_[packet.type] = 1;
  68582. }
  68583. if (this.activeCea608Channel_[packet.type] === null) {
  68584. return;
  68585. }
  68586. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  68587. };
  68588. CaptionStream$2.prototype.setsChannel1Active = function(packet) {
  68589. return (packet.ccData & 30720) === 4096;
  68590. };
  68591. CaptionStream$2.prototype.setsChannel2Active = function(packet) {
  68592. return (packet.ccData & 30720) === 6144;
  68593. };
  68594. CaptionStream$2.prototype.setsTextOrXDSActive = function(packet) {
  68595. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  68596. };
  68597. CaptionStream$2.prototype.dispatchCea708Packet = function(packet) {
  68598. if (this.parse708captions_) {
  68599. this.cc708Stream_.push(packet);
  68600. }
  68601. };
  68602. var CHARACTER_TRANSLATION_708 = {
  68603. 127: 9834,
  68604. 4128: 32,
  68605. 4129: 160,
  68606. 4133: 8230,
  68607. 4138: 352,
  68608. 4140: 338,
  68609. 4144: 9608,
  68610. 4145: 8216,
  68611. 4146: 8217,
  68612. 4147: 8220,
  68613. 4148: 8221,
  68614. 4149: 8226,
  68615. 4153: 8482,
  68616. 4154: 353,
  68617. 4156: 339,
  68618. 4157: 8480,
  68619. 4159: 376,
  68620. 4214: 8539,
  68621. 4215: 8540,
  68622. 4216: 8541,
  68623. 4217: 8542,
  68624. 4218: 9168,
  68625. 4219: 9124,
  68626. 4220: 9123,
  68627. 4221: 9135,
  68628. 4222: 9126,
  68629. 4223: 9121,
  68630. 4256: 12600
  68631. };
  68632. var get708CharFromCode = function(code) {
  68633. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  68634. if (code & 4096 && code === newCode) {
  68635. return "";
  68636. }
  68637. return String.fromCharCode(newCode);
  68638. };
  68639. var within708TextBlock = function(b) {
  68640. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  68641. };
  68642. var Cea708Window = function(windowNum) {
  68643. this.windowNum = windowNum;
  68644. this.reset();
  68645. };
  68646. Cea708Window.prototype.reset = function() {
  68647. this.clearText();
  68648. this.pendingNewLine = false;
  68649. this.winAttr = {};
  68650. this.penAttr = {};
  68651. this.penLoc = {};
  68652. this.penColor = {};
  68653. this.visible = 0;
  68654. this.rowLock = 0;
  68655. this.columnLock = 0;
  68656. this.priority = 0;
  68657. this.relativePositioning = 0;
  68658. this.anchorVertical = 0;
  68659. this.anchorHorizontal = 0;
  68660. this.anchorPoint = 0;
  68661. this.rowCount = 1;
  68662. this.virtualRowCount = this.rowCount + 1;
  68663. this.columnCount = 41;
  68664. this.windowStyle = 0;
  68665. this.penStyle = 0;
  68666. };
  68667. Cea708Window.prototype.getText = function() {
  68668. return this.rows.join("\n");
  68669. };
  68670. Cea708Window.prototype.clearText = function() {
  68671. this.rows = [""];
  68672. this.rowIdx = 0;
  68673. };
  68674. Cea708Window.prototype.newLine = function(pts) {
  68675. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  68676. this.beforeRowOverflow(pts);
  68677. }
  68678. if (this.rows.length > 0) {
  68679. this.rows.push("");
  68680. this.rowIdx++;
  68681. }
  68682. while (this.rows.length > this.virtualRowCount) {
  68683. this.rows.shift();
  68684. this.rowIdx--;
  68685. }
  68686. };
  68687. Cea708Window.prototype.isEmpty = function() {
  68688. if (this.rows.length === 0) {
  68689. return true;
  68690. } else if (this.rows.length === 1) {
  68691. return this.rows[0] === "";
  68692. }
  68693. return false;
  68694. };
  68695. Cea708Window.prototype.addText = function(text) {
  68696. this.rows[this.rowIdx] += text;
  68697. };
  68698. Cea708Window.prototype.backspace = function() {
  68699. if (!this.isEmpty()) {
  68700. var row = this.rows[this.rowIdx];
  68701. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  68702. }
  68703. };
  68704. var Cea708Service = function(serviceNum, encoding, stream2) {
  68705. this.serviceNum = serviceNum;
  68706. this.text = "";
  68707. this.currentWindow = new Cea708Window(-1);
  68708. this.windows = [];
  68709. this.stream = stream2;
  68710. if (typeof encoding === "string") {
  68711. this.createTextDecoder(encoding);
  68712. }
  68713. };
  68714. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  68715. this.startPts = pts;
  68716. for (var win3 = 0; win3 < 8; win3++) {
  68717. this.windows[win3] = new Cea708Window(win3);
  68718. if (typeof beforeRowOverflow === "function") {
  68719. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  68720. }
  68721. }
  68722. };
  68723. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  68724. this.currentWindow = this.windows[windowNum];
  68725. };
  68726. Cea708Service.prototype.createTextDecoder = function(encoding) {
  68727. if (typeof TextDecoder === "undefined") {
  68728. this.stream.trigger("log", {
  68729. level: "warn",
  68730. message: "The `encoding` option is unsupported without TextDecoder support"
  68731. });
  68732. } else {
  68733. try {
  68734. this.textDecoder_ = new TextDecoder(encoding);
  68735. } catch (error) {
  68736. this.stream.trigger("log", {
  68737. level: "warn",
  68738. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  68739. });
  68740. }
  68741. }
  68742. };
  68743. var Cea708Stream = function(options2) {
  68744. options2 = options2 || {};
  68745. Cea708Stream.prototype.init.call(this);
  68746. var self2 = this;
  68747. var captionServices = options2.captionServices || {};
  68748. var captionServiceEncodings = {};
  68749. var serviceProps;
  68750. Object.keys(captionServices).forEach((serviceName) => {
  68751. serviceProps = captionServices[serviceName];
  68752. if (/^SERVICE/.test(serviceName)) {
  68753. captionServiceEncodings[serviceName] = serviceProps.encoding;
  68754. }
  68755. });
  68756. this.serviceEncodings = captionServiceEncodings;
  68757. this.current708Packet = null;
  68758. this.services = {};
  68759. this.push = function(packet) {
  68760. if (packet.type === 3) {
  68761. self2.new708Packet();
  68762. self2.add708Bytes(packet);
  68763. } else {
  68764. if (self2.current708Packet === null) {
  68765. self2.new708Packet();
  68766. }
  68767. self2.add708Bytes(packet);
  68768. }
  68769. };
  68770. };
  68771. Cea708Stream.prototype = new Stream$7();
  68772. Cea708Stream.prototype.new708Packet = function() {
  68773. if (this.current708Packet !== null) {
  68774. this.push708Packet();
  68775. }
  68776. this.current708Packet = {
  68777. data: [],
  68778. ptsVals: []
  68779. };
  68780. };
  68781. Cea708Stream.prototype.add708Bytes = function(packet) {
  68782. var data = packet.ccData;
  68783. var byte0 = data >>> 8;
  68784. var byte1 = data & 255;
  68785. this.current708Packet.ptsVals.push(packet.pts);
  68786. this.current708Packet.data.push(byte0);
  68787. this.current708Packet.data.push(byte1);
  68788. };
  68789. Cea708Stream.prototype.push708Packet = function() {
  68790. var packet708 = this.current708Packet;
  68791. var packetData = packet708.data;
  68792. var serviceNum = null;
  68793. var blockSize = null;
  68794. var i2 = 0;
  68795. var b = packetData[i2++];
  68796. packet708.seq = b >> 6;
  68797. packet708.sizeCode = b & 63;
  68798. for (; i2 < packetData.length; i2++) {
  68799. b = packetData[i2++];
  68800. serviceNum = b >> 5;
  68801. blockSize = b & 31;
  68802. if (serviceNum === 7 && blockSize > 0) {
  68803. b = packetData[i2++];
  68804. serviceNum = b;
  68805. }
  68806. this.pushServiceBlock(serviceNum, i2, blockSize);
  68807. if (blockSize > 0) {
  68808. i2 += blockSize - 1;
  68809. }
  68810. }
  68811. };
  68812. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  68813. var b;
  68814. var i2 = start2;
  68815. var packetData = this.current708Packet.data;
  68816. var service = this.services[serviceNum];
  68817. if (!service) {
  68818. service = this.initService(serviceNum, i2);
  68819. }
  68820. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  68821. b = packetData[i2];
  68822. if (within708TextBlock(b)) {
  68823. i2 = this.handleText(i2, service);
  68824. } else if (b === 24) {
  68825. i2 = this.multiByteCharacter(i2, service);
  68826. } else if (b === 16) {
  68827. i2 = this.extendedCommands(i2, service);
  68828. } else if (128 <= b && b <= 135) {
  68829. i2 = this.setCurrentWindow(i2, service);
  68830. } else if (152 <= b && b <= 159) {
  68831. i2 = this.defineWindow(i2, service);
  68832. } else if (b === 136) {
  68833. i2 = this.clearWindows(i2, service);
  68834. } else if (b === 140) {
  68835. i2 = this.deleteWindows(i2, service);
  68836. } else if (b === 137) {
  68837. i2 = this.displayWindows(i2, service);
  68838. } else if (b === 138) {
  68839. i2 = this.hideWindows(i2, service);
  68840. } else if (b === 139) {
  68841. i2 = this.toggleWindows(i2, service);
  68842. } else if (b === 151) {
  68843. i2 = this.setWindowAttributes(i2, service);
  68844. } else if (b === 144) {
  68845. i2 = this.setPenAttributes(i2, service);
  68846. } else if (b === 145) {
  68847. i2 = this.setPenColor(i2, service);
  68848. } else if (b === 146) {
  68849. i2 = this.setPenLocation(i2, service);
  68850. } else if (b === 143) {
  68851. service = this.reset(i2, service);
  68852. } else if (b === 8) {
  68853. service.currentWindow.backspace();
  68854. } else if (b === 12) {
  68855. service.currentWindow.clearText();
  68856. } else if (b === 13) {
  68857. service.currentWindow.pendingNewLine = true;
  68858. } else if (b === 14) {
  68859. service.currentWindow.clearText();
  68860. } else if (b === 141) {
  68861. i2++;
  68862. } else
  68863. ;
  68864. }
  68865. };
  68866. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  68867. var packetData = this.current708Packet.data;
  68868. var b = packetData[++i2];
  68869. if (within708TextBlock(b)) {
  68870. i2 = this.handleText(i2, service, {
  68871. isExtended: true
  68872. });
  68873. }
  68874. return i2;
  68875. };
  68876. Cea708Stream.prototype.getPts = function(byteIndex) {
  68877. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  68878. };
  68879. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  68880. var serviceName = "SERVICE" + serviceNum;
  68881. var self2 = this;
  68882. var serviceName;
  68883. var encoding;
  68884. if (serviceName in this.serviceEncodings) {
  68885. encoding = this.serviceEncodings[serviceName];
  68886. }
  68887. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  68888. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  68889. self2.flushDisplayed(pts, self2.services[serviceNum]);
  68890. });
  68891. return this.services[serviceNum];
  68892. };
  68893. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  68894. var isExtended = options2 && options2.isExtended;
  68895. var isMultiByte = options2 && options2.isMultiByte;
  68896. var packetData = this.current708Packet.data;
  68897. var extended = isExtended ? 4096 : 0;
  68898. var currentByte = packetData[i2];
  68899. var nextByte = packetData[i2 + 1];
  68900. var win3 = service.currentWindow;
  68901. var char;
  68902. var charCodeArray;
  68903. if (service.textDecoder_ && !isExtended) {
  68904. if (isMultiByte) {
  68905. charCodeArray = [currentByte, nextByte];
  68906. i2++;
  68907. } else {
  68908. charCodeArray = [currentByte];
  68909. }
  68910. char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  68911. } else {
  68912. char = get708CharFromCode(extended | currentByte);
  68913. }
  68914. if (win3.pendingNewLine && !win3.isEmpty()) {
  68915. win3.newLine(this.getPts(i2));
  68916. }
  68917. win3.pendingNewLine = false;
  68918. win3.addText(char);
  68919. return i2;
  68920. };
  68921. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  68922. var packetData = this.current708Packet.data;
  68923. var firstByte = packetData[i2 + 1];
  68924. var secondByte = packetData[i2 + 2];
  68925. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  68926. i2 = this.handleText(++i2, service, {
  68927. isMultiByte: true
  68928. });
  68929. }
  68930. return i2;
  68931. };
  68932. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  68933. var packetData = this.current708Packet.data;
  68934. var b = packetData[i2];
  68935. var windowNum = b & 7;
  68936. service.setCurrentWindow(windowNum);
  68937. return i2;
  68938. };
  68939. Cea708Stream.prototype.defineWindow = function(i2, service) {
  68940. var packetData = this.current708Packet.data;
  68941. var b = packetData[i2];
  68942. var windowNum = b & 7;
  68943. service.setCurrentWindow(windowNum);
  68944. var win3 = service.currentWindow;
  68945. b = packetData[++i2];
  68946. win3.visible = (b & 32) >> 5;
  68947. win3.rowLock = (b & 16) >> 4;
  68948. win3.columnLock = (b & 8) >> 3;
  68949. win3.priority = b & 7;
  68950. b = packetData[++i2];
  68951. win3.relativePositioning = (b & 128) >> 7;
  68952. win3.anchorVertical = b & 127;
  68953. b = packetData[++i2];
  68954. win3.anchorHorizontal = b;
  68955. b = packetData[++i2];
  68956. win3.anchorPoint = (b & 240) >> 4;
  68957. win3.rowCount = b & 15;
  68958. b = packetData[++i2];
  68959. win3.columnCount = b & 63;
  68960. b = packetData[++i2];
  68961. win3.windowStyle = (b & 56) >> 3;
  68962. win3.penStyle = b & 7;
  68963. win3.virtualRowCount = win3.rowCount + 1;
  68964. return i2;
  68965. };
  68966. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  68967. var packetData = this.current708Packet.data;
  68968. var b = packetData[i2];
  68969. var winAttr = service.currentWindow.winAttr;
  68970. b = packetData[++i2];
  68971. winAttr.fillOpacity = (b & 192) >> 6;
  68972. winAttr.fillRed = (b & 48) >> 4;
  68973. winAttr.fillGreen = (b & 12) >> 2;
  68974. winAttr.fillBlue = b & 3;
  68975. b = packetData[++i2];
  68976. winAttr.borderType = (b & 192) >> 6;
  68977. winAttr.borderRed = (b & 48) >> 4;
  68978. winAttr.borderGreen = (b & 12) >> 2;
  68979. winAttr.borderBlue = b & 3;
  68980. b = packetData[++i2];
  68981. winAttr.borderType += (b & 128) >> 5;
  68982. winAttr.wordWrap = (b & 64) >> 6;
  68983. winAttr.printDirection = (b & 48) >> 4;
  68984. winAttr.scrollDirection = (b & 12) >> 2;
  68985. winAttr.justify = b & 3;
  68986. b = packetData[++i2];
  68987. winAttr.effectSpeed = (b & 240) >> 4;
  68988. winAttr.effectDirection = (b & 12) >> 2;
  68989. winAttr.displayEffect = b & 3;
  68990. return i2;
  68991. };
  68992. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  68993. var displayedText = [];
  68994. for (var winId = 0; winId < 8; winId++) {
  68995. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  68996. displayedText.push(service.windows[winId].getText());
  68997. }
  68998. }
  68999. service.endPts = pts;
  69000. service.text = displayedText.join("\n\n");
  69001. this.pushCaption(service);
  69002. service.startPts = pts;
  69003. };
  69004. Cea708Stream.prototype.pushCaption = function(service) {
  69005. if (service.text !== "") {
  69006. this.trigger("data", {
  69007. startPts: service.startPts,
  69008. endPts: service.endPts,
  69009. text: service.text,
  69010. stream: "cc708_" + service.serviceNum
  69011. });
  69012. service.text = "";
  69013. service.startPts = service.endPts;
  69014. }
  69015. };
  69016. Cea708Stream.prototype.displayWindows = function(i2, service) {
  69017. var packetData = this.current708Packet.data;
  69018. var b = packetData[++i2];
  69019. var pts = this.getPts(i2);
  69020. this.flushDisplayed(pts, service);
  69021. for (var winId = 0; winId < 8; winId++) {
  69022. if (b & 1 << winId) {
  69023. service.windows[winId].visible = 1;
  69024. }
  69025. }
  69026. return i2;
  69027. };
  69028. Cea708Stream.prototype.hideWindows = function(i2, service) {
  69029. var packetData = this.current708Packet.data;
  69030. var b = packetData[++i2];
  69031. var pts = this.getPts(i2);
  69032. this.flushDisplayed(pts, service);
  69033. for (var winId = 0; winId < 8; winId++) {
  69034. if (b & 1 << winId) {
  69035. service.windows[winId].visible = 0;
  69036. }
  69037. }
  69038. return i2;
  69039. };
  69040. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  69041. var packetData = this.current708Packet.data;
  69042. var b = packetData[++i2];
  69043. var pts = this.getPts(i2);
  69044. this.flushDisplayed(pts, service);
  69045. for (var winId = 0; winId < 8; winId++) {
  69046. if (b & 1 << winId) {
  69047. service.windows[winId].visible ^= 1;
  69048. }
  69049. }
  69050. return i2;
  69051. };
  69052. Cea708Stream.prototype.clearWindows = function(i2, service) {
  69053. var packetData = this.current708Packet.data;
  69054. var b = packetData[++i2];
  69055. var pts = this.getPts(i2);
  69056. this.flushDisplayed(pts, service);
  69057. for (var winId = 0; winId < 8; winId++) {
  69058. if (b & 1 << winId) {
  69059. service.windows[winId].clearText();
  69060. }
  69061. }
  69062. return i2;
  69063. };
  69064. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  69065. var packetData = this.current708Packet.data;
  69066. var b = packetData[++i2];
  69067. var pts = this.getPts(i2);
  69068. this.flushDisplayed(pts, service);
  69069. for (var winId = 0; winId < 8; winId++) {
  69070. if (b & 1 << winId) {
  69071. service.windows[winId].reset();
  69072. }
  69073. }
  69074. return i2;
  69075. };
  69076. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  69077. var packetData = this.current708Packet.data;
  69078. var b = packetData[i2];
  69079. var penAttr = service.currentWindow.penAttr;
  69080. b = packetData[++i2];
  69081. penAttr.textTag = (b & 240) >> 4;
  69082. penAttr.offset = (b & 12) >> 2;
  69083. penAttr.penSize = b & 3;
  69084. b = packetData[++i2];
  69085. penAttr.italics = (b & 128) >> 7;
  69086. penAttr.underline = (b & 64) >> 6;
  69087. penAttr.edgeType = (b & 56) >> 3;
  69088. penAttr.fontStyle = b & 7;
  69089. return i2;
  69090. };
  69091. Cea708Stream.prototype.setPenColor = function(i2, service) {
  69092. var packetData = this.current708Packet.data;
  69093. var b = packetData[i2];
  69094. var penColor = service.currentWindow.penColor;
  69095. b = packetData[++i2];
  69096. penColor.fgOpacity = (b & 192) >> 6;
  69097. penColor.fgRed = (b & 48) >> 4;
  69098. penColor.fgGreen = (b & 12) >> 2;
  69099. penColor.fgBlue = b & 3;
  69100. b = packetData[++i2];
  69101. penColor.bgOpacity = (b & 192) >> 6;
  69102. penColor.bgRed = (b & 48) >> 4;
  69103. penColor.bgGreen = (b & 12) >> 2;
  69104. penColor.bgBlue = b & 3;
  69105. b = packetData[++i2];
  69106. penColor.edgeRed = (b & 48) >> 4;
  69107. penColor.edgeGreen = (b & 12) >> 2;
  69108. penColor.edgeBlue = b & 3;
  69109. return i2;
  69110. };
  69111. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  69112. var packetData = this.current708Packet.data;
  69113. var b = packetData[i2];
  69114. var penLoc = service.currentWindow.penLoc;
  69115. service.currentWindow.pendingNewLine = true;
  69116. b = packetData[++i2];
  69117. penLoc.row = b & 15;
  69118. b = packetData[++i2];
  69119. penLoc.column = b & 63;
  69120. return i2;
  69121. };
  69122. Cea708Stream.prototype.reset = function(i2, service) {
  69123. var pts = this.getPts(i2);
  69124. this.flushDisplayed(pts, service);
  69125. return this.initService(service.serviceNum, i2);
  69126. };
  69127. var CHARACTER_TRANSLATION = {
  69128. 42: 225,
  69129. 92: 233,
  69130. 94: 237,
  69131. 95: 243,
  69132. 96: 250,
  69133. 123: 231,
  69134. 124: 247,
  69135. 125: 209,
  69136. 126: 241,
  69137. 127: 9608,
  69138. 304: 174,
  69139. 305: 176,
  69140. 306: 189,
  69141. 307: 191,
  69142. 308: 8482,
  69143. 309: 162,
  69144. 310: 163,
  69145. 311: 9834,
  69146. 312: 224,
  69147. 313: 160,
  69148. 314: 232,
  69149. 315: 226,
  69150. 316: 234,
  69151. 317: 238,
  69152. 318: 244,
  69153. 319: 251,
  69154. 544: 193,
  69155. 545: 201,
  69156. 546: 211,
  69157. 547: 218,
  69158. 548: 220,
  69159. 549: 252,
  69160. 550: 8216,
  69161. 551: 161,
  69162. 552: 42,
  69163. 553: 39,
  69164. 554: 8212,
  69165. 555: 169,
  69166. 556: 8480,
  69167. 557: 8226,
  69168. 558: 8220,
  69169. 559: 8221,
  69170. 560: 192,
  69171. 561: 194,
  69172. 562: 199,
  69173. 563: 200,
  69174. 564: 202,
  69175. 565: 203,
  69176. 566: 235,
  69177. 567: 206,
  69178. 568: 207,
  69179. 569: 239,
  69180. 570: 212,
  69181. 571: 217,
  69182. 572: 249,
  69183. 573: 219,
  69184. 574: 171,
  69185. 575: 187,
  69186. 800: 195,
  69187. 801: 227,
  69188. 802: 205,
  69189. 803: 204,
  69190. 804: 236,
  69191. 805: 210,
  69192. 806: 242,
  69193. 807: 213,
  69194. 808: 245,
  69195. 809: 123,
  69196. 810: 125,
  69197. 811: 92,
  69198. 812: 94,
  69199. 813: 95,
  69200. 814: 124,
  69201. 815: 126,
  69202. 816: 196,
  69203. 817: 228,
  69204. 818: 214,
  69205. 819: 246,
  69206. 820: 223,
  69207. 821: 165,
  69208. 822: 164,
  69209. 823: 9474,
  69210. 824: 197,
  69211. 825: 229,
  69212. 826: 216,
  69213. 827: 248,
  69214. 828: 9484,
  69215. 829: 9488,
  69216. 830: 9492,
  69217. 831: 9496
  69218. };
  69219. var getCharFromCode = function(code) {
  69220. if (code === null) {
  69221. return "";
  69222. }
  69223. code = CHARACTER_TRANSLATION[code] || code;
  69224. return String.fromCharCode(code);
  69225. };
  69226. var BOTTOM_ROW = 14;
  69227. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  69228. var createDisplayBuffer = function() {
  69229. var result = [], i2 = BOTTOM_ROW + 1;
  69230. while (i2--) {
  69231. result.push("");
  69232. }
  69233. return result;
  69234. };
  69235. var Cea608Stream = function(field, dataChannel) {
  69236. Cea608Stream.prototype.init.call(this);
  69237. this.field_ = field || 0;
  69238. this.dataChannel_ = dataChannel || 0;
  69239. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  69240. this.setConstants();
  69241. this.reset();
  69242. this.push = function(packet) {
  69243. var data, swap, char0, char1, text;
  69244. data = packet.ccData & 32639;
  69245. if (data === this.lastControlCode_) {
  69246. this.lastControlCode_ = null;
  69247. return;
  69248. }
  69249. if ((data & 61440) === 4096) {
  69250. this.lastControlCode_ = data;
  69251. } else if (data !== this.PADDING_) {
  69252. this.lastControlCode_ = null;
  69253. }
  69254. char0 = data >>> 8;
  69255. char1 = data & 255;
  69256. if (data === this.PADDING_) {
  69257. return;
  69258. } else if (data === this.RESUME_CAPTION_LOADING_) {
  69259. this.mode_ = "popOn";
  69260. } else if (data === this.END_OF_CAPTION_) {
  69261. this.mode_ = "popOn";
  69262. this.clearFormatting(packet.pts);
  69263. this.flushDisplayed(packet.pts);
  69264. swap = this.displayed_;
  69265. this.displayed_ = this.nonDisplayed_;
  69266. this.nonDisplayed_ = swap;
  69267. this.startPts_ = packet.pts;
  69268. } else if (data === this.ROLL_UP_2_ROWS_) {
  69269. this.rollUpRows_ = 2;
  69270. this.setRollUp(packet.pts);
  69271. } else if (data === this.ROLL_UP_3_ROWS_) {
  69272. this.rollUpRows_ = 3;
  69273. this.setRollUp(packet.pts);
  69274. } else if (data === this.ROLL_UP_4_ROWS_) {
  69275. this.rollUpRows_ = 4;
  69276. this.setRollUp(packet.pts);
  69277. } else if (data === this.CARRIAGE_RETURN_) {
  69278. this.clearFormatting(packet.pts);
  69279. this.flushDisplayed(packet.pts);
  69280. this.shiftRowsUp_();
  69281. this.startPts_ = packet.pts;
  69282. } else if (data === this.BACKSPACE_) {
  69283. if (this.mode_ === "popOn") {
  69284. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69285. } else {
  69286. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69287. }
  69288. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  69289. this.flushDisplayed(packet.pts);
  69290. this.displayed_ = createDisplayBuffer();
  69291. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  69292. this.nonDisplayed_ = createDisplayBuffer();
  69293. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  69294. if (this.mode_ !== "paintOn") {
  69295. this.flushDisplayed(packet.pts);
  69296. this.displayed_ = createDisplayBuffer();
  69297. }
  69298. this.mode_ = "paintOn";
  69299. this.startPts_ = packet.pts;
  69300. } else if (this.isSpecialCharacter(char0, char1)) {
  69301. char0 = (char0 & 3) << 8;
  69302. text = getCharFromCode(char0 | char1);
  69303. this[this.mode_](packet.pts, text);
  69304. this.column_++;
  69305. } else if (this.isExtCharacter(char0, char1)) {
  69306. if (this.mode_ === "popOn") {
  69307. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69308. } else {
  69309. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69310. }
  69311. char0 = (char0 & 3) << 8;
  69312. text = getCharFromCode(char0 | char1);
  69313. this[this.mode_](packet.pts, text);
  69314. this.column_++;
  69315. } else if (this.isMidRowCode(char0, char1)) {
  69316. this.clearFormatting(packet.pts);
  69317. this[this.mode_](packet.pts, " ");
  69318. this.column_++;
  69319. if ((char1 & 14) === 14) {
  69320. this.addFormatting(packet.pts, ["i"]);
  69321. }
  69322. if ((char1 & 1) === 1) {
  69323. this.addFormatting(packet.pts, ["u"]);
  69324. }
  69325. } else if (this.isOffsetControlCode(char0, char1)) {
  69326. this.column_ += char1 & 3;
  69327. } else if (this.isPAC(char0, char1)) {
  69328. var row = ROWS.indexOf(data & 7968);
  69329. if (this.mode_ === "rollUp") {
  69330. if (row - this.rollUpRows_ + 1 < 0) {
  69331. row = this.rollUpRows_ - 1;
  69332. }
  69333. this.setRollUp(packet.pts, row);
  69334. }
  69335. if (row !== this.row_) {
  69336. this.clearFormatting(packet.pts);
  69337. this.row_ = row;
  69338. }
  69339. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  69340. this.addFormatting(packet.pts, ["u"]);
  69341. }
  69342. if ((data & 16) === 16) {
  69343. this.column_ = ((data & 14) >> 1) * 4;
  69344. }
  69345. if (this.isColorPAC(char1)) {
  69346. if ((char1 & 14) === 14) {
  69347. this.addFormatting(packet.pts, ["i"]);
  69348. }
  69349. }
  69350. } else if (this.isNormalChar(char0)) {
  69351. if (char1 === 0) {
  69352. char1 = null;
  69353. }
  69354. text = getCharFromCode(char0);
  69355. text += getCharFromCode(char1);
  69356. this[this.mode_](packet.pts, text);
  69357. this.column_ += text.length;
  69358. }
  69359. };
  69360. };
  69361. Cea608Stream.prototype = new Stream$7();
  69362. Cea608Stream.prototype.flushDisplayed = function(pts) {
  69363. var content = this.displayed_.map(function(row, index2) {
  69364. try {
  69365. return row.trim();
  69366. } catch (e) {
  69367. this.trigger("log", {
  69368. level: "warn",
  69369. message: "Skipping a malformed 608 caption at index " + index2 + "."
  69370. });
  69371. return "";
  69372. }
  69373. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  69374. if (content.length) {
  69375. this.trigger("data", {
  69376. startPts: this.startPts_,
  69377. endPts: pts,
  69378. text: content,
  69379. stream: this.name_
  69380. });
  69381. }
  69382. };
  69383. Cea608Stream.prototype.reset = function() {
  69384. this.mode_ = "popOn";
  69385. this.topRow_ = 0;
  69386. this.startPts_ = 0;
  69387. this.displayed_ = createDisplayBuffer();
  69388. this.nonDisplayed_ = createDisplayBuffer();
  69389. this.lastControlCode_ = null;
  69390. this.column_ = 0;
  69391. this.row_ = BOTTOM_ROW;
  69392. this.rollUpRows_ = 2;
  69393. this.formatting_ = [];
  69394. };
  69395. Cea608Stream.prototype.setConstants = function() {
  69396. if (this.dataChannel_ === 0) {
  69397. this.BASE_ = 16;
  69398. this.EXT_ = 17;
  69399. this.CONTROL_ = (20 | this.field_) << 8;
  69400. this.OFFSET_ = 23;
  69401. } else if (this.dataChannel_ === 1) {
  69402. this.BASE_ = 24;
  69403. this.EXT_ = 25;
  69404. this.CONTROL_ = (28 | this.field_) << 8;
  69405. this.OFFSET_ = 31;
  69406. }
  69407. this.PADDING_ = 0;
  69408. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  69409. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  69410. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  69411. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  69412. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  69413. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  69414. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  69415. this.BACKSPACE_ = this.CONTROL_ | 33;
  69416. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  69417. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  69418. };
  69419. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  69420. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  69421. };
  69422. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  69423. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  69424. };
  69425. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  69426. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  69427. };
  69428. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  69429. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  69430. };
  69431. Cea608Stream.prototype.isPAC = function(char0, char1) {
  69432. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  69433. };
  69434. Cea608Stream.prototype.isColorPAC = function(char1) {
  69435. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  69436. };
  69437. Cea608Stream.prototype.isNormalChar = function(char) {
  69438. return char >= 32 && char <= 127;
  69439. };
  69440. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  69441. if (this.mode_ !== "rollUp") {
  69442. this.row_ = BOTTOM_ROW;
  69443. this.mode_ = "rollUp";
  69444. this.flushDisplayed(pts);
  69445. this.nonDisplayed_ = createDisplayBuffer();
  69446. this.displayed_ = createDisplayBuffer();
  69447. }
  69448. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  69449. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  69450. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  69451. this.displayed_[this.row_ - i2] = "";
  69452. }
  69453. }
  69454. if (newBaseRow === void 0) {
  69455. newBaseRow = this.row_;
  69456. }
  69457. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  69458. };
  69459. Cea608Stream.prototype.addFormatting = function(pts, format) {
  69460. this.formatting_ = this.formatting_.concat(format);
  69461. var text = format.reduce(function(text2, format2) {
  69462. return text2 + "<" + format2 + ">";
  69463. }, "");
  69464. this[this.mode_](pts, text);
  69465. };
  69466. Cea608Stream.prototype.clearFormatting = function(pts) {
  69467. if (!this.formatting_.length) {
  69468. return;
  69469. }
  69470. var text = this.formatting_.reverse().reduce(function(text2, format) {
  69471. return text2 + "</" + format + ">";
  69472. }, "");
  69473. this.formatting_ = [];
  69474. this[this.mode_](pts, text);
  69475. };
  69476. Cea608Stream.prototype.popOn = function(pts, text) {
  69477. var baseRow = this.nonDisplayed_[this.row_];
  69478. baseRow += text;
  69479. this.nonDisplayed_[this.row_] = baseRow;
  69480. };
  69481. Cea608Stream.prototype.rollUp = function(pts, text) {
  69482. var baseRow = this.displayed_[this.row_];
  69483. baseRow += text;
  69484. this.displayed_[this.row_] = baseRow;
  69485. };
  69486. Cea608Stream.prototype.shiftRowsUp_ = function() {
  69487. var i2;
  69488. for (i2 = 0; i2 < this.topRow_; i2++) {
  69489. this.displayed_[i2] = "";
  69490. }
  69491. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  69492. this.displayed_[i2] = "";
  69493. }
  69494. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  69495. this.displayed_[i2] = this.displayed_[i2 + 1];
  69496. }
  69497. this.displayed_[this.row_] = "";
  69498. };
  69499. Cea608Stream.prototype.paintOn = function(pts, text) {
  69500. var baseRow = this.displayed_[this.row_];
  69501. baseRow += text;
  69502. this.displayed_[this.row_] = baseRow;
  69503. };
  69504. var captionStream = {
  69505. CaptionStream: CaptionStream$2,
  69506. Cea608Stream,
  69507. Cea708Stream
  69508. };
  69509. var streamTypes = {
  69510. H264_STREAM_TYPE: 27,
  69511. ADTS_STREAM_TYPE: 15,
  69512. METADATA_STREAM_TYPE: 21
  69513. };
  69514. var Stream$6 = stream;
  69515. var MAX_TS = 8589934592;
  69516. var RO_THRESH = 4294967296;
  69517. var TYPE_SHARED = "shared";
  69518. var handleRollover$1 = function(value, reference) {
  69519. var direction = 1;
  69520. if (value > reference) {
  69521. direction = -1;
  69522. }
  69523. while (Math.abs(reference - value) > RO_THRESH) {
  69524. value += direction * MAX_TS;
  69525. }
  69526. return value;
  69527. };
  69528. var TimestampRolloverStream$1 = function(type3) {
  69529. var lastDTS, referenceDTS;
  69530. TimestampRolloverStream$1.prototype.init.call(this);
  69531. this.type_ = type3 || TYPE_SHARED;
  69532. this.push = function(data) {
  69533. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  69534. return;
  69535. }
  69536. if (referenceDTS === void 0) {
  69537. referenceDTS = data.dts;
  69538. }
  69539. data.dts = handleRollover$1(data.dts, referenceDTS);
  69540. data.pts = handleRollover$1(data.pts, referenceDTS);
  69541. lastDTS = data.dts;
  69542. this.trigger("data", data);
  69543. };
  69544. this.flush = function() {
  69545. referenceDTS = lastDTS;
  69546. this.trigger("done");
  69547. };
  69548. this.endTimeline = function() {
  69549. this.flush();
  69550. this.trigger("endedtimeline");
  69551. };
  69552. this.discontinuity = function() {
  69553. referenceDTS = void 0;
  69554. lastDTS = void 0;
  69555. };
  69556. this.reset = function() {
  69557. this.discontinuity();
  69558. this.trigger("reset");
  69559. };
  69560. };
  69561. TimestampRolloverStream$1.prototype = new Stream$6();
  69562. var timestampRolloverStream = {
  69563. TimestampRolloverStream: TimestampRolloverStream$1,
  69564. handleRollover: handleRollover$1
  69565. };
  69566. var typedArrayIndexOf$1 = (typedArray2, element, fromIndex) => {
  69567. if (!typedArray2) {
  69568. return -1;
  69569. }
  69570. var currentIndex = fromIndex;
  69571. for (; currentIndex < typedArray2.length; currentIndex++) {
  69572. if (typedArray2[currentIndex] === element) {
  69573. return currentIndex;
  69574. }
  69575. }
  69576. return -1;
  69577. };
  69578. var typedArray = {
  69579. typedArrayIndexOf: typedArrayIndexOf$1
  69580. };
  69581. var typedArrayIndexOf = typedArray.typedArrayIndexOf, textEncodingDescriptionByte = {
  69582. Iso88591: 0,
  69583. Utf16: 1,
  69584. Utf16be: 2,
  69585. Utf8: 3
  69586. }, percentEncode$1 = function(bytes, start2, end) {
  69587. var i2, result = "";
  69588. for (i2 = start2; i2 < end; i2++) {
  69589. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  69590. }
  69591. return result;
  69592. }, parseUtf8 = function(bytes, start2, end) {
  69593. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  69594. }, parseIso88591$1 = function(bytes, start2, end) {
  69595. return unescape(percentEncode$1(bytes, start2, end));
  69596. }, parseSyncSafeInteger$1 = function(data) {
  69597. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  69598. }, frameParsers = {
  69599. "APIC": function(frame) {
  69600. var i2 = 1, mimeTypeEndIndex, descriptionEndIndex, LINK_MIME_TYPE = "-->";
  69601. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69602. return;
  69603. }
  69604. mimeTypeEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69605. if (mimeTypeEndIndex < 0) {
  69606. return;
  69607. }
  69608. frame.mimeType = parseIso88591$1(frame.data, i2, mimeTypeEndIndex);
  69609. i2 = mimeTypeEndIndex + 1;
  69610. frame.pictureType = frame.data[i2];
  69611. i2++;
  69612. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69613. if (descriptionEndIndex < 0) {
  69614. return;
  69615. }
  69616. frame.description = parseUtf8(frame.data, i2, descriptionEndIndex);
  69617. i2 = descriptionEndIndex + 1;
  69618. if (frame.mimeType === LINK_MIME_TYPE) {
  69619. frame.url = parseIso88591$1(frame.data, i2, frame.data.length);
  69620. } else {
  69621. frame.pictureData = frame.data.subarray(i2, frame.data.length);
  69622. }
  69623. },
  69624. "T*": function(frame) {
  69625. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69626. return;
  69627. }
  69628. frame.value = parseUtf8(frame.data, 1, frame.data.length).replace(/\0*$/, "");
  69629. frame.values = frame.value.split("\0");
  69630. },
  69631. "TXXX": function(frame) {
  69632. var descriptionEndIndex;
  69633. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69634. return;
  69635. }
  69636. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69637. if (descriptionEndIndex === -1) {
  69638. return;
  69639. }
  69640. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69641. frame.value = parseUtf8(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0*$/, "");
  69642. frame.data = frame.value;
  69643. },
  69644. "W*": function(frame) {
  69645. frame.url = parseIso88591$1(frame.data, 0, frame.data.length).replace(/\0.*$/, "");
  69646. },
  69647. "WXXX": function(frame) {
  69648. var descriptionEndIndex;
  69649. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69650. return;
  69651. }
  69652. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69653. if (descriptionEndIndex === -1) {
  69654. return;
  69655. }
  69656. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69657. frame.url = parseIso88591$1(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0.*$/, "");
  69658. },
  69659. "PRIV": function(frame) {
  69660. var i2;
  69661. for (i2 = 0; i2 < frame.data.length; i2++) {
  69662. if (frame.data[i2] === 0) {
  69663. frame.owner = parseIso88591$1(frame.data, 0, i2);
  69664. break;
  69665. }
  69666. }
  69667. frame.privateData = frame.data.subarray(i2 + 1);
  69668. frame.data = frame.privateData;
  69669. }
  69670. };
  69671. var parseId3Frames$1 = function(data) {
  69672. var frameSize, frameHeader, frameStart = 10, tagSize = 0, frames = [];
  69673. if (data.length < 10 || data[0] !== "I".charCodeAt(0) || data[1] !== "D".charCodeAt(0) || data[2] !== "3".charCodeAt(0)) {
  69674. return;
  69675. }
  69676. tagSize = parseSyncSafeInteger$1(data.subarray(6, 10));
  69677. tagSize += 10;
  69678. var hasExtendedHeader = data[5] & 64;
  69679. if (hasExtendedHeader) {
  69680. frameStart += 4;
  69681. frameStart += parseSyncSafeInteger$1(data.subarray(10, 14));
  69682. tagSize -= parseSyncSafeInteger$1(data.subarray(16, 20));
  69683. }
  69684. do {
  69685. frameSize = parseSyncSafeInteger$1(data.subarray(frameStart + 4, frameStart + 8));
  69686. if (frameSize < 1) {
  69687. break;
  69688. }
  69689. frameHeader = String.fromCharCode(data[frameStart], data[frameStart + 1], data[frameStart + 2], data[frameStart + 3]);
  69690. var frame = {
  69691. id: frameHeader,
  69692. data: data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69693. };
  69694. frame.key = frame.id;
  69695. if (frameParsers[frame.id]) {
  69696. frameParsers[frame.id](frame);
  69697. } else if (frame.id[0] === "T") {
  69698. frameParsers["T*"](frame);
  69699. } else if (frame.id[0] === "W") {
  69700. frameParsers["W*"](frame);
  69701. }
  69702. frames.push(frame);
  69703. frameStart += 10;
  69704. frameStart += frameSize;
  69705. } while (frameStart < tagSize);
  69706. return frames;
  69707. };
  69708. var parseId3 = {
  69709. parseId3Frames: parseId3Frames$1,
  69710. parseSyncSafeInteger: parseSyncSafeInteger$1,
  69711. frameParsers
  69712. };
  69713. var Stream$5 = stream, StreamTypes$3 = streamTypes, id3 = parseId3, MetadataStream;
  69714. MetadataStream = function(options2) {
  69715. var settings = {
  69716. descriptor: options2 && options2.descriptor
  69717. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  69718. MetadataStream.prototype.init.call(this);
  69719. this.dispatchType = StreamTypes$3.METADATA_STREAM_TYPE.toString(16);
  69720. if (settings.descriptor) {
  69721. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  69722. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  69723. }
  69724. }
  69725. this.push = function(chunk) {
  69726. var tag, frameStart, frameSize, frame, i3, frameHeader;
  69727. if (chunk.type !== "timed-metadata") {
  69728. return;
  69729. }
  69730. if (chunk.dataAlignmentIndicator) {
  69731. bufferSize = 0;
  69732. buffer.length = 0;
  69733. }
  69734. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  69735. this.trigger("log", {
  69736. level: "warn",
  69737. message: "Skipping unrecognized metadata packet"
  69738. });
  69739. return;
  69740. }
  69741. buffer.push(chunk);
  69742. bufferSize += chunk.data.byteLength;
  69743. if (buffer.length === 1) {
  69744. tagSize = id3.parseSyncSafeInteger(chunk.data.subarray(6, 10));
  69745. tagSize += 10;
  69746. }
  69747. if (bufferSize < tagSize) {
  69748. return;
  69749. }
  69750. tag = {
  69751. data: new Uint8Array(tagSize),
  69752. frames: [],
  69753. pts: buffer[0].pts,
  69754. dts: buffer[0].dts
  69755. };
  69756. for (i3 = 0; i3 < tagSize; ) {
  69757. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  69758. i3 += buffer[0].data.byteLength;
  69759. bufferSize -= buffer[0].data.byteLength;
  69760. buffer.shift();
  69761. }
  69762. frameStart = 10;
  69763. if (tag.data[5] & 64) {
  69764. frameStart += 4;
  69765. frameStart += id3.parseSyncSafeInteger(tag.data.subarray(10, 14));
  69766. tagSize -= id3.parseSyncSafeInteger(tag.data.subarray(16, 20));
  69767. }
  69768. do {
  69769. frameSize = id3.parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));
  69770. if (frameSize < 1) {
  69771. this.trigger("log", {
  69772. level: "warn",
  69773. message: "Malformed ID3 frame encountered. Skipping remaining metadata parsing."
  69774. });
  69775. break;
  69776. }
  69777. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  69778. frame = {
  69779. id: frameHeader,
  69780. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69781. };
  69782. frame.key = frame.id;
  69783. if (id3.frameParsers[frame.id]) {
  69784. id3.frameParsers[frame.id](frame);
  69785. } else if (frame.id[0] === "T") {
  69786. id3.frameParsers["T*"](frame);
  69787. } else if (frame.id[0] === "W") {
  69788. id3.frameParsers["W*"](frame);
  69789. }
  69790. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  69791. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  69792. size *= 4;
  69793. size += d2[7] & 3;
  69794. frame.timeStamp = size;
  69795. if (tag.pts === void 0 && tag.dts === void 0) {
  69796. tag.pts = frame.timeStamp;
  69797. tag.dts = frame.timeStamp;
  69798. }
  69799. this.trigger("timestamp", frame);
  69800. }
  69801. tag.frames.push(frame);
  69802. frameStart += 10;
  69803. frameStart += frameSize;
  69804. } while (frameStart < tagSize);
  69805. this.trigger("data", tag);
  69806. };
  69807. };
  69808. MetadataStream.prototype = new Stream$5();
  69809. var metadataStream = MetadataStream;
  69810. var Stream$4 = stream, CaptionStream$1 = captionStream, StreamTypes$2 = streamTypes, TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  69811. var TransportPacketStream, TransportParseStream, ElementaryStream;
  69812. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  69813. TransportPacketStream = function() {
  69814. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  69815. TransportPacketStream.prototype.init.call(this);
  69816. this.push = function(bytes) {
  69817. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  69818. if (bytesInBuffer) {
  69819. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  69820. everything.set(buffer.subarray(0, bytesInBuffer));
  69821. everything.set(bytes, bytesInBuffer);
  69822. bytesInBuffer = 0;
  69823. } else {
  69824. everything = bytes;
  69825. }
  69826. while (endIndex < everything.byteLength) {
  69827. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  69828. this.trigger("data", everything.subarray(startIndex, endIndex));
  69829. startIndex += MP2T_PACKET_LENGTH$1;
  69830. endIndex += MP2T_PACKET_LENGTH$1;
  69831. continue;
  69832. }
  69833. startIndex++;
  69834. endIndex++;
  69835. }
  69836. if (startIndex < everything.byteLength) {
  69837. buffer.set(everything.subarray(startIndex), 0);
  69838. bytesInBuffer = everything.byteLength - startIndex;
  69839. }
  69840. };
  69841. this.flush = function() {
  69842. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  69843. this.trigger("data", buffer);
  69844. bytesInBuffer = 0;
  69845. }
  69846. this.trigger("done");
  69847. };
  69848. this.endTimeline = function() {
  69849. this.flush();
  69850. this.trigger("endedtimeline");
  69851. };
  69852. this.reset = function() {
  69853. bytesInBuffer = 0;
  69854. this.trigger("reset");
  69855. };
  69856. };
  69857. TransportPacketStream.prototype = new Stream$4();
  69858. TransportParseStream = function() {
  69859. var parsePsi, parsePat2, parsePmt2, self2;
  69860. TransportParseStream.prototype.init.call(this);
  69861. self2 = this;
  69862. this.packetsWaitingForPmt = [];
  69863. this.programMapTable = void 0;
  69864. parsePsi = function(payload, psi) {
  69865. var offset = 0;
  69866. if (psi.payloadUnitStartIndicator) {
  69867. offset += payload[offset] + 1;
  69868. }
  69869. if (psi.type === "pat") {
  69870. parsePat2(payload.subarray(offset), psi);
  69871. } else {
  69872. parsePmt2(payload.subarray(offset), psi);
  69873. }
  69874. };
  69875. parsePat2 = function(payload, pat) {
  69876. pat.section_number = payload[7];
  69877. pat.last_section_number = payload[8];
  69878. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  69879. pat.pmtPid = self2.pmtPid;
  69880. };
  69881. parsePmt2 = function(payload, pmt) {
  69882. var sectionLength, tableEnd, programInfoLength, offset;
  69883. if (!(payload[5] & 1)) {
  69884. return;
  69885. }
  69886. self2.programMapTable = {
  69887. video: null,
  69888. audio: null,
  69889. "timed-metadata": {}
  69890. };
  69891. sectionLength = (payload[1] & 15) << 8 | payload[2];
  69892. tableEnd = 3 + sectionLength - 4;
  69893. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  69894. offset = 12 + programInfoLength;
  69895. while (offset < tableEnd) {
  69896. var streamType = payload[offset];
  69897. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  69898. if (streamType === StreamTypes$2.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  69899. self2.programMapTable.video = pid;
  69900. } else if (streamType === StreamTypes$2.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  69901. self2.programMapTable.audio = pid;
  69902. } else if (streamType === StreamTypes$2.METADATA_STREAM_TYPE) {
  69903. self2.programMapTable["timed-metadata"][pid] = streamType;
  69904. }
  69905. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  69906. }
  69907. pmt.programMapTable = self2.programMapTable;
  69908. };
  69909. this.push = function(packet) {
  69910. var result = {}, offset = 4;
  69911. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  69912. result.pid = packet[1] & 31;
  69913. result.pid <<= 8;
  69914. result.pid |= packet[2];
  69915. if ((packet[3] & 48) >>> 4 > 1) {
  69916. offset += packet[offset] + 1;
  69917. }
  69918. if (result.pid === 0) {
  69919. result.type = "pat";
  69920. parsePsi(packet.subarray(offset), result);
  69921. this.trigger("data", result);
  69922. } else if (result.pid === this.pmtPid) {
  69923. result.type = "pmt";
  69924. parsePsi(packet.subarray(offset), result);
  69925. this.trigger("data", result);
  69926. while (this.packetsWaitingForPmt.length) {
  69927. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  69928. }
  69929. } else if (this.programMapTable === void 0) {
  69930. this.packetsWaitingForPmt.push([packet, offset, result]);
  69931. } else {
  69932. this.processPes_(packet, offset, result);
  69933. }
  69934. };
  69935. this.processPes_ = function(packet, offset, result) {
  69936. if (result.pid === this.programMapTable.video) {
  69937. result.streamType = StreamTypes$2.H264_STREAM_TYPE;
  69938. } else if (result.pid === this.programMapTable.audio) {
  69939. result.streamType = StreamTypes$2.ADTS_STREAM_TYPE;
  69940. } else {
  69941. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  69942. }
  69943. result.type = "pes";
  69944. result.data = packet.subarray(offset);
  69945. this.trigger("data", result);
  69946. };
  69947. };
  69948. TransportParseStream.prototype = new Stream$4();
  69949. TransportParseStream.STREAM_TYPES = {
  69950. h264: 27,
  69951. adts: 15
  69952. };
  69953. ElementaryStream = function() {
  69954. var self2 = this, segmentHadPmt = false, video = {
  69955. data: [],
  69956. size: 0
  69957. }, audio = {
  69958. data: [],
  69959. size: 0
  69960. }, timedMetadata = {
  69961. data: [],
  69962. size: 0
  69963. }, programMapTable, parsePes = function(payload, pes) {
  69964. var ptsDtsFlags;
  69965. const startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  69966. pes.data = new Uint8Array();
  69967. if (startPrefix !== 1) {
  69968. return;
  69969. }
  69970. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  69971. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  69972. ptsDtsFlags = payload[7];
  69973. if (ptsDtsFlags & 192) {
  69974. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  69975. pes.pts *= 4;
  69976. pes.pts += (payload[13] & 6) >>> 1;
  69977. pes.dts = pes.pts;
  69978. if (ptsDtsFlags & 64) {
  69979. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  69980. pes.dts *= 4;
  69981. pes.dts += (payload[18] & 6) >>> 1;
  69982. }
  69983. }
  69984. pes.data = payload.subarray(9 + payload[8]);
  69985. }, flushStream = function(stream2, type3, forceFlush) {
  69986. var packetData = new Uint8Array(stream2.size), event2 = {
  69987. type: type3
  69988. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  69989. if (!stream2.data.length || stream2.size < 9) {
  69990. return;
  69991. }
  69992. event2.trackId = stream2.data[0].pid;
  69993. for (i2 = 0; i2 < stream2.data.length; i2++) {
  69994. fragment = stream2.data[i2];
  69995. packetData.set(fragment.data, offset);
  69996. offset += fragment.data.byteLength;
  69997. }
  69998. parsePes(packetData, event2);
  69999. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  70000. if (forceFlush || packetFlushable) {
  70001. stream2.size = 0;
  70002. stream2.data.length = 0;
  70003. }
  70004. if (packetFlushable) {
  70005. self2.trigger("data", event2);
  70006. }
  70007. };
  70008. ElementaryStream.prototype.init.call(this);
  70009. this.push = function(data) {
  70010. ({
  70011. pat: function() {
  70012. },
  70013. pes: function() {
  70014. var stream2, streamType;
  70015. switch (data.streamType) {
  70016. case StreamTypes$2.H264_STREAM_TYPE:
  70017. stream2 = video;
  70018. streamType = "video";
  70019. break;
  70020. case StreamTypes$2.ADTS_STREAM_TYPE:
  70021. stream2 = audio;
  70022. streamType = "audio";
  70023. break;
  70024. case StreamTypes$2.METADATA_STREAM_TYPE:
  70025. stream2 = timedMetadata;
  70026. streamType = "timed-metadata";
  70027. break;
  70028. default:
  70029. return;
  70030. }
  70031. if (data.payloadUnitStartIndicator) {
  70032. flushStream(stream2, streamType, true);
  70033. }
  70034. stream2.data.push(data);
  70035. stream2.size += data.data.byteLength;
  70036. },
  70037. pmt: function() {
  70038. var event2 = {
  70039. type: "metadata",
  70040. tracks: []
  70041. };
  70042. programMapTable = data.programMapTable;
  70043. if (programMapTable.video !== null) {
  70044. event2.tracks.push({
  70045. timelineStartInfo: {
  70046. baseMediaDecodeTime: 0
  70047. },
  70048. id: +programMapTable.video,
  70049. codec: "avc",
  70050. type: "video"
  70051. });
  70052. }
  70053. if (programMapTable.audio !== null) {
  70054. event2.tracks.push({
  70055. timelineStartInfo: {
  70056. baseMediaDecodeTime: 0
  70057. },
  70058. id: +programMapTable.audio,
  70059. codec: "adts",
  70060. type: "audio"
  70061. });
  70062. }
  70063. segmentHadPmt = true;
  70064. self2.trigger("data", event2);
  70065. }
  70066. })[data.type]();
  70067. };
  70068. this.reset = function() {
  70069. video.size = 0;
  70070. video.data.length = 0;
  70071. audio.size = 0;
  70072. audio.data.length = 0;
  70073. this.trigger("reset");
  70074. };
  70075. this.flushStreams_ = function() {
  70076. flushStream(video, "video");
  70077. flushStream(audio, "audio");
  70078. flushStream(timedMetadata, "timed-metadata");
  70079. };
  70080. this.flush = function() {
  70081. if (!segmentHadPmt && programMapTable) {
  70082. var pmt = {
  70083. type: "metadata",
  70084. tracks: []
  70085. };
  70086. if (programMapTable.video !== null) {
  70087. pmt.tracks.push({
  70088. timelineStartInfo: {
  70089. baseMediaDecodeTime: 0
  70090. },
  70091. id: +programMapTable.video,
  70092. codec: "avc",
  70093. type: "video"
  70094. });
  70095. }
  70096. if (programMapTable.audio !== null) {
  70097. pmt.tracks.push({
  70098. timelineStartInfo: {
  70099. baseMediaDecodeTime: 0
  70100. },
  70101. id: +programMapTable.audio,
  70102. codec: "adts",
  70103. type: "audio"
  70104. });
  70105. }
  70106. self2.trigger("data", pmt);
  70107. }
  70108. segmentHadPmt = false;
  70109. this.flushStreams_();
  70110. this.trigger("done");
  70111. };
  70112. };
  70113. ElementaryStream.prototype = new Stream$4();
  70114. var m2ts$1 = {
  70115. PAT_PID: 0,
  70116. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  70117. TransportPacketStream,
  70118. TransportParseStream,
  70119. ElementaryStream,
  70120. TimestampRolloverStream,
  70121. CaptionStream: CaptionStream$1.CaptionStream,
  70122. Cea608Stream: CaptionStream$1.Cea608Stream,
  70123. Cea708Stream: CaptionStream$1.Cea708Stream,
  70124. MetadataStream: metadataStream
  70125. };
  70126. for (var type2 in StreamTypes$2) {
  70127. if (StreamTypes$2.hasOwnProperty(type2)) {
  70128. m2ts$1[type2] = StreamTypes$2[type2];
  70129. }
  70130. }
  70131. var m2ts_1 = m2ts$1;
  70132. var Stream$3 = stream;
  70133. var ONE_SECOND_IN_TS$2 = clock$2.ONE_SECOND_IN_TS;
  70134. var AdtsStream$1;
  70135. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70136. AdtsStream$1 = function(handlePartialSegments) {
  70137. var buffer, frameNum = 0;
  70138. AdtsStream$1.prototype.init.call(this);
  70139. this.skipWarn_ = function(start2, end) {
  70140. this.trigger("log", {
  70141. level: "warn",
  70142. message: `adts skiping bytes ${start2} to ${end} in frame ${frameNum} outside syncword`
  70143. });
  70144. };
  70145. this.push = function(packet) {
  70146. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  70147. if (!handlePartialSegments) {
  70148. frameNum = 0;
  70149. }
  70150. if (packet.type !== "audio") {
  70151. return;
  70152. }
  70153. if (buffer && buffer.length) {
  70154. oldBuffer = buffer;
  70155. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  70156. buffer.set(oldBuffer);
  70157. buffer.set(packet.data, oldBuffer.byteLength);
  70158. } else {
  70159. buffer = packet.data;
  70160. }
  70161. var skip;
  70162. while (i2 + 7 < buffer.length) {
  70163. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  70164. if (typeof skip !== "number") {
  70165. skip = i2;
  70166. }
  70167. i2++;
  70168. continue;
  70169. }
  70170. if (typeof skip === "number") {
  70171. this.skipWarn_(skip, i2);
  70172. skip = null;
  70173. }
  70174. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  70175. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  70176. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  70177. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  70178. if (buffer.byteLength - i2 < frameLength) {
  70179. break;
  70180. }
  70181. this.trigger("data", {
  70182. pts: packet.pts + frameNum * adtsFrameDuration,
  70183. dts: packet.dts + frameNum * adtsFrameDuration,
  70184. sampleCount,
  70185. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  70186. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  70187. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  70188. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  70189. samplesize: 16,
  70190. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  70191. });
  70192. frameNum++;
  70193. i2 += frameLength;
  70194. }
  70195. if (typeof skip === "number") {
  70196. this.skipWarn_(skip, i2);
  70197. skip = null;
  70198. }
  70199. buffer = buffer.subarray(i2);
  70200. };
  70201. this.flush = function() {
  70202. frameNum = 0;
  70203. this.trigger("done");
  70204. };
  70205. this.reset = function() {
  70206. buffer = void 0;
  70207. this.trigger("reset");
  70208. };
  70209. this.endTimeline = function() {
  70210. buffer = void 0;
  70211. this.trigger("endedtimeline");
  70212. };
  70213. };
  70214. AdtsStream$1.prototype = new Stream$3();
  70215. var adts = AdtsStream$1;
  70216. var ExpGolomb$1;
  70217. ExpGolomb$1 = function(workingData) {
  70218. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  70219. this.length = function() {
  70220. return 8 * workingBytesAvailable;
  70221. };
  70222. this.bitsAvailable = function() {
  70223. return 8 * workingBytesAvailable + workingBitsAvailable;
  70224. };
  70225. this.loadWord = function() {
  70226. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  70227. if (availableBytes === 0) {
  70228. throw new Error("no bytes available");
  70229. }
  70230. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  70231. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  70232. workingBitsAvailable = availableBytes * 8;
  70233. workingBytesAvailable -= availableBytes;
  70234. };
  70235. this.skipBits = function(count) {
  70236. var skipBytes;
  70237. if (workingBitsAvailable > count) {
  70238. workingWord <<= count;
  70239. workingBitsAvailable -= count;
  70240. } else {
  70241. count -= workingBitsAvailable;
  70242. skipBytes = Math.floor(count / 8);
  70243. count -= skipBytes * 8;
  70244. workingBytesAvailable -= skipBytes;
  70245. this.loadWord();
  70246. workingWord <<= count;
  70247. workingBitsAvailable -= count;
  70248. }
  70249. };
  70250. this.readBits = function(size) {
  70251. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  70252. workingBitsAvailable -= bits;
  70253. if (workingBitsAvailable > 0) {
  70254. workingWord <<= bits;
  70255. } else if (workingBytesAvailable > 0) {
  70256. this.loadWord();
  70257. }
  70258. bits = size - bits;
  70259. if (bits > 0) {
  70260. return valu << bits | this.readBits(bits);
  70261. }
  70262. return valu;
  70263. };
  70264. this.skipLeadingZeros = function() {
  70265. var leadingZeroCount;
  70266. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  70267. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  70268. workingWord <<= leadingZeroCount;
  70269. workingBitsAvailable -= leadingZeroCount;
  70270. return leadingZeroCount;
  70271. }
  70272. }
  70273. this.loadWord();
  70274. return leadingZeroCount + this.skipLeadingZeros();
  70275. };
  70276. this.skipUnsignedExpGolomb = function() {
  70277. this.skipBits(1 + this.skipLeadingZeros());
  70278. };
  70279. this.skipExpGolomb = function() {
  70280. this.skipBits(1 + this.skipLeadingZeros());
  70281. };
  70282. this.readUnsignedExpGolomb = function() {
  70283. var clz = this.skipLeadingZeros();
  70284. return this.readBits(clz + 1) - 1;
  70285. };
  70286. this.readExpGolomb = function() {
  70287. var valu = this.readUnsignedExpGolomb();
  70288. if (1 & valu) {
  70289. return 1 + valu >>> 1;
  70290. }
  70291. return -1 * (valu >>> 1);
  70292. };
  70293. this.readBoolean = function() {
  70294. return this.readBits(1) === 1;
  70295. };
  70296. this.readUnsignedByte = function() {
  70297. return this.readBits(8);
  70298. };
  70299. this.loadWord();
  70300. };
  70301. var expGolomb = ExpGolomb$1;
  70302. var Stream$2 = stream;
  70303. var ExpGolomb = expGolomb;
  70304. var H264Stream$1, NalByteStream;
  70305. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  70306. NalByteStream = function() {
  70307. var syncPoint = 0, i2, buffer;
  70308. NalByteStream.prototype.init.call(this);
  70309. this.push = function(data) {
  70310. var swapBuffer;
  70311. if (!buffer) {
  70312. buffer = data.data;
  70313. } else {
  70314. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  70315. swapBuffer.set(buffer);
  70316. swapBuffer.set(data.data, buffer.byteLength);
  70317. buffer = swapBuffer;
  70318. }
  70319. var len = buffer.byteLength;
  70320. for (; syncPoint < len - 3; syncPoint++) {
  70321. if (buffer[syncPoint + 2] === 1) {
  70322. i2 = syncPoint + 5;
  70323. break;
  70324. }
  70325. }
  70326. while (i2 < len) {
  70327. switch (buffer[i2]) {
  70328. case 0:
  70329. if (buffer[i2 - 1] !== 0) {
  70330. i2 += 2;
  70331. break;
  70332. } else if (buffer[i2 - 2] !== 0) {
  70333. i2++;
  70334. break;
  70335. }
  70336. if (syncPoint + 3 !== i2 - 2) {
  70337. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70338. }
  70339. do {
  70340. i2++;
  70341. } while (buffer[i2] !== 1 && i2 < len);
  70342. syncPoint = i2 - 2;
  70343. i2 += 3;
  70344. break;
  70345. case 1:
  70346. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  70347. i2 += 3;
  70348. break;
  70349. }
  70350. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70351. syncPoint = i2 - 2;
  70352. i2 += 3;
  70353. break;
  70354. default:
  70355. i2 += 3;
  70356. break;
  70357. }
  70358. }
  70359. buffer = buffer.subarray(syncPoint);
  70360. i2 -= syncPoint;
  70361. syncPoint = 0;
  70362. };
  70363. this.reset = function() {
  70364. buffer = null;
  70365. syncPoint = 0;
  70366. this.trigger("reset");
  70367. };
  70368. this.flush = function() {
  70369. if (buffer && buffer.byteLength > 3) {
  70370. this.trigger("data", buffer.subarray(syncPoint + 3));
  70371. }
  70372. buffer = null;
  70373. syncPoint = 0;
  70374. this.trigger("done");
  70375. };
  70376. this.endTimeline = function() {
  70377. this.flush();
  70378. this.trigger("endedtimeline");
  70379. };
  70380. };
  70381. NalByteStream.prototype = new Stream$2();
  70382. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  70383. 100: true,
  70384. 110: true,
  70385. 122: true,
  70386. 244: true,
  70387. 44: true,
  70388. 83: true,
  70389. 86: true,
  70390. 118: true,
  70391. 128: true,
  70392. 138: true,
  70393. 139: true,
  70394. 134: true
  70395. };
  70396. H264Stream$1 = function() {
  70397. var nalByteStream = new NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  70398. H264Stream$1.prototype.init.call(this);
  70399. self2 = this;
  70400. this.push = function(packet) {
  70401. if (packet.type !== "video") {
  70402. return;
  70403. }
  70404. trackId = packet.trackId;
  70405. currentPts = packet.pts;
  70406. currentDts = packet.dts;
  70407. nalByteStream.push(packet);
  70408. };
  70409. nalByteStream.on("data", function(data) {
  70410. var event2 = {
  70411. trackId,
  70412. pts: currentPts,
  70413. dts: currentDts,
  70414. data,
  70415. nalUnitTypeCode: data[0] & 31
  70416. };
  70417. switch (event2.nalUnitTypeCode) {
  70418. case 5:
  70419. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  70420. break;
  70421. case 6:
  70422. event2.nalUnitType = "sei_rbsp";
  70423. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70424. break;
  70425. case 7:
  70426. event2.nalUnitType = "seq_parameter_set_rbsp";
  70427. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70428. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  70429. break;
  70430. case 8:
  70431. event2.nalUnitType = "pic_parameter_set_rbsp";
  70432. break;
  70433. case 9:
  70434. event2.nalUnitType = "access_unit_delimiter_rbsp";
  70435. break;
  70436. }
  70437. self2.trigger("data", event2);
  70438. });
  70439. nalByteStream.on("done", function() {
  70440. self2.trigger("done");
  70441. });
  70442. nalByteStream.on("partialdone", function() {
  70443. self2.trigger("partialdone");
  70444. });
  70445. nalByteStream.on("reset", function() {
  70446. self2.trigger("reset");
  70447. });
  70448. nalByteStream.on("endedtimeline", function() {
  70449. self2.trigger("endedtimeline");
  70450. });
  70451. this.flush = function() {
  70452. nalByteStream.flush();
  70453. };
  70454. this.partialFlush = function() {
  70455. nalByteStream.partialFlush();
  70456. };
  70457. this.reset = function() {
  70458. nalByteStream.reset();
  70459. };
  70460. this.endTimeline = function() {
  70461. nalByteStream.endTimeline();
  70462. };
  70463. skipScalingList = function(count, expGolombDecoder) {
  70464. var lastScale = 8, nextScale = 8, j, deltaScale;
  70465. for (j = 0; j < count; j++) {
  70466. if (nextScale !== 0) {
  70467. deltaScale = expGolombDecoder.readExpGolomb();
  70468. nextScale = (lastScale + deltaScale + 256) % 256;
  70469. }
  70470. lastScale = nextScale === 0 ? lastScale : nextScale;
  70471. }
  70472. };
  70473. discardEmulationPreventionBytes5 = function(data) {
  70474. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  70475. while (i2 < length - 2) {
  70476. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  70477. emulationPreventionBytesPositions.push(i2 + 2);
  70478. i2 += 2;
  70479. } else {
  70480. i2++;
  70481. }
  70482. }
  70483. if (emulationPreventionBytesPositions.length === 0) {
  70484. return data;
  70485. }
  70486. newLength = length - emulationPreventionBytesPositions.length;
  70487. newData = new Uint8Array(newLength);
  70488. var sourceIndex = 0;
  70489. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  70490. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  70491. sourceIndex++;
  70492. emulationPreventionBytesPositions.shift();
  70493. }
  70494. newData[i2] = data[sourceIndex];
  70495. }
  70496. return newData;
  70497. };
  70498. readSequenceParameterSet = function(data) {
  70499. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  70500. expGolombDecoder = new ExpGolomb(data);
  70501. profileIdc = expGolombDecoder.readUnsignedByte();
  70502. profileCompatibility = expGolombDecoder.readUnsignedByte();
  70503. levelIdc = expGolombDecoder.readUnsignedByte();
  70504. expGolombDecoder.skipUnsignedExpGolomb();
  70505. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  70506. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  70507. if (chromaFormatIdc === 3) {
  70508. expGolombDecoder.skipBits(1);
  70509. }
  70510. expGolombDecoder.skipUnsignedExpGolomb();
  70511. expGolombDecoder.skipUnsignedExpGolomb();
  70512. expGolombDecoder.skipBits(1);
  70513. if (expGolombDecoder.readBoolean()) {
  70514. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  70515. for (i2 = 0; i2 < scalingListCount; i2++) {
  70516. if (expGolombDecoder.readBoolean()) {
  70517. if (i2 < 6) {
  70518. skipScalingList(16, expGolombDecoder);
  70519. } else {
  70520. skipScalingList(64, expGolombDecoder);
  70521. }
  70522. }
  70523. }
  70524. }
  70525. }
  70526. expGolombDecoder.skipUnsignedExpGolomb();
  70527. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  70528. if (picOrderCntType === 0) {
  70529. expGolombDecoder.readUnsignedExpGolomb();
  70530. } else if (picOrderCntType === 1) {
  70531. expGolombDecoder.skipBits(1);
  70532. expGolombDecoder.skipExpGolomb();
  70533. expGolombDecoder.skipExpGolomb();
  70534. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  70535. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  70536. expGolombDecoder.skipExpGolomb();
  70537. }
  70538. }
  70539. expGolombDecoder.skipUnsignedExpGolomb();
  70540. expGolombDecoder.skipBits(1);
  70541. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70542. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70543. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  70544. if (frameMbsOnlyFlag === 0) {
  70545. expGolombDecoder.skipBits(1);
  70546. }
  70547. expGolombDecoder.skipBits(1);
  70548. if (expGolombDecoder.readBoolean()) {
  70549. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  70550. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  70551. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  70552. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  70553. }
  70554. if (expGolombDecoder.readBoolean()) {
  70555. if (expGolombDecoder.readBoolean()) {
  70556. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  70557. switch (aspectRatioIdc) {
  70558. case 1:
  70559. sarRatio = [1, 1];
  70560. break;
  70561. case 2:
  70562. sarRatio = [12, 11];
  70563. break;
  70564. case 3:
  70565. sarRatio = [10, 11];
  70566. break;
  70567. case 4:
  70568. sarRatio = [16, 11];
  70569. break;
  70570. case 5:
  70571. sarRatio = [40, 33];
  70572. break;
  70573. case 6:
  70574. sarRatio = [24, 11];
  70575. break;
  70576. case 7:
  70577. sarRatio = [20, 11];
  70578. break;
  70579. case 8:
  70580. sarRatio = [32, 11];
  70581. break;
  70582. case 9:
  70583. sarRatio = [80, 33];
  70584. break;
  70585. case 10:
  70586. sarRatio = [18, 11];
  70587. break;
  70588. case 11:
  70589. sarRatio = [15, 11];
  70590. break;
  70591. case 12:
  70592. sarRatio = [64, 33];
  70593. break;
  70594. case 13:
  70595. sarRatio = [160, 99];
  70596. break;
  70597. case 14:
  70598. sarRatio = [4, 3];
  70599. break;
  70600. case 15:
  70601. sarRatio = [3, 2];
  70602. break;
  70603. case 16:
  70604. sarRatio = [2, 1];
  70605. break;
  70606. case 255: {
  70607. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  70608. break;
  70609. }
  70610. }
  70611. if (sarRatio) {
  70612. sarRatio[0] / sarRatio[1];
  70613. }
  70614. }
  70615. }
  70616. return {
  70617. profileIdc,
  70618. levelIdc,
  70619. profileCompatibility,
  70620. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  70621. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  70622. sarRatio
  70623. };
  70624. };
  70625. };
  70626. H264Stream$1.prototype = new Stream$2();
  70627. var h2643 = {
  70628. H264Stream: H264Stream$1,
  70629. NalByteStream
  70630. };
  70631. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70632. var parseId3TagSize = function(header, byteIndex) {
  70633. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  70634. returnSize = returnSize >= 0 ? returnSize : 0;
  70635. if (footerPresent) {
  70636. return returnSize + 20;
  70637. }
  70638. return returnSize + 10;
  70639. };
  70640. var getId3Offset4 = function(data, offset) {
  70641. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  70642. return offset;
  70643. }
  70644. offset += parseId3TagSize(data, offset);
  70645. return getId3Offset4(data, offset);
  70646. };
  70647. var isLikelyAacData$1 = function(data) {
  70648. var offset = getId3Offset4(data, 0);
  70649. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  70650. };
  70651. var parseSyncSafeInteger = function(data) {
  70652. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  70653. };
  70654. var percentEncode = function(bytes, start2, end) {
  70655. var i2, result = "";
  70656. for (i2 = start2; i2 < end; i2++) {
  70657. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  70658. }
  70659. return result;
  70660. };
  70661. var parseIso88591 = function(bytes, start2, end) {
  70662. return unescape(percentEncode(bytes, start2, end));
  70663. };
  70664. var parseAdtsSize = function(header, byteIndex) {
  70665. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  70666. return highTwo | middle | lowThree;
  70667. };
  70668. var parseType$4 = function(header, byteIndex) {
  70669. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  70670. return "timed-metadata";
  70671. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  70672. return "audio";
  70673. }
  70674. return null;
  70675. };
  70676. var parseSampleRate = function(packet) {
  70677. var i2 = 0;
  70678. while (i2 + 5 < packet.length) {
  70679. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  70680. i2++;
  70681. continue;
  70682. }
  70683. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  70684. }
  70685. return null;
  70686. };
  70687. var parseAacTimestamp = function(packet) {
  70688. var frameStart, frameSize, frame, frameHeader;
  70689. frameStart = 10;
  70690. if (packet[5] & 64) {
  70691. frameStart += 4;
  70692. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  70693. }
  70694. do {
  70695. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  70696. if (frameSize < 1) {
  70697. return null;
  70698. }
  70699. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  70700. if (frameHeader === "PRIV") {
  70701. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  70702. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  70703. if (frame[i2] === 0) {
  70704. var owner = parseIso88591(frame, 0, i2);
  70705. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  70706. var d2 = frame.subarray(i2 + 1);
  70707. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  70708. size *= 4;
  70709. size += d2[7] & 3;
  70710. return size;
  70711. }
  70712. break;
  70713. }
  70714. }
  70715. }
  70716. frameStart += 10;
  70717. frameStart += frameSize;
  70718. } while (frameStart < packet.byteLength);
  70719. return null;
  70720. };
  70721. var utils2 = {
  70722. isLikelyAacData: isLikelyAacData$1,
  70723. parseId3TagSize,
  70724. parseAdtsSize,
  70725. parseType: parseType$4,
  70726. parseSampleRate,
  70727. parseAacTimestamp
  70728. };
  70729. var Stream$12 = stream;
  70730. var aacUtils = utils2;
  70731. var AacStream$1;
  70732. AacStream$1 = function() {
  70733. var everything = new Uint8Array(), timeStamp = 0;
  70734. AacStream$1.prototype.init.call(this);
  70735. this.setTimestamp = function(timestamp) {
  70736. timeStamp = timestamp;
  70737. };
  70738. this.push = function(bytes) {
  70739. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  70740. if (everything.length) {
  70741. tempLength = everything.length;
  70742. everything = new Uint8Array(bytes.byteLength + tempLength);
  70743. everything.set(everything.subarray(0, tempLength));
  70744. everything.set(bytes, tempLength);
  70745. } else {
  70746. everything = bytes;
  70747. }
  70748. while (everything.length - byteIndex >= 3) {
  70749. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  70750. if (everything.length - byteIndex < 10) {
  70751. break;
  70752. }
  70753. frameSize = aacUtils.parseId3TagSize(everything, byteIndex);
  70754. if (byteIndex + frameSize > everything.length) {
  70755. break;
  70756. }
  70757. chunk = {
  70758. type: "timed-metadata",
  70759. data: everything.subarray(byteIndex, byteIndex + frameSize)
  70760. };
  70761. this.trigger("data", chunk);
  70762. byteIndex += frameSize;
  70763. continue;
  70764. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  70765. if (everything.length - byteIndex < 7) {
  70766. break;
  70767. }
  70768. frameSize = aacUtils.parseAdtsSize(everything, byteIndex);
  70769. if (byteIndex + frameSize > everything.length) {
  70770. break;
  70771. }
  70772. packet = {
  70773. type: "audio",
  70774. data: everything.subarray(byteIndex, byteIndex + frameSize),
  70775. pts: timeStamp,
  70776. dts: timeStamp
  70777. };
  70778. this.trigger("data", packet);
  70779. byteIndex += frameSize;
  70780. continue;
  70781. }
  70782. byteIndex++;
  70783. }
  70784. bytesLeft = everything.length - byteIndex;
  70785. if (bytesLeft > 0) {
  70786. everything = everything.subarray(byteIndex);
  70787. } else {
  70788. everything = new Uint8Array();
  70789. }
  70790. };
  70791. this.reset = function() {
  70792. everything = new Uint8Array();
  70793. this.trigger("reset");
  70794. };
  70795. this.endTimeline = function() {
  70796. everything = new Uint8Array();
  70797. this.trigger("endedtimeline");
  70798. };
  70799. };
  70800. AacStream$1.prototype = new Stream$12();
  70801. var aac3 = AacStream$1;
  70802. var AUDIO_PROPERTIES$1 = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  70803. var audioProperties = AUDIO_PROPERTIES$1;
  70804. var VIDEO_PROPERTIES$1 = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  70805. var videoProperties = VIDEO_PROPERTIES$1;
  70806. var Stream2 = stream;
  70807. var mp43 = mp4Generator;
  70808. var frameUtils = frameUtils$1;
  70809. var audioFrameUtils = audioFrameUtils$1;
  70810. var trackDecodeInfo = trackDecodeInfo$1;
  70811. var m2ts = m2ts_1;
  70812. var clock2 = clock$2;
  70813. var AdtsStream = adts;
  70814. var H264Stream = h2643.H264Stream;
  70815. var AacStream = aac3;
  70816. var isLikelyAacData = utils2.isLikelyAacData;
  70817. var ONE_SECOND_IN_TS$12 = clock$2.ONE_SECOND_IN_TS;
  70818. var AUDIO_PROPERTIES = audioProperties;
  70819. var VIDEO_PROPERTIES = videoProperties;
  70820. var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;
  70821. var retriggerForStream = function(key, event2) {
  70822. event2.stream = key;
  70823. this.trigger("log", event2);
  70824. };
  70825. var addPipelineLogRetriggers = function(transmuxer2, pipeline) {
  70826. var keys3 = Object.keys(pipeline);
  70827. for (var i2 = 0; i2 < keys3.length; i2++) {
  70828. var key = keys3[i2];
  70829. if (key === "headOfPipeline" || !pipeline[key].on) {
  70830. continue;
  70831. }
  70832. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  70833. }
  70834. };
  70835. var arrayEquals = function(a, b) {
  70836. var i2;
  70837. if (a.length !== b.length) {
  70838. return false;
  70839. }
  70840. for (i2 = 0; i2 < a.length; i2++) {
  70841. if (a[i2] !== b[i2]) {
  70842. return false;
  70843. }
  70844. }
  70845. return true;
  70846. };
  70847. var generateSegmentTimingInfo = function(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  70848. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  70849. return {
  70850. start: {
  70851. dts: baseMediaDecodeTime,
  70852. pts: baseMediaDecodeTime + ptsOffsetFromDts
  70853. },
  70854. end: {
  70855. dts: baseMediaDecodeTime + decodeDuration,
  70856. pts: baseMediaDecodeTime + presentationDuration
  70857. },
  70858. prependedContentDuration,
  70859. baseMediaDecodeTime
  70860. };
  70861. };
  70862. AudioSegmentStream = function(track, options2) {
  70863. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  70864. options2 = options2 || {};
  70865. sequenceNumber = options2.firstSequenceNumber || 0;
  70866. AudioSegmentStream.prototype.init.call(this);
  70867. this.push = function(data) {
  70868. trackDecodeInfo.collectDtsInfo(track, data);
  70869. if (track) {
  70870. AUDIO_PROPERTIES.forEach(function(prop) {
  70871. track[prop] = data[prop];
  70872. });
  70873. }
  70874. adtsFrames.push(data);
  70875. };
  70876. this.setEarliestDts = function(earliestDts) {
  70877. earliestAllowedDts = earliestDts;
  70878. };
  70879. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  70880. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  70881. };
  70882. this.setAudioAppendStart = function(timestamp) {
  70883. audioAppendStartTs = timestamp;
  70884. };
  70885. this.flush = function() {
  70886. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  70887. if (adtsFrames.length === 0) {
  70888. this.trigger("done", "AudioSegmentStream");
  70889. return;
  70890. }
  70891. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  70892. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  70893. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  70894. track.samples = audioFrameUtils.generateSampleTable(frames);
  70895. mdat2 = mp43.mdat(audioFrameUtils.concatenateFrameData(frames));
  70896. adtsFrames = [];
  70897. moof2 = mp43.moof(sequenceNumber, [track]);
  70898. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  70899. sequenceNumber++;
  70900. boxes.set(moof2);
  70901. boxes.set(mdat2, moof2.byteLength);
  70902. trackDecodeInfo.clearDtsInfo(track);
  70903. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  70904. if (frames.length) {
  70905. segmentDuration = frames.length * frameDuration;
  70906. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  70907. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  70908. frames[0].dts,
  70909. frames[0].pts,
  70910. frames[0].dts + segmentDuration,
  70911. frames[0].pts + segmentDuration,
  70912. videoClockCyclesOfSilencePrefixed || 0
  70913. ));
  70914. this.trigger("timingInfo", {
  70915. start: frames[0].pts,
  70916. end: frames[0].pts + segmentDuration
  70917. });
  70918. }
  70919. this.trigger("data", {
  70920. track,
  70921. boxes
  70922. });
  70923. this.trigger("done", "AudioSegmentStream");
  70924. };
  70925. this.reset = function() {
  70926. trackDecodeInfo.clearDtsInfo(track);
  70927. adtsFrames = [];
  70928. this.trigger("reset");
  70929. };
  70930. };
  70931. AudioSegmentStream.prototype = new Stream2();
  70932. VideoSegmentStream = function(track, options2) {
  70933. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  70934. options2 = options2 || {};
  70935. sequenceNumber = options2.firstSequenceNumber || 0;
  70936. VideoSegmentStream.prototype.init.call(this);
  70937. delete track.minPTS;
  70938. this.gopCache_ = [];
  70939. this.push = function(nalUnit) {
  70940. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  70941. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  70942. config = nalUnit.config;
  70943. track.sps = [nalUnit.data];
  70944. VIDEO_PROPERTIES.forEach(function(prop) {
  70945. track[prop] = config[prop];
  70946. }, this);
  70947. }
  70948. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  70949. pps = nalUnit.data;
  70950. track.pps = [nalUnit.data];
  70951. }
  70952. nalUnits.push(nalUnit);
  70953. };
  70954. this.flush = function() {
  70955. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  70956. while (nalUnits.length) {
  70957. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  70958. break;
  70959. }
  70960. nalUnits.shift();
  70961. }
  70962. if (nalUnits.length === 0) {
  70963. this.resetStream_();
  70964. this.trigger("done", "VideoSegmentStream");
  70965. return;
  70966. }
  70967. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  70968. gops = frameUtils.groupFramesIntoGops(frames);
  70969. if (!gops[0][0].keyFrame) {
  70970. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  70971. if (gopForFusion) {
  70972. prependedContentDuration = gopForFusion.duration;
  70973. gops.unshift(gopForFusion);
  70974. gops.byteLength += gopForFusion.byteLength;
  70975. gops.nalCount += gopForFusion.nalCount;
  70976. gops.pts = gopForFusion.pts;
  70977. gops.dts = gopForFusion.dts;
  70978. gops.duration += gopForFusion.duration;
  70979. } else {
  70980. gops = frameUtils.extendFirstKeyFrame(gops);
  70981. }
  70982. }
  70983. if (gopsToAlignWith.length) {
  70984. var alignedGops;
  70985. if (options2.alignGopsAtEnd) {
  70986. alignedGops = this.alignGopsAtEnd_(gops);
  70987. } else {
  70988. alignedGops = this.alignGopsAtStart_(gops);
  70989. }
  70990. if (!alignedGops) {
  70991. this.gopCache_.unshift({
  70992. gop: gops.pop(),
  70993. pps: track.pps,
  70994. sps: track.sps
  70995. });
  70996. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  70997. nalUnits = [];
  70998. this.resetStream_();
  70999. this.trigger("done", "VideoSegmentStream");
  71000. return;
  71001. }
  71002. trackDecodeInfo.clearDtsInfo(track);
  71003. gops = alignedGops;
  71004. }
  71005. trackDecodeInfo.collectDtsInfo(track, gops);
  71006. track.samples = frameUtils.generateSampleTable(gops);
  71007. mdat2 = mp43.mdat(frameUtils.concatenateNalData(gops));
  71008. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  71009. this.trigger("processedGopsInfo", gops.map(function(gop) {
  71010. return {
  71011. pts: gop.pts,
  71012. dts: gop.dts,
  71013. byteLength: gop.byteLength
  71014. };
  71015. }));
  71016. firstGop = gops[0];
  71017. lastGop = gops[gops.length - 1];
  71018. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  71019. this.trigger("timingInfo", {
  71020. start: gops[0].pts,
  71021. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  71022. });
  71023. this.gopCache_.unshift({
  71024. gop: gops.pop(),
  71025. pps: track.pps,
  71026. sps: track.sps
  71027. });
  71028. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  71029. nalUnits = [];
  71030. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  71031. this.trigger("timelineStartInfo", track.timelineStartInfo);
  71032. moof2 = mp43.moof(sequenceNumber, [track]);
  71033. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  71034. sequenceNumber++;
  71035. boxes.set(moof2);
  71036. boxes.set(mdat2, moof2.byteLength);
  71037. this.trigger("data", {
  71038. track,
  71039. boxes
  71040. });
  71041. this.resetStream_();
  71042. this.trigger("done", "VideoSegmentStream");
  71043. };
  71044. this.reset = function() {
  71045. this.resetStream_();
  71046. nalUnits = [];
  71047. this.gopCache_.length = 0;
  71048. gopsToAlignWith.length = 0;
  71049. this.trigger("reset");
  71050. };
  71051. this.resetStream_ = function() {
  71052. trackDecodeInfo.clearDtsInfo(track);
  71053. config = void 0;
  71054. pps = void 0;
  71055. };
  71056. this.getGopForFusion_ = function(nalUnit) {
  71057. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  71058. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  71059. currentGopObj = this.gopCache_[i2];
  71060. currentGop = currentGopObj.gop;
  71061. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  71062. continue;
  71063. }
  71064. if (currentGop.dts < track.timelineStartInfo.dts) {
  71065. continue;
  71066. }
  71067. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  71068. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  71069. if (!nearestGopObj || nearestDistance > dtsDistance) {
  71070. nearestGopObj = currentGopObj;
  71071. nearestDistance = dtsDistance;
  71072. }
  71073. }
  71074. }
  71075. if (nearestGopObj) {
  71076. return nearestGopObj.gop;
  71077. }
  71078. return null;
  71079. };
  71080. this.alignGopsAtStart_ = function(gops) {
  71081. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  71082. byteLength = gops.byteLength;
  71083. nalCount = gops.nalCount;
  71084. duration5 = gops.duration;
  71085. alignIndex = gopIndex = 0;
  71086. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  71087. align = gopsToAlignWith[alignIndex];
  71088. gop = gops[gopIndex];
  71089. if (align.pts === gop.pts) {
  71090. break;
  71091. }
  71092. if (gop.pts > align.pts) {
  71093. alignIndex++;
  71094. continue;
  71095. }
  71096. gopIndex++;
  71097. byteLength -= gop.byteLength;
  71098. nalCount -= gop.nalCount;
  71099. duration5 -= gop.duration;
  71100. }
  71101. if (gopIndex === 0) {
  71102. return gops;
  71103. }
  71104. if (gopIndex === gops.length) {
  71105. return null;
  71106. }
  71107. alignedGops = gops.slice(gopIndex);
  71108. alignedGops.byteLength = byteLength;
  71109. alignedGops.duration = duration5;
  71110. alignedGops.nalCount = nalCount;
  71111. alignedGops.pts = alignedGops[0].pts;
  71112. alignedGops.dts = alignedGops[0].dts;
  71113. return alignedGops;
  71114. };
  71115. this.alignGopsAtEnd_ = function(gops) {
  71116. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  71117. alignIndex = gopsToAlignWith.length - 1;
  71118. gopIndex = gops.length - 1;
  71119. alignEndIndex = null;
  71120. matchFound = false;
  71121. while (alignIndex >= 0 && gopIndex >= 0) {
  71122. align = gopsToAlignWith[alignIndex];
  71123. gop = gops[gopIndex];
  71124. if (align.pts === gop.pts) {
  71125. matchFound = true;
  71126. break;
  71127. }
  71128. if (align.pts > gop.pts) {
  71129. alignIndex--;
  71130. continue;
  71131. }
  71132. if (alignIndex === gopsToAlignWith.length - 1) {
  71133. alignEndIndex = gopIndex;
  71134. }
  71135. gopIndex--;
  71136. }
  71137. if (!matchFound && alignEndIndex === null) {
  71138. return null;
  71139. }
  71140. var trimIndex;
  71141. if (matchFound) {
  71142. trimIndex = gopIndex;
  71143. } else {
  71144. trimIndex = alignEndIndex;
  71145. }
  71146. if (trimIndex === 0) {
  71147. return gops;
  71148. }
  71149. var alignedGops = gops.slice(trimIndex);
  71150. var metadata = alignedGops.reduce(function(total, gop2) {
  71151. total.byteLength += gop2.byteLength;
  71152. total.duration += gop2.duration;
  71153. total.nalCount += gop2.nalCount;
  71154. return total;
  71155. }, {
  71156. byteLength: 0,
  71157. duration: 0,
  71158. nalCount: 0
  71159. });
  71160. alignedGops.byteLength = metadata.byteLength;
  71161. alignedGops.duration = metadata.duration;
  71162. alignedGops.nalCount = metadata.nalCount;
  71163. alignedGops.pts = alignedGops[0].pts;
  71164. alignedGops.dts = alignedGops[0].dts;
  71165. return alignedGops;
  71166. };
  71167. this.alignGopsWith = function(newGopsToAlignWith) {
  71168. gopsToAlignWith = newGopsToAlignWith;
  71169. };
  71170. };
  71171. VideoSegmentStream.prototype = new Stream2();
  71172. CoalesceStream = function(options2, metadataStream2) {
  71173. this.numberOfTracks = 0;
  71174. this.metadataStream = metadataStream2;
  71175. options2 = options2 || {};
  71176. if (typeof options2.remux !== "undefined") {
  71177. this.remuxTracks = !!options2.remux;
  71178. } else {
  71179. this.remuxTracks = true;
  71180. }
  71181. if (typeof options2.keepOriginalTimestamps === "boolean") {
  71182. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  71183. } else {
  71184. this.keepOriginalTimestamps = false;
  71185. }
  71186. this.pendingTracks = [];
  71187. this.videoTrack = null;
  71188. this.pendingBoxes = [];
  71189. this.pendingCaptions = [];
  71190. this.pendingMetadata = [];
  71191. this.pendingBytes = 0;
  71192. this.emittedTracks = 0;
  71193. CoalesceStream.prototype.init.call(this);
  71194. this.push = function(output) {
  71195. if (output.text) {
  71196. return this.pendingCaptions.push(output);
  71197. }
  71198. if (output.frames) {
  71199. return this.pendingMetadata.push(output);
  71200. }
  71201. this.pendingTracks.push(output.track);
  71202. this.pendingBytes += output.boxes.byteLength;
  71203. if (output.track.type === "video") {
  71204. this.videoTrack = output.track;
  71205. this.pendingBoxes.push(output.boxes);
  71206. }
  71207. if (output.track.type === "audio") {
  71208. this.audioTrack = output.track;
  71209. this.pendingBoxes.unshift(output.boxes);
  71210. }
  71211. };
  71212. };
  71213. CoalesceStream.prototype = new Stream2();
  71214. CoalesceStream.prototype.flush = function(flushSource) {
  71215. var offset = 0, event2 = {
  71216. captions: [],
  71217. captionStreams: {},
  71218. metadata: [],
  71219. info: {}
  71220. }, caption, id32, initSegment, timelineStartPts = 0, i2;
  71221. if (this.pendingTracks.length < this.numberOfTracks) {
  71222. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  71223. return;
  71224. } else if (this.remuxTracks) {
  71225. return;
  71226. } else if (this.pendingTracks.length === 0) {
  71227. this.emittedTracks++;
  71228. if (this.emittedTracks >= this.numberOfTracks) {
  71229. this.trigger("done");
  71230. this.emittedTracks = 0;
  71231. }
  71232. return;
  71233. }
  71234. }
  71235. if (this.videoTrack) {
  71236. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  71237. VIDEO_PROPERTIES.forEach(function(prop) {
  71238. event2.info[prop] = this.videoTrack[prop];
  71239. }, this);
  71240. } else if (this.audioTrack) {
  71241. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  71242. AUDIO_PROPERTIES.forEach(function(prop) {
  71243. event2.info[prop] = this.audioTrack[prop];
  71244. }, this);
  71245. }
  71246. if (this.videoTrack || this.audioTrack) {
  71247. if (this.pendingTracks.length === 1) {
  71248. event2.type = this.pendingTracks[0].type;
  71249. } else {
  71250. event2.type = "combined";
  71251. }
  71252. this.emittedTracks += this.pendingTracks.length;
  71253. initSegment = mp43.initSegment(this.pendingTracks);
  71254. event2.initSegment = new Uint8Array(initSegment.byteLength);
  71255. event2.initSegment.set(initSegment);
  71256. event2.data = new Uint8Array(this.pendingBytes);
  71257. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  71258. event2.data.set(this.pendingBoxes[i2], offset);
  71259. offset += this.pendingBoxes[i2].byteLength;
  71260. }
  71261. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  71262. caption = this.pendingCaptions[i2];
  71263. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  71264. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  71265. event2.captionStreams[caption.stream] = true;
  71266. event2.captions.push(caption);
  71267. }
  71268. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  71269. id32 = this.pendingMetadata[i2];
  71270. id32.cueTime = clock2.metadataTsToSeconds(id32.pts, timelineStartPts, this.keepOriginalTimestamps);
  71271. event2.metadata.push(id32);
  71272. }
  71273. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  71274. this.pendingTracks.length = 0;
  71275. this.videoTrack = null;
  71276. this.pendingBoxes.length = 0;
  71277. this.pendingCaptions.length = 0;
  71278. this.pendingBytes = 0;
  71279. this.pendingMetadata.length = 0;
  71280. this.trigger("data", event2);
  71281. for (i2 = 0; i2 < event2.captions.length; i2++) {
  71282. caption = event2.captions[i2];
  71283. this.trigger("caption", caption);
  71284. }
  71285. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  71286. id32 = event2.metadata[i2];
  71287. this.trigger("id3Frame", id32);
  71288. }
  71289. }
  71290. if (this.emittedTracks >= this.numberOfTracks) {
  71291. this.trigger("done");
  71292. this.emittedTracks = 0;
  71293. }
  71294. };
  71295. CoalesceStream.prototype.setRemux = function(val) {
  71296. this.remuxTracks = val;
  71297. };
  71298. Transmuxer = function(options2) {
  71299. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  71300. Transmuxer.prototype.init.call(this);
  71301. options2 = options2 || {};
  71302. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  71303. this.transmuxPipeline_ = {};
  71304. this.setupAacPipeline = function() {
  71305. var pipeline = {};
  71306. this.transmuxPipeline_ = pipeline;
  71307. pipeline.type = "aac";
  71308. pipeline.metadataStream = new m2ts.MetadataStream();
  71309. pipeline.aacStream = new AacStream();
  71310. pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream("audio");
  71311. pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream("timed-metadata");
  71312. pipeline.adtsStream = new AdtsStream();
  71313. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71314. pipeline.headOfPipeline = pipeline.aacStream;
  71315. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  71316. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71317. pipeline.metadataStream.on("timestamp", function(frame) {
  71318. pipeline.aacStream.setTimestamp(frame.timeStamp);
  71319. });
  71320. pipeline.aacStream.on("data", function(data) {
  71321. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  71322. return;
  71323. }
  71324. audioTrack = audioTrack || {
  71325. timelineStartInfo: {
  71326. baseMediaDecodeTime: self2.baseMediaDecodeTime
  71327. },
  71328. codec: "adts",
  71329. type: "audio"
  71330. };
  71331. pipeline.coalesceStream.numberOfTracks++;
  71332. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71333. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71334. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71335. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71336. self2.trigger("trackinfo", {
  71337. hasAudio: !!audioTrack,
  71338. hasVideo: !!videoTrack
  71339. });
  71340. });
  71341. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71342. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71343. addPipelineLogRetriggers(this, pipeline);
  71344. };
  71345. this.setupTsPipeline = function() {
  71346. var pipeline = {};
  71347. this.transmuxPipeline_ = pipeline;
  71348. pipeline.type = "ts";
  71349. pipeline.metadataStream = new m2ts.MetadataStream();
  71350. pipeline.packetStream = new m2ts.TransportPacketStream();
  71351. pipeline.parseStream = new m2ts.TransportParseStream();
  71352. pipeline.elementaryStream = new m2ts.ElementaryStream();
  71353. pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream();
  71354. pipeline.adtsStream = new AdtsStream();
  71355. pipeline.h264Stream = new H264Stream();
  71356. pipeline.captionStream = new m2ts.CaptionStream(options2);
  71357. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71358. pipeline.headOfPipeline = pipeline.packetStream;
  71359. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  71360. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  71361. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  71362. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71363. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  71364. pipeline.elementaryStream.on("data", function(data) {
  71365. var i2;
  71366. if (data.type === "metadata") {
  71367. i2 = data.tracks.length;
  71368. while (i2--) {
  71369. if (!videoTrack && data.tracks[i2].type === "video") {
  71370. videoTrack = data.tracks[i2];
  71371. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71372. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  71373. audioTrack = data.tracks[i2];
  71374. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71375. }
  71376. }
  71377. if (videoTrack && !pipeline.videoSegmentStream) {
  71378. pipeline.coalesceStream.numberOfTracks++;
  71379. pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options2);
  71380. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  71381. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  71382. if (audioTrack && !options2.keepOriginalTimestamps) {
  71383. audioTrack.timelineStartInfo = timelineStartInfo;
  71384. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  71385. }
  71386. });
  71387. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  71388. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  71389. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  71390. if (audioTrack) {
  71391. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  71392. }
  71393. });
  71394. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  71395. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  71396. }
  71397. if (audioTrack && !pipeline.audioSegmentStream) {
  71398. pipeline.coalesceStream.numberOfTracks++;
  71399. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71400. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71401. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71402. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  71403. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71404. }
  71405. self2.trigger("trackinfo", {
  71406. hasAudio: !!audioTrack,
  71407. hasVideo: !!videoTrack
  71408. });
  71409. }
  71410. });
  71411. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71412. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  71413. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  71414. self2.trigger("id3Frame", id3Frame);
  71415. });
  71416. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  71417. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71418. addPipelineLogRetriggers(this, pipeline);
  71419. };
  71420. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  71421. var pipeline = this.transmuxPipeline_;
  71422. if (!options2.keepOriginalTimestamps) {
  71423. this.baseMediaDecodeTime = baseMediaDecodeTime;
  71424. }
  71425. if (audioTrack) {
  71426. audioTrack.timelineStartInfo.dts = void 0;
  71427. audioTrack.timelineStartInfo.pts = void 0;
  71428. trackDecodeInfo.clearDtsInfo(audioTrack);
  71429. if (pipeline.audioTimestampRolloverStream) {
  71430. pipeline.audioTimestampRolloverStream.discontinuity();
  71431. }
  71432. }
  71433. if (videoTrack) {
  71434. if (pipeline.videoSegmentStream) {
  71435. pipeline.videoSegmentStream.gopCache_ = [];
  71436. }
  71437. videoTrack.timelineStartInfo.dts = void 0;
  71438. videoTrack.timelineStartInfo.pts = void 0;
  71439. trackDecodeInfo.clearDtsInfo(videoTrack);
  71440. pipeline.captionStream.reset();
  71441. }
  71442. if (pipeline.timestampRolloverStream) {
  71443. pipeline.timestampRolloverStream.discontinuity();
  71444. }
  71445. };
  71446. this.setAudioAppendStart = function(timestamp) {
  71447. if (audioTrack) {
  71448. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  71449. }
  71450. };
  71451. this.setRemux = function(val) {
  71452. var pipeline = this.transmuxPipeline_;
  71453. options2.remux = val;
  71454. if (pipeline && pipeline.coalesceStream) {
  71455. pipeline.coalesceStream.setRemux(val);
  71456. }
  71457. };
  71458. this.alignGopsWith = function(gopsToAlignWith) {
  71459. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  71460. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  71461. }
  71462. };
  71463. this.getLogTrigger_ = function(key) {
  71464. var self3 = this;
  71465. return function(event2) {
  71466. event2.stream = key;
  71467. self3.trigger("log", event2);
  71468. };
  71469. };
  71470. this.push = function(data) {
  71471. if (hasFlushed) {
  71472. var isAac = isLikelyAacData(data);
  71473. if (isAac && this.transmuxPipeline_.type !== "aac") {
  71474. this.setupAacPipeline();
  71475. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  71476. this.setupTsPipeline();
  71477. }
  71478. hasFlushed = false;
  71479. }
  71480. this.transmuxPipeline_.headOfPipeline.push(data);
  71481. };
  71482. this.flush = function() {
  71483. hasFlushed = true;
  71484. this.transmuxPipeline_.headOfPipeline.flush();
  71485. };
  71486. this.endTimeline = function() {
  71487. this.transmuxPipeline_.headOfPipeline.endTimeline();
  71488. };
  71489. this.reset = function() {
  71490. if (this.transmuxPipeline_.headOfPipeline) {
  71491. this.transmuxPipeline_.headOfPipeline.reset();
  71492. }
  71493. };
  71494. this.resetCaptions = function() {
  71495. if (this.transmuxPipeline_.captionStream) {
  71496. this.transmuxPipeline_.captionStream.reset();
  71497. }
  71498. };
  71499. };
  71500. Transmuxer.prototype = new Stream2();
  71501. var transmuxer = {
  71502. Transmuxer,
  71503. VideoSegmentStream,
  71504. AudioSegmentStream,
  71505. AUDIO_PROPERTIES,
  71506. VIDEO_PROPERTIES,
  71507. generateSegmentTimingInfo
  71508. };
  71509. var toUnsigned$3 = function(value) {
  71510. return value >>> 0;
  71511. };
  71512. var toHexString$1 = function(value) {
  71513. return ("00" + value.toString(16)).slice(-2);
  71514. };
  71515. var bin = {
  71516. toUnsigned: toUnsigned$3,
  71517. toHexString: toHexString$1
  71518. };
  71519. var parseType$3 = function(buffer) {
  71520. var result = "";
  71521. result += String.fromCharCode(buffer[0]);
  71522. result += String.fromCharCode(buffer[1]);
  71523. result += String.fromCharCode(buffer[2]);
  71524. result += String.fromCharCode(buffer[3]);
  71525. return result;
  71526. };
  71527. var parseType_1 = parseType$3;
  71528. var toUnsigned$2 = bin.toUnsigned;
  71529. var parseType$2 = parseType_1;
  71530. var findBox$2 = function(data, path) {
  71531. var results = [], i2, size, type3, end, subresults;
  71532. if (!path.length) {
  71533. return null;
  71534. }
  71535. for (i2 = 0; i2 < data.byteLength; ) {
  71536. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  71537. type3 = parseType$2(data.subarray(i2 + 4, i2 + 8));
  71538. end = size > 1 ? i2 + size : data.byteLength;
  71539. if (type3 === path[0]) {
  71540. if (path.length === 1) {
  71541. results.push(data.subarray(i2 + 8, end));
  71542. } else {
  71543. subresults = findBox$2(data.subarray(i2 + 8, end), path.slice(1));
  71544. if (subresults.length) {
  71545. results = results.concat(subresults);
  71546. }
  71547. }
  71548. }
  71549. i2 = end;
  71550. }
  71551. return results;
  71552. };
  71553. var findBox_1 = findBox$2;
  71554. var toUnsigned$1 = bin.toUnsigned;
  71555. var getUint64$22 = numbers2.getUint64;
  71556. var tfdt = function(data) {
  71557. var result = {
  71558. version: data[0],
  71559. flags: new Uint8Array(data.subarray(1, 4))
  71560. };
  71561. if (result.version === 1) {
  71562. result.baseMediaDecodeTime = getUint64$22(data.subarray(4));
  71563. } else {
  71564. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  71565. }
  71566. return result;
  71567. };
  71568. var parseTfdt$2 = tfdt;
  71569. var parseSampleFlags$1 = function(flags) {
  71570. return {
  71571. isLeading: (flags[0] & 12) >>> 2,
  71572. dependsOn: flags[0] & 3,
  71573. isDependedOn: (flags[1] & 192) >>> 6,
  71574. hasRedundancy: (flags[1] & 48) >>> 4,
  71575. paddingValue: (flags[1] & 14) >>> 1,
  71576. isNonSyncSample: flags[1] & 1,
  71577. degradationPriority: flags[2] << 8 | flags[3]
  71578. };
  71579. };
  71580. var parseSampleFlags_1 = parseSampleFlags$1;
  71581. var parseSampleFlags = parseSampleFlags_1;
  71582. var trun = function(data) {
  71583. var result = {
  71584. version: data[0],
  71585. flags: new Uint8Array(data.subarray(1, 4)),
  71586. samples: []
  71587. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  71588. if (dataOffsetPresent) {
  71589. result.dataOffset = view.getInt32(offset);
  71590. offset += 4;
  71591. }
  71592. if (firstSampleFlagsPresent && sampleCount) {
  71593. sample = {
  71594. flags: parseSampleFlags(data.subarray(offset, offset + 4))
  71595. };
  71596. offset += 4;
  71597. if (sampleDurationPresent) {
  71598. sample.duration = view.getUint32(offset);
  71599. offset += 4;
  71600. }
  71601. if (sampleSizePresent) {
  71602. sample.size = view.getUint32(offset);
  71603. offset += 4;
  71604. }
  71605. if (sampleCompositionTimeOffsetPresent) {
  71606. if (result.version === 1) {
  71607. sample.compositionTimeOffset = view.getInt32(offset);
  71608. } else {
  71609. sample.compositionTimeOffset = view.getUint32(offset);
  71610. }
  71611. offset += 4;
  71612. }
  71613. result.samples.push(sample);
  71614. sampleCount--;
  71615. }
  71616. while (sampleCount--) {
  71617. sample = {};
  71618. if (sampleDurationPresent) {
  71619. sample.duration = view.getUint32(offset);
  71620. offset += 4;
  71621. }
  71622. if (sampleSizePresent) {
  71623. sample.size = view.getUint32(offset);
  71624. offset += 4;
  71625. }
  71626. if (sampleFlagsPresent) {
  71627. sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));
  71628. offset += 4;
  71629. }
  71630. if (sampleCompositionTimeOffsetPresent) {
  71631. if (result.version === 1) {
  71632. sample.compositionTimeOffset = view.getInt32(offset);
  71633. } else {
  71634. sample.compositionTimeOffset = view.getUint32(offset);
  71635. }
  71636. offset += 4;
  71637. }
  71638. result.samples.push(sample);
  71639. }
  71640. return result;
  71641. };
  71642. var parseTrun$2 = trun;
  71643. var tfhd = function(data) {
  71644. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  71645. version: data[0],
  71646. flags: new Uint8Array(data.subarray(1, 4)),
  71647. trackId: view.getUint32(4)
  71648. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  71649. i2 = 8;
  71650. if (baseDataOffsetPresent) {
  71651. i2 += 4;
  71652. result.baseDataOffset = view.getUint32(12);
  71653. i2 += 4;
  71654. }
  71655. if (sampleDescriptionIndexPresent) {
  71656. result.sampleDescriptionIndex = view.getUint32(i2);
  71657. i2 += 4;
  71658. }
  71659. if (defaultSampleDurationPresent) {
  71660. result.defaultSampleDuration = view.getUint32(i2);
  71661. i2 += 4;
  71662. }
  71663. if (defaultSampleSizePresent) {
  71664. result.defaultSampleSize = view.getUint32(i2);
  71665. i2 += 4;
  71666. }
  71667. if (defaultSampleFlagsPresent) {
  71668. result.defaultSampleFlags = view.getUint32(i2);
  71669. }
  71670. if (durationIsEmpty) {
  71671. result.durationIsEmpty = true;
  71672. }
  71673. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  71674. result.baseDataOffsetIsMoof = true;
  71675. }
  71676. return result;
  71677. };
  71678. var parseTfhd$2 = tfhd;
  71679. var win2;
  71680. if (typeof window !== "undefined") {
  71681. win2 = window;
  71682. } else if (typeof commonjsGlobal2 !== "undefined") {
  71683. win2 = commonjsGlobal2;
  71684. } else if (typeof self !== "undefined") {
  71685. win2 = self;
  71686. } else {
  71687. win2 = {};
  71688. }
  71689. var window_12 = win2;
  71690. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  71691. var CaptionStream = captionStream.CaptionStream;
  71692. var findBox$12 = findBox_1;
  71693. var parseTfdt$1 = parseTfdt$2;
  71694. var parseTrun$1 = parseTrun$2;
  71695. var parseTfhd$1 = parseTfhd$2;
  71696. var window$22 = window_12;
  71697. var mapToSample = function(offset, samples) {
  71698. var approximateOffset = offset;
  71699. for (var i2 = 0; i2 < samples.length; i2++) {
  71700. var sample = samples[i2];
  71701. if (approximateOffset < sample.size) {
  71702. return sample;
  71703. }
  71704. approximateOffset -= sample.size;
  71705. }
  71706. return null;
  71707. };
  71708. var findSeiNals = function(avcStream, samples, trackId) {
  71709. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  71710. logs: [],
  71711. seiNals: []
  71712. }, seiNal, i2, length, lastMatchedSample;
  71713. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  71714. length = avcView.getUint32(i2);
  71715. i2 += 4;
  71716. if (length <= 0) {
  71717. continue;
  71718. }
  71719. switch (avcStream[i2] & 31) {
  71720. case 6:
  71721. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  71722. var matchingSample = mapToSample(i2, samples);
  71723. seiNal = {
  71724. nalUnitType: "sei_rbsp",
  71725. size: length,
  71726. data,
  71727. escapedRBSP: discardEmulationPreventionBytes4(data),
  71728. trackId
  71729. };
  71730. if (matchingSample) {
  71731. seiNal.pts = matchingSample.pts;
  71732. seiNal.dts = matchingSample.dts;
  71733. lastMatchedSample = matchingSample;
  71734. } else if (lastMatchedSample) {
  71735. seiNal.pts = lastMatchedSample.pts;
  71736. seiNal.dts = lastMatchedSample.dts;
  71737. } else {
  71738. result.logs.push({
  71739. level: "warn",
  71740. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  71741. });
  71742. break;
  71743. }
  71744. result.seiNals.push(seiNal);
  71745. break;
  71746. }
  71747. }
  71748. return result;
  71749. };
  71750. var parseSamples = function(truns, baseMediaDecodeTime, tfhd2) {
  71751. var currentDts = baseMediaDecodeTime;
  71752. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  71753. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  71754. var trackId = tfhd2.trackId;
  71755. var allSamples = [];
  71756. truns.forEach(function(trun2) {
  71757. var trackRun = parseTrun$1(trun2);
  71758. var samples = trackRun.samples;
  71759. samples.forEach(function(sample) {
  71760. if (sample.duration === void 0) {
  71761. sample.duration = defaultSampleDuration;
  71762. }
  71763. if (sample.size === void 0) {
  71764. sample.size = defaultSampleSize;
  71765. }
  71766. sample.trackId = trackId;
  71767. sample.dts = currentDts;
  71768. if (sample.compositionTimeOffset === void 0) {
  71769. sample.compositionTimeOffset = 0;
  71770. }
  71771. if (typeof currentDts === "bigint") {
  71772. sample.pts = currentDts + window$22.BigInt(sample.compositionTimeOffset);
  71773. currentDts += window$22.BigInt(sample.duration);
  71774. } else {
  71775. sample.pts = currentDts + sample.compositionTimeOffset;
  71776. currentDts += sample.duration;
  71777. }
  71778. });
  71779. allSamples = allSamples.concat(samples);
  71780. });
  71781. return allSamples;
  71782. };
  71783. var parseCaptionNals = function(segment, videoTrackId) {
  71784. var trafs = findBox$12(segment, ["moof", "traf"]);
  71785. var mdats = findBox$12(segment, ["mdat"]);
  71786. var captionNals = {};
  71787. var mdatTrafPairs = [];
  71788. mdats.forEach(function(mdat2, index2) {
  71789. var matchingTraf = trafs[index2];
  71790. mdatTrafPairs.push({
  71791. mdat: mdat2,
  71792. traf: matchingTraf
  71793. });
  71794. });
  71795. mdatTrafPairs.forEach(function(pair) {
  71796. var mdat2 = pair.mdat;
  71797. var traf2 = pair.traf;
  71798. var tfhd2 = findBox$12(traf2, ["tfhd"]);
  71799. var headerInfo = parseTfhd$1(tfhd2[0]);
  71800. var trackId = headerInfo.trackId;
  71801. var tfdt2 = findBox$12(traf2, ["tfdt"]);
  71802. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt$1(tfdt2[0]).baseMediaDecodeTime : 0;
  71803. var truns = findBox$12(traf2, ["trun"]);
  71804. var samples;
  71805. var result;
  71806. if (videoTrackId === trackId && truns.length > 0) {
  71807. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  71808. result = findSeiNals(mdat2, samples, trackId);
  71809. if (!captionNals[trackId]) {
  71810. captionNals[trackId] = {
  71811. seiNals: [],
  71812. logs: []
  71813. };
  71814. }
  71815. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  71816. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  71817. }
  71818. });
  71819. return captionNals;
  71820. };
  71821. var parseEmbeddedCaptions = function(segment, trackId, timescale3) {
  71822. var captionNals;
  71823. if (trackId === null) {
  71824. return null;
  71825. }
  71826. captionNals = parseCaptionNals(segment, trackId);
  71827. var trackNals = captionNals[trackId] || {};
  71828. return {
  71829. seiNals: trackNals.seiNals,
  71830. logs: trackNals.logs,
  71831. timescale: timescale3
  71832. };
  71833. };
  71834. var CaptionParser = function() {
  71835. var isInitialized = false;
  71836. var captionStream2;
  71837. var segmentCache;
  71838. var trackId;
  71839. var timescale3;
  71840. var parsedCaptions;
  71841. var parsingPartial;
  71842. this.isInitialized = function() {
  71843. return isInitialized;
  71844. };
  71845. this.init = function(options2) {
  71846. captionStream2 = new CaptionStream();
  71847. isInitialized = true;
  71848. parsingPartial = options2 ? options2.isPartial : false;
  71849. captionStream2.on("data", function(event2) {
  71850. event2.startTime = event2.startPts / timescale3;
  71851. event2.endTime = event2.endPts / timescale3;
  71852. parsedCaptions.captions.push(event2);
  71853. parsedCaptions.captionStreams[event2.stream] = true;
  71854. });
  71855. captionStream2.on("log", function(log2) {
  71856. parsedCaptions.logs.push(log2);
  71857. });
  71858. };
  71859. this.isNewInit = function(videoTrackIds, timescales) {
  71860. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  71861. return false;
  71862. }
  71863. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  71864. };
  71865. this.parse = function(segment, videoTrackIds, timescales) {
  71866. var parsedData;
  71867. if (!this.isInitialized()) {
  71868. return null;
  71869. } else if (!videoTrackIds || !timescales) {
  71870. return null;
  71871. } else if (this.isNewInit(videoTrackIds, timescales)) {
  71872. trackId = videoTrackIds[0];
  71873. timescale3 = timescales[trackId];
  71874. } else if (trackId === null || !timescale3) {
  71875. segmentCache.push(segment);
  71876. return null;
  71877. }
  71878. while (segmentCache.length > 0) {
  71879. var cachedSegment = segmentCache.shift();
  71880. this.parse(cachedSegment, videoTrackIds, timescales);
  71881. }
  71882. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  71883. if (parsedData && parsedData.logs) {
  71884. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  71885. }
  71886. if (parsedData === null || !parsedData.seiNals) {
  71887. if (parsedCaptions.logs.length) {
  71888. return {
  71889. logs: parsedCaptions.logs,
  71890. captions: [],
  71891. captionStreams: []
  71892. };
  71893. }
  71894. return null;
  71895. }
  71896. this.pushNals(parsedData.seiNals);
  71897. this.flushStream();
  71898. return parsedCaptions;
  71899. };
  71900. this.pushNals = function(nals) {
  71901. if (!this.isInitialized() || !nals || nals.length === 0) {
  71902. return null;
  71903. }
  71904. nals.forEach(function(nal) {
  71905. captionStream2.push(nal);
  71906. });
  71907. };
  71908. this.flushStream = function() {
  71909. if (!this.isInitialized()) {
  71910. return null;
  71911. }
  71912. if (!parsingPartial) {
  71913. captionStream2.flush();
  71914. } else {
  71915. captionStream2.partialFlush();
  71916. }
  71917. };
  71918. this.clearParsedCaptions = function() {
  71919. parsedCaptions.captions = [];
  71920. parsedCaptions.captionStreams = {};
  71921. parsedCaptions.logs = [];
  71922. };
  71923. this.resetCaptionStream = function() {
  71924. if (!this.isInitialized()) {
  71925. return null;
  71926. }
  71927. captionStream2.reset();
  71928. };
  71929. this.clearAllCaptions = function() {
  71930. this.clearParsedCaptions();
  71931. this.resetCaptionStream();
  71932. };
  71933. this.reset = function() {
  71934. segmentCache = [];
  71935. trackId = null;
  71936. timescale3 = null;
  71937. if (!parsedCaptions) {
  71938. parsedCaptions = {
  71939. captions: [],
  71940. captionStreams: {},
  71941. logs: []
  71942. };
  71943. } else {
  71944. this.clearParsedCaptions();
  71945. }
  71946. this.resetCaptionStream();
  71947. };
  71948. this.reset();
  71949. };
  71950. var captionParser = CaptionParser;
  71951. var uint8ToCString$1 = function(data) {
  71952. var index2 = 0;
  71953. var curChar = String.fromCharCode(data[index2]);
  71954. var retString = "";
  71955. while (curChar !== "\0") {
  71956. retString += curChar;
  71957. index2++;
  71958. curChar = String.fromCharCode(data[index2]);
  71959. }
  71960. retString += curChar;
  71961. return retString;
  71962. };
  71963. var string = {
  71964. uint8ToCString: uint8ToCString$1
  71965. };
  71966. var uint8ToCString = string.uint8ToCString;
  71967. var getUint64$12 = numbers2.getUint64;
  71968. var parseEmsgBox = function(boxData) {
  71969. var offset = 4;
  71970. var version2 = boxData[0];
  71971. var scheme_id_uri, value, timescale3, presentation_time, presentation_time_delta, event_duration, id, message_data;
  71972. if (version2 === 0) {
  71973. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  71974. offset += scheme_id_uri.length;
  71975. value = uint8ToCString(boxData.subarray(offset));
  71976. offset += value.length;
  71977. var dv = new DataView(boxData.buffer);
  71978. timescale3 = dv.getUint32(offset);
  71979. offset += 4;
  71980. presentation_time_delta = dv.getUint32(offset);
  71981. offset += 4;
  71982. event_duration = dv.getUint32(offset);
  71983. offset += 4;
  71984. id = dv.getUint32(offset);
  71985. offset += 4;
  71986. } else if (version2 === 1) {
  71987. var dv = new DataView(boxData.buffer);
  71988. timescale3 = dv.getUint32(offset);
  71989. offset += 4;
  71990. presentation_time = getUint64$12(boxData.subarray(offset));
  71991. offset += 8;
  71992. event_duration = dv.getUint32(offset);
  71993. offset += 4;
  71994. id = dv.getUint32(offset);
  71995. offset += 4;
  71996. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  71997. offset += scheme_id_uri.length;
  71998. value = uint8ToCString(boxData.subarray(offset));
  71999. offset += value.length;
  72000. }
  72001. message_data = new Uint8Array(boxData.subarray(offset, boxData.byteLength));
  72002. var emsgBox = {
  72003. scheme_id_uri,
  72004. value,
  72005. timescale: timescale3 ? timescale3 : 1,
  72006. presentation_time,
  72007. presentation_time_delta,
  72008. event_duration,
  72009. id,
  72010. message_data
  72011. };
  72012. return isValidEmsgBox(version2, emsgBox) ? emsgBox : void 0;
  72013. };
  72014. var scaleTime = function(presentationTime, timescale3, timeDelta, offset) {
  72015. return presentationTime || presentationTime === 0 ? presentationTime / timescale3 : offset + timeDelta / timescale3;
  72016. };
  72017. var isValidEmsgBox = function(version2, emsg2) {
  72018. var hasScheme = emsg2.scheme_id_uri !== "\0";
  72019. var isValidV0Box = version2 === 0 && isDefined(emsg2.presentation_time_delta) && hasScheme;
  72020. var isValidV1Box = version2 === 1 && isDefined(emsg2.presentation_time) && hasScheme;
  72021. return !(version2 > 1) && isValidV0Box || isValidV1Box;
  72022. };
  72023. var isDefined = function(data) {
  72024. return data !== void 0 || data !== null;
  72025. };
  72026. var emsg$1 = {
  72027. parseEmsgBox,
  72028. scaleTime
  72029. };
  72030. var toUnsigned = bin.toUnsigned;
  72031. var toHexString = bin.toHexString;
  72032. var findBox4 = findBox_1;
  72033. var parseType$1 = parseType_1;
  72034. var emsg = emsg$1;
  72035. var parseTfhd = parseTfhd$2;
  72036. var parseTrun = parseTrun$2;
  72037. var parseTfdt = parseTfdt$2;
  72038. var getUint642 = numbers2.getUint64;
  72039. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, getEmsgID3;
  72040. var window$12 = window_12;
  72041. var parseId3Frames = parseId3.parseId3Frames;
  72042. timescale2 = function(init) {
  72043. var result = {}, traks = findBox4(init, ["moov", "trak"]);
  72044. return traks.reduce(function(result2, trak2) {
  72045. var tkhd2, version2, index2, id, mdhd2;
  72046. tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72047. if (!tkhd2) {
  72048. return null;
  72049. }
  72050. version2 = tkhd2[0];
  72051. index2 = version2 === 0 ? 12 : 20;
  72052. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  72053. mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72054. if (!mdhd2) {
  72055. return null;
  72056. }
  72057. version2 = mdhd2[0];
  72058. index2 = version2 === 0 ? 12 : 20;
  72059. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72060. return result2;
  72061. }, result);
  72062. };
  72063. startTime = function(timescale3, fragment) {
  72064. var trafs;
  72065. trafs = findBox4(fragment, ["moof", "traf"]);
  72066. var lowestTime = trafs.reduce(function(acc, traf2) {
  72067. var tfhd2 = findBox4(traf2, ["tfhd"])[0];
  72068. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  72069. var scale = timescale3[id] || 9e4;
  72070. var tfdt2 = findBox4(traf2, ["tfdt"])[0];
  72071. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  72072. var baseTime;
  72073. if (tfdt2[0] === 1) {
  72074. baseTime = getUint642(tfdt2.subarray(4, 12));
  72075. } else {
  72076. baseTime = dv.getUint32(4);
  72077. }
  72078. let seconds;
  72079. if (typeof baseTime === "bigint") {
  72080. seconds = baseTime / window$12.BigInt(scale);
  72081. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  72082. seconds = baseTime / scale;
  72083. }
  72084. if (seconds < Number.MAX_SAFE_INTEGER) {
  72085. seconds = Number(seconds);
  72086. }
  72087. if (seconds < acc) {
  72088. acc = seconds;
  72089. }
  72090. return acc;
  72091. }, Infinity);
  72092. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  72093. };
  72094. compositionStartTime = function(timescales, fragment) {
  72095. var trafBoxes = findBox4(fragment, ["moof", "traf"]);
  72096. var baseMediaDecodeTime = 0;
  72097. var compositionTimeOffset = 0;
  72098. var trackId;
  72099. if (trafBoxes && trafBoxes.length) {
  72100. var tfhd2 = findBox4(trafBoxes[0], ["tfhd"])[0];
  72101. var trun2 = findBox4(trafBoxes[0], ["trun"])[0];
  72102. var tfdt2 = findBox4(trafBoxes[0], ["tfdt"])[0];
  72103. if (tfhd2) {
  72104. var parsedTfhd = parseTfhd(tfhd2);
  72105. trackId = parsedTfhd.trackId;
  72106. }
  72107. if (tfdt2) {
  72108. var parsedTfdt = parseTfdt(tfdt2);
  72109. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  72110. }
  72111. if (trun2) {
  72112. var parsedTrun = parseTrun(trun2);
  72113. if (parsedTrun.samples && parsedTrun.samples.length) {
  72114. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  72115. }
  72116. }
  72117. }
  72118. var timescale3 = timescales[trackId] || 9e4;
  72119. if (typeof baseMediaDecodeTime === "bigint") {
  72120. compositionTimeOffset = window$12.BigInt(compositionTimeOffset);
  72121. timescale3 = window$12.BigInt(timescale3);
  72122. }
  72123. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  72124. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  72125. result = Number(result);
  72126. }
  72127. return result;
  72128. };
  72129. getVideoTrackIds = function(init) {
  72130. var traks = findBox4(init, ["moov", "trak"]);
  72131. var videoTrackIds = [];
  72132. traks.forEach(function(trak2) {
  72133. var hdlrs = findBox4(trak2, ["mdia", "hdlr"]);
  72134. var tkhds = findBox4(trak2, ["tkhd"]);
  72135. hdlrs.forEach(function(hdlr2, index2) {
  72136. var handlerType = parseType$1(hdlr2.subarray(8, 12));
  72137. var tkhd2 = tkhds[index2];
  72138. var view;
  72139. var version2;
  72140. var trackId;
  72141. if (handlerType === "vide") {
  72142. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72143. version2 = view.getUint8(0);
  72144. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  72145. videoTrackIds.push(trackId);
  72146. }
  72147. });
  72148. });
  72149. return videoTrackIds;
  72150. };
  72151. getTimescaleFromMediaHeader = function(mdhd2) {
  72152. var version2 = mdhd2[0];
  72153. var index2 = version2 === 0 ? 12 : 20;
  72154. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72155. };
  72156. getTracks = function(init) {
  72157. var traks = findBox4(init, ["moov", "trak"]);
  72158. var tracks = [];
  72159. traks.forEach(function(trak2) {
  72160. var track = {};
  72161. var tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72162. var view, tkhdVersion;
  72163. if (tkhd2) {
  72164. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72165. tkhdVersion = view.getUint8(0);
  72166. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  72167. }
  72168. var hdlr2 = findBox4(trak2, ["mdia", "hdlr"])[0];
  72169. if (hdlr2) {
  72170. var type3 = parseType$1(hdlr2.subarray(8, 12));
  72171. if (type3 === "vide") {
  72172. track.type = "video";
  72173. } else if (type3 === "soun") {
  72174. track.type = "audio";
  72175. } else {
  72176. track.type = type3;
  72177. }
  72178. }
  72179. var stsd2 = findBox4(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  72180. if (stsd2) {
  72181. var sampleDescriptions = stsd2.subarray(8);
  72182. track.codec = parseType$1(sampleDescriptions.subarray(4, 8));
  72183. var codecBox = findBox4(sampleDescriptions, [track.codec])[0];
  72184. var codecConfig, codecConfigType;
  72185. if (codecBox) {
  72186. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  72187. codecConfig = codecBox.subarray(78);
  72188. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72189. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  72190. track.codec += ".";
  72191. track.codec += toHexString(codecConfig[9]);
  72192. track.codec += toHexString(codecConfig[10]);
  72193. track.codec += toHexString(codecConfig[11]);
  72194. } else {
  72195. track.codec = "avc1.4d400d";
  72196. }
  72197. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  72198. codecConfig = codecBox.subarray(28);
  72199. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72200. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  72201. track.codec += "." + toHexString(codecConfig[19]);
  72202. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  72203. } else {
  72204. track.codec = "mp4a.40.2";
  72205. }
  72206. } else {
  72207. track.codec = track.codec.toLowerCase();
  72208. }
  72209. }
  72210. }
  72211. var mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72212. if (mdhd2) {
  72213. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  72214. }
  72215. tracks.push(track);
  72216. });
  72217. return tracks;
  72218. };
  72219. getEmsgID3 = function(segmentData, offset = 0) {
  72220. var emsgBoxes = findBox4(segmentData, ["emsg"]);
  72221. return emsgBoxes.map((data) => {
  72222. var parsedBox = emsg.parseEmsgBox(new Uint8Array(data));
  72223. var parsedId3Frames = parseId3Frames(parsedBox.message_data);
  72224. return {
  72225. cueTime: emsg.scaleTime(parsedBox.presentation_time, parsedBox.timescale, parsedBox.presentation_time_delta, offset),
  72226. duration: emsg.scaleTime(parsedBox.event_duration, parsedBox.timescale),
  72227. frames: parsedId3Frames
  72228. };
  72229. });
  72230. };
  72231. var probe$2 = {
  72232. findBox: findBox4,
  72233. parseType: parseType$1,
  72234. timescale: timescale2,
  72235. startTime,
  72236. compositionStartTime,
  72237. videoTrackIds: getVideoTrackIds,
  72238. tracks: getTracks,
  72239. getTimescaleFromMediaHeader,
  72240. getEmsgID3
  72241. };
  72242. var StreamTypes$1 = streamTypes;
  72243. var parsePid = function(packet) {
  72244. var pid = packet[1] & 31;
  72245. pid <<= 8;
  72246. pid |= packet[2];
  72247. return pid;
  72248. };
  72249. var parsePayloadUnitStartIndicator = function(packet) {
  72250. return !!(packet[1] & 64);
  72251. };
  72252. var parseAdaptionField = function(packet) {
  72253. var offset = 0;
  72254. if ((packet[3] & 48) >>> 4 > 1) {
  72255. offset += packet[4] + 1;
  72256. }
  72257. return offset;
  72258. };
  72259. var parseType = function(packet, pmtPid) {
  72260. var pid = parsePid(packet);
  72261. if (pid === 0) {
  72262. return "pat";
  72263. } else if (pid === pmtPid) {
  72264. return "pmt";
  72265. } else if (pmtPid) {
  72266. return "pes";
  72267. }
  72268. return null;
  72269. };
  72270. var parsePat = function(packet) {
  72271. var pusi = parsePayloadUnitStartIndicator(packet);
  72272. var offset = 4 + parseAdaptionField(packet);
  72273. if (pusi) {
  72274. offset += packet[offset] + 1;
  72275. }
  72276. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  72277. };
  72278. var parsePmt = function(packet) {
  72279. var programMapTable = {};
  72280. var pusi = parsePayloadUnitStartIndicator(packet);
  72281. var payloadOffset = 4 + parseAdaptionField(packet);
  72282. if (pusi) {
  72283. payloadOffset += packet[payloadOffset] + 1;
  72284. }
  72285. if (!(packet[payloadOffset + 5] & 1)) {
  72286. return;
  72287. }
  72288. var sectionLength, tableEnd, programInfoLength;
  72289. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  72290. tableEnd = 3 + sectionLength - 4;
  72291. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  72292. var offset = 12 + programInfoLength;
  72293. while (offset < tableEnd) {
  72294. var i2 = payloadOffset + offset;
  72295. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  72296. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  72297. }
  72298. return programMapTable;
  72299. };
  72300. var parsePesType = function(packet, programMapTable) {
  72301. var pid = parsePid(packet);
  72302. var type3 = programMapTable[pid];
  72303. switch (type3) {
  72304. case StreamTypes$1.H264_STREAM_TYPE:
  72305. return "video";
  72306. case StreamTypes$1.ADTS_STREAM_TYPE:
  72307. return "audio";
  72308. case StreamTypes$1.METADATA_STREAM_TYPE:
  72309. return "timed-metadata";
  72310. default:
  72311. return null;
  72312. }
  72313. };
  72314. var parsePesTime = function(packet) {
  72315. var pusi = parsePayloadUnitStartIndicator(packet);
  72316. if (!pusi) {
  72317. return null;
  72318. }
  72319. var offset = 4 + parseAdaptionField(packet);
  72320. if (offset >= packet.byteLength) {
  72321. return null;
  72322. }
  72323. var pes = null;
  72324. var ptsDtsFlags;
  72325. ptsDtsFlags = packet[offset + 7];
  72326. if (ptsDtsFlags & 192) {
  72327. pes = {};
  72328. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  72329. pes.pts *= 4;
  72330. pes.pts += (packet[offset + 13] & 6) >>> 1;
  72331. pes.dts = pes.pts;
  72332. if (ptsDtsFlags & 64) {
  72333. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  72334. pes.dts *= 4;
  72335. pes.dts += (packet[offset + 18] & 6) >>> 1;
  72336. }
  72337. }
  72338. return pes;
  72339. };
  72340. var parseNalUnitType = function(type3) {
  72341. switch (type3) {
  72342. case 5:
  72343. return "slice_layer_without_partitioning_rbsp_idr";
  72344. case 6:
  72345. return "sei_rbsp";
  72346. case 7:
  72347. return "seq_parameter_set_rbsp";
  72348. case 8:
  72349. return "pic_parameter_set_rbsp";
  72350. case 9:
  72351. return "access_unit_delimiter_rbsp";
  72352. default:
  72353. return null;
  72354. }
  72355. };
  72356. var videoPacketContainsKeyFrame = function(packet) {
  72357. var offset = 4 + parseAdaptionField(packet);
  72358. var frameBuffer = packet.subarray(offset);
  72359. var frameI = 0;
  72360. var frameSyncPoint = 0;
  72361. var foundKeyFrame = false;
  72362. var nalType;
  72363. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  72364. if (frameBuffer[frameSyncPoint + 2] === 1) {
  72365. frameI = frameSyncPoint + 5;
  72366. break;
  72367. }
  72368. }
  72369. while (frameI < frameBuffer.byteLength) {
  72370. switch (frameBuffer[frameI]) {
  72371. case 0:
  72372. if (frameBuffer[frameI - 1] !== 0) {
  72373. frameI += 2;
  72374. break;
  72375. } else if (frameBuffer[frameI - 2] !== 0) {
  72376. frameI++;
  72377. break;
  72378. }
  72379. if (frameSyncPoint + 3 !== frameI - 2) {
  72380. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72381. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72382. foundKeyFrame = true;
  72383. }
  72384. }
  72385. do {
  72386. frameI++;
  72387. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  72388. frameSyncPoint = frameI - 2;
  72389. frameI += 3;
  72390. break;
  72391. case 1:
  72392. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  72393. frameI += 3;
  72394. break;
  72395. }
  72396. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72397. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72398. foundKeyFrame = true;
  72399. }
  72400. frameSyncPoint = frameI - 2;
  72401. frameI += 3;
  72402. break;
  72403. default:
  72404. frameI += 3;
  72405. break;
  72406. }
  72407. }
  72408. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  72409. frameI -= frameSyncPoint;
  72410. frameSyncPoint = 0;
  72411. if (frameBuffer && frameBuffer.byteLength > 3) {
  72412. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72413. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72414. foundKeyFrame = true;
  72415. }
  72416. }
  72417. return foundKeyFrame;
  72418. };
  72419. var probe$1 = {
  72420. parseType,
  72421. parsePat,
  72422. parsePmt,
  72423. parsePayloadUnitStartIndicator,
  72424. parsePesType,
  72425. parsePesTime,
  72426. videoPacketContainsKeyFrame
  72427. };
  72428. var StreamTypes = streamTypes;
  72429. var handleRollover = timestampRolloverStream.handleRollover;
  72430. var probe = {};
  72431. probe.ts = probe$1;
  72432. probe.aac = utils2;
  72433. var ONE_SECOND_IN_TS2 = clock$2.ONE_SECOND_IN_TS;
  72434. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  72435. var parsePsi_ = function(bytes, pmt) {
  72436. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  72437. while (endIndex < bytes.byteLength) {
  72438. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72439. packet = bytes.subarray(startIndex, endIndex);
  72440. type3 = probe.ts.parseType(packet, pmt.pid);
  72441. switch (type3) {
  72442. case "pat":
  72443. pmt.pid = probe.ts.parsePat(packet);
  72444. break;
  72445. case "pmt":
  72446. var table = probe.ts.parsePmt(packet);
  72447. pmt.table = pmt.table || {};
  72448. Object.keys(table).forEach(function(key) {
  72449. pmt.table[key] = table[key];
  72450. });
  72451. break;
  72452. }
  72453. startIndex += MP2T_PACKET_LENGTH;
  72454. endIndex += MP2T_PACKET_LENGTH;
  72455. continue;
  72456. }
  72457. startIndex++;
  72458. endIndex++;
  72459. }
  72460. };
  72461. var parseAudioPes_ = function(bytes, pmt, result) {
  72462. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  72463. var endLoop = false;
  72464. while (endIndex <= bytes.byteLength) {
  72465. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72466. packet = bytes.subarray(startIndex, endIndex);
  72467. type3 = probe.ts.parseType(packet, pmt.pid);
  72468. switch (type3) {
  72469. case "pes":
  72470. pesType = probe.ts.parsePesType(packet, pmt.table);
  72471. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72472. if (pesType === "audio" && pusi) {
  72473. parsed = probe.ts.parsePesTime(packet);
  72474. if (parsed) {
  72475. parsed.type = "audio";
  72476. result.audio.push(parsed);
  72477. endLoop = true;
  72478. }
  72479. }
  72480. break;
  72481. }
  72482. if (endLoop) {
  72483. break;
  72484. }
  72485. startIndex += MP2T_PACKET_LENGTH;
  72486. endIndex += MP2T_PACKET_LENGTH;
  72487. continue;
  72488. }
  72489. startIndex++;
  72490. endIndex++;
  72491. }
  72492. endIndex = bytes.byteLength;
  72493. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72494. endLoop = false;
  72495. while (startIndex >= 0) {
  72496. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72497. packet = bytes.subarray(startIndex, endIndex);
  72498. type3 = probe.ts.parseType(packet, pmt.pid);
  72499. switch (type3) {
  72500. case "pes":
  72501. pesType = probe.ts.parsePesType(packet, pmt.table);
  72502. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72503. if (pesType === "audio" && pusi) {
  72504. parsed = probe.ts.parsePesTime(packet);
  72505. if (parsed) {
  72506. parsed.type = "audio";
  72507. result.audio.push(parsed);
  72508. endLoop = true;
  72509. }
  72510. }
  72511. break;
  72512. }
  72513. if (endLoop) {
  72514. break;
  72515. }
  72516. startIndex -= MP2T_PACKET_LENGTH;
  72517. endIndex -= MP2T_PACKET_LENGTH;
  72518. continue;
  72519. }
  72520. startIndex--;
  72521. endIndex--;
  72522. }
  72523. };
  72524. var parseVideoPes_ = function(bytes, pmt, result) {
  72525. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  72526. var endLoop = false;
  72527. var currentFrame = {
  72528. data: [],
  72529. size: 0
  72530. };
  72531. while (endIndex < bytes.byteLength) {
  72532. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72533. packet = bytes.subarray(startIndex, endIndex);
  72534. type3 = probe.ts.parseType(packet, pmt.pid);
  72535. switch (type3) {
  72536. case "pes":
  72537. pesType = probe.ts.parsePesType(packet, pmt.table);
  72538. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72539. if (pesType === "video") {
  72540. if (pusi && !endLoop) {
  72541. parsed = probe.ts.parsePesTime(packet);
  72542. if (parsed) {
  72543. parsed.type = "video";
  72544. result.video.push(parsed);
  72545. endLoop = true;
  72546. }
  72547. }
  72548. if (!result.firstKeyFrame) {
  72549. if (pusi) {
  72550. if (currentFrame.size !== 0) {
  72551. frame = new Uint8Array(currentFrame.size);
  72552. i2 = 0;
  72553. while (currentFrame.data.length) {
  72554. pes = currentFrame.data.shift();
  72555. frame.set(pes, i2);
  72556. i2 += pes.byteLength;
  72557. }
  72558. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  72559. var firstKeyFrame = probe.ts.parsePesTime(frame);
  72560. if (firstKeyFrame) {
  72561. result.firstKeyFrame = firstKeyFrame;
  72562. result.firstKeyFrame.type = "video";
  72563. } else {
  72564. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  72565. }
  72566. }
  72567. currentFrame.size = 0;
  72568. }
  72569. }
  72570. currentFrame.data.push(packet);
  72571. currentFrame.size += packet.byteLength;
  72572. }
  72573. }
  72574. break;
  72575. }
  72576. if (endLoop && result.firstKeyFrame) {
  72577. break;
  72578. }
  72579. startIndex += MP2T_PACKET_LENGTH;
  72580. endIndex += MP2T_PACKET_LENGTH;
  72581. continue;
  72582. }
  72583. startIndex++;
  72584. endIndex++;
  72585. }
  72586. endIndex = bytes.byteLength;
  72587. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72588. endLoop = false;
  72589. while (startIndex >= 0) {
  72590. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72591. packet = bytes.subarray(startIndex, endIndex);
  72592. type3 = probe.ts.parseType(packet, pmt.pid);
  72593. switch (type3) {
  72594. case "pes":
  72595. pesType = probe.ts.parsePesType(packet, pmt.table);
  72596. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72597. if (pesType === "video" && pusi) {
  72598. parsed = probe.ts.parsePesTime(packet);
  72599. if (parsed) {
  72600. parsed.type = "video";
  72601. result.video.push(parsed);
  72602. endLoop = true;
  72603. }
  72604. }
  72605. break;
  72606. }
  72607. if (endLoop) {
  72608. break;
  72609. }
  72610. startIndex -= MP2T_PACKET_LENGTH;
  72611. endIndex -= MP2T_PACKET_LENGTH;
  72612. continue;
  72613. }
  72614. startIndex--;
  72615. endIndex--;
  72616. }
  72617. };
  72618. var adjustTimestamp_ = function(segmentInfo, baseTimestamp) {
  72619. if (segmentInfo.audio && segmentInfo.audio.length) {
  72620. var audioBaseTimestamp = baseTimestamp;
  72621. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  72622. audioBaseTimestamp = segmentInfo.audio[0].dts;
  72623. }
  72624. segmentInfo.audio.forEach(function(info) {
  72625. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  72626. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  72627. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72628. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72629. });
  72630. }
  72631. if (segmentInfo.video && segmentInfo.video.length) {
  72632. var videoBaseTimestamp = baseTimestamp;
  72633. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  72634. videoBaseTimestamp = segmentInfo.video[0].dts;
  72635. }
  72636. segmentInfo.video.forEach(function(info) {
  72637. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  72638. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  72639. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72640. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72641. });
  72642. if (segmentInfo.firstKeyFrame) {
  72643. var frame = segmentInfo.firstKeyFrame;
  72644. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  72645. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  72646. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  72647. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  72648. }
  72649. }
  72650. };
  72651. var inspectAac_ = function(bytes) {
  72652. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  72653. while (bytes.length - byteIndex >= 3) {
  72654. var type3 = probe.aac.parseType(bytes, byteIndex);
  72655. switch (type3) {
  72656. case "timed-metadata":
  72657. if (bytes.length - byteIndex < 10) {
  72658. endLoop = true;
  72659. break;
  72660. }
  72661. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  72662. if (frameSize > bytes.length) {
  72663. endLoop = true;
  72664. break;
  72665. }
  72666. if (timestamp === null) {
  72667. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72668. timestamp = probe.aac.parseAacTimestamp(packet);
  72669. }
  72670. byteIndex += frameSize;
  72671. break;
  72672. case "audio":
  72673. if (bytes.length - byteIndex < 7) {
  72674. endLoop = true;
  72675. break;
  72676. }
  72677. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  72678. if (frameSize > bytes.length) {
  72679. endLoop = true;
  72680. break;
  72681. }
  72682. if (sampleRate === null) {
  72683. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72684. sampleRate = probe.aac.parseSampleRate(packet);
  72685. }
  72686. audioCount++;
  72687. byteIndex += frameSize;
  72688. break;
  72689. default:
  72690. byteIndex++;
  72691. break;
  72692. }
  72693. if (endLoop) {
  72694. return null;
  72695. }
  72696. }
  72697. if (sampleRate === null || timestamp === null) {
  72698. return null;
  72699. }
  72700. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  72701. var result = {
  72702. audio: [{
  72703. type: "audio",
  72704. dts: timestamp,
  72705. pts: timestamp
  72706. }, {
  72707. type: "audio",
  72708. dts: timestamp + audioCount * 1024 * audioTimescale,
  72709. pts: timestamp + audioCount * 1024 * audioTimescale
  72710. }]
  72711. };
  72712. return result;
  72713. };
  72714. var inspectTs_ = function(bytes) {
  72715. var pmt = {
  72716. pid: null,
  72717. table: null
  72718. };
  72719. var result = {};
  72720. parsePsi_(bytes, pmt);
  72721. for (var pid in pmt.table) {
  72722. if (pmt.table.hasOwnProperty(pid)) {
  72723. var type3 = pmt.table[pid];
  72724. switch (type3) {
  72725. case StreamTypes.H264_STREAM_TYPE:
  72726. result.video = [];
  72727. parseVideoPes_(bytes, pmt, result);
  72728. if (result.video.length === 0) {
  72729. delete result.video;
  72730. }
  72731. break;
  72732. case StreamTypes.ADTS_STREAM_TYPE:
  72733. result.audio = [];
  72734. parseAudioPes_(bytes, pmt, result);
  72735. if (result.audio.length === 0) {
  72736. delete result.audio;
  72737. }
  72738. break;
  72739. }
  72740. }
  72741. }
  72742. return result;
  72743. };
  72744. var inspect = function(bytes, baseTimestamp) {
  72745. var isAacData = probe.aac.isLikelyAacData(bytes);
  72746. var result;
  72747. if (isAacData) {
  72748. result = inspectAac_(bytes);
  72749. } else {
  72750. result = inspectTs_(bytes);
  72751. }
  72752. if (!result || !result.audio && !result.video) {
  72753. return null;
  72754. }
  72755. adjustTimestamp_(result, baseTimestamp);
  72756. return result;
  72757. };
  72758. var tsInspector = {
  72759. inspect,
  72760. parseAudioPes_
  72761. };
  72762. const wireTransmuxerEvents = function(self2, transmuxer2) {
  72763. transmuxer2.on("data", function(segment) {
  72764. const initArray = segment.initSegment;
  72765. segment.initSegment = {
  72766. data: initArray.buffer,
  72767. byteOffset: initArray.byteOffset,
  72768. byteLength: initArray.byteLength
  72769. };
  72770. const typedArray2 = segment.data;
  72771. segment.data = typedArray2.buffer;
  72772. self2.postMessage({
  72773. action: "data",
  72774. segment,
  72775. byteOffset: typedArray2.byteOffset,
  72776. byteLength: typedArray2.byteLength
  72777. }, [segment.data]);
  72778. });
  72779. transmuxer2.on("done", function(data) {
  72780. self2.postMessage({
  72781. action: "done"
  72782. });
  72783. });
  72784. transmuxer2.on("gopInfo", function(gopInfo) {
  72785. self2.postMessage({
  72786. action: "gopInfo",
  72787. gopInfo
  72788. });
  72789. });
  72790. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  72791. const videoSegmentTimingInfo = {
  72792. start: {
  72793. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72794. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72795. },
  72796. end: {
  72797. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72798. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72799. },
  72800. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72801. };
  72802. if (timingInfo.prependedContentDuration) {
  72803. videoSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72804. }
  72805. self2.postMessage({
  72806. action: "videoSegmentTimingInfo",
  72807. videoSegmentTimingInfo
  72808. });
  72809. });
  72810. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  72811. const audioSegmentTimingInfo = {
  72812. start: {
  72813. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72814. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72815. },
  72816. end: {
  72817. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72818. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72819. },
  72820. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72821. };
  72822. if (timingInfo.prependedContentDuration) {
  72823. audioSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72824. }
  72825. self2.postMessage({
  72826. action: "audioSegmentTimingInfo",
  72827. audioSegmentTimingInfo
  72828. });
  72829. });
  72830. transmuxer2.on("id3Frame", function(id3Frame) {
  72831. self2.postMessage({
  72832. action: "id3Frame",
  72833. id3Frame
  72834. });
  72835. });
  72836. transmuxer2.on("caption", function(caption) {
  72837. self2.postMessage({
  72838. action: "caption",
  72839. caption
  72840. });
  72841. });
  72842. transmuxer2.on("trackinfo", function(trackInfo) {
  72843. self2.postMessage({
  72844. action: "trackinfo",
  72845. trackInfo
  72846. });
  72847. });
  72848. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  72849. self2.postMessage({
  72850. action: "audioTimingInfo",
  72851. audioTimingInfo: {
  72852. start: clock$2.videoTsToSeconds(audioTimingInfo.start),
  72853. end: clock$2.videoTsToSeconds(audioTimingInfo.end)
  72854. }
  72855. });
  72856. });
  72857. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  72858. self2.postMessage({
  72859. action: "videoTimingInfo",
  72860. videoTimingInfo: {
  72861. start: clock$2.videoTsToSeconds(videoTimingInfo.start),
  72862. end: clock$2.videoTsToSeconds(videoTimingInfo.end)
  72863. }
  72864. });
  72865. });
  72866. transmuxer2.on("log", function(log2) {
  72867. self2.postMessage({
  72868. action: "log",
  72869. log: log2
  72870. });
  72871. });
  72872. };
  72873. class MessageHandlers {
  72874. constructor(self2, options2) {
  72875. this.options = options2 || {};
  72876. this.self = self2;
  72877. this.init();
  72878. }
  72879. init() {
  72880. if (this.transmuxer) {
  72881. this.transmuxer.dispose();
  72882. }
  72883. this.transmuxer = new transmuxer.Transmuxer(this.options);
  72884. wireTransmuxerEvents(this.self, this.transmuxer);
  72885. }
  72886. pushMp4Captions(data) {
  72887. if (!this.captionParser) {
  72888. this.captionParser = new captionParser();
  72889. this.captionParser.init();
  72890. }
  72891. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  72892. const parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  72893. this.self.postMessage({
  72894. action: "mp4Captions",
  72895. captions: parsed && parsed.captions || [],
  72896. logs: parsed && parsed.logs || [],
  72897. data: segment.buffer
  72898. }, [segment.buffer]);
  72899. }
  72900. probeMp4StartTime({
  72901. timescales,
  72902. data
  72903. }) {
  72904. const startTime2 = probe$2.startTime(timescales, data);
  72905. this.self.postMessage({
  72906. action: "probeMp4StartTime",
  72907. startTime: startTime2,
  72908. data
  72909. }, [data.buffer]);
  72910. }
  72911. probeMp4Tracks({
  72912. data
  72913. }) {
  72914. const tracks = probe$2.tracks(data);
  72915. this.self.postMessage({
  72916. action: "probeMp4Tracks",
  72917. tracks,
  72918. data
  72919. }, [data.buffer]);
  72920. }
  72921. probeTs({
  72922. data,
  72923. baseStartTime
  72924. }) {
  72925. const tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock$2.ONE_SECOND_IN_TS : void 0;
  72926. const timeInfo = tsInspector.inspect(data, tsStartTime);
  72927. let result = null;
  72928. if (timeInfo) {
  72929. result = {
  72930. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  72931. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  72932. };
  72933. if (result.hasVideo) {
  72934. result.videoStart = timeInfo.video[0].ptsTime;
  72935. }
  72936. if (result.hasAudio) {
  72937. result.audioStart = timeInfo.audio[0].ptsTime;
  72938. }
  72939. }
  72940. this.self.postMessage({
  72941. action: "probeTs",
  72942. result,
  72943. data
  72944. }, [data.buffer]);
  72945. }
  72946. clearAllMp4Captions() {
  72947. if (this.captionParser) {
  72948. this.captionParser.clearAllCaptions();
  72949. }
  72950. }
  72951. clearParsedMp4Captions() {
  72952. if (this.captionParser) {
  72953. this.captionParser.clearParsedCaptions();
  72954. }
  72955. }
  72956. push(data) {
  72957. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  72958. this.transmuxer.push(segment);
  72959. }
  72960. reset() {
  72961. this.transmuxer.reset();
  72962. }
  72963. setTimestampOffset(data) {
  72964. const timestampOffset2 = data.timestampOffset || 0;
  72965. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock$2.secondsToVideoTs(timestampOffset2)));
  72966. }
  72967. setAudioAppendStart(data) {
  72968. this.transmuxer.setAudioAppendStart(Math.ceil(clock$2.secondsToVideoTs(data.appendStart)));
  72969. }
  72970. setRemux(data) {
  72971. this.transmuxer.setRemux(data.remux);
  72972. }
  72973. flush(data) {
  72974. this.transmuxer.flush();
  72975. self.postMessage({
  72976. action: "done",
  72977. type: "transmuxed"
  72978. });
  72979. }
  72980. endTimeline() {
  72981. this.transmuxer.endTimeline();
  72982. self.postMessage({
  72983. action: "endedtimeline",
  72984. type: "transmuxed"
  72985. });
  72986. }
  72987. alignGopsWith(data) {
  72988. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  72989. }
  72990. }
  72991. self.onmessage = function(event2) {
  72992. if (event2.data.action === "init" && event2.data.options) {
  72993. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  72994. return;
  72995. }
  72996. if (!this.messageHandlers) {
  72997. this.messageHandlers = new MessageHandlers(self);
  72998. }
  72999. if (event2.data && event2.data.action && event2.data.action !== "init") {
  73000. if (this.messageHandlers[event2.data.action]) {
  73001. this.messageHandlers[event2.data.action](event2.data);
  73002. }
  73003. }
  73004. };
  73005. }));
  73006. var TransmuxWorker$1 = factory$1(workerCode$1$1);
  73007. const handleData_$1 = (event2, transmuxedData, callback2) => {
  73008. const {
  73009. type: type2,
  73010. initSegment,
  73011. captions,
  73012. captionStreams,
  73013. metadata,
  73014. videoFrameDtsTime,
  73015. videoFramePtsTime
  73016. } = event2.data.segment;
  73017. transmuxedData.buffer.push({
  73018. captions,
  73019. captionStreams,
  73020. metadata
  73021. });
  73022. const boxes = event2.data.segment.boxes || {
  73023. data: event2.data.segment.data
  73024. };
  73025. const result = {
  73026. type: type2,
  73027. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  73028. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  73029. };
  73030. if (typeof videoFrameDtsTime !== "undefined") {
  73031. result.videoFrameDtsTime = videoFrameDtsTime;
  73032. }
  73033. if (typeof videoFramePtsTime !== "undefined") {
  73034. result.videoFramePtsTime = videoFramePtsTime;
  73035. }
  73036. callback2(result);
  73037. };
  73038. const handleDone_$1 = ({
  73039. transmuxedData,
  73040. callback: callback2
  73041. }) => {
  73042. transmuxedData.buffer = [];
  73043. callback2(transmuxedData);
  73044. };
  73045. const handleGopInfo_$1 = (event2, transmuxedData) => {
  73046. transmuxedData.gopInfo = event2.data.gopInfo;
  73047. };
  73048. const processTransmux$1 = (options2) => {
  73049. const {
  73050. transmuxer,
  73051. bytes,
  73052. audioAppendStart,
  73053. gopsToAlignWith,
  73054. remux,
  73055. onData,
  73056. onTrackInfo,
  73057. onAudioTimingInfo,
  73058. onVideoTimingInfo,
  73059. onVideoSegmentTimingInfo,
  73060. onAudioSegmentTimingInfo,
  73061. onId3,
  73062. onCaptions,
  73063. onDone,
  73064. onEndedTimeline,
  73065. onTransmuxerLog,
  73066. isEndOfTimeline
  73067. } = options2;
  73068. const transmuxedData = {
  73069. buffer: []
  73070. };
  73071. let waitForEndedTimelineEvent = isEndOfTimeline;
  73072. const handleMessage = (event2) => {
  73073. if (transmuxer.currentTransmux !== options2) {
  73074. return;
  73075. }
  73076. if (event2.data.action === "data") {
  73077. handleData_$1(event2, transmuxedData, onData);
  73078. }
  73079. if (event2.data.action === "trackinfo") {
  73080. onTrackInfo(event2.data.trackInfo);
  73081. }
  73082. if (event2.data.action === "gopInfo") {
  73083. handleGopInfo_$1(event2, transmuxedData);
  73084. }
  73085. if (event2.data.action === "audioTimingInfo") {
  73086. onAudioTimingInfo(event2.data.audioTimingInfo);
  73087. }
  73088. if (event2.data.action === "videoTimingInfo") {
  73089. onVideoTimingInfo(event2.data.videoTimingInfo);
  73090. }
  73091. if (event2.data.action === "videoSegmentTimingInfo") {
  73092. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  73093. }
  73094. if (event2.data.action === "audioSegmentTimingInfo") {
  73095. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  73096. }
  73097. if (event2.data.action === "id3Frame") {
  73098. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  73099. }
  73100. if (event2.data.action === "caption") {
  73101. onCaptions(event2.data.caption);
  73102. }
  73103. if (event2.data.action === "endedtimeline") {
  73104. waitForEndedTimelineEvent = false;
  73105. onEndedTimeline();
  73106. }
  73107. if (event2.data.action === "log") {
  73108. onTransmuxerLog(event2.data.log);
  73109. }
  73110. if (event2.data.type !== "transmuxed") {
  73111. return;
  73112. }
  73113. if (waitForEndedTimelineEvent) {
  73114. return;
  73115. }
  73116. transmuxer.onmessage = null;
  73117. handleDone_$1({
  73118. transmuxedData,
  73119. callback: onDone
  73120. });
  73121. dequeue$1(transmuxer);
  73122. };
  73123. transmuxer.onmessage = handleMessage;
  73124. if (audioAppendStart) {
  73125. transmuxer.postMessage({
  73126. action: "setAudioAppendStart",
  73127. appendStart: audioAppendStart
  73128. });
  73129. }
  73130. if (Array.isArray(gopsToAlignWith)) {
  73131. transmuxer.postMessage({
  73132. action: "alignGopsWith",
  73133. gopsToAlignWith
  73134. });
  73135. }
  73136. if (typeof remux !== "undefined") {
  73137. transmuxer.postMessage({
  73138. action: "setRemux",
  73139. remux
  73140. });
  73141. }
  73142. if (bytes.byteLength) {
  73143. const buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  73144. const byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  73145. transmuxer.postMessage({
  73146. action: "push",
  73147. data: buffer,
  73148. byteOffset,
  73149. byteLength: bytes.byteLength
  73150. }, [buffer]);
  73151. }
  73152. if (isEndOfTimeline) {
  73153. transmuxer.postMessage({
  73154. action: "endTimeline"
  73155. });
  73156. }
  73157. transmuxer.postMessage({
  73158. action: "flush"
  73159. });
  73160. };
  73161. const dequeue$1 = (transmuxer) => {
  73162. transmuxer.currentTransmux = null;
  73163. if (transmuxer.transmuxQueue.length) {
  73164. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  73165. if (typeof transmuxer.currentTransmux === "function") {
  73166. transmuxer.currentTransmux();
  73167. } else {
  73168. processTransmux$1(transmuxer.currentTransmux);
  73169. }
  73170. }
  73171. };
  73172. const processAction$1 = (transmuxer, action) => {
  73173. transmuxer.postMessage({
  73174. action
  73175. });
  73176. dequeue$1(transmuxer);
  73177. };
  73178. const enqueueAction$1 = (action, transmuxer) => {
  73179. if (!transmuxer.currentTransmux) {
  73180. transmuxer.currentTransmux = action;
  73181. processAction$1(transmuxer, action);
  73182. return;
  73183. }
  73184. transmuxer.transmuxQueue.push(processAction$1.bind(null, transmuxer, action));
  73185. };
  73186. const reset$1 = (transmuxer) => {
  73187. enqueueAction$1("reset", transmuxer);
  73188. };
  73189. const endTimeline$1 = (transmuxer) => {
  73190. enqueueAction$1("endTimeline", transmuxer);
  73191. };
  73192. const transmux$1 = (options2) => {
  73193. if (!options2.transmuxer.currentTransmux) {
  73194. options2.transmuxer.currentTransmux = options2;
  73195. processTransmux$1(options2);
  73196. return;
  73197. }
  73198. options2.transmuxer.transmuxQueue.push(options2);
  73199. };
  73200. const createTransmuxer$1 = (options2) => {
  73201. const transmuxer = new TransmuxWorker$1();
  73202. transmuxer.currentTransmux = null;
  73203. transmuxer.transmuxQueue = [];
  73204. const term = transmuxer.terminate;
  73205. transmuxer.terminate = () => {
  73206. transmuxer.currentTransmux = null;
  73207. transmuxer.transmuxQueue.length = 0;
  73208. return term.call(transmuxer);
  73209. };
  73210. transmuxer.postMessage({
  73211. action: "init",
  73212. options: options2
  73213. });
  73214. return transmuxer;
  73215. };
  73216. var segmentTransmuxer$1 = {
  73217. reset: reset$1,
  73218. endTimeline: endTimeline$1,
  73219. transmux: transmux$1,
  73220. createTransmuxer: createTransmuxer$1
  73221. };
  73222. const workerCallback$1 = function(options2) {
  73223. const transmuxer = options2.transmuxer;
  73224. const endAction = options2.endAction || options2.action;
  73225. const callback2 = options2.callback;
  73226. const message = _extends$2({}, options2, {
  73227. endAction: null,
  73228. transmuxer: null,
  73229. callback: null
  73230. });
  73231. const listenForEndEvent = (event2) => {
  73232. if (event2.data.action !== endAction) {
  73233. return;
  73234. }
  73235. transmuxer.removeEventListener("message", listenForEndEvent);
  73236. if (event2.data.data) {
  73237. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  73238. if (options2.data) {
  73239. options2.data = event2.data.data;
  73240. }
  73241. }
  73242. callback2(event2.data);
  73243. };
  73244. transmuxer.addEventListener("message", listenForEndEvent);
  73245. if (options2.data) {
  73246. const isArrayBuffer = options2.data instanceof ArrayBuffer;
  73247. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  73248. message.byteLength = options2.data.byteLength;
  73249. const transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  73250. transmuxer.postMessage(message, transfers);
  73251. } else {
  73252. transmuxer.postMessage(message);
  73253. }
  73254. };
  73255. const REQUEST_ERRORS$1 = {
  73256. FAILURE: 2,
  73257. TIMEOUT: -101,
  73258. ABORTED: -102
  73259. };
  73260. const abortAll$1 = (activeXhrs) => {
  73261. activeXhrs.forEach((xhr) => {
  73262. xhr.abort();
  73263. });
  73264. };
  73265. const getRequestStats$1 = (request) => {
  73266. return {
  73267. bandwidth: request.bandwidth,
  73268. bytesReceived: request.bytesReceived || 0,
  73269. roundTripTime: request.roundTripTime || 0
  73270. };
  73271. };
  73272. const getProgressStats$1 = (progressEvent) => {
  73273. const request = progressEvent.target;
  73274. const roundTripTime = Date.now() - request.requestTime;
  73275. const stats = {
  73276. bandwidth: Infinity,
  73277. bytesReceived: 0,
  73278. roundTripTime: roundTripTime || 0
  73279. };
  73280. stats.bytesReceived = progressEvent.loaded;
  73281. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  73282. return stats;
  73283. };
  73284. const handleErrors$1 = (error, request) => {
  73285. if (request.timedout) {
  73286. return {
  73287. status: request.status,
  73288. message: "HLS request timed-out at URL: " + request.uri,
  73289. code: REQUEST_ERRORS$1.TIMEOUT,
  73290. xhr: request
  73291. };
  73292. }
  73293. if (request.aborted) {
  73294. return {
  73295. status: request.status,
  73296. message: "HLS request aborted at URL: " + request.uri,
  73297. code: REQUEST_ERRORS$1.ABORTED,
  73298. xhr: request
  73299. };
  73300. }
  73301. if (error) {
  73302. return {
  73303. status: request.status,
  73304. message: "HLS request errored at URL: " + request.uri,
  73305. code: REQUEST_ERRORS$1.FAILURE,
  73306. xhr: request
  73307. };
  73308. }
  73309. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  73310. return {
  73311. status: request.status,
  73312. message: "Empty HLS response at URL: " + request.uri,
  73313. code: REQUEST_ERRORS$1.FAILURE,
  73314. xhr: request
  73315. };
  73316. }
  73317. return null;
  73318. };
  73319. const handleKeyResponse$1 = (segment, objects, finishProcessingFn) => (error, request) => {
  73320. const response = request.response;
  73321. const errorObj = handleErrors$1(error, request);
  73322. if (errorObj) {
  73323. return finishProcessingFn(errorObj, segment);
  73324. }
  73325. if (response.byteLength !== 16) {
  73326. return finishProcessingFn({
  73327. status: request.status,
  73328. message: "Invalid HLS key at URL: " + request.uri,
  73329. code: REQUEST_ERRORS$1.FAILURE,
  73330. xhr: request
  73331. }, segment);
  73332. }
  73333. const view = new DataView(response);
  73334. const bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  73335. for (let i2 = 0; i2 < objects.length; i2++) {
  73336. objects[i2].bytes = bytes;
  73337. }
  73338. return finishProcessingFn(null, segment);
  73339. };
  73340. const parseInitSegment$1 = (segment, callback2) => {
  73341. const type2 = detectContainerForBytes$1(segment.map.bytes);
  73342. if (type2 !== "mp4") {
  73343. const uri = segment.map.resolvedUri || segment.map.uri;
  73344. return callback2({
  73345. internal: true,
  73346. message: `Found unsupported ${type2 || "unknown"} container for initialization segment at URL: ${uri}`,
  73347. code: REQUEST_ERRORS$1.FAILURE
  73348. });
  73349. }
  73350. workerCallback$1({
  73351. action: "probeMp4Tracks",
  73352. data: segment.map.bytes,
  73353. transmuxer: segment.transmuxer,
  73354. callback: ({
  73355. tracks,
  73356. data
  73357. }) => {
  73358. segment.map.bytes = data;
  73359. tracks.forEach(function(track) {
  73360. segment.map.tracks = segment.map.tracks || {};
  73361. if (segment.map.tracks[track.type]) {
  73362. return;
  73363. }
  73364. segment.map.tracks[track.type] = track;
  73365. if (typeof track.id === "number" && track.timescale) {
  73366. segment.map.timescales = segment.map.timescales || {};
  73367. segment.map.timescales[track.id] = track.timescale;
  73368. }
  73369. });
  73370. return callback2(null);
  73371. }
  73372. });
  73373. };
  73374. const handleInitSegmentResponse$1 = ({
  73375. segment,
  73376. finishProcessingFn
  73377. }) => (error, request) => {
  73378. const errorObj = handleErrors$1(error, request);
  73379. if (errorObj) {
  73380. return finishProcessingFn(errorObj, segment);
  73381. }
  73382. const bytes = new Uint8Array(request.response);
  73383. if (segment.map.key) {
  73384. segment.map.encryptedBytes = bytes;
  73385. return finishProcessingFn(null, segment);
  73386. }
  73387. segment.map.bytes = bytes;
  73388. parseInitSegment$1(segment, function(parseError) {
  73389. if (parseError) {
  73390. parseError.xhr = request;
  73391. parseError.status = request.status;
  73392. return finishProcessingFn(parseError, segment);
  73393. }
  73394. finishProcessingFn(null, segment);
  73395. });
  73396. };
  73397. const handleSegmentResponse$1 = ({
  73398. segment,
  73399. finishProcessingFn,
  73400. responseType
  73401. }) => (error, request) => {
  73402. const errorObj = handleErrors$1(error, request);
  73403. if (errorObj) {
  73404. return finishProcessingFn(errorObj, segment);
  73405. }
  73406. const newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer$1(request.responseText.substring(segment.lastReachedChar || 0));
  73407. segment.stats = getRequestStats$1(request);
  73408. if (segment.key) {
  73409. segment.encryptedBytes = new Uint8Array(newBytes);
  73410. } else {
  73411. segment.bytes = new Uint8Array(newBytes);
  73412. }
  73413. return finishProcessingFn(null, segment);
  73414. };
  73415. const transmuxAndNotify$1 = ({
  73416. segment,
  73417. bytes,
  73418. trackInfoFn,
  73419. timingInfoFn,
  73420. videoSegmentTimingInfoFn,
  73421. audioSegmentTimingInfoFn,
  73422. id3Fn,
  73423. captionsFn,
  73424. isEndOfTimeline,
  73425. endedTimelineFn,
  73426. dataFn,
  73427. doneFn,
  73428. onTransmuxerLog
  73429. }) => {
  73430. const fmp4Tracks = segment.map && segment.map.tracks || {};
  73431. const isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  73432. let audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  73433. const audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  73434. let videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  73435. const videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  73436. const finish = () => transmux$1({
  73437. bytes,
  73438. transmuxer: segment.transmuxer,
  73439. audioAppendStart: segment.audioAppendStart,
  73440. gopsToAlignWith: segment.gopsToAlignWith,
  73441. remux: isMuxed3,
  73442. onData: (result) => {
  73443. result.type = result.type === "combined" ? "video" : result.type;
  73444. dataFn(segment, result);
  73445. },
  73446. onTrackInfo: (trackInfo) => {
  73447. if (trackInfoFn) {
  73448. if (isMuxed3) {
  73449. trackInfo.isMuxed = true;
  73450. }
  73451. trackInfoFn(segment, trackInfo);
  73452. }
  73453. },
  73454. onAudioTimingInfo: (audioTimingInfo) => {
  73455. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  73456. audioStartFn(audioTimingInfo.start);
  73457. audioStartFn = null;
  73458. }
  73459. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  73460. audioEndFn(audioTimingInfo.end);
  73461. }
  73462. },
  73463. onVideoTimingInfo: (videoTimingInfo) => {
  73464. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  73465. videoStartFn(videoTimingInfo.start);
  73466. videoStartFn = null;
  73467. }
  73468. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  73469. videoEndFn(videoTimingInfo.end);
  73470. }
  73471. },
  73472. onVideoSegmentTimingInfo: (videoSegmentTimingInfo) => {
  73473. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  73474. },
  73475. onAudioSegmentTimingInfo: (audioSegmentTimingInfo) => {
  73476. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  73477. },
  73478. onId3: (id3Frames, dispatchType) => {
  73479. id3Fn(segment, id3Frames, dispatchType);
  73480. },
  73481. onCaptions: (captions) => {
  73482. captionsFn(segment, [captions]);
  73483. },
  73484. isEndOfTimeline,
  73485. onEndedTimeline: () => {
  73486. endedTimelineFn();
  73487. },
  73488. onTransmuxerLog,
  73489. onDone: (result) => {
  73490. if (!doneFn) {
  73491. return;
  73492. }
  73493. result.type = result.type === "combined" ? "video" : result.type;
  73494. doneFn(null, segment, result);
  73495. }
  73496. });
  73497. workerCallback$1({
  73498. action: "probeTs",
  73499. transmuxer: segment.transmuxer,
  73500. data: bytes,
  73501. baseStartTime: segment.baseStartTime,
  73502. callback: (data) => {
  73503. segment.bytes = bytes = data.data;
  73504. const probeResult = data.result;
  73505. if (probeResult) {
  73506. trackInfoFn(segment, {
  73507. hasAudio: probeResult.hasAudio,
  73508. hasVideo: probeResult.hasVideo,
  73509. isMuxed: isMuxed3
  73510. });
  73511. trackInfoFn = null;
  73512. if (probeResult.hasAudio && !isMuxed3) {
  73513. audioStartFn(probeResult.audioStart);
  73514. }
  73515. if (probeResult.hasVideo) {
  73516. videoStartFn(probeResult.videoStart);
  73517. }
  73518. audioStartFn = null;
  73519. videoStartFn = null;
  73520. }
  73521. finish();
  73522. }
  73523. });
  73524. };
  73525. const handleSegmentBytes$1 = ({
  73526. segment,
  73527. bytes,
  73528. trackInfoFn,
  73529. timingInfoFn,
  73530. videoSegmentTimingInfoFn,
  73531. audioSegmentTimingInfoFn,
  73532. id3Fn,
  73533. captionsFn,
  73534. isEndOfTimeline,
  73535. endedTimelineFn,
  73536. dataFn,
  73537. doneFn,
  73538. onTransmuxerLog
  73539. }) => {
  73540. let bytesAsUint8Array = new Uint8Array(bytes);
  73541. if (isLikelyFmp4MediaSegment$1(bytesAsUint8Array)) {
  73542. segment.isFmp4 = true;
  73543. const {
  73544. tracks
  73545. } = segment.map;
  73546. const trackInfo = {
  73547. isFmp4: true,
  73548. hasVideo: !!tracks.video,
  73549. hasAudio: !!tracks.audio
  73550. };
  73551. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  73552. trackInfo.audioCodec = tracks.audio.codec;
  73553. }
  73554. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  73555. trackInfo.videoCodec = tracks.video.codec;
  73556. }
  73557. if (tracks.video && tracks.audio) {
  73558. trackInfo.isMuxed = true;
  73559. }
  73560. trackInfoFn(segment, trackInfo);
  73561. const finishLoading = (captions) => {
  73562. dataFn(segment, {
  73563. data: bytesAsUint8Array,
  73564. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  73565. });
  73566. if (captions && captions.length) {
  73567. captionsFn(segment, captions);
  73568. }
  73569. doneFn(null, segment, {});
  73570. };
  73571. workerCallback$1({
  73572. action: "probeMp4StartTime",
  73573. timescales: segment.map.timescales,
  73574. data: bytesAsUint8Array,
  73575. transmuxer: segment.transmuxer,
  73576. callback: ({
  73577. data,
  73578. startTime
  73579. }) => {
  73580. bytes = data.buffer;
  73581. segment.bytes = bytesAsUint8Array = data;
  73582. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  73583. timingInfoFn(segment, "audio", "start", startTime);
  73584. }
  73585. if (trackInfo.hasVideo) {
  73586. timingInfoFn(segment, "video", "start", startTime);
  73587. }
  73588. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  73589. finishLoading();
  73590. return;
  73591. }
  73592. workerCallback$1({
  73593. action: "pushMp4Captions",
  73594. endAction: "mp4Captions",
  73595. transmuxer: segment.transmuxer,
  73596. data: bytesAsUint8Array,
  73597. timescales: segment.map.timescales,
  73598. trackIds: [tracks.video.id],
  73599. callback: (message) => {
  73600. bytes = message.data.buffer;
  73601. segment.bytes = bytesAsUint8Array = message.data;
  73602. message.logs.forEach(function(log2) {
  73603. onTransmuxerLog(merge$2(log2, {
  73604. stream: "mp4CaptionParser"
  73605. }));
  73606. });
  73607. finishLoading(message.captions);
  73608. }
  73609. });
  73610. }
  73611. });
  73612. return;
  73613. }
  73614. if (!segment.transmuxer) {
  73615. doneFn(null, segment, {});
  73616. return;
  73617. }
  73618. if (typeof segment.container === "undefined") {
  73619. segment.container = detectContainerForBytes$1(bytesAsUint8Array);
  73620. }
  73621. if (segment.container !== "ts" && segment.container !== "aac") {
  73622. trackInfoFn(segment, {
  73623. hasAudio: false,
  73624. hasVideo: false
  73625. });
  73626. doneFn(null, segment, {});
  73627. return;
  73628. }
  73629. transmuxAndNotify$1({
  73630. segment,
  73631. bytes,
  73632. trackInfoFn,
  73633. timingInfoFn,
  73634. videoSegmentTimingInfoFn,
  73635. audioSegmentTimingInfoFn,
  73636. id3Fn,
  73637. captionsFn,
  73638. isEndOfTimeline,
  73639. endedTimelineFn,
  73640. dataFn,
  73641. doneFn,
  73642. onTransmuxerLog
  73643. });
  73644. };
  73645. const decrypt$1 = function({
  73646. id,
  73647. key,
  73648. encryptedBytes,
  73649. decryptionWorker
  73650. }, callback2) {
  73651. const decryptionHandler = (event2) => {
  73652. if (event2.data.source === id) {
  73653. decryptionWorker.removeEventListener("message", decryptionHandler);
  73654. const decrypted = event2.data.decrypted;
  73655. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  73656. }
  73657. };
  73658. decryptionWorker.addEventListener("message", decryptionHandler);
  73659. let keyBytes;
  73660. if (key.bytes.slice) {
  73661. keyBytes = key.bytes.slice();
  73662. } else {
  73663. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  73664. }
  73665. decryptionWorker.postMessage(createTransferableMessage$1({
  73666. source: id,
  73667. encrypted: encryptedBytes,
  73668. key: keyBytes,
  73669. iv: key.iv
  73670. }), [encryptedBytes.buffer, keyBytes.buffer]);
  73671. };
  73672. const decryptSegment$1 = ({
  73673. decryptionWorker,
  73674. segment,
  73675. trackInfoFn,
  73676. timingInfoFn,
  73677. videoSegmentTimingInfoFn,
  73678. audioSegmentTimingInfoFn,
  73679. id3Fn,
  73680. captionsFn,
  73681. isEndOfTimeline,
  73682. endedTimelineFn,
  73683. dataFn,
  73684. doneFn,
  73685. onTransmuxerLog
  73686. }) => {
  73687. decrypt$1({
  73688. id: segment.requestId,
  73689. key: segment.key,
  73690. encryptedBytes: segment.encryptedBytes,
  73691. decryptionWorker
  73692. }, (decryptedBytes) => {
  73693. segment.bytes = decryptedBytes;
  73694. handleSegmentBytes$1({
  73695. segment,
  73696. bytes: segment.bytes,
  73697. trackInfoFn,
  73698. timingInfoFn,
  73699. videoSegmentTimingInfoFn,
  73700. audioSegmentTimingInfoFn,
  73701. id3Fn,
  73702. captionsFn,
  73703. isEndOfTimeline,
  73704. endedTimelineFn,
  73705. dataFn,
  73706. doneFn,
  73707. onTransmuxerLog
  73708. });
  73709. });
  73710. };
  73711. const waitForCompletion$1 = ({
  73712. activeXhrs,
  73713. decryptionWorker,
  73714. trackInfoFn,
  73715. timingInfoFn,
  73716. videoSegmentTimingInfoFn,
  73717. audioSegmentTimingInfoFn,
  73718. id3Fn,
  73719. captionsFn,
  73720. isEndOfTimeline,
  73721. endedTimelineFn,
  73722. dataFn,
  73723. doneFn,
  73724. onTransmuxerLog
  73725. }) => {
  73726. let count = 0;
  73727. let didError = false;
  73728. return (error, segment) => {
  73729. if (didError) {
  73730. return;
  73731. }
  73732. if (error) {
  73733. didError = true;
  73734. abortAll$1(activeXhrs);
  73735. return doneFn(error, segment);
  73736. }
  73737. count += 1;
  73738. if (count === activeXhrs.length) {
  73739. const segmentFinish = function() {
  73740. if (segment.encryptedBytes) {
  73741. return decryptSegment$1({
  73742. decryptionWorker,
  73743. segment,
  73744. trackInfoFn,
  73745. timingInfoFn,
  73746. videoSegmentTimingInfoFn,
  73747. audioSegmentTimingInfoFn,
  73748. id3Fn,
  73749. captionsFn,
  73750. isEndOfTimeline,
  73751. endedTimelineFn,
  73752. dataFn,
  73753. doneFn,
  73754. onTransmuxerLog
  73755. });
  73756. }
  73757. handleSegmentBytes$1({
  73758. segment,
  73759. bytes: segment.bytes,
  73760. trackInfoFn,
  73761. timingInfoFn,
  73762. videoSegmentTimingInfoFn,
  73763. audioSegmentTimingInfoFn,
  73764. id3Fn,
  73765. captionsFn,
  73766. isEndOfTimeline,
  73767. endedTimelineFn,
  73768. dataFn,
  73769. doneFn,
  73770. onTransmuxerLog
  73771. });
  73772. };
  73773. segment.endOfAllRequests = Date.now();
  73774. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  73775. return decrypt$1({
  73776. decryptionWorker,
  73777. id: segment.requestId + "-init",
  73778. encryptedBytes: segment.map.encryptedBytes,
  73779. key: segment.map.key
  73780. }, (decryptedBytes) => {
  73781. segment.map.bytes = decryptedBytes;
  73782. parseInitSegment$1(segment, (parseError) => {
  73783. if (parseError) {
  73784. abortAll$1(activeXhrs);
  73785. return doneFn(parseError, segment);
  73786. }
  73787. segmentFinish();
  73788. });
  73789. });
  73790. }
  73791. segmentFinish();
  73792. }
  73793. };
  73794. };
  73795. const handleLoadEnd$1 = ({
  73796. loadendState,
  73797. abortFn
  73798. }) => (event2) => {
  73799. const request = event2.target;
  73800. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  73801. abortFn();
  73802. loadendState.calledAbortFn = true;
  73803. }
  73804. };
  73805. const handleProgress$1 = ({
  73806. segment,
  73807. progressFn,
  73808. trackInfoFn,
  73809. timingInfoFn,
  73810. videoSegmentTimingInfoFn,
  73811. audioSegmentTimingInfoFn,
  73812. id3Fn,
  73813. captionsFn,
  73814. isEndOfTimeline,
  73815. endedTimelineFn,
  73816. dataFn
  73817. }) => (event2) => {
  73818. const request = event2.target;
  73819. if (request.aborted) {
  73820. return;
  73821. }
  73822. segment.stats = merge$2(segment.stats, getProgressStats$1(event2));
  73823. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  73824. segment.stats.firstBytesReceivedAt = Date.now();
  73825. }
  73826. return progressFn(event2, segment);
  73827. };
  73828. const mediaSegmentRequest$1 = ({
  73829. xhr,
  73830. xhrOptions,
  73831. decryptionWorker,
  73832. segment,
  73833. abortFn,
  73834. progressFn,
  73835. trackInfoFn,
  73836. timingInfoFn,
  73837. videoSegmentTimingInfoFn,
  73838. audioSegmentTimingInfoFn,
  73839. id3Fn,
  73840. captionsFn,
  73841. isEndOfTimeline,
  73842. endedTimelineFn,
  73843. dataFn,
  73844. doneFn,
  73845. onTransmuxerLog
  73846. }) => {
  73847. const activeXhrs = [];
  73848. const finishProcessingFn = waitForCompletion$1({
  73849. activeXhrs,
  73850. decryptionWorker,
  73851. trackInfoFn,
  73852. timingInfoFn,
  73853. videoSegmentTimingInfoFn,
  73854. audioSegmentTimingInfoFn,
  73855. id3Fn,
  73856. captionsFn,
  73857. isEndOfTimeline,
  73858. endedTimelineFn,
  73859. dataFn,
  73860. doneFn,
  73861. onTransmuxerLog
  73862. });
  73863. if (segment.key && !segment.key.bytes) {
  73864. const objects = [segment.key];
  73865. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  73866. objects.push(segment.map.key);
  73867. }
  73868. const keyRequestOptions = merge$2(xhrOptions, {
  73869. uri: segment.key.resolvedUri,
  73870. responseType: "arraybuffer"
  73871. });
  73872. const keyRequestCallback = handleKeyResponse$1(segment, objects, finishProcessingFn);
  73873. const keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  73874. activeXhrs.push(keyXhr);
  73875. }
  73876. if (segment.map && !segment.map.bytes) {
  73877. const differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  73878. if (differentMapKey) {
  73879. const mapKeyRequestOptions = merge$2(xhrOptions, {
  73880. uri: segment.map.key.resolvedUri,
  73881. responseType: "arraybuffer"
  73882. });
  73883. const mapKeyRequestCallback = handleKeyResponse$1(segment, [segment.map.key], finishProcessingFn);
  73884. const mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  73885. activeXhrs.push(mapKeyXhr);
  73886. }
  73887. const initSegmentOptions = merge$2(xhrOptions, {
  73888. uri: segment.map.resolvedUri,
  73889. responseType: "arraybuffer",
  73890. headers: segmentXhrHeaders$1(segment.map)
  73891. });
  73892. const initSegmentRequestCallback = handleInitSegmentResponse$1({
  73893. segment,
  73894. finishProcessingFn
  73895. });
  73896. const initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  73897. activeXhrs.push(initSegmentXhr);
  73898. }
  73899. const segmentRequestOptions = merge$2(xhrOptions, {
  73900. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  73901. responseType: "arraybuffer",
  73902. headers: segmentXhrHeaders$1(segment)
  73903. });
  73904. const segmentRequestCallback = handleSegmentResponse$1({
  73905. segment,
  73906. finishProcessingFn,
  73907. responseType: segmentRequestOptions.responseType
  73908. });
  73909. const segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  73910. segmentXhr.addEventListener("progress", handleProgress$1({
  73911. segment,
  73912. progressFn,
  73913. trackInfoFn,
  73914. timingInfoFn,
  73915. videoSegmentTimingInfoFn,
  73916. audioSegmentTimingInfoFn,
  73917. id3Fn,
  73918. captionsFn,
  73919. isEndOfTimeline,
  73920. endedTimelineFn,
  73921. dataFn
  73922. }));
  73923. activeXhrs.push(segmentXhr);
  73924. const loadendState = {};
  73925. activeXhrs.forEach((activeXhr) => {
  73926. activeXhr.addEventListener("loadend", handleLoadEnd$1({
  73927. loadendState,
  73928. abortFn
  73929. }));
  73930. });
  73931. return () => abortAll$1(activeXhrs);
  73932. };
  73933. const logFn$1$1 = logger$1("CodecUtils");
  73934. const getCodecs$1 = function(media) {
  73935. const mediaAttributes = media.attributes || {};
  73936. if (mediaAttributes.CODECS) {
  73937. return parseCodecs$1(mediaAttributes.CODECS);
  73938. }
  73939. };
  73940. const isMaat$1 = (main, media) => {
  73941. const mediaAttributes = media.attributes || {};
  73942. return main && main.mediaGroups && main.mediaGroups.AUDIO && mediaAttributes.AUDIO && main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73943. };
  73944. const isMuxed$1 = (main, media) => {
  73945. if (!isMaat$1(main, media)) {
  73946. return true;
  73947. }
  73948. const mediaAttributes = media.attributes || {};
  73949. const audioGroup = main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73950. for (const groupId in audioGroup) {
  73951. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  73952. return true;
  73953. }
  73954. }
  73955. return false;
  73956. };
  73957. const unwrapCodecList$1 = function(codecList) {
  73958. const codecs = {};
  73959. codecList.forEach(({
  73960. mediaType,
  73961. type: type2,
  73962. details
  73963. }) => {
  73964. codecs[mediaType] = codecs[mediaType] || [];
  73965. codecs[mediaType].push(translateLegacyCodec$1(`${type2}${details}`));
  73966. });
  73967. Object.keys(codecs).forEach(function(mediaType) {
  73968. if (codecs[mediaType].length > 1) {
  73969. logFn$1$1(`multiple ${mediaType} codecs found as attributes: ${codecs[mediaType].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);
  73970. codecs[mediaType] = null;
  73971. return;
  73972. }
  73973. codecs[mediaType] = codecs[mediaType][0];
  73974. });
  73975. return codecs;
  73976. };
  73977. const codecCount$1 = function(codecObj) {
  73978. let count = 0;
  73979. if (codecObj.audio) {
  73980. count++;
  73981. }
  73982. if (codecObj.video) {
  73983. count++;
  73984. }
  73985. return count;
  73986. };
  73987. const codecsForPlaylist$1 = function(main, media) {
  73988. const mediaAttributes = media.attributes || {};
  73989. const codecInfo = unwrapCodecList$1(getCodecs$1(media) || []);
  73990. if (isMaat$1(main, media) && !codecInfo.audio) {
  73991. if (!isMuxed$1(main, media)) {
  73992. const defaultCodecs = unwrapCodecList$1(codecsFromDefault$1(main, mediaAttributes.AUDIO) || []);
  73993. if (defaultCodecs.audio) {
  73994. codecInfo.audio = defaultCodecs.audio;
  73995. }
  73996. }
  73997. }
  73998. return codecInfo;
  73999. };
  74000. const logFn$2 = logger$1("PlaylistSelector");
  74001. const representationToString$1 = function(representation) {
  74002. if (!representation || !representation.playlist) {
  74003. return;
  74004. }
  74005. const playlist = representation.playlist;
  74006. return JSON.stringify({
  74007. id: playlist.id,
  74008. bandwidth: representation.bandwidth,
  74009. width: representation.width,
  74010. height: representation.height,
  74011. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  74012. });
  74013. };
  74014. const safeGetComputedStyle$1 = function(el, property) {
  74015. if (!el) {
  74016. return "";
  74017. }
  74018. const result = window_1.getComputedStyle(el);
  74019. if (!result) {
  74020. return "";
  74021. }
  74022. return result[property];
  74023. };
  74024. const stableSort$1 = function(array, sortFn) {
  74025. const newArray = array.slice();
  74026. array.sort(function(left, right) {
  74027. const cmp = sortFn(left, right);
  74028. if (cmp === 0) {
  74029. return newArray.indexOf(left) - newArray.indexOf(right);
  74030. }
  74031. return cmp;
  74032. });
  74033. };
  74034. const comparePlaylistBandwidth$1 = function(left, right) {
  74035. let leftBandwidth;
  74036. let rightBandwidth;
  74037. if (left.attributes.BANDWIDTH) {
  74038. leftBandwidth = left.attributes.BANDWIDTH;
  74039. }
  74040. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  74041. if (right.attributes.BANDWIDTH) {
  74042. rightBandwidth = right.attributes.BANDWIDTH;
  74043. }
  74044. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  74045. return leftBandwidth - rightBandwidth;
  74046. };
  74047. const comparePlaylistResolution$1 = function(left, right) {
  74048. let leftWidth;
  74049. let rightWidth;
  74050. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  74051. leftWidth = left.attributes.RESOLUTION.width;
  74052. }
  74053. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  74054. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  74055. rightWidth = right.attributes.RESOLUTION.width;
  74056. }
  74057. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  74058. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  74059. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  74060. }
  74061. return leftWidth - rightWidth;
  74062. };
  74063. let simpleSelector$1 = function(main, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, playlistController) {
  74064. if (!main) {
  74065. return;
  74066. }
  74067. const options2 = {
  74068. bandwidth: playerBandwidth,
  74069. width: playerWidth,
  74070. height: playerHeight,
  74071. limitRenditionByPlayerDimensions
  74072. };
  74073. let playlists = main.playlists;
  74074. if (Playlist$1.isAudioOnly(main)) {
  74075. playlists = playlistController.getAudioTrackPlaylists_();
  74076. options2.audioOnly = true;
  74077. }
  74078. let sortedPlaylistReps = playlists.map((playlist) => {
  74079. let bandwidth2;
  74080. const width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  74081. const height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  74082. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  74083. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  74084. return {
  74085. bandwidth: bandwidth2,
  74086. width: width2,
  74087. height: height2,
  74088. playlist
  74089. };
  74090. });
  74091. stableSort$1(sortedPlaylistReps, (left, right) => left.bandwidth - right.bandwidth);
  74092. sortedPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isIncompatible(rep2.playlist));
  74093. let enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => Playlist$1.isEnabled(rep2.playlist));
  74094. if (!enabledPlaylistReps.length) {
  74095. enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isDisabled(rep2.playlist));
  74096. }
  74097. const bandwidthPlaylistReps = enabledPlaylistReps.filter((rep2) => rep2.bandwidth * Config$1.BANDWIDTH_VARIANCE < playerBandwidth);
  74098. let highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  74099. const bandwidthBestRep = bandwidthPlaylistReps.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74100. if (limitRenditionByPlayerDimensions === false) {
  74101. const chosenRep2 = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74102. if (chosenRep2 && chosenRep2.playlist) {
  74103. let type2 = "sortedPlaylistReps";
  74104. if (bandwidthBestRep) {
  74105. type2 = "bandwidthBestRep";
  74106. }
  74107. if (enabledPlaylistReps[0]) {
  74108. type2 = "enabledPlaylistReps";
  74109. }
  74110. logFn$2(`choosing ${representationToString$1(chosenRep2)} using ${type2} with options`, options2);
  74111. return chosenRep2.playlist;
  74112. }
  74113. logFn$2("could not choose a playlist with options", options2);
  74114. return null;
  74115. }
  74116. const haveResolution = bandwidthPlaylistReps.filter((rep2) => rep2.width && rep2.height);
  74117. stableSort$1(haveResolution, (left, right) => left.width - right.width);
  74118. const resolutionBestRepList = haveResolution.filter((rep2) => rep2.width === playerWidth && rep2.height === playerHeight);
  74119. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  74120. const resolutionBestRep = resolutionBestRepList.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74121. let resolutionPlusOneList;
  74122. let resolutionPlusOneSmallest;
  74123. let resolutionPlusOneRep;
  74124. if (!resolutionBestRep) {
  74125. resolutionPlusOneList = haveResolution.filter((rep2) => rep2.width > playerWidth || rep2.height > playerHeight);
  74126. resolutionPlusOneSmallest = resolutionPlusOneList.filter((rep2) => rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height);
  74127. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  74128. resolutionPlusOneRep = resolutionPlusOneSmallest.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74129. }
  74130. let leastPixelDiffRep;
  74131. if (playlistController.leastPixelDiffSelector) {
  74132. const leastPixelDiffList = haveResolution.map((rep2) => {
  74133. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  74134. return rep2;
  74135. });
  74136. stableSort$1(leastPixelDiffList, (left, right) => {
  74137. if (left.pixelDiff === right.pixelDiff) {
  74138. return right.bandwidth - left.bandwidth;
  74139. }
  74140. return left.pixelDiff - right.pixelDiff;
  74141. });
  74142. leastPixelDiffRep = leastPixelDiffList[0];
  74143. }
  74144. const chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74145. if (chosenRep && chosenRep.playlist) {
  74146. let type2 = "sortedPlaylistReps";
  74147. if (leastPixelDiffRep) {
  74148. type2 = "leastPixelDiffRep";
  74149. } else if (resolutionPlusOneRep) {
  74150. type2 = "resolutionPlusOneRep";
  74151. } else if (resolutionBestRep) {
  74152. type2 = "resolutionBestRep";
  74153. } else if (bandwidthBestRep) {
  74154. type2 = "bandwidthBestRep";
  74155. } else if (enabledPlaylistReps[0]) {
  74156. type2 = "enabledPlaylistReps";
  74157. }
  74158. logFn$2(`choosing ${representationToString$1(chosenRep)} using ${type2} with options`, options2);
  74159. return chosenRep.playlist;
  74160. }
  74161. logFn$2("could not choose a playlist with options", options2);
  74162. return null;
  74163. };
  74164. const lastBandwidthSelector$1 = function() {
  74165. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74166. return simpleSelector$1(this.playlists.main, this.systemBandwidth, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74167. };
  74168. const movingAverageBandwidthSelector$1 = function(decay) {
  74169. let average = -1;
  74170. let lastSystemBandwidth = -1;
  74171. if (decay < 0 || decay > 1) {
  74172. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  74173. }
  74174. return function() {
  74175. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74176. if (average < 0) {
  74177. average = this.systemBandwidth;
  74178. lastSystemBandwidth = this.systemBandwidth;
  74179. }
  74180. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  74181. average = decay * this.systemBandwidth + (1 - decay) * average;
  74182. lastSystemBandwidth = this.systemBandwidth;
  74183. }
  74184. return simpleSelector$1(this.playlists.main, average, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74185. };
  74186. };
  74187. const minRebufferMaxBandwidthSelector$1 = function(settings) {
  74188. const {
  74189. main,
  74190. currentTime,
  74191. bandwidth: bandwidth2,
  74192. duration: duration5,
  74193. segmentDuration,
  74194. timeUntilRebuffer: timeUntilRebuffer3,
  74195. currentTimeline,
  74196. syncController
  74197. } = settings;
  74198. const compatiblePlaylists = main.playlists.filter((playlist) => !Playlist$1.isIncompatible(playlist));
  74199. let enabledPlaylists = compatiblePlaylists.filter(Playlist$1.isEnabled);
  74200. if (!enabledPlaylists.length) {
  74201. enabledPlaylists = compatiblePlaylists.filter((playlist) => !Playlist$1.isDisabled(playlist));
  74202. }
  74203. const bandwidthPlaylists = enabledPlaylists.filter(Playlist$1.hasAttribute.bind(null, "BANDWIDTH"));
  74204. const rebufferingEstimates = bandwidthPlaylists.map((playlist) => {
  74205. const syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  74206. const numRequests = syncPoint ? 1 : 2;
  74207. const requestTimeEstimate = Playlist$1.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  74208. const rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  74209. return {
  74210. playlist,
  74211. rebufferingImpact
  74212. };
  74213. });
  74214. const noRebufferingPlaylists = rebufferingEstimates.filter((estimate) => estimate.rebufferingImpact <= 0);
  74215. stableSort$1(noRebufferingPlaylists, (a, b) => comparePlaylistBandwidth$1(b.playlist, a.playlist));
  74216. if (noRebufferingPlaylists.length) {
  74217. return noRebufferingPlaylists[0];
  74218. }
  74219. stableSort$1(rebufferingEstimates, (a, b) => a.rebufferingImpact - b.rebufferingImpact);
  74220. return rebufferingEstimates[0] || null;
  74221. };
  74222. const lowestBitrateCompatibleVariantSelector$1 = function() {
  74223. const playlists = this.playlists.main.playlists.filter(Playlist$1.isEnabled);
  74224. stableSort$1(playlists, (a, b) => comparePlaylistBandwidth$1(a, b));
  74225. const playlistsWithVideo = playlists.filter((playlist) => !!codecsForPlaylist$1(this.playlists.main, playlist).video);
  74226. return playlistsWithVideo[0] || null;
  74227. };
  74228. const concatSegments$1 = (segmentObj) => {
  74229. let offset = 0;
  74230. let tempBuffer;
  74231. if (segmentObj.bytes) {
  74232. tempBuffer = new Uint8Array(segmentObj.bytes);
  74233. segmentObj.segments.forEach((segment) => {
  74234. tempBuffer.set(segment, offset);
  74235. offset += segment.byteLength;
  74236. });
  74237. }
  74238. return tempBuffer;
  74239. };
  74240. const createCaptionsTrackIfNotExists$1 = function(inbandTextTracks, tech, captionStream) {
  74241. if (!inbandTextTracks[captionStream]) {
  74242. tech.trigger({
  74243. type: "usage",
  74244. name: "vhs-608"
  74245. });
  74246. let instreamId = captionStream;
  74247. if (/^cc708_/.test(captionStream)) {
  74248. instreamId = "SERVICE" + captionStream.split("_")[1];
  74249. }
  74250. const track = tech.textTracks().getTrackById(instreamId);
  74251. if (track) {
  74252. inbandTextTracks[captionStream] = track;
  74253. } else {
  74254. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  74255. let label = captionStream;
  74256. let language = captionStream;
  74257. let def = false;
  74258. const captionService = captionServices[instreamId];
  74259. if (captionService) {
  74260. label = captionService.label;
  74261. language = captionService.language;
  74262. def = captionService.default;
  74263. }
  74264. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  74265. kind: "captions",
  74266. id: instreamId,
  74267. default: def,
  74268. label,
  74269. language
  74270. }, false).track;
  74271. }
  74272. }
  74273. };
  74274. const addCaptionData$1 = function({
  74275. inbandTextTracks,
  74276. captionArray,
  74277. timestampOffset: timestampOffset2
  74278. }) {
  74279. if (!captionArray) {
  74280. return;
  74281. }
  74282. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74283. captionArray.forEach((caption) => {
  74284. const track = caption.stream;
  74285. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  74286. });
  74287. };
  74288. const deprecateOldCue$1 = function(cue) {
  74289. Object.defineProperties(cue.frame, {
  74290. id: {
  74291. get() {
  74292. videojs$2.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  74293. return cue.value.key;
  74294. }
  74295. },
  74296. value: {
  74297. get() {
  74298. videojs$2.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  74299. return cue.value.data;
  74300. }
  74301. },
  74302. privateData: {
  74303. get() {
  74304. videojs$2.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  74305. return cue.value.data;
  74306. }
  74307. }
  74308. });
  74309. };
  74310. const addMetadata$1 = ({
  74311. inbandTextTracks,
  74312. metadataArray,
  74313. timestampOffset: timestampOffset2,
  74314. videoDuration
  74315. }) => {
  74316. if (!metadataArray) {
  74317. return;
  74318. }
  74319. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74320. const metadataTrack = inbandTextTracks.metadataTrack_;
  74321. if (!metadataTrack) {
  74322. return;
  74323. }
  74324. metadataArray.forEach((metadata) => {
  74325. const time = metadata.cueTime + timestampOffset2;
  74326. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  74327. return;
  74328. }
  74329. metadata.frames.forEach((frame) => {
  74330. const cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  74331. cue.frame = frame;
  74332. cue.value = frame;
  74333. deprecateOldCue$1(cue);
  74334. metadataTrack.addCue(cue);
  74335. });
  74336. });
  74337. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  74338. return;
  74339. }
  74340. const cues = metadataTrack.cues;
  74341. const cuesArray = [];
  74342. for (let i2 = 0; i2 < cues.length; i2++) {
  74343. if (cues[i2]) {
  74344. cuesArray.push(cues[i2]);
  74345. }
  74346. }
  74347. const cuesGroupedByStartTime = cuesArray.reduce((obj, cue) => {
  74348. const timeSlot = obj[cue.startTime] || [];
  74349. timeSlot.push(cue);
  74350. obj[cue.startTime] = timeSlot;
  74351. return obj;
  74352. }, {});
  74353. const sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort((a, b) => Number(a) - Number(b));
  74354. sortedStartTimes.forEach((startTime, idx) => {
  74355. const cueGroup = cuesGroupedByStartTime[startTime];
  74356. const nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  74357. cueGroup.forEach((cue) => {
  74358. cue.endTime = nextTime;
  74359. });
  74360. });
  74361. };
  74362. const createMetadataTrackIfNotExists$1 = (inbandTextTracks, dispatchType, tech) => {
  74363. if (inbandTextTracks.metadataTrack_) {
  74364. return;
  74365. }
  74366. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  74367. kind: "metadata",
  74368. label: "Timed Metadata"
  74369. }, false).track;
  74370. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  74371. };
  74372. const removeCuesFromTrack$1 = function(start2, end, track) {
  74373. let i2;
  74374. let cue;
  74375. if (!track) {
  74376. return;
  74377. }
  74378. if (!track.cues) {
  74379. return;
  74380. }
  74381. i2 = track.cues.length;
  74382. while (i2--) {
  74383. cue = track.cues[i2];
  74384. if (cue.startTime >= start2 && cue.endTime <= end) {
  74385. track.removeCue(cue);
  74386. }
  74387. }
  74388. };
  74389. const removeDuplicateCuesFromTrack$1 = function(track) {
  74390. const cues = track.cues;
  74391. if (!cues) {
  74392. return;
  74393. }
  74394. for (let i2 = 0; i2 < cues.length; i2++) {
  74395. const duplicates = [];
  74396. let occurrences = 0;
  74397. for (let j = 0; j < cues.length; j++) {
  74398. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  74399. occurrences++;
  74400. if (occurrences > 1) {
  74401. duplicates.push(cues[j]);
  74402. }
  74403. }
  74404. }
  74405. if (duplicates.length) {
  74406. duplicates.forEach((dupe) => track.removeCue(dupe));
  74407. }
  74408. }
  74409. };
  74410. const gopsSafeToAlignWith$1 = (buffer, currentTime, mapping) => {
  74411. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  74412. return [];
  74413. }
  74414. const currentTimePts = Math.ceil((currentTime - mapping + 3) * clock$1.ONE_SECOND_IN_TS);
  74415. let i2;
  74416. for (i2 = 0; i2 < buffer.length; i2++) {
  74417. if (buffer[i2].pts > currentTimePts) {
  74418. break;
  74419. }
  74420. }
  74421. return buffer.slice(i2);
  74422. };
  74423. const updateGopBuffer$1 = (buffer, gops, replace) => {
  74424. if (!gops.length) {
  74425. return buffer;
  74426. }
  74427. if (replace) {
  74428. return gops.slice();
  74429. }
  74430. const start2 = gops[0].pts;
  74431. let i2 = 0;
  74432. for (i2; i2 < buffer.length; i2++) {
  74433. if (buffer[i2].pts >= start2) {
  74434. break;
  74435. }
  74436. }
  74437. return buffer.slice(0, i2).concat(gops);
  74438. };
  74439. const removeGopBuffer$1 = (buffer, start2, end, mapping) => {
  74440. const startPts = Math.ceil((start2 - mapping) * clock$1.ONE_SECOND_IN_TS);
  74441. const endPts = Math.ceil((end - mapping) * clock$1.ONE_SECOND_IN_TS);
  74442. const updatedBuffer = buffer.slice();
  74443. let i2 = buffer.length;
  74444. while (i2--) {
  74445. if (buffer[i2].pts <= endPts) {
  74446. break;
  74447. }
  74448. }
  74449. if (i2 === -1) {
  74450. return updatedBuffer;
  74451. }
  74452. let j = i2 + 1;
  74453. while (j--) {
  74454. if (buffer[j].pts <= startPts) {
  74455. break;
  74456. }
  74457. }
  74458. j = Math.max(j, 0);
  74459. updatedBuffer.splice(j, i2 - j + 1);
  74460. return updatedBuffer;
  74461. };
  74462. const shallowEqual$1 = function(a, b) {
  74463. if (!a && !b || !a && b || a && !b) {
  74464. return false;
  74465. }
  74466. if (a === b) {
  74467. return true;
  74468. }
  74469. const akeys = Object.keys(a).sort();
  74470. const bkeys = Object.keys(b).sort();
  74471. if (akeys.length !== bkeys.length) {
  74472. return false;
  74473. }
  74474. for (let i2 = 0; i2 < akeys.length; i2++) {
  74475. const key = akeys[i2];
  74476. if (key !== bkeys[i2]) {
  74477. return false;
  74478. }
  74479. if (a[key] !== b[key]) {
  74480. return false;
  74481. }
  74482. }
  74483. return true;
  74484. };
  74485. const QUOTA_EXCEEDED_ERR$1 = 22;
  74486. const getSyncSegmentCandidate$1 = function(currentTimeline, segments, targetTime) {
  74487. segments = segments || [];
  74488. const timelineSegments = [];
  74489. let time = 0;
  74490. for (let i2 = 0; i2 < segments.length; i2++) {
  74491. const segment = segments[i2];
  74492. if (currentTimeline === segment.timeline) {
  74493. timelineSegments.push(i2);
  74494. time += segment.duration;
  74495. if (time > targetTime) {
  74496. return i2;
  74497. }
  74498. }
  74499. }
  74500. if (timelineSegments.length === 0) {
  74501. return 0;
  74502. }
  74503. return timelineSegments[timelineSegments.length - 1];
  74504. };
  74505. const MIN_BACK_BUFFER$1 = 1;
  74506. const CHECK_BUFFER_DELAY$1 = 500;
  74507. const finite$1 = (num) => typeof num === "number" && isFinite(num);
  74508. const MIN_SEGMENT_DURATION_TO_SAVE_STATS$1 = 1 / 60;
  74509. const illegalMediaSwitch$1 = (loaderType, startingMedia, trackInfo) => {
  74510. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  74511. return null;
  74512. }
  74513. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  74514. return "Neither audio nor video found in segment.";
  74515. }
  74516. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  74517. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  74518. }
  74519. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  74520. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  74521. }
  74522. return null;
  74523. };
  74524. const safeBackBufferTrimTime$1 = (seekable3, currentTime, targetDuration) => {
  74525. let trimTime = currentTime - Config$1.BACK_BUFFER_LENGTH;
  74526. if (seekable3.length) {
  74527. trimTime = Math.max(trimTime, seekable3.start(0));
  74528. }
  74529. const maxTrimTime = currentTime - targetDuration;
  74530. return Math.min(maxTrimTime, trimTime);
  74531. };
  74532. const segmentInfoString$1 = (segmentInfo) => {
  74533. const {
  74534. startOfSegment,
  74535. duration: duration5,
  74536. segment,
  74537. part,
  74538. playlist: {
  74539. mediaSequence: seq,
  74540. id,
  74541. segments = []
  74542. },
  74543. mediaIndex: index2,
  74544. partIndex,
  74545. timeline
  74546. } = segmentInfo;
  74547. const segmentLen = segments.length - 1;
  74548. let selection = "mediaIndex/partIndex increment";
  74549. if (segmentInfo.getMediaInfoForTime) {
  74550. selection = `getMediaInfoForTime (${segmentInfo.getMediaInfoForTime})`;
  74551. } else if (segmentInfo.isSyncRequest) {
  74552. selection = "getSyncSegmentCandidate (isSyncRequest)";
  74553. }
  74554. if (segmentInfo.independent) {
  74555. selection += ` with independent ${segmentInfo.independent}`;
  74556. }
  74557. const hasPartIndex = typeof partIndex === "number";
  74558. const name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  74559. const zeroBasedPartCount = hasPartIndex ? getKnownPartCount$1({
  74560. preloadSegment: segment
  74561. }) - 1 : 0;
  74562. return `${name} [${seq + index2}/${seq + segmentLen}]` + (hasPartIndex ? ` part [${partIndex}/${zeroBasedPartCount}]` : "") + ` segment start/end [${segment.start} => ${segment.end}]` + (hasPartIndex ? ` part start/end [${part.start} => ${part.end}]` : "") + ` startOfSegment [${startOfSegment}] duration [${duration5}] timeline [${timeline}] selected by [${selection}] playlist [${id}]`;
  74563. };
  74564. const timingInfoPropertyForMedia$1 = (mediaType) => `${mediaType}TimingInfo`;
  74565. const timestampOffsetForSegment$1 = ({
  74566. segmentTimeline,
  74567. currentTimeline,
  74568. startOfSegment,
  74569. buffered,
  74570. overrideCheck
  74571. }) => {
  74572. if (!overrideCheck && segmentTimeline === currentTimeline) {
  74573. return null;
  74574. }
  74575. if (segmentTimeline < currentTimeline) {
  74576. return startOfSegment;
  74577. }
  74578. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  74579. };
  74580. const shouldWaitForTimelineChange$1 = ({
  74581. timelineChangeController,
  74582. currentTimeline,
  74583. segmentTimeline,
  74584. loaderType,
  74585. audioDisabled
  74586. }) => {
  74587. if (currentTimeline === segmentTimeline) {
  74588. return false;
  74589. }
  74590. if (loaderType === "audio") {
  74591. const lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  74592. type: "main"
  74593. });
  74594. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  74595. }
  74596. if (loaderType === "main" && audioDisabled) {
  74597. const pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  74598. type: "audio"
  74599. });
  74600. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  74601. return false;
  74602. }
  74603. return true;
  74604. }
  74605. return false;
  74606. };
  74607. const mediaDuration$1 = (timingInfos) => {
  74608. let maxDuration = 0;
  74609. ["video", "audio"].forEach(function(type2) {
  74610. const typeTimingInfo = timingInfos[`${type2}TimingInfo`];
  74611. if (!typeTimingInfo) {
  74612. return;
  74613. }
  74614. const {
  74615. start: start2,
  74616. end
  74617. } = typeTimingInfo;
  74618. let duration5;
  74619. if (typeof start2 === "bigint" || typeof end === "bigint") {
  74620. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  74621. } else if (typeof start2 === "number" && typeof end === "number") {
  74622. duration5 = end - start2;
  74623. }
  74624. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  74625. maxDuration = duration5;
  74626. }
  74627. });
  74628. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  74629. maxDuration = Number(maxDuration);
  74630. }
  74631. return maxDuration;
  74632. };
  74633. const segmentTooLong$1 = ({
  74634. segmentDuration,
  74635. maxDuration
  74636. }) => {
  74637. if (!segmentDuration) {
  74638. return false;
  74639. }
  74640. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR$1;
  74641. };
  74642. const getTroublesomeSegmentDurationMessage$1 = (segmentInfo, sourceType) => {
  74643. if (sourceType !== "hls") {
  74644. return null;
  74645. }
  74646. const segmentDuration = mediaDuration$1({
  74647. audioTimingInfo: segmentInfo.audioTimingInfo,
  74648. videoTimingInfo: segmentInfo.videoTimingInfo
  74649. });
  74650. if (!segmentDuration) {
  74651. return null;
  74652. }
  74653. const targetDuration = segmentInfo.playlist.targetDuration;
  74654. const isSegmentWayTooLong = segmentTooLong$1({
  74655. segmentDuration,
  74656. maxDuration: targetDuration * 2
  74657. });
  74658. const isSegmentSlightlyTooLong = segmentTooLong$1({
  74659. segmentDuration,
  74660. maxDuration: targetDuration
  74661. });
  74662. const segmentTooLongMessage = `Segment with index ${segmentInfo.mediaIndex} from playlist ${segmentInfo.playlist.id} has a duration of ${segmentDuration} when the reported duration is ${segmentInfo.duration} and the target duration is ${targetDuration}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;
  74663. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  74664. return {
  74665. severity: isSegmentWayTooLong ? "warn" : "info",
  74666. message: segmentTooLongMessage
  74667. };
  74668. }
  74669. return null;
  74670. };
  74671. class SegmentLoader$1 extends videojs$2.EventTarget {
  74672. constructor(settings, options2 = {}) {
  74673. super();
  74674. if (!settings) {
  74675. throw new TypeError("Initialization settings are required");
  74676. }
  74677. if (typeof settings.currentTime !== "function") {
  74678. throw new TypeError("No currentTime getter specified");
  74679. }
  74680. if (!settings.mediaSource) {
  74681. throw new TypeError("No MediaSource specified");
  74682. }
  74683. this.bandwidth = settings.bandwidth;
  74684. this.throughput = {
  74685. rate: 0,
  74686. count: 0
  74687. };
  74688. this.roundTrip = NaN;
  74689. this.resetStats_();
  74690. this.mediaIndex = null;
  74691. this.partIndex = null;
  74692. this.hasPlayed_ = settings.hasPlayed;
  74693. this.currentTime_ = settings.currentTime;
  74694. this.seekable_ = settings.seekable;
  74695. this.seeking_ = settings.seeking;
  74696. this.duration_ = settings.duration;
  74697. this.mediaSource_ = settings.mediaSource;
  74698. this.vhs_ = settings.vhs;
  74699. this.loaderType_ = settings.loaderType;
  74700. this.currentMediaInfo_ = void 0;
  74701. this.startingMediaInfo_ = void 0;
  74702. this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  74703. this.goalBufferLength_ = settings.goalBufferLength;
  74704. this.sourceType_ = settings.sourceType;
  74705. this.sourceUpdater_ = settings.sourceUpdater;
  74706. this.inbandTextTracks_ = settings.inbandTextTracks;
  74707. this.state_ = "INIT";
  74708. this.timelineChangeController_ = settings.timelineChangeController;
  74709. this.shouldSaveSegmentTimingInfo_ = true;
  74710. this.parse708captions_ = settings.parse708captions;
  74711. this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  74712. this.captionServices_ = settings.captionServices;
  74713. this.exactManifestTimings = settings.exactManifestTimings;
  74714. this.checkBufferTimeout_ = null;
  74715. this.error_ = void 0;
  74716. this.currentTimeline_ = -1;
  74717. this.pendingSegment_ = null;
  74718. this.xhrOptions_ = null;
  74719. this.pendingSegments_ = [];
  74720. this.audioDisabled_ = false;
  74721. this.isPendingTimestampOffset_ = false;
  74722. this.gopBuffer_ = [];
  74723. this.timeMapping_ = 0;
  74724. this.safeAppend_ = videojs$2.browser.IE_VERSION >= 11;
  74725. this.appendInitSegment_ = {
  74726. audio: true,
  74727. video: true
  74728. };
  74729. this.playlistOfLastInitSegment_ = {
  74730. audio: null,
  74731. video: null
  74732. };
  74733. this.callQueue_ = [];
  74734. this.loadQueue_ = [];
  74735. this.metadataQueue_ = {
  74736. id3: [],
  74737. caption: []
  74738. };
  74739. this.waitingOnRemove_ = false;
  74740. this.quotaExceededErrorRetryTimeout_ = null;
  74741. this.activeInitSegmentId_ = null;
  74742. this.initSegments_ = {};
  74743. this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  74744. this.keyCache_ = {};
  74745. this.decrypter_ = settings.decrypter;
  74746. this.syncController_ = settings.syncController;
  74747. this.syncPoint_ = {
  74748. segmentIndex: 0,
  74749. time: 0
  74750. };
  74751. this.transmuxer_ = this.createTransmuxer_();
  74752. this.triggerSyncInfoUpdate_ = () => this.trigger("syncinfoupdate");
  74753. this.syncController_.on("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74754. this.mediaSource_.addEventListener("sourceopen", () => {
  74755. if (!this.isEndOfStream_()) {
  74756. this.ended_ = false;
  74757. }
  74758. });
  74759. this.fetchAtBuffer_ = false;
  74760. this.logger_ = logger$1(`SegmentLoader[${this.loaderType_}]`);
  74761. Object.defineProperty(this, "state", {
  74762. get() {
  74763. return this.state_;
  74764. },
  74765. set(newState) {
  74766. if (newState !== this.state_) {
  74767. this.logger_(`${this.state_} -> ${newState}`);
  74768. this.state_ = newState;
  74769. this.trigger("statechange");
  74770. }
  74771. }
  74772. });
  74773. this.sourceUpdater_.on("ready", () => {
  74774. if (this.hasEnoughInfoToAppend_()) {
  74775. this.processCallQueue_();
  74776. }
  74777. });
  74778. if (this.loaderType_ === "main") {
  74779. this.timelineChangeController_.on("pendingtimelinechange", () => {
  74780. if (this.hasEnoughInfoToAppend_()) {
  74781. this.processCallQueue_();
  74782. }
  74783. });
  74784. }
  74785. if (this.loaderType_ === "audio") {
  74786. this.timelineChangeController_.on("timelinechange", () => {
  74787. if (this.hasEnoughInfoToLoad_()) {
  74788. this.processLoadQueue_();
  74789. }
  74790. if (this.hasEnoughInfoToAppend_()) {
  74791. this.processCallQueue_();
  74792. }
  74793. });
  74794. }
  74795. }
  74796. createTransmuxer_() {
  74797. return segmentTransmuxer$1.createTransmuxer({
  74798. remux: false,
  74799. alignGopsAtEnd: this.safeAppend_,
  74800. keepOriginalTimestamps: true,
  74801. parse708captions: this.parse708captions_,
  74802. captionServices: this.captionServices_
  74803. });
  74804. }
  74805. resetStats_() {
  74806. this.mediaBytesTransferred = 0;
  74807. this.mediaRequests = 0;
  74808. this.mediaRequestsAborted = 0;
  74809. this.mediaRequestsTimedout = 0;
  74810. this.mediaRequestsErrored = 0;
  74811. this.mediaTransferDuration = 0;
  74812. this.mediaSecondsLoaded = 0;
  74813. this.mediaAppends = 0;
  74814. }
  74815. dispose() {
  74816. this.trigger("dispose");
  74817. this.state = "DISPOSED";
  74818. this.pause();
  74819. this.abort_();
  74820. if (this.transmuxer_) {
  74821. this.transmuxer_.terminate();
  74822. }
  74823. this.resetStats_();
  74824. if (this.checkBufferTimeout_) {
  74825. window_1.clearTimeout(this.checkBufferTimeout_);
  74826. }
  74827. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  74828. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74829. }
  74830. this.off();
  74831. }
  74832. setAudio(enable) {
  74833. this.audioDisabled_ = !enable;
  74834. if (enable) {
  74835. this.appendInitSegment_.audio = true;
  74836. } else {
  74837. this.sourceUpdater_.removeAudio(0, this.duration_());
  74838. }
  74839. }
  74840. abort() {
  74841. if (this.state !== "WAITING") {
  74842. if (this.pendingSegment_) {
  74843. this.pendingSegment_ = null;
  74844. }
  74845. return;
  74846. }
  74847. this.abort_();
  74848. this.state = "READY";
  74849. if (!this.paused()) {
  74850. this.monitorBuffer_();
  74851. }
  74852. }
  74853. abort_() {
  74854. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  74855. this.pendingSegment_.abortRequests();
  74856. }
  74857. this.pendingSegment_ = null;
  74858. this.callQueue_ = [];
  74859. this.loadQueue_ = [];
  74860. this.metadataQueue_.id3 = [];
  74861. this.metadataQueue_.caption = [];
  74862. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  74863. this.waitingOnRemove_ = false;
  74864. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  74865. this.quotaExceededErrorRetryTimeout_ = null;
  74866. }
  74867. checkForAbort_(requestId) {
  74868. if (this.state === "APPENDING" && !this.pendingSegment_) {
  74869. this.state = "READY";
  74870. return true;
  74871. }
  74872. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  74873. return true;
  74874. }
  74875. return false;
  74876. }
  74877. error(error) {
  74878. if (typeof error !== "undefined") {
  74879. this.logger_("error occurred:", error);
  74880. this.error_ = error;
  74881. }
  74882. this.pendingSegment_ = null;
  74883. return this.error_;
  74884. }
  74885. endOfStream() {
  74886. this.ended_ = true;
  74887. if (this.transmuxer_) {
  74888. segmentTransmuxer$1.reset(this.transmuxer_);
  74889. }
  74890. this.gopBuffer_.length = 0;
  74891. this.pause();
  74892. this.trigger("ended");
  74893. }
  74894. buffered_() {
  74895. const trackInfo = this.getMediaInfo_();
  74896. if (!this.sourceUpdater_ || !trackInfo) {
  74897. return createTimeRanges$2();
  74898. }
  74899. if (this.loaderType_ === "main") {
  74900. const {
  74901. hasAudio,
  74902. hasVideo,
  74903. isMuxed: isMuxed3
  74904. } = trackInfo;
  74905. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  74906. return this.sourceUpdater_.buffered();
  74907. }
  74908. if (hasVideo) {
  74909. return this.sourceUpdater_.videoBuffered();
  74910. }
  74911. }
  74912. return this.sourceUpdater_.audioBuffered();
  74913. }
  74914. initSegmentForMap(map, set4 = false) {
  74915. if (!map) {
  74916. return null;
  74917. }
  74918. const id = initSegmentId$1(map);
  74919. let storedMap = this.initSegments_[id];
  74920. if (set4 && !storedMap && map.bytes) {
  74921. this.initSegments_[id] = storedMap = {
  74922. resolvedUri: map.resolvedUri,
  74923. byterange: map.byterange,
  74924. bytes: map.bytes,
  74925. tracks: map.tracks,
  74926. timescales: map.timescales
  74927. };
  74928. }
  74929. return storedMap || map;
  74930. }
  74931. segmentKey(key, set4 = false) {
  74932. if (!key) {
  74933. return null;
  74934. }
  74935. const id = segmentKeyId$1(key);
  74936. let storedKey = this.keyCache_[id];
  74937. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  74938. this.keyCache_[id] = storedKey = {
  74939. resolvedUri: key.resolvedUri,
  74940. bytes: key.bytes
  74941. };
  74942. }
  74943. const result = {
  74944. resolvedUri: (storedKey || key).resolvedUri
  74945. };
  74946. if (storedKey) {
  74947. result.bytes = storedKey.bytes;
  74948. }
  74949. return result;
  74950. }
  74951. couldBeginLoading_() {
  74952. return this.playlist_ && !this.paused();
  74953. }
  74954. load() {
  74955. this.monitorBuffer_();
  74956. if (!this.playlist_) {
  74957. return;
  74958. }
  74959. if (this.state === "INIT" && this.couldBeginLoading_()) {
  74960. return this.init_();
  74961. }
  74962. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  74963. return;
  74964. }
  74965. this.state = "READY";
  74966. }
  74967. init_() {
  74968. this.state = "READY";
  74969. this.resetEverything();
  74970. return this.monitorBuffer_();
  74971. }
  74972. playlist(newPlaylist, options2 = {}) {
  74973. if (!newPlaylist) {
  74974. return;
  74975. }
  74976. const oldPlaylist = this.playlist_;
  74977. const segmentInfo = this.pendingSegment_;
  74978. this.playlist_ = newPlaylist;
  74979. this.xhrOptions_ = options2;
  74980. if (this.state === "INIT") {
  74981. newPlaylist.syncInfo = {
  74982. mediaSequence: newPlaylist.mediaSequence,
  74983. time: 0
  74984. };
  74985. if (this.loaderType_ === "main") {
  74986. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  74987. }
  74988. }
  74989. let oldId = null;
  74990. if (oldPlaylist) {
  74991. if (oldPlaylist.id) {
  74992. oldId = oldPlaylist.id;
  74993. } else if (oldPlaylist.uri) {
  74994. oldId = oldPlaylist.uri;
  74995. }
  74996. }
  74997. this.logger_(`playlist update [${oldId} => ${newPlaylist.id || newPlaylist.uri}]`);
  74998. this.trigger("syncinfoupdate");
  74999. if (this.state === "INIT" && this.couldBeginLoading_()) {
  75000. return this.init_();
  75001. }
  75002. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  75003. if (this.mediaIndex !== null) {
  75004. if (!newPlaylist.endList) {
  75005. this.resetLoader();
  75006. } else {
  75007. this.resyncLoader();
  75008. }
  75009. }
  75010. this.currentMediaInfo_ = void 0;
  75011. this.trigger("playlistupdate");
  75012. return;
  75013. }
  75014. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  75015. this.logger_(`live window shift [${mediaSequenceDiff}]`);
  75016. if (this.mediaIndex !== null) {
  75017. this.mediaIndex -= mediaSequenceDiff;
  75018. if (this.mediaIndex < 0) {
  75019. this.mediaIndex = null;
  75020. this.partIndex = null;
  75021. } else {
  75022. const segment = this.playlist_.segments[this.mediaIndex];
  75023. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  75024. const mediaIndex = this.mediaIndex;
  75025. this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);
  75026. this.resetLoader();
  75027. this.mediaIndex = mediaIndex;
  75028. }
  75029. }
  75030. }
  75031. if (segmentInfo) {
  75032. segmentInfo.mediaIndex -= mediaSequenceDiff;
  75033. if (segmentInfo.mediaIndex < 0) {
  75034. segmentInfo.mediaIndex = null;
  75035. segmentInfo.partIndex = null;
  75036. } else {
  75037. if (segmentInfo.mediaIndex >= 0) {
  75038. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  75039. }
  75040. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  75041. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  75042. }
  75043. }
  75044. }
  75045. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  75046. }
  75047. pause() {
  75048. if (this.checkBufferTimeout_) {
  75049. window_1.clearTimeout(this.checkBufferTimeout_);
  75050. this.checkBufferTimeout_ = null;
  75051. }
  75052. }
  75053. paused() {
  75054. return this.checkBufferTimeout_ === null;
  75055. }
  75056. resetEverything(done) {
  75057. this.ended_ = false;
  75058. this.activeInitSegmentId_ = null;
  75059. this.appendInitSegment_ = {
  75060. audio: true,
  75061. video: true
  75062. };
  75063. this.resetLoader();
  75064. this.remove(0, Infinity, done);
  75065. if (this.transmuxer_) {
  75066. this.transmuxer_.postMessage({
  75067. action: "clearAllMp4Captions"
  75068. });
  75069. this.transmuxer_.postMessage({
  75070. action: "reset"
  75071. });
  75072. }
  75073. }
  75074. resetLoader() {
  75075. this.fetchAtBuffer_ = false;
  75076. this.resyncLoader();
  75077. }
  75078. resyncLoader() {
  75079. if (this.transmuxer_) {
  75080. segmentTransmuxer$1.reset(this.transmuxer_);
  75081. }
  75082. this.mediaIndex = null;
  75083. this.partIndex = null;
  75084. this.syncPoint_ = null;
  75085. this.isPendingTimestampOffset_ = false;
  75086. this.callQueue_ = [];
  75087. this.loadQueue_ = [];
  75088. this.metadataQueue_.id3 = [];
  75089. this.metadataQueue_.caption = [];
  75090. this.abort();
  75091. if (this.transmuxer_) {
  75092. this.transmuxer_.postMessage({
  75093. action: "clearParsedMp4Captions"
  75094. });
  75095. }
  75096. }
  75097. remove(start2, end, done = () => {
  75098. }, force = false) {
  75099. if (end === Infinity) {
  75100. end = this.duration_();
  75101. }
  75102. if (end <= start2) {
  75103. this.logger_("skipping remove because end ${end} is <= start ${start}");
  75104. return;
  75105. }
  75106. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  75107. this.logger_("skipping remove because no source updater or starting media info");
  75108. return;
  75109. }
  75110. let removesRemaining = 1;
  75111. const removeFinished = () => {
  75112. removesRemaining--;
  75113. if (removesRemaining === 0) {
  75114. done();
  75115. }
  75116. };
  75117. if (force || !this.audioDisabled_) {
  75118. removesRemaining++;
  75119. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  75120. }
  75121. if (force || this.loaderType_ === "main") {
  75122. this.gopBuffer_ = removeGopBuffer$1(this.gopBuffer_, start2, end, this.timeMapping_);
  75123. removesRemaining++;
  75124. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  75125. }
  75126. for (const track in this.inbandTextTracks_) {
  75127. removeCuesFromTrack$1(start2, end, this.inbandTextTracks_[track]);
  75128. }
  75129. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  75130. removeFinished();
  75131. }
  75132. monitorBuffer_() {
  75133. if (this.checkBufferTimeout_) {
  75134. window_1.clearTimeout(this.checkBufferTimeout_);
  75135. }
  75136. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  75137. }
  75138. monitorBufferTick_() {
  75139. if (this.state === "READY") {
  75140. this.fillBuffer_();
  75141. }
  75142. if (this.checkBufferTimeout_) {
  75143. window_1.clearTimeout(this.checkBufferTimeout_);
  75144. }
  75145. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY$1);
  75146. }
  75147. fillBuffer_() {
  75148. if (this.sourceUpdater_.updating()) {
  75149. return;
  75150. }
  75151. const segmentInfo = this.chooseNextRequest_();
  75152. if (!segmentInfo) {
  75153. return;
  75154. }
  75155. if (typeof segmentInfo.timestampOffset === "number") {
  75156. this.isPendingTimestampOffset_ = false;
  75157. this.timelineChangeController_.pendingTimelineChange({
  75158. type: this.loaderType_,
  75159. from: this.currentTimeline_,
  75160. to: segmentInfo.timeline
  75161. });
  75162. }
  75163. this.loadSegment_(segmentInfo);
  75164. }
  75165. isEndOfStream_(mediaIndex = this.mediaIndex, playlist = this.playlist_, partIndex = this.partIndex) {
  75166. if (!playlist || !this.mediaSource_) {
  75167. return false;
  75168. }
  75169. const segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  75170. const appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  75171. const appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  75172. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  75173. }
  75174. chooseNextRequest_() {
  75175. const buffered = this.buffered_();
  75176. const bufferedEnd = lastBufferedEnd$1(buffered) || 0;
  75177. const bufferedTime = timeAheadOf$1(buffered, this.currentTime_());
  75178. const preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  75179. const haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  75180. const segments = this.playlist_.segments;
  75181. if (!segments.length || preloaded || haveEnoughBuffer) {
  75182. return null;
  75183. }
  75184. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  75185. const next = {
  75186. partIndex: null,
  75187. mediaIndex: null,
  75188. startOfSegment: null,
  75189. playlist: this.playlist_,
  75190. isSyncRequest: Boolean(!this.syncPoint_)
  75191. };
  75192. if (next.isSyncRequest) {
  75193. next.mediaIndex = getSyncSegmentCandidate$1(this.currentTimeline_, segments, bufferedEnd);
  75194. } else if (this.mediaIndex !== null) {
  75195. const segment = segments[this.mediaIndex];
  75196. const partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  75197. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  75198. if (segment.parts && segment.parts[partIndex + 1]) {
  75199. next.mediaIndex = this.mediaIndex;
  75200. next.partIndex = partIndex + 1;
  75201. } else {
  75202. next.mediaIndex = this.mediaIndex + 1;
  75203. }
  75204. } else {
  75205. const {
  75206. segmentIndex,
  75207. startTime,
  75208. partIndex
  75209. } = Playlist$1.getMediaInfoForTime({
  75210. exactManifestTimings: this.exactManifestTimings,
  75211. playlist: this.playlist_,
  75212. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  75213. startingPartIndex: this.syncPoint_.partIndex,
  75214. startingSegmentIndex: this.syncPoint_.segmentIndex,
  75215. startTime: this.syncPoint_.time
  75216. });
  75217. next.getMediaInfoForTime = this.fetchAtBuffer_ ? `bufferedEnd ${bufferedEnd}` : `currentTime ${this.currentTime_()}`;
  75218. next.mediaIndex = segmentIndex;
  75219. next.startOfSegment = startTime;
  75220. next.partIndex = partIndex;
  75221. }
  75222. const nextSegment = segments[next.mediaIndex];
  75223. let nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  75224. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  75225. return null;
  75226. }
  75227. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  75228. next.partIndex = 0;
  75229. nextPart = nextSegment.parts[0];
  75230. }
  75231. if (!bufferedTime && nextPart && !nextPart.independent) {
  75232. if (next.partIndex === 0) {
  75233. const lastSegment = segments[next.mediaIndex - 1];
  75234. const lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  75235. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  75236. next.mediaIndex -= 1;
  75237. next.partIndex = lastSegment.parts.length - 1;
  75238. next.independent = "previous segment";
  75239. }
  75240. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  75241. next.partIndex -= 1;
  75242. next.independent = "previous part";
  75243. }
  75244. }
  75245. const ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  75246. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  75247. return null;
  75248. }
  75249. return this.generateSegmentInfo_(next);
  75250. }
  75251. generateSegmentInfo_(options2) {
  75252. const {
  75253. independent,
  75254. playlist,
  75255. mediaIndex,
  75256. startOfSegment,
  75257. isSyncRequest,
  75258. partIndex,
  75259. forceTimestampOffset,
  75260. getMediaInfoForTime: getMediaInfoForTime3
  75261. } = options2;
  75262. const segment = playlist.segments[mediaIndex];
  75263. const part = typeof partIndex === "number" && segment.parts[partIndex];
  75264. const segmentInfo = {
  75265. requestId: "segment-loader-" + Math.random(),
  75266. uri: part && part.resolvedUri || segment.resolvedUri,
  75267. mediaIndex,
  75268. partIndex: part ? partIndex : null,
  75269. isSyncRequest,
  75270. startOfSegment,
  75271. playlist,
  75272. bytes: null,
  75273. encryptedBytes: null,
  75274. timestampOffset: null,
  75275. timeline: segment.timeline,
  75276. duration: part && part.duration || segment.duration,
  75277. segment,
  75278. part,
  75279. byteLength: 0,
  75280. transmuxer: this.transmuxer_,
  75281. getMediaInfoForTime: getMediaInfoForTime3,
  75282. independent
  75283. };
  75284. const overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  75285. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  75286. segmentTimeline: segment.timeline,
  75287. currentTimeline: this.currentTimeline_,
  75288. startOfSegment,
  75289. buffered: this.buffered_(),
  75290. overrideCheck
  75291. });
  75292. const audioBufferedEnd = lastBufferedEnd$1(this.sourceUpdater_.audioBuffered());
  75293. if (typeof audioBufferedEnd === "number") {
  75294. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  75295. }
  75296. if (this.sourceUpdater_.videoBuffered().length) {
  75297. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith$1(
  75298. this.gopBuffer_,
  75299. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  75300. this.timeMapping_
  75301. );
  75302. }
  75303. return segmentInfo;
  75304. }
  75305. timestampOffsetForSegment_(options2) {
  75306. return timestampOffsetForSegment$1(options2);
  75307. }
  75308. earlyAbortWhenNeeded_(stats) {
  75309. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  75310. return;
  75311. }
  75312. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  75313. return;
  75314. }
  75315. const currentTime = this.currentTime_();
  75316. const measuredBandwidth = stats.bandwidth;
  75317. const segmentDuration = this.pendingSegment_.duration;
  75318. const requestTimeRemaining = Playlist$1.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  75319. const timeUntilRebuffer$1$1 = timeUntilRebuffer$1(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  75320. if (requestTimeRemaining <= timeUntilRebuffer$1$1) {
  75321. return;
  75322. }
  75323. const switchCandidate = minRebufferMaxBandwidthSelector$1({
  75324. main: this.vhs_.playlists.main,
  75325. currentTime,
  75326. bandwidth: measuredBandwidth,
  75327. duration: this.duration_(),
  75328. segmentDuration,
  75329. timeUntilRebuffer: timeUntilRebuffer$1$1,
  75330. currentTimeline: this.currentTimeline_,
  75331. syncController: this.syncController_
  75332. });
  75333. if (!switchCandidate) {
  75334. return;
  75335. }
  75336. const rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1$1;
  75337. const timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  75338. let minimumTimeSaving = 0.5;
  75339. if (timeUntilRebuffer$1$1 <= TIME_FUDGE_FACTOR$1) {
  75340. minimumTimeSaving = 1;
  75341. }
  75342. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  75343. return;
  75344. }
  75345. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config$1.BANDWIDTH_VARIANCE + 1;
  75346. this.trigger("earlyabort");
  75347. }
  75348. handleAbort_(segmentInfo) {
  75349. this.logger_(`Aborting ${segmentInfoString$1(segmentInfo)}`);
  75350. this.mediaRequestsAborted += 1;
  75351. }
  75352. handleProgress_(event2, simpleSegment) {
  75353. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75354. if (this.checkForAbort_(simpleSegment.requestId)) {
  75355. return;
  75356. }
  75357. this.trigger("progress");
  75358. }
  75359. handleTrackInfo_(simpleSegment, trackInfo) {
  75360. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75361. if (this.checkForAbort_(simpleSegment.requestId)) {
  75362. return;
  75363. }
  75364. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  75365. return;
  75366. }
  75367. trackInfo = trackInfo || {};
  75368. if (!shallowEqual$1(this.currentMediaInfo_, trackInfo)) {
  75369. this.appendInitSegment_ = {
  75370. audio: true,
  75371. video: true
  75372. };
  75373. this.startingMediaInfo_ = trackInfo;
  75374. this.currentMediaInfo_ = trackInfo;
  75375. this.logger_("trackinfo update", trackInfo);
  75376. this.trigger("trackinfo");
  75377. }
  75378. if (this.checkForAbort_(simpleSegment.requestId)) {
  75379. return;
  75380. }
  75381. this.pendingSegment_.trackInfo = trackInfo;
  75382. if (this.hasEnoughInfoToAppend_()) {
  75383. this.processCallQueue_();
  75384. }
  75385. }
  75386. handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  75387. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75388. if (this.checkForAbort_(simpleSegment.requestId)) {
  75389. return;
  75390. }
  75391. const segmentInfo = this.pendingSegment_;
  75392. const timingInfoProperty = timingInfoPropertyForMedia$1(mediaType);
  75393. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  75394. segmentInfo[timingInfoProperty][timeType] = time;
  75395. this.logger_(`timinginfo: ${mediaType} - ${timeType} - ${time}`);
  75396. if (this.hasEnoughInfoToAppend_()) {
  75397. this.processCallQueue_();
  75398. }
  75399. }
  75400. handleCaptions_(simpleSegment, captionData) {
  75401. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75402. if (this.checkForAbort_(simpleSegment.requestId)) {
  75403. return;
  75404. }
  75405. if (captionData.length === 0) {
  75406. this.logger_("SegmentLoader received no captions from a caption event");
  75407. return;
  75408. }
  75409. const segmentInfo = this.pendingSegment_;
  75410. if (!segmentInfo.hasAppendedData_) {
  75411. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  75412. return;
  75413. }
  75414. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75415. const captionTracks = {};
  75416. captionData.forEach((caption) => {
  75417. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  75418. startTime: Infinity,
  75419. captions: [],
  75420. endTime: 0
  75421. };
  75422. const captionTrack = captionTracks[caption.stream];
  75423. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  75424. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  75425. captionTrack.captions.push(caption);
  75426. });
  75427. Object.keys(captionTracks).forEach((trackName) => {
  75428. const {
  75429. startTime,
  75430. endTime,
  75431. captions
  75432. } = captionTracks[trackName];
  75433. const inbandTextTracks = this.inbandTextTracks_;
  75434. this.logger_(`adding cues from ${startTime} -> ${endTime} for ${trackName}`);
  75435. createCaptionsTrackIfNotExists$1(inbandTextTracks, this.vhs_.tech_, trackName);
  75436. removeCuesFromTrack$1(startTime, endTime, inbandTextTracks[trackName]);
  75437. addCaptionData$1({
  75438. captionArray: captions,
  75439. inbandTextTracks,
  75440. timestampOffset: timestampOffset2
  75441. });
  75442. });
  75443. if (this.transmuxer_) {
  75444. this.transmuxer_.postMessage({
  75445. action: "clearParsedMp4Captions"
  75446. });
  75447. }
  75448. }
  75449. handleId3_(simpleSegment, id3Frames, dispatchType) {
  75450. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75451. if (this.checkForAbort_(simpleSegment.requestId)) {
  75452. return;
  75453. }
  75454. const segmentInfo = this.pendingSegment_;
  75455. if (!segmentInfo.hasAppendedData_) {
  75456. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  75457. return;
  75458. }
  75459. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75460. createMetadataTrackIfNotExists$1(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  75461. addMetadata$1({
  75462. inbandTextTracks: this.inbandTextTracks_,
  75463. metadataArray: id3Frames,
  75464. timestampOffset: timestampOffset2,
  75465. videoDuration: this.duration_()
  75466. });
  75467. }
  75468. processMetadataQueue_() {
  75469. this.metadataQueue_.id3.forEach((fn2) => fn2());
  75470. this.metadataQueue_.caption.forEach((fn2) => fn2());
  75471. this.metadataQueue_.id3 = [];
  75472. this.metadataQueue_.caption = [];
  75473. }
  75474. processCallQueue_() {
  75475. const callQueue = this.callQueue_;
  75476. this.callQueue_ = [];
  75477. callQueue.forEach((fun) => fun());
  75478. }
  75479. processLoadQueue_() {
  75480. const loadQueue = this.loadQueue_;
  75481. this.loadQueue_ = [];
  75482. loadQueue.forEach((fun) => fun());
  75483. }
  75484. hasEnoughInfoToLoad_() {
  75485. if (this.loaderType_ !== "audio") {
  75486. return true;
  75487. }
  75488. const segmentInfo = this.pendingSegment_;
  75489. if (!segmentInfo) {
  75490. return false;
  75491. }
  75492. if (!this.getCurrentMediaInfo_()) {
  75493. return true;
  75494. }
  75495. if (shouldWaitForTimelineChange$1({
  75496. timelineChangeController: this.timelineChangeController_,
  75497. currentTimeline: this.currentTimeline_,
  75498. segmentTimeline: segmentInfo.timeline,
  75499. loaderType: this.loaderType_,
  75500. audioDisabled: this.audioDisabled_
  75501. })) {
  75502. return false;
  75503. }
  75504. return true;
  75505. }
  75506. getCurrentMediaInfo_(segmentInfo = this.pendingSegment_) {
  75507. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  75508. }
  75509. getMediaInfo_(segmentInfo = this.pendingSegment_) {
  75510. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  75511. }
  75512. getPendingSegmentPlaylist() {
  75513. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  75514. }
  75515. hasEnoughInfoToAppend_() {
  75516. if (!this.sourceUpdater_.ready()) {
  75517. return false;
  75518. }
  75519. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  75520. return false;
  75521. }
  75522. const segmentInfo = this.pendingSegment_;
  75523. const trackInfo = this.getCurrentMediaInfo_();
  75524. if (!segmentInfo || !trackInfo) {
  75525. return false;
  75526. }
  75527. const {
  75528. hasAudio,
  75529. hasVideo,
  75530. isMuxed: isMuxed3
  75531. } = trackInfo;
  75532. if (hasVideo && !segmentInfo.videoTimingInfo) {
  75533. return false;
  75534. }
  75535. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  75536. return false;
  75537. }
  75538. if (shouldWaitForTimelineChange$1({
  75539. timelineChangeController: this.timelineChangeController_,
  75540. currentTimeline: this.currentTimeline_,
  75541. segmentTimeline: segmentInfo.timeline,
  75542. loaderType: this.loaderType_,
  75543. audioDisabled: this.audioDisabled_
  75544. })) {
  75545. return false;
  75546. }
  75547. return true;
  75548. }
  75549. handleData_(simpleSegment, result) {
  75550. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75551. if (this.checkForAbort_(simpleSegment.requestId)) {
  75552. return;
  75553. }
  75554. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  75555. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  75556. return;
  75557. }
  75558. const segmentInfo = this.pendingSegment_;
  75559. this.setTimeMapping_(segmentInfo.timeline);
  75560. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  75561. if (this.mediaSource_.readyState === "closed") {
  75562. return;
  75563. }
  75564. if (simpleSegment.map) {
  75565. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  75566. segmentInfo.segment.map = simpleSegment.map;
  75567. }
  75568. if (simpleSegment.key) {
  75569. this.segmentKey(simpleSegment.key, true);
  75570. }
  75571. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  75572. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  75573. if (segmentInfo.isFmp4) {
  75574. this.trigger("fmp4");
  75575. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia$1(result.type)].start;
  75576. } else {
  75577. const trackInfo = this.getCurrentMediaInfo_();
  75578. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  75579. let firstVideoFrameTimeForData;
  75580. if (useVideoTimingInfo) {
  75581. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  75582. }
  75583. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  75584. currentStart: segmentInfo.timingInfo.start,
  75585. playlist: segmentInfo.playlist,
  75586. mediaIndex: segmentInfo.mediaIndex,
  75587. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  75588. useVideoTimingInfo,
  75589. firstVideoFrameTimeForData,
  75590. videoTimingInfo: segmentInfo.videoTimingInfo,
  75591. audioTimingInfo: segmentInfo.audioTimingInfo
  75592. });
  75593. }
  75594. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  75595. this.updateSourceBufferTimestampOffset_(segmentInfo);
  75596. if (segmentInfo.isSyncRequest) {
  75597. this.updateTimingInfoEnd_(segmentInfo);
  75598. this.syncController_.saveSegmentTimingInfo({
  75599. segmentInfo,
  75600. shouldSaveTimelineMapping: this.loaderType_ === "main"
  75601. });
  75602. const next = this.chooseNextRequest_();
  75603. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  75604. this.logger_("sync segment was incorrect, not appending");
  75605. return;
  75606. }
  75607. this.logger_("sync segment was correct, appending");
  75608. }
  75609. segmentInfo.hasAppendedData_ = true;
  75610. this.processMetadataQueue_();
  75611. this.appendData_(segmentInfo, result);
  75612. }
  75613. updateAppendInitSegmentStatus(segmentInfo, type2) {
  75614. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  75615. this.appendInitSegment_ = {
  75616. audio: true,
  75617. video: true
  75618. };
  75619. }
  75620. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  75621. this.appendInitSegment_[type2] = true;
  75622. }
  75623. }
  75624. getInitSegmentAndUpdateState_({
  75625. type: type2,
  75626. initSegment,
  75627. map,
  75628. playlist
  75629. }) {
  75630. if (map) {
  75631. const id = initSegmentId$1(map);
  75632. if (this.activeInitSegmentId_ === id) {
  75633. return null;
  75634. }
  75635. initSegment = this.initSegmentForMap(map, true).bytes;
  75636. this.activeInitSegmentId_ = id;
  75637. }
  75638. if (initSegment && this.appendInitSegment_[type2]) {
  75639. this.playlistOfLastInitSegment_[type2] = playlist;
  75640. this.appendInitSegment_[type2] = false;
  75641. this.activeInitSegmentId_ = null;
  75642. return initSegment;
  75643. }
  75644. return null;
  75645. }
  75646. handleQuotaExceededError_({
  75647. segmentInfo,
  75648. type: type2,
  75649. bytes
  75650. }, error) {
  75651. const audioBuffered = this.sourceUpdater_.audioBuffered();
  75652. const videoBuffered = this.sourceUpdater_.videoBuffered();
  75653. if (audioBuffered.length > 1) {
  75654. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray$1(audioBuffered).join(", "));
  75655. }
  75656. if (videoBuffered.length > 1) {
  75657. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray$1(videoBuffered).join(", "));
  75658. }
  75659. const audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  75660. const audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  75661. const videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  75662. const videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  75663. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER$1 && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER$1) {
  75664. this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${bytes.byteLength}, audio buffer: ${timeRangesToArray$1(audioBuffered).join(", ")}, video buffer: ${timeRangesToArray$1(videoBuffered).join(", ")}, `);
  75665. this.error({
  75666. message: "Quota exceeded error with append of a single segment of content",
  75667. excludeUntil: Infinity
  75668. });
  75669. this.trigger("error");
  75670. return;
  75671. }
  75672. this.waitingOnRemove_ = true;
  75673. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  75674. segmentInfo,
  75675. type: type2,
  75676. bytes
  75677. }));
  75678. const currentTime = this.currentTime_();
  75679. const timeToRemoveUntil = currentTime - MIN_BACK_BUFFER$1;
  75680. this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${timeToRemoveUntil}`);
  75681. this.remove(0, timeToRemoveUntil, () => {
  75682. this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${MIN_BACK_BUFFER$1}s`);
  75683. this.waitingOnRemove_ = false;
  75684. this.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(() => {
  75685. this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  75686. this.quotaExceededErrorRetryTimeout_ = null;
  75687. this.processCallQueue_();
  75688. }, MIN_BACK_BUFFER$1 * 1e3);
  75689. }, true);
  75690. }
  75691. handleAppendError_({
  75692. segmentInfo,
  75693. type: type2,
  75694. bytes
  75695. }, error) {
  75696. if (!error) {
  75697. return;
  75698. }
  75699. if (error.code === QUOTA_EXCEEDED_ERR$1) {
  75700. this.handleQuotaExceededError_({
  75701. segmentInfo,
  75702. type: type2,
  75703. bytes
  75704. });
  75705. return;
  75706. }
  75707. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  75708. this.error(`${type2} append of ${bytes.length}b failed for segment #${segmentInfo.mediaIndex} in playlist ${segmentInfo.playlist.id}`);
  75709. this.trigger("appenderror");
  75710. }
  75711. appendToSourceBuffer_({
  75712. segmentInfo,
  75713. type: type2,
  75714. initSegment,
  75715. data,
  75716. bytes
  75717. }) {
  75718. if (!bytes) {
  75719. const segments = [data];
  75720. let byteLength = data.byteLength;
  75721. if (initSegment) {
  75722. segments.unshift(initSegment);
  75723. byteLength += initSegment.byteLength;
  75724. }
  75725. bytes = concatSegments$1({
  75726. bytes: byteLength,
  75727. segments
  75728. });
  75729. }
  75730. this.sourceUpdater_.appendBuffer({
  75731. segmentInfo,
  75732. type: type2,
  75733. bytes
  75734. }, this.handleAppendError_.bind(this, {
  75735. segmentInfo,
  75736. type: type2,
  75737. bytes
  75738. }));
  75739. }
  75740. handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  75741. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  75742. return;
  75743. }
  75744. const segment = this.pendingSegment_.segment;
  75745. const timingInfoProperty = `${type2}TimingInfo`;
  75746. if (!segment[timingInfoProperty]) {
  75747. segment[timingInfoProperty] = {};
  75748. }
  75749. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  75750. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  75751. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  75752. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  75753. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  75754. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  75755. }
  75756. appendData_(segmentInfo, result) {
  75757. const {
  75758. type: type2,
  75759. data
  75760. } = result;
  75761. if (!data || !data.byteLength) {
  75762. return;
  75763. }
  75764. if (type2 === "audio" && this.audioDisabled_) {
  75765. return;
  75766. }
  75767. const initSegment = this.getInitSegmentAndUpdateState_({
  75768. type: type2,
  75769. initSegment: result.initSegment,
  75770. playlist: segmentInfo.playlist,
  75771. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  75772. });
  75773. this.appendToSourceBuffer_({
  75774. segmentInfo,
  75775. type: type2,
  75776. initSegment,
  75777. data
  75778. });
  75779. }
  75780. loadSegment_(segmentInfo) {
  75781. this.state = "WAITING";
  75782. this.pendingSegment_ = segmentInfo;
  75783. this.trimBackBuffer_(segmentInfo);
  75784. if (typeof segmentInfo.timestampOffset === "number") {
  75785. if (this.transmuxer_) {
  75786. this.transmuxer_.postMessage({
  75787. action: "clearAllMp4Captions"
  75788. });
  75789. }
  75790. }
  75791. if (!this.hasEnoughInfoToLoad_()) {
  75792. this.loadQueue_.push(() => {
  75793. const options2 = _extends$2({}, segmentInfo, {
  75794. forceTimestampOffset: true
  75795. });
  75796. _extends$2(segmentInfo, this.generateSegmentInfo_(options2));
  75797. this.isPendingTimestampOffset_ = false;
  75798. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75799. });
  75800. return;
  75801. }
  75802. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75803. }
  75804. updateTransmuxerAndRequestSegment_(segmentInfo) {
  75805. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  75806. this.gopBuffer_.length = 0;
  75807. segmentInfo.gopsToAlignWith = [];
  75808. this.timeMapping_ = 0;
  75809. this.transmuxer_.postMessage({
  75810. action: "reset"
  75811. });
  75812. this.transmuxer_.postMessage({
  75813. action: "setTimestampOffset",
  75814. timestampOffset: segmentInfo.timestampOffset
  75815. });
  75816. }
  75817. const simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  75818. const isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  75819. const isWalkingForward = this.mediaIndex !== null;
  75820. const isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  75821. const isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  75822. this.logger_(`Requesting ${segmentInfoString$1(segmentInfo)}`);
  75823. if (simpleSegment.map && !simpleSegment.map.bytes) {
  75824. this.logger_("going to request init segment.");
  75825. this.appendInitSegment_ = {
  75826. video: true,
  75827. audio: true
  75828. };
  75829. }
  75830. segmentInfo.abortRequests = mediaSegmentRequest$1({
  75831. xhr: this.vhs_.xhr,
  75832. xhrOptions: this.xhrOptions_,
  75833. decryptionWorker: this.decrypter_,
  75834. segment: simpleSegment,
  75835. abortFn: this.handleAbort_.bind(this, segmentInfo),
  75836. progressFn: this.handleProgress_.bind(this),
  75837. trackInfoFn: this.handleTrackInfo_.bind(this),
  75838. timingInfoFn: this.handleTimingInfo_.bind(this),
  75839. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  75840. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  75841. captionsFn: this.handleCaptions_.bind(this),
  75842. isEndOfTimeline,
  75843. endedTimelineFn: () => {
  75844. this.logger_("received endedtimeline callback");
  75845. },
  75846. id3Fn: this.handleId3_.bind(this),
  75847. dataFn: this.handleData_.bind(this),
  75848. doneFn: this.segmentRequestFinished_.bind(this),
  75849. onTransmuxerLog: ({
  75850. message,
  75851. level,
  75852. stream
  75853. }) => {
  75854. this.logger_(`${segmentInfoString$1(segmentInfo)} logged from transmuxer stream ${stream} as a ${level}: ${message}`);
  75855. }
  75856. });
  75857. }
  75858. trimBackBuffer_(segmentInfo) {
  75859. const removeToTime = safeBackBufferTrimTime$1(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  75860. if (removeToTime > 0) {
  75861. this.remove(0, removeToTime);
  75862. }
  75863. }
  75864. createSimplifiedSegmentObj_(segmentInfo) {
  75865. const segment = segmentInfo.segment;
  75866. const part = segmentInfo.part;
  75867. const simpleSegment = {
  75868. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  75869. byterange: part ? part.byterange : segment.byterange,
  75870. requestId: segmentInfo.requestId,
  75871. transmuxer: segmentInfo.transmuxer,
  75872. audioAppendStart: segmentInfo.audioAppendStart,
  75873. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  75874. part: segmentInfo.part
  75875. };
  75876. const previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  75877. if (previousSegment && previousSegment.timeline === segment.timeline) {
  75878. if (previousSegment.videoTimingInfo) {
  75879. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  75880. } else if (previousSegment.audioTimingInfo) {
  75881. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  75882. }
  75883. }
  75884. if (segment.key) {
  75885. const iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  75886. simpleSegment.key = this.segmentKey(segment.key);
  75887. simpleSegment.key.iv = iv;
  75888. }
  75889. if (segment.map) {
  75890. simpleSegment.map = this.initSegmentForMap(segment.map);
  75891. }
  75892. return simpleSegment;
  75893. }
  75894. saveTransferStats_(stats) {
  75895. this.mediaRequests += 1;
  75896. if (stats) {
  75897. this.mediaBytesTransferred += stats.bytesReceived;
  75898. this.mediaTransferDuration += stats.roundTripTime;
  75899. }
  75900. }
  75901. saveBandwidthRelatedStats_(duration5, stats) {
  75902. this.pendingSegment_.byteLength = stats.bytesReceived;
  75903. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  75904. this.logger_(`Ignoring segment's bandwidth because its duration of ${duration5} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  75905. return;
  75906. }
  75907. this.bandwidth = stats.bandwidth;
  75908. this.roundTrip = stats.roundTripTime;
  75909. }
  75910. handleTimeout_() {
  75911. this.mediaRequestsTimedout += 1;
  75912. this.bandwidth = 1;
  75913. this.roundTrip = NaN;
  75914. this.trigger("bandwidthupdate");
  75915. this.trigger("timeout");
  75916. }
  75917. segmentRequestFinished_(error, simpleSegment, result) {
  75918. if (this.callQueue_.length) {
  75919. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  75920. return;
  75921. }
  75922. this.saveTransferStats_(simpleSegment.stats);
  75923. if (!this.pendingSegment_) {
  75924. return;
  75925. }
  75926. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  75927. return;
  75928. }
  75929. if (error) {
  75930. this.pendingSegment_ = null;
  75931. this.state = "READY";
  75932. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  75933. return;
  75934. }
  75935. this.pause();
  75936. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  75937. this.handleTimeout_();
  75938. return;
  75939. }
  75940. this.mediaRequestsErrored += 1;
  75941. this.error(error);
  75942. this.trigger("error");
  75943. return;
  75944. }
  75945. const segmentInfo = this.pendingSegment_;
  75946. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  75947. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  75948. if (result.gopInfo) {
  75949. this.gopBuffer_ = updateGopBuffer$1(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  75950. }
  75951. this.state = "APPENDING";
  75952. this.trigger("appending");
  75953. this.waitForAppendsToComplete_(segmentInfo);
  75954. }
  75955. setTimeMapping_(timeline) {
  75956. const timelineMapping = this.syncController_.mappingForTimeline(timeline);
  75957. if (timelineMapping !== null) {
  75958. this.timeMapping_ = timelineMapping;
  75959. }
  75960. }
  75961. updateMediaSecondsLoaded_(segment) {
  75962. if (typeof segment.start === "number" && typeof segment.end === "number") {
  75963. this.mediaSecondsLoaded += segment.end - segment.start;
  75964. } else {
  75965. this.mediaSecondsLoaded += segment.duration;
  75966. }
  75967. }
  75968. shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  75969. if (timestampOffset2 === null) {
  75970. return false;
  75971. }
  75972. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  75973. return true;
  75974. }
  75975. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  75976. return true;
  75977. }
  75978. return false;
  75979. }
  75980. trueSegmentStart_({
  75981. currentStart,
  75982. playlist,
  75983. mediaIndex,
  75984. firstVideoFrameTimeForData,
  75985. currentVideoTimestampOffset,
  75986. useVideoTimingInfo,
  75987. videoTimingInfo,
  75988. audioTimingInfo
  75989. }) {
  75990. if (typeof currentStart !== "undefined") {
  75991. return currentStart;
  75992. }
  75993. if (!useVideoTimingInfo) {
  75994. return audioTimingInfo.start;
  75995. }
  75996. const previousSegment = playlist.segments[mediaIndex - 1];
  75997. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  75998. return firstVideoFrameTimeForData;
  75999. }
  76000. return videoTimingInfo.start;
  76001. }
  76002. waitForAppendsToComplete_(segmentInfo) {
  76003. const trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  76004. if (!trackInfo) {
  76005. this.error({
  76006. message: "No starting media returned, likely due to an unsupported media format.",
  76007. playlistExclusionDuration: Infinity
  76008. });
  76009. this.trigger("error");
  76010. return;
  76011. }
  76012. const {
  76013. hasAudio,
  76014. hasVideo,
  76015. isMuxed: isMuxed3
  76016. } = trackInfo;
  76017. const waitForVideo = this.loaderType_ === "main" && hasVideo;
  76018. const waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  76019. segmentInfo.waitingOnAppends = 0;
  76020. if (!segmentInfo.hasAppendedData_) {
  76021. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  76022. this.isPendingTimestampOffset_ = true;
  76023. }
  76024. segmentInfo.timingInfo = {
  76025. start: 0
  76026. };
  76027. segmentInfo.waitingOnAppends++;
  76028. if (!this.isPendingTimestampOffset_) {
  76029. this.updateSourceBufferTimestampOffset_(segmentInfo);
  76030. this.processMetadataQueue_();
  76031. }
  76032. this.checkAppendsDone_(segmentInfo);
  76033. return;
  76034. }
  76035. if (waitForVideo) {
  76036. segmentInfo.waitingOnAppends++;
  76037. }
  76038. if (waitForAudio) {
  76039. segmentInfo.waitingOnAppends++;
  76040. }
  76041. if (waitForVideo) {
  76042. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76043. }
  76044. if (waitForAudio) {
  76045. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76046. }
  76047. }
  76048. checkAppendsDone_(segmentInfo) {
  76049. if (this.checkForAbort_(segmentInfo.requestId)) {
  76050. return;
  76051. }
  76052. segmentInfo.waitingOnAppends--;
  76053. if (segmentInfo.waitingOnAppends === 0) {
  76054. this.handleAppendsDone_();
  76055. }
  76056. }
  76057. checkForIllegalMediaSwitch(trackInfo) {
  76058. const illegalMediaSwitchError = illegalMediaSwitch$1(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  76059. if (illegalMediaSwitchError) {
  76060. this.error({
  76061. message: illegalMediaSwitchError,
  76062. playlistExclusionDuration: Infinity
  76063. });
  76064. this.trigger("error");
  76065. return true;
  76066. }
  76067. return false;
  76068. }
  76069. updateSourceBufferTimestampOffset_(segmentInfo) {
  76070. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  76071. return;
  76072. }
  76073. let didChange = false;
  76074. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  76075. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  76076. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  76077. timingInfo: segmentInfo.timingInfo
  76078. });
  76079. segmentInfo.changedTimestampOffset = true;
  76080. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  76081. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  76082. didChange = true;
  76083. }
  76084. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  76085. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  76086. didChange = true;
  76087. }
  76088. if (didChange) {
  76089. this.trigger("timestampoffset");
  76090. }
  76091. }
  76092. getSegmentStartTimeForTimestampOffsetCalculation_({
  76093. videoTimingInfo,
  76094. audioTimingInfo,
  76095. timingInfo
  76096. }) {
  76097. if (!this.useDtsForTimestampOffset_) {
  76098. return timingInfo.start;
  76099. }
  76100. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  76101. return videoTimingInfo.transmuxedDecodeStart;
  76102. }
  76103. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  76104. return audioTimingInfo.transmuxedDecodeStart;
  76105. }
  76106. return timingInfo.start;
  76107. }
  76108. updateTimingInfoEnd_(segmentInfo) {
  76109. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  76110. const trackInfo = this.getMediaInfo_();
  76111. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  76112. const prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  76113. if (!prioritizedTimingInfo) {
  76114. return;
  76115. }
  76116. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  76117. }
  76118. handleAppendsDone_() {
  76119. if (this.pendingSegment_) {
  76120. this.trigger("appendsdone");
  76121. }
  76122. if (!this.pendingSegment_) {
  76123. this.state = "READY";
  76124. if (!this.paused()) {
  76125. this.monitorBuffer_();
  76126. }
  76127. return;
  76128. }
  76129. const segmentInfo = this.pendingSegment_;
  76130. this.updateTimingInfoEnd_(segmentInfo);
  76131. if (this.shouldSaveSegmentTimingInfo_) {
  76132. this.syncController_.saveSegmentTimingInfo({
  76133. segmentInfo,
  76134. shouldSaveTimelineMapping: this.loaderType_ === "main"
  76135. });
  76136. }
  76137. const segmentDurationMessage = getTroublesomeSegmentDurationMessage$1(segmentInfo, this.sourceType_);
  76138. if (segmentDurationMessage) {
  76139. if (segmentDurationMessage.severity === "warn") {
  76140. videojs$2.log.warn(segmentDurationMessage.message);
  76141. } else {
  76142. this.logger_(segmentDurationMessage.message);
  76143. }
  76144. }
  76145. this.recordThroughput_(segmentInfo);
  76146. this.pendingSegment_ = null;
  76147. this.state = "READY";
  76148. if (segmentInfo.isSyncRequest) {
  76149. this.trigger("syncinfoupdate");
  76150. if (!segmentInfo.hasAppendedData_) {
  76151. this.logger_(`Throwing away un-appended sync request ${segmentInfoString$1(segmentInfo)}`);
  76152. return;
  76153. }
  76154. }
  76155. this.logger_(`Appended ${segmentInfoString$1(segmentInfo)}`);
  76156. this.addSegmentMetadataCue_(segmentInfo);
  76157. this.fetchAtBuffer_ = true;
  76158. if (this.currentTimeline_ !== segmentInfo.timeline) {
  76159. this.timelineChangeController_.lastTimelineChange({
  76160. type: this.loaderType_,
  76161. from: this.currentTimeline_,
  76162. to: segmentInfo.timeline
  76163. });
  76164. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  76165. this.timelineChangeController_.lastTimelineChange({
  76166. type: "audio",
  76167. from: this.currentTimeline_,
  76168. to: segmentInfo.timeline
  76169. });
  76170. }
  76171. }
  76172. this.currentTimeline_ = segmentInfo.timeline;
  76173. this.trigger("syncinfoupdate");
  76174. const segment = segmentInfo.segment;
  76175. const part = segmentInfo.part;
  76176. const badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  76177. const badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  76178. if (badSegmentGuess || badPartGuess) {
  76179. this.logger_(`bad ${badSegmentGuess ? "segment" : "part"} ${segmentInfoString$1(segmentInfo)}`);
  76180. this.resetEverything();
  76181. return;
  76182. }
  76183. const isWalkingForward = this.mediaIndex !== null;
  76184. if (isWalkingForward) {
  76185. this.trigger("bandwidthupdate");
  76186. }
  76187. this.trigger("progress");
  76188. this.mediaIndex = segmentInfo.mediaIndex;
  76189. this.partIndex = segmentInfo.partIndex;
  76190. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  76191. this.endOfStream();
  76192. }
  76193. this.trigger("appended");
  76194. if (segmentInfo.hasAppendedData_) {
  76195. this.mediaAppends++;
  76196. }
  76197. if (!this.paused()) {
  76198. this.monitorBuffer_();
  76199. }
  76200. }
  76201. recordThroughput_(segmentInfo) {
  76202. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  76203. this.logger_(`Ignoring segment's throughput because its duration of ${segmentInfo.duration} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  76204. return;
  76205. }
  76206. const rate = this.throughput.rate;
  76207. const segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  76208. const segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  76209. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  76210. }
  76211. addSegmentMetadataCue_(segmentInfo) {
  76212. if (!this.segmentMetadataTrack_) {
  76213. return;
  76214. }
  76215. const segment = segmentInfo.segment;
  76216. const start2 = segment.start;
  76217. const end = segment.end;
  76218. if (!finite$1(start2) || !finite$1(end)) {
  76219. return;
  76220. }
  76221. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  76222. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  76223. const value = {
  76224. custom: segment.custom,
  76225. dateTimeObject: segment.dateTimeObject,
  76226. dateTimeString: segment.dateTimeString,
  76227. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  76228. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  76229. codecs: segmentInfo.playlist.attributes.CODECS,
  76230. byteLength: segmentInfo.byteLength,
  76231. uri: segmentInfo.uri,
  76232. timeline: segmentInfo.timeline,
  76233. playlist: segmentInfo.playlist.id,
  76234. start: start2,
  76235. end
  76236. };
  76237. const data = JSON.stringify(value);
  76238. const cue = new Cue(start2, end, data);
  76239. cue.value = value;
  76240. this.segmentMetadataTrack_.addCue(cue);
  76241. }
  76242. }
  76243. function noop$1() {
  76244. }
  76245. const toTitleCase$2 = function(string) {
  76246. if (typeof string !== "string") {
  76247. return string;
  76248. }
  76249. return string.replace(/./, (w) => w.toUpperCase());
  76250. };
  76251. const bufferTypes$1 = ["video", "audio"];
  76252. const updating = (type2, sourceUpdater) => {
  76253. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76254. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  76255. };
  76256. const nextQueueIndexOfType$1 = (type2, queue) => {
  76257. for (let i2 = 0; i2 < queue.length; i2++) {
  76258. const queueEntry = queue[i2];
  76259. if (queueEntry.type === "mediaSource") {
  76260. return null;
  76261. }
  76262. if (queueEntry.type === type2) {
  76263. return i2;
  76264. }
  76265. }
  76266. return null;
  76267. };
  76268. const shiftQueue$1 = (type2, sourceUpdater) => {
  76269. if (sourceUpdater.queue.length === 0) {
  76270. return;
  76271. }
  76272. let queueIndex = 0;
  76273. let queueEntry = sourceUpdater.queue[queueIndex];
  76274. if (queueEntry.type === "mediaSource") {
  76275. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  76276. sourceUpdater.queue.shift();
  76277. queueEntry.action(sourceUpdater);
  76278. if (queueEntry.doneFn) {
  76279. queueEntry.doneFn();
  76280. }
  76281. shiftQueue$1("audio", sourceUpdater);
  76282. shiftQueue$1("video", sourceUpdater);
  76283. }
  76284. return;
  76285. }
  76286. if (type2 === "mediaSource") {
  76287. return;
  76288. }
  76289. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || updating(type2, sourceUpdater)) {
  76290. return;
  76291. }
  76292. if (queueEntry.type !== type2) {
  76293. queueIndex = nextQueueIndexOfType$1(type2, sourceUpdater.queue);
  76294. if (queueIndex === null) {
  76295. return;
  76296. }
  76297. queueEntry = sourceUpdater.queue[queueIndex];
  76298. }
  76299. sourceUpdater.queue.splice(queueIndex, 1);
  76300. sourceUpdater.queuePending[type2] = queueEntry;
  76301. queueEntry.action(type2, sourceUpdater);
  76302. if (!queueEntry.doneFn) {
  76303. sourceUpdater.queuePending[type2] = null;
  76304. shiftQueue$1(type2, sourceUpdater);
  76305. return;
  76306. }
  76307. };
  76308. const cleanupBuffer$1 = (type2, sourceUpdater) => {
  76309. const buffer = sourceUpdater[`${type2}Buffer`];
  76310. const titleType = toTitleCase$2(type2);
  76311. if (!buffer) {
  76312. return;
  76313. }
  76314. buffer.removeEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76315. buffer.removeEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76316. sourceUpdater.codecs[type2] = null;
  76317. sourceUpdater[`${type2}Buffer`] = null;
  76318. };
  76319. const inSourceBuffers$1 = (mediaSource, sourceBuffer) => mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  76320. const actions$1 = {
  76321. appendBuffer: (bytes, segmentInfo, onError2) => (type2, sourceUpdater) => {
  76322. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76323. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76324. return;
  76325. }
  76326. sourceUpdater.logger_(`Appending segment ${segmentInfo.mediaIndex}'s ${bytes.length} bytes to ${type2}Buffer`);
  76327. try {
  76328. sourceBuffer.appendBuffer(bytes);
  76329. } catch (e) {
  76330. sourceUpdater.logger_(`Error with code ${e.code} ` + (e.code === QUOTA_EXCEEDED_ERR$1 ? "(QUOTA_EXCEEDED_ERR) " : "") + `when appending segment ${segmentInfo.mediaIndex} to ${type2}Buffer`);
  76331. sourceUpdater.queuePending[type2] = null;
  76332. onError2(e);
  76333. }
  76334. },
  76335. remove: (start2, end) => (type2, sourceUpdater) => {
  76336. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76337. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76338. return;
  76339. }
  76340. sourceUpdater.logger_(`Removing ${start2} to ${end} from ${type2}Buffer`);
  76341. try {
  76342. sourceBuffer.remove(start2, end);
  76343. } catch (e) {
  76344. sourceUpdater.logger_(`Remove ${start2} to ${end} from ${type2}Buffer failed`);
  76345. }
  76346. },
  76347. timestampOffset: (offset) => (type2, sourceUpdater) => {
  76348. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76349. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76350. return;
  76351. }
  76352. sourceUpdater.logger_(`Setting ${type2}timestampOffset to ${offset}`);
  76353. sourceBuffer.timestampOffset = offset;
  76354. },
  76355. callback: (callback2) => (type2, sourceUpdater) => {
  76356. callback2();
  76357. },
  76358. endOfStream: (error) => (sourceUpdater) => {
  76359. if (sourceUpdater.mediaSource.readyState !== "open") {
  76360. return;
  76361. }
  76362. sourceUpdater.logger_(`Calling mediaSource endOfStream(${error || ""})`);
  76363. try {
  76364. sourceUpdater.mediaSource.endOfStream(error);
  76365. } catch (e) {
  76366. videojs$2.log.warn("Failed to call media source endOfStream", e);
  76367. }
  76368. },
  76369. duration: (duration5) => (sourceUpdater) => {
  76370. sourceUpdater.logger_(`Setting mediaSource duration to ${duration5}`);
  76371. try {
  76372. sourceUpdater.mediaSource.duration = duration5;
  76373. } catch (e) {
  76374. videojs$2.log.warn("Failed to set media source duration", e);
  76375. }
  76376. },
  76377. abort: () => (type2, sourceUpdater) => {
  76378. if (sourceUpdater.mediaSource.readyState !== "open") {
  76379. return;
  76380. }
  76381. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76382. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76383. return;
  76384. }
  76385. sourceUpdater.logger_(`calling abort on ${type2}Buffer`);
  76386. try {
  76387. sourceBuffer.abort();
  76388. } catch (e) {
  76389. videojs$2.log.warn(`Failed to abort on ${type2}Buffer`, e);
  76390. }
  76391. },
  76392. addSourceBuffer: (type2, codec) => (sourceUpdater) => {
  76393. const titleType = toTitleCase$2(type2);
  76394. const mime = getMimeForCodec$1(codec);
  76395. sourceUpdater.logger_(`Adding ${type2}Buffer with codec ${codec} to mediaSource`);
  76396. const sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  76397. sourceBuffer.addEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76398. sourceBuffer.addEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76399. sourceUpdater.codecs[type2] = codec;
  76400. sourceUpdater[`${type2}Buffer`] = sourceBuffer;
  76401. },
  76402. removeSourceBuffer: (type2) => (sourceUpdater) => {
  76403. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76404. cleanupBuffer$1(type2, sourceUpdater);
  76405. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76406. return;
  76407. }
  76408. sourceUpdater.logger_(`Removing ${type2}Buffer with codec ${sourceUpdater.codecs[type2]} from mediaSource`);
  76409. try {
  76410. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  76411. } catch (e) {
  76412. videojs$2.log.warn(`Failed to removeSourceBuffer ${type2}Buffer`, e);
  76413. }
  76414. },
  76415. changeType: (codec) => (type2, sourceUpdater) => {
  76416. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76417. const mime = getMimeForCodec$1(codec);
  76418. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76419. return;
  76420. }
  76421. if (sourceUpdater.codecs[type2] === codec) {
  76422. return;
  76423. }
  76424. sourceUpdater.logger_(`changing ${type2}Buffer codec from ${sourceUpdater.codecs[type2]} to ${codec}`);
  76425. sourceBuffer.changeType(mime);
  76426. sourceUpdater.codecs[type2] = codec;
  76427. }
  76428. };
  76429. const pushQueue$1 = ({
  76430. type: type2,
  76431. sourceUpdater,
  76432. action,
  76433. doneFn,
  76434. name
  76435. }) => {
  76436. sourceUpdater.queue.push({
  76437. type: type2,
  76438. action,
  76439. doneFn,
  76440. name
  76441. });
  76442. shiftQueue$1(type2, sourceUpdater);
  76443. };
  76444. const onUpdateend$1 = (type2, sourceUpdater) => (e) => {
  76445. if (sourceUpdater.queuePending[type2]) {
  76446. const doneFn = sourceUpdater.queuePending[type2].doneFn;
  76447. sourceUpdater.queuePending[type2] = null;
  76448. if (doneFn) {
  76449. doneFn(sourceUpdater[`${type2}Error_`]);
  76450. }
  76451. }
  76452. shiftQueue$1(type2, sourceUpdater);
  76453. };
  76454. class SourceUpdater$1 extends videojs$2.EventTarget {
  76455. constructor(mediaSource) {
  76456. super();
  76457. this.mediaSource = mediaSource;
  76458. this.sourceopenListener_ = () => shiftQueue$1("mediaSource", this);
  76459. this.mediaSource.addEventListener("sourceopen", this.sourceopenListener_);
  76460. this.logger_ = logger$1("SourceUpdater");
  76461. this.audioTimestampOffset_ = 0;
  76462. this.videoTimestampOffset_ = 0;
  76463. this.queue = [];
  76464. this.queuePending = {
  76465. audio: null,
  76466. video: null
  76467. };
  76468. this.delayedAudioAppendQueue_ = [];
  76469. this.videoAppendQueued_ = false;
  76470. this.codecs = {};
  76471. this.onVideoUpdateEnd_ = onUpdateend$1("video", this);
  76472. this.onAudioUpdateEnd_ = onUpdateend$1("audio", this);
  76473. this.onVideoError_ = (e) => {
  76474. this.videoError_ = e;
  76475. };
  76476. this.onAudioError_ = (e) => {
  76477. this.audioError_ = e;
  76478. };
  76479. this.createdSourceBuffers_ = false;
  76480. this.initializedEme_ = false;
  76481. this.triggeredReady_ = false;
  76482. }
  76483. initializedEme() {
  76484. this.initializedEme_ = true;
  76485. this.triggerReady();
  76486. }
  76487. hasCreatedSourceBuffers() {
  76488. return this.createdSourceBuffers_;
  76489. }
  76490. hasInitializedAnyEme() {
  76491. return this.initializedEme_;
  76492. }
  76493. ready() {
  76494. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  76495. }
  76496. createSourceBuffers(codecs) {
  76497. if (this.hasCreatedSourceBuffers()) {
  76498. return;
  76499. }
  76500. this.addOrChangeSourceBuffers(codecs);
  76501. this.createdSourceBuffers_ = true;
  76502. this.trigger("createdsourcebuffers");
  76503. this.triggerReady();
  76504. }
  76505. triggerReady() {
  76506. if (this.ready() && !this.triggeredReady_) {
  76507. this.triggeredReady_ = true;
  76508. this.trigger("ready");
  76509. }
  76510. }
  76511. addSourceBuffer(type2, codec) {
  76512. pushQueue$1({
  76513. type: "mediaSource",
  76514. sourceUpdater: this,
  76515. action: actions$1.addSourceBuffer(type2, codec),
  76516. name: "addSourceBuffer"
  76517. });
  76518. }
  76519. abort(type2) {
  76520. pushQueue$1({
  76521. type: type2,
  76522. sourceUpdater: this,
  76523. action: actions$1.abort(type2),
  76524. name: "abort"
  76525. });
  76526. }
  76527. removeSourceBuffer(type2) {
  76528. if (!this.canRemoveSourceBuffer()) {
  76529. videojs$2.log.error("removeSourceBuffer is not supported!");
  76530. return;
  76531. }
  76532. pushQueue$1({
  76533. type: "mediaSource",
  76534. sourceUpdater: this,
  76535. action: actions$1.removeSourceBuffer(type2),
  76536. name: "removeSourceBuffer"
  76537. });
  76538. }
  76539. canRemoveSourceBuffer() {
  76540. return !videojs$2.browser.IE_VERSION && !videojs$2.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  76541. }
  76542. static canChangeType() {
  76543. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  76544. }
  76545. canChangeType() {
  76546. return this.constructor.canChangeType();
  76547. }
  76548. changeType(type2, codec) {
  76549. if (!this.canChangeType()) {
  76550. videojs$2.log.error("changeType is not supported!");
  76551. return;
  76552. }
  76553. pushQueue$1({
  76554. type: type2,
  76555. sourceUpdater: this,
  76556. action: actions$1.changeType(codec),
  76557. name: "changeType"
  76558. });
  76559. }
  76560. addOrChangeSourceBuffers(codecs) {
  76561. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  76562. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  76563. }
  76564. Object.keys(codecs).forEach((type2) => {
  76565. const codec = codecs[type2];
  76566. if (!this.hasCreatedSourceBuffers()) {
  76567. return this.addSourceBuffer(type2, codec);
  76568. }
  76569. if (this.canChangeType()) {
  76570. this.changeType(type2, codec);
  76571. }
  76572. });
  76573. }
  76574. appendBuffer(options2, doneFn) {
  76575. const {
  76576. segmentInfo,
  76577. type: type2,
  76578. bytes
  76579. } = options2;
  76580. this.processedAppend_ = true;
  76581. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  76582. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  76583. this.logger_(`delayed audio append of ${bytes.length} until video append`);
  76584. return;
  76585. }
  76586. const onError2 = doneFn;
  76587. pushQueue$1({
  76588. type: type2,
  76589. sourceUpdater: this,
  76590. action: actions$1.appendBuffer(bytes, segmentInfo || {
  76591. mediaIndex: -1
  76592. }, onError2),
  76593. doneFn,
  76594. name: "appendBuffer"
  76595. });
  76596. if (type2 === "video") {
  76597. this.videoAppendQueued_ = true;
  76598. if (!this.delayedAudioAppendQueue_.length) {
  76599. return;
  76600. }
  76601. const queue = this.delayedAudioAppendQueue_.slice();
  76602. this.logger_(`queuing delayed audio ${queue.length} appendBuffers`);
  76603. this.delayedAudioAppendQueue_.length = 0;
  76604. queue.forEach((que) => {
  76605. this.appendBuffer.apply(this, que);
  76606. });
  76607. }
  76608. }
  76609. audioBuffered() {
  76610. if (!inSourceBuffers$1(this.mediaSource, this.audioBuffer)) {
  76611. return createTimeRanges$2();
  76612. }
  76613. return this.audioBuffer.buffered ? this.audioBuffer.buffered : createTimeRanges$2();
  76614. }
  76615. videoBuffered() {
  76616. if (!inSourceBuffers$1(this.mediaSource, this.videoBuffer)) {
  76617. return createTimeRanges$2();
  76618. }
  76619. return this.videoBuffer.buffered ? this.videoBuffer.buffered : createTimeRanges$2();
  76620. }
  76621. buffered() {
  76622. const video = inSourceBuffers$1(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  76623. const audio = inSourceBuffers$1(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  76624. if (audio && !video) {
  76625. return this.audioBuffered();
  76626. }
  76627. if (video && !audio) {
  76628. return this.videoBuffered();
  76629. }
  76630. return bufferIntersection$1(this.audioBuffered(), this.videoBuffered());
  76631. }
  76632. setDuration(duration5, doneFn = noop$1) {
  76633. pushQueue$1({
  76634. type: "mediaSource",
  76635. sourceUpdater: this,
  76636. action: actions$1.duration(duration5),
  76637. name: "duration",
  76638. doneFn
  76639. });
  76640. }
  76641. endOfStream(error = null, doneFn = noop$1) {
  76642. if (typeof error !== "string") {
  76643. error = void 0;
  76644. }
  76645. pushQueue$1({
  76646. type: "mediaSource",
  76647. sourceUpdater: this,
  76648. action: actions$1.endOfStream(error),
  76649. name: "endOfStream",
  76650. doneFn
  76651. });
  76652. }
  76653. removeAudio(start2, end, done = noop$1) {
  76654. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  76655. done();
  76656. return;
  76657. }
  76658. pushQueue$1({
  76659. type: "audio",
  76660. sourceUpdater: this,
  76661. action: actions$1.remove(start2, end),
  76662. doneFn: done,
  76663. name: "remove"
  76664. });
  76665. }
  76666. removeVideo(start2, end, done = noop$1) {
  76667. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  76668. done();
  76669. return;
  76670. }
  76671. pushQueue$1({
  76672. type: "video",
  76673. sourceUpdater: this,
  76674. action: actions$1.remove(start2, end),
  76675. doneFn: done,
  76676. name: "remove"
  76677. });
  76678. }
  76679. updating() {
  76680. if (updating("audio", this) || updating("video", this)) {
  76681. return true;
  76682. }
  76683. return false;
  76684. }
  76685. audioTimestampOffset(offset) {
  76686. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  76687. pushQueue$1({
  76688. type: "audio",
  76689. sourceUpdater: this,
  76690. action: actions$1.timestampOffset(offset),
  76691. name: "timestampOffset"
  76692. });
  76693. this.audioTimestampOffset_ = offset;
  76694. }
  76695. return this.audioTimestampOffset_;
  76696. }
  76697. videoTimestampOffset(offset) {
  76698. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  76699. pushQueue$1({
  76700. type: "video",
  76701. sourceUpdater: this,
  76702. action: actions$1.timestampOffset(offset),
  76703. name: "timestampOffset"
  76704. });
  76705. this.videoTimestampOffset_ = offset;
  76706. }
  76707. return this.videoTimestampOffset_;
  76708. }
  76709. audioQueueCallback(callback2) {
  76710. if (!this.audioBuffer) {
  76711. return;
  76712. }
  76713. pushQueue$1({
  76714. type: "audio",
  76715. sourceUpdater: this,
  76716. action: actions$1.callback(callback2),
  76717. name: "callback"
  76718. });
  76719. }
  76720. videoQueueCallback(callback2) {
  76721. if (!this.videoBuffer) {
  76722. return;
  76723. }
  76724. pushQueue$1({
  76725. type: "video",
  76726. sourceUpdater: this,
  76727. action: actions$1.callback(callback2),
  76728. name: "callback"
  76729. });
  76730. }
  76731. dispose() {
  76732. this.trigger("dispose");
  76733. bufferTypes$1.forEach((type2) => {
  76734. this.abort(type2);
  76735. if (this.canRemoveSourceBuffer()) {
  76736. this.removeSourceBuffer(type2);
  76737. } else {
  76738. this[`${type2}QueueCallback`](() => cleanupBuffer$1(type2, this));
  76739. }
  76740. });
  76741. this.videoAppendQueued_ = false;
  76742. this.delayedAudioAppendQueue_.length = 0;
  76743. if (this.sourceopenListener_) {
  76744. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  76745. }
  76746. this.off();
  76747. }
  76748. }
  76749. const uint8ToUtf8$1 = (uintArray) => decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  76750. const VTT_LINE_TERMINATORS$1 = new Uint8Array("\n\n".split("").map((char) => char.charCodeAt(0)));
  76751. class NoVttJsError$1 extends Error {
  76752. constructor() {
  76753. super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.");
  76754. }
  76755. }
  76756. class VTTSegmentLoader$1 extends SegmentLoader$1 {
  76757. constructor(settings, options2 = {}) {
  76758. super(settings, options2);
  76759. this.mediaSource_ = null;
  76760. this.subtitlesTrack_ = null;
  76761. this.loaderType_ = "subtitle";
  76762. this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  76763. this.loadVttJs = settings.loadVttJs;
  76764. this.shouldSaveSegmentTimingInfo_ = false;
  76765. }
  76766. createTransmuxer_() {
  76767. return null;
  76768. }
  76769. buffered_() {
  76770. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  76771. return createTimeRanges$2();
  76772. }
  76773. const cues = this.subtitlesTrack_.cues;
  76774. const start2 = cues[0].startTime;
  76775. const end = cues[cues.length - 1].startTime;
  76776. return createTimeRanges$2([[start2, end]]);
  76777. }
  76778. initSegmentForMap(map, set4 = false) {
  76779. if (!map) {
  76780. return null;
  76781. }
  76782. const id = initSegmentId$1(map);
  76783. let storedMap = this.initSegments_[id];
  76784. if (set4 && !storedMap && map.bytes) {
  76785. const combinedByteLength = VTT_LINE_TERMINATORS$1.byteLength + map.bytes.byteLength;
  76786. const combinedSegment = new Uint8Array(combinedByteLength);
  76787. combinedSegment.set(map.bytes);
  76788. combinedSegment.set(VTT_LINE_TERMINATORS$1, map.bytes.byteLength);
  76789. this.initSegments_[id] = storedMap = {
  76790. resolvedUri: map.resolvedUri,
  76791. byterange: map.byterange,
  76792. bytes: combinedSegment
  76793. };
  76794. }
  76795. return storedMap || map;
  76796. }
  76797. couldBeginLoading_() {
  76798. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  76799. }
  76800. init_() {
  76801. this.state = "READY";
  76802. this.resetEverything();
  76803. return this.monitorBuffer_();
  76804. }
  76805. track(track) {
  76806. if (typeof track === "undefined") {
  76807. return this.subtitlesTrack_;
  76808. }
  76809. this.subtitlesTrack_ = track;
  76810. if (this.state === "INIT" && this.couldBeginLoading_()) {
  76811. this.init_();
  76812. }
  76813. return this.subtitlesTrack_;
  76814. }
  76815. remove(start2, end) {
  76816. removeCuesFromTrack$1(start2, end, this.subtitlesTrack_);
  76817. }
  76818. fillBuffer_() {
  76819. const segmentInfo = this.chooseNextRequest_();
  76820. if (!segmentInfo) {
  76821. return;
  76822. }
  76823. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  76824. const checkTimestampOffset = () => {
  76825. this.state = "READY";
  76826. if (!this.paused()) {
  76827. this.monitorBuffer_();
  76828. }
  76829. };
  76830. this.syncController_.one("timestampoffset", checkTimestampOffset);
  76831. this.state = "WAITING_ON_TIMELINE";
  76832. return;
  76833. }
  76834. this.loadSegment_(segmentInfo);
  76835. }
  76836. timestampOffsetForSegment_() {
  76837. return null;
  76838. }
  76839. chooseNextRequest_() {
  76840. return this.skipEmptySegments_(super.chooseNextRequest_());
  76841. }
  76842. skipEmptySegments_(segmentInfo) {
  76843. while (segmentInfo && segmentInfo.segment.empty) {
  76844. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  76845. segmentInfo = null;
  76846. break;
  76847. }
  76848. segmentInfo = this.generateSegmentInfo_({
  76849. playlist: segmentInfo.playlist,
  76850. mediaIndex: segmentInfo.mediaIndex + 1,
  76851. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  76852. isSyncRequest: segmentInfo.isSyncRequest
  76853. });
  76854. }
  76855. return segmentInfo;
  76856. }
  76857. stopForError(error) {
  76858. this.error(error);
  76859. this.state = "READY";
  76860. this.pause();
  76861. this.trigger("error");
  76862. }
  76863. segmentRequestFinished_(error, simpleSegment, result) {
  76864. if (!this.subtitlesTrack_) {
  76865. this.state = "READY";
  76866. return;
  76867. }
  76868. this.saveTransferStats_(simpleSegment.stats);
  76869. if (!this.pendingSegment_) {
  76870. this.state = "READY";
  76871. this.mediaRequestsAborted += 1;
  76872. return;
  76873. }
  76874. if (error) {
  76875. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  76876. this.handleTimeout_();
  76877. }
  76878. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  76879. this.mediaRequestsAborted += 1;
  76880. } else {
  76881. this.mediaRequestsErrored += 1;
  76882. }
  76883. this.stopForError(error);
  76884. return;
  76885. }
  76886. const segmentInfo = this.pendingSegment_;
  76887. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  76888. if (simpleSegment.key) {
  76889. this.segmentKey(simpleSegment.key, true);
  76890. }
  76891. this.state = "APPENDING";
  76892. this.trigger("appending");
  76893. const segment = segmentInfo.segment;
  76894. if (segment.map) {
  76895. segment.map.bytes = simpleSegment.map.bytes;
  76896. }
  76897. segmentInfo.bytes = simpleSegment.bytes;
  76898. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  76899. this.state = "WAITING_ON_VTTJS";
  76900. this.loadVttJs().then(() => this.segmentRequestFinished_(error, simpleSegment, result), () => this.stopForError({
  76901. message: "Error loading vtt.js"
  76902. }));
  76903. return;
  76904. }
  76905. segment.requested = true;
  76906. try {
  76907. this.parseVTTCues_(segmentInfo);
  76908. } catch (e) {
  76909. this.stopForError({
  76910. message: e.message
  76911. });
  76912. return;
  76913. }
  76914. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  76915. if (segmentInfo.cues.length) {
  76916. segmentInfo.timingInfo = {
  76917. start: segmentInfo.cues[0].startTime,
  76918. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  76919. };
  76920. } else {
  76921. segmentInfo.timingInfo = {
  76922. start: segmentInfo.startOfSegment,
  76923. end: segmentInfo.startOfSegment + segmentInfo.duration
  76924. };
  76925. }
  76926. if (segmentInfo.isSyncRequest) {
  76927. this.trigger("syncinfoupdate");
  76928. this.pendingSegment_ = null;
  76929. this.state = "READY";
  76930. return;
  76931. }
  76932. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  76933. this.mediaSecondsLoaded += segment.duration;
  76934. segmentInfo.cues.forEach((cue) => {
  76935. this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  76936. });
  76937. removeDuplicateCuesFromTrack$1(this.subtitlesTrack_);
  76938. this.handleAppendsDone_();
  76939. }
  76940. handleData_() {
  76941. }
  76942. updateTimingInfoEnd_() {
  76943. }
  76944. parseVTTCues_(segmentInfo) {
  76945. let decoder;
  76946. let decodeBytesToString = false;
  76947. if (typeof window_1.WebVTT !== "function") {
  76948. throw new NoVttJsError$1();
  76949. }
  76950. if (typeof window_1.TextDecoder === "function") {
  76951. decoder = new window_1.TextDecoder("utf8");
  76952. } else {
  76953. decoder = window_1.WebVTT.StringDecoder();
  76954. decodeBytesToString = true;
  76955. }
  76956. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  76957. segmentInfo.cues = [];
  76958. segmentInfo.timestampmap = {
  76959. MPEGTS: 0,
  76960. LOCAL: 0
  76961. };
  76962. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  76963. parser2.ontimestampmap = (map) => {
  76964. segmentInfo.timestampmap = map;
  76965. };
  76966. parser2.onparsingerror = (error) => {
  76967. videojs$2.log.warn("Error encountered when parsing cues: " + error.message);
  76968. };
  76969. if (segmentInfo.segment.map) {
  76970. let mapData = segmentInfo.segment.map.bytes;
  76971. if (decodeBytesToString) {
  76972. mapData = uint8ToUtf8$1(mapData);
  76973. }
  76974. parser2.parse(mapData);
  76975. }
  76976. let segmentData = segmentInfo.bytes;
  76977. if (decodeBytesToString) {
  76978. segmentData = uint8ToUtf8$1(segmentData);
  76979. }
  76980. parser2.parse(segmentData);
  76981. parser2.flush();
  76982. }
  76983. updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  76984. const segment = segmentInfo.segment;
  76985. if (!mappingObj) {
  76986. return;
  76987. }
  76988. if (!segmentInfo.cues.length) {
  76989. segment.empty = true;
  76990. return;
  76991. }
  76992. const timestampmap = segmentInfo.timestampmap;
  76993. const diff = timestampmap.MPEGTS / clock$1.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  76994. segmentInfo.cues.forEach((cue) => {
  76995. cue.startTime += diff;
  76996. cue.endTime += diff;
  76997. });
  76998. if (!playlist.syncInfo) {
  76999. const firstStart = segmentInfo.cues[0].startTime;
  77000. const lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  77001. playlist.syncInfo = {
  77002. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  77003. time: Math.min(firstStart, lastStart - segment.duration)
  77004. };
  77005. }
  77006. }
  77007. }
  77008. const findAdCue$1 = function(track, mediaTime) {
  77009. const cues = track.cues;
  77010. for (let i2 = 0; i2 < cues.length; i2++) {
  77011. const cue = cues[i2];
  77012. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  77013. return cue;
  77014. }
  77015. }
  77016. return null;
  77017. };
  77018. const updateAdCues$1 = function(media, track, offset = 0) {
  77019. if (!media.segments) {
  77020. return;
  77021. }
  77022. let mediaTime = offset;
  77023. let cue;
  77024. for (let i2 = 0; i2 < media.segments.length; i2++) {
  77025. const segment = media.segments[i2];
  77026. if (!cue) {
  77027. cue = findAdCue$1(track, mediaTime + segment.duration / 2);
  77028. }
  77029. if (cue) {
  77030. if ("cueIn" in segment) {
  77031. cue.endTime = mediaTime;
  77032. cue.adEndTime = mediaTime;
  77033. mediaTime += segment.duration;
  77034. cue = null;
  77035. continue;
  77036. }
  77037. if (mediaTime < cue.endTime) {
  77038. mediaTime += segment.duration;
  77039. continue;
  77040. }
  77041. cue.endTime += segment.duration;
  77042. } else {
  77043. if ("cueOut" in segment) {
  77044. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  77045. cue.adStartTime = mediaTime;
  77046. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  77047. track.addCue(cue);
  77048. }
  77049. if ("cueOutCont" in segment) {
  77050. const [adOffset, adTotal] = segment.cueOutCont.split("/").map(parseFloat);
  77051. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  77052. cue.adStartTime = mediaTime - adOffset;
  77053. cue.adEndTime = cue.adStartTime + adTotal;
  77054. track.addCue(cue);
  77055. }
  77056. }
  77057. mediaTime += segment.duration;
  77058. }
  77059. };
  77060. const MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1 = 86400;
  77061. const syncPointStrategies$1 = [
  77062. {
  77063. name: "VOD",
  77064. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77065. if (duration5 !== Infinity) {
  77066. const syncPoint = {
  77067. time: 0,
  77068. segmentIndex: 0,
  77069. partIndex: null
  77070. };
  77071. return syncPoint;
  77072. }
  77073. return null;
  77074. }
  77075. },
  77076. {
  77077. name: "ProgramDateTime",
  77078. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77079. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  77080. return null;
  77081. }
  77082. let syncPoint = null;
  77083. let lastDistance = null;
  77084. const partsAndSegments = getPartsAndSegments$1(playlist);
  77085. currentTime = currentTime || 0;
  77086. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77087. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77088. const partAndSegment = partsAndSegments[index2];
  77089. const segment = partAndSegment.segment;
  77090. const datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  77091. if (!datetimeMapping || !segment.dateTimeObject) {
  77092. continue;
  77093. }
  77094. const segmentTime = segment.dateTimeObject.getTime() / 1e3;
  77095. let start2 = segmentTime + datetimeMapping;
  77096. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  77097. for (let z = 0; z < partAndSegment.partIndex; z++) {
  77098. start2 += segment.parts[z].duration;
  77099. }
  77100. }
  77101. const distance2 = Math.abs(currentTime - start2);
  77102. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  77103. break;
  77104. }
  77105. lastDistance = distance2;
  77106. syncPoint = {
  77107. time: start2,
  77108. segmentIndex: partAndSegment.segmentIndex,
  77109. partIndex: partAndSegment.partIndex
  77110. };
  77111. }
  77112. return syncPoint;
  77113. }
  77114. },
  77115. {
  77116. name: "Segment",
  77117. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77118. let syncPoint = null;
  77119. let lastDistance = null;
  77120. currentTime = currentTime || 0;
  77121. const partsAndSegments = getPartsAndSegments$1(playlist);
  77122. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77123. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77124. const partAndSegment = partsAndSegments[index2];
  77125. const segment = partAndSegment.segment;
  77126. const start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  77127. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  77128. const distance2 = Math.abs(currentTime - start2);
  77129. if (lastDistance !== null && lastDistance < distance2) {
  77130. break;
  77131. }
  77132. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77133. lastDistance = distance2;
  77134. syncPoint = {
  77135. time: start2,
  77136. segmentIndex: partAndSegment.segmentIndex,
  77137. partIndex: partAndSegment.partIndex
  77138. };
  77139. }
  77140. }
  77141. }
  77142. return syncPoint;
  77143. }
  77144. },
  77145. {
  77146. name: "Discontinuity",
  77147. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77148. let syncPoint = null;
  77149. currentTime = currentTime || 0;
  77150. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77151. let lastDistance = null;
  77152. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77153. const segmentIndex = playlist.discontinuityStarts[i2];
  77154. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77155. const discontinuitySync = syncController.discontinuities[discontinuity];
  77156. if (discontinuitySync) {
  77157. const distance2 = Math.abs(currentTime - discontinuitySync.time);
  77158. if (lastDistance !== null && lastDistance < distance2) {
  77159. break;
  77160. }
  77161. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77162. lastDistance = distance2;
  77163. syncPoint = {
  77164. time: discontinuitySync.time,
  77165. segmentIndex,
  77166. partIndex: null
  77167. };
  77168. }
  77169. }
  77170. }
  77171. }
  77172. return syncPoint;
  77173. }
  77174. },
  77175. {
  77176. name: "Playlist",
  77177. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77178. if (playlist.syncInfo) {
  77179. const syncPoint = {
  77180. time: playlist.syncInfo.time,
  77181. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  77182. partIndex: null
  77183. };
  77184. return syncPoint;
  77185. }
  77186. return null;
  77187. }
  77188. }
  77189. ];
  77190. class SyncController$1 extends videojs$2.EventTarget {
  77191. constructor(options2 = {}) {
  77192. super();
  77193. this.timelines = [];
  77194. this.discontinuities = [];
  77195. this.timelineToDatetimeMappings = {};
  77196. this.logger_ = logger$1("SyncController");
  77197. }
  77198. getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  77199. const syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  77200. if (!syncPoints.length) {
  77201. return null;
  77202. }
  77203. return this.selectSyncPoint_(syncPoints, {
  77204. key: "time",
  77205. value: currentTime
  77206. });
  77207. }
  77208. getExpiredTime(playlist, duration5) {
  77209. if (!playlist || !playlist.segments) {
  77210. return null;
  77211. }
  77212. const syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  77213. if (!syncPoints.length) {
  77214. return null;
  77215. }
  77216. const syncPoint = this.selectSyncPoint_(syncPoints, {
  77217. key: "segmentIndex",
  77218. value: 0
  77219. });
  77220. if (syncPoint.segmentIndex > 0) {
  77221. syncPoint.time *= -1;
  77222. }
  77223. return Math.abs(syncPoint.time + sumDurations$1({
  77224. defaultDuration: playlist.targetDuration,
  77225. durationList: playlist.segments,
  77226. startIndex: syncPoint.segmentIndex,
  77227. endIndex: 0
  77228. }));
  77229. }
  77230. runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  77231. const syncPoints = [];
  77232. for (let i2 = 0; i2 < syncPointStrategies$1.length; i2++) {
  77233. const strategy = syncPointStrategies$1[i2];
  77234. const syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  77235. if (syncPoint) {
  77236. syncPoint.strategy = strategy.name;
  77237. syncPoints.push({
  77238. strategy: strategy.name,
  77239. syncPoint
  77240. });
  77241. }
  77242. }
  77243. return syncPoints;
  77244. }
  77245. selectSyncPoint_(syncPoints, target) {
  77246. let bestSyncPoint = syncPoints[0].syncPoint;
  77247. let bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  77248. let bestStrategy = syncPoints[0].strategy;
  77249. for (let i2 = 1; i2 < syncPoints.length; i2++) {
  77250. const newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  77251. if (newDistance < bestDistance) {
  77252. bestDistance = newDistance;
  77253. bestSyncPoint = syncPoints[i2].syncPoint;
  77254. bestStrategy = syncPoints[i2].strategy;
  77255. }
  77256. }
  77257. this.logger_(`syncPoint for [${target.key}: ${target.value}] chosen with strategy [${bestStrategy}]: [time:${bestSyncPoint.time}, segmentIndex:${bestSyncPoint.segmentIndex}` + (typeof bestSyncPoint.partIndex === "number" ? `,partIndex:${bestSyncPoint.partIndex}` : "") + "]");
  77258. return bestSyncPoint;
  77259. }
  77260. saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  77261. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  77262. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1) {
  77263. videojs$2.log.warn(`Not saving expired segment info. Media sequence gap ${mediaSequenceDiff} is too large.`);
  77264. return;
  77265. }
  77266. for (let i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  77267. const lastRemovedSegment = oldPlaylist.segments[i2];
  77268. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  77269. newPlaylist.syncInfo = {
  77270. mediaSequence: oldPlaylist.mediaSequence + i2,
  77271. time: lastRemovedSegment.start
  77272. };
  77273. this.logger_(`playlist refresh sync: [time:${newPlaylist.syncInfo.time}, mediaSequence: ${newPlaylist.syncInfo.mediaSequence}]`);
  77274. this.trigger("syncinfoupdate");
  77275. break;
  77276. }
  77277. }
  77278. }
  77279. setDateTimeMappingForStart(playlist) {
  77280. this.timelineToDatetimeMappings = {};
  77281. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  77282. const firstSegment = playlist.segments[0];
  77283. const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  77284. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  77285. }
  77286. }
  77287. saveSegmentTimingInfo({
  77288. segmentInfo,
  77289. shouldSaveTimelineMapping
  77290. }) {
  77291. const didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  77292. const segment = segmentInfo.segment;
  77293. if (didCalculateSegmentTimeMapping) {
  77294. this.saveDiscontinuitySyncInfo_(segmentInfo);
  77295. if (!segmentInfo.playlist.syncInfo) {
  77296. segmentInfo.playlist.syncInfo = {
  77297. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  77298. time: segment.start
  77299. };
  77300. }
  77301. }
  77302. const dateTime = segment.dateTimeObject;
  77303. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  77304. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  77305. }
  77306. }
  77307. timestampOffsetForTimeline(timeline) {
  77308. if (typeof this.timelines[timeline] === "undefined") {
  77309. return null;
  77310. }
  77311. return this.timelines[timeline].time;
  77312. }
  77313. mappingForTimeline(timeline) {
  77314. if (typeof this.timelines[timeline] === "undefined") {
  77315. return null;
  77316. }
  77317. return this.timelines[timeline].mapping;
  77318. }
  77319. calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  77320. const segment = segmentInfo.segment;
  77321. const part = segmentInfo.part;
  77322. let mappingObj = this.timelines[segmentInfo.timeline];
  77323. let start2;
  77324. let end;
  77325. if (typeof segmentInfo.timestampOffset === "number") {
  77326. mappingObj = {
  77327. time: segmentInfo.startOfSegment,
  77328. mapping: segmentInfo.startOfSegment - timingInfo.start
  77329. };
  77330. if (shouldSaveTimelineMapping) {
  77331. this.timelines[segmentInfo.timeline] = mappingObj;
  77332. this.trigger("timestampoffset");
  77333. this.logger_(`time mapping for timeline ${segmentInfo.timeline}: [time: ${mappingObj.time}] [mapping: ${mappingObj.mapping}]`);
  77334. }
  77335. start2 = segmentInfo.startOfSegment;
  77336. end = timingInfo.end + mappingObj.mapping;
  77337. } else if (mappingObj) {
  77338. start2 = timingInfo.start + mappingObj.mapping;
  77339. end = timingInfo.end + mappingObj.mapping;
  77340. } else {
  77341. return false;
  77342. }
  77343. if (part) {
  77344. part.start = start2;
  77345. part.end = end;
  77346. }
  77347. if (!segment.start || start2 < segment.start) {
  77348. segment.start = start2;
  77349. }
  77350. segment.end = end;
  77351. return true;
  77352. }
  77353. saveDiscontinuitySyncInfo_(segmentInfo) {
  77354. const playlist = segmentInfo.playlist;
  77355. const segment = segmentInfo.segment;
  77356. if (segment.discontinuity) {
  77357. this.discontinuities[segment.timeline] = {
  77358. time: segment.start,
  77359. accuracy: 0
  77360. };
  77361. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77362. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77363. const segmentIndex = playlist.discontinuityStarts[i2];
  77364. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77365. const mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  77366. const accuracy = Math.abs(mediaIndexDiff);
  77367. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  77368. let time;
  77369. if (mediaIndexDiff < 0) {
  77370. time = segment.start - sumDurations$1({
  77371. defaultDuration: playlist.targetDuration,
  77372. durationList: playlist.segments,
  77373. startIndex: segmentInfo.mediaIndex,
  77374. endIndex: segmentIndex
  77375. });
  77376. } else {
  77377. time = segment.end + sumDurations$1({
  77378. defaultDuration: playlist.targetDuration,
  77379. durationList: playlist.segments,
  77380. startIndex: segmentInfo.mediaIndex + 1,
  77381. endIndex: segmentIndex
  77382. });
  77383. }
  77384. this.discontinuities[discontinuity] = {
  77385. time,
  77386. accuracy
  77387. };
  77388. }
  77389. }
  77390. }
  77391. }
  77392. dispose() {
  77393. this.trigger("dispose");
  77394. this.off();
  77395. }
  77396. }
  77397. class TimelineChangeController$1 extends videojs$2.EventTarget {
  77398. constructor() {
  77399. super();
  77400. this.pendingTimelineChanges_ = {};
  77401. this.lastTimelineChanges_ = {};
  77402. }
  77403. clearPendingTimelineChange(type2) {
  77404. this.pendingTimelineChanges_[type2] = null;
  77405. this.trigger("pendingtimelinechange");
  77406. }
  77407. pendingTimelineChange({
  77408. type: type2,
  77409. from: from3,
  77410. to
  77411. }) {
  77412. if (typeof from3 === "number" && typeof to === "number") {
  77413. this.pendingTimelineChanges_[type2] = {
  77414. type: type2,
  77415. from: from3,
  77416. to
  77417. };
  77418. this.trigger("pendingtimelinechange");
  77419. }
  77420. return this.pendingTimelineChanges_[type2];
  77421. }
  77422. lastTimelineChange({
  77423. type: type2,
  77424. from: from3,
  77425. to
  77426. }) {
  77427. if (typeof from3 === "number" && typeof to === "number") {
  77428. this.lastTimelineChanges_[type2] = {
  77429. type: type2,
  77430. from: from3,
  77431. to
  77432. };
  77433. delete this.pendingTimelineChanges_[type2];
  77434. this.trigger("timelinechange");
  77435. }
  77436. return this.lastTimelineChanges_[type2];
  77437. }
  77438. dispose() {
  77439. this.trigger("dispose");
  77440. this.pendingTimelineChanges_ = {};
  77441. this.lastTimelineChanges_ = {};
  77442. this.off();
  77443. }
  77444. }
  77445. const workerCode$2 = transform$1(getWorkerString$1(function() {
  77446. var Stream2 = /* @__PURE__ */ function() {
  77447. function Stream3() {
  77448. this.listeners = {};
  77449. }
  77450. var _proto = Stream3.prototype;
  77451. _proto.on = function on3(type2, listener) {
  77452. if (!this.listeners[type2]) {
  77453. this.listeners[type2] = [];
  77454. }
  77455. this.listeners[type2].push(listener);
  77456. };
  77457. _proto.off = function off2(type2, listener) {
  77458. if (!this.listeners[type2]) {
  77459. return false;
  77460. }
  77461. var index2 = this.listeners[type2].indexOf(listener);
  77462. this.listeners[type2] = this.listeners[type2].slice(0);
  77463. this.listeners[type2].splice(index2, 1);
  77464. return index2 > -1;
  77465. };
  77466. _proto.trigger = function trigger2(type2) {
  77467. var callbacks = this.listeners[type2];
  77468. if (!callbacks) {
  77469. return;
  77470. }
  77471. if (arguments.length === 2) {
  77472. var length = callbacks.length;
  77473. for (var i2 = 0; i2 < length; ++i2) {
  77474. callbacks[i2].call(this, arguments[1]);
  77475. }
  77476. } else {
  77477. var args = Array.prototype.slice.call(arguments, 1);
  77478. var _length = callbacks.length;
  77479. for (var _i = 0; _i < _length; ++_i) {
  77480. callbacks[_i].apply(this, args);
  77481. }
  77482. }
  77483. };
  77484. _proto.dispose = function dispose() {
  77485. this.listeners = {};
  77486. };
  77487. _proto.pipe = function pipe(destination2) {
  77488. this.on("data", function(data) {
  77489. destination2.push(data);
  77490. });
  77491. };
  77492. return Stream3;
  77493. }();
  77494. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  77495. function unpad(padded) {
  77496. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  77497. }
  77498. /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */
  77499. const precompute = function() {
  77500. const tables = [[[], [], [], [], []], [[], [], [], [], []]];
  77501. const encTable = tables[0];
  77502. const decTable = tables[1];
  77503. const sbox = encTable[4];
  77504. const sboxInv = decTable[4];
  77505. let i2;
  77506. let x;
  77507. let xInv;
  77508. const d2 = [];
  77509. const th = [];
  77510. let x2;
  77511. let x4;
  77512. let x8;
  77513. let s;
  77514. let tEnc;
  77515. let tDec;
  77516. for (i2 = 0; i2 < 256; i2++) {
  77517. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  77518. }
  77519. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  77520. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  77521. s = s >> 8 ^ s & 255 ^ 99;
  77522. sbox[x] = s;
  77523. sboxInv[s] = x;
  77524. x8 = d2[x4 = d2[x2 = d2[x]]];
  77525. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  77526. tEnc = d2[s] * 257 ^ s * 16843008;
  77527. for (i2 = 0; i2 < 4; i2++) {
  77528. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  77529. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  77530. }
  77531. }
  77532. for (i2 = 0; i2 < 5; i2++) {
  77533. encTable[i2] = encTable[i2].slice(0);
  77534. decTable[i2] = decTable[i2].slice(0);
  77535. }
  77536. return tables;
  77537. };
  77538. let aesTables = null;
  77539. class AES {
  77540. constructor(key) {
  77541. if (!aesTables) {
  77542. aesTables = precompute();
  77543. }
  77544. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  77545. let i2;
  77546. let j;
  77547. let tmp;
  77548. const sbox = this._tables[0][4];
  77549. const decTable = this._tables[1];
  77550. const keyLen = key.length;
  77551. let rcon = 1;
  77552. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  77553. throw new Error("Invalid aes key size");
  77554. }
  77555. const encKey = key.slice(0);
  77556. const decKey = [];
  77557. this._key = [encKey, decKey];
  77558. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  77559. tmp = encKey[i2 - 1];
  77560. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  77561. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  77562. if (i2 % keyLen === 0) {
  77563. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  77564. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  77565. }
  77566. }
  77567. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  77568. }
  77569. for (j = 0; i2; j++, i2--) {
  77570. tmp = encKey[j & 3 ? i2 : i2 - 4];
  77571. if (i2 <= 4 || j < 4) {
  77572. decKey[j] = tmp;
  77573. } else {
  77574. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  77575. }
  77576. }
  77577. }
  77578. decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  77579. const key = this._key[1];
  77580. let a = encrypted0 ^ key[0];
  77581. let b = encrypted3 ^ key[1];
  77582. let c = encrypted2 ^ key[2];
  77583. let d2 = encrypted1 ^ key[3];
  77584. let a2;
  77585. let b2;
  77586. let c2;
  77587. const nInnerRounds = key.length / 4 - 2;
  77588. let i2;
  77589. let kIndex = 4;
  77590. const table = this._tables[1];
  77591. const table0 = table[0];
  77592. const table1 = table[1];
  77593. const table2 = table[2];
  77594. const table3 = table[3];
  77595. const sbox = table[4];
  77596. for (i2 = 0; i2 < nInnerRounds; i2++) {
  77597. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  77598. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  77599. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  77600. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  77601. kIndex += 4;
  77602. a = a2;
  77603. b = b2;
  77604. c = c2;
  77605. }
  77606. for (i2 = 0; i2 < 4; i2++) {
  77607. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  77608. a2 = a;
  77609. a = b;
  77610. b = c;
  77611. c = d2;
  77612. d2 = a2;
  77613. }
  77614. }
  77615. }
  77616. class AsyncStream extends Stream2 {
  77617. constructor() {
  77618. super(Stream2);
  77619. this.jobs = [];
  77620. this.delay = 1;
  77621. this.timeout_ = null;
  77622. }
  77623. processJob_() {
  77624. this.jobs.shift()();
  77625. if (this.jobs.length) {
  77626. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77627. } else {
  77628. this.timeout_ = null;
  77629. }
  77630. }
  77631. push(job) {
  77632. this.jobs.push(job);
  77633. if (!this.timeout_) {
  77634. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77635. }
  77636. }
  77637. }
  77638. const ntoh = function(word) {
  77639. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  77640. };
  77641. const decrypt3 = function(encrypted, key, initVector) {
  77642. const encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  77643. const decipher = new AES(Array.prototype.slice.call(key));
  77644. const decrypted = new Uint8Array(encrypted.byteLength);
  77645. const decrypted32 = new Int32Array(decrypted.buffer);
  77646. let init0;
  77647. let init1;
  77648. let init2;
  77649. let init3;
  77650. let encrypted0;
  77651. let encrypted1;
  77652. let encrypted2;
  77653. let encrypted3;
  77654. let wordIx;
  77655. init0 = initVector[0];
  77656. init1 = initVector[1];
  77657. init2 = initVector[2];
  77658. init3 = initVector[3];
  77659. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  77660. encrypted0 = ntoh(encrypted32[wordIx]);
  77661. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  77662. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  77663. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  77664. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  77665. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  77666. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  77667. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  77668. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  77669. init0 = encrypted0;
  77670. init1 = encrypted1;
  77671. init2 = encrypted2;
  77672. init3 = encrypted3;
  77673. }
  77674. return decrypted;
  77675. };
  77676. class Decrypter2 {
  77677. constructor(encrypted, key, initVector, done) {
  77678. const step = Decrypter2.STEP;
  77679. const encrypted32 = new Int32Array(encrypted.buffer);
  77680. const decrypted = new Uint8Array(encrypted.byteLength);
  77681. let i2 = 0;
  77682. this.asyncStream_ = new AsyncStream();
  77683. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77684. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  77685. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  77686. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77687. }
  77688. this.asyncStream_.push(function() {
  77689. done(null, unpad(decrypted));
  77690. });
  77691. }
  77692. static get STEP() {
  77693. return 32e3;
  77694. }
  77695. decryptChunk_(encrypted, key, initVector, decrypted) {
  77696. return function() {
  77697. const bytes = decrypt3(encrypted, key, initVector);
  77698. decrypted.set(bytes, encrypted.byteOffset);
  77699. };
  77700. }
  77701. }
  77702. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  77703. var win2;
  77704. if (typeof window !== "undefined") {
  77705. win2 = window;
  77706. } else if (typeof commonjsGlobal2 !== "undefined") {
  77707. win2 = commonjsGlobal2;
  77708. } else if (typeof self !== "undefined") {
  77709. win2 = self;
  77710. } else {
  77711. win2 = {};
  77712. }
  77713. var window_12 = win2;
  77714. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  77715. if (ArrayBuffer.isView === "function") {
  77716. return ArrayBuffer.isView(obj);
  77717. }
  77718. return obj && obj.buffer instanceof ArrayBuffer;
  77719. };
  77720. var BigInt2 = window_12.BigInt || Number;
  77721. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  77722. (function() {
  77723. var a = new Uint16Array([65484]);
  77724. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  77725. if (b[0] === 255) {
  77726. return "big";
  77727. }
  77728. if (b[0] === 204) {
  77729. return "little";
  77730. }
  77731. return "unknown";
  77732. })();
  77733. const createTransferableMessage3 = function(message) {
  77734. const transferable = {};
  77735. Object.keys(message).forEach((key) => {
  77736. const value = message[key];
  77737. if (isArrayBufferView4(value)) {
  77738. transferable[key] = {
  77739. bytes: value.buffer,
  77740. byteOffset: value.byteOffset,
  77741. byteLength: value.byteLength
  77742. };
  77743. } else {
  77744. transferable[key] = value;
  77745. }
  77746. });
  77747. return transferable;
  77748. };
  77749. self.onmessage = function(event2) {
  77750. const data = event2.data;
  77751. const encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  77752. const key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  77753. const iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  77754. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  77755. self.postMessage(createTransferableMessage3({
  77756. source: data.source,
  77757. decrypted: bytes
  77758. }), [bytes.buffer]);
  77759. });
  77760. };
  77761. }));
  77762. var Decrypter$1 = factory$1(workerCode$2);
  77763. const audioTrackKind_$1 = (properties) => {
  77764. let kind = properties.default ? "main" : "alternative";
  77765. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  77766. kind = "main-desc";
  77767. }
  77768. return kind;
  77769. };
  77770. const stopLoaders$1 = (segmentLoader, mediaType) => {
  77771. segmentLoader.abort();
  77772. segmentLoader.pause();
  77773. if (mediaType && mediaType.activePlaylistLoader) {
  77774. mediaType.activePlaylistLoader.pause();
  77775. mediaType.activePlaylistLoader = null;
  77776. }
  77777. };
  77778. const startLoaders$1 = (playlistLoader, mediaType) => {
  77779. mediaType.activePlaylistLoader = playlistLoader;
  77780. playlistLoader.load();
  77781. };
  77782. const onGroupChanged$1 = (type2, settings) => () => {
  77783. const {
  77784. segmentLoaders: {
  77785. [type2]: segmentLoader,
  77786. main: mainSegmentLoader
  77787. },
  77788. mediaTypes: {
  77789. [type2]: mediaType
  77790. }
  77791. } = settings;
  77792. const activeTrack2 = mediaType.activeTrack();
  77793. const activeGroup3 = mediaType.getActiveGroup();
  77794. const previousActiveLoader = mediaType.activePlaylistLoader;
  77795. const lastGroup = mediaType.lastGroup_;
  77796. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  77797. return;
  77798. }
  77799. mediaType.lastGroup_ = activeGroup3;
  77800. mediaType.lastTrack_ = activeTrack2;
  77801. stopLoaders$1(segmentLoader, mediaType);
  77802. if (!activeGroup3 || activeGroup3.isMainPlaylist) {
  77803. return;
  77804. }
  77805. if (!activeGroup3.playlistLoader) {
  77806. if (previousActiveLoader) {
  77807. mainSegmentLoader.resetEverything();
  77808. }
  77809. return;
  77810. }
  77811. segmentLoader.resyncLoader();
  77812. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77813. };
  77814. const onGroupChanging$1 = (type2, settings) => () => {
  77815. const {
  77816. segmentLoaders: {
  77817. [type2]: segmentLoader
  77818. },
  77819. mediaTypes: {
  77820. [type2]: mediaType
  77821. }
  77822. } = settings;
  77823. mediaType.lastGroup_ = null;
  77824. segmentLoader.abort();
  77825. segmentLoader.pause();
  77826. };
  77827. const onTrackChanged$1 = (type2, settings) => () => {
  77828. const {
  77829. mainPlaylistLoader,
  77830. segmentLoaders: {
  77831. [type2]: segmentLoader,
  77832. main: mainSegmentLoader
  77833. },
  77834. mediaTypes: {
  77835. [type2]: mediaType
  77836. }
  77837. } = settings;
  77838. const activeTrack2 = mediaType.activeTrack();
  77839. const activeGroup3 = mediaType.getActiveGroup();
  77840. const previousActiveLoader = mediaType.activePlaylistLoader;
  77841. const lastTrack = mediaType.lastTrack_;
  77842. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  77843. return;
  77844. }
  77845. mediaType.lastGroup_ = activeGroup3;
  77846. mediaType.lastTrack_ = activeTrack2;
  77847. stopLoaders$1(segmentLoader, mediaType);
  77848. if (!activeGroup3) {
  77849. return;
  77850. }
  77851. if (activeGroup3.isMainPlaylist) {
  77852. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  77853. return;
  77854. }
  77855. const pc = settings.vhs.playlistController_;
  77856. const newPlaylist = pc.selectPlaylist();
  77857. if (pc.media() === newPlaylist) {
  77858. return;
  77859. }
  77860. mediaType.logger_(`track change. Switching main audio from ${lastTrack.id} to ${activeTrack2.id}`);
  77861. mainPlaylistLoader.pause();
  77862. mainSegmentLoader.resetEverything();
  77863. pc.fastQualityChange_(newPlaylist);
  77864. return;
  77865. }
  77866. if (type2 === "AUDIO") {
  77867. if (!activeGroup3.playlistLoader) {
  77868. mainSegmentLoader.setAudio(true);
  77869. mainSegmentLoader.resetEverything();
  77870. return;
  77871. }
  77872. segmentLoader.setAudio(true);
  77873. mainSegmentLoader.setAudio(false);
  77874. }
  77875. if (previousActiveLoader === activeGroup3.playlistLoader) {
  77876. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77877. return;
  77878. }
  77879. if (segmentLoader.track) {
  77880. segmentLoader.track(activeTrack2);
  77881. }
  77882. segmentLoader.resetEverything();
  77883. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77884. };
  77885. const onError$1 = {
  77886. AUDIO: (type2, settings) => () => {
  77887. const {
  77888. segmentLoaders: {
  77889. [type2]: segmentLoader
  77890. },
  77891. mediaTypes: {
  77892. [type2]: mediaType
  77893. },
  77894. excludePlaylist
  77895. } = settings;
  77896. stopLoaders$1(segmentLoader, mediaType);
  77897. const activeTrack2 = mediaType.activeTrack();
  77898. const activeGroup3 = mediaType.activeGroup();
  77899. const id = (activeGroup3.filter((group) => group.default)[0] || activeGroup3[0]).id;
  77900. const defaultTrack = mediaType.tracks[id];
  77901. if (activeTrack2 === defaultTrack) {
  77902. excludePlaylist({
  77903. error: {
  77904. message: "Problem encountered loading the default audio track."
  77905. }
  77906. });
  77907. return;
  77908. }
  77909. videojs$2.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  77910. for (const trackId in mediaType.tracks) {
  77911. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  77912. }
  77913. mediaType.onTrackChanged();
  77914. },
  77915. SUBTITLES: (type2, settings) => () => {
  77916. const {
  77917. segmentLoaders: {
  77918. [type2]: segmentLoader
  77919. },
  77920. mediaTypes: {
  77921. [type2]: mediaType
  77922. }
  77923. } = settings;
  77924. videojs$2.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  77925. stopLoaders$1(segmentLoader, mediaType);
  77926. const track = mediaType.activeTrack();
  77927. if (track) {
  77928. track.mode = "disabled";
  77929. }
  77930. mediaType.onTrackChanged();
  77931. }
  77932. };
  77933. const setupListeners$1 = {
  77934. AUDIO: (type2, playlistLoader, settings) => {
  77935. if (!playlistLoader) {
  77936. return;
  77937. }
  77938. const {
  77939. tech,
  77940. requestOptions,
  77941. segmentLoaders: {
  77942. [type2]: segmentLoader
  77943. }
  77944. } = settings;
  77945. playlistLoader.on("loadedmetadata", () => {
  77946. const media = playlistLoader.media();
  77947. segmentLoader.playlist(media, requestOptions);
  77948. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  77949. segmentLoader.load();
  77950. }
  77951. });
  77952. playlistLoader.on("loadedplaylist", () => {
  77953. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  77954. if (!tech.paused()) {
  77955. segmentLoader.load();
  77956. }
  77957. });
  77958. playlistLoader.on("error", onError$1[type2](type2, settings));
  77959. },
  77960. SUBTITLES: (type2, playlistLoader, settings) => {
  77961. const {
  77962. tech,
  77963. requestOptions,
  77964. segmentLoaders: {
  77965. [type2]: segmentLoader
  77966. },
  77967. mediaTypes: {
  77968. [type2]: mediaType
  77969. }
  77970. } = settings;
  77971. playlistLoader.on("loadedmetadata", () => {
  77972. const media = playlistLoader.media();
  77973. segmentLoader.playlist(media, requestOptions);
  77974. segmentLoader.track(mediaType.activeTrack());
  77975. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  77976. segmentLoader.load();
  77977. }
  77978. });
  77979. playlistLoader.on("loadedplaylist", () => {
  77980. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  77981. if (!tech.paused()) {
  77982. segmentLoader.load();
  77983. }
  77984. });
  77985. playlistLoader.on("error", onError$1[type2](type2, settings));
  77986. }
  77987. };
  77988. const initialize$1 = {
  77989. "AUDIO": (type2, settings) => {
  77990. const {
  77991. vhs,
  77992. sourceType,
  77993. segmentLoaders: {
  77994. [type2]: segmentLoader
  77995. },
  77996. requestOptions,
  77997. main: {
  77998. mediaGroups
  77999. },
  78000. mediaTypes: {
  78001. [type2]: {
  78002. groups,
  78003. tracks,
  78004. logger_
  78005. }
  78006. },
  78007. mainPlaylistLoader
  78008. } = settings;
  78009. const audioOnlyMain = isAudioOnly$1(mainPlaylistLoader.main);
  78010. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  78011. mediaGroups[type2] = {
  78012. main: {
  78013. default: {
  78014. default: true
  78015. }
  78016. }
  78017. };
  78018. if (audioOnlyMain) {
  78019. mediaGroups[type2].main.default.playlists = mainPlaylistLoader.main.playlists;
  78020. }
  78021. }
  78022. for (const groupId in mediaGroups[type2]) {
  78023. if (!groups[groupId]) {
  78024. groups[groupId] = [];
  78025. }
  78026. for (const variantLabel in mediaGroups[type2][groupId]) {
  78027. let properties = mediaGroups[type2][groupId][variantLabel];
  78028. let playlistLoader;
  78029. if (audioOnlyMain) {
  78030. logger_(`AUDIO group '${groupId}' label '${variantLabel}' is a main playlist`);
  78031. properties.isMainPlaylist = true;
  78032. playlistLoader = null;
  78033. } else if (sourceType === "vhs-json" && properties.playlists) {
  78034. playlistLoader = new PlaylistLoader$1(properties.playlists[0], vhs, requestOptions);
  78035. } else if (properties.resolvedUri) {
  78036. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78037. } else if (properties.playlists && sourceType === "dash") {
  78038. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78039. } else {
  78040. playlistLoader = null;
  78041. }
  78042. properties = merge$2({
  78043. id: variantLabel,
  78044. playlistLoader
  78045. }, properties);
  78046. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78047. groups[groupId].push(properties);
  78048. if (typeof tracks[variantLabel] === "undefined") {
  78049. const track = new videojs$2.AudioTrack({
  78050. id: variantLabel,
  78051. kind: audioTrackKind_$1(properties),
  78052. enabled: false,
  78053. language: properties.language,
  78054. default: properties.default,
  78055. label: variantLabel
  78056. });
  78057. tracks[variantLabel] = track;
  78058. }
  78059. }
  78060. }
  78061. segmentLoader.on("error", onError$1[type2](type2, settings));
  78062. },
  78063. "SUBTITLES": (type2, settings) => {
  78064. const {
  78065. tech,
  78066. vhs,
  78067. sourceType,
  78068. segmentLoaders: {
  78069. [type2]: segmentLoader
  78070. },
  78071. requestOptions,
  78072. main: {
  78073. mediaGroups
  78074. },
  78075. mediaTypes: {
  78076. [type2]: {
  78077. groups,
  78078. tracks
  78079. }
  78080. },
  78081. mainPlaylistLoader
  78082. } = settings;
  78083. for (const groupId in mediaGroups[type2]) {
  78084. if (!groups[groupId]) {
  78085. groups[groupId] = [];
  78086. }
  78087. for (const variantLabel in mediaGroups[type2][groupId]) {
  78088. if (mediaGroups[type2][groupId][variantLabel].forced) {
  78089. continue;
  78090. }
  78091. let properties = mediaGroups[type2][groupId][variantLabel];
  78092. let playlistLoader;
  78093. if (sourceType === "hls") {
  78094. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78095. } else if (sourceType === "dash") {
  78096. const playlists = properties.playlists.filter((p) => p.excludeUntil !== Infinity);
  78097. if (!playlists.length) {
  78098. return;
  78099. }
  78100. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78101. } else if (sourceType === "vhs-json") {
  78102. playlistLoader = new PlaylistLoader$1(
  78103. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  78104. vhs,
  78105. requestOptions
  78106. );
  78107. }
  78108. properties = merge$2({
  78109. id: variantLabel,
  78110. playlistLoader
  78111. }, properties);
  78112. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78113. groups[groupId].push(properties);
  78114. if (typeof tracks[variantLabel] === "undefined") {
  78115. const track = tech.addRemoteTextTrack({
  78116. id: variantLabel,
  78117. kind: "subtitles",
  78118. default: properties.default && properties.autoselect,
  78119. language: properties.language,
  78120. label: variantLabel
  78121. }, false).track;
  78122. tracks[variantLabel] = track;
  78123. }
  78124. }
  78125. }
  78126. segmentLoader.on("error", onError$1[type2](type2, settings));
  78127. },
  78128. "CLOSED-CAPTIONS": (type2, settings) => {
  78129. const {
  78130. tech,
  78131. main: {
  78132. mediaGroups
  78133. },
  78134. mediaTypes: {
  78135. [type2]: {
  78136. groups,
  78137. tracks
  78138. }
  78139. }
  78140. } = settings;
  78141. for (const groupId in mediaGroups[type2]) {
  78142. if (!groups[groupId]) {
  78143. groups[groupId] = [];
  78144. }
  78145. for (const variantLabel in mediaGroups[type2][groupId]) {
  78146. const properties = mediaGroups[type2][groupId][variantLabel];
  78147. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  78148. continue;
  78149. }
  78150. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  78151. let newProps = {
  78152. label: variantLabel,
  78153. language: properties.language,
  78154. instreamId: properties.instreamId,
  78155. default: properties.default && properties.autoselect
  78156. };
  78157. if (captionServices[newProps.instreamId]) {
  78158. newProps = merge$2(newProps, captionServices[newProps.instreamId]);
  78159. }
  78160. if (newProps.default === void 0) {
  78161. delete newProps.default;
  78162. }
  78163. groups[groupId].push(merge$2({
  78164. id: variantLabel
  78165. }, properties));
  78166. if (typeof tracks[variantLabel] === "undefined") {
  78167. const track = tech.addRemoteTextTrack({
  78168. id: newProps.instreamId,
  78169. kind: "captions",
  78170. default: newProps.default,
  78171. language: newProps.language,
  78172. label: newProps.label
  78173. }, false).track;
  78174. tracks[variantLabel] = track;
  78175. }
  78176. }
  78177. }
  78178. }
  78179. };
  78180. const groupMatch$1 = (list, media) => {
  78181. for (let i2 = 0; i2 < list.length; i2++) {
  78182. if (playlistMatch$1(media, list[i2])) {
  78183. return true;
  78184. }
  78185. if (list[i2].playlists && groupMatch$1(list[i2].playlists, media)) {
  78186. return true;
  78187. }
  78188. }
  78189. return false;
  78190. };
  78191. const activeGroup$1 = (type2, settings) => (track) => {
  78192. const {
  78193. mainPlaylistLoader,
  78194. mediaTypes: {
  78195. [type2]: {
  78196. groups
  78197. }
  78198. }
  78199. } = settings;
  78200. const media = mainPlaylistLoader.media();
  78201. if (!media) {
  78202. return null;
  78203. }
  78204. let variants = null;
  78205. if (media.attributes[type2]) {
  78206. variants = groups[media.attributes[type2]];
  78207. }
  78208. const groupKeys = Object.keys(groups);
  78209. if (!variants) {
  78210. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly$1(settings.main)) {
  78211. for (let i2 = 0; i2 < groupKeys.length; i2++) {
  78212. const groupPropertyList = groups[groupKeys[i2]];
  78213. if (groupMatch$1(groupPropertyList, media)) {
  78214. variants = groupPropertyList;
  78215. break;
  78216. }
  78217. }
  78218. } else if (groups.main) {
  78219. variants = groups.main;
  78220. } else if (groupKeys.length === 1) {
  78221. variants = groups[groupKeys[0]];
  78222. }
  78223. }
  78224. if (typeof track === "undefined") {
  78225. return variants;
  78226. }
  78227. if (track === null || !variants) {
  78228. return null;
  78229. }
  78230. return variants.filter((props) => props.id === track.id)[0] || null;
  78231. };
  78232. const activeTrack$1 = {
  78233. AUDIO: (type2, settings) => () => {
  78234. const {
  78235. mediaTypes: {
  78236. [type2]: {
  78237. tracks
  78238. }
  78239. }
  78240. } = settings;
  78241. for (const id in tracks) {
  78242. if (tracks[id].enabled) {
  78243. return tracks[id];
  78244. }
  78245. }
  78246. return null;
  78247. },
  78248. SUBTITLES: (type2, settings) => () => {
  78249. const {
  78250. mediaTypes: {
  78251. [type2]: {
  78252. tracks
  78253. }
  78254. }
  78255. } = settings;
  78256. for (const id in tracks) {
  78257. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  78258. return tracks[id];
  78259. }
  78260. }
  78261. return null;
  78262. }
  78263. };
  78264. const getActiveGroup$1 = (type2, {
  78265. mediaTypes: mediaTypes2
  78266. }) => () => {
  78267. const activeTrack_ = mediaTypes2[type2].activeTrack();
  78268. if (!activeTrack_) {
  78269. return null;
  78270. }
  78271. return mediaTypes2[type2].activeGroup(activeTrack_);
  78272. };
  78273. const setupMediaGroups$1 = (settings) => {
  78274. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78275. initialize$1[type2](type2, settings);
  78276. });
  78277. const {
  78278. mediaTypes: mediaTypes2,
  78279. mainPlaylistLoader,
  78280. tech,
  78281. vhs,
  78282. segmentLoaders: {
  78283. ["AUDIO"]: audioSegmentLoader,
  78284. main: mainSegmentLoader
  78285. }
  78286. } = settings;
  78287. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  78288. mediaTypes2[type2].activeGroup = activeGroup$1(type2, settings);
  78289. mediaTypes2[type2].activeTrack = activeTrack$1[type2](type2, settings);
  78290. mediaTypes2[type2].onGroupChanged = onGroupChanged$1(type2, settings);
  78291. mediaTypes2[type2].onGroupChanging = onGroupChanging$1(type2, settings);
  78292. mediaTypes2[type2].onTrackChanged = onTrackChanged$1(type2, settings);
  78293. mediaTypes2[type2].getActiveGroup = getActiveGroup$1(type2, settings);
  78294. });
  78295. const audioGroup = mediaTypes2.AUDIO.activeGroup();
  78296. if (audioGroup) {
  78297. const groupId = (audioGroup.filter((group) => group.default)[0] || audioGroup[0]).id;
  78298. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  78299. mediaTypes2.AUDIO.onGroupChanged();
  78300. mediaTypes2.AUDIO.onTrackChanged();
  78301. const activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  78302. if (!activeAudioGroup.playlistLoader) {
  78303. mainSegmentLoader.setAudio(true);
  78304. } else {
  78305. mainSegmentLoader.setAudio(false);
  78306. audioSegmentLoader.setAudio(true);
  78307. }
  78308. }
  78309. mainPlaylistLoader.on("mediachange", () => {
  78310. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanged());
  78311. });
  78312. mainPlaylistLoader.on("mediachanging", () => {
  78313. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanging());
  78314. });
  78315. const onAudioTrackChanged = () => {
  78316. mediaTypes2.AUDIO.onTrackChanged();
  78317. tech.trigger({
  78318. type: "usage",
  78319. name: "vhs-audio-change"
  78320. });
  78321. };
  78322. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  78323. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78324. vhs.on("dispose", () => {
  78325. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  78326. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78327. });
  78328. tech.clearTracks("audio");
  78329. for (const id in mediaTypes2.AUDIO.tracks) {
  78330. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  78331. }
  78332. };
  78333. const createMediaTypes$1 = () => {
  78334. const mediaTypes2 = {};
  78335. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78336. mediaTypes2[type2] = {
  78337. groups: {},
  78338. tracks: {},
  78339. activePlaylistLoader: null,
  78340. activeGroup: noop$1,
  78341. activeTrack: noop$1,
  78342. getActiveGroup: noop$1,
  78343. onGroupChanged: noop$1,
  78344. onTrackChanged: noop$1,
  78345. lastTrack_: null,
  78346. logger_: logger$1(`MediaGroups[${type2}]`)
  78347. };
  78348. });
  78349. return mediaTypes2;
  78350. };
  78351. const ABORT_EARLY_EXCLUSION_SECONDS = 60 * 2;
  78352. let Vhs$1$1;
  78353. const loaderStats$1 = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  78354. const sumLoaderStat$1 = function(stat) {
  78355. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  78356. };
  78357. const shouldSwitchToMedia$1 = function({
  78358. currentPlaylist,
  78359. buffered,
  78360. currentTime,
  78361. nextPlaylist,
  78362. bufferLowWaterLine,
  78363. bufferHighWaterLine,
  78364. duration: duration5,
  78365. bufferBasedABR,
  78366. log: log2
  78367. }) {
  78368. if (!nextPlaylist) {
  78369. videojs$2.log.warn("We received no playlist to switch to. Please check your stream.");
  78370. return false;
  78371. }
  78372. const sharedLogLine = `allowing switch ${currentPlaylist && currentPlaylist.id || "null"} -> ${nextPlaylist.id}`;
  78373. if (!currentPlaylist) {
  78374. log2(`${sharedLogLine} as current playlist is not set`);
  78375. return true;
  78376. }
  78377. if (nextPlaylist.id === currentPlaylist.id) {
  78378. return false;
  78379. }
  78380. const isBuffered = Boolean(findRange$1(buffered, currentTime).length);
  78381. if (!currentPlaylist.endList) {
  78382. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  78383. log2(`not ${sharedLogLine} as current playlist is live llhls, but currentTime isn't in buffered.`);
  78384. return false;
  78385. }
  78386. log2(`${sharedLogLine} as current playlist is live`);
  78387. return true;
  78388. }
  78389. const forwardBuffer = timeAheadOf$1(buffered, currentTime);
  78390. const maxBufferLowWaterLine = bufferBasedABR ? Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config$1.MAX_BUFFER_LOW_WATER_LINE;
  78391. if (duration5 < maxBufferLowWaterLine) {
  78392. log2(`${sharedLogLine} as duration < max low water line (${duration5} < ${maxBufferLowWaterLine})`);
  78393. return true;
  78394. }
  78395. const nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  78396. const currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  78397. if (nextBandwidth < currBandwidth && (!bufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  78398. let logLine = `${sharedLogLine} as next bandwidth < current bandwidth (${nextBandwidth} < ${currBandwidth})`;
  78399. if (bufferBasedABR) {
  78400. logLine += ` and forwardBuffer < bufferHighWaterLine (${forwardBuffer} < ${bufferHighWaterLine})`;
  78401. }
  78402. log2(logLine);
  78403. return true;
  78404. }
  78405. if ((!bufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  78406. let logLine = `${sharedLogLine} as forwardBuffer >= bufferLowWaterLine (${forwardBuffer} >= ${bufferLowWaterLine})`;
  78407. if (bufferBasedABR) {
  78408. logLine += ` and next bandwidth > current bandwidth (${nextBandwidth} > ${currBandwidth})`;
  78409. }
  78410. log2(logLine);
  78411. return true;
  78412. }
  78413. log2(`not ${sharedLogLine} as no switching criteria met`);
  78414. return false;
  78415. };
  78416. class PlaylistController extends videojs$2.EventTarget {
  78417. constructor(options2) {
  78418. super();
  78419. const {
  78420. src,
  78421. withCredentials,
  78422. tech,
  78423. bandwidth: bandwidth2,
  78424. externVhs,
  78425. useCueTags,
  78426. playlistExclusionDuration,
  78427. enableLowInitialPlaylist,
  78428. sourceType,
  78429. cacheEncryptionKeys,
  78430. bufferBasedABR,
  78431. leastPixelDiffSelector,
  78432. captionServices
  78433. } = options2;
  78434. if (!src) {
  78435. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  78436. }
  78437. let {
  78438. maxPlaylistRetries
  78439. } = options2;
  78440. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  78441. maxPlaylistRetries = Infinity;
  78442. }
  78443. Vhs$1$1 = externVhs;
  78444. this.bufferBasedABR = Boolean(bufferBasedABR);
  78445. this.leastPixelDiffSelector = Boolean(leastPixelDiffSelector);
  78446. this.withCredentials = withCredentials;
  78447. this.tech_ = tech;
  78448. this.vhs_ = tech.vhs;
  78449. this.sourceType_ = sourceType;
  78450. this.useCueTags_ = useCueTags;
  78451. this.playlistExclusionDuration = playlistExclusionDuration;
  78452. this.maxPlaylistRetries = maxPlaylistRetries;
  78453. this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  78454. if (this.useCueTags_) {
  78455. this.cueTagsTrack_ = this.tech_.addTextTrack("metadata", "ad-cues");
  78456. this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  78457. }
  78458. this.requestOptions_ = {
  78459. withCredentials,
  78460. maxPlaylistRetries,
  78461. timeout: null
  78462. };
  78463. this.on("error", this.pauseLoading);
  78464. this.mediaTypes_ = createMediaTypes$1();
  78465. this.mediaSource = new window_1.MediaSource();
  78466. this.handleDurationChange_ = this.handleDurationChange_.bind(this);
  78467. this.handleSourceOpen_ = this.handleSourceOpen_.bind(this);
  78468. this.handleSourceEnded_ = this.handleSourceEnded_.bind(this);
  78469. this.mediaSource.addEventListener("durationchange", this.handleDurationChange_);
  78470. this.mediaSource.addEventListener("sourceopen", this.handleSourceOpen_);
  78471. this.mediaSource.addEventListener("sourceended", this.handleSourceEnded_);
  78472. this.seekable_ = createTimeRanges$2();
  78473. this.hasPlayed_ = false;
  78474. this.syncController_ = new SyncController$1(options2);
  78475. this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  78476. kind: "metadata",
  78477. label: "segment-metadata"
  78478. }, false).track;
  78479. this.decrypter_ = new Decrypter$1();
  78480. this.sourceUpdater_ = new SourceUpdater$1(this.mediaSource);
  78481. this.inbandTextTracks_ = {};
  78482. this.timelineChangeController_ = new TimelineChangeController$1();
  78483. const segmentLoaderSettings = {
  78484. vhs: this.vhs_,
  78485. parse708captions: options2.parse708captions,
  78486. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  78487. captionServices,
  78488. mediaSource: this.mediaSource,
  78489. currentTime: this.tech_.currentTime.bind(this.tech_),
  78490. seekable: () => this.seekable(),
  78491. seeking: () => this.tech_.seeking(),
  78492. duration: () => this.duration(),
  78493. hasPlayed: () => this.hasPlayed_,
  78494. goalBufferLength: () => this.goalBufferLength(),
  78495. bandwidth: bandwidth2,
  78496. syncController: this.syncController_,
  78497. decrypter: this.decrypter_,
  78498. sourceType: this.sourceType_,
  78499. inbandTextTracks: this.inbandTextTracks_,
  78500. cacheEncryptionKeys,
  78501. sourceUpdater: this.sourceUpdater_,
  78502. timelineChangeController: this.timelineChangeController_,
  78503. exactManifestTimings: options2.exactManifestTimings
  78504. };
  78505. this.mainPlaylistLoader_ = this.sourceType_ === "dash" ? new DashPlaylistLoader$1(src, this.vhs_, this.requestOptions_) : new PlaylistLoader$1(src, this.vhs_, this.requestOptions_);
  78506. this.setupMainPlaylistLoaderListeners_();
  78507. this.mainSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78508. segmentMetadataTrack: this.segmentMetadataTrack_,
  78509. loaderType: "main"
  78510. }), options2);
  78511. this.audioSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78512. loaderType: "audio"
  78513. }), options2);
  78514. this.subtitleSegmentLoader_ = new VTTSegmentLoader$1(merge$2(segmentLoaderSettings, {
  78515. loaderType: "vtt",
  78516. featuresNativeTextTracks: this.tech_.featuresNativeTextTracks,
  78517. loadVttJs: () => new Promise((resolve2, reject2) => {
  78518. function onLoad() {
  78519. tech.off("vttjserror", onError2);
  78520. resolve2();
  78521. }
  78522. function onError2() {
  78523. tech.off("vttjsloaded", onLoad);
  78524. reject2();
  78525. }
  78526. tech.one("vttjsloaded", onLoad);
  78527. tech.one("vttjserror", onError2);
  78528. tech.addWebVttScript_();
  78529. })
  78530. }), options2);
  78531. this.setupSegmentLoaderListeners_();
  78532. if (this.bufferBasedABR) {
  78533. this.mainPlaylistLoader_.one("loadedplaylist", () => this.startABRTimer_());
  78534. this.tech_.on("pause", () => this.stopABRTimer_());
  78535. this.tech_.on("play", () => this.startABRTimer_());
  78536. }
  78537. loaderStats$1.forEach((stat) => {
  78538. this[stat + "_"] = sumLoaderStat$1.bind(this, stat);
  78539. });
  78540. this.logger_ = logger$1("pc");
  78541. this.triggeredFmp4Usage = false;
  78542. if (this.tech_.preload() === "none") {
  78543. this.loadOnPlay_ = () => {
  78544. this.loadOnPlay_ = null;
  78545. this.mainPlaylistLoader_.load();
  78546. };
  78547. this.tech_.one("play", this.loadOnPlay_);
  78548. } else {
  78549. this.mainPlaylistLoader_.load();
  78550. }
  78551. this.timeToLoadedData__ = -1;
  78552. this.mainAppendsToLoadedData__ = -1;
  78553. this.audioAppendsToLoadedData__ = -1;
  78554. const event2 = this.tech_.preload() === "none" ? "play" : "loadstart";
  78555. this.tech_.one(event2, () => {
  78556. const timeToLoadedDataStart = Date.now();
  78557. this.tech_.one("loadeddata", () => {
  78558. this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  78559. this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends;
  78560. this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends;
  78561. });
  78562. });
  78563. }
  78564. mainAppendsToLoadedData_() {
  78565. return this.mainAppendsToLoadedData__;
  78566. }
  78567. audioAppendsToLoadedData_() {
  78568. return this.audioAppendsToLoadedData__;
  78569. }
  78570. appendsToLoadedData_() {
  78571. const main = this.mainAppendsToLoadedData_();
  78572. const audio = this.audioAppendsToLoadedData_();
  78573. if (main === -1 || audio === -1) {
  78574. return -1;
  78575. }
  78576. return main + audio;
  78577. }
  78578. timeToLoadedData_() {
  78579. return this.timeToLoadedData__;
  78580. }
  78581. checkABR_(reason = "abr") {
  78582. const nextPlaylist = this.selectPlaylist();
  78583. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  78584. this.switchMedia_(nextPlaylist, reason);
  78585. }
  78586. }
  78587. switchMedia_(playlist, cause, delay) {
  78588. const oldMedia = this.media();
  78589. const oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  78590. const newId = playlist.id || playlist.uri;
  78591. if (oldId && oldId !== newId) {
  78592. this.logger_(`switch media ${oldId} -> ${newId} from ${cause}`);
  78593. this.tech_.trigger({
  78594. type: "usage",
  78595. name: `vhs-rendition-change-${cause}`
  78596. });
  78597. }
  78598. this.mainPlaylistLoader_.media(playlist, delay);
  78599. }
  78600. startABRTimer_() {
  78601. this.stopABRTimer_();
  78602. this.abrTimer_ = window_1.setInterval(() => this.checkABR_(), 250);
  78603. }
  78604. stopABRTimer_() {
  78605. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  78606. return;
  78607. }
  78608. window_1.clearInterval(this.abrTimer_);
  78609. this.abrTimer_ = null;
  78610. }
  78611. getAudioTrackPlaylists_() {
  78612. const main = this.main();
  78613. const defaultPlaylists = main && main.playlists || [];
  78614. if (!main || !main.mediaGroups || !main.mediaGroups.AUDIO) {
  78615. return defaultPlaylists;
  78616. }
  78617. const AUDIO5 = main.mediaGroups.AUDIO;
  78618. const groupKeys = Object.keys(AUDIO5);
  78619. let track;
  78620. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  78621. track = this.mediaTypes_.AUDIO.activeTrack();
  78622. } else {
  78623. const defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  78624. for (const label in defaultGroup) {
  78625. if (defaultGroup[label].default) {
  78626. track = {
  78627. label
  78628. };
  78629. break;
  78630. }
  78631. }
  78632. }
  78633. if (!track) {
  78634. return defaultPlaylists;
  78635. }
  78636. const playlists = [];
  78637. for (const group in AUDIO5) {
  78638. if (AUDIO5[group][track.label]) {
  78639. const properties = AUDIO5[group][track.label];
  78640. if (properties.playlists && properties.playlists.length) {
  78641. playlists.push.apply(playlists, properties.playlists);
  78642. } else if (properties.uri) {
  78643. playlists.push(properties);
  78644. } else if (main.playlists.length) {
  78645. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  78646. const playlist = main.playlists[i2];
  78647. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  78648. playlists.push(playlist);
  78649. }
  78650. }
  78651. }
  78652. }
  78653. }
  78654. if (!playlists.length) {
  78655. return defaultPlaylists;
  78656. }
  78657. return playlists;
  78658. }
  78659. setupMainPlaylistLoaderListeners_() {
  78660. this.mainPlaylistLoader_.on("loadedmetadata", () => {
  78661. const media = this.mainPlaylistLoader_.media();
  78662. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78663. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78664. this.requestOptions_.timeout = 0;
  78665. } else {
  78666. this.requestOptions_.timeout = requestTimeout;
  78667. }
  78668. if (media.endList && this.tech_.preload() !== "none") {
  78669. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78670. this.mainSegmentLoader_.load();
  78671. }
  78672. setupMediaGroups$1({
  78673. sourceType: this.sourceType_,
  78674. segmentLoaders: {
  78675. AUDIO: this.audioSegmentLoader_,
  78676. SUBTITLES: this.subtitleSegmentLoader_,
  78677. main: this.mainSegmentLoader_
  78678. },
  78679. tech: this.tech_,
  78680. requestOptions: this.requestOptions_,
  78681. mainPlaylistLoader: this.mainPlaylistLoader_,
  78682. vhs: this.vhs_,
  78683. main: this.main(),
  78684. mediaTypes: this.mediaTypes_,
  78685. excludePlaylist: this.excludePlaylist.bind(this)
  78686. });
  78687. this.triggerPresenceUsage_(this.main(), media);
  78688. this.setupFirstPlay();
  78689. if (!this.mediaTypes_.AUDIO.activePlaylistLoader || this.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  78690. this.trigger("selectedinitialmedia");
  78691. } else {
  78692. this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", () => {
  78693. this.trigger("selectedinitialmedia");
  78694. });
  78695. }
  78696. });
  78697. this.mainPlaylistLoader_.on("loadedplaylist", () => {
  78698. if (this.loadOnPlay_) {
  78699. this.tech_.off("play", this.loadOnPlay_);
  78700. }
  78701. let updatedPlaylist = this.mainPlaylistLoader_.media();
  78702. if (!updatedPlaylist) {
  78703. this.excludeUnsupportedVariants_();
  78704. let selectedMedia;
  78705. if (this.enableLowInitialPlaylist) {
  78706. selectedMedia = this.selectInitialPlaylist();
  78707. }
  78708. if (!selectedMedia) {
  78709. selectedMedia = this.selectPlaylist();
  78710. }
  78711. if (!selectedMedia || !this.shouldSwitchToMedia_(selectedMedia)) {
  78712. return;
  78713. }
  78714. this.initialMedia_ = selectedMedia;
  78715. this.switchMedia_(this.initialMedia_, "initial");
  78716. const haveJsonSource = this.sourceType_ === "vhs-json" && this.initialMedia_.segments;
  78717. if (!haveJsonSource) {
  78718. return;
  78719. }
  78720. updatedPlaylist = this.initialMedia_;
  78721. }
  78722. this.handleUpdatedMediaPlaylist(updatedPlaylist);
  78723. });
  78724. this.mainPlaylistLoader_.on("error", () => {
  78725. const error = this.mainPlaylistLoader_.error;
  78726. this.excludePlaylist({
  78727. playlistToExclude: error.playlist,
  78728. error
  78729. });
  78730. });
  78731. this.mainPlaylistLoader_.on("mediachanging", () => {
  78732. this.mainSegmentLoader_.abort();
  78733. this.mainSegmentLoader_.pause();
  78734. });
  78735. this.mainPlaylistLoader_.on("mediachange", () => {
  78736. const media = this.mainPlaylistLoader_.media();
  78737. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78738. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78739. this.requestOptions_.timeout = 0;
  78740. } else {
  78741. this.requestOptions_.timeout = requestTimeout;
  78742. }
  78743. this.mainPlaylistLoader_.load();
  78744. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78745. this.mainSegmentLoader_.load();
  78746. this.tech_.trigger({
  78747. type: "mediachange",
  78748. bubbles: true
  78749. });
  78750. });
  78751. this.mainPlaylistLoader_.on("playlistunchanged", () => {
  78752. const updatedPlaylist = this.mainPlaylistLoader_.media();
  78753. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  78754. return;
  78755. }
  78756. const playlistOutdated = this.stuckAtPlaylistEnd_(updatedPlaylist);
  78757. if (playlistOutdated) {
  78758. this.excludePlaylist({
  78759. error: {
  78760. message: "Playlist no longer updating.",
  78761. reason: "playlist-unchanged"
  78762. }
  78763. });
  78764. this.tech_.trigger("playliststuck");
  78765. }
  78766. });
  78767. this.mainPlaylistLoader_.on("renditiondisabled", () => {
  78768. this.tech_.trigger({
  78769. type: "usage",
  78770. name: "vhs-rendition-disabled"
  78771. });
  78772. });
  78773. this.mainPlaylistLoader_.on("renditionenabled", () => {
  78774. this.tech_.trigger({
  78775. type: "usage",
  78776. name: "vhs-rendition-enabled"
  78777. });
  78778. });
  78779. }
  78780. handleUpdatedMediaPlaylist(updatedPlaylist) {
  78781. if (this.useCueTags_) {
  78782. this.updateAdCues_(updatedPlaylist);
  78783. }
  78784. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  78785. this.updateDuration(!updatedPlaylist.endList);
  78786. if (!this.tech_.paused()) {
  78787. this.mainSegmentLoader_.load();
  78788. if (this.audioSegmentLoader_) {
  78789. this.audioSegmentLoader_.load();
  78790. }
  78791. }
  78792. }
  78793. triggerPresenceUsage_(main, media) {
  78794. const mediaGroups = main.mediaGroups || {};
  78795. let defaultDemuxed = true;
  78796. const audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  78797. for (const mediaGroup in mediaGroups.AUDIO) {
  78798. for (const label in mediaGroups.AUDIO[mediaGroup]) {
  78799. const properties = mediaGroups.AUDIO[mediaGroup][label];
  78800. if (!properties.uri) {
  78801. defaultDemuxed = false;
  78802. }
  78803. }
  78804. }
  78805. if (defaultDemuxed) {
  78806. this.tech_.trigger({
  78807. type: "usage",
  78808. name: "vhs-demuxed"
  78809. });
  78810. }
  78811. if (Object.keys(mediaGroups.SUBTITLES).length) {
  78812. this.tech_.trigger({
  78813. type: "usage",
  78814. name: "vhs-webvtt"
  78815. });
  78816. }
  78817. if (Vhs$1$1.Playlist.isAes(media)) {
  78818. this.tech_.trigger({
  78819. type: "usage",
  78820. name: "vhs-aes"
  78821. });
  78822. }
  78823. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  78824. this.tech_.trigger({
  78825. type: "usage",
  78826. name: "vhs-alternate-audio"
  78827. });
  78828. }
  78829. if (this.useCueTags_) {
  78830. this.tech_.trigger({
  78831. type: "usage",
  78832. name: "vhs-playlist-cue-tags"
  78833. });
  78834. }
  78835. }
  78836. shouldSwitchToMedia_(nextPlaylist) {
  78837. const currentPlaylist = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pendingMedia_;
  78838. const currentTime = this.tech_.currentTime();
  78839. const bufferLowWaterLine = this.bufferLowWaterLine();
  78840. const bufferHighWaterLine = this.bufferHighWaterLine();
  78841. const buffered = this.tech_.buffered();
  78842. return shouldSwitchToMedia$1({
  78843. buffered,
  78844. currentTime,
  78845. currentPlaylist,
  78846. nextPlaylist,
  78847. bufferLowWaterLine,
  78848. bufferHighWaterLine,
  78849. duration: this.duration(),
  78850. bufferBasedABR: this.bufferBasedABR,
  78851. log: this.logger_
  78852. });
  78853. }
  78854. setupSegmentLoaderListeners_() {
  78855. this.mainSegmentLoader_.on("bandwidthupdate", () => {
  78856. this.checkABR_("bandwidthupdate");
  78857. this.tech_.trigger("bandwidthupdate");
  78858. });
  78859. this.mainSegmentLoader_.on("timeout", () => {
  78860. if (this.bufferBasedABR) {
  78861. this.mainSegmentLoader_.load();
  78862. }
  78863. });
  78864. if (!this.bufferBasedABR) {
  78865. this.mainSegmentLoader_.on("progress", () => {
  78866. this.trigger("progress");
  78867. });
  78868. }
  78869. this.mainSegmentLoader_.on("error", () => {
  78870. const error = this.mainSegmentLoader_.error();
  78871. this.excludePlaylist({
  78872. playlistToExclude: error.playlist,
  78873. error
  78874. });
  78875. });
  78876. this.mainSegmentLoader_.on("appenderror", () => {
  78877. this.error = this.mainSegmentLoader_.error_;
  78878. this.trigger("error");
  78879. });
  78880. this.mainSegmentLoader_.on("syncinfoupdate", () => {
  78881. this.onSyncInfoUpdate_();
  78882. });
  78883. this.mainSegmentLoader_.on("timestampoffset", () => {
  78884. this.tech_.trigger({
  78885. type: "usage",
  78886. name: "vhs-timestamp-offset"
  78887. });
  78888. });
  78889. this.audioSegmentLoader_.on("syncinfoupdate", () => {
  78890. this.onSyncInfoUpdate_();
  78891. });
  78892. this.audioSegmentLoader_.on("appenderror", () => {
  78893. this.error = this.audioSegmentLoader_.error_;
  78894. this.trigger("error");
  78895. });
  78896. this.mainSegmentLoader_.on("ended", () => {
  78897. this.logger_("main segment loader ended");
  78898. this.onEndOfStream();
  78899. });
  78900. this.mainSegmentLoader_.on("earlyabort", (event2) => {
  78901. if (this.bufferBasedABR) {
  78902. return;
  78903. }
  78904. this.delegateLoaders_("all", ["abort"]);
  78905. this.excludePlaylist({
  78906. error: {
  78907. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  78908. },
  78909. playlistExclusionDuration: ABORT_EARLY_EXCLUSION_SECONDS
  78910. });
  78911. });
  78912. const updateCodecs = () => {
  78913. if (!this.sourceUpdater_.hasCreatedSourceBuffers()) {
  78914. return this.tryToCreateSourceBuffers_();
  78915. }
  78916. const codecs = this.getCodecsOrExclude_();
  78917. if (!codecs) {
  78918. return;
  78919. }
  78920. this.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  78921. };
  78922. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  78923. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  78924. this.mainSegmentLoader_.on("fmp4", () => {
  78925. if (!this.triggeredFmp4Usage) {
  78926. this.tech_.trigger({
  78927. type: "usage",
  78928. name: "vhs-fmp4"
  78929. });
  78930. this.triggeredFmp4Usage = true;
  78931. }
  78932. });
  78933. this.audioSegmentLoader_.on("fmp4", () => {
  78934. if (!this.triggeredFmp4Usage) {
  78935. this.tech_.trigger({
  78936. type: "usage",
  78937. name: "vhs-fmp4"
  78938. });
  78939. this.triggeredFmp4Usage = true;
  78940. }
  78941. });
  78942. this.audioSegmentLoader_.on("ended", () => {
  78943. this.logger_("audioSegmentLoader ended");
  78944. this.onEndOfStream();
  78945. });
  78946. }
  78947. mediaSecondsLoaded_() {
  78948. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  78949. }
  78950. load() {
  78951. this.mainSegmentLoader_.load();
  78952. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  78953. this.audioSegmentLoader_.load();
  78954. }
  78955. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  78956. this.subtitleSegmentLoader_.load();
  78957. }
  78958. }
  78959. fastQualityChange_(media = this.selectPlaylist()) {
  78960. if (media === this.mainPlaylistLoader_.media()) {
  78961. this.logger_("skipping fastQualityChange because new media is same as old");
  78962. return;
  78963. }
  78964. this.switchMedia_(media, "fast-quality");
  78965. this.mainSegmentLoader_.resetEverything(() => {
  78966. if (videojs$2.browser.IE_VERSION || videojs$2.browser.IS_EDGE) {
  78967. this.tech_.setCurrentTime(this.tech_.currentTime() + 0.04);
  78968. } else {
  78969. this.tech_.setCurrentTime(this.tech_.currentTime());
  78970. }
  78971. });
  78972. }
  78973. play() {
  78974. if (this.setupFirstPlay()) {
  78975. return;
  78976. }
  78977. if (this.tech_.ended()) {
  78978. this.tech_.setCurrentTime(0);
  78979. }
  78980. if (this.hasPlayed_) {
  78981. this.load();
  78982. }
  78983. const seekable3 = this.tech_.seekable();
  78984. if (this.tech_.duration() === Infinity) {
  78985. if (this.tech_.currentTime() < seekable3.start(0)) {
  78986. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  78987. }
  78988. }
  78989. }
  78990. setupFirstPlay() {
  78991. const media = this.mainPlaylistLoader_.media();
  78992. if (!media || this.tech_.paused() || this.hasPlayed_) {
  78993. return false;
  78994. }
  78995. if (!media.endList) {
  78996. const seekable3 = this.seekable();
  78997. if (!seekable3.length) {
  78998. return false;
  78999. }
  79000. if (videojs$2.browser.IE_VERSION && this.tech_.readyState() === 0) {
  79001. this.tech_.one("loadedmetadata", () => {
  79002. this.trigger("firstplay");
  79003. this.tech_.setCurrentTime(seekable3.end(0));
  79004. this.hasPlayed_ = true;
  79005. });
  79006. return false;
  79007. }
  79008. this.trigger("firstplay");
  79009. this.tech_.setCurrentTime(seekable3.end(0));
  79010. }
  79011. this.hasPlayed_ = true;
  79012. this.load();
  79013. return true;
  79014. }
  79015. handleSourceOpen_() {
  79016. this.tryToCreateSourceBuffers_();
  79017. if (this.tech_.autoplay()) {
  79018. const playPromise = this.tech_.play();
  79019. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  79020. playPromise.then(null, (e) => {
  79021. });
  79022. }
  79023. }
  79024. this.trigger("sourceopen");
  79025. }
  79026. handleSourceEnded_() {
  79027. if (!this.inbandTextTracks_.metadataTrack_) {
  79028. return;
  79029. }
  79030. const cues = this.inbandTextTracks_.metadataTrack_.cues;
  79031. if (!cues || !cues.length) {
  79032. return;
  79033. }
  79034. const duration5 = this.duration();
  79035. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  79036. }
  79037. handleDurationChange_() {
  79038. this.tech_.trigger("durationchange");
  79039. }
  79040. onEndOfStream() {
  79041. let isEndOfStream = this.mainSegmentLoader_.ended_;
  79042. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79043. const mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  79044. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  79045. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  79046. } else {
  79047. isEndOfStream = this.audioSegmentLoader_.ended_;
  79048. }
  79049. }
  79050. if (!isEndOfStream) {
  79051. return;
  79052. }
  79053. this.stopABRTimer_();
  79054. this.sourceUpdater_.endOfStream();
  79055. }
  79056. stuckAtPlaylistEnd_(playlist) {
  79057. const seekable3 = this.seekable();
  79058. if (!seekable3.length) {
  79059. return false;
  79060. }
  79061. const expired = this.syncController_.getExpiredTime(playlist, this.duration());
  79062. if (expired === null) {
  79063. return false;
  79064. }
  79065. const absolutePlaylistEnd = Vhs$1$1.Playlist.playlistEnd(playlist, expired);
  79066. const currentTime = this.tech_.currentTime();
  79067. const buffered = this.tech_.buffered();
  79068. if (!buffered.length) {
  79069. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA$1;
  79070. }
  79071. const bufferedEnd = buffered.end(buffered.length - 1);
  79072. return bufferedEnd - currentTime <= SAFE_TIME_DELTA$1 && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA$1;
  79073. }
  79074. excludePlaylist({
  79075. playlistToExclude = this.mainPlaylistLoader_.media(),
  79076. error = {},
  79077. playlistExclusionDuration
  79078. }) {
  79079. playlistToExclude = playlistToExclude || this.mainPlaylistLoader_.media();
  79080. playlistExclusionDuration = playlistExclusionDuration || error.playlistExclusionDuration || this.playlistExclusionDuration;
  79081. if (!playlistToExclude) {
  79082. this.error = error;
  79083. if (this.mediaSource.readyState !== "open") {
  79084. this.trigger("error");
  79085. } else {
  79086. this.sourceUpdater_.endOfStream("network");
  79087. }
  79088. return;
  79089. }
  79090. playlistToExclude.playlistErrors_++;
  79091. const playlists = this.mainPlaylistLoader_.main.playlists;
  79092. const enabledPlaylists = playlists.filter(isEnabled$1);
  79093. const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude;
  79094. if (playlists.length === 1 && playlistExclusionDuration !== Infinity) {
  79095. videojs$2.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. Trying again since it is the only playlist.`);
  79096. this.tech_.trigger("retryplaylist");
  79097. return this.mainPlaylistLoader_.load(isFinalRendition);
  79098. }
  79099. if (isFinalRendition) {
  79100. let reincluded = false;
  79101. playlists.forEach((playlist) => {
  79102. if (playlist === playlistToExclude) {
  79103. return;
  79104. }
  79105. const excludeUntil2 = playlist.excludeUntil;
  79106. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  79107. reincluded = true;
  79108. delete playlist.excludeUntil;
  79109. }
  79110. });
  79111. if (reincluded) {
  79112. videojs$2.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  79113. this.tech_.trigger("retryplaylist");
  79114. }
  79115. }
  79116. let excludeUntil;
  79117. if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) {
  79118. excludeUntil = Infinity;
  79119. } else {
  79120. excludeUntil = Date.now() + playlistExclusionDuration * 1e3;
  79121. }
  79122. playlistToExclude.excludeUntil = excludeUntil;
  79123. if (error.reason) {
  79124. playlistToExclude.lastExcludeReason_ = error.reason;
  79125. }
  79126. this.tech_.trigger("excludeplaylist");
  79127. this.tech_.trigger({
  79128. type: "usage",
  79129. name: "vhs-rendition-excluded"
  79130. });
  79131. const nextPlaylist = this.selectPlaylist();
  79132. if (!nextPlaylist) {
  79133. this.error = "Playback cannot continue. No available working or supported playlists.";
  79134. this.trigger("error");
  79135. return;
  79136. }
  79137. const logFn2 = error.internal ? this.logger_ : videojs$2.log.warn;
  79138. const errorMessage = error.message ? " " + error.message : "";
  79139. logFn2(`${error.internal ? "Internal problem" : "Problem"} encountered with playlist ${playlistToExclude.id}.${errorMessage} Switching to playlist ${nextPlaylist.id}.`);
  79140. if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) {
  79141. this.delegateLoaders_("audio", ["abort", "pause"]);
  79142. }
  79143. if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) {
  79144. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  79145. }
  79146. this.delegateLoaders_("main", ["abort", "pause"]);
  79147. const delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  79148. const shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  79149. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  79150. }
  79151. pauseLoading() {
  79152. this.delegateLoaders_("all", ["abort", "pause"]);
  79153. this.stopABRTimer_();
  79154. }
  79155. delegateLoaders_(filter, fnNames) {
  79156. const loaders = [];
  79157. const dontFilterPlaylist = filter === "all";
  79158. if (dontFilterPlaylist || filter === "main") {
  79159. loaders.push(this.mainPlaylistLoader_);
  79160. }
  79161. const mediaTypes2 = [];
  79162. if (dontFilterPlaylist || filter === "audio") {
  79163. mediaTypes2.push("AUDIO");
  79164. }
  79165. if (dontFilterPlaylist || filter === "subtitle") {
  79166. mediaTypes2.push("CLOSED-CAPTIONS");
  79167. mediaTypes2.push("SUBTITLES");
  79168. }
  79169. mediaTypes2.forEach((mediaType) => {
  79170. const loader = this.mediaTypes_[mediaType] && this.mediaTypes_[mediaType].activePlaylistLoader;
  79171. if (loader) {
  79172. loaders.push(loader);
  79173. }
  79174. });
  79175. ["main", "audio", "subtitle"].forEach((name) => {
  79176. const loader = this[`${name}SegmentLoader_`];
  79177. if (loader && (filter === name || filter === "all")) {
  79178. loaders.push(loader);
  79179. }
  79180. });
  79181. loaders.forEach((loader) => fnNames.forEach((fnName) => {
  79182. if (typeof loader[fnName] === "function") {
  79183. loader[fnName]();
  79184. }
  79185. }));
  79186. }
  79187. setCurrentTime(currentTime) {
  79188. const buffered = findRange$1(this.tech_.buffered(), currentTime);
  79189. if (!(this.mainPlaylistLoader_ && this.mainPlaylistLoader_.media())) {
  79190. return 0;
  79191. }
  79192. if (!this.mainPlaylistLoader_.media().segments) {
  79193. return 0;
  79194. }
  79195. if (buffered && buffered.length) {
  79196. return currentTime;
  79197. }
  79198. this.mainSegmentLoader_.resetEverything();
  79199. this.mainSegmentLoader_.abort();
  79200. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79201. this.audioSegmentLoader_.resetEverything();
  79202. this.audioSegmentLoader_.abort();
  79203. }
  79204. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  79205. this.subtitleSegmentLoader_.resetEverything();
  79206. this.subtitleSegmentLoader_.abort();
  79207. }
  79208. this.load();
  79209. }
  79210. duration() {
  79211. if (!this.mainPlaylistLoader_) {
  79212. return 0;
  79213. }
  79214. const media = this.mainPlaylistLoader_.media();
  79215. if (!media) {
  79216. return 0;
  79217. }
  79218. if (!media.endList) {
  79219. return Infinity;
  79220. }
  79221. if (this.mediaSource) {
  79222. return this.mediaSource.duration;
  79223. }
  79224. return Vhs$1$1.Playlist.duration(media);
  79225. }
  79226. seekable() {
  79227. return this.seekable_;
  79228. }
  79229. onSyncInfoUpdate_() {
  79230. let audioSeekable;
  79231. if (!this.mainPlaylistLoader_) {
  79232. return;
  79233. }
  79234. let media = this.mainPlaylistLoader_.media();
  79235. if (!media) {
  79236. return;
  79237. }
  79238. let expired = this.syncController_.getExpiredTime(media, this.duration());
  79239. if (expired === null) {
  79240. return;
  79241. }
  79242. const main = this.mainPlaylistLoader_.main;
  79243. const mainSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79244. if (mainSeekable.length === 0) {
  79245. return;
  79246. }
  79247. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79248. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  79249. expired = this.syncController_.getExpiredTime(media, this.duration());
  79250. if (expired === null) {
  79251. return;
  79252. }
  79253. audioSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79254. if (audioSeekable.length === 0) {
  79255. return;
  79256. }
  79257. }
  79258. let oldEnd;
  79259. let oldStart;
  79260. if (this.seekable_ && this.seekable_.length) {
  79261. oldEnd = this.seekable_.end(0);
  79262. oldStart = this.seekable_.start(0);
  79263. }
  79264. if (!audioSeekable) {
  79265. this.seekable_ = mainSeekable;
  79266. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  79267. this.seekable_ = mainSeekable;
  79268. } else {
  79269. this.seekable_ = createTimeRanges$2([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  79270. }
  79271. if (this.seekable_ && this.seekable_.length) {
  79272. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  79273. return;
  79274. }
  79275. }
  79276. this.logger_(`seekable updated [${printableRange$1(this.seekable_)}]`);
  79277. this.tech_.trigger("seekablechanged");
  79278. }
  79279. updateDuration(isLive) {
  79280. if (this.updateDuration_) {
  79281. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79282. this.updateDuration_ = null;
  79283. }
  79284. if (this.mediaSource.readyState !== "open") {
  79285. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  79286. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  79287. return;
  79288. }
  79289. if (isLive) {
  79290. const seekable3 = this.seekable();
  79291. if (!seekable3.length) {
  79292. return;
  79293. }
  79294. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  79295. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  79296. }
  79297. return;
  79298. }
  79299. const buffered = this.tech_.buffered();
  79300. let duration5 = Vhs$1$1.Playlist.duration(this.mainPlaylistLoader_.media());
  79301. if (buffered.length > 0) {
  79302. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  79303. }
  79304. if (this.mediaSource.duration !== duration5) {
  79305. this.sourceUpdater_.setDuration(duration5);
  79306. }
  79307. }
  79308. dispose() {
  79309. this.trigger("dispose");
  79310. this.decrypter_.terminate();
  79311. this.mainPlaylistLoader_.dispose();
  79312. this.mainSegmentLoader_.dispose();
  79313. if (this.loadOnPlay_) {
  79314. this.tech_.off("play", this.loadOnPlay_);
  79315. }
  79316. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  79317. const groups = this.mediaTypes_[type2].groups;
  79318. for (const id in groups) {
  79319. groups[id].forEach((group) => {
  79320. if (group.playlistLoader) {
  79321. group.playlistLoader.dispose();
  79322. }
  79323. });
  79324. }
  79325. });
  79326. this.audioSegmentLoader_.dispose();
  79327. this.subtitleSegmentLoader_.dispose();
  79328. this.sourceUpdater_.dispose();
  79329. this.timelineChangeController_.dispose();
  79330. this.stopABRTimer_();
  79331. if (this.updateDuration_) {
  79332. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79333. }
  79334. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  79335. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  79336. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  79337. this.off();
  79338. }
  79339. main() {
  79340. return this.mainPlaylistLoader_.main;
  79341. }
  79342. media() {
  79343. return this.mainPlaylistLoader_.media() || this.initialMedia_;
  79344. }
  79345. areMediaTypesKnown_() {
  79346. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79347. const hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  79348. const hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  79349. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  79350. return false;
  79351. }
  79352. return true;
  79353. }
  79354. getCodecsOrExclude_() {
  79355. const media = {
  79356. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  79357. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  79358. };
  79359. const playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  79360. media.video = media.main;
  79361. const playlistCodecs = codecsForPlaylist$1(this.main(), playlist);
  79362. const codecs = {};
  79363. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79364. if (media.main.hasVideo) {
  79365. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC$1;
  79366. }
  79367. if (media.main.isMuxed) {
  79368. codecs.video += `,${playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC$1}`;
  79369. }
  79370. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  79371. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC$1;
  79372. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  79373. }
  79374. if (!codecs.audio && !codecs.video) {
  79375. this.excludePlaylist({
  79376. playlistToExclude: playlist,
  79377. error: {
  79378. message: "Could not determine codecs for playlist."
  79379. },
  79380. playlistExclusionDuration: Infinity
  79381. });
  79382. return;
  79383. }
  79384. const supportFunction = (isFmp4, codec) => isFmp4 ? browserSupportsCodec$1(codec) : muxerSupportsCodec$1(codec);
  79385. const unsupportedCodecs = {};
  79386. let unsupportedAudio;
  79387. ["video", "audio"].forEach(function(type2) {
  79388. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  79389. const supporter = media[type2].isFmp4 ? "browser" : "muxer";
  79390. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  79391. unsupportedCodecs[supporter].push(codecs[type2]);
  79392. if (type2 === "audio") {
  79393. unsupportedAudio = supporter;
  79394. }
  79395. }
  79396. });
  79397. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  79398. const audioGroup = playlist.attributes.AUDIO;
  79399. this.main().playlists.forEach((variant) => {
  79400. const variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  79401. if (variantAudioGroup === audioGroup && variant !== playlist) {
  79402. variant.excludeUntil = Infinity;
  79403. }
  79404. });
  79405. this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): "${codecs.audio}"`);
  79406. }
  79407. if (Object.keys(unsupportedCodecs).length) {
  79408. const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => {
  79409. if (acc) {
  79410. acc += ", ";
  79411. }
  79412. acc += `${supporter} does not support codec(s): "${unsupportedCodecs[supporter].join(",")}"`;
  79413. return acc;
  79414. }, "") + ".";
  79415. this.excludePlaylist({
  79416. playlistToExclude: playlist,
  79417. error: {
  79418. internal: true,
  79419. message
  79420. },
  79421. playlistExclusionDuration: Infinity
  79422. });
  79423. return;
  79424. }
  79425. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  79426. const switchMessages = [];
  79427. ["video", "audio"].forEach((type2) => {
  79428. const newCodec = (parseCodecs$1(this.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  79429. const oldCodec = (parseCodecs$1(codecs[type2] || "")[0] || {}).type;
  79430. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  79431. switchMessages.push(`"${this.sourceUpdater_.codecs[type2]}" -> "${codecs[type2]}"`);
  79432. }
  79433. });
  79434. if (switchMessages.length) {
  79435. this.excludePlaylist({
  79436. playlistToExclude: playlist,
  79437. error: {
  79438. message: `Codec switching not supported: ${switchMessages.join(", ")}.`,
  79439. internal: true
  79440. },
  79441. playlistExclusionDuration: Infinity
  79442. });
  79443. return;
  79444. }
  79445. }
  79446. return codecs;
  79447. }
  79448. tryToCreateSourceBuffers_() {
  79449. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  79450. return;
  79451. }
  79452. if (!this.areMediaTypesKnown_()) {
  79453. return;
  79454. }
  79455. const codecs = this.getCodecsOrExclude_();
  79456. if (!codecs) {
  79457. return;
  79458. }
  79459. this.sourceUpdater_.createSourceBuffers(codecs);
  79460. const codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  79461. this.excludeIncompatibleVariants_(codecString);
  79462. }
  79463. excludeUnsupportedVariants_() {
  79464. const playlists = this.main().playlists;
  79465. const ids = [];
  79466. Object.keys(playlists).forEach((key) => {
  79467. const variant = playlists[key];
  79468. if (ids.indexOf(variant.id) !== -1) {
  79469. return;
  79470. }
  79471. ids.push(variant.id);
  79472. const codecs = codecsForPlaylist$1(this.main, variant);
  79473. const unsupported = [];
  79474. if (codecs.audio && !muxerSupportsCodec$1(codecs.audio) && !browserSupportsCodec$1(codecs.audio)) {
  79475. unsupported.push(`audio codec ${codecs.audio}`);
  79476. }
  79477. if (codecs.video && !muxerSupportsCodec$1(codecs.video) && !browserSupportsCodec$1(codecs.video)) {
  79478. unsupported.push(`video codec ${codecs.video}`);
  79479. }
  79480. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  79481. unsupported.push(`text codec ${codecs.text}`);
  79482. }
  79483. if (unsupported.length) {
  79484. variant.excludeUntil = Infinity;
  79485. this.logger_(`excluding ${variant.id} for unsupported: ${unsupported.join(", ")}`);
  79486. }
  79487. });
  79488. }
  79489. excludeIncompatibleVariants_(codecString) {
  79490. const ids = [];
  79491. const playlists = this.main().playlists;
  79492. const codecs = unwrapCodecList$1(parseCodecs$1(codecString));
  79493. const codecCount_ = codecCount$1(codecs);
  79494. const videoDetails = codecs.video && parseCodecs$1(codecs.video)[0] || null;
  79495. const audioDetails = codecs.audio && parseCodecs$1(codecs.audio)[0] || null;
  79496. Object.keys(playlists).forEach((key) => {
  79497. const variant = playlists[key];
  79498. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  79499. return;
  79500. }
  79501. ids.push(variant.id);
  79502. const exclusionReasons = [];
  79503. const variantCodecs = codecsForPlaylist$1(this.mainPlaylistLoader_.main, variant);
  79504. const variantCodecCount = codecCount$1(variantCodecs);
  79505. if (!variantCodecs.audio && !variantCodecs.video) {
  79506. return;
  79507. }
  79508. if (variantCodecCount !== codecCount_) {
  79509. exclusionReasons.push(`codec count "${variantCodecCount}" !== "${codecCount_}"`);
  79510. }
  79511. if (!this.sourceUpdater_.canChangeType()) {
  79512. const variantVideoDetails = variantCodecs.video && parseCodecs$1(variantCodecs.video)[0] || null;
  79513. const variantAudioDetails = variantCodecs.audio && parseCodecs$1(variantCodecs.audio)[0] || null;
  79514. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  79515. exclusionReasons.push(`video codec "${variantVideoDetails.type}" !== "${videoDetails.type}"`);
  79516. }
  79517. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  79518. exclusionReasons.push(`audio codec "${variantAudioDetails.type}" !== "${audioDetails.type}"`);
  79519. }
  79520. }
  79521. if (exclusionReasons.length) {
  79522. variant.excludeUntil = Infinity;
  79523. this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(" && ")}`);
  79524. }
  79525. });
  79526. }
  79527. updateAdCues_(media) {
  79528. let offset = 0;
  79529. const seekable3 = this.seekable();
  79530. if (seekable3.length) {
  79531. offset = seekable3.start(0);
  79532. }
  79533. updateAdCues$1(media, this.cueTagsTrack_, offset);
  79534. }
  79535. goalBufferLength() {
  79536. const currentTime = this.tech_.currentTime();
  79537. const initial = Config$1.GOAL_BUFFER_LENGTH;
  79538. const rate = Config$1.GOAL_BUFFER_LENGTH_RATE;
  79539. const max2 = Math.max(initial, Config$1.MAX_GOAL_BUFFER_LENGTH);
  79540. return Math.min(initial + currentTime * rate, max2);
  79541. }
  79542. bufferLowWaterLine() {
  79543. const currentTime = this.tech_.currentTime();
  79544. const initial = Config$1.BUFFER_LOW_WATER_LINE;
  79545. const rate = Config$1.BUFFER_LOW_WATER_LINE_RATE;
  79546. const max2 = Math.max(initial, Config$1.MAX_BUFFER_LOW_WATER_LINE);
  79547. const newMax = Math.max(initial, Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  79548. return Math.min(initial + currentTime * rate, this.bufferBasedABR ? newMax : max2);
  79549. }
  79550. bufferHighWaterLine() {
  79551. return Config$1.BUFFER_HIGH_WATER_LINE;
  79552. }
  79553. }
  79554. const enableFunction$1 = (loader, playlistID, changePlaylistFn) => (enable) => {
  79555. const playlist = loader.main.playlists[playlistID];
  79556. const incompatible = isIncompatible$1(playlist);
  79557. const currentlyEnabled = isEnabled$1(playlist);
  79558. if (typeof enable === "undefined") {
  79559. return currentlyEnabled;
  79560. }
  79561. if (enable) {
  79562. delete playlist.disabled;
  79563. } else {
  79564. playlist.disabled = true;
  79565. }
  79566. if (enable !== currentlyEnabled && !incompatible) {
  79567. changePlaylistFn();
  79568. if (enable) {
  79569. loader.trigger("renditionenabled");
  79570. } else {
  79571. loader.trigger("renditiondisabled");
  79572. }
  79573. }
  79574. return enable;
  79575. };
  79576. class Representation$1 {
  79577. constructor(vhsHandler, playlist, id) {
  79578. const {
  79579. playlistController_: pc
  79580. } = vhsHandler;
  79581. const qualityChangeFunction = pc.fastQualityChange_.bind(pc);
  79582. if (playlist.attributes) {
  79583. const resolution = playlist.attributes.RESOLUTION;
  79584. this.width = resolution && resolution.width;
  79585. this.height = resolution && resolution.height;
  79586. this.bandwidth = playlist.attributes.BANDWIDTH;
  79587. this.frameRate = playlist.attributes["FRAME-RATE"];
  79588. }
  79589. this.codecs = codecsForPlaylist$1(pc.main(), playlist);
  79590. this.playlist = playlist;
  79591. this.id = id;
  79592. this.enabled = enableFunction$1(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  79593. }
  79594. }
  79595. const renditionSelectionMixin$1 = function(vhsHandler) {
  79596. vhsHandler.representations = () => {
  79597. const main = vhsHandler.playlistController_.main();
  79598. const playlists = isAudioOnly$1(main) ? vhsHandler.playlistController_.getAudioTrackPlaylists_() : main.playlists;
  79599. if (!playlists) {
  79600. return [];
  79601. }
  79602. return playlists.filter((media) => !isIncompatible$1(media)).map((e, i2) => new Representation$1(vhsHandler, e, e.id));
  79603. };
  79604. };
  79605. const timerCancelEvents$1 = ["seeking", "seeked", "pause", "playing", "error"];
  79606. class PlaybackWatcher$1 {
  79607. constructor(options2) {
  79608. this.playlistController_ = options2.playlistController;
  79609. this.tech_ = options2.tech;
  79610. this.seekable = options2.seekable;
  79611. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  79612. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  79613. this.media = options2.media;
  79614. this.consecutiveUpdates = 0;
  79615. this.lastRecordedTime = null;
  79616. this.checkCurrentTimeTimeout_ = null;
  79617. this.logger_ = logger$1("PlaybackWatcher");
  79618. this.logger_("initialize");
  79619. const playHandler = () => this.monitorCurrentTime_();
  79620. const canPlayHandler = () => this.monitorCurrentTime_();
  79621. const waitingHandler = () => this.techWaiting_();
  79622. const cancelTimerHandler = () => this.resetTimeUpdate_();
  79623. const pc = this.playlistController_;
  79624. const loaderTypes = ["main", "subtitle", "audio"];
  79625. const loaderChecks = {};
  79626. loaderTypes.forEach((type2) => {
  79627. loaderChecks[type2] = {
  79628. reset: () => this.resetSegmentDownloads_(type2),
  79629. updateend: () => this.checkSegmentDownloads_(type2)
  79630. };
  79631. pc[`${type2}SegmentLoader_`].on("appendsdone", loaderChecks[type2].updateend);
  79632. pc[`${type2}SegmentLoader_`].on("playlistupdate", loaderChecks[type2].reset);
  79633. this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  79634. });
  79635. const setSeekingHandlers = (fn2) => {
  79636. ["main", "audio"].forEach((type2) => {
  79637. pc[`${type2}SegmentLoader_`][fn2]("appended", this.seekingAppendCheck_);
  79638. });
  79639. };
  79640. this.seekingAppendCheck_ = () => {
  79641. if (this.fixesBadSeeks_()) {
  79642. this.consecutiveUpdates = 0;
  79643. this.lastRecordedTime = this.tech_.currentTime();
  79644. setSeekingHandlers("off");
  79645. }
  79646. };
  79647. this.clearSeekingAppendCheck_ = () => setSeekingHandlers("off");
  79648. this.watchForBadSeeking_ = () => {
  79649. this.clearSeekingAppendCheck_();
  79650. setSeekingHandlers("on");
  79651. };
  79652. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  79653. this.tech_.on("seeking", this.watchForBadSeeking_);
  79654. this.tech_.on("waiting", waitingHandler);
  79655. this.tech_.on(timerCancelEvents$1, cancelTimerHandler);
  79656. this.tech_.on("canplay", canPlayHandler);
  79657. this.tech_.one("play", playHandler);
  79658. this.dispose = () => {
  79659. this.clearSeekingAppendCheck_();
  79660. this.logger_("dispose");
  79661. this.tech_.off("waiting", waitingHandler);
  79662. this.tech_.off(timerCancelEvents$1, cancelTimerHandler);
  79663. this.tech_.off("canplay", canPlayHandler);
  79664. this.tech_.off("play", playHandler);
  79665. this.tech_.off("seeking", this.watchForBadSeeking_);
  79666. this.tech_.off("seeked", this.clearSeekingAppendCheck_);
  79667. loaderTypes.forEach((type2) => {
  79668. pc[`${type2}SegmentLoader_`].off("appendsdone", loaderChecks[type2].updateend);
  79669. pc[`${type2}SegmentLoader_`].off("playlistupdate", loaderChecks[type2].reset);
  79670. this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  79671. });
  79672. if (this.checkCurrentTimeTimeout_) {
  79673. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79674. }
  79675. this.resetTimeUpdate_();
  79676. };
  79677. }
  79678. monitorCurrentTime_() {
  79679. this.checkCurrentTime_();
  79680. if (this.checkCurrentTimeTimeout_) {
  79681. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79682. }
  79683. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  79684. }
  79685. resetSegmentDownloads_(type2) {
  79686. const loader = this.playlistController_[`${type2}SegmentLoader_`];
  79687. if (this[`${type2}StalledDownloads_`] > 0) {
  79688. this.logger_(`resetting possible stalled download count for ${type2} loader`);
  79689. }
  79690. this[`${type2}StalledDownloads_`] = 0;
  79691. this[`${type2}Buffered_`] = loader.buffered_();
  79692. }
  79693. checkSegmentDownloads_(type2) {
  79694. const pc = this.playlistController_;
  79695. const loader = pc[`${type2}SegmentLoader_`];
  79696. const buffered = loader.buffered_();
  79697. const isBufferedDifferent = isRangeDifferent$1(this[`${type2}Buffered_`], buffered);
  79698. this[`${type2}Buffered_`] = buffered;
  79699. if (isBufferedDifferent) {
  79700. this.resetSegmentDownloads_(type2);
  79701. return;
  79702. }
  79703. this[`${type2}StalledDownloads_`]++;
  79704. this.logger_(`found #${this[`${type2}StalledDownloads_`]} ${type2} appends that did not increase buffer (possible stalled download)`, {
  79705. playlistId: loader.playlist_ && loader.playlist_.id,
  79706. buffered: timeRangesToArray$1(buffered)
  79707. });
  79708. if (this[`${type2}StalledDownloads_`] < 10) {
  79709. return;
  79710. }
  79711. this.logger_(`${type2} loader stalled download exclusion`);
  79712. this.resetSegmentDownloads_(type2);
  79713. this.tech_.trigger({
  79714. type: "usage",
  79715. name: `vhs-${type2}-download-exclusion`
  79716. });
  79717. if (type2 === "subtitle") {
  79718. return;
  79719. }
  79720. pc.excludePlaylist({
  79721. error: {
  79722. message: `Excessive ${type2} segment downloading detected.`
  79723. },
  79724. playlistExclusionDuration: Infinity
  79725. });
  79726. }
  79727. checkCurrentTime_() {
  79728. if (this.tech_.paused() || this.tech_.seeking()) {
  79729. return;
  79730. }
  79731. const currentTime = this.tech_.currentTime();
  79732. const buffered = this.tech_.buffered();
  79733. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA$1 >= buffered.end(buffered.length - 1))) {
  79734. return this.techWaiting_();
  79735. }
  79736. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  79737. this.consecutiveUpdates++;
  79738. this.waiting_();
  79739. } else if (currentTime === this.lastRecordedTime) {
  79740. this.consecutiveUpdates++;
  79741. } else {
  79742. this.consecutiveUpdates = 0;
  79743. this.lastRecordedTime = currentTime;
  79744. }
  79745. }
  79746. resetTimeUpdate_() {
  79747. this.consecutiveUpdates = 0;
  79748. }
  79749. fixesBadSeeks_() {
  79750. const seeking = this.tech_.seeking();
  79751. if (!seeking) {
  79752. return false;
  79753. }
  79754. const seekable3 = this.seekable();
  79755. const currentTime = this.tech_.currentTime();
  79756. const isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  79757. let seekTo;
  79758. if (isAfterSeekableRange) {
  79759. const seekableEnd = seekable3.end(seekable3.length - 1);
  79760. seekTo = seekableEnd;
  79761. }
  79762. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79763. const seekableStart = seekable3.start(0);
  79764. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA$1);
  79765. }
  79766. if (typeof seekTo !== "undefined") {
  79767. this.logger_(`Trying to seek outside of seekable at time ${currentTime} with seekable range ${printableRange$1(seekable3)}. Seeking to ${seekTo}.`);
  79768. this.tech_.setCurrentTime(seekTo);
  79769. return true;
  79770. }
  79771. const sourceUpdater = this.playlistController_.sourceUpdater_;
  79772. const buffered = this.tech_.buffered();
  79773. const audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  79774. const videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  79775. const media = this.media();
  79776. const minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR$1) * 2;
  79777. const bufferedToCheck = [audioBuffered, videoBuffered];
  79778. for (let i2 = 0; i2 < bufferedToCheck.length; i2++) {
  79779. if (!bufferedToCheck[i2]) {
  79780. continue;
  79781. }
  79782. const timeAhead = timeAheadOf$1(bufferedToCheck[i2], currentTime);
  79783. if (timeAhead < minAppendedDuration) {
  79784. return false;
  79785. }
  79786. }
  79787. const nextRange = findNextRange$1(buffered, currentTime);
  79788. if (nextRange.length === 0) {
  79789. return false;
  79790. }
  79791. seekTo = nextRange.start(0) + SAFE_TIME_DELTA$1;
  79792. this.logger_(`Buffered region starts (${nextRange.start(0)}) just beyond seek point (${currentTime}). Seeking to ${seekTo}.`);
  79793. this.tech_.setCurrentTime(seekTo);
  79794. return true;
  79795. }
  79796. waiting_() {
  79797. if (this.techWaiting_()) {
  79798. return;
  79799. }
  79800. const currentTime = this.tech_.currentTime();
  79801. const buffered = this.tech_.buffered();
  79802. const currentRange = findRange$1(buffered, currentTime);
  79803. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  79804. this.resetTimeUpdate_();
  79805. this.tech_.setCurrentTime(currentTime);
  79806. this.logger_(`Stopped at ${currentTime} while inside a buffered region [${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume playback by seeking to the current time.`);
  79807. this.tech_.trigger({
  79808. type: "usage",
  79809. name: "vhs-unknown-waiting"
  79810. });
  79811. return;
  79812. }
  79813. }
  79814. techWaiting_() {
  79815. const seekable3 = this.seekable();
  79816. const currentTime = this.tech_.currentTime();
  79817. if (this.tech_.seeking()) {
  79818. return true;
  79819. }
  79820. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79821. const livePoint = seekable3.end(seekable3.length - 1);
  79822. this.logger_(`Fell out of live window at time ${currentTime}. Seeking to live point (seekable end) ${livePoint}`);
  79823. this.resetTimeUpdate_();
  79824. this.tech_.setCurrentTime(livePoint);
  79825. this.tech_.trigger({
  79826. type: "usage",
  79827. name: "vhs-live-resync"
  79828. });
  79829. return true;
  79830. }
  79831. const sourceUpdater = this.tech_.vhs.playlistController_.sourceUpdater_;
  79832. const buffered = this.tech_.buffered();
  79833. const videoUnderflow = this.videoUnderflow_({
  79834. audioBuffered: sourceUpdater.audioBuffered(),
  79835. videoBuffered: sourceUpdater.videoBuffered(),
  79836. currentTime
  79837. });
  79838. if (videoUnderflow) {
  79839. this.resetTimeUpdate_();
  79840. this.tech_.setCurrentTime(currentTime);
  79841. this.tech_.trigger({
  79842. type: "usage",
  79843. name: "vhs-video-underflow"
  79844. });
  79845. return true;
  79846. }
  79847. const nextRange = findNextRange$1(buffered, currentTime);
  79848. if (nextRange.length > 0) {
  79849. this.logger_(`Stopped at ${currentTime} and seeking to ${nextRange.start(0)}`);
  79850. this.resetTimeUpdate_();
  79851. this.skipTheGap_(currentTime);
  79852. return true;
  79853. }
  79854. return false;
  79855. }
  79856. afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow = false) {
  79857. if (!seekable3.length) {
  79858. return false;
  79859. }
  79860. let allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA$1;
  79861. const isLive = !playlist.endList;
  79862. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  79863. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  79864. }
  79865. if (currentTime > allowedEnd) {
  79866. return true;
  79867. }
  79868. return false;
  79869. }
  79870. beforeSeekableWindow_(seekable3, currentTime) {
  79871. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  79872. return true;
  79873. }
  79874. return false;
  79875. }
  79876. videoUnderflow_({
  79877. videoBuffered,
  79878. audioBuffered,
  79879. currentTime
  79880. }) {
  79881. if (!videoBuffered) {
  79882. return;
  79883. }
  79884. let gap;
  79885. if (videoBuffered.length && audioBuffered.length) {
  79886. const lastVideoRange = findRange$1(videoBuffered, currentTime - 3);
  79887. const videoRange = findRange$1(videoBuffered, currentTime);
  79888. const audioRange = findRange$1(audioBuffered, currentTime);
  79889. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  79890. gap = {
  79891. start: lastVideoRange.end(0),
  79892. end: audioRange.end(0)
  79893. };
  79894. }
  79895. } else {
  79896. const nextRange = findNextRange$1(videoBuffered, currentTime);
  79897. if (!nextRange.length) {
  79898. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  79899. }
  79900. }
  79901. if (gap) {
  79902. this.logger_(`Encountered a gap in video from ${gap.start} to ${gap.end}. Seeking to current time ${currentTime}`);
  79903. return true;
  79904. }
  79905. return false;
  79906. }
  79907. skipTheGap_(scheduledCurrentTime) {
  79908. const buffered = this.tech_.buffered();
  79909. const currentTime = this.tech_.currentTime();
  79910. const nextRange = findNextRange$1(buffered, currentTime);
  79911. this.resetTimeUpdate_();
  79912. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  79913. return;
  79914. }
  79915. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  79916. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR$1);
  79917. this.tech_.trigger({
  79918. type: "usage",
  79919. name: "vhs-gap-skip"
  79920. });
  79921. }
  79922. gapFromVideoUnderflow_(buffered, currentTime) {
  79923. const gaps = findGaps$1(buffered);
  79924. for (let i2 = 0; i2 < gaps.length; i2++) {
  79925. const start2 = gaps.start(i2);
  79926. const end = gaps.end(i2);
  79927. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  79928. return {
  79929. start: start2,
  79930. end
  79931. };
  79932. }
  79933. }
  79934. return null;
  79935. }
  79936. }
  79937. const defaultOptions$1 = {
  79938. errorInterval: 30,
  79939. getSource(next) {
  79940. const tech = this.tech({
  79941. IWillNotUseThisInPlugins: true
  79942. });
  79943. const sourceObj = tech.currentSource_ || this.currentSource();
  79944. return next(sourceObj);
  79945. }
  79946. };
  79947. const initPlugin$2 = function(player, options2) {
  79948. let lastCalled = 0;
  79949. let seekTo = 0;
  79950. const localOptions = merge$2(defaultOptions$1, options2);
  79951. player.ready(() => {
  79952. player.trigger({
  79953. type: "usage",
  79954. name: "vhs-error-reload-initialized"
  79955. });
  79956. });
  79957. const loadedMetadataHandler = function() {
  79958. if (seekTo) {
  79959. player.currentTime(seekTo);
  79960. }
  79961. };
  79962. const setSource2 = function(sourceObj) {
  79963. if (sourceObj === null || sourceObj === void 0) {
  79964. return;
  79965. }
  79966. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  79967. player.one("loadedmetadata", loadedMetadataHandler);
  79968. player.src(sourceObj);
  79969. player.trigger({
  79970. type: "usage",
  79971. name: "vhs-error-reload"
  79972. });
  79973. player.play();
  79974. };
  79975. const errorHandler = function() {
  79976. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  79977. player.trigger({
  79978. type: "usage",
  79979. name: "vhs-error-reload-canceled"
  79980. });
  79981. return;
  79982. }
  79983. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  79984. videojs$2.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  79985. return;
  79986. }
  79987. lastCalled = Date.now();
  79988. return localOptions.getSource.call(player, setSource2);
  79989. };
  79990. const cleanupEvents = function() {
  79991. player.off("loadedmetadata", loadedMetadataHandler);
  79992. player.off("error", errorHandler);
  79993. player.off("dispose", cleanupEvents);
  79994. };
  79995. const reinitPlugin = function(newOptions) {
  79996. cleanupEvents();
  79997. initPlugin$2(player, newOptions);
  79998. };
  79999. player.on("error", errorHandler);
  80000. player.on("dispose", cleanupEvents);
  80001. player.reloadSourceOnError = reinitPlugin;
  80002. };
  80003. const reloadSourceOnError$1 = function(options2) {
  80004. initPlugin$2(this, options2);
  80005. };
  80006. var version$4$1 = "3.0.2";
  80007. var version$3$1 = "6.3.0";
  80008. var version$2$1 = "1.0.1";
  80009. var version$1$2 = "6.0.0";
  80010. var version$7 = "4.0.1";
  80011. const Vhs$2 = {
  80012. PlaylistLoader: PlaylistLoader$1,
  80013. Playlist: Playlist$1,
  80014. utils: utils$1,
  80015. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector$1,
  80016. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector$1,
  80017. lastBandwidthSelector: lastBandwidthSelector$1,
  80018. movingAverageBandwidthSelector: movingAverageBandwidthSelector$1,
  80019. comparePlaylistBandwidth: comparePlaylistBandwidth$1,
  80020. comparePlaylistResolution: comparePlaylistResolution$1,
  80021. xhr: xhrFactory$1()
  80022. };
  80023. Object.keys(Config$1).forEach((prop) => {
  80024. Object.defineProperty(Vhs$2, prop, {
  80025. get() {
  80026. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80027. return Config$1[prop];
  80028. },
  80029. set(value) {
  80030. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80031. if (typeof value !== "number" || value < 0) {
  80032. videojs$2.log.warn(`value of Vhs.${prop} must be greater than or equal to 0`);
  80033. return;
  80034. }
  80035. Config$1[prop] = value;
  80036. }
  80037. });
  80038. });
  80039. const LOCAL_STORAGE_KEY$2 = "videojs-vhs";
  80040. const handleVhsMediaChange$1 = function(qualityLevels2, playlistLoader) {
  80041. const newPlaylist = playlistLoader.media();
  80042. let selectedIndex = -1;
  80043. for (let i2 = 0; i2 < qualityLevels2.length; i2++) {
  80044. if (qualityLevels2[i2].id === newPlaylist.id) {
  80045. selectedIndex = i2;
  80046. break;
  80047. }
  80048. }
  80049. qualityLevels2.selectedIndex_ = selectedIndex;
  80050. qualityLevels2.trigger({
  80051. selectedIndex,
  80052. type: "change"
  80053. });
  80054. };
  80055. const handleVhsLoadedMetadata$1 = function(qualityLevels2, vhs) {
  80056. vhs.representations().forEach((rep2) => {
  80057. qualityLevels2.addQualityLevel(rep2);
  80058. });
  80059. handleVhsMediaChange$1(qualityLevels2, vhs.playlists);
  80060. };
  80061. Vhs$2.canPlaySource = function() {
  80062. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80063. };
  80064. const emeKeySystems$1 = (keySystemOptions, mainPlaylist, audioPlaylist) => {
  80065. if (!keySystemOptions) {
  80066. return keySystemOptions;
  80067. }
  80068. let codecs = {};
  80069. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  80070. codecs = unwrapCodecList$1(parseCodecs$1(mainPlaylist.attributes.CODECS));
  80071. }
  80072. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  80073. codecs.audio = audioPlaylist.attributes.CODECS;
  80074. }
  80075. const videoContentType = getMimeForCodec$1(codecs.video);
  80076. const audioContentType = getMimeForCodec$1(codecs.audio);
  80077. const keySystemContentTypes = {};
  80078. for (const keySystem in keySystemOptions) {
  80079. keySystemContentTypes[keySystem] = {};
  80080. if (audioContentType) {
  80081. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  80082. }
  80083. if (videoContentType) {
  80084. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  80085. }
  80086. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  80087. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  80088. }
  80089. if (typeof keySystemOptions[keySystem] === "string") {
  80090. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  80091. }
  80092. }
  80093. return merge$2(keySystemOptions, keySystemContentTypes);
  80094. };
  80095. const getAllPsshKeySystemsOptions$1 = (playlists, keySystems) => {
  80096. return playlists.reduce((keySystemsArr, playlist) => {
  80097. if (!playlist.contentProtection) {
  80098. return keySystemsArr;
  80099. }
  80100. const keySystemsOptions = keySystems.reduce((keySystemsObj, keySystem) => {
  80101. const keySystemOptions = playlist.contentProtection[keySystem];
  80102. if (keySystemOptions && keySystemOptions.pssh) {
  80103. keySystemsObj[keySystem] = {
  80104. pssh: keySystemOptions.pssh
  80105. };
  80106. }
  80107. return keySystemsObj;
  80108. }, {});
  80109. if (Object.keys(keySystemsOptions).length) {
  80110. keySystemsArr.push(keySystemsOptions);
  80111. }
  80112. return keySystemsArr;
  80113. }, []);
  80114. };
  80115. const waitForKeySessionCreation$1 = ({
  80116. player,
  80117. sourceKeySystems,
  80118. audioMedia,
  80119. mainPlaylists
  80120. }) => {
  80121. if (!player.eme.initializeMediaKeys) {
  80122. return Promise.resolve();
  80123. }
  80124. const playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  80125. const keySystemsOptionsArr = getAllPsshKeySystemsOptions$1(playlists, Object.keys(sourceKeySystems));
  80126. const initializationFinishedPromises = [];
  80127. const keySessionCreatedPromises = [];
  80128. keySystemsOptionsArr.forEach((keySystemsOptions) => {
  80129. keySessionCreatedPromises.push(new Promise((resolve2, reject2) => {
  80130. player.tech_.one("keysessioncreated", resolve2);
  80131. }));
  80132. initializationFinishedPromises.push(new Promise((resolve2, reject2) => {
  80133. player.eme.initializeMediaKeys({
  80134. keySystems: keySystemsOptions
  80135. }, (err) => {
  80136. if (err) {
  80137. reject2(err);
  80138. return;
  80139. }
  80140. resolve2();
  80141. });
  80142. }));
  80143. });
  80144. return Promise.race([
  80145. Promise.all(initializationFinishedPromises),
  80146. Promise.race(keySessionCreatedPromises)
  80147. ]);
  80148. };
  80149. const setupEmeOptions$1 = ({
  80150. player,
  80151. sourceKeySystems,
  80152. media,
  80153. audioMedia
  80154. }) => {
  80155. const sourceOptions = emeKeySystems$1(sourceKeySystems, media, audioMedia);
  80156. if (!sourceOptions) {
  80157. return false;
  80158. }
  80159. player.currentSource().keySystems = sourceOptions;
  80160. if (sourceOptions && !player.eme) {
  80161. videojs$2.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  80162. return false;
  80163. }
  80164. return true;
  80165. };
  80166. const getVhsLocalStorage$1 = () => {
  80167. if (!window_1.localStorage) {
  80168. return null;
  80169. }
  80170. const storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY$2);
  80171. if (!storedObject) {
  80172. return null;
  80173. }
  80174. try {
  80175. return JSON.parse(storedObject);
  80176. } catch (e) {
  80177. return null;
  80178. }
  80179. };
  80180. const updateVhsLocalStorage$1 = (options2) => {
  80181. if (!window_1.localStorage) {
  80182. return false;
  80183. }
  80184. let objectToStore = getVhsLocalStorage$1();
  80185. objectToStore = objectToStore ? merge$2(objectToStore, options2) : options2;
  80186. try {
  80187. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$2, JSON.stringify(objectToStore));
  80188. } catch (e) {
  80189. return false;
  80190. }
  80191. return objectToStore;
  80192. };
  80193. const expandDataUri$1 = (dataUri) => {
  80194. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  80195. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  80196. }
  80197. return dataUri;
  80198. };
  80199. Vhs$2.supportsNativeHls = function() {
  80200. if (!document_1 || !document_1.createElement) {
  80201. return false;
  80202. }
  80203. const video = document_1.createElement("video");
  80204. if (!videojs$2.getTech("Html5").isSupported()) {
  80205. return false;
  80206. }
  80207. const canPlay = [
  80208. "application/vnd.apple.mpegurl",
  80209. "audio/mpegurl",
  80210. "audio/x-mpegurl",
  80211. "application/x-mpegurl",
  80212. "video/x-mpegurl",
  80213. "video/mpegurl",
  80214. "application/mpegurl"
  80215. ];
  80216. return canPlay.some(function(canItPlay) {
  80217. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  80218. });
  80219. }();
  80220. Vhs$2.supportsNativeDash = function() {
  80221. if (!document_1 || !document_1.createElement || !videojs$2.getTech("Html5").isSupported()) {
  80222. return false;
  80223. }
  80224. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  80225. }();
  80226. Vhs$2.supportsTypeNatively = (type2) => {
  80227. if (type2 === "hls") {
  80228. return Vhs$2.supportsNativeHls;
  80229. }
  80230. if (type2 === "dash") {
  80231. return Vhs$2.supportsNativeDash;
  80232. }
  80233. return false;
  80234. };
  80235. Vhs$2.isSupported = function() {
  80236. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80237. };
  80238. const Component$2 = videojs$2.getComponent("Component");
  80239. class VhsHandler$1 extends Component$2 {
  80240. constructor(source, tech, options2) {
  80241. super(tech, options2.vhs);
  80242. if (typeof options2.initialBandwidth === "number") {
  80243. this.options_.bandwidth = options2.initialBandwidth;
  80244. }
  80245. this.logger_ = logger$1("VhsHandler");
  80246. if (tech.options_ && tech.options_.playerId) {
  80247. const _player = videojs$2.getPlayer(tech.options_.playerId);
  80248. this.player_ = _player;
  80249. }
  80250. this.tech_ = tech;
  80251. this.source_ = source;
  80252. this.stats = {};
  80253. this.ignoreNextSeekingEvent_ = false;
  80254. this.setOptions_();
  80255. if (this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  80256. tech.overrideNativeAudioTracks(true);
  80257. tech.overrideNativeVideoTracks(true);
  80258. } else if (this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  80259. throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");
  80260. }
  80261. this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], (event2) => {
  80262. const fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  80263. if (fullscreenElement && fullscreenElement.contains(this.tech_.el())) {
  80264. this.playlistController_.fastQualityChange_();
  80265. } else {
  80266. this.playlistController_.checkABR_();
  80267. }
  80268. });
  80269. this.on(this.tech_, "seeking", function() {
  80270. if (this.ignoreNextSeekingEvent_) {
  80271. this.ignoreNextSeekingEvent_ = false;
  80272. return;
  80273. }
  80274. this.setCurrentTime(this.tech_.currentTime());
  80275. });
  80276. this.on(this.tech_, "error", function() {
  80277. if (this.tech_.error() && this.playlistController_) {
  80278. this.playlistController_.pauseLoading();
  80279. }
  80280. });
  80281. this.on(this.tech_, "play", this.play);
  80282. }
  80283. setOptions_() {
  80284. this.options_.withCredentials = this.options_.withCredentials || false;
  80285. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  80286. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  80287. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  80288. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  80289. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  80290. this.options_.customTagParsers = this.options_.customTagParsers || [];
  80291. this.options_.customTagMappers = this.options_.customTagMappers || [];
  80292. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  80293. this.options_.llhls = this.options_.llhls === false ? false : true;
  80294. this.options_.bufferBasedABR = this.options_.bufferBasedABR || false;
  80295. if (typeof this.options_.playlistExclusionDuration !== "number") {
  80296. this.options_.playlistExclusionDuration = 5 * 60;
  80297. }
  80298. if (typeof this.options_.bandwidth !== "number") {
  80299. if (this.options_.useBandwidthFromLocalStorage) {
  80300. const storedObject = getVhsLocalStorage$1();
  80301. if (storedObject && storedObject.bandwidth) {
  80302. this.options_.bandwidth = storedObject.bandwidth;
  80303. this.tech_.trigger({
  80304. type: "usage",
  80305. name: "vhs-bandwidth-from-local-storage"
  80306. });
  80307. }
  80308. if (storedObject && storedObject.throughput) {
  80309. this.options_.throughput = storedObject.throughput;
  80310. this.tech_.trigger({
  80311. type: "usage",
  80312. name: "vhs-throughput-from-local-storage"
  80313. });
  80314. }
  80315. }
  80316. }
  80317. if (typeof this.options_.bandwidth !== "number") {
  80318. this.options_.bandwidth = Config$1.INITIAL_BANDWIDTH;
  80319. }
  80320. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config$1.INITIAL_BANDWIDTH;
  80321. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "customTagParsers", "customTagMappers", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "bufferBasedABR", "liveRangeSafeTimeDelta", "llhls", "useNetworkInformationApi", "useDtsForTimestampOffset", "exactManifestTimings", "leastPixelDiffSelector"].forEach((option) => {
  80322. if (typeof this.source_[option] !== "undefined") {
  80323. this.options_[option] = this.source_[option];
  80324. }
  80325. });
  80326. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  80327. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  80328. }
  80329. src(src, type2) {
  80330. if (!src) {
  80331. return;
  80332. }
  80333. this.setOptions_();
  80334. this.options_.src = expandDataUri$1(this.source_.src);
  80335. this.options_.tech = this.tech_;
  80336. this.options_.externVhs = Vhs$2;
  80337. this.options_.sourceType = simpleTypeFromSourceType$1(type2);
  80338. this.options_.seekTo = (time) => {
  80339. this.tech_.setCurrentTime(time);
  80340. };
  80341. this.playlistController_ = new PlaylistController(this.options_);
  80342. const playbackWatcherOptions = merge$2({
  80343. liveRangeSafeTimeDelta: SAFE_TIME_DELTA$1
  80344. }, this.options_, {
  80345. seekable: () => this.seekable(),
  80346. media: () => this.playlistController_.media(),
  80347. playlistController: this.playlistController_
  80348. });
  80349. this.playbackWatcher_ = new PlaybackWatcher$1(playbackWatcherOptions);
  80350. this.playlistController_.on("error", () => {
  80351. const player = videojs$2.players[this.tech_.options_.playerId];
  80352. let error = this.playlistController_.error;
  80353. if (typeof error === "object" && !error.code) {
  80354. error.code = 3;
  80355. } else if (typeof error === "string") {
  80356. error = {
  80357. message: error,
  80358. code: 3
  80359. };
  80360. }
  80361. player.error(error);
  80362. });
  80363. const defaultSelector = this.options_.bufferBasedABR ? Vhs$2.movingAverageBandwidthSelector(0.55) : Vhs$2.STANDARD_PLAYLIST_SELECTOR;
  80364. this.playlistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  80365. this.playlistController_.selectInitialPlaylist = Vhs$2.INITIAL_PLAYLIST_SELECTOR.bind(this);
  80366. this.playlists = this.playlistController_.mainPlaylistLoader_;
  80367. this.mediaSource = this.playlistController_.mediaSource;
  80368. Object.defineProperties(this, {
  80369. selectPlaylist: {
  80370. get() {
  80371. return this.playlistController_.selectPlaylist;
  80372. },
  80373. set(selectPlaylist) {
  80374. this.playlistController_.selectPlaylist = selectPlaylist.bind(this);
  80375. }
  80376. },
  80377. throughput: {
  80378. get() {
  80379. return this.playlistController_.mainSegmentLoader_.throughput.rate;
  80380. },
  80381. set(throughput) {
  80382. this.playlistController_.mainSegmentLoader_.throughput.rate = throughput;
  80383. this.playlistController_.mainSegmentLoader_.throughput.count = 1;
  80384. }
  80385. },
  80386. bandwidth: {
  80387. get() {
  80388. let playerBandwidthEst = this.playlistController_.mainSegmentLoader_.bandwidth;
  80389. const networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  80390. const tenMbpsAsBitsPerSecond = 1e7;
  80391. if (this.options_.useNetworkInformationApi && networkInformation) {
  80392. const networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  80393. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  80394. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  80395. } else {
  80396. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  80397. }
  80398. }
  80399. return playerBandwidthEst;
  80400. },
  80401. set(bandwidth2) {
  80402. this.playlistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  80403. this.playlistController_.mainSegmentLoader_.throughput = {
  80404. rate: 0,
  80405. count: 0
  80406. };
  80407. }
  80408. },
  80409. systemBandwidth: {
  80410. get() {
  80411. const invBandwidth = 1 / (this.bandwidth || 1);
  80412. let invThroughput;
  80413. if (this.throughput > 0) {
  80414. invThroughput = 1 / this.throughput;
  80415. } else {
  80416. invThroughput = 0;
  80417. }
  80418. const systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  80419. return systemBitrate;
  80420. },
  80421. set() {
  80422. videojs$2.log.error('The "systemBandwidth" property is read-only');
  80423. }
  80424. }
  80425. });
  80426. if (this.options_.bandwidth) {
  80427. this.bandwidth = this.options_.bandwidth;
  80428. }
  80429. if (this.options_.throughput) {
  80430. this.throughput = this.options_.throughput;
  80431. }
  80432. Object.defineProperties(this.stats, {
  80433. bandwidth: {
  80434. get: () => this.bandwidth || 0,
  80435. enumerable: true
  80436. },
  80437. mediaRequests: {
  80438. get: () => this.playlistController_.mediaRequests_() || 0,
  80439. enumerable: true
  80440. },
  80441. mediaRequestsAborted: {
  80442. get: () => this.playlistController_.mediaRequestsAborted_() || 0,
  80443. enumerable: true
  80444. },
  80445. mediaRequestsTimedout: {
  80446. get: () => this.playlistController_.mediaRequestsTimedout_() || 0,
  80447. enumerable: true
  80448. },
  80449. mediaRequestsErrored: {
  80450. get: () => this.playlistController_.mediaRequestsErrored_() || 0,
  80451. enumerable: true
  80452. },
  80453. mediaTransferDuration: {
  80454. get: () => this.playlistController_.mediaTransferDuration_() || 0,
  80455. enumerable: true
  80456. },
  80457. mediaBytesTransferred: {
  80458. get: () => this.playlistController_.mediaBytesTransferred_() || 0,
  80459. enumerable: true
  80460. },
  80461. mediaSecondsLoaded: {
  80462. get: () => this.playlistController_.mediaSecondsLoaded_() || 0,
  80463. enumerable: true
  80464. },
  80465. mediaAppends: {
  80466. get: () => this.playlistController_.mediaAppends_() || 0,
  80467. enumerable: true
  80468. },
  80469. mainAppendsToLoadedData: {
  80470. get: () => this.playlistController_.mainAppendsToLoadedData_() || 0,
  80471. enumerable: true
  80472. },
  80473. audioAppendsToLoadedData: {
  80474. get: () => this.playlistController_.audioAppendsToLoadedData_() || 0,
  80475. enumerable: true
  80476. },
  80477. appendsToLoadedData: {
  80478. get: () => this.playlistController_.appendsToLoadedData_() || 0,
  80479. enumerable: true
  80480. },
  80481. timeToLoadedData: {
  80482. get: () => this.playlistController_.timeToLoadedData_() || 0,
  80483. enumerable: true
  80484. },
  80485. buffered: {
  80486. get: () => timeRangesToArray$1(this.tech_.buffered()),
  80487. enumerable: true
  80488. },
  80489. currentTime: {
  80490. get: () => this.tech_.currentTime(),
  80491. enumerable: true
  80492. },
  80493. currentSource: {
  80494. get: () => this.tech_.currentSource_,
  80495. enumerable: true
  80496. },
  80497. currentTech: {
  80498. get: () => this.tech_.name_,
  80499. enumerable: true
  80500. },
  80501. duration: {
  80502. get: () => this.tech_.duration(),
  80503. enumerable: true
  80504. },
  80505. main: {
  80506. get: () => this.playlists.main,
  80507. enumerable: true
  80508. },
  80509. playerDimensions: {
  80510. get: () => this.tech_.currentDimensions(),
  80511. enumerable: true
  80512. },
  80513. seekable: {
  80514. get: () => timeRangesToArray$1(this.tech_.seekable()),
  80515. enumerable: true
  80516. },
  80517. timestamp: {
  80518. get: () => Date.now(),
  80519. enumerable: true
  80520. },
  80521. videoPlaybackQuality: {
  80522. get: () => this.tech_.getVideoPlaybackQuality(),
  80523. enumerable: true
  80524. }
  80525. });
  80526. this.tech_.one("canplay", this.playlistController_.setupFirstPlay.bind(this.playlistController_));
  80527. this.tech_.on("bandwidthupdate", () => {
  80528. if (this.options_.useBandwidthFromLocalStorage) {
  80529. updateVhsLocalStorage$1({
  80530. bandwidth: this.bandwidth,
  80531. throughput: Math.round(this.throughput)
  80532. });
  80533. }
  80534. });
  80535. this.playlistController_.on("selectedinitialmedia", () => {
  80536. renditionSelectionMixin$1(this);
  80537. });
  80538. this.playlistController_.sourceUpdater_.on("createdsourcebuffers", () => {
  80539. this.setupEme_();
  80540. });
  80541. this.on(this.playlistController_, "progress", function() {
  80542. this.tech_.trigger("progress");
  80543. });
  80544. this.on(this.playlistController_, "firstplay", function() {
  80545. this.ignoreNextSeekingEvent_ = true;
  80546. });
  80547. this.setupQualityLevels_();
  80548. if (!this.tech_.el()) {
  80549. return;
  80550. }
  80551. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.playlistController_.mediaSource);
  80552. this.tech_.src(this.mediaSourceUrl_);
  80553. }
  80554. createKeySessions_() {
  80555. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80556. this.logger_("waiting for EME key session creation");
  80557. waitForKeySessionCreation$1({
  80558. player: this.player_,
  80559. sourceKeySystems: this.source_.keySystems,
  80560. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  80561. mainPlaylists: this.playlists.main.playlists
  80562. }).then(() => {
  80563. this.logger_("created EME key session");
  80564. this.playlistController_.sourceUpdater_.initializedEme();
  80565. }).catch((err) => {
  80566. this.logger_("error while creating EME key session", err);
  80567. this.player_.error({
  80568. message: "Failed to initialize media keys for EME",
  80569. code: 3
  80570. });
  80571. });
  80572. }
  80573. handleWaitingForKey_() {
  80574. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  80575. this.createKeySessions_();
  80576. }
  80577. setupEme_() {
  80578. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80579. const didSetupEmeOptions = setupEmeOptions$1({
  80580. player: this.player_,
  80581. sourceKeySystems: this.source_.keySystems,
  80582. media: this.playlists.media(),
  80583. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  80584. });
  80585. this.player_.tech_.on("keystatuschange", (e) => {
  80586. if (e.status !== "output-restricted") {
  80587. return;
  80588. }
  80589. const mainPlaylist = this.playlistController_.main();
  80590. if (!mainPlaylist || !mainPlaylist.playlists) {
  80591. return;
  80592. }
  80593. const excludedHDPlaylists = [];
  80594. mainPlaylist.playlists.forEach((playlist) => {
  80595. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  80596. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  80597. playlist.excludeUntil = Infinity;
  80598. excludedHDPlaylists.push(playlist);
  80599. }
  80600. }
  80601. });
  80602. if (excludedHDPlaylists.length) {
  80603. videojs$2.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.', ...excludedHDPlaylists);
  80604. this.playlistController_.fastQualityChange_();
  80605. }
  80606. });
  80607. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  80608. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  80609. if (videojs$2.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  80610. this.playlistController_.sourceUpdater_.initializedEme();
  80611. return;
  80612. }
  80613. this.createKeySessions_();
  80614. }
  80615. setupQualityLevels_() {
  80616. const player = videojs$2.players[this.tech_.options_.playerId];
  80617. if (!player || !player.qualityLevels || this.qualityLevels_) {
  80618. return;
  80619. }
  80620. this.qualityLevels_ = player.qualityLevels();
  80621. this.playlistController_.on("selectedinitialmedia", () => {
  80622. handleVhsLoadedMetadata$1(this.qualityLevels_, this);
  80623. });
  80624. this.playlists.on("mediachange", () => {
  80625. handleVhsMediaChange$1(this.qualityLevels_, this.playlists);
  80626. });
  80627. }
  80628. static version() {
  80629. return {
  80630. "@videojs/http-streaming": version$4$1,
  80631. "mux.js": version$3$1,
  80632. "mpd-parser": version$2$1,
  80633. "m3u8-parser": version$1$2,
  80634. "aes-decrypter": version$7
  80635. };
  80636. }
  80637. version() {
  80638. return this.constructor.version();
  80639. }
  80640. canChangeType() {
  80641. return SourceUpdater$1.canChangeType();
  80642. }
  80643. play() {
  80644. this.playlistController_.play();
  80645. }
  80646. setCurrentTime(currentTime) {
  80647. this.playlistController_.setCurrentTime(currentTime);
  80648. }
  80649. duration() {
  80650. return this.playlistController_.duration();
  80651. }
  80652. seekable() {
  80653. return this.playlistController_.seekable();
  80654. }
  80655. dispose() {
  80656. if (this.playbackWatcher_) {
  80657. this.playbackWatcher_.dispose();
  80658. }
  80659. if (this.playlistController_) {
  80660. this.playlistController_.dispose();
  80661. }
  80662. if (this.qualityLevels_) {
  80663. this.qualityLevels_.dispose();
  80664. }
  80665. if (this.tech_ && this.tech_.vhs) {
  80666. delete this.tech_.vhs;
  80667. }
  80668. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  80669. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  80670. this.mediaSourceUrl_ = null;
  80671. }
  80672. if (this.tech_) {
  80673. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  80674. }
  80675. super.dispose();
  80676. }
  80677. convertToProgramTime(time, callback2) {
  80678. return getProgramTime$1({
  80679. playlist: this.playlistController_.media(),
  80680. time,
  80681. callback: callback2
  80682. });
  80683. }
  80684. seekToProgramTime(programTime, callback2, pauseAfterSeek = true, retryCount = 2) {
  80685. return seekToProgramTime$1({
  80686. programTime,
  80687. playlist: this.playlistController_.media(),
  80688. retryCount,
  80689. pauseAfterSeek,
  80690. seekTo: this.options_.seekTo,
  80691. tech: this.options_.tech,
  80692. callback: callback2
  80693. });
  80694. }
  80695. }
  80696. const VhsSourceHandler$1 = {
  80697. name: "videojs-http-streaming",
  80698. VERSION: version$4$1,
  80699. canHandleSource(srcObj, options2 = {}) {
  80700. const localOptions = merge$2(videojs$2.options, options2);
  80701. return VhsSourceHandler$1.canPlayType(srcObj.type, localOptions);
  80702. },
  80703. handleSource(source, tech, options2 = {}) {
  80704. const localOptions = merge$2(videojs$2.options, options2);
  80705. tech.vhs = new VhsHandler$1(source, tech, localOptions);
  80706. tech.vhs.xhr = xhrFactory$1();
  80707. tech.vhs.src(source.src, source.type);
  80708. return tech.vhs;
  80709. },
  80710. canPlayType(type2, options2) {
  80711. const simpleType = simpleTypeFromSourceType$1(type2);
  80712. if (!simpleType) {
  80713. return "";
  80714. }
  80715. const overrideNative = VhsSourceHandler$1.getOverrideNative(options2);
  80716. const supportsTypeNatively = Vhs$2.supportsTypeNatively(simpleType);
  80717. const canUseMsePlayback = !supportsTypeNatively || overrideNative;
  80718. return canUseMsePlayback ? "maybe" : "";
  80719. },
  80720. getOverrideNative(options2 = {}) {
  80721. const {
  80722. vhs = {}
  80723. } = options2;
  80724. const defaultOverrideNative = !(videojs$2.browser.IS_ANY_SAFARI || videojs$2.browser.IS_IOS);
  80725. const {
  80726. overrideNative = defaultOverrideNative
  80727. } = vhs;
  80728. return overrideNative;
  80729. }
  80730. };
  80731. const supportsNativeMediaSources$1 = () => {
  80732. return browserSupportsCodec$1("avc1.4d400d,mp4a.40.2");
  80733. };
  80734. if (supportsNativeMediaSources$1()) {
  80735. videojs$2.getTech("Html5").registerSourceHandler(VhsSourceHandler$1, 0);
  80736. }
  80737. videojs$2.VhsHandler = VhsHandler$1;
  80738. videojs$2.VhsSourceHandler = VhsSourceHandler$1;
  80739. videojs$2.Vhs = Vhs$2;
  80740. if (!videojs$2.use) {
  80741. videojs$2.registerComponent("Vhs", Vhs$2);
  80742. }
  80743. videojs$2.options.vhs = videojs$2.options.vhs || {};
  80744. if (!videojs$2.getPlugin || !videojs$2.getPlugin("reloadSourceOnError")) {
  80745. videojs$2.registerPlugin("reloadSourceOnError", reloadSourceOnError$1);
  80746. }
  80747. var videoJs = "";
  80748. function _assertThisInitialized(self2) {
  80749. if (self2 === void 0) {
  80750. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80751. }
  80752. return self2;
  80753. }
  80754. function _setPrototypeOf(o, p) {
  80755. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
  80756. o2.__proto__ = p2;
  80757. return o2;
  80758. };
  80759. return _setPrototypeOf(o, p);
  80760. }
  80761. function _inheritsLoose(subClass, superClass) {
  80762. subClass.prototype = Object.create(superClass.prototype);
  80763. subClass.prototype.constructor = subClass;
  80764. _setPrototypeOf(subClass, superClass);
  80765. }
  80766. function _isNativeReflectConstruct() {
  80767. if (typeof Reflect === "undefined" || !Reflect.construct)
  80768. return false;
  80769. if (Reflect.construct.sham)
  80770. return false;
  80771. if (typeof Proxy === "function")
  80772. return true;
  80773. try {
  80774. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  80775. }));
  80776. return true;
  80777. } catch (e) {
  80778. return false;
  80779. }
  80780. }
  80781. function _construct(Parent, args, Class) {
  80782. if (_isNativeReflectConstruct()) {
  80783. _construct = Reflect.construct.bind();
  80784. } else {
  80785. _construct = function _construct2(Parent2, args2, Class2) {
  80786. var a = [null];
  80787. a.push.apply(a, args2);
  80788. var Constructor = Function.bind.apply(Parent2, a);
  80789. var instance = new Constructor();
  80790. if (Class2)
  80791. _setPrototypeOf(instance, Class2.prototype);
  80792. return instance;
  80793. };
  80794. }
  80795. return _construct.apply(null, arguments);
  80796. }
  80797. function _inherits(subClass, superClass) {
  80798. if (typeof superClass !== "function" && superClass !== null) {
  80799. throw new TypeError("Super expression must either be null or a function");
  80800. }
  80801. subClass.prototype = Object.create(superClass && superClass.prototype, {
  80802. constructor: {
  80803. value: subClass,
  80804. writable: true,
  80805. configurable: true
  80806. }
  80807. });
  80808. Object.defineProperty(subClass, "prototype", {
  80809. writable: false
  80810. });
  80811. if (superClass)
  80812. _setPrototypeOf(subClass, superClass);
  80813. }
  80814. var DEFAULT_LOCATION = "http://example.com";
  80815. var resolveUrl$1 = function resolveUrl3(baseUrl, relativeUrl) {
  80816. if (/^[a-z]+:/i.test(relativeUrl)) {
  80817. return relativeUrl;
  80818. }
  80819. if (/^data:/.test(baseUrl)) {
  80820. baseUrl = window_1.location && window_1.location.href || "";
  80821. }
  80822. var nativeURL = typeof window_1.URL === "function";
  80823. var protocolLess = /^\/\//.test(baseUrl);
  80824. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  80825. if (nativeURL) {
  80826. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION);
  80827. } else if (!/\/\//i.test(baseUrl)) {
  80828. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  80829. }
  80830. if (nativeURL) {
  80831. var newUrl = new URL(relativeUrl, baseUrl);
  80832. if (removeLocation) {
  80833. return newUrl.href.slice(DEFAULT_LOCATION.length);
  80834. } else if (protocolLess) {
  80835. return newUrl.href.slice(newUrl.protocol.length);
  80836. }
  80837. return newUrl.href;
  80838. }
  80839. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  80840. };
  80841. var Stream = /* @__PURE__ */ function() {
  80842. function Stream2() {
  80843. this.listeners = {};
  80844. }
  80845. var _proto = Stream2.prototype;
  80846. _proto.on = function on3(type2, listener) {
  80847. if (!this.listeners[type2]) {
  80848. this.listeners[type2] = [];
  80849. }
  80850. this.listeners[type2].push(listener);
  80851. };
  80852. _proto.off = function off2(type2, listener) {
  80853. if (!this.listeners[type2]) {
  80854. return false;
  80855. }
  80856. var index2 = this.listeners[type2].indexOf(listener);
  80857. this.listeners[type2] = this.listeners[type2].slice(0);
  80858. this.listeners[type2].splice(index2, 1);
  80859. return index2 > -1;
  80860. };
  80861. _proto.trigger = function trigger2(type2) {
  80862. var callbacks = this.listeners[type2];
  80863. if (!callbacks) {
  80864. return;
  80865. }
  80866. if (arguments.length === 2) {
  80867. var length = callbacks.length;
  80868. for (var i2 = 0; i2 < length; ++i2) {
  80869. callbacks[i2].call(this, arguments[1]);
  80870. }
  80871. } else {
  80872. var args = Array.prototype.slice.call(arguments, 1);
  80873. var _length = callbacks.length;
  80874. for (var _i = 0; _i < _length; ++_i) {
  80875. callbacks[_i].apply(this, args);
  80876. }
  80877. }
  80878. };
  80879. _proto.dispose = function dispose() {
  80880. this.listeners = {};
  80881. };
  80882. _proto.pipe = function pipe(destination2) {
  80883. this.on("data", function(data) {
  80884. destination2.push(data);
  80885. });
  80886. };
  80887. return Stream2;
  80888. }();
  80889. var atob3 = function atob4(s) {
  80890. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  80891. };
  80892. function decodeB64ToUint8Array(b64Text) {
  80893. var decodedString = atob3(b64Text);
  80894. var array = new Uint8Array(decodedString.length);
  80895. for (var i2 = 0; i2 < decodedString.length; i2++) {
  80896. array[i2] = decodedString.charCodeAt(i2);
  80897. }
  80898. return array;
  80899. }
  80900. /*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */
  80901. var LineStream = /* @__PURE__ */ function(_Stream) {
  80902. _inheritsLoose(LineStream2, _Stream);
  80903. function LineStream2() {
  80904. var _this;
  80905. _this = _Stream.call(this) || this;
  80906. _this.buffer = "";
  80907. return _this;
  80908. }
  80909. var _proto = LineStream2.prototype;
  80910. _proto.push = function push(data) {
  80911. var nextNewline;
  80912. this.buffer += data;
  80913. nextNewline = this.buffer.indexOf("\n");
  80914. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  80915. this.trigger("data", this.buffer.substring(0, nextNewline));
  80916. this.buffer = this.buffer.substring(nextNewline + 1);
  80917. }
  80918. };
  80919. return LineStream2;
  80920. }(Stream);
  80921. var TAB = String.fromCharCode(9);
  80922. var parseByterange = function parseByterange2(byterangeString) {
  80923. var match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  80924. var result = {};
  80925. if (match[1]) {
  80926. result.length = parseInt(match[1], 10);
  80927. }
  80928. if (match[2]) {
  80929. result.offset = parseInt(match[2], 10);
  80930. }
  80931. return result;
  80932. };
  80933. var attributeSeparator = function attributeSeparator2() {
  80934. var key = "[^=]*";
  80935. var value = '"[^"]*"|[^,]*';
  80936. var keyvalue = "(?:" + key + ")=(?:" + value + ")";
  80937. return new RegExp("(?:^|,)(" + keyvalue + ")");
  80938. };
  80939. var parseAttributes$1 = function parseAttributes(attributes) {
  80940. var attrs = attributes.split(attributeSeparator());
  80941. var result = {};
  80942. var i2 = attrs.length;
  80943. var attr;
  80944. while (i2--) {
  80945. if (attrs[i2] === "") {
  80946. continue;
  80947. }
  80948. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  80949. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  80950. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  80951. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  80952. result[attr[0]] = attr[1];
  80953. }
  80954. return result;
  80955. };
  80956. var ParseStream = /* @__PURE__ */ function(_Stream) {
  80957. _inheritsLoose(ParseStream2, _Stream);
  80958. function ParseStream2() {
  80959. var _this;
  80960. _this = _Stream.call(this) || this;
  80961. _this.customParsers = [];
  80962. _this.tagMappers = [];
  80963. return _this;
  80964. }
  80965. var _proto = ParseStream2.prototype;
  80966. _proto.push = function push(line) {
  80967. var _this2 = this;
  80968. var match;
  80969. var event2;
  80970. line = line.trim();
  80971. if (line.length === 0) {
  80972. return;
  80973. }
  80974. if (line[0] !== "#") {
  80975. this.trigger("data", {
  80976. type: "uri",
  80977. uri: line
  80978. });
  80979. return;
  80980. }
  80981. var newLines = this.tagMappers.reduce(function(acc, mapper) {
  80982. var mappedLine = mapper(line);
  80983. if (mappedLine === line) {
  80984. return acc;
  80985. }
  80986. return acc.concat([mappedLine]);
  80987. }, [line]);
  80988. newLines.forEach(function(newLine) {
  80989. for (var i2 = 0; i2 < _this2.customParsers.length; i2++) {
  80990. if (_this2.customParsers[i2].call(_this2, newLine)) {
  80991. return;
  80992. }
  80993. }
  80994. if (newLine.indexOf("#EXT") !== 0) {
  80995. _this2.trigger("data", {
  80996. type: "comment",
  80997. text: newLine.slice(1)
  80998. });
  80999. return;
  81000. }
  81001. newLine = newLine.replace("\r", "");
  81002. match = /^#EXTM3U/.exec(newLine);
  81003. if (match) {
  81004. _this2.trigger("data", {
  81005. type: "tag",
  81006. tagType: "m3u"
  81007. });
  81008. return;
  81009. }
  81010. match = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine);
  81011. if (match) {
  81012. event2 = {
  81013. type: "tag",
  81014. tagType: "inf"
  81015. };
  81016. if (match[1]) {
  81017. event2.duration = parseFloat(match[1]);
  81018. }
  81019. if (match[2]) {
  81020. event2.title = match[2];
  81021. }
  81022. _this2.trigger("data", event2);
  81023. return;
  81024. }
  81025. match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);
  81026. if (match) {
  81027. event2 = {
  81028. type: "tag",
  81029. tagType: "targetduration"
  81030. };
  81031. if (match[1]) {
  81032. event2.duration = parseInt(match[1], 10);
  81033. }
  81034. _this2.trigger("data", event2);
  81035. return;
  81036. }
  81037. match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);
  81038. if (match) {
  81039. event2 = {
  81040. type: "tag",
  81041. tagType: "version"
  81042. };
  81043. if (match[1]) {
  81044. event2.version = parseInt(match[1], 10);
  81045. }
  81046. _this2.trigger("data", event2);
  81047. return;
  81048. }
  81049. match = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81050. if (match) {
  81051. event2 = {
  81052. type: "tag",
  81053. tagType: "media-sequence"
  81054. };
  81055. if (match[1]) {
  81056. event2.number = parseInt(match[1], 10);
  81057. }
  81058. _this2.trigger("data", event2);
  81059. return;
  81060. }
  81061. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81062. if (match) {
  81063. event2 = {
  81064. type: "tag",
  81065. tagType: "discontinuity-sequence"
  81066. };
  81067. if (match[1]) {
  81068. event2.number = parseInt(match[1], 10);
  81069. }
  81070. _this2.trigger("data", event2);
  81071. return;
  81072. }
  81073. match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);
  81074. if (match) {
  81075. event2 = {
  81076. type: "tag",
  81077. tagType: "playlist-type"
  81078. };
  81079. if (match[1]) {
  81080. event2.playlistType = match[1];
  81081. }
  81082. _this2.trigger("data", event2);
  81083. return;
  81084. }
  81085. match = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine);
  81086. if (match) {
  81087. event2 = _extends$2(parseByterange(match[1]), {
  81088. type: "tag",
  81089. tagType: "byterange"
  81090. });
  81091. _this2.trigger("data", event2);
  81092. return;
  81093. }
  81094. match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);
  81095. if (match) {
  81096. event2 = {
  81097. type: "tag",
  81098. tagType: "allow-cache"
  81099. };
  81100. if (match[1]) {
  81101. event2.allowed = !/NO/.test(match[1]);
  81102. }
  81103. _this2.trigger("data", event2);
  81104. return;
  81105. }
  81106. match = /^#EXT-X-MAP:?(.*)$/.exec(newLine);
  81107. if (match) {
  81108. event2 = {
  81109. type: "tag",
  81110. tagType: "map"
  81111. };
  81112. if (match[1]) {
  81113. var attributes = parseAttributes$1(match[1]);
  81114. if (attributes.URI) {
  81115. event2.uri = attributes.URI;
  81116. }
  81117. if (attributes.BYTERANGE) {
  81118. event2.byterange = parseByterange(attributes.BYTERANGE);
  81119. }
  81120. }
  81121. _this2.trigger("data", event2);
  81122. return;
  81123. }
  81124. match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);
  81125. if (match) {
  81126. event2 = {
  81127. type: "tag",
  81128. tagType: "stream-inf"
  81129. };
  81130. if (match[1]) {
  81131. event2.attributes = parseAttributes$1(match[1]);
  81132. if (event2.attributes.RESOLUTION) {
  81133. var split2 = event2.attributes.RESOLUTION.split("x");
  81134. var resolution = {};
  81135. if (split2[0]) {
  81136. resolution.width = parseInt(split2[0], 10);
  81137. }
  81138. if (split2[1]) {
  81139. resolution.height = parseInt(split2[1], 10);
  81140. }
  81141. event2.attributes.RESOLUTION = resolution;
  81142. }
  81143. if (event2.attributes.BANDWIDTH) {
  81144. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  81145. }
  81146. if (event2.attributes["FRAME-RATE"]) {
  81147. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  81148. }
  81149. if (event2.attributes["PROGRAM-ID"]) {
  81150. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  81151. }
  81152. }
  81153. _this2.trigger("data", event2);
  81154. return;
  81155. }
  81156. match = /^#EXT-X-MEDIA:?(.*)$/.exec(newLine);
  81157. if (match) {
  81158. event2 = {
  81159. type: "tag",
  81160. tagType: "media"
  81161. };
  81162. if (match[1]) {
  81163. event2.attributes = parseAttributes$1(match[1]);
  81164. }
  81165. _this2.trigger("data", event2);
  81166. return;
  81167. }
  81168. match = /^#EXT-X-ENDLIST/.exec(newLine);
  81169. if (match) {
  81170. _this2.trigger("data", {
  81171. type: "tag",
  81172. tagType: "endlist"
  81173. });
  81174. return;
  81175. }
  81176. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  81177. if (match) {
  81178. _this2.trigger("data", {
  81179. type: "tag",
  81180. tagType: "discontinuity"
  81181. });
  81182. return;
  81183. }
  81184. match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);
  81185. if (match) {
  81186. event2 = {
  81187. type: "tag",
  81188. tagType: "program-date-time"
  81189. };
  81190. if (match[1]) {
  81191. event2.dateTimeString = match[1];
  81192. event2.dateTimeObject = new Date(match[1]);
  81193. }
  81194. _this2.trigger("data", event2);
  81195. return;
  81196. }
  81197. match = /^#EXT-X-KEY:?(.*)$/.exec(newLine);
  81198. if (match) {
  81199. event2 = {
  81200. type: "tag",
  81201. tagType: "key"
  81202. };
  81203. if (match[1]) {
  81204. event2.attributes = parseAttributes$1(match[1]);
  81205. if (event2.attributes.IV) {
  81206. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  81207. event2.attributes.IV = event2.attributes.IV.substring(2);
  81208. }
  81209. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  81210. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  81211. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  81212. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  81213. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  81214. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  81215. }
  81216. }
  81217. _this2.trigger("data", event2);
  81218. return;
  81219. }
  81220. match = /^#EXT-X-START:?(.*)$/.exec(newLine);
  81221. if (match) {
  81222. event2 = {
  81223. type: "tag",
  81224. tagType: "start"
  81225. };
  81226. if (match[1]) {
  81227. event2.attributes = parseAttributes$1(match[1]);
  81228. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  81229. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  81230. }
  81231. _this2.trigger("data", event2);
  81232. return;
  81233. }
  81234. match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);
  81235. if (match) {
  81236. event2 = {
  81237. type: "tag",
  81238. tagType: "cue-out-cont"
  81239. };
  81240. if (match[1]) {
  81241. event2.data = match[1];
  81242. } else {
  81243. event2.data = "";
  81244. }
  81245. _this2.trigger("data", event2);
  81246. return;
  81247. }
  81248. match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);
  81249. if (match) {
  81250. event2 = {
  81251. type: "tag",
  81252. tagType: "cue-out"
  81253. };
  81254. if (match[1]) {
  81255. event2.data = match[1];
  81256. } else {
  81257. event2.data = "";
  81258. }
  81259. _this2.trigger("data", event2);
  81260. return;
  81261. }
  81262. match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);
  81263. if (match) {
  81264. event2 = {
  81265. type: "tag",
  81266. tagType: "cue-in"
  81267. };
  81268. if (match[1]) {
  81269. event2.data = match[1];
  81270. } else {
  81271. event2.data = "";
  81272. }
  81273. _this2.trigger("data", event2);
  81274. return;
  81275. }
  81276. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  81277. if (match && match[1]) {
  81278. event2 = {
  81279. type: "tag",
  81280. tagType: "skip"
  81281. };
  81282. event2.attributes = parseAttributes$1(match[1]);
  81283. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  81284. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  81285. }
  81286. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  81287. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB);
  81288. }
  81289. _this2.trigger("data", event2);
  81290. return;
  81291. }
  81292. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  81293. if (match && match[1]) {
  81294. event2 = {
  81295. type: "tag",
  81296. tagType: "part"
  81297. };
  81298. event2.attributes = parseAttributes$1(match[1]);
  81299. ["DURATION"].forEach(function(key) {
  81300. if (event2.attributes.hasOwnProperty(key)) {
  81301. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81302. }
  81303. });
  81304. ["INDEPENDENT", "GAP"].forEach(function(key) {
  81305. if (event2.attributes.hasOwnProperty(key)) {
  81306. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81307. }
  81308. });
  81309. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  81310. event2.attributes.byterange = parseByterange(event2.attributes.BYTERANGE);
  81311. }
  81312. _this2.trigger("data", event2);
  81313. return;
  81314. }
  81315. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  81316. if (match && match[1]) {
  81317. event2 = {
  81318. type: "tag",
  81319. tagType: "server-control"
  81320. };
  81321. event2.attributes = parseAttributes$1(match[1]);
  81322. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  81323. if (event2.attributes.hasOwnProperty(key)) {
  81324. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81325. }
  81326. });
  81327. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  81328. if (event2.attributes.hasOwnProperty(key)) {
  81329. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81330. }
  81331. });
  81332. _this2.trigger("data", event2);
  81333. return;
  81334. }
  81335. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  81336. if (match && match[1]) {
  81337. event2 = {
  81338. type: "tag",
  81339. tagType: "part-inf"
  81340. };
  81341. event2.attributes = parseAttributes$1(match[1]);
  81342. ["PART-TARGET"].forEach(function(key) {
  81343. if (event2.attributes.hasOwnProperty(key)) {
  81344. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81345. }
  81346. });
  81347. _this2.trigger("data", event2);
  81348. return;
  81349. }
  81350. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  81351. if (match && match[1]) {
  81352. event2 = {
  81353. type: "tag",
  81354. tagType: "preload-hint"
  81355. };
  81356. event2.attributes = parseAttributes$1(match[1]);
  81357. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  81358. if (event2.attributes.hasOwnProperty(key)) {
  81359. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81360. var subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  81361. event2.attributes.byterange = event2.attributes.byterange || {};
  81362. event2.attributes.byterange[subkey] = event2.attributes[key];
  81363. delete event2.attributes[key];
  81364. }
  81365. });
  81366. _this2.trigger("data", event2);
  81367. return;
  81368. }
  81369. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  81370. if (match && match[1]) {
  81371. event2 = {
  81372. type: "tag",
  81373. tagType: "rendition-report"
  81374. };
  81375. event2.attributes = parseAttributes$1(match[1]);
  81376. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  81377. if (event2.attributes.hasOwnProperty(key)) {
  81378. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81379. }
  81380. });
  81381. _this2.trigger("data", event2);
  81382. return;
  81383. }
  81384. _this2.trigger("data", {
  81385. type: "tag",
  81386. data: newLine.slice(4)
  81387. });
  81388. });
  81389. };
  81390. _proto.addParser = function addParser(_ref) {
  81391. var _this3 = this;
  81392. var expression = _ref.expression, customType = _ref.customType, dataParser = _ref.dataParser, segment = _ref.segment;
  81393. if (typeof dataParser !== "function") {
  81394. dataParser = function dataParser2(line) {
  81395. return line;
  81396. };
  81397. }
  81398. this.customParsers.push(function(line) {
  81399. var match = expression.exec(line);
  81400. if (match) {
  81401. _this3.trigger("data", {
  81402. type: "custom",
  81403. data: dataParser(line),
  81404. customType,
  81405. segment
  81406. });
  81407. return true;
  81408. }
  81409. });
  81410. };
  81411. _proto.addTagMapper = function addTagMapper(_ref2) {
  81412. var expression = _ref2.expression, map = _ref2.map;
  81413. var mapFn = function mapFn2(line) {
  81414. if (expression.test(line)) {
  81415. return map(line);
  81416. }
  81417. return line;
  81418. };
  81419. this.tagMappers.push(mapFn);
  81420. };
  81421. return ParseStream2;
  81422. }(Stream);
  81423. var camelCase = function camelCase2(str) {
  81424. return str.toLowerCase().replace(/-(\w)/g, function(a) {
  81425. return a[1].toUpperCase();
  81426. });
  81427. };
  81428. var camelCaseKeys = function camelCaseKeys2(attributes) {
  81429. var result = {};
  81430. Object.keys(attributes).forEach(function(key) {
  81431. result[camelCase(key)] = attributes[key];
  81432. });
  81433. return result;
  81434. };
  81435. var setHoldBack = function setHoldBack2(manifest) {
  81436. var serverControl = manifest.serverControl, targetDuration = manifest.targetDuration, partTargetDuration = manifest.partTargetDuration;
  81437. if (!serverControl) {
  81438. return;
  81439. }
  81440. var tag = "#EXT-X-SERVER-CONTROL";
  81441. var hb = "holdBack";
  81442. var phb = "partHoldBack";
  81443. var minTargetDuration = targetDuration && targetDuration * 3;
  81444. var minPartDuration = partTargetDuration && partTargetDuration * 2;
  81445. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  81446. serverControl[hb] = minTargetDuration;
  81447. this.trigger("info", {
  81448. message: tag + " defaulting HOLD-BACK to targetDuration * 3 (" + minTargetDuration + ")."
  81449. });
  81450. }
  81451. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  81452. this.trigger("warn", {
  81453. message: tag + " clamping HOLD-BACK (" + serverControl[hb] + ") to targetDuration * 3 (" + minTargetDuration + ")"
  81454. });
  81455. serverControl[hb] = minTargetDuration;
  81456. }
  81457. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  81458. serverControl[phb] = partTargetDuration * 3;
  81459. this.trigger("info", {
  81460. message: tag + " defaulting PART-HOLD-BACK to partTargetDuration * 3 (" + serverControl[phb] + ")."
  81461. });
  81462. }
  81463. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  81464. this.trigger("warn", {
  81465. message: tag + " clamping PART-HOLD-BACK (" + serverControl[phb] + ") to partTargetDuration * 2 (" + minPartDuration + ")."
  81466. });
  81467. serverControl[phb] = minPartDuration;
  81468. }
  81469. };
  81470. var Parser = /* @__PURE__ */ function(_Stream) {
  81471. _inheritsLoose(Parser2, _Stream);
  81472. function Parser2() {
  81473. var _this;
  81474. _this = _Stream.call(this) || this;
  81475. _this.lineStream = new LineStream();
  81476. _this.parseStream = new ParseStream();
  81477. _this.lineStream.pipe(_this.parseStream);
  81478. var self2 = _assertThisInitialized(_this);
  81479. var uris = [];
  81480. var currentUri = {};
  81481. var currentMap;
  81482. var _key;
  81483. var hasParts = false;
  81484. var noop2 = function noop3() {
  81485. };
  81486. var defaultMediaGroups = {
  81487. "AUDIO": {},
  81488. "VIDEO": {},
  81489. "CLOSED-CAPTIONS": {},
  81490. "SUBTITLES": {}
  81491. };
  81492. var widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  81493. var currentTimeline = 0;
  81494. _this.manifest = {
  81495. allowCache: true,
  81496. discontinuityStarts: [],
  81497. segments: []
  81498. };
  81499. var lastByterangeEnd = 0;
  81500. var lastPartByterangeEnd = 0;
  81501. _this.on("end", function() {
  81502. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  81503. return;
  81504. }
  81505. if (!currentUri.map && currentMap) {
  81506. currentUri.map = currentMap;
  81507. }
  81508. if (!currentUri.key && _key) {
  81509. currentUri.key = _key;
  81510. }
  81511. if (!currentUri.timeline && typeof currentTimeline === "number") {
  81512. currentUri.timeline = currentTimeline;
  81513. }
  81514. _this.manifest.preloadSegment = currentUri;
  81515. });
  81516. _this.parseStream.on("data", function(entry) {
  81517. var mediaGroup;
  81518. var rendition;
  81519. ({
  81520. tag: function tag() {
  81521. ({
  81522. version: function version2() {
  81523. if (entry.version) {
  81524. this.manifest.version = entry.version;
  81525. }
  81526. },
  81527. "allow-cache": function allowCache() {
  81528. this.manifest.allowCache = entry.allowed;
  81529. if (!("allowed" in entry)) {
  81530. this.trigger("info", {
  81531. message: "defaulting allowCache to YES"
  81532. });
  81533. this.manifest.allowCache = true;
  81534. }
  81535. },
  81536. byterange: function byterange() {
  81537. var byterange2 = {};
  81538. if ("length" in entry) {
  81539. currentUri.byterange = byterange2;
  81540. byterange2.length = entry.length;
  81541. if (!("offset" in entry)) {
  81542. entry.offset = lastByterangeEnd;
  81543. }
  81544. }
  81545. if ("offset" in entry) {
  81546. currentUri.byterange = byterange2;
  81547. byterange2.offset = entry.offset;
  81548. }
  81549. lastByterangeEnd = byterange2.offset + byterange2.length;
  81550. },
  81551. endlist: function endlist() {
  81552. this.manifest.endList = true;
  81553. },
  81554. inf: function inf() {
  81555. if (!("mediaSequence" in this.manifest)) {
  81556. this.manifest.mediaSequence = 0;
  81557. this.trigger("info", {
  81558. message: "defaulting media sequence to zero"
  81559. });
  81560. }
  81561. if (!("discontinuitySequence" in this.manifest)) {
  81562. this.manifest.discontinuitySequence = 0;
  81563. this.trigger("info", {
  81564. message: "defaulting discontinuity sequence to zero"
  81565. });
  81566. }
  81567. if (entry.duration > 0) {
  81568. currentUri.duration = entry.duration;
  81569. }
  81570. if (entry.duration === 0) {
  81571. currentUri.duration = 0.01;
  81572. this.trigger("info", {
  81573. message: "updating zero segment duration to a small value"
  81574. });
  81575. }
  81576. this.manifest.segments = uris;
  81577. },
  81578. key: function key() {
  81579. if (!entry.attributes) {
  81580. this.trigger("warn", {
  81581. message: "ignoring key declaration without attribute list"
  81582. });
  81583. return;
  81584. }
  81585. if (entry.attributes.METHOD === "NONE") {
  81586. _key = null;
  81587. return;
  81588. }
  81589. if (!entry.attributes.URI) {
  81590. this.trigger("warn", {
  81591. message: "ignoring key declaration without URI"
  81592. });
  81593. return;
  81594. }
  81595. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  81596. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81597. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  81598. attributes: entry.attributes
  81599. };
  81600. return;
  81601. }
  81602. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  81603. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81604. this.manifest.contentProtection["com.microsoft.playready"] = {
  81605. uri: entry.attributes.URI
  81606. };
  81607. return;
  81608. }
  81609. if (entry.attributes.KEYFORMAT === widevineUuid) {
  81610. var VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  81611. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  81612. this.trigger("warn", {
  81613. message: "invalid key method provided for Widevine"
  81614. });
  81615. return;
  81616. }
  81617. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  81618. this.trigger("warn", {
  81619. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  81620. });
  81621. }
  81622. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  81623. this.trigger("warn", {
  81624. message: "invalid key URI provided for Widevine"
  81625. });
  81626. return;
  81627. }
  81628. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  81629. this.trigger("warn", {
  81630. message: "invalid key ID provided for Widevine"
  81631. });
  81632. return;
  81633. }
  81634. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81635. this.manifest.contentProtection["com.widevine.alpha"] = {
  81636. attributes: {
  81637. schemeIdUri: entry.attributes.KEYFORMAT,
  81638. keyId: entry.attributes.KEYID.substring(2)
  81639. },
  81640. pssh: decodeB64ToUint8Array(entry.attributes.URI.split(",")[1])
  81641. };
  81642. return;
  81643. }
  81644. if (!entry.attributes.METHOD) {
  81645. this.trigger("warn", {
  81646. message: "defaulting key method to AES-128"
  81647. });
  81648. }
  81649. _key = {
  81650. method: entry.attributes.METHOD || "AES-128",
  81651. uri: entry.attributes.URI
  81652. };
  81653. if (typeof entry.attributes.IV !== "undefined") {
  81654. _key.iv = entry.attributes.IV;
  81655. }
  81656. },
  81657. "media-sequence": function mediaSequence() {
  81658. if (!isFinite(entry.number)) {
  81659. this.trigger("warn", {
  81660. message: "ignoring invalid media sequence: " + entry.number
  81661. });
  81662. return;
  81663. }
  81664. this.manifest.mediaSequence = entry.number;
  81665. },
  81666. "discontinuity-sequence": function discontinuitySequence() {
  81667. if (!isFinite(entry.number)) {
  81668. this.trigger("warn", {
  81669. message: "ignoring invalid discontinuity sequence: " + entry.number
  81670. });
  81671. return;
  81672. }
  81673. this.manifest.discontinuitySequence = entry.number;
  81674. currentTimeline = entry.number;
  81675. },
  81676. "playlist-type": function playlistType() {
  81677. if (!/VOD|EVENT/.test(entry.playlistType)) {
  81678. this.trigger("warn", {
  81679. message: "ignoring unknown playlist type: " + entry.playlist
  81680. });
  81681. return;
  81682. }
  81683. this.manifest.playlistType = entry.playlistType;
  81684. },
  81685. map: function map() {
  81686. currentMap = {};
  81687. if (entry.uri) {
  81688. currentMap.uri = entry.uri;
  81689. }
  81690. if (entry.byterange) {
  81691. currentMap.byterange = entry.byterange;
  81692. }
  81693. if (_key) {
  81694. currentMap.key = _key;
  81695. }
  81696. },
  81697. "stream-inf": function streamInf() {
  81698. this.manifest.playlists = uris;
  81699. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81700. if (!entry.attributes) {
  81701. this.trigger("warn", {
  81702. message: "ignoring empty stream-inf attributes"
  81703. });
  81704. return;
  81705. }
  81706. if (!currentUri.attributes) {
  81707. currentUri.attributes = {};
  81708. }
  81709. _extends$2(currentUri.attributes, entry.attributes);
  81710. },
  81711. media: function media() {
  81712. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81713. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  81714. this.trigger("warn", {
  81715. message: "ignoring incomplete or missing media group"
  81716. });
  81717. return;
  81718. }
  81719. var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  81720. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  81721. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  81722. rendition = {
  81723. default: /yes/i.test(entry.attributes.DEFAULT)
  81724. };
  81725. if (rendition.default) {
  81726. rendition.autoselect = true;
  81727. } else {
  81728. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  81729. }
  81730. if (entry.attributes.LANGUAGE) {
  81731. rendition.language = entry.attributes.LANGUAGE;
  81732. }
  81733. if (entry.attributes.URI) {
  81734. rendition.uri = entry.attributes.URI;
  81735. }
  81736. if (entry.attributes["INSTREAM-ID"]) {
  81737. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  81738. }
  81739. if (entry.attributes.CHARACTERISTICS) {
  81740. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  81741. }
  81742. if (entry.attributes.FORCED) {
  81743. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  81744. }
  81745. mediaGroup[entry.attributes.NAME] = rendition;
  81746. },
  81747. discontinuity: function discontinuity() {
  81748. currentTimeline += 1;
  81749. currentUri.discontinuity = true;
  81750. this.manifest.discontinuityStarts.push(uris.length);
  81751. },
  81752. "program-date-time": function programDateTime() {
  81753. if (typeof this.manifest.dateTimeString === "undefined") {
  81754. this.manifest.dateTimeString = entry.dateTimeString;
  81755. this.manifest.dateTimeObject = entry.dateTimeObject;
  81756. }
  81757. currentUri.dateTimeString = entry.dateTimeString;
  81758. currentUri.dateTimeObject = entry.dateTimeObject;
  81759. },
  81760. targetduration: function targetduration() {
  81761. if (!isFinite(entry.duration) || entry.duration < 0) {
  81762. this.trigger("warn", {
  81763. message: "ignoring invalid target duration: " + entry.duration
  81764. });
  81765. return;
  81766. }
  81767. this.manifest.targetDuration = entry.duration;
  81768. setHoldBack.call(this, this.manifest);
  81769. },
  81770. start: function start2() {
  81771. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  81772. this.trigger("warn", {
  81773. message: "ignoring start declaration without appropriate attribute list"
  81774. });
  81775. return;
  81776. }
  81777. this.manifest.start = {
  81778. timeOffset: entry.attributes["TIME-OFFSET"],
  81779. precise: entry.attributes.PRECISE
  81780. };
  81781. },
  81782. "cue-out": function cueOut() {
  81783. currentUri.cueOut = entry.data;
  81784. },
  81785. "cue-out-cont": function cueOutCont() {
  81786. currentUri.cueOutCont = entry.data;
  81787. },
  81788. "cue-in": function cueIn() {
  81789. currentUri.cueIn = entry.data;
  81790. },
  81791. "skip": function skip() {
  81792. this.manifest.skip = camelCaseKeys(entry.attributes);
  81793. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  81794. },
  81795. "part": function part() {
  81796. var _this2 = this;
  81797. hasParts = true;
  81798. var segmentIndex = this.manifest.segments.length;
  81799. var part2 = camelCaseKeys(entry.attributes);
  81800. currentUri.parts = currentUri.parts || [];
  81801. currentUri.parts.push(part2);
  81802. if (part2.byterange) {
  81803. if (!part2.byterange.hasOwnProperty("offset")) {
  81804. part2.byterange.offset = lastPartByterangeEnd;
  81805. }
  81806. lastPartByterangeEnd = part2.byterange.offset + part2.byterange.length;
  81807. }
  81808. var partIndex = currentUri.parts.length - 1;
  81809. this.warnOnMissingAttributes_("#EXT-X-PART #" + partIndex + " for segment #" + segmentIndex, entry.attributes, ["URI", "DURATION"]);
  81810. if (this.manifest.renditionReports) {
  81811. this.manifest.renditionReports.forEach(function(r2, i2) {
  81812. if (!r2.hasOwnProperty("lastPart")) {
  81813. _this2.trigger("warn", {
  81814. message: "#EXT-X-RENDITION-REPORT #" + i2 + " lacks required attribute(s): LAST-PART"
  81815. });
  81816. }
  81817. });
  81818. }
  81819. },
  81820. "server-control": function serverControl() {
  81821. var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);
  81822. if (!attrs.hasOwnProperty("canBlockReload")) {
  81823. attrs.canBlockReload = false;
  81824. this.trigger("info", {
  81825. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  81826. });
  81827. }
  81828. setHoldBack.call(this, this.manifest);
  81829. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  81830. this.trigger("warn", {
  81831. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  81832. });
  81833. }
  81834. },
  81835. "preload-hint": function preloadHint() {
  81836. var segmentIndex = this.manifest.segments.length;
  81837. var hint = camelCaseKeys(entry.attributes);
  81838. var isPart = hint.type && hint.type === "PART";
  81839. currentUri.preloadHints = currentUri.preloadHints || [];
  81840. currentUri.preloadHints.push(hint);
  81841. if (hint.byterange) {
  81842. if (!hint.byterange.hasOwnProperty("offset")) {
  81843. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  81844. if (isPart) {
  81845. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  81846. }
  81847. }
  81848. }
  81849. var index2 = currentUri.preloadHints.length - 1;
  81850. this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex, entry.attributes, ["TYPE", "URI"]);
  81851. if (!hint.type) {
  81852. return;
  81853. }
  81854. for (var i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  81855. var otherHint = currentUri.preloadHints[i2];
  81856. if (!otherHint.type) {
  81857. continue;
  81858. }
  81859. if (otherHint.type === hint.type) {
  81860. this.trigger("warn", {
  81861. message: "#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex + " has the same TYPE " + hint.type + " as preload hint #" + i2
  81862. });
  81863. }
  81864. }
  81865. },
  81866. "rendition-report": function renditionReport() {
  81867. var report = camelCaseKeys(entry.attributes);
  81868. this.manifest.renditionReports = this.manifest.renditionReports || [];
  81869. this.manifest.renditionReports.push(report);
  81870. var index2 = this.manifest.renditionReports.length - 1;
  81871. var required = ["LAST-MSN", "URI"];
  81872. if (hasParts) {
  81873. required.push("LAST-PART");
  81874. }
  81875. this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #" + index2, entry.attributes, required);
  81876. },
  81877. "part-inf": function partInf() {
  81878. this.manifest.partInf = camelCaseKeys(entry.attributes);
  81879. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  81880. if (this.manifest.partInf.partTarget) {
  81881. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  81882. }
  81883. setHoldBack.call(this, this.manifest);
  81884. }
  81885. }[entry.tagType] || noop2).call(self2);
  81886. },
  81887. uri: function uri() {
  81888. currentUri.uri = entry.uri;
  81889. uris.push(currentUri);
  81890. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  81891. this.trigger("warn", {
  81892. message: "defaulting segment duration to the target duration"
  81893. });
  81894. currentUri.duration = this.manifest.targetDuration;
  81895. }
  81896. if (_key) {
  81897. currentUri.key = _key;
  81898. }
  81899. currentUri.timeline = currentTimeline;
  81900. if (currentMap) {
  81901. currentUri.map = currentMap;
  81902. }
  81903. lastPartByterangeEnd = 0;
  81904. currentUri = {};
  81905. },
  81906. comment: function comment() {
  81907. },
  81908. custom: function custom() {
  81909. if (entry.segment) {
  81910. currentUri.custom = currentUri.custom || {};
  81911. currentUri.custom[entry.customType] = entry.data;
  81912. } else {
  81913. this.manifest.custom = this.manifest.custom || {};
  81914. this.manifest.custom[entry.customType] = entry.data;
  81915. }
  81916. }
  81917. })[entry.type].call(self2);
  81918. });
  81919. return _this;
  81920. }
  81921. var _proto = Parser2.prototype;
  81922. _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) {
  81923. var missing = [];
  81924. required.forEach(function(key) {
  81925. if (!attributes.hasOwnProperty(key)) {
  81926. missing.push(key);
  81927. }
  81928. });
  81929. if (missing.length) {
  81930. this.trigger("warn", {
  81931. message: identifier + " lacks required attribute(s): " + missing.join(", ")
  81932. });
  81933. }
  81934. };
  81935. _proto.push = function push(chunk) {
  81936. this.lineStream.push(chunk);
  81937. };
  81938. _proto.end = function end() {
  81939. this.lineStream.push("\n");
  81940. this.trigger("end");
  81941. };
  81942. _proto.addParser = function addParser(options2) {
  81943. this.parseStream.addParser(options2);
  81944. };
  81945. _proto.addTagMapper = function addTagMapper(options2) {
  81946. this.parseStream.addTagMapper(options2);
  81947. };
  81948. return Parser2;
  81949. }(Stream);
  81950. var regexs = {
  81951. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  81952. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  81953. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  81954. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  81955. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  81956. text: /^(stpp.ttml.im1t)/,
  81957. muxerVideo: /^(avc0?1)/,
  81958. muxerAudio: /^(mp4a)/,
  81959. muxerText: /a^/
  81960. };
  81961. var mediaTypes = ["video", "audio", "text"];
  81962. var upperMediaTypes = ["Video", "Audio", "Text"];
  81963. var translateLegacyCodec2 = function translateLegacyCodec3(codec) {
  81964. if (!codec) {
  81965. return codec;
  81966. }
  81967. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  81968. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  81969. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  81970. return "avc1." + profileHex + "00" + avcLevelHex;
  81971. });
  81972. };
  81973. var parseCodecs2 = function parseCodecs3(codecString) {
  81974. if (codecString === void 0) {
  81975. codecString = "";
  81976. }
  81977. var codecs = codecString.split(",");
  81978. var result = [];
  81979. codecs.forEach(function(codec) {
  81980. codec = codec.trim();
  81981. var codecType;
  81982. mediaTypes.forEach(function(name) {
  81983. var match = regexs[name].exec(codec.toLowerCase());
  81984. if (!match || match.length <= 1) {
  81985. return;
  81986. }
  81987. codecType = name;
  81988. var type2 = codec.substring(0, match[1].length);
  81989. var details = codec.replace(type2, "");
  81990. result.push({
  81991. type: type2,
  81992. details,
  81993. mediaType: name
  81994. });
  81995. });
  81996. if (!codecType) {
  81997. result.push({
  81998. type: codec,
  81999. details: "",
  82000. mediaType: "unknown"
  82001. });
  82002. }
  82003. });
  82004. return result;
  82005. };
  82006. var codecsFromDefault2 = function codecsFromDefault3(master, audioGroupId) {
  82007. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  82008. return null;
  82009. }
  82010. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  82011. if (!audioGroup) {
  82012. return null;
  82013. }
  82014. for (var name in audioGroup) {
  82015. var audioType = audioGroup[name];
  82016. if (audioType.default && audioType.playlists) {
  82017. return parseCodecs2(audioType.playlists[0].attributes.CODECS);
  82018. }
  82019. }
  82020. return null;
  82021. };
  82022. var isAudioCodec2 = function isAudioCodec3(codec) {
  82023. if (codec === void 0) {
  82024. codec = "";
  82025. }
  82026. return regexs.audio.test(codec.trim().toLowerCase());
  82027. };
  82028. var isTextCodec2 = function isTextCodec3(codec) {
  82029. if (codec === void 0) {
  82030. codec = "";
  82031. }
  82032. return regexs.text.test(codec.trim().toLowerCase());
  82033. };
  82034. var getMimeForCodec2 = function getMimeForCodec3(codecString) {
  82035. if (!codecString || typeof codecString !== "string") {
  82036. return;
  82037. }
  82038. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  82039. return translateLegacyCodec2(c.trim());
  82040. });
  82041. var type2 = "video";
  82042. if (codecs.length === 1 && isAudioCodec2(codecs[0])) {
  82043. type2 = "audio";
  82044. } else if (codecs.length === 1 && isTextCodec2(codecs[0])) {
  82045. type2 = "application";
  82046. }
  82047. var container = "mp4";
  82048. if (codecs.every(function(c) {
  82049. return regexs.mp4.test(c);
  82050. })) {
  82051. container = "mp4";
  82052. } else if (codecs.every(function(c) {
  82053. return regexs.webm.test(c);
  82054. })) {
  82055. container = "webm";
  82056. } else if (codecs.every(function(c) {
  82057. return regexs.ogg.test(c);
  82058. })) {
  82059. container = "ogg";
  82060. }
  82061. return type2 + "/" + container + ';codecs="' + codecString + '"';
  82062. };
  82063. var browserSupportsCodec2 = function browserSupportsCodec3(codecString) {
  82064. if (codecString === void 0) {
  82065. codecString = "";
  82066. }
  82067. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec2(codecString)) || false;
  82068. };
  82069. var muxerSupportsCodec2 = function muxerSupportsCodec3(codecString) {
  82070. if (codecString === void 0) {
  82071. codecString = "";
  82072. }
  82073. return codecString.toLowerCase().split(",").every(function(codec) {
  82074. codec = codec.trim();
  82075. for (var i2 = 0; i2 < upperMediaTypes.length; i2++) {
  82076. var type2 = upperMediaTypes[i2];
  82077. if (regexs["muxer" + type2].test(codec)) {
  82078. return true;
  82079. }
  82080. }
  82081. return false;
  82082. });
  82083. };
  82084. var DEFAULT_AUDIO_CODEC = "mp4a.40.2";
  82085. var DEFAULT_VIDEO_CODEC = "avc1.4d400d";
  82086. var MPEGURL_REGEX = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  82087. var DASH_REGEX = /^application\/dash\+xml/i;
  82088. var simpleTypeFromSourceType2 = function simpleTypeFromSourceType3(type2) {
  82089. if (MPEGURL_REGEX.test(type2)) {
  82090. return "hls";
  82091. }
  82092. if (DASH_REGEX.test(type2)) {
  82093. return "dash";
  82094. }
  82095. if (type2 === "application/vnd.videojs.vhs+json") {
  82096. return "vhs-json";
  82097. }
  82098. return null;
  82099. };
  82100. var countBits2 = function countBits3(x) {
  82101. return x.toString(2).length;
  82102. };
  82103. var countBytes2 = function countBytes3(x) {
  82104. return Math.ceil(countBits2(x) / 8);
  82105. };
  82106. var isArrayBufferView2 = function isArrayBufferView3(obj) {
  82107. if (ArrayBuffer.isView === "function") {
  82108. return ArrayBuffer.isView(obj);
  82109. }
  82110. return obj && obj.buffer instanceof ArrayBuffer;
  82111. };
  82112. var isTypedArray2 = function isTypedArray3(obj) {
  82113. return isArrayBufferView2(obj);
  82114. };
  82115. var toUint82 = function toUint83(bytes) {
  82116. if (bytes instanceof Uint8Array) {
  82117. return bytes;
  82118. }
  82119. if (!Array.isArray(bytes) && !isTypedArray2(bytes) && !(bytes instanceof ArrayBuffer)) {
  82120. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  82121. bytes = 0;
  82122. } else {
  82123. bytes = [bytes];
  82124. }
  82125. }
  82126. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  82127. };
  82128. var BigInt = window_1.BigInt || Number;
  82129. var BYTE_TABLE = [BigInt("0x1"), BigInt("0x100"), BigInt("0x10000"), BigInt("0x1000000"), BigInt("0x100000000"), BigInt("0x10000000000"), BigInt("0x1000000000000"), BigInt("0x100000000000000"), BigInt("0x10000000000000000")];
  82130. (function() {
  82131. var a = new Uint16Array([65484]);
  82132. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  82133. if (b[0] === 255) {
  82134. return "big";
  82135. }
  82136. if (b[0] === 204) {
  82137. return "little";
  82138. }
  82139. return "unknown";
  82140. })();
  82141. var bytesToNumber2 = function bytesToNumber3(bytes, _temp) {
  82142. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  82143. bytes = toUint82(bytes);
  82144. var fn2 = le ? "reduce" : "reduceRight";
  82145. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  82146. var number = obj.call(bytes, function(total, byte, i2) {
  82147. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82148. return total + BigInt(byte) * BYTE_TABLE[exponent];
  82149. }, BigInt(0));
  82150. if (signed) {
  82151. var max2 = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);
  82152. number = BigInt(number);
  82153. if (number > max2) {
  82154. number -= max2;
  82155. number -= max2;
  82156. number -= BigInt(2);
  82157. }
  82158. }
  82159. return Number(number);
  82160. };
  82161. var numberToBytes2 = function numberToBytes3(number, _temp2) {
  82162. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  82163. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  82164. number = 0;
  82165. }
  82166. number = BigInt(number);
  82167. var byteCount = countBytes2(number);
  82168. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  82169. for (var i2 = 0; i2 < byteCount; i2++) {
  82170. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82171. bytes[byteIndex] = Number(number / BYTE_TABLE[i2] & BigInt(255));
  82172. if (number < 0) {
  82173. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  82174. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  82175. }
  82176. }
  82177. return bytes;
  82178. };
  82179. var stringToBytes2 = function stringToBytes3(string, stringIsBytes) {
  82180. if (typeof string !== "string" && string && typeof string.toString === "function") {
  82181. string = string.toString();
  82182. }
  82183. if (typeof string !== "string") {
  82184. return new Uint8Array();
  82185. }
  82186. if (!stringIsBytes) {
  82187. string = unescape(encodeURIComponent(string));
  82188. }
  82189. var view = new Uint8Array(string.length);
  82190. for (var i2 = 0; i2 < string.length; i2++) {
  82191. view[i2] = string.charCodeAt(i2);
  82192. }
  82193. return view;
  82194. };
  82195. var concatTypedArrays2 = function concatTypedArrays3() {
  82196. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  82197. buffers[_key] = arguments[_key];
  82198. }
  82199. buffers = buffers.filter(function(b) {
  82200. return b && (b.byteLength || b.length) && typeof b !== "string";
  82201. });
  82202. if (buffers.length <= 1) {
  82203. return toUint82(buffers[0]);
  82204. }
  82205. var totalLen = buffers.reduce(function(total, buf, i2) {
  82206. return total + (buf.byteLength || buf.length);
  82207. }, 0);
  82208. var tempBuffer = new Uint8Array(totalLen);
  82209. var offset = 0;
  82210. buffers.forEach(function(buf) {
  82211. buf = toUint82(buf);
  82212. tempBuffer.set(buf, offset);
  82213. offset += buf.byteLength;
  82214. });
  82215. return tempBuffer;
  82216. };
  82217. var bytesMatch2 = function bytesMatch3(a, b, _temp3) {
  82218. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  82219. a = toUint82(a);
  82220. b = toUint82(b);
  82221. var fn2 = b.every ? b.every : Array.prototype.every;
  82222. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  82223. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  82224. return bByte === aByte;
  82225. });
  82226. };
  82227. var forEachMediaGroup$1 = function forEachMediaGroup2(master, groups, callback2) {
  82228. groups.forEach(function(mediaType) {
  82229. for (var groupKey in master.mediaGroups[mediaType]) {
  82230. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  82231. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  82232. callback2(mediaProperties, mediaType, groupKey, labelKey);
  82233. }
  82234. }
  82235. });
  82236. };
  82237. /*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */
  82238. var isObject$1 = function isObject(obj) {
  82239. return !!obj && typeof obj === "object";
  82240. };
  82241. var merge = function merge2() {
  82242. for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
  82243. objects[_key] = arguments[_key];
  82244. }
  82245. return objects.reduce(function(result, source) {
  82246. if (typeof source !== "object") {
  82247. return result;
  82248. }
  82249. Object.keys(source).forEach(function(key) {
  82250. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  82251. result[key] = result[key].concat(source[key]);
  82252. } else if (isObject$1(result[key]) && isObject$1(source[key])) {
  82253. result[key] = merge2(result[key], source[key]);
  82254. } else {
  82255. result[key] = source[key];
  82256. }
  82257. });
  82258. return result;
  82259. }, {});
  82260. };
  82261. var values = function values2(o) {
  82262. return Object.keys(o).map(function(k) {
  82263. return o[k];
  82264. });
  82265. };
  82266. var range = function range2(start2, end) {
  82267. var result = [];
  82268. for (var i2 = start2; i2 < end; i2++) {
  82269. result.push(i2);
  82270. }
  82271. return result;
  82272. };
  82273. var flatten = function flatten2(lists) {
  82274. return lists.reduce(function(x, y) {
  82275. return x.concat(y);
  82276. }, []);
  82277. };
  82278. var from = function from2(list) {
  82279. if (!list.length) {
  82280. return [];
  82281. }
  82282. var result = [];
  82283. for (var i2 = 0; i2 < list.length; i2++) {
  82284. result.push(list[i2]);
  82285. }
  82286. return result;
  82287. };
  82288. var findIndexes = function findIndexes2(l, key) {
  82289. return l.reduce(function(a, e, i2) {
  82290. if (e[key]) {
  82291. a.push(i2);
  82292. }
  82293. return a;
  82294. }, []);
  82295. };
  82296. var findIndex = function findIndex2(list, matchingFunction) {
  82297. for (var i2 = 0; i2 < list.length; i2++) {
  82298. if (matchingFunction(list[i2])) {
  82299. return i2;
  82300. }
  82301. }
  82302. return -1;
  82303. };
  82304. var union = function union2(lists, keyFunction) {
  82305. return values(lists.reduce(function(acc, list) {
  82306. list.forEach(function(el) {
  82307. acc[keyFunction(el)] = el;
  82308. });
  82309. return acc;
  82310. }, {}));
  82311. };
  82312. var errors = {
  82313. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  82314. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  82315. DASH_INVALID_XML: "DASH_INVALID_XML",
  82316. NO_BASE_URL: "NO_BASE_URL",
  82317. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  82318. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  82319. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  82320. };
  82321. var urlTypeToSegment = function urlTypeToSegment2(_ref) {
  82322. var _ref$baseUrl = _ref.baseUrl, baseUrl = _ref$baseUrl === void 0 ? "" : _ref$baseUrl, _ref$source = _ref.source, source = _ref$source === void 0 ? "" : _ref$source, _ref$range = _ref.range, range3 = _ref$range === void 0 ? "" : _ref$range, _ref$indexRange = _ref.indexRange, indexRange = _ref$indexRange === void 0 ? "" : _ref$indexRange;
  82323. var segment = {
  82324. uri: source,
  82325. resolvedUri: resolveUrl$1(baseUrl || "", source)
  82326. };
  82327. if (range3 || indexRange) {
  82328. var rangeStr = range3 ? range3 : indexRange;
  82329. var ranges = rangeStr.split("-");
  82330. var startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  82331. var endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  82332. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  82333. startRange = Number(startRange);
  82334. }
  82335. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  82336. endRange = Number(endRange);
  82337. }
  82338. var length;
  82339. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  82340. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  82341. } else {
  82342. length = endRange - startRange + 1;
  82343. }
  82344. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  82345. length = Number(length);
  82346. }
  82347. segment.byterange = {
  82348. length,
  82349. offset: startRange
  82350. };
  82351. }
  82352. return segment;
  82353. };
  82354. var byteRangeToString = function byteRangeToString2(byterange) {
  82355. var endRange;
  82356. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  82357. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  82358. } else {
  82359. endRange = byterange.offset + byterange.length - 1;
  82360. }
  82361. return byterange.offset + "-" + endRange;
  82362. };
  82363. var parseEndNumber = function parseEndNumber2(endNumber) {
  82364. if (endNumber && typeof endNumber !== "number") {
  82365. endNumber = parseInt(endNumber, 10);
  82366. }
  82367. if (isNaN(endNumber)) {
  82368. return null;
  82369. }
  82370. return endNumber;
  82371. };
  82372. var segmentRange = {
  82373. static: function _static(attributes) {
  82374. var duration5 = attributes.duration, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, sourceDuration = attributes.sourceDuration, periodDuration = attributes.periodDuration;
  82375. var endNumber = parseEndNumber(attributes.endNumber);
  82376. var segmentDuration = duration5 / timescale2;
  82377. if (typeof endNumber === "number") {
  82378. return {
  82379. start: 0,
  82380. end: endNumber
  82381. };
  82382. }
  82383. if (typeof periodDuration === "number") {
  82384. return {
  82385. start: 0,
  82386. end: periodDuration / segmentDuration
  82387. };
  82388. }
  82389. return {
  82390. start: 0,
  82391. end: sourceDuration / segmentDuration
  82392. };
  82393. },
  82394. dynamic: function dynamic(attributes) {
  82395. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, duration5 = attributes.duration, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp, _attributes$timeShift = attributes.timeShiftBufferDepth, timeShiftBufferDepth2 = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;
  82396. var endNumber = parseEndNumber(attributes.endNumber);
  82397. var now2 = (NOW + clientOffset) / 1e3;
  82398. var periodStartWC = availabilityStartTime2 + periodStart;
  82399. var periodEndWC = now2 + minimumUpdatePeriod2;
  82400. var periodDuration = periodEndWC - periodStartWC;
  82401. var segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  82402. var availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  82403. var availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  82404. return {
  82405. start: Math.max(0, availableStart),
  82406. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  82407. };
  82408. }
  82409. };
  82410. var toSegments = function toSegments2(attributes) {
  82411. return function(number) {
  82412. var duration5 = attributes.duration, _attributes$timescale3 = attributes.timescale, timescale2 = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3, periodStart = attributes.periodStart, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;
  82413. return {
  82414. number: startNumber2 + number,
  82415. duration: duration5 / timescale2,
  82416. timeline: periodStart,
  82417. time: number * duration5
  82418. };
  82419. };
  82420. };
  82421. var parseByDuration = function parseByDuration2(attributes) {
  82422. var type2 = attributes.type, duration5 = attributes.duration, _attributes$timescale4 = attributes.timescale, timescale2 = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4, periodDuration = attributes.periodDuration, sourceDuration = attributes.sourceDuration;
  82423. var _segmentRange$type = segmentRange[type2](attributes), start2 = _segmentRange$type.start, end = _segmentRange$type.end;
  82424. var segments = range(start2, end).map(toSegments(attributes));
  82425. if (type2 === "static") {
  82426. var index2 = segments.length - 1;
  82427. var sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  82428. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  82429. }
  82430. return segments;
  82431. };
  82432. var segmentsFromBase = function segmentsFromBase2(attributes) {
  82433. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ, sourceDuration = attributes.sourceDuration, _attributes$indexRang = attributes.indexRange, indexRange = _attributes$indexRang === void 0 ? "" : _attributes$indexRang, periodStart = attributes.periodStart, presentationTime = attributes.presentationTime, _attributes$number = attributes.number, number = _attributes$number === void 0 ? 0 : _attributes$number, duration5 = attributes.duration;
  82434. if (!baseUrl) {
  82435. throw new Error(errors.NO_BASE_URL);
  82436. }
  82437. var initSegment = urlTypeToSegment({
  82438. baseUrl,
  82439. source: initialization.sourceURL,
  82440. range: initialization.range
  82441. });
  82442. var segment = urlTypeToSegment({
  82443. baseUrl,
  82444. source: baseUrl,
  82445. indexRange
  82446. });
  82447. segment.map = initSegment;
  82448. if (duration5) {
  82449. var segmentTimeInfo = parseByDuration(attributes);
  82450. if (segmentTimeInfo.length) {
  82451. segment.duration = segmentTimeInfo[0].duration;
  82452. segment.timeline = segmentTimeInfo[0].timeline;
  82453. }
  82454. } else if (sourceDuration) {
  82455. segment.duration = sourceDuration;
  82456. segment.timeline = periodStart;
  82457. }
  82458. segment.presentationTime = presentationTime || periodStart;
  82459. segment.number = number;
  82460. return [segment];
  82461. };
  82462. var addSidxSegmentsToPlaylist$1 = function addSidxSegmentsToPlaylist(playlist, sidx, baseUrl) {
  82463. var initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  82464. var sourceDuration = playlist.sidx.duration;
  82465. var timeline = playlist.timeline || 0;
  82466. var sidxByteRange = playlist.sidx.byterange;
  82467. var sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  82468. var timescale2 = sidx.timescale;
  82469. var mediaReferences = sidx.references.filter(function(r2) {
  82470. return r2.referenceType !== 1;
  82471. });
  82472. var segments = [];
  82473. var type2 = playlist.endList ? "static" : "dynamic";
  82474. var periodStart = playlist.sidx.timeline;
  82475. var presentationTime = periodStart;
  82476. var number = playlist.mediaSequence || 0;
  82477. var startIndex;
  82478. if (typeof sidx.firstOffset === "bigint") {
  82479. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  82480. } else {
  82481. startIndex = sidxEnd + sidx.firstOffset;
  82482. }
  82483. for (var i2 = 0; i2 < mediaReferences.length; i2++) {
  82484. var reference = sidx.references[i2];
  82485. var size = reference.referencedSize;
  82486. var duration5 = reference.subsegmentDuration;
  82487. var endIndex = void 0;
  82488. if (typeof startIndex === "bigint") {
  82489. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  82490. } else {
  82491. endIndex = startIndex + size - 1;
  82492. }
  82493. var indexRange = startIndex + "-" + endIndex;
  82494. var attributes = {
  82495. baseUrl,
  82496. timescale: timescale2,
  82497. timeline,
  82498. periodStart,
  82499. presentationTime,
  82500. number,
  82501. duration: duration5,
  82502. sourceDuration,
  82503. indexRange,
  82504. type: type2
  82505. };
  82506. var segment = segmentsFromBase(attributes)[0];
  82507. if (initSegment) {
  82508. segment.map = initSegment;
  82509. }
  82510. segments.push(segment);
  82511. if (typeof startIndex === "bigint") {
  82512. startIndex += window_1.BigInt(size);
  82513. } else {
  82514. startIndex += size;
  82515. }
  82516. presentationTime += duration5 / timescale2;
  82517. number++;
  82518. }
  82519. playlist.segments = segments;
  82520. return playlist;
  82521. };
  82522. var SUPPORTED_MEDIA_TYPES = ["AUDIO", "SUBTITLES"];
  82523. var TIME_FUDGE = 1 / 60;
  82524. var getUniqueTimelineStarts = function getUniqueTimelineStarts2(timelineStarts) {
  82525. return union(timelineStarts, function(_ref) {
  82526. var timeline = _ref.timeline;
  82527. return timeline;
  82528. }).sort(function(a, b) {
  82529. return a.timeline > b.timeline ? 1 : -1;
  82530. });
  82531. };
  82532. var findPlaylistWithName = function findPlaylistWithName2(playlists, name) {
  82533. for (var i2 = 0; i2 < playlists.length; i2++) {
  82534. if (playlists[i2].attributes.NAME === name) {
  82535. return playlists[i2];
  82536. }
  82537. }
  82538. return null;
  82539. };
  82540. var getMediaGroupPlaylists = function getMediaGroupPlaylists2(manifest) {
  82541. var mediaGroupPlaylists = [];
  82542. forEachMediaGroup$1(manifest, SUPPORTED_MEDIA_TYPES, function(properties, type2, group, label) {
  82543. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  82544. });
  82545. return mediaGroupPlaylists;
  82546. };
  82547. var updateMediaSequenceForPlaylist = function updateMediaSequenceForPlaylist2(_ref2) {
  82548. var playlist = _ref2.playlist, mediaSequence = _ref2.mediaSequence;
  82549. playlist.mediaSequence = mediaSequence;
  82550. playlist.segments.forEach(function(segment, index2) {
  82551. segment.number = playlist.mediaSequence + index2;
  82552. });
  82553. };
  82554. var updateSequenceNumbers = function updateSequenceNumbers2(_ref3) {
  82555. var oldPlaylists = _ref3.oldPlaylists, newPlaylists = _ref3.newPlaylists, timelineStarts = _ref3.timelineStarts;
  82556. newPlaylists.forEach(function(playlist) {
  82557. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref4) {
  82558. var timeline = _ref4.timeline;
  82559. return timeline === playlist.timeline;
  82560. });
  82561. var oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);
  82562. if (!oldPlaylist) {
  82563. return;
  82564. }
  82565. if (playlist.sidx) {
  82566. return;
  82567. }
  82568. var firstNewSegment = playlist.segments[0];
  82569. var oldMatchingSegmentIndex = findIndex(oldPlaylist.segments, function(oldSegment) {
  82570. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;
  82571. });
  82572. if (oldMatchingSegmentIndex === -1) {
  82573. updateMediaSequenceForPlaylist({
  82574. playlist,
  82575. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  82576. });
  82577. playlist.segments[0].discontinuity = true;
  82578. playlist.discontinuityStarts.unshift(0);
  82579. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  82580. playlist.discontinuitySequence--;
  82581. }
  82582. return;
  82583. }
  82584. var oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  82585. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  82586. firstNewSegment.discontinuity = true;
  82587. playlist.discontinuityStarts.unshift(0);
  82588. playlist.discontinuitySequence--;
  82589. }
  82590. updateMediaSequenceForPlaylist({
  82591. playlist,
  82592. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  82593. });
  82594. });
  82595. };
  82596. var positionManifestOnTimeline = function positionManifestOnTimeline2(_ref5) {
  82597. var oldManifest = _ref5.oldManifest, newManifest = _ref5.newManifest;
  82598. var oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));
  82599. var newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest));
  82600. newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);
  82601. updateSequenceNumbers({
  82602. oldPlaylists,
  82603. newPlaylists,
  82604. timelineStarts: newManifest.timelineStarts
  82605. });
  82606. return newManifest;
  82607. };
  82608. var generateSidxKey = function generateSidxKey2(sidx) {
  82609. return sidx && sidx.uri + "-" + byteRangeToString(sidx.byterange);
  82610. };
  82611. var mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists2(playlists) {
  82612. var mergedPlaylists = values(playlists.reduce(function(acc, playlist) {
  82613. var name = playlist.attributes.id + (playlist.attributes.lang || "");
  82614. if (!acc[name]) {
  82615. acc[name] = playlist;
  82616. acc[name].attributes.timelineStarts = [];
  82617. } else {
  82618. if (playlist.segments) {
  82619. var _acc$name$segments;
  82620. if (playlist.segments[0]) {
  82621. playlist.segments[0].discontinuity = true;
  82622. }
  82623. (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments);
  82624. }
  82625. if (playlist.attributes.contentProtection) {
  82626. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  82627. }
  82628. }
  82629. acc[name].attributes.timelineStarts.push({
  82630. start: playlist.attributes.periodStart,
  82631. timeline: playlist.attributes.periodStart
  82632. });
  82633. return acc;
  82634. }, {}));
  82635. return mergedPlaylists.map(function(playlist) {
  82636. playlist.discontinuityStarts = findIndexes(playlist.segments || [], "discontinuity");
  82637. return playlist;
  82638. });
  82639. };
  82640. var addSidxSegmentsToPlaylist2 = function addSidxSegmentsToPlaylist3(playlist, sidxMapping) {
  82641. var sidxKey = generateSidxKey(playlist.sidx);
  82642. var sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  82643. if (sidxMatch) {
  82644. addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  82645. }
  82646. return playlist;
  82647. };
  82648. var addSidxSegmentsToPlaylists = function addSidxSegmentsToPlaylists2(playlists, sidxMapping) {
  82649. if (sidxMapping === void 0) {
  82650. sidxMapping = {};
  82651. }
  82652. if (!Object.keys(sidxMapping).length) {
  82653. return playlists;
  82654. }
  82655. for (var i2 in playlists) {
  82656. playlists[i2] = addSidxSegmentsToPlaylist2(playlists[i2], sidxMapping);
  82657. }
  82658. return playlists;
  82659. };
  82660. var formatAudioPlaylist = function formatAudioPlaylist2(_ref, isAudioOnly3) {
  82661. var _attributes;
  82662. var attributes = _ref.attributes, segments = _ref.segments, sidx = _ref.sidx, mediaSequence = _ref.mediaSequence, discontinuitySequence = _ref.discontinuitySequence, discontinuityStarts = _ref.discontinuityStarts;
  82663. var playlist = {
  82664. attributes: (_attributes = {
  82665. NAME: attributes.id,
  82666. BANDWIDTH: attributes.bandwidth,
  82667. CODECS: attributes.codecs
  82668. }, _attributes["PROGRAM-ID"] = 1, _attributes),
  82669. uri: "",
  82670. endList: attributes.type === "static",
  82671. timeline: attributes.periodStart,
  82672. resolvedUri: "",
  82673. targetDuration: attributes.duration,
  82674. discontinuitySequence,
  82675. discontinuityStarts,
  82676. timelineStarts: attributes.timelineStarts,
  82677. mediaSequence,
  82678. segments
  82679. };
  82680. if (attributes.contentProtection) {
  82681. playlist.contentProtection = attributes.contentProtection;
  82682. }
  82683. if (sidx) {
  82684. playlist.sidx = sidx;
  82685. }
  82686. if (isAudioOnly3) {
  82687. playlist.attributes.AUDIO = "audio";
  82688. playlist.attributes.SUBTITLES = "subs";
  82689. }
  82690. return playlist;
  82691. };
  82692. var formatVttPlaylist = function formatVttPlaylist2(_ref2) {
  82693. var _m3u8Attributes;
  82694. var attributes = _ref2.attributes, segments = _ref2.segments, mediaSequence = _ref2.mediaSequence, discontinuityStarts = _ref2.discontinuityStarts, discontinuitySequence = _ref2.discontinuitySequence;
  82695. if (typeof segments === "undefined") {
  82696. segments = [{
  82697. uri: attributes.baseUrl,
  82698. timeline: attributes.periodStart,
  82699. resolvedUri: attributes.baseUrl || "",
  82700. duration: attributes.sourceDuration,
  82701. number: 0
  82702. }];
  82703. attributes.duration = attributes.sourceDuration;
  82704. }
  82705. var m3u8Attributes = (_m3u8Attributes = {
  82706. NAME: attributes.id,
  82707. BANDWIDTH: attributes.bandwidth
  82708. }, _m3u8Attributes["PROGRAM-ID"] = 1, _m3u8Attributes);
  82709. if (attributes.codecs) {
  82710. m3u8Attributes.CODECS = attributes.codecs;
  82711. }
  82712. return {
  82713. attributes: m3u8Attributes,
  82714. uri: "",
  82715. endList: attributes.type === "static",
  82716. timeline: attributes.periodStart,
  82717. resolvedUri: attributes.baseUrl || "",
  82718. targetDuration: attributes.duration,
  82719. timelineStarts: attributes.timelineStarts,
  82720. discontinuityStarts,
  82721. discontinuitySequence,
  82722. mediaSequence,
  82723. segments
  82724. };
  82725. };
  82726. var organizeAudioPlaylists = function organizeAudioPlaylists2(playlists, sidxMapping, isAudioOnly3) {
  82727. if (sidxMapping === void 0) {
  82728. sidxMapping = {};
  82729. }
  82730. if (isAudioOnly3 === void 0) {
  82731. isAudioOnly3 = false;
  82732. }
  82733. var mainPlaylist;
  82734. var formattedPlaylists = playlists.reduce(function(a, playlist) {
  82735. var role = playlist.attributes.role && playlist.attributes.role.value || "";
  82736. var language = playlist.attributes.lang || "";
  82737. var label = playlist.attributes.label || "main";
  82738. if (language && !playlist.attributes.label) {
  82739. var roleLabel = role ? " (" + role + ")" : "";
  82740. label = "" + playlist.attributes.lang + roleLabel;
  82741. }
  82742. if (!a[label]) {
  82743. a[label] = {
  82744. language,
  82745. autoselect: true,
  82746. default: role === "main",
  82747. playlists: [],
  82748. uri: ""
  82749. };
  82750. }
  82751. var formatted = addSidxSegmentsToPlaylist2(formatAudioPlaylist(playlist, isAudioOnly3), sidxMapping);
  82752. a[label].playlists.push(formatted);
  82753. if (typeof mainPlaylist === "undefined" && role === "main") {
  82754. mainPlaylist = playlist;
  82755. mainPlaylist.default = true;
  82756. }
  82757. return a;
  82758. }, {});
  82759. if (!mainPlaylist) {
  82760. var firstLabel = Object.keys(formattedPlaylists)[0];
  82761. formattedPlaylists[firstLabel].default = true;
  82762. }
  82763. return formattedPlaylists;
  82764. };
  82765. var organizeVttPlaylists = function organizeVttPlaylists2(playlists, sidxMapping) {
  82766. if (sidxMapping === void 0) {
  82767. sidxMapping = {};
  82768. }
  82769. return playlists.reduce(function(a, playlist) {
  82770. var label = playlist.attributes.lang || "text";
  82771. if (!a[label]) {
  82772. a[label] = {
  82773. language: label,
  82774. default: false,
  82775. autoselect: false,
  82776. playlists: [],
  82777. uri: ""
  82778. };
  82779. }
  82780. a[label].playlists.push(addSidxSegmentsToPlaylist2(formatVttPlaylist(playlist), sidxMapping));
  82781. return a;
  82782. }, {});
  82783. };
  82784. var organizeCaptionServices = function organizeCaptionServices2(captionServices) {
  82785. return captionServices.reduce(function(svcObj, svc) {
  82786. if (!svc) {
  82787. return svcObj;
  82788. }
  82789. svc.forEach(function(service) {
  82790. var channel = service.channel, language = service.language;
  82791. svcObj[language] = {
  82792. autoselect: false,
  82793. default: false,
  82794. instreamId: channel,
  82795. language
  82796. };
  82797. if (service.hasOwnProperty("aspectRatio")) {
  82798. svcObj[language].aspectRatio = service.aspectRatio;
  82799. }
  82800. if (service.hasOwnProperty("easyReader")) {
  82801. svcObj[language].easyReader = service.easyReader;
  82802. }
  82803. if (service.hasOwnProperty("3D")) {
  82804. svcObj[language]["3D"] = service["3D"];
  82805. }
  82806. });
  82807. return svcObj;
  82808. }, {});
  82809. };
  82810. var formatVideoPlaylist = function formatVideoPlaylist2(_ref3) {
  82811. var _attributes2;
  82812. var attributes = _ref3.attributes, segments = _ref3.segments, sidx = _ref3.sidx, discontinuityStarts = _ref3.discontinuityStarts;
  82813. var playlist = {
  82814. attributes: (_attributes2 = {
  82815. NAME: attributes.id,
  82816. AUDIO: "audio",
  82817. SUBTITLES: "subs",
  82818. RESOLUTION: {
  82819. width: attributes.width,
  82820. height: attributes.height
  82821. },
  82822. CODECS: attributes.codecs,
  82823. BANDWIDTH: attributes.bandwidth
  82824. }, _attributes2["PROGRAM-ID"] = 1, _attributes2),
  82825. uri: "",
  82826. endList: attributes.type === "static",
  82827. timeline: attributes.periodStart,
  82828. resolvedUri: "",
  82829. targetDuration: attributes.duration,
  82830. discontinuityStarts,
  82831. timelineStarts: attributes.timelineStarts,
  82832. segments
  82833. };
  82834. if (attributes.frameRate) {
  82835. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  82836. }
  82837. if (attributes.contentProtection) {
  82838. playlist.contentProtection = attributes.contentProtection;
  82839. }
  82840. if (sidx) {
  82841. playlist.sidx = sidx;
  82842. }
  82843. return playlist;
  82844. };
  82845. var videoOnly = function videoOnly2(_ref4) {
  82846. var attributes = _ref4.attributes;
  82847. return attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  82848. };
  82849. var audioOnly = function audioOnly2(_ref5) {
  82850. var attributes = _ref5.attributes;
  82851. return attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  82852. };
  82853. var vttOnly = function vttOnly2(_ref6) {
  82854. var attributes = _ref6.attributes;
  82855. return attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  82856. };
  82857. var addMediaSequenceValues = function addMediaSequenceValues2(playlists, timelineStarts) {
  82858. playlists.forEach(function(playlist) {
  82859. playlist.mediaSequence = 0;
  82860. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref7) {
  82861. var timeline = _ref7.timeline;
  82862. return timeline === playlist.timeline;
  82863. });
  82864. if (!playlist.segments) {
  82865. return;
  82866. }
  82867. playlist.segments.forEach(function(segment, index2) {
  82868. segment.number = index2;
  82869. });
  82870. });
  82871. };
  82872. var flattenMediaGroupPlaylists = function flattenMediaGroupPlaylists2(mediaGroupObject) {
  82873. if (!mediaGroupObject) {
  82874. return [];
  82875. }
  82876. return Object.keys(mediaGroupObject).reduce(function(acc, label) {
  82877. var labelContents = mediaGroupObject[label];
  82878. return acc.concat(labelContents.playlists);
  82879. }, []);
  82880. };
  82881. var toM3u8 = function toM3u82(_ref8) {
  82882. var _mediaGroups;
  82883. var dashPlaylists = _ref8.dashPlaylists, locations = _ref8.locations, _ref8$sidxMapping = _ref8.sidxMapping, sidxMapping = _ref8$sidxMapping === void 0 ? {} : _ref8$sidxMapping, previousManifest = _ref8.previousManifest;
  82884. if (!dashPlaylists.length) {
  82885. return {};
  82886. }
  82887. var _dashPlaylists$0$attr = dashPlaylists[0].attributes, duration5 = _dashPlaylists$0$attr.sourceDuration, type2 = _dashPlaylists$0$attr.type, suggestedPresentationDelay2 = _dashPlaylists$0$attr.suggestedPresentationDelay, minimumUpdatePeriod2 = _dashPlaylists$0$attr.minimumUpdatePeriod;
  82888. var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);
  82889. var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));
  82890. var vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));
  82891. var captions = dashPlaylists.map(function(playlist) {
  82892. return playlist.attributes.captionServices;
  82893. }).filter(Boolean);
  82894. var manifest = {
  82895. allowCache: true,
  82896. discontinuityStarts: [],
  82897. segments: [],
  82898. endList: true,
  82899. mediaGroups: (_mediaGroups = {
  82900. AUDIO: {},
  82901. VIDEO: {}
  82902. }, _mediaGroups["CLOSED-CAPTIONS"] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),
  82903. uri: "",
  82904. duration: duration5,
  82905. playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)
  82906. };
  82907. if (minimumUpdatePeriod2 >= 0) {
  82908. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  82909. }
  82910. if (locations) {
  82911. manifest.locations = locations;
  82912. }
  82913. if (type2 === "dynamic") {
  82914. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  82915. }
  82916. var isAudioOnly3 = manifest.playlists.length === 0;
  82917. var organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  82918. var organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;
  82919. var formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));
  82920. var playlistTimelineStarts = formattedPlaylists.map(function(_ref9) {
  82921. var timelineStarts = _ref9.timelineStarts;
  82922. return timelineStarts;
  82923. });
  82924. manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);
  82925. addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);
  82926. if (organizedAudioGroup) {
  82927. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  82928. }
  82929. if (organizedVttGroup) {
  82930. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  82931. }
  82932. if (captions.length) {
  82933. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices(captions);
  82934. }
  82935. if (previousManifest) {
  82936. return positionManifestOnTimeline({
  82937. oldManifest: previousManifest,
  82938. newManifest: manifest
  82939. });
  82940. }
  82941. return manifest;
  82942. };
  82943. var getLiveRValue = function getLiveRValue2(attributes, time, duration5) {
  82944. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;
  82945. var now2 = (NOW + clientOffset) / 1e3;
  82946. var periodStartWC = availabilityStartTime2 + periodStart;
  82947. var periodEndWC = now2 + minimumUpdatePeriod2;
  82948. var periodDuration = periodEndWC - periodStartWC;
  82949. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  82950. };
  82951. var parseByTimeline = function parseByTimeline2(attributes, segmentTimeline) {
  82952. var type2 = attributes.type, _attributes$minimumUp2 = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2, _attributes$media = attributes.media, media = _attributes$media === void 0 ? "" : _attributes$media, sourceDuration = attributes.sourceDuration, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb, timeline = attributes.periodStart;
  82953. var segments = [];
  82954. var time = -1;
  82955. for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  82956. var S = segmentTimeline[sIndex];
  82957. var duration5 = S.d;
  82958. var repeat = S.r || 0;
  82959. var segmentTime = S.t || 0;
  82960. if (time < 0) {
  82961. time = segmentTime;
  82962. }
  82963. if (segmentTime && segmentTime > time) {
  82964. time = segmentTime;
  82965. }
  82966. var count = void 0;
  82967. if (repeat < 0) {
  82968. var nextS = sIndex + 1;
  82969. if (nextS === segmentTimeline.length) {
  82970. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  82971. count = getLiveRValue(attributes, time, duration5);
  82972. } else {
  82973. count = (sourceDuration * timescale2 - time) / duration5;
  82974. }
  82975. } else {
  82976. count = (segmentTimeline[nextS].t - time) / duration5;
  82977. }
  82978. } else {
  82979. count = repeat + 1;
  82980. }
  82981. var end = startNumber2 + segments.length + count;
  82982. var number = startNumber2 + segments.length;
  82983. while (number < end) {
  82984. segments.push({
  82985. number,
  82986. duration: duration5 / timescale2,
  82987. time,
  82988. timeline
  82989. });
  82990. time += duration5;
  82991. number++;
  82992. }
  82993. }
  82994. return segments;
  82995. };
  82996. var identifierPattern = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  82997. var identifierReplacement = function identifierReplacement2(values3) {
  82998. return function(match, identifier, format, width2) {
  82999. if (match === "$$") {
  83000. return "$";
  83001. }
  83002. if (typeof values3[identifier] === "undefined") {
  83003. return match;
  83004. }
  83005. var value = "" + values3[identifier];
  83006. if (identifier === "RepresentationID") {
  83007. return value;
  83008. }
  83009. if (!format) {
  83010. width2 = 1;
  83011. } else {
  83012. width2 = parseInt(width2, 10);
  83013. }
  83014. if (value.length >= width2) {
  83015. return value;
  83016. }
  83017. return "" + new Array(width2 - value.length + 1).join("0") + value;
  83018. };
  83019. };
  83020. var constructTemplateUrl = function constructTemplateUrl2(url, values3) {
  83021. return url.replace(identifierPattern, identifierReplacement(values3));
  83022. };
  83023. var parseTemplateInfo = function parseTemplateInfo2(attributes, segmentTimeline) {
  83024. if (!attributes.duration && !segmentTimeline) {
  83025. return [{
  83026. number: attributes.startNumber || 1,
  83027. duration: attributes.sourceDuration,
  83028. time: 0,
  83029. timeline: attributes.periodStart
  83030. }];
  83031. }
  83032. if (attributes.duration) {
  83033. return parseByDuration(attributes);
  83034. }
  83035. return parseByTimeline(attributes, segmentTimeline);
  83036. };
  83037. var segmentsFromTemplate = function segmentsFromTemplate2(attributes, segmentTimeline) {
  83038. var templateValues = {
  83039. RepresentationID: attributes.id,
  83040. Bandwidth: attributes.bandwidth || 0
  83041. };
  83042. var _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {
  83043. sourceURL: "",
  83044. range: ""
  83045. } : _attributes$initializ;
  83046. var mapSegment = urlTypeToSegment({
  83047. baseUrl: attributes.baseUrl,
  83048. source: constructTemplateUrl(initialization.sourceURL, templateValues),
  83049. range: initialization.range
  83050. });
  83051. var segments = parseTemplateInfo(attributes, segmentTimeline);
  83052. return segments.map(function(segment) {
  83053. templateValues.Number = segment.number;
  83054. templateValues.Time = segment.time;
  83055. var uri = constructTemplateUrl(attributes.media || "", templateValues);
  83056. var timescale2 = attributes.timescale || 1;
  83057. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83058. var presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  83059. var map = {
  83060. uri,
  83061. timeline: segment.timeline,
  83062. duration: segment.duration,
  83063. resolvedUri: resolveUrl$1(attributes.baseUrl || "", uri),
  83064. map: mapSegment,
  83065. number: segment.number,
  83066. presentationTime
  83067. };
  83068. return map;
  83069. });
  83070. };
  83071. var SegmentURLToSegmentObject = function SegmentURLToSegmentObject2(attributes, segmentUrl) {
  83072. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;
  83073. var initSegment = urlTypeToSegment({
  83074. baseUrl,
  83075. source: initialization.sourceURL,
  83076. range: initialization.range
  83077. });
  83078. var segment = urlTypeToSegment({
  83079. baseUrl,
  83080. source: segmentUrl.media,
  83081. range: segmentUrl.mediaRange
  83082. });
  83083. segment.map = initSegment;
  83084. return segment;
  83085. };
  83086. var segmentsFromList = function segmentsFromList2(attributes, segmentTimeline) {
  83087. var duration5 = attributes.duration, _attributes$segmentUr = attributes.segmentUrls, segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr, periodStart = attributes.periodStart;
  83088. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  83089. throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);
  83090. }
  83091. var segmentUrlMap = segmentUrls.map(function(segmentUrlObject) {
  83092. return SegmentURLToSegmentObject(attributes, segmentUrlObject);
  83093. });
  83094. var segmentTimeInfo;
  83095. if (duration5) {
  83096. segmentTimeInfo = parseByDuration(attributes);
  83097. }
  83098. if (segmentTimeline) {
  83099. segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);
  83100. }
  83101. var segments = segmentTimeInfo.map(function(segmentTime, index2) {
  83102. if (segmentUrlMap[index2]) {
  83103. var segment = segmentUrlMap[index2];
  83104. var timescale2 = attributes.timescale || 1;
  83105. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83106. segment.timeline = segmentTime.timeline;
  83107. segment.duration = segmentTime.duration;
  83108. segment.number = segmentTime.number;
  83109. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  83110. return segment;
  83111. }
  83112. }).filter(function(segment) {
  83113. return segment;
  83114. });
  83115. return segments;
  83116. };
  83117. var generateSegments = function generateSegments2(_ref) {
  83118. var attributes = _ref.attributes, segmentInfo = _ref.segmentInfo;
  83119. var segmentAttributes;
  83120. var segmentsFn;
  83121. if (segmentInfo.template) {
  83122. segmentsFn = segmentsFromTemplate;
  83123. segmentAttributes = merge(attributes, segmentInfo.template);
  83124. } else if (segmentInfo.base) {
  83125. segmentsFn = segmentsFromBase;
  83126. segmentAttributes = merge(attributes, segmentInfo.base);
  83127. } else if (segmentInfo.list) {
  83128. segmentsFn = segmentsFromList;
  83129. segmentAttributes = merge(attributes, segmentInfo.list);
  83130. }
  83131. var segmentsInfo = {
  83132. attributes
  83133. };
  83134. if (!segmentsFn) {
  83135. return segmentsInfo;
  83136. }
  83137. var segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  83138. if (segmentAttributes.duration) {
  83139. var _segmentAttributes = segmentAttributes, duration5 = _segmentAttributes.duration, _segmentAttributes$ti = _segmentAttributes.timescale, timescale2 = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;
  83140. segmentAttributes.duration = duration5 / timescale2;
  83141. } else if (segments.length) {
  83142. segmentAttributes.duration = segments.reduce(function(max2, segment) {
  83143. return Math.max(max2, Math.ceil(segment.duration));
  83144. }, 0);
  83145. } else {
  83146. segmentAttributes.duration = 0;
  83147. }
  83148. segmentsInfo.attributes = segmentAttributes;
  83149. segmentsInfo.segments = segments;
  83150. if (segmentInfo.base && segmentAttributes.indexRange) {
  83151. segmentsInfo.sidx = segments[0];
  83152. segmentsInfo.segments = [];
  83153. }
  83154. return segmentsInfo;
  83155. };
  83156. var toPlaylists = function toPlaylists2(representations) {
  83157. return representations.map(generateSegments);
  83158. };
  83159. var findChildren = function findChildren2(element, name) {
  83160. return from(element.childNodes).filter(function(_ref) {
  83161. var tagName = _ref.tagName;
  83162. return tagName === name;
  83163. });
  83164. };
  83165. var getContent = function getContent2(element) {
  83166. return element.textContent.trim();
  83167. };
  83168. var parseDivisionValue = function parseDivisionValue2(value) {
  83169. return parseFloat(value.split("/").reduce(function(prev, current) {
  83170. return prev / current;
  83171. }));
  83172. };
  83173. var parseDuration = function parseDuration2(str) {
  83174. var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  83175. var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  83176. var SECONDS_IN_DAY = 24 * 60 * 60;
  83177. var SECONDS_IN_HOUR = 60 * 60;
  83178. var SECONDS_IN_MIN = 60;
  83179. var durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  83180. var match = durationRegex.exec(str);
  83181. if (!match) {
  83182. return 0;
  83183. }
  83184. var _match$slice = match.slice(1), year = _match$slice[0], month = _match$slice[1], day = _match$slice[2], hour = _match$slice[3], minute = _match$slice[4], second = _match$slice[5];
  83185. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  83186. };
  83187. var parseDate = function parseDate2(str) {
  83188. var dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  83189. if (dateRegex.test(str)) {
  83190. str += "Z";
  83191. }
  83192. return Date.parse(str);
  83193. };
  83194. var parsers = {
  83195. mediaPresentationDuration: function mediaPresentationDuration(value) {
  83196. return parseDuration(value);
  83197. },
  83198. availabilityStartTime: function availabilityStartTime(value) {
  83199. return parseDate(value) / 1e3;
  83200. },
  83201. minimumUpdatePeriod: function minimumUpdatePeriod(value) {
  83202. return parseDuration(value);
  83203. },
  83204. suggestedPresentationDelay: function suggestedPresentationDelay(value) {
  83205. return parseDuration(value);
  83206. },
  83207. type: function type(value) {
  83208. return value;
  83209. },
  83210. timeShiftBufferDepth: function timeShiftBufferDepth(value) {
  83211. return parseDuration(value);
  83212. },
  83213. start: function start(value) {
  83214. return parseDuration(value);
  83215. },
  83216. width: function width(value) {
  83217. return parseInt(value, 10);
  83218. },
  83219. height: function height(value) {
  83220. return parseInt(value, 10);
  83221. },
  83222. bandwidth: function bandwidth(value) {
  83223. return parseInt(value, 10);
  83224. },
  83225. frameRate: function frameRate(value) {
  83226. return parseDivisionValue(value);
  83227. },
  83228. startNumber: function startNumber(value) {
  83229. return parseInt(value, 10);
  83230. },
  83231. timescale: function timescale(value) {
  83232. return parseInt(value, 10);
  83233. },
  83234. presentationTimeOffset: function presentationTimeOffset(value) {
  83235. return parseInt(value, 10);
  83236. },
  83237. duration: function duration(value) {
  83238. var parsedValue = parseInt(value, 10);
  83239. if (isNaN(parsedValue)) {
  83240. return parseDuration(value);
  83241. }
  83242. return parsedValue;
  83243. },
  83244. d: function d(value) {
  83245. return parseInt(value, 10);
  83246. },
  83247. t: function t(value) {
  83248. return parseInt(value, 10);
  83249. },
  83250. r: function r(value) {
  83251. return parseInt(value, 10);
  83252. },
  83253. DEFAULT: function DEFAULT(value) {
  83254. return value;
  83255. }
  83256. };
  83257. var parseAttributes2 = function parseAttributes3(el) {
  83258. if (!(el && el.attributes)) {
  83259. return {};
  83260. }
  83261. return from(el.attributes).reduce(function(a, e) {
  83262. var parseFn = parsers[e.name] || parsers.DEFAULT;
  83263. a[e.name] = parseFn(e.value);
  83264. return a;
  83265. }, {});
  83266. };
  83267. var keySystemsMap = {
  83268. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  83269. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  83270. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  83271. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  83272. };
  83273. var buildBaseUrls = function buildBaseUrls2(referenceUrls, baseUrlElements) {
  83274. if (!baseUrlElements.length) {
  83275. return referenceUrls;
  83276. }
  83277. return flatten(referenceUrls.map(function(reference) {
  83278. return baseUrlElements.map(function(baseUrlElement) {
  83279. return resolveUrl$1(reference, getContent(baseUrlElement));
  83280. });
  83281. }));
  83282. };
  83283. var getSegmentInformation = function getSegmentInformation2(adaptationSet) {
  83284. var segmentTemplate = findChildren(adaptationSet, "SegmentTemplate")[0];
  83285. var segmentList = findChildren(adaptationSet, "SegmentList")[0];
  83286. var segmentUrls = segmentList && findChildren(segmentList, "SegmentURL").map(function(s) {
  83287. return merge({
  83288. tag: "SegmentURL"
  83289. }, parseAttributes2(s));
  83290. });
  83291. var segmentBase = findChildren(adaptationSet, "SegmentBase")[0];
  83292. var segmentTimelineParentNode = segmentList || segmentTemplate;
  83293. var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, "SegmentTimeline")[0];
  83294. var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  83295. var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, "Initialization")[0];
  83296. var template = segmentTemplate && parseAttributes2(segmentTemplate);
  83297. if (template && segmentInitialization) {
  83298. template.initialization = segmentInitialization && parseAttributes2(segmentInitialization);
  83299. } else if (template && template.initialization) {
  83300. template.initialization = {
  83301. sourceURL: template.initialization
  83302. };
  83303. }
  83304. var segmentInfo = {
  83305. template,
  83306. segmentTimeline: segmentTimeline && findChildren(segmentTimeline, "S").map(function(s) {
  83307. return parseAttributes2(s);
  83308. }),
  83309. list: segmentList && merge(parseAttributes2(segmentList), {
  83310. segmentUrls,
  83311. initialization: parseAttributes2(segmentInitialization)
  83312. }),
  83313. base: segmentBase && merge(parseAttributes2(segmentBase), {
  83314. initialization: parseAttributes2(segmentInitialization)
  83315. })
  83316. };
  83317. Object.keys(segmentInfo).forEach(function(key) {
  83318. if (!segmentInfo[key]) {
  83319. delete segmentInfo[key];
  83320. }
  83321. });
  83322. return segmentInfo;
  83323. };
  83324. var inheritBaseUrls = function inheritBaseUrls2(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {
  83325. return function(representation) {
  83326. var repBaseUrlElements = findChildren(representation, "BaseURL");
  83327. var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);
  83328. var attributes = merge(adaptationSetAttributes, parseAttributes2(representation));
  83329. var representationSegmentInfo = getSegmentInformation(representation);
  83330. return repBaseUrls.map(function(baseUrl) {
  83331. return {
  83332. segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),
  83333. attributes: merge(attributes, {
  83334. baseUrl
  83335. })
  83336. };
  83337. });
  83338. };
  83339. };
  83340. var generateKeySystemInformation = function generateKeySystemInformation2(contentProtectionNodes) {
  83341. return contentProtectionNodes.reduce(function(acc, node) {
  83342. var attributes = parseAttributes2(node);
  83343. if (attributes.schemeIdUri) {
  83344. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  83345. }
  83346. var keySystem = keySystemsMap[attributes.schemeIdUri];
  83347. if (keySystem) {
  83348. acc[keySystem] = {
  83349. attributes
  83350. };
  83351. var psshNode = findChildren(node, "cenc:pssh")[0];
  83352. if (psshNode) {
  83353. var pssh = getContent(psshNode);
  83354. acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);
  83355. }
  83356. }
  83357. return acc;
  83358. }, {});
  83359. };
  83360. var parseCaptionServiceMetadata = function parseCaptionServiceMetadata2(service) {
  83361. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  83362. var values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  83363. return values3.map(function(value) {
  83364. var channel;
  83365. var language;
  83366. language = value;
  83367. if (/^CC\d=/.test(value)) {
  83368. var _value$split = value.split("=");
  83369. channel = _value$split[0];
  83370. language = _value$split[1];
  83371. } else if (/^CC\d$/.test(value)) {
  83372. channel = value;
  83373. }
  83374. return {
  83375. channel,
  83376. language
  83377. };
  83378. });
  83379. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  83380. var _values = typeof service.value !== "string" ? [] : service.value.split(";");
  83381. return _values.map(function(value) {
  83382. var flags = {
  83383. "channel": void 0,
  83384. "language": void 0,
  83385. "aspectRatio": 1,
  83386. "easyReader": 0,
  83387. "3D": 0
  83388. };
  83389. if (/=/.test(value)) {
  83390. var _value$split2 = value.split("="), channel = _value$split2[0], _value$split2$ = _value$split2[1], opts = _value$split2$ === void 0 ? "" : _value$split2$;
  83391. flags.channel = channel;
  83392. flags.language = value;
  83393. opts.split(",").forEach(function(opt) {
  83394. var _opt$split = opt.split(":"), name = _opt$split[0], val = _opt$split[1];
  83395. if (name === "lang") {
  83396. flags.language = val;
  83397. } else if (name === "er") {
  83398. flags.easyReader = Number(val);
  83399. } else if (name === "war") {
  83400. flags.aspectRatio = Number(val);
  83401. } else if (name === "3D") {
  83402. flags["3D"] = Number(val);
  83403. }
  83404. });
  83405. } else {
  83406. flags.language = value;
  83407. }
  83408. if (flags.channel) {
  83409. flags.channel = "SERVICE" + flags.channel;
  83410. }
  83411. return flags;
  83412. });
  83413. }
  83414. };
  83415. var toRepresentations = function toRepresentations2(periodAttributes, periodBaseUrls, periodSegmentInfo) {
  83416. return function(adaptationSet) {
  83417. var adaptationSetAttributes = parseAttributes2(adaptationSet);
  83418. var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, "BaseURL"));
  83419. var role = findChildren(adaptationSet, "Role")[0];
  83420. var roleAttributes = {
  83421. role: parseAttributes2(role)
  83422. };
  83423. var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);
  83424. var accessibility = findChildren(adaptationSet, "Accessibility")[0];
  83425. var captionServices = parseCaptionServiceMetadata(parseAttributes2(accessibility));
  83426. if (captionServices) {
  83427. attrs = merge(attrs, {
  83428. captionServices
  83429. });
  83430. }
  83431. var label = findChildren(adaptationSet, "Label")[0];
  83432. if (label && label.childNodes.length) {
  83433. var labelVal = label.childNodes[0].nodeValue.trim();
  83434. attrs = merge(attrs, {
  83435. label: labelVal
  83436. });
  83437. }
  83438. var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, "ContentProtection"));
  83439. if (Object.keys(contentProtection).length) {
  83440. attrs = merge(attrs, {
  83441. contentProtection
  83442. });
  83443. }
  83444. var segmentInfo = getSegmentInformation(adaptationSet);
  83445. var representations = findChildren(adaptationSet, "Representation");
  83446. var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);
  83447. return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  83448. };
  83449. };
  83450. var toAdaptationSets = function toAdaptationSets2(mpdAttributes, mpdBaseUrls) {
  83451. return function(period, index2) {
  83452. var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, "BaseURL"));
  83453. var periodAttributes = merge(mpdAttributes, {
  83454. periodStart: period.attributes.start
  83455. });
  83456. if (typeof period.attributes.duration === "number") {
  83457. periodAttributes.periodDuration = period.attributes.duration;
  83458. }
  83459. var adaptationSets = findChildren(period.node, "AdaptationSet");
  83460. var periodSegmentInfo = getSegmentInformation(period.node);
  83461. return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  83462. };
  83463. };
  83464. var getPeriodStart = function getPeriodStart2(_ref) {
  83465. var attributes = _ref.attributes, priorPeriodAttributes = _ref.priorPeriodAttributes, mpdType = _ref.mpdType;
  83466. if (typeof attributes.start === "number") {
  83467. return attributes.start;
  83468. }
  83469. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  83470. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  83471. }
  83472. if (!priorPeriodAttributes && mpdType === "static") {
  83473. return 0;
  83474. }
  83475. return null;
  83476. };
  83477. var inheritAttributes = function inheritAttributes2(mpd, options2) {
  83478. if (options2 === void 0) {
  83479. options2 = {};
  83480. }
  83481. var _options = options2, _options$manifestUri = _options.manifestUri, manifestUri = _options$manifestUri === void 0 ? "" : _options$manifestUri, _options$NOW = _options.NOW, NOW = _options$NOW === void 0 ? Date.now() : _options$NOW, _options$clientOffset = _options.clientOffset, clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;
  83482. var periodNodes = findChildren(mpd, "Period");
  83483. if (!periodNodes.length) {
  83484. throw new Error(errors.INVALID_NUMBER_OF_PERIOD);
  83485. }
  83486. var locations = findChildren(mpd, "Location");
  83487. var mpdAttributes = parseAttributes2(mpd);
  83488. var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, "BaseURL"));
  83489. mpdAttributes.type = mpdAttributes.type || "static";
  83490. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  83491. mpdAttributes.NOW = NOW;
  83492. mpdAttributes.clientOffset = clientOffset;
  83493. if (locations.length) {
  83494. mpdAttributes.locations = locations.map(getContent);
  83495. }
  83496. var periods = [];
  83497. periodNodes.forEach(function(node, index2) {
  83498. var attributes = parseAttributes2(node);
  83499. var priorPeriod = periods[index2 - 1];
  83500. attributes.start = getPeriodStart({
  83501. attributes,
  83502. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  83503. mpdType: mpdAttributes.type
  83504. });
  83505. periods.push({
  83506. node,
  83507. attributes
  83508. });
  83509. });
  83510. return {
  83511. locations: mpdAttributes.locations,
  83512. representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)))
  83513. };
  83514. };
  83515. var stringToMpdXml = function stringToMpdXml2(manifestString) {
  83516. if (manifestString === "") {
  83517. throw new Error(errors.DASH_EMPTY_MANIFEST);
  83518. }
  83519. var parser2 = new DOMParser();
  83520. var xml;
  83521. var mpd;
  83522. try {
  83523. xml = parser2.parseFromString(manifestString, "application/xml");
  83524. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  83525. } catch (e) {
  83526. }
  83527. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  83528. throw new Error(errors.DASH_INVALID_XML);
  83529. }
  83530. return mpd;
  83531. };
  83532. var parseUTCTimingScheme = function parseUTCTimingScheme2(mpd) {
  83533. var UTCTimingNode = findChildren(mpd, "UTCTiming")[0];
  83534. if (!UTCTimingNode) {
  83535. return null;
  83536. }
  83537. var attributes = parseAttributes2(UTCTimingNode);
  83538. switch (attributes.schemeIdUri) {
  83539. case "urn:mpeg:dash:utc:http-head:2014":
  83540. case "urn:mpeg:dash:utc:http-head:2012":
  83541. attributes.method = "HEAD";
  83542. break;
  83543. case "urn:mpeg:dash:utc:http-xsdate:2014":
  83544. case "urn:mpeg:dash:utc:http-iso:2014":
  83545. case "urn:mpeg:dash:utc:http-xsdate:2012":
  83546. case "urn:mpeg:dash:utc:http-iso:2012":
  83547. attributes.method = "GET";
  83548. break;
  83549. case "urn:mpeg:dash:utc:direct:2014":
  83550. case "urn:mpeg:dash:utc:direct:2012":
  83551. attributes.method = "DIRECT";
  83552. attributes.value = Date.parse(attributes.value);
  83553. break;
  83554. case "urn:mpeg:dash:utc:http-ntp:2014":
  83555. case "urn:mpeg:dash:utc:ntp:2014":
  83556. case "urn:mpeg:dash:utc:sntp:2014":
  83557. default:
  83558. throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);
  83559. }
  83560. return attributes;
  83561. };
  83562. var parse = function parse2(manifestString, options2) {
  83563. if (options2 === void 0) {
  83564. options2 = {};
  83565. }
  83566. var parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options2);
  83567. var playlists = toPlaylists(parsedManifestInfo.representationInfo);
  83568. return toM3u8({
  83569. dashPlaylists: playlists,
  83570. locations: parsedManifestInfo.locations,
  83571. sidxMapping: options2.sidxMapping,
  83572. previousManifest: options2.previousManifest
  83573. });
  83574. };
  83575. var parseUTCTiming = function parseUTCTiming2(manifestString) {
  83576. return parseUTCTimingScheme(stringToMpdXml(manifestString));
  83577. };
  83578. var MAX_UINT32 = Math.pow(2, 32);
  83579. var getUint64$1 = function(uint8) {
  83580. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  83581. var value;
  83582. if (dv.getBigUint64) {
  83583. value = dv.getBigUint64(0);
  83584. if (value < Number.MAX_SAFE_INTEGER) {
  83585. return Number(value);
  83586. }
  83587. return value;
  83588. }
  83589. return dv.getUint32(0) * MAX_UINT32 + dv.getUint32(4);
  83590. };
  83591. var numbers = {
  83592. getUint64: getUint64$1,
  83593. MAX_UINT32
  83594. };
  83595. var getUint64 = numbers.getUint64;
  83596. var parseSidx = function(data) {
  83597. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  83598. version: data[0],
  83599. flags: new Uint8Array(data.subarray(1, 4)),
  83600. references: [],
  83601. referenceId: view.getUint32(4),
  83602. timescale: view.getUint32(8)
  83603. }, i2 = 12;
  83604. if (result.version === 0) {
  83605. result.earliestPresentationTime = view.getUint32(i2);
  83606. result.firstOffset = view.getUint32(i2 + 4);
  83607. i2 += 8;
  83608. } else {
  83609. result.earliestPresentationTime = getUint64(data.subarray(i2));
  83610. result.firstOffset = getUint64(data.subarray(i2 + 8));
  83611. i2 += 16;
  83612. }
  83613. i2 += 2;
  83614. var referenceCount = view.getUint16(i2);
  83615. i2 += 2;
  83616. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  83617. result.references.push({
  83618. referenceType: (data[i2] & 128) >>> 7,
  83619. referencedSize: view.getUint32(i2) & 2147483647,
  83620. subsegmentDuration: view.getUint32(i2 + 4),
  83621. startsWithSap: !!(data[i2 + 8] & 128),
  83622. sapType: (data[i2 + 8] & 112) >>> 4,
  83623. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  83624. });
  83625. }
  83626. return result;
  83627. };
  83628. var parseSidx_1 = parseSidx;
  83629. var ID3 = toUint82([73, 68, 51]);
  83630. var getId3Size2 = function getId3Size3(bytes, offset) {
  83631. if (offset === void 0) {
  83632. offset = 0;
  83633. }
  83634. bytes = toUint82(bytes);
  83635. var flags = bytes[offset + 5];
  83636. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  83637. var footerPresent = (flags & 16) >> 4;
  83638. if (footerPresent) {
  83639. return returnSize + 20;
  83640. }
  83641. return returnSize + 10;
  83642. };
  83643. var getId3Offset2 = function getId3Offset3(bytes, offset) {
  83644. if (offset === void 0) {
  83645. offset = 0;
  83646. }
  83647. bytes = toUint82(bytes);
  83648. if (bytes.length - offset < 10 || !bytesMatch2(bytes, ID3, {
  83649. offset
  83650. })) {
  83651. return offset;
  83652. }
  83653. offset += getId3Size2(bytes, offset);
  83654. return getId3Offset3(bytes, offset);
  83655. };
  83656. var normalizePath$1 = function normalizePath3(path) {
  83657. if (typeof path === "string") {
  83658. return stringToBytes2(path);
  83659. }
  83660. if (typeof path === "number") {
  83661. return path;
  83662. }
  83663. return path;
  83664. };
  83665. var normalizePaths$1 = function normalizePaths3(paths) {
  83666. if (!Array.isArray(paths)) {
  83667. return [normalizePath$1(paths)];
  83668. }
  83669. return paths.map(function(p) {
  83670. return normalizePath$1(p);
  83671. });
  83672. };
  83673. var findBox2 = function findBox3(bytes, paths, complete) {
  83674. if (complete === void 0) {
  83675. complete = false;
  83676. }
  83677. paths = normalizePaths$1(paths);
  83678. bytes = toUint82(bytes);
  83679. var results = [];
  83680. if (!paths.length) {
  83681. return results;
  83682. }
  83683. var i2 = 0;
  83684. while (i2 < bytes.length) {
  83685. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  83686. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  83687. if (size === 0) {
  83688. break;
  83689. }
  83690. var end = i2 + size;
  83691. if (end > bytes.length) {
  83692. if (complete) {
  83693. break;
  83694. }
  83695. end = bytes.length;
  83696. }
  83697. var data = bytes.subarray(i2 + 8, end);
  83698. if (bytesMatch2(type2, paths[0])) {
  83699. if (paths.length === 1) {
  83700. results.push(data);
  83701. } else {
  83702. results.push.apply(results, findBox3(data, paths.slice(1), complete));
  83703. }
  83704. }
  83705. i2 = end;
  83706. }
  83707. return results;
  83708. };
  83709. var EBML_TAGS = {
  83710. EBML: toUint82([26, 69, 223, 163]),
  83711. DocType: toUint82([66, 130]),
  83712. Segment: toUint82([24, 83, 128, 103]),
  83713. SegmentInfo: toUint82([21, 73, 169, 102]),
  83714. Tracks: toUint82([22, 84, 174, 107]),
  83715. Track: toUint82([174]),
  83716. TrackNumber: toUint82([215]),
  83717. DefaultDuration: toUint82([35, 227, 131]),
  83718. TrackEntry: toUint82([174]),
  83719. TrackType: toUint82([131]),
  83720. FlagDefault: toUint82([136]),
  83721. CodecID: toUint82([134]),
  83722. CodecPrivate: toUint82([99, 162]),
  83723. VideoTrack: toUint82([224]),
  83724. AudioTrack: toUint82([225]),
  83725. Cluster: toUint82([31, 67, 182, 117]),
  83726. Timestamp: toUint82([231]),
  83727. TimestampScale: toUint82([42, 215, 177]),
  83728. BlockGroup: toUint82([160]),
  83729. BlockDuration: toUint82([155]),
  83730. Block: toUint82([161]),
  83731. SimpleBlock: toUint82([163])
  83732. };
  83733. var LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];
  83734. var getLength2 = function getLength3(byte) {
  83735. var len = 1;
  83736. for (var i2 = 0; i2 < LENGTH_TABLE.length; i2++) {
  83737. if (byte & LENGTH_TABLE[i2]) {
  83738. break;
  83739. }
  83740. len++;
  83741. }
  83742. return len;
  83743. };
  83744. var getvint2 = function getvint3(bytes, offset, removeLength, signed) {
  83745. if (removeLength === void 0) {
  83746. removeLength = true;
  83747. }
  83748. if (signed === void 0) {
  83749. signed = false;
  83750. }
  83751. var length = getLength2(bytes[offset]);
  83752. var valueBytes = bytes.subarray(offset, offset + length);
  83753. if (removeLength) {
  83754. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  83755. valueBytes[0] ^= LENGTH_TABLE[length - 1];
  83756. }
  83757. return {
  83758. length,
  83759. value: bytesToNumber2(valueBytes, {
  83760. signed
  83761. }),
  83762. bytes: valueBytes
  83763. };
  83764. };
  83765. var normalizePath4 = function normalizePath5(path) {
  83766. if (typeof path === "string") {
  83767. return path.match(/.{1,2}/g).map(function(p) {
  83768. return normalizePath5(p);
  83769. });
  83770. }
  83771. if (typeof path === "number") {
  83772. return numberToBytes2(path);
  83773. }
  83774. return path;
  83775. };
  83776. var normalizePaths4 = function normalizePaths5(paths) {
  83777. if (!Array.isArray(paths)) {
  83778. return [normalizePath4(paths)];
  83779. }
  83780. return paths.map(function(p) {
  83781. return normalizePath4(p);
  83782. });
  83783. };
  83784. var getInfinityDataSize2 = function getInfinityDataSize3(id, bytes, offset) {
  83785. if (offset >= bytes.length) {
  83786. return bytes.length;
  83787. }
  83788. var innerid = getvint2(bytes, offset, false);
  83789. if (bytesMatch2(id.bytes, innerid.bytes)) {
  83790. return offset;
  83791. }
  83792. var dataHeader = getvint2(bytes, offset + innerid.length);
  83793. return getInfinityDataSize3(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  83794. };
  83795. var findEbml2 = function findEbml3(bytes, paths) {
  83796. paths = normalizePaths4(paths);
  83797. bytes = toUint82(bytes);
  83798. var results = [];
  83799. if (!paths.length) {
  83800. return results;
  83801. }
  83802. var i2 = 0;
  83803. while (i2 < bytes.length) {
  83804. var id = getvint2(bytes, i2, false);
  83805. var dataHeader = getvint2(bytes, i2 + id.length);
  83806. var dataStart = i2 + id.length + dataHeader.length;
  83807. if (dataHeader.value === 127) {
  83808. dataHeader.value = getInfinityDataSize2(id, bytes, dataStart);
  83809. if (dataHeader.value !== bytes.length) {
  83810. dataHeader.value -= dataStart;
  83811. }
  83812. }
  83813. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  83814. var data = bytes.subarray(dataStart, dataEnd);
  83815. if (bytesMatch2(paths[0], id.bytes)) {
  83816. if (paths.length === 1) {
  83817. results.push(data);
  83818. } else {
  83819. results = results.concat(findEbml3(data, paths.slice(1)));
  83820. }
  83821. }
  83822. var totalLength = id.length + dataHeader.length + data.length;
  83823. i2 += totalLength;
  83824. }
  83825. return results;
  83826. };
  83827. var NAL_TYPE_ONE = toUint82([0, 0, 0, 1]);
  83828. var NAL_TYPE_TWO = toUint82([0, 0, 1]);
  83829. var EMULATION_PREVENTION = toUint82([0, 0, 3]);
  83830. var discardEmulationPreventionBytes2 = function discardEmulationPreventionBytes3(bytes) {
  83831. var positions = [];
  83832. var i2 = 1;
  83833. while (i2 < bytes.length - 2) {
  83834. if (bytesMatch2(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION)) {
  83835. positions.push(i2 + 2);
  83836. i2++;
  83837. }
  83838. i2++;
  83839. }
  83840. if (positions.length === 0) {
  83841. return bytes;
  83842. }
  83843. var newLength = bytes.length - positions.length;
  83844. var newData = new Uint8Array(newLength);
  83845. var sourceIndex = 0;
  83846. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  83847. if (sourceIndex === positions[0]) {
  83848. sourceIndex++;
  83849. positions.shift();
  83850. }
  83851. newData[i2] = bytes[sourceIndex];
  83852. }
  83853. return newData;
  83854. };
  83855. var findNal2 = function findNal3(bytes, dataType, types, nalLimit) {
  83856. if (nalLimit === void 0) {
  83857. nalLimit = Infinity;
  83858. }
  83859. bytes = toUint82(bytes);
  83860. types = [].concat(types);
  83861. var i2 = 0;
  83862. var nalStart;
  83863. var nalsFound = 0;
  83864. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  83865. var nalOffset = void 0;
  83866. if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_ONE)) {
  83867. nalOffset = 4;
  83868. } else if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_TWO)) {
  83869. nalOffset = 3;
  83870. }
  83871. if (!nalOffset) {
  83872. i2++;
  83873. continue;
  83874. }
  83875. nalsFound++;
  83876. if (nalStart) {
  83877. return discardEmulationPreventionBytes2(bytes.subarray(nalStart, i2));
  83878. }
  83879. var nalType = void 0;
  83880. if (dataType === "h264") {
  83881. nalType = bytes[i2 + nalOffset] & 31;
  83882. } else if (dataType === "h265") {
  83883. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  83884. }
  83885. if (types.indexOf(nalType) !== -1) {
  83886. nalStart = i2 + nalOffset;
  83887. }
  83888. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  83889. }
  83890. return bytes.subarray(0, 0);
  83891. };
  83892. var findH264Nal2 = function findH264Nal3(bytes, type2, nalLimit) {
  83893. return findNal2(bytes, "h264", type2, nalLimit);
  83894. };
  83895. var findH265Nal2 = function findH265Nal3(bytes, type2, nalLimit) {
  83896. return findNal2(bytes, "h265", type2, nalLimit);
  83897. };
  83898. var CONSTANTS = {
  83899. "webm": toUint82([119, 101, 98, 109]),
  83900. "matroska": toUint82([109, 97, 116, 114, 111, 115, 107, 97]),
  83901. "flac": toUint82([102, 76, 97, 67]),
  83902. "ogg": toUint82([79, 103, 103, 83]),
  83903. "ac3": toUint82([11, 119]),
  83904. "riff": toUint82([82, 73, 70, 70]),
  83905. "avi": toUint82([65, 86, 73]),
  83906. "wav": toUint82([87, 65, 86, 69]),
  83907. "3gp": toUint82([102, 116, 121, 112, 51, 103]),
  83908. "mp4": toUint82([102, 116, 121, 112]),
  83909. "fmp4": toUint82([115, 116, 121, 112]),
  83910. "mov": toUint82([102, 116, 121, 112, 113, 116]),
  83911. "moov": toUint82([109, 111, 111, 118]),
  83912. "moof": toUint82([109, 111, 111, 102])
  83913. };
  83914. var _isLikely = {
  83915. aac: function aac2(bytes) {
  83916. var offset = getId3Offset2(bytes);
  83917. return bytesMatch2(bytes, [255, 16], {
  83918. offset,
  83919. mask: [255, 22]
  83920. });
  83921. },
  83922. mp3: function mp32(bytes) {
  83923. var offset = getId3Offset2(bytes);
  83924. return bytesMatch2(bytes, [255, 2], {
  83925. offset,
  83926. mask: [255, 6]
  83927. });
  83928. },
  83929. webm: function webm2(bytes) {
  83930. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83931. return bytesMatch2(docType, CONSTANTS.webm);
  83932. },
  83933. mkv: function mkv2(bytes) {
  83934. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83935. return bytesMatch2(docType, CONSTANTS.matroska);
  83936. },
  83937. mp4: function mp42(bytes) {
  83938. if (_isLikely["3gp"](bytes) || _isLikely.mov(bytes)) {
  83939. return false;
  83940. }
  83941. if (bytesMatch2(bytes, CONSTANTS.mp4, {
  83942. offset: 4
  83943. }) || bytesMatch2(bytes, CONSTANTS.fmp4, {
  83944. offset: 4
  83945. })) {
  83946. return true;
  83947. }
  83948. if (bytesMatch2(bytes, CONSTANTS.moof, {
  83949. offset: 4
  83950. }) || bytesMatch2(bytes, CONSTANTS.moov, {
  83951. offset: 4
  83952. })) {
  83953. return true;
  83954. }
  83955. },
  83956. mov: function mov2(bytes) {
  83957. return bytesMatch2(bytes, CONSTANTS.mov, {
  83958. offset: 4
  83959. });
  83960. },
  83961. "3gp": function gp2(bytes) {
  83962. return bytesMatch2(bytes, CONSTANTS["3gp"], {
  83963. offset: 4
  83964. });
  83965. },
  83966. ac3: function ac32(bytes) {
  83967. var offset = getId3Offset2(bytes);
  83968. return bytesMatch2(bytes, CONSTANTS.ac3, {
  83969. offset
  83970. });
  83971. },
  83972. ts: function ts2(bytes) {
  83973. if (bytes.length < 189 && bytes.length >= 1) {
  83974. return bytes[0] === 71;
  83975. }
  83976. var i2 = 0;
  83977. while (i2 + 188 < bytes.length && i2 < 188) {
  83978. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  83979. return true;
  83980. }
  83981. i2 += 1;
  83982. }
  83983. return false;
  83984. },
  83985. flac: function flac2(bytes) {
  83986. var offset = getId3Offset2(bytes);
  83987. return bytesMatch2(bytes, CONSTANTS.flac, {
  83988. offset
  83989. });
  83990. },
  83991. ogg: function ogg2(bytes) {
  83992. return bytesMatch2(bytes, CONSTANTS.ogg);
  83993. },
  83994. avi: function avi2(bytes) {
  83995. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.avi, {
  83996. offset: 8
  83997. });
  83998. },
  83999. wav: function wav2(bytes) {
  84000. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.wav, {
  84001. offset: 8
  84002. });
  84003. },
  84004. "h264": function h2642(bytes) {
  84005. return findH264Nal2(bytes, 7, 3).length;
  84006. },
  84007. "h265": function h2652(bytes) {
  84008. return findH265Nal2(bytes, [32, 33], 3).length;
  84009. }
  84010. };
  84011. var isLikelyTypes = Object.keys(_isLikely).filter(function(t2) {
  84012. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  84013. }).concat(["ts", "h264", "h265"]);
  84014. isLikelyTypes.forEach(function(type2) {
  84015. var isLikelyFn = _isLikely[type2];
  84016. _isLikely[type2] = function(bytes) {
  84017. return isLikelyFn(toUint82(bytes));
  84018. };
  84019. });
  84020. var isLikely = _isLikely;
  84021. var detectContainerForBytes2 = function detectContainerForBytes3(bytes) {
  84022. bytes = toUint82(bytes);
  84023. for (var i2 = 0; i2 < isLikelyTypes.length; i2++) {
  84024. var type2 = isLikelyTypes[i2];
  84025. if (isLikely[type2](bytes)) {
  84026. return type2;
  84027. }
  84028. }
  84029. return "";
  84030. };
  84031. var isLikelyFmp4MediaSegment2 = function isLikelyFmp4MediaSegment3(bytes) {
  84032. return findBox2(bytes, ["moof"]).length > 0;
  84033. };
  84034. var ONE_SECOND_IN_TS = 9e4, secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds;
  84035. secondsToVideoTs = function(seconds) {
  84036. return seconds * ONE_SECOND_IN_TS;
  84037. };
  84038. secondsToAudioTs = function(seconds, sampleRate) {
  84039. return seconds * sampleRate;
  84040. };
  84041. videoTsToSeconds = function(timestamp) {
  84042. return timestamp / ONE_SECOND_IN_TS;
  84043. };
  84044. audioTsToSeconds = function(timestamp, sampleRate) {
  84045. return timestamp / sampleRate;
  84046. };
  84047. audioTsToVideoTs = function(timestamp, sampleRate) {
  84048. return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));
  84049. };
  84050. videoTsToAudioTs = function(timestamp, sampleRate) {
  84051. return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);
  84052. };
  84053. metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  84054. return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  84055. };
  84056. var clock = {
  84057. ONE_SECOND_IN_TS,
  84058. secondsToVideoTs,
  84059. secondsToAudioTs,
  84060. videoTsToSeconds,
  84061. audioTsToSeconds,
  84062. audioTsToVideoTs,
  84063. videoTsToAudioTs,
  84064. metadataTsToSeconds
  84065. };
  84066. function _getPrototypeOf(o) {
  84067. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
  84068. return o2.__proto__ || Object.getPrototypeOf(o2);
  84069. };
  84070. return _getPrototypeOf(o);
  84071. }
  84072. function _isNativeFunction(fn2) {
  84073. return Function.toString.call(fn2).indexOf("[native code]") !== -1;
  84074. }
  84075. function _wrapNativeSuper(Class) {
  84076. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  84077. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  84078. if (Class2 === null || !_isNativeFunction(Class2))
  84079. return Class2;
  84080. if (typeof Class2 !== "function") {
  84081. throw new TypeError("Super expression must either be null or a function");
  84082. }
  84083. if (typeof _cache !== "undefined") {
  84084. if (_cache.has(Class2))
  84085. return _cache.get(Class2);
  84086. _cache.set(Class2, Wrapper);
  84087. }
  84088. function Wrapper() {
  84089. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  84090. }
  84091. Wrapper.prototype = Object.create(Class2.prototype, {
  84092. constructor: {
  84093. value: Wrapper,
  84094. enumerable: false,
  84095. writable: true,
  84096. configurable: true
  84097. }
  84098. });
  84099. return _setPrototypeOf(Wrapper, Class2);
  84100. };
  84101. return _wrapNativeSuper(Class);
  84102. }
  84103. /**
  84104. * @license
  84105. * Video.js 7.21.4 <http://videojs.com/>
  84106. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  84107. * Available under Apache License Version 2.0
  84108. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  84109. *
  84110. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  84111. * Available under Apache License Version 2.0
  84112. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  84113. */
  84114. var version$5 = "7.21.4";
  84115. var hooks_ = {};
  84116. var hooks = function hooks2(type2, fn2) {
  84117. hooks_[type2] = hooks_[type2] || [];
  84118. if (fn2) {
  84119. hooks_[type2] = hooks_[type2].concat(fn2);
  84120. }
  84121. return hooks_[type2];
  84122. };
  84123. var hook = function hook2(type2, fn2) {
  84124. hooks(type2, fn2);
  84125. };
  84126. var removeHook = function removeHook2(type2, fn2) {
  84127. var index2 = hooks(type2).indexOf(fn2);
  84128. if (index2 <= -1) {
  84129. return false;
  84130. }
  84131. hooks_[type2] = hooks_[type2].slice();
  84132. hooks_[type2].splice(index2, 1);
  84133. return true;
  84134. };
  84135. var hookOnce = function hookOnce2(type2, fn2) {
  84136. hooks(type2, [].concat(fn2).map(function(original) {
  84137. var wrapper = function wrapper2() {
  84138. removeHook(type2, wrapper2);
  84139. return original.apply(void 0, arguments);
  84140. };
  84141. return wrapper;
  84142. }));
  84143. };
  84144. var FullscreenApi = {
  84145. prefixed: true
  84146. };
  84147. var apiMap = [
  84148. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  84149. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  84150. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  84151. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  84152. ];
  84153. var specApi = apiMap[0];
  84154. var browserApi;
  84155. for (var i$2 = 0; i$2 < apiMap.length; i$2++) {
  84156. if (apiMap[i$2][1] in document_1) {
  84157. browserApi = apiMap[i$2];
  84158. break;
  84159. }
  84160. }
  84161. if (browserApi) {
  84162. for (var _i$1 = 0; _i$1 < browserApi.length; _i$1++) {
  84163. FullscreenApi[specApi[_i$1]] = browserApi[_i$1];
  84164. }
  84165. FullscreenApi.prefixed = browserApi[0] !== specApi[0];
  84166. }
  84167. var history = [];
  84168. var LogByTypeFactory = function LogByTypeFactory2(name, log2) {
  84169. return function(type2, level, args) {
  84170. var lvl = log2.levels[level];
  84171. var lvlRegExp = new RegExp("^(" + lvl + ")$");
  84172. if (type2 !== "log") {
  84173. args.unshift(type2.toUpperCase() + ":");
  84174. }
  84175. args.unshift(name + ":");
  84176. if (history) {
  84177. history.push([].concat(args));
  84178. var splice2 = history.length - 1e3;
  84179. history.splice(0, splice2 > 0 ? splice2 : 0);
  84180. }
  84181. if (!window_1.console) {
  84182. return;
  84183. }
  84184. var fn2 = window_1.console[type2];
  84185. if (!fn2 && type2 === "debug") {
  84186. fn2 = window_1.console.info || window_1.console.log;
  84187. }
  84188. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  84189. return;
  84190. }
  84191. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  84192. };
  84193. };
  84194. function createLogger$1(name) {
  84195. var level = "info";
  84196. var logByType;
  84197. var log2 = function log3() {
  84198. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  84199. args[_key] = arguments[_key];
  84200. }
  84201. logByType("log", level, args);
  84202. };
  84203. logByType = LogByTypeFactory(name, log2);
  84204. log2.createLogger = function(subname) {
  84205. return createLogger$1(name + ": " + subname);
  84206. };
  84207. log2.levels = {
  84208. all: "debug|log|warn|error",
  84209. off: "",
  84210. debug: "debug|log|warn|error",
  84211. info: "log|warn|error",
  84212. warn: "warn|error",
  84213. error: "error",
  84214. DEFAULT: level
  84215. };
  84216. log2.level = function(lvl) {
  84217. if (typeof lvl === "string") {
  84218. if (!log2.levels.hasOwnProperty(lvl)) {
  84219. throw new Error('"' + lvl + '" in not a valid log level');
  84220. }
  84221. level = lvl;
  84222. }
  84223. return level;
  84224. };
  84225. log2.history = function() {
  84226. return history ? [].concat(history) : [];
  84227. };
  84228. log2.history.filter = function(fname) {
  84229. return (history || []).filter(function(historyItem) {
  84230. return new RegExp(".*" + fname + ".*").test(historyItem[0]);
  84231. });
  84232. };
  84233. log2.history.clear = function() {
  84234. if (history) {
  84235. history.length = 0;
  84236. }
  84237. };
  84238. log2.history.disable = function() {
  84239. if (history !== null) {
  84240. history.length = 0;
  84241. history = null;
  84242. }
  84243. };
  84244. log2.history.enable = function() {
  84245. if (history === null) {
  84246. history = [];
  84247. }
  84248. };
  84249. log2.error = function() {
  84250. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  84251. args[_key2] = arguments[_key2];
  84252. }
  84253. return logByType("error", level, args);
  84254. };
  84255. log2.warn = function() {
  84256. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  84257. args[_key3] = arguments[_key3];
  84258. }
  84259. return logByType("warn", level, args);
  84260. };
  84261. log2.debug = function() {
  84262. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  84263. args[_key4] = arguments[_key4];
  84264. }
  84265. return logByType("debug", level, args);
  84266. };
  84267. return log2;
  84268. }
  84269. var log$1 = createLogger$1("VIDEOJS");
  84270. var createLogger = log$1.createLogger;
  84271. var toString = Object.prototype.toString;
  84272. var keys = function keys2(object) {
  84273. return isObject2(object) ? Object.keys(object) : [];
  84274. };
  84275. function each(object, fn2) {
  84276. keys(object).forEach(function(key) {
  84277. return fn2(object[key], key);
  84278. });
  84279. }
  84280. function reduce(object, fn2, initial) {
  84281. if (initial === void 0) {
  84282. initial = 0;
  84283. }
  84284. return keys(object).reduce(function(accum, key) {
  84285. return fn2(accum, object[key], key);
  84286. }, initial);
  84287. }
  84288. function assign(target) {
  84289. for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  84290. sources[_key - 1] = arguments[_key];
  84291. }
  84292. if (Object.assign) {
  84293. return _extends$2.apply(void 0, [target].concat(sources));
  84294. }
  84295. sources.forEach(function(source) {
  84296. if (!source) {
  84297. return;
  84298. }
  84299. each(source, function(value, key) {
  84300. target[key] = value;
  84301. });
  84302. });
  84303. return target;
  84304. }
  84305. function isObject2(value) {
  84306. return !!value && typeof value === "object";
  84307. }
  84308. function isPlain(value) {
  84309. return isObject2(value) && toString.call(value) === "[object Object]" && value.constructor === Object;
  84310. }
  84311. function computedStyle(el, prop) {
  84312. if (!el || !prop) {
  84313. return "";
  84314. }
  84315. if (typeof window_1.getComputedStyle === "function") {
  84316. var computedStyleValue;
  84317. try {
  84318. computedStyleValue = window_1.getComputedStyle(el);
  84319. } catch (e) {
  84320. return "";
  84321. }
  84322. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  84323. }
  84324. return "";
  84325. }
  84326. var USER_AGENT = window_1.navigator && window_1.navigator.userAgent || "";
  84327. var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);
  84328. var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;
  84329. var IS_IPOD = /iPod/i.test(USER_AGENT);
  84330. var IOS_VERSION = function() {
  84331. var match = USER_AGENT.match(/OS (\d+)_/i);
  84332. if (match && match[1]) {
  84333. return match[1];
  84334. }
  84335. return null;
  84336. }();
  84337. var IS_ANDROID = /Android/i.test(USER_AGENT);
  84338. var ANDROID_VERSION = function() {
  84339. var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  84340. if (!match) {
  84341. return null;
  84342. }
  84343. var major = match[1] && parseFloat(match[1]);
  84344. var minor = match[2] && parseFloat(match[2]);
  84345. if (major && minor) {
  84346. return parseFloat(match[1] + "." + match[2]);
  84347. } else if (major) {
  84348. return major;
  84349. }
  84350. return null;
  84351. }();
  84352. var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;
  84353. var IS_FIREFOX = /Firefox/i.test(USER_AGENT);
  84354. var IS_EDGE = /Edg/i.test(USER_AGENT);
  84355. var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));
  84356. var CHROME_VERSION = function() {
  84357. var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);
  84358. if (match && match[2]) {
  84359. return parseFloat(match[2]);
  84360. }
  84361. return null;
  84362. }();
  84363. var IE_VERSION = function() {
  84364. var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT);
  84365. var version2 = result && parseFloat(result[1]);
  84366. if (!version2 && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {
  84367. version2 = 11;
  84368. }
  84369. return version2;
  84370. }();
  84371. var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;
  84372. var IS_WINDOWS = /Windows/i.test(USER_AGENT);
  84373. var TOUCH_ENABLED = Boolean(isReal() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  84374. var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);
  84375. var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;
  84376. var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;
  84377. var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;
  84378. var browser = /* @__PURE__ */ Object.freeze({
  84379. __proto__: null,
  84380. IS_IPOD,
  84381. IOS_VERSION,
  84382. IS_ANDROID,
  84383. ANDROID_VERSION,
  84384. IS_NATIVE_ANDROID,
  84385. IS_FIREFOX,
  84386. IS_EDGE,
  84387. IS_CHROME,
  84388. CHROME_VERSION,
  84389. IE_VERSION,
  84390. IS_SAFARI,
  84391. IS_WINDOWS,
  84392. TOUCH_ENABLED,
  84393. IS_IPAD,
  84394. IS_IPHONE,
  84395. IS_IOS,
  84396. IS_ANY_SAFARI
  84397. });
  84398. function isNonBlankString(str) {
  84399. return typeof str === "string" && Boolean(str.trim());
  84400. }
  84401. function throwIfWhitespace(str) {
  84402. if (str.indexOf(" ") >= 0) {
  84403. throw new Error("class has illegal whitespace characters");
  84404. }
  84405. }
  84406. function classRegExp(className) {
  84407. return new RegExp("(^|\\s)" + className + "($|\\s)");
  84408. }
  84409. function isReal() {
  84410. return document_1 === window_1.document;
  84411. }
  84412. function isEl(value) {
  84413. return isObject2(value) && value.nodeType === 1;
  84414. }
  84415. function isInFrame() {
  84416. try {
  84417. return window_1.parent !== window_1.self;
  84418. } catch (x) {
  84419. return true;
  84420. }
  84421. }
  84422. function createQuerier(method) {
  84423. return function(selector, context) {
  84424. if (!isNonBlankString(selector)) {
  84425. return document_1[method](null);
  84426. }
  84427. if (isNonBlankString(context)) {
  84428. context = document_1.querySelector(context);
  84429. }
  84430. var ctx = isEl(context) ? context : document_1;
  84431. return ctx[method] && ctx[method](selector);
  84432. };
  84433. }
  84434. function createEl(tagName, properties, attributes, content) {
  84435. if (tagName === void 0) {
  84436. tagName = "div";
  84437. }
  84438. if (properties === void 0) {
  84439. properties = {};
  84440. }
  84441. if (attributes === void 0) {
  84442. attributes = {};
  84443. }
  84444. var el = document_1.createElement(tagName);
  84445. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  84446. var val = properties[propName];
  84447. if (propName.indexOf("aria-") !== -1 || propName === "role" || propName === "type") {
  84448. log$1.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\n" + ("createEl(type, properties, attributes). Attempting to set " + propName + " to " + val + "."));
  84449. el.setAttribute(propName, val);
  84450. } else if (propName === "textContent") {
  84451. textContent(el, val);
  84452. } else if (el[propName] !== val || propName === "tabIndex") {
  84453. el[propName] = val;
  84454. }
  84455. });
  84456. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84457. el.setAttribute(attrName, attributes[attrName]);
  84458. });
  84459. if (content) {
  84460. appendContent(el, content);
  84461. }
  84462. return el;
  84463. }
  84464. function textContent(el, text) {
  84465. if (typeof el.textContent === "undefined") {
  84466. el.innerText = text;
  84467. } else {
  84468. el.textContent = text;
  84469. }
  84470. return el;
  84471. }
  84472. function prependTo(child, parent) {
  84473. if (parent.firstChild) {
  84474. parent.insertBefore(child, parent.firstChild);
  84475. } else {
  84476. parent.appendChild(child);
  84477. }
  84478. }
  84479. function hasClass(element, classToCheck) {
  84480. throwIfWhitespace(classToCheck);
  84481. if (element.classList) {
  84482. return element.classList.contains(classToCheck);
  84483. }
  84484. return classRegExp(classToCheck).test(element.className);
  84485. }
  84486. function addClass(element, classToAdd) {
  84487. if (element.classList) {
  84488. element.classList.add(classToAdd);
  84489. } else if (!hasClass(element, classToAdd)) {
  84490. element.className = (element.className + " " + classToAdd).trim();
  84491. }
  84492. return element;
  84493. }
  84494. function removeClass(element, classToRemove) {
  84495. if (!element) {
  84496. log$1.warn("removeClass was called with an element that doesn't exist");
  84497. return null;
  84498. }
  84499. if (element.classList) {
  84500. element.classList.remove(classToRemove);
  84501. } else {
  84502. throwIfWhitespace(classToRemove);
  84503. element.className = element.className.split(/\s+/).filter(function(c) {
  84504. return c !== classToRemove;
  84505. }).join(" ");
  84506. }
  84507. return element;
  84508. }
  84509. function toggleClass(element, classToToggle, predicate) {
  84510. var has = hasClass(element, classToToggle);
  84511. if (typeof predicate === "function") {
  84512. predicate = predicate(element, classToToggle);
  84513. }
  84514. if (typeof predicate !== "boolean") {
  84515. predicate = !has;
  84516. }
  84517. if (predicate === has) {
  84518. return;
  84519. }
  84520. if (predicate) {
  84521. addClass(element, classToToggle);
  84522. } else {
  84523. removeClass(element, classToToggle);
  84524. }
  84525. return element;
  84526. }
  84527. function setAttributes(el, attributes) {
  84528. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84529. var attrValue = attributes[attrName];
  84530. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  84531. el.removeAttribute(attrName);
  84532. } else {
  84533. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  84534. }
  84535. });
  84536. }
  84537. function getAttributes(tag) {
  84538. var obj = {};
  84539. var knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  84540. if (tag && tag.attributes && tag.attributes.length > 0) {
  84541. var attrs = tag.attributes;
  84542. for (var i2 = attrs.length - 1; i2 >= 0; i2--) {
  84543. var attrName = attrs[i2].name;
  84544. var attrVal = attrs[i2].value;
  84545. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  84546. attrVal = attrVal !== null ? true : false;
  84547. }
  84548. obj[attrName] = attrVal;
  84549. }
  84550. }
  84551. return obj;
  84552. }
  84553. function getAttribute(el, attribute) {
  84554. return el.getAttribute(attribute);
  84555. }
  84556. function setAttribute(el, attribute, value) {
  84557. el.setAttribute(attribute, value);
  84558. }
  84559. function removeAttribute(el, attribute) {
  84560. el.removeAttribute(attribute);
  84561. }
  84562. function blockTextSelection() {
  84563. document_1.body.focus();
  84564. document_1.onselectstart = function() {
  84565. return false;
  84566. };
  84567. }
  84568. function unblockTextSelection() {
  84569. document_1.onselectstart = function() {
  84570. return true;
  84571. };
  84572. }
  84573. function getBoundingClientRect(el) {
  84574. if (el && el.getBoundingClientRect && el.parentNode) {
  84575. var rect = el.getBoundingClientRect();
  84576. var result = {};
  84577. ["bottom", "height", "left", "right", "top", "width"].forEach(function(k) {
  84578. if (rect[k] !== void 0) {
  84579. result[k] = rect[k];
  84580. }
  84581. });
  84582. if (!result.height) {
  84583. result.height = parseFloat(computedStyle(el, "height"));
  84584. }
  84585. if (!result.width) {
  84586. result.width = parseFloat(computedStyle(el, "width"));
  84587. }
  84588. return result;
  84589. }
  84590. }
  84591. function findPosition(el) {
  84592. if (!el || el && !el.offsetParent) {
  84593. return {
  84594. left: 0,
  84595. top: 0,
  84596. width: 0,
  84597. height: 0
  84598. };
  84599. }
  84600. var width2 = el.offsetWidth;
  84601. var height2 = el.offsetHeight;
  84602. var left = 0;
  84603. var top = 0;
  84604. while (el.offsetParent && el !== document_1[FullscreenApi.fullscreenElement]) {
  84605. left += el.offsetLeft;
  84606. top += el.offsetTop;
  84607. el = el.offsetParent;
  84608. }
  84609. return {
  84610. left,
  84611. top,
  84612. width: width2,
  84613. height: height2
  84614. };
  84615. }
  84616. function getPointerPosition(el, event2) {
  84617. var translated = {
  84618. x: 0,
  84619. y: 0
  84620. };
  84621. if (IS_IOS) {
  84622. var item = el;
  84623. while (item && item.nodeName.toLowerCase() !== "html") {
  84624. var transform3 = computedStyle(item, "transform");
  84625. if (/^matrix/.test(transform3)) {
  84626. var values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  84627. translated.x += values3[4];
  84628. translated.y += values3[5];
  84629. } else if (/^matrix3d/.test(transform3)) {
  84630. var _values = transform3.slice(9, -1).split(/,\s/).map(Number);
  84631. translated.x += _values[12];
  84632. translated.y += _values[13];
  84633. }
  84634. item = item.parentNode;
  84635. }
  84636. }
  84637. var position2 = {};
  84638. var boxTarget = findPosition(event2.target);
  84639. var box = findPosition(el);
  84640. var boxW = box.width;
  84641. var boxH = box.height;
  84642. var offsetY = event2.offsetY - (box.top - boxTarget.top);
  84643. var offsetX = event2.offsetX - (box.left - boxTarget.left);
  84644. if (event2.changedTouches) {
  84645. offsetX = event2.changedTouches[0].pageX - box.left;
  84646. offsetY = event2.changedTouches[0].pageY + box.top;
  84647. if (IS_IOS) {
  84648. offsetX -= translated.x;
  84649. offsetY -= translated.y;
  84650. }
  84651. }
  84652. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  84653. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  84654. return position2;
  84655. }
  84656. function isTextNode(value) {
  84657. return isObject2(value) && value.nodeType === 3;
  84658. }
  84659. function emptyEl(el) {
  84660. while (el.firstChild) {
  84661. el.removeChild(el.firstChild);
  84662. }
  84663. return el;
  84664. }
  84665. function normalizeContent(content) {
  84666. if (typeof content === "function") {
  84667. content = content();
  84668. }
  84669. return (Array.isArray(content) ? content : [content]).map(function(value) {
  84670. if (typeof value === "function") {
  84671. value = value();
  84672. }
  84673. if (isEl(value) || isTextNode(value)) {
  84674. return value;
  84675. }
  84676. if (typeof value === "string" && /\S/.test(value)) {
  84677. return document_1.createTextNode(value);
  84678. }
  84679. }).filter(function(value) {
  84680. return value;
  84681. });
  84682. }
  84683. function appendContent(el, content) {
  84684. normalizeContent(content).forEach(function(node) {
  84685. return el.appendChild(node);
  84686. });
  84687. return el;
  84688. }
  84689. function insertContent(el, content) {
  84690. return appendContent(emptyEl(el), content);
  84691. }
  84692. function isSingleLeftClick(event2) {
  84693. if (event2.button === void 0 && event2.buttons === void 0) {
  84694. return true;
  84695. }
  84696. if (event2.button === 0 && event2.buttons === void 0) {
  84697. return true;
  84698. }
  84699. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  84700. return true;
  84701. }
  84702. if (event2.button !== 0 || event2.buttons !== 1) {
  84703. return false;
  84704. }
  84705. return true;
  84706. }
  84707. var $ = createQuerier("querySelector");
  84708. var $$ = createQuerier("querySelectorAll");
  84709. var Dom$1 = /* @__PURE__ */ Object.freeze({
  84710. __proto__: null,
  84711. isReal,
  84712. isEl,
  84713. isInFrame,
  84714. createEl,
  84715. textContent,
  84716. prependTo,
  84717. hasClass,
  84718. addClass,
  84719. removeClass,
  84720. toggleClass,
  84721. setAttributes,
  84722. getAttributes,
  84723. getAttribute,
  84724. setAttribute,
  84725. removeAttribute,
  84726. blockTextSelection,
  84727. unblockTextSelection,
  84728. getBoundingClientRect,
  84729. findPosition,
  84730. getPointerPosition,
  84731. isTextNode,
  84732. emptyEl,
  84733. normalizeContent,
  84734. appendContent,
  84735. insertContent,
  84736. isSingleLeftClick,
  84737. $,
  84738. $$
  84739. });
  84740. var _windowLoaded = false;
  84741. var videojs$1;
  84742. var autoSetup = function autoSetup2() {
  84743. if (videojs$1.options.autoSetup === false) {
  84744. return;
  84745. }
  84746. var vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  84747. var audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  84748. var divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  84749. var mediaEls = vids.concat(audios, divs);
  84750. if (mediaEls && mediaEls.length > 0) {
  84751. for (var i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  84752. var mediaEl = mediaEls[i2];
  84753. if (mediaEl && mediaEl.getAttribute) {
  84754. if (mediaEl.player === void 0) {
  84755. var options2 = mediaEl.getAttribute("data-setup");
  84756. if (options2 !== null) {
  84757. videojs$1(mediaEl);
  84758. }
  84759. }
  84760. } else {
  84761. autoSetupTimeout(1);
  84762. break;
  84763. }
  84764. }
  84765. } else if (!_windowLoaded) {
  84766. autoSetupTimeout(1);
  84767. }
  84768. };
  84769. function autoSetupTimeout(wait, vjs) {
  84770. if (!isReal()) {
  84771. return;
  84772. }
  84773. if (vjs) {
  84774. videojs$1 = vjs;
  84775. }
  84776. window_1.setTimeout(autoSetup, wait);
  84777. }
  84778. function setWindowLoaded() {
  84779. _windowLoaded = true;
  84780. window_1.removeEventListener("load", setWindowLoaded);
  84781. }
  84782. if (isReal()) {
  84783. if (document_1.readyState === "complete") {
  84784. setWindowLoaded();
  84785. } else {
  84786. window_1.addEventListener("load", setWindowLoaded);
  84787. }
  84788. }
  84789. var createStyleElement = function createStyleElement2(className) {
  84790. var style = document_1.createElement("style");
  84791. style.className = className;
  84792. return style;
  84793. };
  84794. var setTextContent = function setTextContent2(el, content) {
  84795. if (el.styleSheet) {
  84796. el.styleSheet.cssText = content;
  84797. } else {
  84798. el.textContent = content;
  84799. }
  84800. };
  84801. var _initialGuid = 3;
  84802. var _guid = _initialGuid;
  84803. function newGUID() {
  84804. return _guid++;
  84805. }
  84806. var FakeWeakMap;
  84807. if (!window_1.WeakMap) {
  84808. FakeWeakMap = /* @__PURE__ */ function() {
  84809. function FakeWeakMap2() {
  84810. this.vdata = "vdata" + Math.floor(window_1.performance && window_1.performance.now() || Date.now());
  84811. this.data = {};
  84812. }
  84813. var _proto = FakeWeakMap2.prototype;
  84814. _proto.set = function set4(key, value) {
  84815. var access = key[this.vdata] || newGUID();
  84816. if (!key[this.vdata]) {
  84817. key[this.vdata] = access;
  84818. }
  84819. this.data[access] = value;
  84820. return this;
  84821. };
  84822. _proto.get = function get7(key) {
  84823. var access = key[this.vdata];
  84824. if (access) {
  84825. return this.data[access];
  84826. }
  84827. log$1("We have no data for this element", key);
  84828. return void 0;
  84829. };
  84830. _proto.has = function has(key) {
  84831. var access = key[this.vdata];
  84832. return access in this.data;
  84833. };
  84834. _proto["delete"] = function _delete(key) {
  84835. var access = key[this.vdata];
  84836. if (access) {
  84837. delete this.data[access];
  84838. delete key[this.vdata];
  84839. }
  84840. };
  84841. return FakeWeakMap2;
  84842. }();
  84843. }
  84844. var DomData = window_1.WeakMap ? /* @__PURE__ */ new WeakMap() : new FakeWeakMap();
  84845. function _cleanUpEvents(elem, type2) {
  84846. if (!DomData.has(elem)) {
  84847. return;
  84848. }
  84849. var data = DomData.get(elem);
  84850. if (data.handlers[type2].length === 0) {
  84851. delete data.handlers[type2];
  84852. if (elem.removeEventListener) {
  84853. elem.removeEventListener(type2, data.dispatcher, false);
  84854. } else if (elem.detachEvent) {
  84855. elem.detachEvent("on" + type2, data.dispatcher);
  84856. }
  84857. }
  84858. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  84859. delete data.handlers;
  84860. delete data.dispatcher;
  84861. delete data.disabled;
  84862. }
  84863. if (Object.getOwnPropertyNames(data).length === 0) {
  84864. DomData["delete"](elem);
  84865. }
  84866. }
  84867. function _handleMultipleEvents(fn2, elem, types, callback2) {
  84868. types.forEach(function(type2) {
  84869. fn2(elem, type2, callback2);
  84870. });
  84871. }
  84872. function fixEvent(event2) {
  84873. if (event2.fixed_) {
  84874. return event2;
  84875. }
  84876. function returnTrue() {
  84877. return true;
  84878. }
  84879. function returnFalse() {
  84880. return false;
  84881. }
  84882. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  84883. var old = event2 || window_1.event;
  84884. event2 = {};
  84885. for (var key in old) {
  84886. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  84887. if (!(key === "returnValue" && old.preventDefault)) {
  84888. event2[key] = old[key];
  84889. }
  84890. }
  84891. }
  84892. if (!event2.target) {
  84893. event2.target = event2.srcElement || document_1;
  84894. }
  84895. if (!event2.relatedTarget) {
  84896. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  84897. }
  84898. event2.preventDefault = function() {
  84899. if (old.preventDefault) {
  84900. old.preventDefault();
  84901. }
  84902. event2.returnValue = false;
  84903. old.returnValue = false;
  84904. event2.defaultPrevented = true;
  84905. };
  84906. event2.defaultPrevented = false;
  84907. event2.stopPropagation = function() {
  84908. if (old.stopPropagation) {
  84909. old.stopPropagation();
  84910. }
  84911. event2.cancelBubble = true;
  84912. old.cancelBubble = true;
  84913. event2.isPropagationStopped = returnTrue;
  84914. };
  84915. event2.isPropagationStopped = returnFalse;
  84916. event2.stopImmediatePropagation = function() {
  84917. if (old.stopImmediatePropagation) {
  84918. old.stopImmediatePropagation();
  84919. }
  84920. event2.isImmediatePropagationStopped = returnTrue;
  84921. event2.stopPropagation();
  84922. };
  84923. event2.isImmediatePropagationStopped = returnFalse;
  84924. if (event2.clientX !== null && event2.clientX !== void 0) {
  84925. var doc = document_1.documentElement;
  84926. var body = document_1.body;
  84927. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  84928. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  84929. }
  84930. event2.which = event2.charCode || event2.keyCode;
  84931. if (event2.button !== null && event2.button !== void 0) {
  84932. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  84933. }
  84934. }
  84935. event2.fixed_ = true;
  84936. return event2;
  84937. }
  84938. var _supportsPassive;
  84939. var supportsPassive = function supportsPassive2() {
  84940. if (typeof _supportsPassive !== "boolean") {
  84941. _supportsPassive = false;
  84942. try {
  84943. var opts = Object.defineProperty({}, "passive", {
  84944. get: function get7() {
  84945. _supportsPassive = true;
  84946. }
  84947. });
  84948. window_1.addEventListener("test", null, opts);
  84949. window_1.removeEventListener("test", null, opts);
  84950. } catch (e) {
  84951. }
  84952. }
  84953. return _supportsPassive;
  84954. };
  84955. var passiveEvents = ["touchstart", "touchmove"];
  84956. function on(elem, type2, fn2) {
  84957. if (Array.isArray(type2)) {
  84958. return _handleMultipleEvents(on, elem, type2, fn2);
  84959. }
  84960. if (!DomData.has(elem)) {
  84961. DomData.set(elem, {});
  84962. }
  84963. var data = DomData.get(elem);
  84964. if (!data.handlers) {
  84965. data.handlers = {};
  84966. }
  84967. if (!data.handlers[type2]) {
  84968. data.handlers[type2] = [];
  84969. }
  84970. if (!fn2.guid) {
  84971. fn2.guid = newGUID();
  84972. }
  84973. data.handlers[type2].push(fn2);
  84974. if (!data.dispatcher) {
  84975. data.disabled = false;
  84976. data.dispatcher = function(event2, hash) {
  84977. if (data.disabled) {
  84978. return;
  84979. }
  84980. event2 = fixEvent(event2);
  84981. var handlers = data.handlers[event2.type];
  84982. if (handlers) {
  84983. var handlersCopy = handlers.slice(0);
  84984. for (var m = 0, n = handlersCopy.length; m < n; m++) {
  84985. if (event2.isImmediatePropagationStopped()) {
  84986. break;
  84987. } else {
  84988. try {
  84989. handlersCopy[m].call(elem, event2, hash);
  84990. } catch (e) {
  84991. log$1.error(e);
  84992. }
  84993. }
  84994. }
  84995. }
  84996. };
  84997. }
  84998. if (data.handlers[type2].length === 1) {
  84999. if (elem.addEventListener) {
  85000. var options2 = false;
  85001. if (supportsPassive() && passiveEvents.indexOf(type2) > -1) {
  85002. options2 = {
  85003. passive: true
  85004. };
  85005. }
  85006. elem.addEventListener(type2, data.dispatcher, options2);
  85007. } else if (elem.attachEvent) {
  85008. elem.attachEvent("on" + type2, data.dispatcher);
  85009. }
  85010. }
  85011. }
  85012. function off(elem, type2, fn2) {
  85013. if (!DomData.has(elem)) {
  85014. return;
  85015. }
  85016. var data = DomData.get(elem);
  85017. if (!data.handlers) {
  85018. return;
  85019. }
  85020. if (Array.isArray(type2)) {
  85021. return _handleMultipleEvents(off, elem, type2, fn2);
  85022. }
  85023. var removeType = function removeType2(el, t3) {
  85024. data.handlers[t3] = [];
  85025. _cleanUpEvents(el, t3);
  85026. };
  85027. if (type2 === void 0) {
  85028. for (var t2 in data.handlers) {
  85029. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  85030. removeType(elem, t2);
  85031. }
  85032. }
  85033. return;
  85034. }
  85035. var handlers = data.handlers[type2];
  85036. if (!handlers) {
  85037. return;
  85038. }
  85039. if (!fn2) {
  85040. removeType(elem, type2);
  85041. return;
  85042. }
  85043. if (fn2.guid) {
  85044. for (var n = 0; n < handlers.length; n++) {
  85045. if (handlers[n].guid === fn2.guid) {
  85046. handlers.splice(n--, 1);
  85047. }
  85048. }
  85049. }
  85050. _cleanUpEvents(elem, type2);
  85051. }
  85052. function trigger(elem, event2, hash) {
  85053. var elemData = DomData.has(elem) ? DomData.get(elem) : {};
  85054. var parent = elem.parentNode || elem.ownerDocument;
  85055. if (typeof event2 === "string") {
  85056. event2 = {
  85057. type: event2,
  85058. target: elem
  85059. };
  85060. } else if (!event2.target) {
  85061. event2.target = elem;
  85062. }
  85063. event2 = fixEvent(event2);
  85064. if (elemData.dispatcher) {
  85065. elemData.dispatcher.call(elem, event2, hash);
  85066. }
  85067. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  85068. trigger.call(null, parent, event2, hash);
  85069. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  85070. if (!DomData.has(event2.target)) {
  85071. DomData.set(event2.target, {});
  85072. }
  85073. var targetData = DomData.get(event2.target);
  85074. if (event2.target[event2.type]) {
  85075. targetData.disabled = true;
  85076. if (typeof event2.target[event2.type] === "function") {
  85077. event2.target[event2.type]();
  85078. }
  85079. targetData.disabled = false;
  85080. }
  85081. }
  85082. return !event2.defaultPrevented;
  85083. }
  85084. function one(elem, type2, fn2) {
  85085. if (Array.isArray(type2)) {
  85086. return _handleMultipleEvents(one, elem, type2, fn2);
  85087. }
  85088. var func = function func2() {
  85089. off(elem, type2, func2);
  85090. fn2.apply(this, arguments);
  85091. };
  85092. func.guid = fn2.guid = fn2.guid || newGUID();
  85093. on(elem, type2, func);
  85094. }
  85095. function any(elem, type2, fn2) {
  85096. var func = function func2() {
  85097. off(elem, type2, func2);
  85098. fn2.apply(this, arguments);
  85099. };
  85100. func.guid = fn2.guid = fn2.guid || newGUID();
  85101. on(elem, type2, func);
  85102. }
  85103. var Events = /* @__PURE__ */ Object.freeze({
  85104. __proto__: null,
  85105. fixEvent,
  85106. on,
  85107. off,
  85108. trigger,
  85109. one,
  85110. any
  85111. });
  85112. var UPDATE_REFRESH_INTERVAL = 30;
  85113. var bind = function bind2(context, fn2, uid) {
  85114. if (!fn2.guid) {
  85115. fn2.guid = newGUID();
  85116. }
  85117. var bound = fn2.bind(context);
  85118. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  85119. return bound;
  85120. };
  85121. var throttle = function throttle2(fn2, wait) {
  85122. var last = window_1.performance.now();
  85123. var throttled = function throttled2() {
  85124. var now2 = window_1.performance.now();
  85125. if (now2 - last >= wait) {
  85126. fn2.apply(void 0, arguments);
  85127. last = now2;
  85128. }
  85129. };
  85130. return throttled;
  85131. };
  85132. var debounce = function debounce2(func, wait, immediate, context) {
  85133. if (context === void 0) {
  85134. context = window_1;
  85135. }
  85136. var timeout;
  85137. var cancel = function cancel2() {
  85138. context.clearTimeout(timeout);
  85139. timeout = null;
  85140. };
  85141. var debounced = function debounced2() {
  85142. var self2 = this;
  85143. var args = arguments;
  85144. var _later = function later() {
  85145. timeout = null;
  85146. _later = null;
  85147. if (!immediate) {
  85148. func.apply(self2, args);
  85149. }
  85150. };
  85151. if (!timeout && immediate) {
  85152. func.apply(self2, args);
  85153. }
  85154. context.clearTimeout(timeout);
  85155. timeout = context.setTimeout(_later, wait);
  85156. };
  85157. debounced.cancel = cancel;
  85158. return debounced;
  85159. };
  85160. var EventTarget$2 = function EventTarget() {
  85161. };
  85162. EventTarget$2.prototype.allowedEvents_ = {};
  85163. EventTarget$2.prototype.on = function(type2, fn2) {
  85164. var ael = this.addEventListener;
  85165. this.addEventListener = function() {
  85166. };
  85167. on(this, type2, fn2);
  85168. this.addEventListener = ael;
  85169. };
  85170. EventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;
  85171. EventTarget$2.prototype.off = function(type2, fn2) {
  85172. off(this, type2, fn2);
  85173. };
  85174. EventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;
  85175. EventTarget$2.prototype.one = function(type2, fn2) {
  85176. var ael = this.addEventListener;
  85177. this.addEventListener = function() {
  85178. };
  85179. one(this, type2, fn2);
  85180. this.addEventListener = ael;
  85181. };
  85182. EventTarget$2.prototype.any = function(type2, fn2) {
  85183. var ael = this.addEventListener;
  85184. this.addEventListener = function() {
  85185. };
  85186. any(this, type2, fn2);
  85187. this.addEventListener = ael;
  85188. };
  85189. EventTarget$2.prototype.trigger = function(event2) {
  85190. var type2 = event2.type || event2;
  85191. if (typeof event2 === "string") {
  85192. event2 = {
  85193. type: type2
  85194. };
  85195. }
  85196. event2 = fixEvent(event2);
  85197. if (this.allowedEvents_[type2] && this["on" + type2]) {
  85198. this["on" + type2](event2);
  85199. }
  85200. trigger(this, event2);
  85201. };
  85202. EventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;
  85203. var EVENT_MAP;
  85204. EventTarget$2.prototype.queueTrigger = function(event2) {
  85205. var _this = this;
  85206. if (!EVENT_MAP) {
  85207. EVENT_MAP = /* @__PURE__ */ new Map();
  85208. }
  85209. var type2 = event2.type || event2;
  85210. var map = EVENT_MAP.get(this);
  85211. if (!map) {
  85212. map = /* @__PURE__ */ new Map();
  85213. EVENT_MAP.set(this, map);
  85214. }
  85215. var oldTimeout = map.get(type2);
  85216. map["delete"](type2);
  85217. window_1.clearTimeout(oldTimeout);
  85218. var timeout = window_1.setTimeout(function() {
  85219. map["delete"](type2);
  85220. if (map.size === 0) {
  85221. map = null;
  85222. EVENT_MAP["delete"](_this);
  85223. }
  85224. _this.trigger(event2);
  85225. }, 0);
  85226. map.set(type2, timeout);
  85227. };
  85228. var objName = function objName2(obj) {
  85229. if (typeof obj.name === "function") {
  85230. return obj.name();
  85231. }
  85232. if (typeof obj.name === "string") {
  85233. return obj.name;
  85234. }
  85235. if (obj.name_) {
  85236. return obj.name_;
  85237. }
  85238. if (obj.constructor && obj.constructor.name) {
  85239. return obj.constructor.name;
  85240. }
  85241. return typeof obj;
  85242. };
  85243. var isEvented = function isEvented2(object) {
  85244. return object instanceof EventTarget$2 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(k) {
  85245. return typeof object[k] === "function";
  85246. });
  85247. };
  85248. var addEventedCallback = function addEventedCallback2(target, callback2) {
  85249. if (isEvented(target)) {
  85250. callback2();
  85251. } else {
  85252. if (!target.eventedCallbacks) {
  85253. target.eventedCallbacks = [];
  85254. }
  85255. target.eventedCallbacks.push(callback2);
  85256. }
  85257. };
  85258. var isValidEventType = function isValidEventType2(type2) {
  85259. return typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  85260. };
  85261. var validateTarget = function validateTarget2(target, obj, fnName) {
  85262. if (!target || !target.nodeName && !isEvented(target)) {
  85263. throw new Error("Invalid target for " + objName(obj) + "#" + fnName + "; must be a DOM node or evented object.");
  85264. }
  85265. };
  85266. var validateEventType = function validateEventType2(type2, obj, fnName) {
  85267. if (!isValidEventType(type2)) {
  85268. throw new Error("Invalid event type for " + objName(obj) + "#" + fnName + "; must be a non-empty string or array.");
  85269. }
  85270. };
  85271. var validateListener = function validateListener2(listener, obj, fnName) {
  85272. if (typeof listener !== "function") {
  85273. throw new Error("Invalid listener for " + objName(obj) + "#" + fnName + "; must be a function.");
  85274. }
  85275. };
  85276. var normalizeListenArgs = function normalizeListenArgs2(self2, args, fnName) {
  85277. var isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  85278. var target;
  85279. var type2;
  85280. var listener;
  85281. if (isTargetingSelf) {
  85282. target = self2.eventBusEl_;
  85283. if (args.length >= 3) {
  85284. args.shift();
  85285. }
  85286. type2 = args[0];
  85287. listener = args[1];
  85288. } else {
  85289. target = args[0];
  85290. type2 = args[1];
  85291. listener = args[2];
  85292. }
  85293. validateTarget(target, self2, fnName);
  85294. validateEventType(type2, self2, fnName);
  85295. validateListener(listener, self2, fnName);
  85296. listener = bind(self2, listener);
  85297. return {
  85298. isTargetingSelf,
  85299. target,
  85300. type: type2,
  85301. listener
  85302. };
  85303. };
  85304. var listen = function listen2(target, method, type2, listener) {
  85305. validateTarget(target, target, method);
  85306. if (target.nodeName) {
  85307. Events[method](target, type2, listener);
  85308. } else {
  85309. target[method](type2, listener);
  85310. }
  85311. };
  85312. var EventedMixin = {
  85313. on: function on2() {
  85314. var _this = this;
  85315. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  85316. args[_key] = arguments[_key];
  85317. }
  85318. var _normalizeListenArgs = normalizeListenArgs(this, args, "on"), isTargetingSelf = _normalizeListenArgs.isTargetingSelf, target = _normalizeListenArgs.target, type2 = _normalizeListenArgs.type, listener = _normalizeListenArgs.listener;
  85319. listen(target, "on", type2, listener);
  85320. if (!isTargetingSelf) {
  85321. var removeListenerOnDispose = function removeListenerOnDispose2() {
  85322. return _this.off(target, type2, listener);
  85323. };
  85324. removeListenerOnDispose.guid = listener.guid;
  85325. var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose2() {
  85326. return _this.off("dispose", removeListenerOnDispose);
  85327. };
  85328. removeRemoverOnTargetDispose.guid = listener.guid;
  85329. listen(this, "on", "dispose", removeListenerOnDispose);
  85330. listen(target, "on", "dispose", removeRemoverOnTargetDispose);
  85331. }
  85332. },
  85333. one: function one2() {
  85334. var _this2 = this;
  85335. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  85336. args[_key2] = arguments[_key2];
  85337. }
  85338. var _normalizeListenArgs2 = normalizeListenArgs(this, args, "one"), isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, target = _normalizeListenArgs2.target, type2 = _normalizeListenArgs2.type, listener = _normalizeListenArgs2.listener;
  85339. if (isTargetingSelf) {
  85340. listen(target, "one", type2, listener);
  85341. } else {
  85342. var wrapper = function wrapper2() {
  85343. _this2.off(target, type2, wrapper2);
  85344. for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  85345. largs[_key3] = arguments[_key3];
  85346. }
  85347. listener.apply(null, largs);
  85348. };
  85349. wrapper.guid = listener.guid;
  85350. listen(target, "one", type2, wrapper);
  85351. }
  85352. },
  85353. any: function any2() {
  85354. var _this3 = this;
  85355. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  85356. args[_key4] = arguments[_key4];
  85357. }
  85358. var _normalizeListenArgs3 = normalizeListenArgs(this, args, "any"), isTargetingSelf = _normalizeListenArgs3.isTargetingSelf, target = _normalizeListenArgs3.target, type2 = _normalizeListenArgs3.type, listener = _normalizeListenArgs3.listener;
  85359. if (isTargetingSelf) {
  85360. listen(target, "any", type2, listener);
  85361. } else {
  85362. var wrapper = function wrapper2() {
  85363. _this3.off(target, type2, wrapper2);
  85364. for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  85365. largs[_key5] = arguments[_key5];
  85366. }
  85367. listener.apply(null, largs);
  85368. };
  85369. wrapper.guid = listener.guid;
  85370. listen(target, "any", type2, wrapper);
  85371. }
  85372. },
  85373. off: function off$12(targetOrType, typeOrListener, listener) {
  85374. if (!targetOrType || isValidEventType(targetOrType)) {
  85375. off(this.eventBusEl_, targetOrType, typeOrListener);
  85376. } else {
  85377. var target = targetOrType;
  85378. var type2 = typeOrListener;
  85379. validateTarget(target, this, "off");
  85380. validateEventType(type2, this, "off");
  85381. validateListener(listener, this, "off");
  85382. listener = bind(this, listener);
  85383. this.off("dispose", listener);
  85384. if (target.nodeName) {
  85385. off(target, type2, listener);
  85386. off(target, "dispose", listener);
  85387. } else if (isEvented(target)) {
  85388. target.off(type2, listener);
  85389. target.off("dispose", listener);
  85390. }
  85391. }
  85392. },
  85393. trigger: function trigger$12(event2, hash) {
  85394. validateTarget(this.eventBusEl_, this, "trigger");
  85395. var type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  85396. if (!isValidEventType(type2)) {
  85397. var error = "Invalid event type for " + objName(this) + "#trigger; must be a non-empty string or object with a type key that has a non-empty value.";
  85398. if (event2) {
  85399. (this.log || log$1).error(error);
  85400. } else {
  85401. throw new Error(error);
  85402. }
  85403. }
  85404. return trigger(this.eventBusEl_, event2, hash);
  85405. }
  85406. };
  85407. function evented(target, options2) {
  85408. if (options2 === void 0) {
  85409. options2 = {};
  85410. }
  85411. var _options = options2, eventBusKey = _options.eventBusKey;
  85412. if (eventBusKey) {
  85413. if (!target[eventBusKey].nodeName) {
  85414. throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.');
  85415. }
  85416. target.eventBusEl_ = target[eventBusKey];
  85417. } else {
  85418. target.eventBusEl_ = createEl("span", {
  85419. className: "vjs-event-bus"
  85420. });
  85421. }
  85422. assign(target, EventedMixin);
  85423. if (target.eventedCallbacks) {
  85424. target.eventedCallbacks.forEach(function(callback2) {
  85425. callback2();
  85426. });
  85427. }
  85428. target.on("dispose", function() {
  85429. target.off();
  85430. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  85431. if (val && DomData.has(val)) {
  85432. DomData["delete"](val);
  85433. }
  85434. });
  85435. window_1.setTimeout(function() {
  85436. target.eventBusEl_ = null;
  85437. }, 0);
  85438. });
  85439. return target;
  85440. }
  85441. var StatefulMixin = {
  85442. state: {},
  85443. setState: function setState(stateUpdates) {
  85444. var _this = this;
  85445. if (typeof stateUpdates === "function") {
  85446. stateUpdates = stateUpdates();
  85447. }
  85448. var changes;
  85449. each(stateUpdates, function(value, key) {
  85450. if (_this.state[key] !== value) {
  85451. changes = changes || {};
  85452. changes[key] = {
  85453. from: _this.state[key],
  85454. to: value
  85455. };
  85456. }
  85457. _this.state[key] = value;
  85458. });
  85459. if (changes && isEvented(this)) {
  85460. this.trigger({
  85461. changes,
  85462. type: "statechanged"
  85463. });
  85464. }
  85465. return changes;
  85466. }
  85467. };
  85468. function stateful(target, defaultState) {
  85469. assign(target, StatefulMixin);
  85470. target.state = assign({}, target.state, defaultState);
  85471. if (typeof target.handleStateChanged === "function" && isEvented(target)) {
  85472. target.on("statechanged", target.handleStateChanged);
  85473. }
  85474. return target;
  85475. }
  85476. var toLowerCase = function toLowerCase2(string) {
  85477. if (typeof string !== "string") {
  85478. return string;
  85479. }
  85480. return string.replace(/./, function(w) {
  85481. return w.toLowerCase();
  85482. });
  85483. };
  85484. var toTitleCase$1 = function toTitleCase(string) {
  85485. if (typeof string !== "string") {
  85486. return string;
  85487. }
  85488. return string.replace(/./, function(w) {
  85489. return w.toUpperCase();
  85490. });
  85491. };
  85492. var titleCaseEquals = function titleCaseEquals2(str1, str2) {
  85493. return toTitleCase$1(str1) === toTitleCase$1(str2);
  85494. };
  85495. function mergeOptions$3() {
  85496. var result = {};
  85497. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  85498. sources[_key] = arguments[_key];
  85499. }
  85500. sources.forEach(function(source) {
  85501. if (!source) {
  85502. return;
  85503. }
  85504. each(source, function(value, key) {
  85505. if (!isPlain(value)) {
  85506. result[key] = value;
  85507. return;
  85508. }
  85509. if (!isPlain(result[key])) {
  85510. result[key] = {};
  85511. }
  85512. result[key] = mergeOptions$3(result[key], value);
  85513. });
  85514. });
  85515. return result;
  85516. }
  85517. var MapSham = /* @__PURE__ */ function() {
  85518. function MapSham2() {
  85519. this.map_ = {};
  85520. }
  85521. var _proto = MapSham2.prototype;
  85522. _proto.has = function has(key) {
  85523. return key in this.map_;
  85524. };
  85525. _proto["delete"] = function _delete(key) {
  85526. var has = this.has(key);
  85527. delete this.map_[key];
  85528. return has;
  85529. };
  85530. _proto.set = function set4(key, value) {
  85531. this.map_[key] = value;
  85532. return this;
  85533. };
  85534. _proto.forEach = function forEach(callback2, thisArg) {
  85535. for (var key in this.map_) {
  85536. callback2.call(thisArg, this.map_[key], key, this);
  85537. }
  85538. };
  85539. return MapSham2;
  85540. }();
  85541. var Map$1 = window_1.Map ? window_1.Map : MapSham;
  85542. var SetSham = /* @__PURE__ */ function() {
  85543. function SetSham2() {
  85544. this.set_ = {};
  85545. }
  85546. var _proto = SetSham2.prototype;
  85547. _proto.has = function has(key) {
  85548. return key in this.set_;
  85549. };
  85550. _proto["delete"] = function _delete(key) {
  85551. var has = this.has(key);
  85552. delete this.set_[key];
  85553. return has;
  85554. };
  85555. _proto.add = function add(key) {
  85556. this.set_[key] = 1;
  85557. return this;
  85558. };
  85559. _proto.forEach = function forEach(callback2, thisArg) {
  85560. for (var key in this.set_) {
  85561. callback2.call(thisArg, key, key, this);
  85562. }
  85563. };
  85564. return SetSham2;
  85565. }();
  85566. var Set$1 = window_1.Set ? window_1.Set : SetSham;
  85567. var Component$1 = /* @__PURE__ */ function() {
  85568. function Component2(player, options2, ready) {
  85569. var _this = this;
  85570. if (!player && this.play) {
  85571. this.player_ = player = this;
  85572. } else {
  85573. this.player_ = player;
  85574. }
  85575. this.isDisposed_ = false;
  85576. this.parentComponent_ = null;
  85577. this.options_ = mergeOptions$3({}, this.options_);
  85578. options2 = this.options_ = mergeOptions$3(this.options_, options2);
  85579. this.id_ = options2.id || options2.el && options2.el.id;
  85580. if (!this.id_) {
  85581. var id = player && player.id && player.id() || "no_player";
  85582. this.id_ = id + "_component_" + newGUID();
  85583. }
  85584. this.name_ = options2.name || null;
  85585. if (options2.el) {
  85586. this.el_ = options2.el;
  85587. } else if (options2.createEl !== false) {
  85588. this.el_ = this.createEl();
  85589. }
  85590. if (options2.className && this.el_) {
  85591. options2.className.split(" ").forEach(function(c) {
  85592. return _this.addClass(c);
  85593. });
  85594. }
  85595. if (options2.evented !== false) {
  85596. evented(this, {
  85597. eventBusKey: this.el_ ? "el_" : null
  85598. });
  85599. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  85600. this.on(this.player_, "languagechange", this.handleLanguagechange);
  85601. }
  85602. stateful(this, this.constructor.defaultState);
  85603. this.children_ = [];
  85604. this.childIndex_ = {};
  85605. this.childNameIndex_ = {};
  85606. this.setTimeoutIds_ = new Set$1();
  85607. this.setIntervalIds_ = new Set$1();
  85608. this.rafIds_ = new Set$1();
  85609. this.namedRafs_ = new Map$1();
  85610. this.clearingTimersOnDispose_ = false;
  85611. if (options2.initChildren !== false) {
  85612. this.initChildren();
  85613. }
  85614. this.ready(ready);
  85615. if (options2.reportTouchActivity !== false) {
  85616. this.enableTouchActivity();
  85617. }
  85618. }
  85619. var _proto = Component2.prototype;
  85620. _proto.dispose = function dispose(options2) {
  85621. if (options2 === void 0) {
  85622. options2 = {};
  85623. }
  85624. if (this.isDisposed_) {
  85625. return;
  85626. }
  85627. if (this.readyQueue_) {
  85628. this.readyQueue_.length = 0;
  85629. }
  85630. this.trigger({
  85631. type: "dispose",
  85632. bubbles: false
  85633. });
  85634. this.isDisposed_ = true;
  85635. if (this.children_) {
  85636. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85637. if (this.children_[i2].dispose) {
  85638. this.children_[i2].dispose();
  85639. }
  85640. }
  85641. }
  85642. this.children_ = null;
  85643. this.childIndex_ = null;
  85644. this.childNameIndex_ = null;
  85645. this.parentComponent_ = null;
  85646. if (this.el_) {
  85647. if (this.el_.parentNode) {
  85648. if (options2.restoreEl) {
  85649. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  85650. } else {
  85651. this.el_.parentNode.removeChild(this.el_);
  85652. }
  85653. }
  85654. this.el_ = null;
  85655. }
  85656. this.player_ = null;
  85657. };
  85658. _proto.isDisposed = function isDisposed() {
  85659. return Boolean(this.isDisposed_);
  85660. };
  85661. _proto.player = function player() {
  85662. return this.player_;
  85663. };
  85664. _proto.options = function options2(obj) {
  85665. if (!obj) {
  85666. return this.options_;
  85667. }
  85668. this.options_ = mergeOptions$3(this.options_, obj);
  85669. return this.options_;
  85670. };
  85671. _proto.el = function el() {
  85672. return this.el_;
  85673. };
  85674. _proto.createEl = function createEl$12(tagName, properties, attributes) {
  85675. return createEl(tagName, properties, attributes);
  85676. };
  85677. _proto.localize = function localize(string, tokens, defaultValue2) {
  85678. if (defaultValue2 === void 0) {
  85679. defaultValue2 = string;
  85680. }
  85681. var code = this.player_.language && this.player_.language();
  85682. var languages = this.player_.languages && this.player_.languages();
  85683. var language = languages && languages[code];
  85684. var primaryCode = code && code.split("-")[0];
  85685. var primaryLang = languages && languages[primaryCode];
  85686. var localizedString = defaultValue2;
  85687. if (language && language[string]) {
  85688. localizedString = language[string];
  85689. } else if (primaryLang && primaryLang[string]) {
  85690. localizedString = primaryLang[string];
  85691. }
  85692. if (tokens) {
  85693. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  85694. var value = tokens[index2 - 1];
  85695. var ret = value;
  85696. if (typeof value === "undefined") {
  85697. ret = match;
  85698. }
  85699. return ret;
  85700. });
  85701. }
  85702. return localizedString;
  85703. };
  85704. _proto.handleLanguagechange = function handleLanguagechange() {
  85705. };
  85706. _proto.contentEl = function contentEl() {
  85707. return this.contentEl_ || this.el_;
  85708. };
  85709. _proto.id = function id() {
  85710. return this.id_;
  85711. };
  85712. _proto.name = function name() {
  85713. return this.name_;
  85714. };
  85715. _proto.children = function children() {
  85716. return this.children_;
  85717. };
  85718. _proto.getChildById = function getChildById(id) {
  85719. return this.childIndex_[id];
  85720. };
  85721. _proto.getChild = function getChild(name) {
  85722. if (!name) {
  85723. return;
  85724. }
  85725. return this.childNameIndex_[name];
  85726. };
  85727. _proto.getDescendant = function getDescendant() {
  85728. for (var _len = arguments.length, names2 = new Array(_len), _key = 0; _key < _len; _key++) {
  85729. names2[_key] = arguments[_key];
  85730. }
  85731. names2 = names2.reduce(function(acc, n) {
  85732. return acc.concat(n);
  85733. }, []);
  85734. var currentChild = this;
  85735. for (var i2 = 0; i2 < names2.length; i2++) {
  85736. currentChild = currentChild.getChild(names2[i2]);
  85737. if (!currentChild || !currentChild.getChild) {
  85738. return;
  85739. }
  85740. }
  85741. return currentChild;
  85742. };
  85743. _proto.addChild = function addChild(child, options2, index2) {
  85744. if (options2 === void 0) {
  85745. options2 = {};
  85746. }
  85747. if (index2 === void 0) {
  85748. index2 = this.children_.length;
  85749. }
  85750. var component;
  85751. var componentName;
  85752. if (typeof child === "string") {
  85753. componentName = toTitleCase$1(child);
  85754. var componentClassName = options2.componentClass || componentName;
  85755. options2.name = componentName;
  85756. var ComponentClass = Component2.getComponent(componentClassName);
  85757. if (!ComponentClass) {
  85758. throw new Error("Component " + componentClassName + " does not exist");
  85759. }
  85760. if (typeof ComponentClass !== "function") {
  85761. return null;
  85762. }
  85763. component = new ComponentClass(this.player_ || this, options2);
  85764. } else {
  85765. component = child;
  85766. }
  85767. if (component.parentComponent_) {
  85768. component.parentComponent_.removeChild(component);
  85769. }
  85770. this.children_.splice(index2, 0, component);
  85771. component.parentComponent_ = this;
  85772. if (typeof component.id === "function") {
  85773. this.childIndex_[component.id()] = component;
  85774. }
  85775. componentName = componentName || component.name && toTitleCase$1(component.name());
  85776. if (componentName) {
  85777. this.childNameIndex_[componentName] = component;
  85778. this.childNameIndex_[toLowerCase(componentName)] = component;
  85779. }
  85780. if (typeof component.el === "function" && component.el()) {
  85781. var refNode = null;
  85782. if (this.children_[index2 + 1]) {
  85783. if (this.children_[index2 + 1].el_) {
  85784. refNode = this.children_[index2 + 1].el_;
  85785. } else if (isEl(this.children_[index2 + 1])) {
  85786. refNode = this.children_[index2 + 1];
  85787. }
  85788. }
  85789. this.contentEl().insertBefore(component.el(), refNode);
  85790. }
  85791. return component;
  85792. };
  85793. _proto.removeChild = function removeChild(component) {
  85794. if (typeof component === "string") {
  85795. component = this.getChild(component);
  85796. }
  85797. if (!component || !this.children_) {
  85798. return;
  85799. }
  85800. var childFound = false;
  85801. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85802. if (this.children_[i2] === component) {
  85803. childFound = true;
  85804. this.children_.splice(i2, 1);
  85805. break;
  85806. }
  85807. }
  85808. if (!childFound) {
  85809. return;
  85810. }
  85811. component.parentComponent_ = null;
  85812. this.childIndex_[component.id()] = null;
  85813. this.childNameIndex_[toTitleCase$1(component.name())] = null;
  85814. this.childNameIndex_[toLowerCase(component.name())] = null;
  85815. var compEl = component.el();
  85816. if (compEl && compEl.parentNode === this.contentEl()) {
  85817. this.contentEl().removeChild(component.el());
  85818. }
  85819. };
  85820. _proto.initChildren = function initChildren() {
  85821. var _this2 = this;
  85822. var children = this.options_.children;
  85823. if (children) {
  85824. var parentOptions = this.options_;
  85825. var handleAdd = function handleAdd2(child) {
  85826. var name = child.name;
  85827. var opts = child.opts;
  85828. if (parentOptions[name] !== void 0) {
  85829. opts = parentOptions[name];
  85830. }
  85831. if (opts === false) {
  85832. return;
  85833. }
  85834. if (opts === true) {
  85835. opts = {};
  85836. }
  85837. opts.playerOptions = _this2.options_.playerOptions;
  85838. var newChild = _this2.addChild(name, opts);
  85839. if (newChild) {
  85840. _this2[name] = newChild;
  85841. }
  85842. };
  85843. var workingChildren;
  85844. var Tech2 = Component2.getComponent("Tech");
  85845. if (Array.isArray(children)) {
  85846. workingChildren = children;
  85847. } else {
  85848. workingChildren = Object.keys(children);
  85849. }
  85850. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  85851. return !workingChildren.some(function(wchild) {
  85852. if (typeof wchild === "string") {
  85853. return child === wchild;
  85854. }
  85855. return child === wchild.name;
  85856. });
  85857. })).map(function(child) {
  85858. var name;
  85859. var opts;
  85860. if (typeof child === "string") {
  85861. name = child;
  85862. opts = children[name] || _this2.options_[name] || {};
  85863. } else {
  85864. name = child.name;
  85865. opts = child;
  85866. }
  85867. return {
  85868. name,
  85869. opts
  85870. };
  85871. }).filter(function(child) {
  85872. var c = Component2.getComponent(child.opts.componentClass || toTitleCase$1(child.name));
  85873. return c && !Tech2.isTech(c);
  85874. }).forEach(handleAdd);
  85875. }
  85876. };
  85877. _proto.buildCSSClass = function buildCSSClass() {
  85878. return "";
  85879. };
  85880. _proto.ready = function ready(fn2, sync) {
  85881. if (sync === void 0) {
  85882. sync = false;
  85883. }
  85884. if (!fn2) {
  85885. return;
  85886. }
  85887. if (!this.isReady_) {
  85888. this.readyQueue_ = this.readyQueue_ || [];
  85889. this.readyQueue_.push(fn2);
  85890. return;
  85891. }
  85892. if (sync) {
  85893. fn2.call(this);
  85894. } else {
  85895. this.setTimeout(fn2, 1);
  85896. }
  85897. };
  85898. _proto.triggerReady = function triggerReady() {
  85899. this.isReady_ = true;
  85900. this.setTimeout(function() {
  85901. var readyQueue = this.readyQueue_;
  85902. this.readyQueue_ = [];
  85903. if (readyQueue && readyQueue.length > 0) {
  85904. readyQueue.forEach(function(fn2) {
  85905. fn2.call(this);
  85906. }, this);
  85907. }
  85908. this.trigger("ready");
  85909. }, 1);
  85910. };
  85911. _proto.$ = function $$12(selector, context) {
  85912. return $(selector, context || this.contentEl());
  85913. };
  85914. _proto.$$ = function $$$12(selector, context) {
  85915. return $$(selector, context || this.contentEl());
  85916. };
  85917. _proto.hasClass = function hasClass$12(classToCheck) {
  85918. return hasClass(this.el_, classToCheck);
  85919. };
  85920. _proto.addClass = function addClass$12(classToAdd) {
  85921. addClass(this.el_, classToAdd);
  85922. };
  85923. _proto.removeClass = function removeClass$12(classToRemove) {
  85924. removeClass(this.el_, classToRemove);
  85925. };
  85926. _proto.toggleClass = function toggleClass$12(classToToggle, predicate) {
  85927. toggleClass(this.el_, classToToggle, predicate);
  85928. };
  85929. _proto.show = function show() {
  85930. this.removeClass("vjs-hidden");
  85931. };
  85932. _proto.hide = function hide() {
  85933. this.addClass("vjs-hidden");
  85934. };
  85935. _proto.lockShowing = function lockShowing() {
  85936. this.addClass("vjs-lock-showing");
  85937. };
  85938. _proto.unlockShowing = function unlockShowing() {
  85939. this.removeClass("vjs-lock-showing");
  85940. };
  85941. _proto.getAttribute = function getAttribute$12(attribute) {
  85942. return getAttribute(this.el_, attribute);
  85943. };
  85944. _proto.setAttribute = function setAttribute$12(attribute, value) {
  85945. setAttribute(this.el_, attribute, value);
  85946. };
  85947. _proto.removeAttribute = function removeAttribute$12(attribute) {
  85948. removeAttribute(this.el_, attribute);
  85949. };
  85950. _proto.width = function width2(num, skipListeners) {
  85951. return this.dimension("width", num, skipListeners);
  85952. };
  85953. _proto.height = function height2(num, skipListeners) {
  85954. return this.dimension("height", num, skipListeners);
  85955. };
  85956. _proto.dimensions = function dimensions(width2, height2) {
  85957. this.width(width2, true);
  85958. this.height(height2);
  85959. };
  85960. _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {
  85961. if (num !== void 0) {
  85962. if (num === null || num !== num) {
  85963. num = 0;
  85964. }
  85965. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  85966. this.el_.style[widthOrHeight] = num;
  85967. } else if (num === "auto") {
  85968. this.el_.style[widthOrHeight] = "";
  85969. } else {
  85970. this.el_.style[widthOrHeight] = num + "px";
  85971. }
  85972. if (!skipListeners) {
  85973. this.trigger("componentresize");
  85974. }
  85975. return;
  85976. }
  85977. if (!this.el_) {
  85978. return 0;
  85979. }
  85980. var val = this.el_.style[widthOrHeight];
  85981. var pxIndex = val.indexOf("px");
  85982. if (pxIndex !== -1) {
  85983. return parseInt(val.slice(0, pxIndex), 10);
  85984. }
  85985. return parseInt(this.el_["offset" + toTitleCase$1(widthOrHeight)], 10);
  85986. };
  85987. _proto.currentDimension = function currentDimension(widthOrHeight) {
  85988. var computedWidthOrHeight = 0;
  85989. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  85990. throw new Error("currentDimension only accepts width or height value");
  85991. }
  85992. computedWidthOrHeight = computedStyle(this.el_, widthOrHeight);
  85993. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  85994. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  85995. var rule = "offset" + toTitleCase$1(widthOrHeight);
  85996. computedWidthOrHeight = this.el_[rule];
  85997. }
  85998. return computedWidthOrHeight;
  85999. };
  86000. _proto.currentDimensions = function currentDimensions() {
  86001. return {
  86002. width: this.currentDimension("width"),
  86003. height: this.currentDimension("height")
  86004. };
  86005. };
  86006. _proto.currentWidth = function currentWidth() {
  86007. return this.currentDimension("width");
  86008. };
  86009. _proto.currentHeight = function currentHeight() {
  86010. return this.currentDimension("height");
  86011. };
  86012. _proto.focus = function focus() {
  86013. this.el_.focus();
  86014. };
  86015. _proto.blur = function blur() {
  86016. this.el_.blur();
  86017. };
  86018. _proto.handleKeyDown = function handleKeyDown(event2) {
  86019. if (this.player_) {
  86020. if (!keycode.isEventKey(event2, "Tab")) {
  86021. event2.stopPropagation();
  86022. }
  86023. this.player_.handleKeyDown(event2);
  86024. }
  86025. };
  86026. _proto.handleKeyPress = function handleKeyPress(event2) {
  86027. this.handleKeyDown(event2);
  86028. };
  86029. _proto.emitTapEvents = function emitTapEvents() {
  86030. var touchStart = 0;
  86031. var firstTouch = null;
  86032. var tapMovementThreshold = 10;
  86033. var touchTimeThreshold = 200;
  86034. var couldBeTap;
  86035. this.on("touchstart", function(event2) {
  86036. if (event2.touches.length === 1) {
  86037. firstTouch = {
  86038. pageX: event2.touches[0].pageX,
  86039. pageY: event2.touches[0].pageY
  86040. };
  86041. touchStart = window_1.performance.now();
  86042. couldBeTap = true;
  86043. }
  86044. });
  86045. this.on("touchmove", function(event2) {
  86046. if (event2.touches.length > 1) {
  86047. couldBeTap = false;
  86048. } else if (firstTouch) {
  86049. var xdiff = event2.touches[0].pageX - firstTouch.pageX;
  86050. var ydiff = event2.touches[0].pageY - firstTouch.pageY;
  86051. var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  86052. if (touchDistance > tapMovementThreshold) {
  86053. couldBeTap = false;
  86054. }
  86055. }
  86056. });
  86057. var noTap = function noTap2() {
  86058. couldBeTap = false;
  86059. };
  86060. this.on("touchleave", noTap);
  86061. this.on("touchcancel", noTap);
  86062. this.on("touchend", function(event2) {
  86063. firstTouch = null;
  86064. if (couldBeTap === true) {
  86065. var touchTime = window_1.performance.now() - touchStart;
  86066. if (touchTime < touchTimeThreshold) {
  86067. event2.preventDefault();
  86068. this.trigger("tap");
  86069. }
  86070. }
  86071. });
  86072. };
  86073. _proto.enableTouchActivity = function enableTouchActivity() {
  86074. if (!this.player() || !this.player().reportUserActivity) {
  86075. return;
  86076. }
  86077. var report = bind(this.player(), this.player().reportUserActivity);
  86078. var touchHolding;
  86079. this.on("touchstart", function() {
  86080. report();
  86081. this.clearInterval(touchHolding);
  86082. touchHolding = this.setInterval(report, 250);
  86083. });
  86084. var touchEnd = function touchEnd2(event2) {
  86085. report();
  86086. this.clearInterval(touchHolding);
  86087. };
  86088. this.on("touchmove", report);
  86089. this.on("touchend", touchEnd);
  86090. this.on("touchcancel", touchEnd);
  86091. };
  86092. _proto.setTimeout = function setTimeout2(fn2, timeout) {
  86093. var _this3 = this;
  86094. var timeoutId;
  86095. fn2 = bind(this, fn2);
  86096. this.clearTimersOnDispose_();
  86097. timeoutId = window_1.setTimeout(function() {
  86098. if (_this3.setTimeoutIds_.has(timeoutId)) {
  86099. _this3.setTimeoutIds_["delete"](timeoutId);
  86100. }
  86101. fn2();
  86102. }, timeout);
  86103. this.setTimeoutIds_.add(timeoutId);
  86104. return timeoutId;
  86105. };
  86106. _proto.clearTimeout = function clearTimeout2(timeoutId) {
  86107. if (this.setTimeoutIds_.has(timeoutId)) {
  86108. this.setTimeoutIds_["delete"](timeoutId);
  86109. window_1.clearTimeout(timeoutId);
  86110. }
  86111. return timeoutId;
  86112. };
  86113. _proto.setInterval = function setInterval2(fn2, interval) {
  86114. fn2 = bind(this, fn2);
  86115. this.clearTimersOnDispose_();
  86116. var intervalId = window_1.setInterval(fn2, interval);
  86117. this.setIntervalIds_.add(intervalId);
  86118. return intervalId;
  86119. };
  86120. _proto.clearInterval = function clearInterval2(intervalId) {
  86121. if (this.setIntervalIds_.has(intervalId)) {
  86122. this.setIntervalIds_["delete"](intervalId);
  86123. window_1.clearInterval(intervalId);
  86124. }
  86125. return intervalId;
  86126. };
  86127. _proto.requestAnimationFrame = function requestAnimationFrame(fn2) {
  86128. var _this4 = this;
  86129. if (!this.supportsRaf_) {
  86130. return this.setTimeout(fn2, 1e3 / 60);
  86131. }
  86132. this.clearTimersOnDispose_();
  86133. var id;
  86134. fn2 = bind(this, fn2);
  86135. id = window_1.requestAnimationFrame(function() {
  86136. if (_this4.rafIds_.has(id)) {
  86137. _this4.rafIds_["delete"](id);
  86138. }
  86139. fn2();
  86140. });
  86141. this.rafIds_.add(id);
  86142. return id;
  86143. };
  86144. _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn2) {
  86145. var _this5 = this;
  86146. if (this.namedRafs_.has(name)) {
  86147. return;
  86148. }
  86149. this.clearTimersOnDispose_();
  86150. fn2 = bind(this, fn2);
  86151. var id = this.requestAnimationFrame(function() {
  86152. fn2();
  86153. if (_this5.namedRafs_.has(name)) {
  86154. _this5.namedRafs_["delete"](name);
  86155. }
  86156. });
  86157. this.namedRafs_.set(name, id);
  86158. return name;
  86159. };
  86160. _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) {
  86161. if (!this.namedRafs_.has(name)) {
  86162. return;
  86163. }
  86164. this.cancelAnimationFrame(this.namedRafs_.get(name));
  86165. this.namedRafs_["delete"](name);
  86166. };
  86167. _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {
  86168. if (!this.supportsRaf_) {
  86169. return this.clearTimeout(id);
  86170. }
  86171. if (this.rafIds_.has(id)) {
  86172. this.rafIds_["delete"](id);
  86173. window_1.cancelAnimationFrame(id);
  86174. }
  86175. return id;
  86176. };
  86177. _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {
  86178. var _this6 = this;
  86179. if (this.clearingTimersOnDispose_) {
  86180. return;
  86181. }
  86182. this.clearingTimersOnDispose_ = true;
  86183. this.one("dispose", function() {
  86184. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function(_ref) {
  86185. var idName = _ref[0], cancelName = _ref[1];
  86186. _this6[idName].forEach(function(val, key) {
  86187. return _this6[cancelName](key);
  86188. });
  86189. });
  86190. _this6.clearingTimersOnDispose_ = false;
  86191. });
  86192. };
  86193. Component2.registerComponent = function registerComponent(name, ComponentToRegister) {
  86194. if (typeof name !== "string" || !name) {
  86195. throw new Error('Illegal component name, "' + name + '"; must be a non-empty string.');
  86196. }
  86197. var Tech2 = Component2.getComponent("Tech");
  86198. var isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  86199. var isComp = Component2 === ComponentToRegister || Component2.prototype.isPrototypeOf(ComponentToRegister.prototype);
  86200. if (isTech || !isComp) {
  86201. var reason;
  86202. if (isTech) {
  86203. reason = "techs must be registered using Tech.registerTech()";
  86204. } else {
  86205. reason = "must be a Component subclass";
  86206. }
  86207. throw new Error('Illegal component, "' + name + '"; ' + reason + ".");
  86208. }
  86209. name = toTitleCase$1(name);
  86210. if (!Component2.components_) {
  86211. Component2.components_ = {};
  86212. }
  86213. var Player2 = Component2.getComponent("Player");
  86214. if (name === "Player" && Player2 && Player2.players) {
  86215. var players = Player2.players;
  86216. var playerNames = Object.keys(players);
  86217. if (players && playerNames.length > 0 && playerNames.map(function(pname) {
  86218. return players[pname];
  86219. }).every(Boolean)) {
  86220. throw new Error("Can not register Player component after player has been created.");
  86221. }
  86222. }
  86223. Component2.components_[name] = ComponentToRegister;
  86224. Component2.components_[toLowerCase(name)] = ComponentToRegister;
  86225. return ComponentToRegister;
  86226. };
  86227. Component2.getComponent = function getComponent(name) {
  86228. if (!name || !Component2.components_) {
  86229. return;
  86230. }
  86231. return Component2.components_[name];
  86232. };
  86233. return Component2;
  86234. }();
  86235. Component$1.prototype.supportsRaf_ = typeof window_1.requestAnimationFrame === "function" && typeof window_1.cancelAnimationFrame === "function";
  86236. Component$1.registerComponent("Component", Component$1);
  86237. function rangeCheck(fnName, index2, maxIndex) {
  86238. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  86239. throw new Error("Failed to execute '" + fnName + "' on 'TimeRanges': The index provided (" + index2 + ") is non-numeric or out of bounds (0-" + maxIndex + ").");
  86240. }
  86241. }
  86242. function getRange(fnName, valueIndex, ranges, rangeIndex) {
  86243. rangeCheck(fnName, rangeIndex, ranges.length - 1);
  86244. return ranges[rangeIndex][valueIndex];
  86245. }
  86246. function createTimeRangesObj(ranges) {
  86247. var timeRangesObj;
  86248. if (ranges === void 0 || ranges.length === 0) {
  86249. timeRangesObj = {
  86250. length: 0,
  86251. start: function start2() {
  86252. throw new Error("This TimeRanges object is empty");
  86253. },
  86254. end: function end() {
  86255. throw new Error("This TimeRanges object is empty");
  86256. }
  86257. };
  86258. } else {
  86259. timeRangesObj = {
  86260. length: ranges.length,
  86261. start: getRange.bind(null, "start", 0, ranges),
  86262. end: getRange.bind(null, "end", 1, ranges)
  86263. };
  86264. }
  86265. if (window_1.Symbol && window_1.Symbol.iterator) {
  86266. timeRangesObj[window_1.Symbol.iterator] = function() {
  86267. return (ranges || []).values();
  86268. };
  86269. }
  86270. return timeRangesObj;
  86271. }
  86272. function createTimeRanges(start2, end) {
  86273. if (Array.isArray(start2)) {
  86274. return createTimeRangesObj(start2);
  86275. } else if (start2 === void 0 || end === void 0) {
  86276. return createTimeRangesObj();
  86277. }
  86278. return createTimeRangesObj([[start2, end]]);
  86279. }
  86280. function bufferedPercent(buffered, duration5) {
  86281. var bufferedDuration = 0;
  86282. var start2;
  86283. var end;
  86284. if (!duration5) {
  86285. return 0;
  86286. }
  86287. if (!buffered || !buffered.length) {
  86288. buffered = createTimeRanges(0, 0);
  86289. }
  86290. for (var i2 = 0; i2 < buffered.length; i2++) {
  86291. start2 = buffered.start(i2);
  86292. end = buffered.end(i2);
  86293. if (end > duration5) {
  86294. end = duration5;
  86295. }
  86296. bufferedDuration += end - start2;
  86297. }
  86298. return bufferedDuration / duration5;
  86299. }
  86300. function MediaError(value) {
  86301. if (value instanceof MediaError) {
  86302. return value;
  86303. }
  86304. if (typeof value === "number") {
  86305. this.code = value;
  86306. } else if (typeof value === "string") {
  86307. this.message = value;
  86308. } else if (isObject2(value)) {
  86309. if (typeof value.code === "number") {
  86310. this.code = value.code;
  86311. }
  86312. assign(this, value);
  86313. }
  86314. if (!this.message) {
  86315. this.message = MediaError.defaultMessages[this.code] || "";
  86316. }
  86317. }
  86318. MediaError.prototype.code = 0;
  86319. MediaError.prototype.message = "";
  86320. MediaError.prototype.status = null;
  86321. MediaError.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  86322. MediaError.defaultMessages = {
  86323. 1: "You aborted the media playback",
  86324. 2: "A network error caused the media download to fail part-way.",
  86325. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  86326. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  86327. 5: "The media is encrypted and we do not have the keys to decrypt it."
  86328. };
  86329. for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {
  86330. MediaError[MediaError.errorTypes[errNum]] = errNum;
  86331. MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;
  86332. }
  86333. function isPromise(value) {
  86334. return value !== void 0 && value !== null && typeof value.then === "function";
  86335. }
  86336. function silencePromise(value) {
  86337. if (isPromise(value)) {
  86338. value.then(null, function(e) {
  86339. });
  86340. }
  86341. }
  86342. var trackToJson_ = function trackToJson_2(track) {
  86343. var ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(acc, prop, i2) {
  86344. if (track[prop]) {
  86345. acc[prop] = track[prop];
  86346. }
  86347. return acc;
  86348. }, {
  86349. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  86350. return {
  86351. startTime: cue.startTime,
  86352. endTime: cue.endTime,
  86353. text: cue.text,
  86354. id: cue.id
  86355. };
  86356. })
  86357. });
  86358. return ret;
  86359. };
  86360. var textTracksToJson = function textTracksToJson2(tech) {
  86361. var trackEls = tech.$$("track");
  86362. var trackObjs = Array.prototype.map.call(trackEls, function(t2) {
  86363. return t2.track;
  86364. });
  86365. var tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  86366. var json = trackToJson_(trackEl.track);
  86367. if (trackEl.src) {
  86368. json.src = trackEl.src;
  86369. }
  86370. return json;
  86371. });
  86372. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  86373. return trackObjs.indexOf(track) === -1;
  86374. }).map(trackToJson_));
  86375. };
  86376. var jsonToTextTracks = function jsonToTextTracks2(json, tech) {
  86377. json.forEach(function(track) {
  86378. var addedTrack = tech.addRemoteTextTrack(track).track;
  86379. if (!track.src && track.cues) {
  86380. track.cues.forEach(function(cue) {
  86381. return addedTrack.addCue(cue);
  86382. });
  86383. }
  86384. });
  86385. return tech.textTracks();
  86386. };
  86387. var textTrackConverter = {
  86388. textTracksToJson,
  86389. jsonToTextTracks,
  86390. trackToJson_
  86391. };
  86392. var MODAL_CLASS_NAME = "vjs-modal-dialog";
  86393. var ModalDialog = /* @__PURE__ */ function(_Component) {
  86394. _inheritsLoose(ModalDialog2, _Component);
  86395. function ModalDialog2(player, options2) {
  86396. var _this;
  86397. _this = _Component.call(this, player, options2) || this;
  86398. _this.handleKeyDown_ = function(e) {
  86399. return _this.handleKeyDown(e);
  86400. };
  86401. _this.close_ = function(e) {
  86402. return _this.close(e);
  86403. };
  86404. _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;
  86405. _this.closeable(!_this.options_.uncloseable);
  86406. _this.content(_this.options_.content);
  86407. _this.contentEl_ = createEl("div", {
  86408. className: MODAL_CLASS_NAME + "-content"
  86409. }, {
  86410. role: "document"
  86411. });
  86412. _this.descEl_ = createEl("p", {
  86413. className: MODAL_CLASS_NAME + "-description vjs-control-text",
  86414. id: _this.el().getAttribute("aria-describedby")
  86415. });
  86416. textContent(_this.descEl_, _this.description());
  86417. _this.el_.appendChild(_this.descEl_);
  86418. _this.el_.appendChild(_this.contentEl_);
  86419. return _this;
  86420. }
  86421. var _proto = ModalDialog2.prototype;
  86422. _proto.createEl = function createEl2() {
  86423. return _Component.prototype.createEl.call(this, "div", {
  86424. className: this.buildCSSClass(),
  86425. tabIndex: -1
  86426. }, {
  86427. "aria-describedby": this.id() + "_description",
  86428. "aria-hidden": "true",
  86429. "aria-label": this.label(),
  86430. "role": "dialog"
  86431. });
  86432. };
  86433. _proto.dispose = function dispose() {
  86434. this.contentEl_ = null;
  86435. this.descEl_ = null;
  86436. this.previouslyActiveEl_ = null;
  86437. _Component.prototype.dispose.call(this);
  86438. };
  86439. _proto.buildCSSClass = function buildCSSClass() {
  86440. return MODAL_CLASS_NAME + " vjs-hidden " + _Component.prototype.buildCSSClass.call(this);
  86441. };
  86442. _proto.label = function label() {
  86443. return this.localize(this.options_.label || "Modal Window");
  86444. };
  86445. _proto.description = function description() {
  86446. var desc = this.options_.description || this.localize("This is a modal window.");
  86447. if (this.closeable()) {
  86448. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  86449. }
  86450. return desc;
  86451. };
  86452. _proto.open = function open() {
  86453. if (!this.opened_) {
  86454. var player = this.player();
  86455. this.trigger("beforemodalopen");
  86456. this.opened_ = true;
  86457. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  86458. this.fill();
  86459. }
  86460. this.wasPlaying_ = !player.paused();
  86461. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  86462. player.pause();
  86463. }
  86464. this.on("keydown", this.handleKeyDown_);
  86465. this.hadControls_ = player.controls();
  86466. player.controls(false);
  86467. this.show();
  86468. this.conditionalFocus_();
  86469. this.el().setAttribute("aria-hidden", "false");
  86470. this.trigger("modalopen");
  86471. this.hasBeenOpened_ = true;
  86472. }
  86473. };
  86474. _proto.opened = function opened(value) {
  86475. if (typeof value === "boolean") {
  86476. this[value ? "open" : "close"]();
  86477. }
  86478. return this.opened_;
  86479. };
  86480. _proto.close = function close() {
  86481. if (!this.opened_) {
  86482. return;
  86483. }
  86484. var player = this.player();
  86485. this.trigger("beforemodalclose");
  86486. this.opened_ = false;
  86487. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  86488. player.play();
  86489. }
  86490. this.off("keydown", this.handleKeyDown_);
  86491. if (this.hadControls_) {
  86492. player.controls(true);
  86493. }
  86494. this.hide();
  86495. this.el().setAttribute("aria-hidden", "true");
  86496. this.trigger("modalclose");
  86497. this.conditionalBlur_();
  86498. if (this.options_.temporary) {
  86499. this.dispose();
  86500. }
  86501. };
  86502. _proto.closeable = function closeable(value) {
  86503. if (typeof value === "boolean") {
  86504. var closeable2 = this.closeable_ = !!value;
  86505. var close = this.getChild("closeButton");
  86506. if (closeable2 && !close) {
  86507. var temp = this.contentEl_;
  86508. this.contentEl_ = this.el_;
  86509. close = this.addChild("closeButton", {
  86510. controlText: "Close Modal Dialog"
  86511. });
  86512. this.contentEl_ = temp;
  86513. this.on(close, "close", this.close_);
  86514. }
  86515. if (!closeable2 && close) {
  86516. this.off(close, "close", this.close_);
  86517. this.removeChild(close);
  86518. close.dispose();
  86519. }
  86520. }
  86521. return this.closeable_;
  86522. };
  86523. _proto.fill = function fill() {
  86524. this.fillWith(this.content());
  86525. };
  86526. _proto.fillWith = function fillWith(content) {
  86527. var contentEl = this.contentEl();
  86528. var parentEl = contentEl.parentNode;
  86529. var nextSiblingEl = contentEl.nextSibling;
  86530. this.trigger("beforemodalfill");
  86531. this.hasBeenFilled_ = true;
  86532. parentEl.removeChild(contentEl);
  86533. this.empty();
  86534. insertContent(contentEl, content);
  86535. this.trigger("modalfill");
  86536. if (nextSiblingEl) {
  86537. parentEl.insertBefore(contentEl, nextSiblingEl);
  86538. } else {
  86539. parentEl.appendChild(contentEl);
  86540. }
  86541. var closeButton = this.getChild("closeButton");
  86542. if (closeButton) {
  86543. parentEl.appendChild(closeButton.el_);
  86544. }
  86545. };
  86546. _proto.empty = function empty() {
  86547. this.trigger("beforemodalempty");
  86548. emptyEl(this.contentEl());
  86549. this.trigger("modalempty");
  86550. };
  86551. _proto.content = function content(value) {
  86552. if (typeof value !== "undefined") {
  86553. this.content_ = value;
  86554. }
  86555. return this.content_;
  86556. };
  86557. _proto.conditionalFocus_ = function conditionalFocus_() {
  86558. var activeEl = document_1.activeElement;
  86559. var playerEl = this.player_.el_;
  86560. this.previouslyActiveEl_ = null;
  86561. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  86562. this.previouslyActiveEl_ = activeEl;
  86563. this.focus();
  86564. }
  86565. };
  86566. _proto.conditionalBlur_ = function conditionalBlur_() {
  86567. if (this.previouslyActiveEl_) {
  86568. this.previouslyActiveEl_.focus();
  86569. this.previouslyActiveEl_ = null;
  86570. }
  86571. };
  86572. _proto.handleKeyDown = function handleKeyDown(event2) {
  86573. event2.stopPropagation();
  86574. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  86575. event2.preventDefault();
  86576. this.close();
  86577. return;
  86578. }
  86579. if (!keycode.isEventKey(event2, "Tab")) {
  86580. return;
  86581. }
  86582. var focusableEls = this.focusableEls_();
  86583. var activeEl = this.el_.querySelector(":focus");
  86584. var focusIndex;
  86585. for (var i2 = 0; i2 < focusableEls.length; i2++) {
  86586. if (activeEl === focusableEls[i2]) {
  86587. focusIndex = i2;
  86588. break;
  86589. }
  86590. }
  86591. if (document_1.activeElement === this.el_) {
  86592. focusIndex = 0;
  86593. }
  86594. if (event2.shiftKey && focusIndex === 0) {
  86595. focusableEls[focusableEls.length - 1].focus();
  86596. event2.preventDefault();
  86597. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  86598. focusableEls[0].focus();
  86599. event2.preventDefault();
  86600. }
  86601. };
  86602. _proto.focusableEls_ = function focusableEls_() {
  86603. var allChildren = this.el_.querySelectorAll("*");
  86604. return Array.prototype.filter.call(allChildren, function(child) {
  86605. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  86606. });
  86607. };
  86608. return ModalDialog2;
  86609. }(Component$1);
  86610. ModalDialog.prototype.options_ = {
  86611. pauseOnOpen: true,
  86612. temporary: true
  86613. };
  86614. Component$1.registerComponent("ModalDialog", ModalDialog);
  86615. var TrackList = /* @__PURE__ */ function(_EventTarget) {
  86616. _inheritsLoose(TrackList2, _EventTarget);
  86617. function TrackList2(tracks) {
  86618. var _this;
  86619. if (tracks === void 0) {
  86620. tracks = [];
  86621. }
  86622. _this = _EventTarget.call(this) || this;
  86623. _this.tracks_ = [];
  86624. Object.defineProperty(_assertThisInitialized(_this), "length", {
  86625. get: function get7() {
  86626. return this.tracks_.length;
  86627. }
  86628. });
  86629. for (var i2 = 0; i2 < tracks.length; i2++) {
  86630. _this.addTrack(tracks[i2]);
  86631. }
  86632. return _this;
  86633. }
  86634. var _proto = TrackList2.prototype;
  86635. _proto.addTrack = function addTrack(track) {
  86636. var _this2 = this;
  86637. var index2 = this.tracks_.length;
  86638. if (!("" + index2 in this)) {
  86639. Object.defineProperty(this, index2, {
  86640. get: function get7() {
  86641. return this.tracks_[index2];
  86642. }
  86643. });
  86644. }
  86645. if (this.tracks_.indexOf(track) === -1) {
  86646. this.tracks_.push(track);
  86647. this.trigger({
  86648. track,
  86649. type: "addtrack",
  86650. target: this
  86651. });
  86652. }
  86653. track.labelchange_ = function() {
  86654. _this2.trigger({
  86655. track,
  86656. type: "labelchange",
  86657. target: _this2
  86658. });
  86659. };
  86660. if (isEvented(track)) {
  86661. track.addEventListener("labelchange", track.labelchange_);
  86662. }
  86663. };
  86664. _proto.removeTrack = function removeTrack(rtrack) {
  86665. var track;
  86666. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86667. if (this[i2] === rtrack) {
  86668. track = this[i2];
  86669. if (track.off) {
  86670. track.off();
  86671. }
  86672. this.tracks_.splice(i2, 1);
  86673. break;
  86674. }
  86675. }
  86676. if (!track) {
  86677. return;
  86678. }
  86679. this.trigger({
  86680. track,
  86681. type: "removetrack",
  86682. target: this
  86683. });
  86684. };
  86685. _proto.getTrackById = function getTrackById(id) {
  86686. var result = null;
  86687. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86688. var track = this[i2];
  86689. if (track.id === id) {
  86690. result = track;
  86691. break;
  86692. }
  86693. }
  86694. return result;
  86695. };
  86696. return TrackList2;
  86697. }(EventTarget$2);
  86698. TrackList.prototype.allowedEvents_ = {
  86699. change: "change",
  86700. addtrack: "addtrack",
  86701. removetrack: "removetrack",
  86702. labelchange: "labelchange"
  86703. };
  86704. for (var event$1 in TrackList.prototype.allowedEvents_) {
  86705. TrackList.prototype["on" + event$1] = null;
  86706. }
  86707. var disableOthers$1 = function disableOthers(list, track) {
  86708. for (var i2 = 0; i2 < list.length; i2++) {
  86709. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86710. continue;
  86711. }
  86712. list[i2].enabled = false;
  86713. }
  86714. };
  86715. var AudioTrackList = /* @__PURE__ */ function(_TrackList) {
  86716. _inheritsLoose(AudioTrackList2, _TrackList);
  86717. function AudioTrackList2(tracks) {
  86718. var _this;
  86719. if (tracks === void 0) {
  86720. tracks = [];
  86721. }
  86722. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86723. if (tracks[i2].enabled) {
  86724. disableOthers$1(tracks, tracks[i2]);
  86725. break;
  86726. }
  86727. }
  86728. _this = _TrackList.call(this, tracks) || this;
  86729. _this.changing_ = false;
  86730. return _this;
  86731. }
  86732. var _proto = AudioTrackList2.prototype;
  86733. _proto.addTrack = function addTrack(track) {
  86734. var _this2 = this;
  86735. if (track.enabled) {
  86736. disableOthers$1(this, track);
  86737. }
  86738. _TrackList.prototype.addTrack.call(this, track);
  86739. if (!track.addEventListener) {
  86740. return;
  86741. }
  86742. track.enabledChange_ = function() {
  86743. if (_this2.changing_) {
  86744. return;
  86745. }
  86746. _this2.changing_ = true;
  86747. disableOthers$1(_this2, track);
  86748. _this2.changing_ = false;
  86749. _this2.trigger("change");
  86750. };
  86751. track.addEventListener("enabledchange", track.enabledChange_);
  86752. };
  86753. _proto.removeTrack = function removeTrack(rtrack) {
  86754. _TrackList.prototype.removeTrack.call(this, rtrack);
  86755. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  86756. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  86757. rtrack.enabledChange_ = null;
  86758. }
  86759. };
  86760. return AudioTrackList2;
  86761. }(TrackList);
  86762. var disableOthers2 = function disableOthers3(list, track) {
  86763. for (var i2 = 0; i2 < list.length; i2++) {
  86764. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86765. continue;
  86766. }
  86767. list[i2].selected = false;
  86768. }
  86769. };
  86770. var VideoTrackList = /* @__PURE__ */ function(_TrackList) {
  86771. _inheritsLoose(VideoTrackList2, _TrackList);
  86772. function VideoTrackList2(tracks) {
  86773. var _this;
  86774. if (tracks === void 0) {
  86775. tracks = [];
  86776. }
  86777. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86778. if (tracks[i2].selected) {
  86779. disableOthers2(tracks, tracks[i2]);
  86780. break;
  86781. }
  86782. }
  86783. _this = _TrackList.call(this, tracks) || this;
  86784. _this.changing_ = false;
  86785. Object.defineProperty(_assertThisInitialized(_this), "selectedIndex", {
  86786. get: function get7() {
  86787. for (var _i = 0; _i < this.length; _i++) {
  86788. if (this[_i].selected) {
  86789. return _i;
  86790. }
  86791. }
  86792. return -1;
  86793. },
  86794. set: function set4() {
  86795. }
  86796. });
  86797. return _this;
  86798. }
  86799. var _proto = VideoTrackList2.prototype;
  86800. _proto.addTrack = function addTrack(track) {
  86801. var _this2 = this;
  86802. if (track.selected) {
  86803. disableOthers2(this, track);
  86804. }
  86805. _TrackList.prototype.addTrack.call(this, track);
  86806. if (!track.addEventListener) {
  86807. return;
  86808. }
  86809. track.selectedChange_ = function() {
  86810. if (_this2.changing_) {
  86811. return;
  86812. }
  86813. _this2.changing_ = true;
  86814. disableOthers2(_this2, track);
  86815. _this2.changing_ = false;
  86816. _this2.trigger("change");
  86817. };
  86818. track.addEventListener("selectedchange", track.selectedChange_);
  86819. };
  86820. _proto.removeTrack = function removeTrack(rtrack) {
  86821. _TrackList.prototype.removeTrack.call(this, rtrack);
  86822. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  86823. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  86824. rtrack.selectedChange_ = null;
  86825. }
  86826. };
  86827. return VideoTrackList2;
  86828. }(TrackList);
  86829. var TextTrackList = /* @__PURE__ */ function(_TrackList) {
  86830. _inheritsLoose(TextTrackList2, _TrackList);
  86831. function TextTrackList2() {
  86832. return _TrackList.apply(this, arguments) || this;
  86833. }
  86834. var _proto = TextTrackList2.prototype;
  86835. _proto.addTrack = function addTrack(track) {
  86836. var _this = this;
  86837. _TrackList.prototype.addTrack.call(this, track);
  86838. if (!this.queueChange_) {
  86839. this.queueChange_ = function() {
  86840. return _this.queueTrigger("change");
  86841. };
  86842. }
  86843. if (!this.triggerSelectedlanguagechange) {
  86844. this.triggerSelectedlanguagechange_ = function() {
  86845. return _this.trigger("selectedlanguagechange");
  86846. };
  86847. }
  86848. track.addEventListener("modechange", this.queueChange_);
  86849. var nonLanguageTextTrackKind = ["metadata", "chapters"];
  86850. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  86851. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  86852. }
  86853. };
  86854. _proto.removeTrack = function removeTrack(rtrack) {
  86855. _TrackList.prototype.removeTrack.call(this, rtrack);
  86856. if (rtrack.removeEventListener) {
  86857. if (this.queueChange_) {
  86858. rtrack.removeEventListener("modechange", this.queueChange_);
  86859. }
  86860. if (this.selectedlanguagechange_) {
  86861. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  86862. }
  86863. }
  86864. };
  86865. return TextTrackList2;
  86866. }(TrackList);
  86867. var HtmlTrackElementList = /* @__PURE__ */ function() {
  86868. function HtmlTrackElementList2(trackElements) {
  86869. if (trackElements === void 0) {
  86870. trackElements = [];
  86871. }
  86872. this.trackElements_ = [];
  86873. Object.defineProperty(this, "length", {
  86874. get: function get7() {
  86875. return this.trackElements_.length;
  86876. }
  86877. });
  86878. for (var i2 = 0, length = trackElements.length; i2 < length; i2++) {
  86879. this.addTrackElement_(trackElements[i2]);
  86880. }
  86881. }
  86882. var _proto = HtmlTrackElementList2.prototype;
  86883. _proto.addTrackElement_ = function addTrackElement_(trackElement) {
  86884. var index2 = this.trackElements_.length;
  86885. if (!("" + index2 in this)) {
  86886. Object.defineProperty(this, index2, {
  86887. get: function get7() {
  86888. return this.trackElements_[index2];
  86889. }
  86890. });
  86891. }
  86892. if (this.trackElements_.indexOf(trackElement) === -1) {
  86893. this.trackElements_.push(trackElement);
  86894. }
  86895. };
  86896. _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {
  86897. var trackElement_;
  86898. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86899. if (track === this.trackElements_[i2].track) {
  86900. trackElement_ = this.trackElements_[i2];
  86901. break;
  86902. }
  86903. }
  86904. return trackElement_;
  86905. };
  86906. _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {
  86907. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86908. if (trackElement === this.trackElements_[i2]) {
  86909. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  86910. this.trackElements_[i2].track.off();
  86911. }
  86912. if (typeof this.trackElements_[i2].off === "function") {
  86913. this.trackElements_[i2].off();
  86914. }
  86915. this.trackElements_.splice(i2, 1);
  86916. break;
  86917. }
  86918. }
  86919. };
  86920. return HtmlTrackElementList2;
  86921. }();
  86922. var TextTrackCueList = /* @__PURE__ */ function() {
  86923. function TextTrackCueList2(cues) {
  86924. TextTrackCueList2.prototype.setCues_.call(this, cues);
  86925. Object.defineProperty(this, "length", {
  86926. get: function get7() {
  86927. return this.length_;
  86928. }
  86929. });
  86930. }
  86931. var _proto = TextTrackCueList2.prototype;
  86932. _proto.setCues_ = function setCues_(cues) {
  86933. var oldLength = this.length || 0;
  86934. var i2 = 0;
  86935. var l = cues.length;
  86936. this.cues_ = cues;
  86937. this.length_ = cues.length;
  86938. var defineProp = function defineProp2(index2) {
  86939. if (!("" + index2 in this)) {
  86940. Object.defineProperty(this, "" + index2, {
  86941. get: function get7() {
  86942. return this.cues_[index2];
  86943. }
  86944. });
  86945. }
  86946. };
  86947. if (oldLength < l) {
  86948. i2 = oldLength;
  86949. for (; i2 < l; i2++) {
  86950. defineProp.call(this, i2);
  86951. }
  86952. }
  86953. };
  86954. _proto.getCueById = function getCueById(id) {
  86955. var result = null;
  86956. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86957. var cue = this[i2];
  86958. if (cue.id === id) {
  86959. result = cue;
  86960. break;
  86961. }
  86962. }
  86963. return result;
  86964. };
  86965. return TextTrackCueList2;
  86966. }();
  86967. var VideoTrackKind = {
  86968. alternative: "alternative",
  86969. captions: "captions",
  86970. main: "main",
  86971. sign: "sign",
  86972. subtitles: "subtitles",
  86973. commentary: "commentary"
  86974. };
  86975. var AudioTrackKind = {
  86976. "alternative": "alternative",
  86977. "descriptions": "descriptions",
  86978. "main": "main",
  86979. "main-desc": "main-desc",
  86980. "translation": "translation",
  86981. "commentary": "commentary"
  86982. };
  86983. var TextTrackKind = {
  86984. subtitles: "subtitles",
  86985. captions: "captions",
  86986. descriptions: "descriptions",
  86987. chapters: "chapters",
  86988. metadata: "metadata"
  86989. };
  86990. var TextTrackMode = {
  86991. disabled: "disabled",
  86992. hidden: "hidden",
  86993. showing: "showing"
  86994. };
  86995. var Track = /* @__PURE__ */ function(_EventTarget) {
  86996. _inheritsLoose(Track2, _EventTarget);
  86997. function Track2(options2) {
  86998. var _this;
  86999. if (options2 === void 0) {
  87000. options2 = {};
  87001. }
  87002. _this = _EventTarget.call(this) || this;
  87003. var trackProps = {
  87004. id: options2.id || "vjs_track_" + newGUID(),
  87005. kind: options2.kind || "",
  87006. language: options2.language || ""
  87007. };
  87008. var label = options2.label || "";
  87009. var _loop = function _loop2(key2) {
  87010. Object.defineProperty(_assertThisInitialized(_this), key2, {
  87011. get: function get7() {
  87012. return trackProps[key2];
  87013. },
  87014. set: function set4() {
  87015. }
  87016. });
  87017. };
  87018. for (var key in trackProps) {
  87019. _loop(key);
  87020. }
  87021. Object.defineProperty(_assertThisInitialized(_this), "label", {
  87022. get: function get7() {
  87023. return label;
  87024. },
  87025. set: function set4(newLabel) {
  87026. if (newLabel !== label) {
  87027. label = newLabel;
  87028. this.trigger("labelchange");
  87029. }
  87030. }
  87031. });
  87032. return _this;
  87033. }
  87034. return Track2;
  87035. }(EventTarget$2);
  87036. var parseUrl = function parseUrl2(url) {
  87037. var props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  87038. var a = document_1.createElement("a");
  87039. a.href = url;
  87040. var details = {};
  87041. for (var i2 = 0; i2 < props.length; i2++) {
  87042. details[props[i2]] = a[props[i2]];
  87043. }
  87044. if (details.protocol === "http:") {
  87045. details.host = details.host.replace(/:80$/, "");
  87046. }
  87047. if (details.protocol === "https:") {
  87048. details.host = details.host.replace(/:443$/, "");
  87049. }
  87050. if (!details.protocol) {
  87051. details.protocol = window_1.location.protocol;
  87052. }
  87053. if (!details.host) {
  87054. details.host = window_1.location.host;
  87055. }
  87056. return details;
  87057. };
  87058. var getAbsoluteURL = function getAbsoluteURL2(url) {
  87059. if (!url.match(/^https?:\/\//)) {
  87060. var a = document_1.createElement("a");
  87061. a.href = url;
  87062. url = a.href;
  87063. }
  87064. return url;
  87065. };
  87066. var getFileExtension = function getFileExtension2(path) {
  87067. if (typeof path === "string") {
  87068. var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  87069. var pathParts = splitPathRe.exec(path);
  87070. if (pathParts) {
  87071. return pathParts.pop().toLowerCase();
  87072. }
  87073. }
  87074. return "";
  87075. };
  87076. var isCrossOrigin = function isCrossOrigin2(url, winLoc) {
  87077. if (winLoc === void 0) {
  87078. winLoc = window_1.location;
  87079. }
  87080. var urlInfo = parseUrl(url);
  87081. var srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  87082. var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  87083. return crossOrigin;
  87084. };
  87085. var Url$1 = /* @__PURE__ */ Object.freeze({
  87086. __proto__: null,
  87087. parseUrl,
  87088. getAbsoluteURL,
  87089. getFileExtension,
  87090. isCrossOrigin
  87091. });
  87092. var parseCues = function parseCues2(srcContent, track) {
  87093. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  87094. var errors2 = [];
  87095. parser2.oncue = function(cue) {
  87096. track.addCue(cue);
  87097. };
  87098. parser2.onparsingerror = function(error) {
  87099. errors2.push(error);
  87100. };
  87101. parser2.onflush = function() {
  87102. track.trigger({
  87103. type: "loadeddata",
  87104. target: track
  87105. });
  87106. };
  87107. parser2.parse(srcContent);
  87108. if (errors2.length > 0) {
  87109. if (window_1.console && window_1.console.groupCollapsed) {
  87110. window_1.console.groupCollapsed("Text Track parsing errors for " + track.src);
  87111. }
  87112. errors2.forEach(function(error) {
  87113. return log$1.error(error);
  87114. });
  87115. if (window_1.console && window_1.console.groupEnd) {
  87116. window_1.console.groupEnd();
  87117. }
  87118. }
  87119. parser2.flush();
  87120. };
  87121. var loadTrack = function loadTrack2(src, track) {
  87122. var opts = {
  87123. uri: src
  87124. };
  87125. var crossOrigin = isCrossOrigin(src);
  87126. if (crossOrigin) {
  87127. opts.cors = crossOrigin;
  87128. }
  87129. var withCredentials = track.tech_.crossOrigin() === "use-credentials";
  87130. if (withCredentials) {
  87131. opts.withCredentials = withCredentials;
  87132. }
  87133. XHR(opts, bind(this, function(err, response, responseBody) {
  87134. if (err) {
  87135. return log$1.error(err, response);
  87136. }
  87137. track.loaded_ = true;
  87138. if (typeof window_1.WebVTT !== "function") {
  87139. if (track.tech_) {
  87140. track.tech_.any(["vttjsloaded", "vttjserror"], function(event2) {
  87141. if (event2.type === "vttjserror") {
  87142. log$1.error("vttjs failed to load, stopping trying to process " + track.src);
  87143. return;
  87144. }
  87145. return parseCues(responseBody, track);
  87146. });
  87147. }
  87148. } else {
  87149. parseCues(responseBody, track);
  87150. }
  87151. }));
  87152. };
  87153. var TextTrack = /* @__PURE__ */ function(_Track) {
  87154. _inheritsLoose(TextTrack2, _Track);
  87155. function TextTrack2(options2) {
  87156. var _this;
  87157. if (options2 === void 0) {
  87158. options2 = {};
  87159. }
  87160. if (!options2.tech) {
  87161. throw new Error("A tech was not provided.");
  87162. }
  87163. var settings = mergeOptions$3(options2, {
  87164. kind: TextTrackKind[options2.kind] || "subtitles",
  87165. language: options2.language || options2.srclang || ""
  87166. });
  87167. var mode = TextTrackMode[settings.mode] || "disabled";
  87168. var default_ = settings["default"];
  87169. if (settings.kind === "metadata" || settings.kind === "chapters") {
  87170. mode = "hidden";
  87171. }
  87172. _this = _Track.call(this, settings) || this;
  87173. _this.tech_ = settings.tech;
  87174. _this.cues_ = [];
  87175. _this.activeCues_ = [];
  87176. _this.preload_ = _this.tech_.preloadTextTracks !== false;
  87177. var cues = new TextTrackCueList(_this.cues_);
  87178. var activeCues = new TextTrackCueList(_this.activeCues_);
  87179. var changed = false;
  87180. _this.timeupdateHandler = bind(_assertThisInitialized(_this), function(event2) {
  87181. if (event2 === void 0) {
  87182. event2 = {};
  87183. }
  87184. if (this.tech_.isDisposed()) {
  87185. return;
  87186. }
  87187. if (!this.tech_.isReady_) {
  87188. if (event2.type !== "timeupdate") {
  87189. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87190. }
  87191. return;
  87192. }
  87193. this.activeCues = this.activeCues;
  87194. if (changed) {
  87195. this.trigger("cuechange");
  87196. changed = false;
  87197. }
  87198. if (event2.type !== "timeupdate") {
  87199. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87200. }
  87201. });
  87202. var disposeHandler = function disposeHandler2() {
  87203. _this.stopTracking();
  87204. };
  87205. _this.tech_.one("dispose", disposeHandler);
  87206. if (mode !== "disabled") {
  87207. _this.startTracking();
  87208. }
  87209. Object.defineProperties(_assertThisInitialized(_this), {
  87210. "default": {
  87211. get: function get7() {
  87212. return default_;
  87213. },
  87214. set: function set4() {
  87215. }
  87216. },
  87217. mode: {
  87218. get: function get7() {
  87219. return mode;
  87220. },
  87221. set: function set4(newMode) {
  87222. if (!TextTrackMode[newMode]) {
  87223. return;
  87224. }
  87225. if (mode === newMode) {
  87226. return;
  87227. }
  87228. mode = newMode;
  87229. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  87230. loadTrack(this.src, this);
  87231. }
  87232. this.stopTracking();
  87233. if (mode !== "disabled") {
  87234. this.startTracking();
  87235. }
  87236. this.trigger("modechange");
  87237. }
  87238. },
  87239. cues: {
  87240. get: function get7() {
  87241. if (!this.loaded_) {
  87242. return null;
  87243. }
  87244. return cues;
  87245. },
  87246. set: function set4() {
  87247. }
  87248. },
  87249. activeCues: {
  87250. get: function get7() {
  87251. if (!this.loaded_) {
  87252. return null;
  87253. }
  87254. if (this.cues.length === 0) {
  87255. return activeCues;
  87256. }
  87257. var ct2 = this.tech_.currentTime();
  87258. var active = [];
  87259. for (var i2 = 0, l = this.cues.length; i2 < l; i2++) {
  87260. var cue = this.cues[i2];
  87261. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  87262. active.push(cue);
  87263. } else if (cue.startTime === cue.endTime && cue.startTime <= ct2 && cue.startTime + 0.5 >= ct2) {
  87264. active.push(cue);
  87265. }
  87266. }
  87267. changed = false;
  87268. if (active.length !== this.activeCues_.length) {
  87269. changed = true;
  87270. } else {
  87271. for (var _i = 0; _i < active.length; _i++) {
  87272. if (this.activeCues_.indexOf(active[_i]) === -1) {
  87273. changed = true;
  87274. }
  87275. }
  87276. }
  87277. this.activeCues_ = active;
  87278. activeCues.setCues_(this.activeCues_);
  87279. return activeCues;
  87280. },
  87281. set: function set4() {
  87282. }
  87283. }
  87284. });
  87285. if (settings.src) {
  87286. _this.src = settings.src;
  87287. if (!_this.preload_) {
  87288. _this.loaded_ = true;
  87289. }
  87290. if (_this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  87291. loadTrack(_this.src, _assertThisInitialized(_this));
  87292. }
  87293. } else {
  87294. _this.loaded_ = true;
  87295. }
  87296. return _this;
  87297. }
  87298. var _proto = TextTrack2.prototype;
  87299. _proto.startTracking = function startTracking() {
  87300. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87301. this.tech_.on("timeupdate", this.timeupdateHandler);
  87302. };
  87303. _proto.stopTracking = function stopTracking() {
  87304. if (this.rvf_) {
  87305. this.tech_.cancelVideoFrameCallback(this.rvf_);
  87306. this.rvf_ = void 0;
  87307. }
  87308. this.tech_.off("timeupdate", this.timeupdateHandler);
  87309. };
  87310. _proto.addCue = function addCue(originalCue) {
  87311. var cue = originalCue;
  87312. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  87313. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  87314. for (var prop in originalCue) {
  87315. if (!(prop in cue)) {
  87316. cue[prop] = originalCue[prop];
  87317. }
  87318. }
  87319. cue.id = originalCue.id;
  87320. cue.originalCue_ = originalCue;
  87321. }
  87322. var tracks = this.tech_.textTracks();
  87323. for (var i2 = 0; i2 < tracks.length; i2++) {
  87324. if (tracks[i2] !== this) {
  87325. tracks[i2].removeCue(cue);
  87326. }
  87327. }
  87328. this.cues_.push(cue);
  87329. this.cues.setCues_(this.cues_);
  87330. };
  87331. _proto.removeCue = function removeCue(_removeCue) {
  87332. var i2 = this.cues_.length;
  87333. while (i2--) {
  87334. var cue = this.cues_[i2];
  87335. if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {
  87336. this.cues_.splice(i2, 1);
  87337. this.cues.setCues_(this.cues_);
  87338. break;
  87339. }
  87340. }
  87341. };
  87342. return TextTrack2;
  87343. }(Track);
  87344. TextTrack.prototype.allowedEvents_ = {
  87345. cuechange: "cuechange"
  87346. };
  87347. var AudioTrack = /* @__PURE__ */ function(_Track) {
  87348. _inheritsLoose(AudioTrack2, _Track);
  87349. function AudioTrack2(options2) {
  87350. var _this;
  87351. if (options2 === void 0) {
  87352. options2 = {};
  87353. }
  87354. var settings = mergeOptions$3(options2, {
  87355. kind: AudioTrackKind[options2.kind] || ""
  87356. });
  87357. _this = _Track.call(this, settings) || this;
  87358. var enabled = false;
  87359. Object.defineProperty(_assertThisInitialized(_this), "enabled", {
  87360. get: function get7() {
  87361. return enabled;
  87362. },
  87363. set: function set4(newEnabled) {
  87364. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  87365. return;
  87366. }
  87367. enabled = newEnabled;
  87368. this.trigger("enabledchange");
  87369. }
  87370. });
  87371. if (settings.enabled) {
  87372. _this.enabled = settings.enabled;
  87373. }
  87374. _this.loaded_ = true;
  87375. return _this;
  87376. }
  87377. return AudioTrack2;
  87378. }(Track);
  87379. var VideoTrack = /* @__PURE__ */ function(_Track) {
  87380. _inheritsLoose(VideoTrack2, _Track);
  87381. function VideoTrack2(options2) {
  87382. var _this;
  87383. if (options2 === void 0) {
  87384. options2 = {};
  87385. }
  87386. var settings = mergeOptions$3(options2, {
  87387. kind: VideoTrackKind[options2.kind] || ""
  87388. });
  87389. _this = _Track.call(this, settings) || this;
  87390. var selected = false;
  87391. Object.defineProperty(_assertThisInitialized(_this), "selected", {
  87392. get: function get7() {
  87393. return selected;
  87394. },
  87395. set: function set4(newSelected) {
  87396. if (typeof newSelected !== "boolean" || newSelected === selected) {
  87397. return;
  87398. }
  87399. selected = newSelected;
  87400. this.trigger("selectedchange");
  87401. }
  87402. });
  87403. if (settings.selected) {
  87404. _this.selected = settings.selected;
  87405. }
  87406. return _this;
  87407. }
  87408. return VideoTrack2;
  87409. }(Track);
  87410. var NONE = 0;
  87411. var LOADING = 1;
  87412. var LOADED = 2;
  87413. var ERROR = 3;
  87414. var HTMLTrackElement = /* @__PURE__ */ function(_EventTarget) {
  87415. _inheritsLoose(HTMLTrackElement2, _EventTarget);
  87416. function HTMLTrackElement2(options2) {
  87417. var _this;
  87418. if (options2 === void 0) {
  87419. options2 = {};
  87420. }
  87421. _this = _EventTarget.call(this) || this;
  87422. var readyState;
  87423. var track = new TextTrack(options2);
  87424. _this.kind = track.kind;
  87425. _this.src = track.src;
  87426. _this.srclang = track.language;
  87427. _this.label = track.label;
  87428. _this["default"] = track["default"];
  87429. Object.defineProperties(_assertThisInitialized(_this), {
  87430. readyState: {
  87431. get: function get7() {
  87432. return readyState;
  87433. }
  87434. },
  87435. track: {
  87436. get: function get7() {
  87437. return track;
  87438. }
  87439. }
  87440. });
  87441. readyState = NONE;
  87442. track.addEventListener("loadeddata", function() {
  87443. readyState = LOADED;
  87444. _this.trigger({
  87445. type: "load",
  87446. target: _assertThisInitialized(_this)
  87447. });
  87448. });
  87449. return _this;
  87450. }
  87451. return HTMLTrackElement2;
  87452. }(EventTarget$2);
  87453. HTMLTrackElement.prototype.allowedEvents_ = {
  87454. load: "load"
  87455. };
  87456. HTMLTrackElement.NONE = NONE;
  87457. HTMLTrackElement.LOADING = LOADING;
  87458. HTMLTrackElement.LOADED = LOADED;
  87459. HTMLTrackElement.ERROR = ERROR;
  87460. var NORMAL = {
  87461. audio: {
  87462. ListClass: AudioTrackList,
  87463. TrackClass: AudioTrack,
  87464. capitalName: "Audio"
  87465. },
  87466. video: {
  87467. ListClass: VideoTrackList,
  87468. TrackClass: VideoTrack,
  87469. capitalName: "Video"
  87470. },
  87471. text: {
  87472. ListClass: TextTrackList,
  87473. TrackClass: TextTrack,
  87474. capitalName: "Text"
  87475. }
  87476. };
  87477. Object.keys(NORMAL).forEach(function(type2) {
  87478. NORMAL[type2].getterName = type2 + "Tracks";
  87479. NORMAL[type2].privateName = type2 + "Tracks_";
  87480. });
  87481. var REMOTE = {
  87482. remoteText: {
  87483. ListClass: TextTrackList,
  87484. TrackClass: TextTrack,
  87485. capitalName: "RemoteText",
  87486. getterName: "remoteTextTracks",
  87487. privateName: "remoteTextTracks_"
  87488. },
  87489. remoteTextEl: {
  87490. ListClass: HtmlTrackElementList,
  87491. TrackClass: HTMLTrackElement,
  87492. capitalName: "RemoteTextTrackEls",
  87493. getterName: "remoteTextTrackEls",
  87494. privateName: "remoteTextTrackEls_"
  87495. }
  87496. };
  87497. var ALL = _extends$2({}, NORMAL, REMOTE);
  87498. REMOTE.names = Object.keys(REMOTE);
  87499. NORMAL.names = Object.keys(NORMAL);
  87500. ALL.names = [].concat(REMOTE.names).concat(NORMAL.names);
  87501. function createTrackHelper(self2, kind, label, language, options2) {
  87502. if (options2 === void 0) {
  87503. options2 = {};
  87504. }
  87505. var tracks = self2.textTracks();
  87506. options2.kind = kind;
  87507. if (label) {
  87508. options2.label = label;
  87509. }
  87510. if (language) {
  87511. options2.language = language;
  87512. }
  87513. options2.tech = self2;
  87514. var track = new ALL.text.TrackClass(options2);
  87515. tracks.addTrack(track);
  87516. return track;
  87517. }
  87518. var Tech$1 = /* @__PURE__ */ function(_Component) {
  87519. _inheritsLoose(Tech2, _Component);
  87520. function Tech2(options2, ready) {
  87521. var _this;
  87522. if (options2 === void 0) {
  87523. options2 = {};
  87524. }
  87525. if (ready === void 0) {
  87526. ready = function ready2() {
  87527. };
  87528. }
  87529. options2.reportTouchActivity = false;
  87530. _this = _Component.call(this, null, options2, ready) || this;
  87531. _this.onDurationChange_ = function(e) {
  87532. return _this.onDurationChange(e);
  87533. };
  87534. _this.trackProgress_ = function(e) {
  87535. return _this.trackProgress(e);
  87536. };
  87537. _this.trackCurrentTime_ = function(e) {
  87538. return _this.trackCurrentTime(e);
  87539. };
  87540. _this.stopTrackingCurrentTime_ = function(e) {
  87541. return _this.stopTrackingCurrentTime(e);
  87542. };
  87543. _this.disposeSourceHandler_ = function(e) {
  87544. return _this.disposeSourceHandler(e);
  87545. };
  87546. _this.queuedHanders_ = /* @__PURE__ */ new Set();
  87547. _this.hasStarted_ = false;
  87548. _this.on("playing", function() {
  87549. this.hasStarted_ = true;
  87550. });
  87551. _this.on("loadstart", function() {
  87552. this.hasStarted_ = false;
  87553. });
  87554. ALL.names.forEach(function(name) {
  87555. var props = ALL[name];
  87556. if (options2 && options2[props.getterName]) {
  87557. _this[props.privateName] = options2[props.getterName];
  87558. }
  87559. });
  87560. if (!_this.featuresProgressEvents) {
  87561. _this.manualProgressOn();
  87562. }
  87563. if (!_this.featuresTimeupdateEvents) {
  87564. _this.manualTimeUpdatesOn();
  87565. }
  87566. ["Text", "Audio", "Video"].forEach(function(track) {
  87567. if (options2["native" + track + "Tracks"] === false) {
  87568. _this["featuresNative" + track + "Tracks"] = false;
  87569. }
  87570. });
  87571. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  87572. _this.featuresNativeTextTracks = false;
  87573. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  87574. _this.featuresNativeTextTracks = true;
  87575. }
  87576. if (!_this.featuresNativeTextTracks) {
  87577. _this.emulateTextTracks();
  87578. }
  87579. _this.preloadTextTracks = options2.preloadTextTracks !== false;
  87580. _this.autoRemoteTextTracks_ = new ALL.text.ListClass();
  87581. _this.initTrackListeners();
  87582. if (!options2.nativeControlsForTouch) {
  87583. _this.emitTapEvents();
  87584. }
  87585. if (_this.constructor) {
  87586. _this.name_ = _this.constructor.name || "Unknown Tech";
  87587. }
  87588. return _this;
  87589. }
  87590. var _proto = Tech2.prototype;
  87591. _proto.triggerSourceset = function triggerSourceset(src) {
  87592. var _this2 = this;
  87593. if (!this.isReady_) {
  87594. this.one("ready", function() {
  87595. return _this2.setTimeout(function() {
  87596. return _this2.triggerSourceset(src);
  87597. }, 1);
  87598. });
  87599. }
  87600. this.trigger({
  87601. src,
  87602. type: "sourceset"
  87603. });
  87604. };
  87605. _proto.manualProgressOn = function manualProgressOn() {
  87606. this.on("durationchange", this.onDurationChange_);
  87607. this.manualProgress = true;
  87608. this.one("ready", this.trackProgress_);
  87609. };
  87610. _proto.manualProgressOff = function manualProgressOff() {
  87611. this.manualProgress = false;
  87612. this.stopTrackingProgress();
  87613. this.off("durationchange", this.onDurationChange_);
  87614. };
  87615. _proto.trackProgress = function trackProgress(event2) {
  87616. this.stopTrackingProgress();
  87617. this.progressInterval = this.setInterval(bind(this, function() {
  87618. var numBufferedPercent = this.bufferedPercent();
  87619. if (this.bufferedPercent_ !== numBufferedPercent) {
  87620. this.trigger("progress");
  87621. }
  87622. this.bufferedPercent_ = numBufferedPercent;
  87623. if (numBufferedPercent === 1) {
  87624. this.stopTrackingProgress();
  87625. }
  87626. }), 500);
  87627. };
  87628. _proto.onDurationChange = function onDurationChange(event2) {
  87629. this.duration_ = this.duration();
  87630. };
  87631. _proto.buffered = function buffered() {
  87632. return createTimeRanges(0, 0);
  87633. };
  87634. _proto.bufferedPercent = function bufferedPercent$12() {
  87635. return bufferedPercent(this.buffered(), this.duration_);
  87636. };
  87637. _proto.stopTrackingProgress = function stopTrackingProgress() {
  87638. this.clearInterval(this.progressInterval);
  87639. };
  87640. _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {
  87641. this.manualTimeUpdates = true;
  87642. this.on("play", this.trackCurrentTime_);
  87643. this.on("pause", this.stopTrackingCurrentTime_);
  87644. };
  87645. _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {
  87646. this.manualTimeUpdates = false;
  87647. this.stopTrackingCurrentTime();
  87648. this.off("play", this.trackCurrentTime_);
  87649. this.off("pause", this.stopTrackingCurrentTime_);
  87650. };
  87651. _proto.trackCurrentTime = function trackCurrentTime() {
  87652. if (this.currentTimeInterval) {
  87653. this.stopTrackingCurrentTime();
  87654. }
  87655. this.currentTimeInterval = this.setInterval(function() {
  87656. this.trigger({
  87657. type: "timeupdate",
  87658. target: this,
  87659. manuallyTriggered: true
  87660. });
  87661. }, 250);
  87662. };
  87663. _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {
  87664. this.clearInterval(this.currentTimeInterval);
  87665. this.trigger({
  87666. type: "timeupdate",
  87667. target: this,
  87668. manuallyTriggered: true
  87669. });
  87670. };
  87671. _proto.dispose = function dispose() {
  87672. this.clearTracks(NORMAL.names);
  87673. if (this.manualProgress) {
  87674. this.manualProgressOff();
  87675. }
  87676. if (this.manualTimeUpdates) {
  87677. this.manualTimeUpdatesOff();
  87678. }
  87679. _Component.prototype.dispose.call(this);
  87680. };
  87681. _proto.clearTracks = function clearTracks(types) {
  87682. var _this3 = this;
  87683. types = [].concat(types);
  87684. types.forEach(function(type2) {
  87685. var list = _this3[type2 + "Tracks"]() || [];
  87686. var i2 = list.length;
  87687. while (i2--) {
  87688. var track = list[i2];
  87689. if (type2 === "text") {
  87690. _this3.removeRemoteTextTrack(track);
  87691. }
  87692. list.removeTrack(track);
  87693. }
  87694. });
  87695. };
  87696. _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {
  87697. var list = this.autoRemoteTextTracks_ || [];
  87698. var i2 = list.length;
  87699. while (i2--) {
  87700. var track = list[i2];
  87701. this.removeRemoteTextTrack(track);
  87702. }
  87703. };
  87704. _proto.reset = function reset3() {
  87705. };
  87706. _proto.crossOrigin = function crossOrigin() {
  87707. };
  87708. _proto.setCrossOrigin = function setCrossOrigin() {
  87709. };
  87710. _proto.error = function error(err) {
  87711. if (err !== void 0) {
  87712. this.error_ = new MediaError(err);
  87713. this.trigger("error");
  87714. }
  87715. return this.error_;
  87716. };
  87717. _proto.played = function played() {
  87718. if (this.hasStarted_) {
  87719. return createTimeRanges(0, 0);
  87720. }
  87721. return createTimeRanges();
  87722. };
  87723. _proto.play = function play() {
  87724. };
  87725. _proto.setScrubbing = function setScrubbing() {
  87726. };
  87727. _proto.scrubbing = function scrubbing() {
  87728. };
  87729. _proto.setCurrentTime = function setCurrentTime() {
  87730. if (this.manualTimeUpdates) {
  87731. this.trigger({
  87732. type: "timeupdate",
  87733. target: this,
  87734. manuallyTriggered: true
  87735. });
  87736. }
  87737. };
  87738. _proto.initTrackListeners = function initTrackListeners() {
  87739. var _this4 = this;
  87740. NORMAL.names.forEach(function(name) {
  87741. var props = NORMAL[name];
  87742. var trackListChanges = function trackListChanges2() {
  87743. _this4.trigger(name + "trackchange");
  87744. };
  87745. var tracks = _this4[props.getterName]();
  87746. tracks.addEventListener("removetrack", trackListChanges);
  87747. tracks.addEventListener("addtrack", trackListChanges);
  87748. _this4.on("dispose", function() {
  87749. tracks.removeEventListener("removetrack", trackListChanges);
  87750. tracks.removeEventListener("addtrack", trackListChanges);
  87751. });
  87752. });
  87753. };
  87754. _proto.addWebVttScript_ = function addWebVttScript_() {
  87755. var _this5 = this;
  87756. if (window_1.WebVTT) {
  87757. return;
  87758. }
  87759. if (document_1.body.contains(this.el())) {
  87760. if (!this.options_["vtt.js"] && isPlain(vtt) && Object.keys(vtt).length > 0) {
  87761. this.trigger("vttjsloaded");
  87762. return;
  87763. }
  87764. var script = document_1.createElement("script");
  87765. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  87766. script.onload = function() {
  87767. _this5.trigger("vttjsloaded");
  87768. };
  87769. script.onerror = function() {
  87770. _this5.trigger("vttjserror");
  87771. };
  87772. this.on("dispose", function() {
  87773. script.onload = null;
  87774. script.onerror = null;
  87775. });
  87776. window_1.WebVTT = true;
  87777. this.el().parentNode.appendChild(script);
  87778. } else {
  87779. this.ready(this.addWebVttScript_);
  87780. }
  87781. };
  87782. _proto.emulateTextTracks = function emulateTextTracks() {
  87783. var _this6 = this;
  87784. var tracks = this.textTracks();
  87785. var remoteTracks = this.remoteTextTracks();
  87786. var handleAddTrack = function handleAddTrack2(e) {
  87787. return tracks.addTrack(e.track);
  87788. };
  87789. var handleRemoveTrack = function handleRemoveTrack2(e) {
  87790. return tracks.removeTrack(e.track);
  87791. };
  87792. remoteTracks.on("addtrack", handleAddTrack);
  87793. remoteTracks.on("removetrack", handleRemoveTrack);
  87794. this.addWebVttScript_();
  87795. var updateDisplay = function updateDisplay2() {
  87796. return _this6.trigger("texttrackchange");
  87797. };
  87798. var textTracksChanges = function textTracksChanges2() {
  87799. updateDisplay();
  87800. for (var i2 = 0; i2 < tracks.length; i2++) {
  87801. var track = tracks[i2];
  87802. track.removeEventListener("cuechange", updateDisplay);
  87803. if (track.mode === "showing") {
  87804. track.addEventListener("cuechange", updateDisplay);
  87805. }
  87806. }
  87807. };
  87808. textTracksChanges();
  87809. tracks.addEventListener("change", textTracksChanges);
  87810. tracks.addEventListener("addtrack", textTracksChanges);
  87811. tracks.addEventListener("removetrack", textTracksChanges);
  87812. this.on("dispose", function() {
  87813. remoteTracks.off("addtrack", handleAddTrack);
  87814. remoteTracks.off("removetrack", handleRemoveTrack);
  87815. tracks.removeEventListener("change", textTracksChanges);
  87816. tracks.removeEventListener("addtrack", textTracksChanges);
  87817. tracks.removeEventListener("removetrack", textTracksChanges);
  87818. for (var i2 = 0; i2 < tracks.length; i2++) {
  87819. var track = tracks[i2];
  87820. track.removeEventListener("cuechange", updateDisplay);
  87821. }
  87822. });
  87823. };
  87824. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  87825. if (!kind) {
  87826. throw new Error("TextTrack kind is required but was not provided");
  87827. }
  87828. return createTrackHelper(this, kind, label, language);
  87829. };
  87830. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  87831. var track = mergeOptions$3(options2, {
  87832. tech: this
  87833. });
  87834. return new REMOTE.remoteTextEl.TrackClass(track);
  87835. };
  87836. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  87837. var _this7 = this;
  87838. if (options2 === void 0) {
  87839. options2 = {};
  87840. }
  87841. var htmlTrackElement = this.createRemoteTextTrack(options2);
  87842. if (manualCleanup !== true && manualCleanup !== false) {
  87843. log$1.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');
  87844. manualCleanup = true;
  87845. }
  87846. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  87847. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  87848. if (manualCleanup !== true) {
  87849. this.ready(function() {
  87850. return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);
  87851. });
  87852. }
  87853. return htmlTrackElement;
  87854. };
  87855. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  87856. var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  87857. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  87858. this.remoteTextTracks().removeTrack(track);
  87859. this.autoRemoteTextTracks_.removeTrack(track);
  87860. };
  87861. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  87862. return {};
  87863. };
  87864. _proto.requestPictureInPicture = function requestPictureInPicture() {
  87865. var PromiseClass = this.options_.Promise || window_1.Promise;
  87866. if (PromiseClass) {
  87867. return PromiseClass.reject();
  87868. }
  87869. };
  87870. _proto.disablePictureInPicture = function disablePictureInPicture() {
  87871. return true;
  87872. };
  87873. _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {
  87874. };
  87875. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  87876. var _this8 = this;
  87877. var id = newGUID();
  87878. if (!this.isReady_ || this.paused()) {
  87879. this.queuedHanders_.add(id);
  87880. this.one("playing", function() {
  87881. if (_this8.queuedHanders_.has(id)) {
  87882. _this8.queuedHanders_["delete"](id);
  87883. cb();
  87884. }
  87885. });
  87886. } else {
  87887. this.requestNamedAnimationFrame(id, cb);
  87888. }
  87889. return id;
  87890. };
  87891. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  87892. if (this.queuedHanders_.has(id)) {
  87893. this.queuedHanders_["delete"](id);
  87894. } else {
  87895. this.cancelNamedAnimationFrame(id);
  87896. }
  87897. };
  87898. _proto.setPoster = function setPoster() {
  87899. };
  87900. _proto.playsinline = function playsinline() {
  87901. };
  87902. _proto.setPlaysinline = function setPlaysinline() {
  87903. };
  87904. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {
  87905. };
  87906. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {
  87907. };
  87908. _proto.canPlayType = function canPlayType3() {
  87909. return "";
  87910. };
  87911. Tech2.canPlayType = function canPlayType3() {
  87912. return "";
  87913. };
  87914. Tech2.canPlaySource = function canPlaySource(srcObj, options2) {
  87915. return Tech2.canPlayType(srcObj.type);
  87916. };
  87917. Tech2.isTech = function isTech(component) {
  87918. return component.prototype instanceof Tech2 || component instanceof Tech2 || component === Tech2;
  87919. };
  87920. Tech2.registerTech = function registerTech(name, tech) {
  87921. if (!Tech2.techs_) {
  87922. Tech2.techs_ = {};
  87923. }
  87924. if (!Tech2.isTech(tech)) {
  87925. throw new Error("Tech " + name + " must be a Tech");
  87926. }
  87927. if (!Tech2.canPlayType) {
  87928. throw new Error("Techs must have a static canPlayType method on them");
  87929. }
  87930. if (!Tech2.canPlaySource) {
  87931. throw new Error("Techs must have a static canPlaySource method on them");
  87932. }
  87933. name = toTitleCase$1(name);
  87934. Tech2.techs_[name] = tech;
  87935. Tech2.techs_[toLowerCase(name)] = tech;
  87936. if (name !== "Tech") {
  87937. Tech2.defaultTechOrder_.push(name);
  87938. }
  87939. return tech;
  87940. };
  87941. Tech2.getTech = function getTech(name) {
  87942. if (!name) {
  87943. return;
  87944. }
  87945. if (Tech2.techs_ && Tech2.techs_[name]) {
  87946. return Tech2.techs_[name];
  87947. }
  87948. name = toTitleCase$1(name);
  87949. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  87950. log$1.warn("The " + name + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");
  87951. return window_1.videojs[name];
  87952. }
  87953. };
  87954. return Tech2;
  87955. }(Component$1);
  87956. ALL.names.forEach(function(name) {
  87957. var props = ALL[name];
  87958. Tech$1.prototype[props.getterName] = function() {
  87959. this[props.privateName] = this[props.privateName] || new props.ListClass();
  87960. return this[props.privateName];
  87961. };
  87962. });
  87963. Tech$1.prototype.featuresVolumeControl = true;
  87964. Tech$1.prototype.featuresMuteControl = true;
  87965. Tech$1.prototype.featuresFullscreenResize = false;
  87966. Tech$1.prototype.featuresPlaybackRate = false;
  87967. Tech$1.prototype.featuresProgressEvents = false;
  87968. Tech$1.prototype.featuresSourceset = false;
  87969. Tech$1.prototype.featuresTimeupdateEvents = false;
  87970. Tech$1.prototype.featuresNativeTextTracks = false;
  87971. Tech$1.prototype.featuresVideoFrameCallback = false;
  87972. Tech$1.withSourceHandlers = function(_Tech) {
  87973. _Tech.registerSourceHandler = function(handler, index2) {
  87974. var handlers = _Tech.sourceHandlers;
  87975. if (!handlers) {
  87976. handlers = _Tech.sourceHandlers = [];
  87977. }
  87978. if (index2 === void 0) {
  87979. index2 = handlers.length;
  87980. }
  87981. handlers.splice(index2, 0, handler);
  87982. };
  87983. _Tech.canPlayType = function(type2) {
  87984. var handlers = _Tech.sourceHandlers || [];
  87985. var can;
  87986. for (var i2 = 0; i2 < handlers.length; i2++) {
  87987. can = handlers[i2].canPlayType(type2);
  87988. if (can) {
  87989. return can;
  87990. }
  87991. }
  87992. return "";
  87993. };
  87994. _Tech.selectSourceHandler = function(source, options2) {
  87995. var handlers = _Tech.sourceHandlers || [];
  87996. var can;
  87997. for (var i2 = 0; i2 < handlers.length; i2++) {
  87998. can = handlers[i2].canHandleSource(source, options2);
  87999. if (can) {
  88000. return handlers[i2];
  88001. }
  88002. }
  88003. return null;
  88004. };
  88005. _Tech.canPlaySource = function(srcObj, options2) {
  88006. var sh = _Tech.selectSourceHandler(srcObj, options2);
  88007. if (sh) {
  88008. return sh.canHandleSource(srcObj, options2);
  88009. }
  88010. return "";
  88011. };
  88012. var deferrable = ["seekable", "seeking", "duration"];
  88013. deferrable.forEach(function(fnName) {
  88014. var originalFn = this[fnName];
  88015. if (typeof originalFn !== "function") {
  88016. return;
  88017. }
  88018. this[fnName] = function() {
  88019. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  88020. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  88021. }
  88022. return originalFn.apply(this, arguments);
  88023. };
  88024. }, _Tech.prototype);
  88025. _Tech.prototype.setSource = function(source) {
  88026. var sh = _Tech.selectSourceHandler(source, this.options_);
  88027. if (!sh) {
  88028. if (_Tech.nativeSourceHandler) {
  88029. sh = _Tech.nativeSourceHandler;
  88030. } else {
  88031. log$1.error("No source handler found for the current source.");
  88032. }
  88033. }
  88034. this.disposeSourceHandler();
  88035. this.off("dispose", this.disposeSourceHandler_);
  88036. if (sh !== _Tech.nativeSourceHandler) {
  88037. this.currentSource_ = source;
  88038. }
  88039. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  88040. this.one("dispose", this.disposeSourceHandler_);
  88041. };
  88042. _Tech.prototype.disposeSourceHandler = function() {
  88043. if (this.currentSource_) {
  88044. this.clearTracks(["audio", "video"]);
  88045. this.currentSource_ = null;
  88046. }
  88047. this.cleanupAutoTextTracks();
  88048. if (this.sourceHandler_) {
  88049. if (this.sourceHandler_.dispose) {
  88050. this.sourceHandler_.dispose();
  88051. }
  88052. this.sourceHandler_ = null;
  88053. }
  88054. };
  88055. };
  88056. Component$1.registerComponent("Tech", Tech$1);
  88057. Tech$1.registerTech("Tech", Tech$1);
  88058. Tech$1.defaultTechOrder_ = [];
  88059. var middlewares = {};
  88060. var middlewareInstances = {};
  88061. var TERMINATOR = {};
  88062. function use(type2, middleware) {
  88063. middlewares[type2] = middlewares[type2] || [];
  88064. middlewares[type2].push(middleware);
  88065. }
  88066. function setSource(player, src, next) {
  88067. player.setTimeout(function() {
  88068. return setSourceHelper(src, middlewares[src.type], next, player);
  88069. }, 1);
  88070. }
  88071. function setTech(middleware, tech) {
  88072. middleware.forEach(function(mw) {
  88073. return mw.setTech && mw.setTech(tech);
  88074. });
  88075. }
  88076. function get(middleware, tech, method) {
  88077. return middleware.reduceRight(middlewareIterator(method), tech[method]());
  88078. }
  88079. function set(middleware, tech, method, arg) {
  88080. return tech[method](middleware.reduce(middlewareIterator(method), arg));
  88081. }
  88082. function mediate(middleware, tech, method, arg) {
  88083. if (arg === void 0) {
  88084. arg = null;
  88085. }
  88086. var callMethod = "call" + toTitleCase$1(method);
  88087. var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);
  88088. var terminated = middlewareValue === TERMINATOR;
  88089. var returnValue = terminated ? null : tech[method](middlewareValue);
  88090. executeRight(middleware, method, returnValue, terminated);
  88091. return returnValue;
  88092. }
  88093. var allowedGetters = {
  88094. buffered: 1,
  88095. currentTime: 1,
  88096. duration: 1,
  88097. muted: 1,
  88098. played: 1,
  88099. paused: 1,
  88100. seekable: 1,
  88101. volume: 1,
  88102. ended: 1
  88103. };
  88104. var allowedSetters = {
  88105. setCurrentTime: 1,
  88106. setMuted: 1,
  88107. setVolume: 1
  88108. };
  88109. var allowedMediators = {
  88110. play: 1,
  88111. pause: 1
  88112. };
  88113. function middlewareIterator(method) {
  88114. return function(value, mw) {
  88115. if (value === TERMINATOR) {
  88116. return TERMINATOR;
  88117. }
  88118. if (mw[method]) {
  88119. return mw[method](value);
  88120. }
  88121. return value;
  88122. };
  88123. }
  88124. function executeRight(mws, method, value, terminated) {
  88125. for (var i2 = mws.length - 1; i2 >= 0; i2--) {
  88126. var mw = mws[i2];
  88127. if (mw[method]) {
  88128. mw[method](terminated, value);
  88129. }
  88130. }
  88131. }
  88132. function clearCacheForPlayer(player) {
  88133. middlewareInstances[player.id()] = null;
  88134. }
  88135. function getOrCreateFactory(player, mwFactory) {
  88136. var mws = middlewareInstances[player.id()];
  88137. var mw = null;
  88138. if (mws === void 0 || mws === null) {
  88139. mw = mwFactory(player);
  88140. middlewareInstances[player.id()] = [[mwFactory, mw]];
  88141. return mw;
  88142. }
  88143. for (var i2 = 0; i2 < mws.length; i2++) {
  88144. var _mws$i = mws[i2], mwf = _mws$i[0], mwi = _mws$i[1];
  88145. if (mwf !== mwFactory) {
  88146. continue;
  88147. }
  88148. mw = mwi;
  88149. }
  88150. if (mw === null) {
  88151. mw = mwFactory(player);
  88152. mws.push([mwFactory, mw]);
  88153. }
  88154. return mw;
  88155. }
  88156. function setSourceHelper(src, middleware, next, player, acc, lastRun) {
  88157. if (src === void 0) {
  88158. src = {};
  88159. }
  88160. if (middleware === void 0) {
  88161. middleware = [];
  88162. }
  88163. if (acc === void 0) {
  88164. acc = [];
  88165. }
  88166. if (lastRun === void 0) {
  88167. lastRun = false;
  88168. }
  88169. var _middleware = middleware, mwFactory = _middleware[0], mwrest = _middleware.slice(1);
  88170. if (typeof mwFactory === "string") {
  88171. setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun);
  88172. } else if (mwFactory) {
  88173. var mw = getOrCreateFactory(player, mwFactory);
  88174. if (!mw.setSource) {
  88175. acc.push(mw);
  88176. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88177. }
  88178. mw.setSource(assign({}, src), function(err, _src) {
  88179. if (err) {
  88180. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88181. }
  88182. acc.push(mw);
  88183. setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);
  88184. });
  88185. } else if (mwrest.length) {
  88186. setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88187. } else if (lastRun) {
  88188. next(src, acc);
  88189. } else {
  88190. setSourceHelper(src, middlewares["*"], next, player, acc, true);
  88191. }
  88192. }
  88193. var MimetypesKind = {
  88194. opus: "video/ogg",
  88195. ogv: "video/ogg",
  88196. mp4: "video/mp4",
  88197. mov: "video/mp4",
  88198. m4v: "video/mp4",
  88199. mkv: "video/x-matroska",
  88200. m4a: "audio/mp4",
  88201. mp3: "audio/mpeg",
  88202. aac: "audio/aac",
  88203. caf: "audio/x-caf",
  88204. flac: "audio/flac",
  88205. oga: "audio/ogg",
  88206. wav: "audio/wav",
  88207. m3u8: "application/x-mpegURL",
  88208. mpd: "application/dash+xml",
  88209. jpg: "image/jpeg",
  88210. jpeg: "image/jpeg",
  88211. gif: "image/gif",
  88212. png: "image/png",
  88213. svg: "image/svg+xml",
  88214. webp: "image/webp"
  88215. };
  88216. var getMimetype = function getMimetype2(src) {
  88217. if (src === void 0) {
  88218. src = "";
  88219. }
  88220. var ext = getFileExtension(src);
  88221. var mimetype = MimetypesKind[ext.toLowerCase()];
  88222. return mimetype || "";
  88223. };
  88224. var findMimetype = function findMimetype2(player, src) {
  88225. if (!src) {
  88226. return "";
  88227. }
  88228. if (player.cache_.source.src === src && player.cache_.source.type) {
  88229. return player.cache_.source.type;
  88230. }
  88231. var matchingSources = player.cache_.sources.filter(function(s2) {
  88232. return s2.src === src;
  88233. });
  88234. if (matchingSources.length) {
  88235. return matchingSources[0].type;
  88236. }
  88237. var sources = player.$$("source");
  88238. for (var i2 = 0; i2 < sources.length; i2++) {
  88239. var s = sources[i2];
  88240. if (s.type && s.src && s.src === src) {
  88241. return s.type;
  88242. }
  88243. }
  88244. return getMimetype(src);
  88245. };
  88246. var filterSource = function filterSource2(src) {
  88247. if (Array.isArray(src)) {
  88248. var newsrc = [];
  88249. src.forEach(function(srcobj) {
  88250. srcobj = filterSource2(srcobj);
  88251. if (Array.isArray(srcobj)) {
  88252. newsrc = newsrc.concat(srcobj);
  88253. } else if (isObject2(srcobj)) {
  88254. newsrc.push(srcobj);
  88255. }
  88256. });
  88257. src = newsrc;
  88258. } else if (typeof src === "string" && src.trim()) {
  88259. src = [fixSource({
  88260. src
  88261. })];
  88262. } else if (isObject2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  88263. src = [fixSource(src)];
  88264. } else {
  88265. src = [];
  88266. }
  88267. return src;
  88268. };
  88269. function fixSource(src) {
  88270. if (!src.type) {
  88271. var mimetype = getMimetype(src.src);
  88272. if (mimetype) {
  88273. src.type = mimetype;
  88274. }
  88275. }
  88276. return src;
  88277. }
  88278. var MediaLoader = /* @__PURE__ */ function(_Component) {
  88279. _inheritsLoose(MediaLoader2, _Component);
  88280. function MediaLoader2(player, options2, ready) {
  88281. var _this;
  88282. var options_ = mergeOptions$3({
  88283. createEl: false
  88284. }, options2);
  88285. _this = _Component.call(this, player, options_, ready) || this;
  88286. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  88287. for (var i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  88288. var techName = toTitleCase$1(j[i2]);
  88289. var tech = Tech$1.getTech(techName);
  88290. if (!techName) {
  88291. tech = Component$1.getComponent(techName);
  88292. }
  88293. if (tech && tech.isSupported()) {
  88294. player.loadTech_(techName);
  88295. break;
  88296. }
  88297. }
  88298. } else {
  88299. player.src(options2.playerOptions.sources);
  88300. }
  88301. return _this;
  88302. }
  88303. return MediaLoader2;
  88304. }(Component$1);
  88305. Component$1.registerComponent("MediaLoader", MediaLoader);
  88306. var ClickableComponent = /* @__PURE__ */ function(_Component) {
  88307. _inheritsLoose(ClickableComponent2, _Component);
  88308. function ClickableComponent2(player, options2) {
  88309. var _this;
  88310. _this = _Component.call(this, player, options2) || this;
  88311. if (_this.options_.controlText) {
  88312. _this.controlText(_this.options_.controlText);
  88313. }
  88314. _this.handleMouseOver_ = function(e) {
  88315. return _this.handleMouseOver(e);
  88316. };
  88317. _this.handleMouseOut_ = function(e) {
  88318. return _this.handleMouseOut(e);
  88319. };
  88320. _this.handleClick_ = function(e) {
  88321. return _this.handleClick(e);
  88322. };
  88323. _this.handleKeyDown_ = function(e) {
  88324. return _this.handleKeyDown(e);
  88325. };
  88326. _this.emitTapEvents();
  88327. _this.enable();
  88328. return _this;
  88329. }
  88330. var _proto = ClickableComponent2.prototype;
  88331. _proto.createEl = function createEl$12(tag, props, attributes) {
  88332. if (tag === void 0) {
  88333. tag = "div";
  88334. }
  88335. if (props === void 0) {
  88336. props = {};
  88337. }
  88338. if (attributes === void 0) {
  88339. attributes = {};
  88340. }
  88341. props = assign({
  88342. className: this.buildCSSClass(),
  88343. tabIndex: 0
  88344. }, props);
  88345. if (tag === "button") {
  88346. log$1.error("Creating a ClickableComponent with an HTML element of " + tag + " is not supported; use a Button instead.");
  88347. }
  88348. attributes = assign({
  88349. role: "button"
  88350. }, attributes);
  88351. this.tabIndex_ = props.tabIndex;
  88352. var el = createEl(tag, props, attributes);
  88353. el.appendChild(createEl("span", {
  88354. className: "vjs-icon-placeholder"
  88355. }, {
  88356. "aria-hidden": true
  88357. }));
  88358. this.createControlTextEl(el);
  88359. return el;
  88360. };
  88361. _proto.dispose = function dispose() {
  88362. this.controlTextEl_ = null;
  88363. _Component.prototype.dispose.call(this);
  88364. };
  88365. _proto.createControlTextEl = function createControlTextEl(el) {
  88366. this.controlTextEl_ = createEl("span", {
  88367. className: "vjs-control-text"
  88368. }, {
  88369. "aria-live": "polite"
  88370. });
  88371. if (el) {
  88372. el.appendChild(this.controlTextEl_);
  88373. }
  88374. this.controlText(this.controlText_, el);
  88375. return this.controlTextEl_;
  88376. };
  88377. _proto.controlText = function controlText(text, el) {
  88378. if (el === void 0) {
  88379. el = this.el();
  88380. }
  88381. if (text === void 0) {
  88382. return this.controlText_ || "Need Text";
  88383. }
  88384. var localizedText = this.localize(text);
  88385. this.controlText_ = text;
  88386. textContent(this.controlTextEl_, localizedText);
  88387. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  88388. el.setAttribute("title", localizedText);
  88389. }
  88390. };
  88391. _proto.buildCSSClass = function buildCSSClass() {
  88392. return "vjs-control vjs-button " + _Component.prototype.buildCSSClass.call(this);
  88393. };
  88394. _proto.enable = function enable() {
  88395. if (!this.enabled_) {
  88396. this.enabled_ = true;
  88397. this.removeClass("vjs-disabled");
  88398. this.el_.setAttribute("aria-disabled", "false");
  88399. if (typeof this.tabIndex_ !== "undefined") {
  88400. this.el_.setAttribute("tabIndex", this.tabIndex_);
  88401. }
  88402. this.on(["tap", "click"], this.handleClick_);
  88403. this.on("keydown", this.handleKeyDown_);
  88404. }
  88405. };
  88406. _proto.disable = function disable() {
  88407. this.enabled_ = false;
  88408. this.addClass("vjs-disabled");
  88409. this.el_.setAttribute("aria-disabled", "true");
  88410. if (typeof this.tabIndex_ !== "undefined") {
  88411. this.el_.removeAttribute("tabIndex");
  88412. }
  88413. this.off("mouseover", this.handleMouseOver_);
  88414. this.off("mouseout", this.handleMouseOut_);
  88415. this.off(["tap", "click"], this.handleClick_);
  88416. this.off("keydown", this.handleKeyDown_);
  88417. };
  88418. _proto.handleLanguagechange = function handleLanguagechange() {
  88419. this.controlText(this.controlText_);
  88420. };
  88421. _proto.handleClick = function handleClick(event2) {
  88422. if (this.options_.clickHandler) {
  88423. this.options_.clickHandler.call(this, arguments);
  88424. }
  88425. };
  88426. _proto.handleKeyDown = function handleKeyDown(event2) {
  88427. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88428. event2.preventDefault();
  88429. event2.stopPropagation();
  88430. this.trigger("click");
  88431. } else {
  88432. _Component.prototype.handleKeyDown.call(this, event2);
  88433. }
  88434. };
  88435. return ClickableComponent2;
  88436. }(Component$1);
  88437. Component$1.registerComponent("ClickableComponent", ClickableComponent);
  88438. var PosterImage = /* @__PURE__ */ function(_ClickableComponent) {
  88439. _inheritsLoose(PosterImage2, _ClickableComponent);
  88440. function PosterImage2(player, options2) {
  88441. var _this;
  88442. _this = _ClickableComponent.call(this, player, options2) || this;
  88443. _this.update();
  88444. _this.update_ = function(e) {
  88445. return _this.update(e);
  88446. };
  88447. player.on("posterchange", _this.update_);
  88448. return _this;
  88449. }
  88450. var _proto = PosterImage2.prototype;
  88451. _proto.dispose = function dispose() {
  88452. this.player().off("posterchange", this.update_);
  88453. _ClickableComponent.prototype.dispose.call(this);
  88454. };
  88455. _proto.createEl = function createEl$12() {
  88456. var el = createEl("div", {
  88457. className: "vjs-poster",
  88458. tabIndex: -1
  88459. });
  88460. return el;
  88461. };
  88462. _proto.update = function update(event2) {
  88463. var url = this.player().poster();
  88464. this.setSrc(url);
  88465. if (url) {
  88466. this.show();
  88467. } else {
  88468. this.hide();
  88469. }
  88470. };
  88471. _proto.setSrc = function setSrc(url) {
  88472. var backgroundImage = "";
  88473. if (url) {
  88474. backgroundImage = 'url("' + url + '")';
  88475. }
  88476. this.el_.style.backgroundImage = backgroundImage;
  88477. };
  88478. _proto.handleClick = function handleClick(event2) {
  88479. if (!this.player_.controls()) {
  88480. return;
  88481. }
  88482. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88483. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88484. this.player_.tech(true).focus();
  88485. }
  88486. if (this.player_.paused()) {
  88487. silencePromise(this.player_.play());
  88488. } else {
  88489. this.player_.pause();
  88490. }
  88491. };
  88492. return PosterImage2;
  88493. }(ClickableComponent);
  88494. Component$1.registerComponent("PosterImage", PosterImage);
  88495. var darkGray = "#222";
  88496. var lightGray = "#ccc";
  88497. var fontMap = {
  88498. monospace: "monospace",
  88499. sansSerif: "sans-serif",
  88500. serif: "serif",
  88501. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  88502. monospaceSerif: '"Courier New", monospace',
  88503. proportionalSansSerif: "sans-serif",
  88504. proportionalSerif: "serif",
  88505. casual: '"Comic Sans MS", Impact, fantasy',
  88506. script: '"Monotype Corsiva", cursive',
  88507. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  88508. };
  88509. function constructColor(color2, opacity) {
  88510. var hex;
  88511. if (color2.length === 4) {
  88512. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  88513. } else if (color2.length === 7) {
  88514. hex = color2.slice(1);
  88515. } else {
  88516. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  88517. }
  88518. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  88519. }
  88520. function tryUpdateStyle(el, style, rule) {
  88521. try {
  88522. el.style[style] = rule;
  88523. } catch (e) {
  88524. return;
  88525. }
  88526. }
  88527. var TextTrackDisplay = /* @__PURE__ */ function(_Component) {
  88528. _inheritsLoose(TextTrackDisplay2, _Component);
  88529. function TextTrackDisplay2(player, options2, ready) {
  88530. var _this;
  88531. _this = _Component.call(this, player, options2, ready) || this;
  88532. var updateDisplayHandler = function updateDisplayHandler2(e) {
  88533. return _this.updateDisplay(e);
  88534. };
  88535. player.on("loadstart", function(e) {
  88536. return _this.toggleDisplay(e);
  88537. });
  88538. player.on("texttrackchange", updateDisplayHandler);
  88539. player.on("loadedmetadata", function(e) {
  88540. return _this.preselectTrack(e);
  88541. });
  88542. player.ready(bind(_assertThisInitialized(_this), function() {
  88543. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  88544. this.hide();
  88545. return;
  88546. }
  88547. player.on("fullscreenchange", updateDisplayHandler);
  88548. player.on("playerresize", updateDisplayHandler);
  88549. window_1.addEventListener("orientationchange", updateDisplayHandler);
  88550. player.on("dispose", function() {
  88551. return window_1.removeEventListener("orientationchange", updateDisplayHandler);
  88552. });
  88553. var tracks = this.options_.playerOptions.tracks || [];
  88554. for (var i2 = 0; i2 < tracks.length; i2++) {
  88555. this.player_.addRemoteTextTrack(tracks[i2], true);
  88556. }
  88557. this.preselectTrack();
  88558. }));
  88559. return _this;
  88560. }
  88561. var _proto = TextTrackDisplay2.prototype;
  88562. _proto.preselectTrack = function preselectTrack() {
  88563. var modes = {
  88564. captions: 1,
  88565. subtitles: 1
  88566. };
  88567. var trackList = this.player_.textTracks();
  88568. var userPref = this.player_.cache_.selectedLanguage;
  88569. var firstDesc;
  88570. var firstCaptions;
  88571. var preferredTrack;
  88572. for (var i2 = 0; i2 < trackList.length; i2++) {
  88573. var track = trackList[i2];
  88574. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  88575. if (track.kind === userPref.kind) {
  88576. preferredTrack = track;
  88577. } else if (!preferredTrack) {
  88578. preferredTrack = track;
  88579. }
  88580. } else if (userPref && !userPref.enabled) {
  88581. preferredTrack = null;
  88582. firstDesc = null;
  88583. firstCaptions = null;
  88584. } else if (track["default"]) {
  88585. if (track.kind === "descriptions" && !firstDesc) {
  88586. firstDesc = track;
  88587. } else if (track.kind in modes && !firstCaptions) {
  88588. firstCaptions = track;
  88589. }
  88590. }
  88591. }
  88592. if (preferredTrack) {
  88593. preferredTrack.mode = "showing";
  88594. } else if (firstCaptions) {
  88595. firstCaptions.mode = "showing";
  88596. } else if (firstDesc) {
  88597. firstDesc.mode = "showing";
  88598. }
  88599. };
  88600. _proto.toggleDisplay = function toggleDisplay() {
  88601. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  88602. this.hide();
  88603. } else {
  88604. this.show();
  88605. }
  88606. };
  88607. _proto.createEl = function createEl2() {
  88608. return _Component.prototype.createEl.call(this, "div", {
  88609. className: "vjs-text-track-display"
  88610. }, {
  88611. "translate": "yes",
  88612. "aria-live": "off",
  88613. "aria-atomic": "true"
  88614. });
  88615. };
  88616. _proto.clearDisplay = function clearDisplay() {
  88617. if (typeof window_1.WebVTT === "function") {
  88618. window_1.WebVTT.processCues(window_1, [], this.el_);
  88619. }
  88620. };
  88621. _proto.updateDisplay = function updateDisplay() {
  88622. var tracks = this.player_.textTracks();
  88623. var allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  88624. this.clearDisplay();
  88625. if (allowMultipleShowingTracks) {
  88626. var showingTracks = [];
  88627. for (var _i = 0; _i < tracks.length; ++_i) {
  88628. var track = tracks[_i];
  88629. if (track.mode !== "showing") {
  88630. continue;
  88631. }
  88632. showingTracks.push(track);
  88633. }
  88634. this.updateForTrack(showingTracks);
  88635. return;
  88636. }
  88637. var descriptionsTrack = null;
  88638. var captionsSubtitlesTrack = null;
  88639. var i2 = tracks.length;
  88640. while (i2--) {
  88641. var _track = tracks[i2];
  88642. if (_track.mode === "showing") {
  88643. if (_track.kind === "descriptions") {
  88644. descriptionsTrack = _track;
  88645. } else {
  88646. captionsSubtitlesTrack = _track;
  88647. }
  88648. }
  88649. }
  88650. if (captionsSubtitlesTrack) {
  88651. if (this.getAttribute("aria-live") !== "off") {
  88652. this.setAttribute("aria-live", "off");
  88653. }
  88654. this.updateForTrack(captionsSubtitlesTrack);
  88655. } else if (descriptionsTrack) {
  88656. if (this.getAttribute("aria-live") !== "assertive") {
  88657. this.setAttribute("aria-live", "assertive");
  88658. }
  88659. this.updateForTrack(descriptionsTrack);
  88660. }
  88661. };
  88662. _proto.updateDisplayState = function updateDisplayState(track) {
  88663. var overrides = this.player_.textTrackSettings.getValues();
  88664. var cues = track.activeCues;
  88665. var i2 = cues.length;
  88666. while (i2--) {
  88667. var cue = cues[i2];
  88668. if (!cue) {
  88669. continue;
  88670. }
  88671. var cueDiv = cue.displayState;
  88672. if (overrides.color) {
  88673. cueDiv.firstChild.style.color = overrides.color;
  88674. }
  88675. if (overrides.textOpacity) {
  88676. tryUpdateStyle(cueDiv.firstChild, "color", constructColor(overrides.color || "#fff", overrides.textOpacity));
  88677. }
  88678. if (overrides.backgroundColor) {
  88679. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  88680. }
  88681. if (overrides.backgroundOpacity) {
  88682. tryUpdateStyle(cueDiv.firstChild, "backgroundColor", constructColor(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  88683. }
  88684. if (overrides.windowColor) {
  88685. if (overrides.windowOpacity) {
  88686. tryUpdateStyle(cueDiv, "backgroundColor", constructColor(overrides.windowColor, overrides.windowOpacity));
  88687. } else {
  88688. cueDiv.style.backgroundColor = overrides.windowColor;
  88689. }
  88690. }
  88691. if (overrides.edgeStyle) {
  88692. if (overrides.edgeStyle === "dropshadow") {
  88693. cueDiv.firstChild.style.textShadow = "2px 2px 3px " + darkGray + ", 2px 2px 4px " + darkGray + ", 2px 2px 5px " + darkGray;
  88694. } else if (overrides.edgeStyle === "raised") {
  88695. cueDiv.firstChild.style.textShadow = "1px 1px " + darkGray + ", 2px 2px " + darkGray + ", 3px 3px " + darkGray;
  88696. } else if (overrides.edgeStyle === "depressed") {
  88697. cueDiv.firstChild.style.textShadow = "1px 1px " + lightGray + ", 0 1px " + lightGray + ", -1px -1px " + darkGray + ", 0 -1px " + darkGray;
  88698. } else if (overrides.edgeStyle === "uniform") {
  88699. cueDiv.firstChild.style.textShadow = "0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray;
  88700. }
  88701. }
  88702. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  88703. var fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  88704. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  88705. cueDiv.style.height = "auto";
  88706. cueDiv.style.top = "auto";
  88707. }
  88708. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  88709. if (overrides.fontFamily === "small-caps") {
  88710. cueDiv.firstChild.style.fontVariant = "small-caps";
  88711. } else {
  88712. cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];
  88713. }
  88714. }
  88715. }
  88716. };
  88717. _proto.updateForTrack = function updateForTrack(tracks) {
  88718. if (!Array.isArray(tracks)) {
  88719. tracks = [tracks];
  88720. }
  88721. if (typeof window_1.WebVTT !== "function" || tracks.every(function(track2) {
  88722. return !track2.activeCues;
  88723. })) {
  88724. return;
  88725. }
  88726. var cues = [];
  88727. for (var i2 = 0; i2 < tracks.length; ++i2) {
  88728. var track = tracks[i2];
  88729. for (var j = 0; j < track.activeCues.length; ++j) {
  88730. cues.push(track.activeCues[j]);
  88731. }
  88732. }
  88733. window_1.WebVTT.processCues(window_1, cues, this.el_);
  88734. for (var _i2 = 0; _i2 < tracks.length; ++_i2) {
  88735. var _track2 = tracks[_i2];
  88736. for (var _j = 0; _j < _track2.activeCues.length; ++_j) {
  88737. var cueEl = _track2.activeCues[_j].displayState;
  88738. addClass(cueEl, "vjs-text-track-cue");
  88739. addClass(cueEl, "vjs-text-track-cue-" + (_track2.language ? _track2.language : _i2));
  88740. if (_track2.language) {
  88741. setAttribute(cueEl, "lang", _track2.language);
  88742. }
  88743. }
  88744. if (this.player_.textTrackSettings) {
  88745. this.updateDisplayState(_track2);
  88746. }
  88747. }
  88748. };
  88749. return TextTrackDisplay2;
  88750. }(Component$1);
  88751. Component$1.registerComponent("TextTrackDisplay", TextTrackDisplay);
  88752. var LoadingSpinner = /* @__PURE__ */ function(_Component) {
  88753. _inheritsLoose(LoadingSpinner2, _Component);
  88754. function LoadingSpinner2() {
  88755. return _Component.apply(this, arguments) || this;
  88756. }
  88757. var _proto = LoadingSpinner2.prototype;
  88758. _proto.createEl = function createEl$12() {
  88759. var isAudio = this.player_.isAudio();
  88760. var playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  88761. var controlText = createEl("span", {
  88762. className: "vjs-control-text",
  88763. textContent: this.localize("{1} is loading.", [playerType])
  88764. });
  88765. var el = _Component.prototype.createEl.call(this, "div", {
  88766. className: "vjs-loading-spinner",
  88767. dir: "ltr"
  88768. });
  88769. el.appendChild(controlText);
  88770. return el;
  88771. };
  88772. return LoadingSpinner2;
  88773. }(Component$1);
  88774. Component$1.registerComponent("LoadingSpinner", LoadingSpinner);
  88775. var Button = /* @__PURE__ */ function(_ClickableComponent) {
  88776. _inheritsLoose(Button2, _ClickableComponent);
  88777. function Button2() {
  88778. return _ClickableComponent.apply(this, arguments) || this;
  88779. }
  88780. var _proto = Button2.prototype;
  88781. _proto.createEl = function createEl$12(tag, props, attributes) {
  88782. if (props === void 0) {
  88783. props = {};
  88784. }
  88785. if (attributes === void 0) {
  88786. attributes = {};
  88787. }
  88788. tag = "button";
  88789. props = assign({
  88790. className: this.buildCSSClass()
  88791. }, props);
  88792. attributes = assign({
  88793. type: "button"
  88794. }, attributes);
  88795. var el = createEl(tag, props, attributes);
  88796. el.appendChild(createEl("span", {
  88797. className: "vjs-icon-placeholder"
  88798. }, {
  88799. "aria-hidden": true
  88800. }));
  88801. this.createControlTextEl(el);
  88802. return el;
  88803. };
  88804. _proto.addChild = function addChild(child, options2) {
  88805. if (options2 === void 0) {
  88806. options2 = {};
  88807. }
  88808. var className = this.constructor.name;
  88809. log$1.warn("Adding an actionable (user controllable) child to a Button (" + className + ") is not supported; use a ClickableComponent instead.");
  88810. return Component$1.prototype.addChild.call(this, child, options2);
  88811. };
  88812. _proto.enable = function enable() {
  88813. _ClickableComponent.prototype.enable.call(this);
  88814. this.el_.removeAttribute("disabled");
  88815. };
  88816. _proto.disable = function disable() {
  88817. _ClickableComponent.prototype.disable.call(this);
  88818. this.el_.setAttribute("disabled", "disabled");
  88819. };
  88820. _proto.handleKeyDown = function handleKeyDown(event2) {
  88821. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88822. event2.stopPropagation();
  88823. return;
  88824. }
  88825. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  88826. };
  88827. return Button2;
  88828. }(ClickableComponent);
  88829. Component$1.registerComponent("Button", Button);
  88830. var BigPlayButton = /* @__PURE__ */ function(_Button) {
  88831. _inheritsLoose(BigPlayButton2, _Button);
  88832. function BigPlayButton2(player, options2) {
  88833. var _this;
  88834. _this = _Button.call(this, player, options2) || this;
  88835. _this.mouseused_ = false;
  88836. _this.on("mousedown", function(e) {
  88837. return _this.handleMouseDown(e);
  88838. });
  88839. return _this;
  88840. }
  88841. var _proto = BigPlayButton2.prototype;
  88842. _proto.buildCSSClass = function buildCSSClass() {
  88843. return "vjs-big-play-button";
  88844. };
  88845. _proto.handleClick = function handleClick(event2) {
  88846. var playPromise = this.player_.play();
  88847. if (this.mouseused_ && event2.clientX && event2.clientY) {
  88848. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88849. silencePromise(playPromise);
  88850. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88851. this.player_.tech(true).focus();
  88852. }
  88853. return;
  88854. }
  88855. var cb = this.player_.getChild("controlBar");
  88856. var playToggle = cb && cb.getChild("playToggle");
  88857. if (!playToggle) {
  88858. this.player_.tech(true).focus();
  88859. return;
  88860. }
  88861. var playFocus = function playFocus2() {
  88862. return playToggle.focus();
  88863. };
  88864. if (isPromise(playPromise)) {
  88865. playPromise.then(playFocus, function() {
  88866. });
  88867. } else {
  88868. this.setTimeout(playFocus, 1);
  88869. }
  88870. };
  88871. _proto.handleKeyDown = function handleKeyDown(event2) {
  88872. this.mouseused_ = false;
  88873. _Button.prototype.handleKeyDown.call(this, event2);
  88874. };
  88875. _proto.handleMouseDown = function handleMouseDown(event2) {
  88876. this.mouseused_ = true;
  88877. };
  88878. return BigPlayButton2;
  88879. }(Button);
  88880. BigPlayButton.prototype.controlText_ = "Play Video";
  88881. Component$1.registerComponent("BigPlayButton", BigPlayButton);
  88882. var CloseButton = /* @__PURE__ */ function(_Button) {
  88883. _inheritsLoose(CloseButton2, _Button);
  88884. function CloseButton2(player, options2) {
  88885. var _this;
  88886. _this = _Button.call(this, player, options2) || this;
  88887. _this.controlText(options2 && options2.controlText || _this.localize("Close"));
  88888. return _this;
  88889. }
  88890. var _proto = CloseButton2.prototype;
  88891. _proto.buildCSSClass = function buildCSSClass() {
  88892. return "vjs-close-button " + _Button.prototype.buildCSSClass.call(this);
  88893. };
  88894. _proto.handleClick = function handleClick(event2) {
  88895. this.trigger({
  88896. type: "close",
  88897. bubbles: false
  88898. });
  88899. };
  88900. _proto.handleKeyDown = function handleKeyDown(event2) {
  88901. if (keycode.isEventKey(event2, "Esc")) {
  88902. event2.preventDefault();
  88903. event2.stopPropagation();
  88904. this.trigger("click");
  88905. } else {
  88906. _Button.prototype.handleKeyDown.call(this, event2);
  88907. }
  88908. };
  88909. return CloseButton2;
  88910. }(Button);
  88911. Component$1.registerComponent("CloseButton", CloseButton);
  88912. var PlayToggle = /* @__PURE__ */ function(_Button) {
  88913. _inheritsLoose(PlayToggle2, _Button);
  88914. function PlayToggle2(player, options2) {
  88915. var _this;
  88916. if (options2 === void 0) {
  88917. options2 = {};
  88918. }
  88919. _this = _Button.call(this, player, options2) || this;
  88920. options2.replay = options2.replay === void 0 || options2.replay;
  88921. _this.on(player, "play", function(e) {
  88922. return _this.handlePlay(e);
  88923. });
  88924. _this.on(player, "pause", function(e) {
  88925. return _this.handlePause(e);
  88926. });
  88927. if (options2.replay) {
  88928. _this.on(player, "ended", function(e) {
  88929. return _this.handleEnded(e);
  88930. });
  88931. }
  88932. return _this;
  88933. }
  88934. var _proto = PlayToggle2.prototype;
  88935. _proto.buildCSSClass = function buildCSSClass() {
  88936. return "vjs-play-control " + _Button.prototype.buildCSSClass.call(this);
  88937. };
  88938. _proto.handleClick = function handleClick(event2) {
  88939. if (this.player_.paused()) {
  88940. silencePromise(this.player_.play());
  88941. } else {
  88942. this.player_.pause();
  88943. }
  88944. };
  88945. _proto.handleSeeked = function handleSeeked(event2) {
  88946. this.removeClass("vjs-ended");
  88947. if (this.player_.paused()) {
  88948. this.handlePause(event2);
  88949. } else {
  88950. this.handlePlay(event2);
  88951. }
  88952. };
  88953. _proto.handlePlay = function handlePlay(event2) {
  88954. this.removeClass("vjs-ended");
  88955. this.removeClass("vjs-paused");
  88956. this.addClass("vjs-playing");
  88957. this.controlText("Pause");
  88958. };
  88959. _proto.handlePause = function handlePause(event2) {
  88960. this.removeClass("vjs-playing");
  88961. this.addClass("vjs-paused");
  88962. this.controlText("Play");
  88963. };
  88964. _proto.handleEnded = function handleEnded(event2) {
  88965. var _this2 = this;
  88966. this.removeClass("vjs-playing");
  88967. this.addClass("vjs-ended");
  88968. this.controlText("Replay");
  88969. this.one(this.player_, "seeked", function(e) {
  88970. return _this2.handleSeeked(e);
  88971. });
  88972. };
  88973. return PlayToggle2;
  88974. }(Button);
  88975. PlayToggle.prototype.controlText_ = "Play";
  88976. Component$1.registerComponent("PlayToggle", PlayToggle);
  88977. var defaultImplementation = function defaultImplementation2(seconds, guide) {
  88978. seconds = seconds < 0 ? 0 : seconds;
  88979. var s = Math.floor(seconds % 60);
  88980. var m = Math.floor(seconds / 60 % 60);
  88981. var h2 = Math.floor(seconds / 3600);
  88982. var gm = Math.floor(guide / 60 % 60);
  88983. var gh = Math.floor(guide / 3600);
  88984. if (isNaN(seconds) || seconds === Infinity) {
  88985. h2 = m = s = "-";
  88986. }
  88987. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  88988. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  88989. s = s < 10 ? "0" + s : s;
  88990. return h2 + m + s;
  88991. };
  88992. var implementation = defaultImplementation;
  88993. function setFormatTime(customImplementation) {
  88994. implementation = customImplementation;
  88995. }
  88996. function resetFormatTime() {
  88997. implementation = defaultImplementation;
  88998. }
  88999. function formatTime(seconds, guide) {
  89000. if (guide === void 0) {
  89001. guide = seconds;
  89002. }
  89003. return implementation(seconds, guide);
  89004. }
  89005. var TimeDisplay = /* @__PURE__ */ function(_Component) {
  89006. _inheritsLoose(TimeDisplay2, _Component);
  89007. function TimeDisplay2(player, options2) {
  89008. var _this;
  89009. _this = _Component.call(this, player, options2) || this;
  89010. _this.on(player, ["timeupdate", "ended"], function(e) {
  89011. return _this.updateContent(e);
  89012. });
  89013. _this.updateTextNode_();
  89014. return _this;
  89015. }
  89016. var _proto = TimeDisplay2.prototype;
  89017. _proto.createEl = function createEl$12() {
  89018. var className = this.buildCSSClass();
  89019. var el = _Component.prototype.createEl.call(this, "div", {
  89020. className: className + " vjs-time-control vjs-control"
  89021. });
  89022. var span = createEl("span", {
  89023. className: "vjs-control-text",
  89024. textContent: this.localize(this.labelText_) + "\xA0"
  89025. }, {
  89026. role: "presentation"
  89027. });
  89028. el.appendChild(span);
  89029. this.contentEl_ = createEl("span", {
  89030. className: className + "-display"
  89031. }, {
  89032. "aria-live": "off",
  89033. "role": "presentation"
  89034. });
  89035. el.appendChild(this.contentEl_);
  89036. return el;
  89037. };
  89038. _proto.dispose = function dispose() {
  89039. this.contentEl_ = null;
  89040. this.textNode_ = null;
  89041. _Component.prototype.dispose.call(this);
  89042. };
  89043. _proto.updateTextNode_ = function updateTextNode_(time) {
  89044. var _this2 = this;
  89045. if (time === void 0) {
  89046. time = 0;
  89047. }
  89048. time = formatTime(time);
  89049. if (this.formattedTime_ === time) {
  89050. return;
  89051. }
  89052. this.formattedTime_ = time;
  89053. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", function() {
  89054. if (!_this2.contentEl_) {
  89055. return;
  89056. }
  89057. var oldNode = _this2.textNode_;
  89058. if (oldNode && _this2.contentEl_.firstChild !== oldNode) {
  89059. oldNode = null;
  89060. log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  89061. }
  89062. _this2.textNode_ = document_1.createTextNode(_this2.formattedTime_);
  89063. if (!_this2.textNode_) {
  89064. return;
  89065. }
  89066. if (oldNode) {
  89067. _this2.contentEl_.replaceChild(_this2.textNode_, oldNode);
  89068. } else {
  89069. _this2.contentEl_.appendChild(_this2.textNode_);
  89070. }
  89071. });
  89072. };
  89073. _proto.updateContent = function updateContent(event2) {
  89074. };
  89075. return TimeDisplay2;
  89076. }(Component$1);
  89077. TimeDisplay.prototype.labelText_ = "Time";
  89078. TimeDisplay.prototype.controlText_ = "Time";
  89079. Component$1.registerComponent("TimeDisplay", TimeDisplay);
  89080. var CurrentTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89081. _inheritsLoose(CurrentTimeDisplay2, _TimeDisplay);
  89082. function CurrentTimeDisplay2() {
  89083. return _TimeDisplay.apply(this, arguments) || this;
  89084. }
  89085. var _proto = CurrentTimeDisplay2.prototype;
  89086. _proto.buildCSSClass = function buildCSSClass() {
  89087. return "vjs-current-time";
  89088. };
  89089. _proto.updateContent = function updateContent(event2) {
  89090. var time;
  89091. if (this.player_.ended()) {
  89092. time = this.player_.duration();
  89093. } else {
  89094. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89095. }
  89096. this.updateTextNode_(time);
  89097. };
  89098. return CurrentTimeDisplay2;
  89099. }(TimeDisplay);
  89100. CurrentTimeDisplay.prototype.labelText_ = "Current Time";
  89101. CurrentTimeDisplay.prototype.controlText_ = "Current Time";
  89102. Component$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay);
  89103. var DurationDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89104. _inheritsLoose(DurationDisplay2, _TimeDisplay);
  89105. function DurationDisplay2(player, options2) {
  89106. var _this;
  89107. _this = _TimeDisplay.call(this, player, options2) || this;
  89108. var updateContent = function updateContent2(e) {
  89109. return _this.updateContent(e);
  89110. };
  89111. _this.on(player, "durationchange", updateContent);
  89112. _this.on(player, "loadstart", updateContent);
  89113. _this.on(player, "loadedmetadata", updateContent);
  89114. return _this;
  89115. }
  89116. var _proto = DurationDisplay2.prototype;
  89117. _proto.buildCSSClass = function buildCSSClass() {
  89118. return "vjs-duration";
  89119. };
  89120. _proto.updateContent = function updateContent(event2) {
  89121. var duration5 = this.player_.duration();
  89122. this.updateTextNode_(duration5);
  89123. };
  89124. return DurationDisplay2;
  89125. }(TimeDisplay);
  89126. DurationDisplay.prototype.labelText_ = "Duration";
  89127. DurationDisplay.prototype.controlText_ = "Duration";
  89128. Component$1.registerComponent("DurationDisplay", DurationDisplay);
  89129. var TimeDivider = /* @__PURE__ */ function(_Component) {
  89130. _inheritsLoose(TimeDivider2, _Component);
  89131. function TimeDivider2() {
  89132. return _Component.apply(this, arguments) || this;
  89133. }
  89134. var _proto = TimeDivider2.prototype;
  89135. _proto.createEl = function createEl2() {
  89136. var el = _Component.prototype.createEl.call(this, "div", {
  89137. className: "vjs-time-control vjs-time-divider"
  89138. }, {
  89139. "aria-hidden": true
  89140. });
  89141. var div = _Component.prototype.createEl.call(this, "div");
  89142. var span = _Component.prototype.createEl.call(this, "span", {
  89143. textContent: "/"
  89144. });
  89145. div.appendChild(span);
  89146. el.appendChild(div);
  89147. return el;
  89148. };
  89149. return TimeDivider2;
  89150. }(Component$1);
  89151. Component$1.registerComponent("TimeDivider", TimeDivider);
  89152. var RemainingTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89153. _inheritsLoose(RemainingTimeDisplay2, _TimeDisplay);
  89154. function RemainingTimeDisplay2(player, options2) {
  89155. var _this;
  89156. _this = _TimeDisplay.call(this, player, options2) || this;
  89157. _this.on(player, "durationchange", function(e) {
  89158. return _this.updateContent(e);
  89159. });
  89160. return _this;
  89161. }
  89162. var _proto = RemainingTimeDisplay2.prototype;
  89163. _proto.buildCSSClass = function buildCSSClass() {
  89164. return "vjs-remaining-time";
  89165. };
  89166. _proto.createEl = function createEl$12() {
  89167. var el = _TimeDisplay.prototype.createEl.call(this);
  89168. if (this.options_.displayNegative !== false) {
  89169. el.insertBefore(createEl("span", {}, {
  89170. "aria-hidden": true
  89171. }, "-"), this.contentEl_);
  89172. }
  89173. return el;
  89174. };
  89175. _proto.updateContent = function updateContent(event2) {
  89176. if (typeof this.player_.duration() !== "number") {
  89177. return;
  89178. }
  89179. var time;
  89180. if (this.player_.ended()) {
  89181. time = 0;
  89182. } else if (this.player_.remainingTimeDisplay) {
  89183. time = this.player_.remainingTimeDisplay();
  89184. } else {
  89185. time = this.player_.remainingTime();
  89186. }
  89187. this.updateTextNode_(time);
  89188. };
  89189. return RemainingTimeDisplay2;
  89190. }(TimeDisplay);
  89191. RemainingTimeDisplay.prototype.labelText_ = "Remaining Time";
  89192. RemainingTimeDisplay.prototype.controlText_ = "Remaining Time";
  89193. Component$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay);
  89194. var LiveDisplay = /* @__PURE__ */ function(_Component) {
  89195. _inheritsLoose(LiveDisplay2, _Component);
  89196. function LiveDisplay2(player, options2) {
  89197. var _this;
  89198. _this = _Component.call(this, player, options2) || this;
  89199. _this.updateShowing();
  89200. _this.on(_this.player(), "durationchange", function(e) {
  89201. return _this.updateShowing(e);
  89202. });
  89203. return _this;
  89204. }
  89205. var _proto = LiveDisplay2.prototype;
  89206. _proto.createEl = function createEl$12() {
  89207. var el = _Component.prototype.createEl.call(this, "div", {
  89208. className: "vjs-live-control vjs-control"
  89209. });
  89210. this.contentEl_ = createEl("div", {
  89211. className: "vjs-live-display"
  89212. }, {
  89213. "aria-live": "off"
  89214. });
  89215. this.contentEl_.appendChild(createEl("span", {
  89216. className: "vjs-control-text",
  89217. textContent: this.localize("Stream Type") + "\xA0"
  89218. }));
  89219. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  89220. el.appendChild(this.contentEl_);
  89221. return el;
  89222. };
  89223. _proto.dispose = function dispose() {
  89224. this.contentEl_ = null;
  89225. _Component.prototype.dispose.call(this);
  89226. };
  89227. _proto.updateShowing = function updateShowing(event2) {
  89228. if (this.player().duration() === Infinity) {
  89229. this.show();
  89230. } else {
  89231. this.hide();
  89232. }
  89233. };
  89234. return LiveDisplay2;
  89235. }(Component$1);
  89236. Component$1.registerComponent("LiveDisplay", LiveDisplay);
  89237. var SeekToLive = /* @__PURE__ */ function(_Button) {
  89238. _inheritsLoose(SeekToLive2, _Button);
  89239. function SeekToLive2(player, options2) {
  89240. var _this;
  89241. _this = _Button.call(this, player, options2) || this;
  89242. _this.updateLiveEdgeStatus();
  89243. if (_this.player_.liveTracker) {
  89244. _this.updateLiveEdgeStatusHandler_ = function(e) {
  89245. return _this.updateLiveEdgeStatus(e);
  89246. };
  89247. _this.on(_this.player_.liveTracker, "liveedgechange", _this.updateLiveEdgeStatusHandler_);
  89248. }
  89249. return _this;
  89250. }
  89251. var _proto = SeekToLive2.prototype;
  89252. _proto.createEl = function createEl$12() {
  89253. var el = _Button.prototype.createEl.call(this, "button", {
  89254. className: "vjs-seek-to-live-control vjs-control"
  89255. });
  89256. this.textEl_ = createEl("span", {
  89257. className: "vjs-seek-to-live-text",
  89258. textContent: this.localize("LIVE")
  89259. }, {
  89260. "aria-hidden": "true"
  89261. });
  89262. el.appendChild(this.textEl_);
  89263. return el;
  89264. };
  89265. _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() {
  89266. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  89267. this.setAttribute("aria-disabled", true);
  89268. this.addClass("vjs-at-live-edge");
  89269. this.controlText("Seek to live, currently playing live");
  89270. } else {
  89271. this.setAttribute("aria-disabled", false);
  89272. this.removeClass("vjs-at-live-edge");
  89273. this.controlText("Seek to live, currently behind live");
  89274. }
  89275. };
  89276. _proto.handleClick = function handleClick() {
  89277. this.player_.liveTracker.seekToLiveEdge();
  89278. };
  89279. _proto.dispose = function dispose() {
  89280. if (this.player_.liveTracker) {
  89281. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  89282. }
  89283. this.textEl_ = null;
  89284. _Button.prototype.dispose.call(this);
  89285. };
  89286. return SeekToLive2;
  89287. }(Button);
  89288. SeekToLive.prototype.controlText_ = "Seek to live, currently playing live";
  89289. Component$1.registerComponent("SeekToLive", SeekToLive);
  89290. var clamp = function clamp2(number, min2, max2) {
  89291. number = Number(number);
  89292. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  89293. };
  89294. var Slider = /* @__PURE__ */ function(_Component) {
  89295. _inheritsLoose(Slider2, _Component);
  89296. function Slider2(player, options2) {
  89297. var _this;
  89298. _this = _Component.call(this, player, options2) || this;
  89299. _this.handleMouseDown_ = function(e) {
  89300. return _this.handleMouseDown(e);
  89301. };
  89302. _this.handleMouseUp_ = function(e) {
  89303. return _this.handleMouseUp(e);
  89304. };
  89305. _this.handleKeyDown_ = function(e) {
  89306. return _this.handleKeyDown(e);
  89307. };
  89308. _this.handleClick_ = function(e) {
  89309. return _this.handleClick(e);
  89310. };
  89311. _this.handleMouseMove_ = function(e) {
  89312. return _this.handleMouseMove(e);
  89313. };
  89314. _this.update_ = function(e) {
  89315. return _this.update(e);
  89316. };
  89317. _this.bar = _this.getChild(_this.options_.barName);
  89318. _this.vertical(!!_this.options_.vertical);
  89319. _this.enable();
  89320. return _this;
  89321. }
  89322. var _proto = Slider2.prototype;
  89323. _proto.enabled = function enabled() {
  89324. return this.enabled_;
  89325. };
  89326. _proto.enable = function enable() {
  89327. if (this.enabled()) {
  89328. return;
  89329. }
  89330. this.on("mousedown", this.handleMouseDown_);
  89331. this.on("touchstart", this.handleMouseDown_);
  89332. this.on("keydown", this.handleKeyDown_);
  89333. this.on("click", this.handleClick_);
  89334. this.on(this.player_, "controlsvisible", this.update);
  89335. if (this.playerEvent) {
  89336. this.on(this.player_, this.playerEvent, this.update);
  89337. }
  89338. this.removeClass("disabled");
  89339. this.setAttribute("tabindex", 0);
  89340. this.enabled_ = true;
  89341. };
  89342. _proto.disable = function disable() {
  89343. if (!this.enabled()) {
  89344. return;
  89345. }
  89346. var doc = this.bar.el_.ownerDocument;
  89347. this.off("mousedown", this.handleMouseDown_);
  89348. this.off("touchstart", this.handleMouseDown_);
  89349. this.off("keydown", this.handleKeyDown_);
  89350. this.off("click", this.handleClick_);
  89351. this.off(this.player_, "controlsvisible", this.update_);
  89352. this.off(doc, "mousemove", this.handleMouseMove_);
  89353. this.off(doc, "mouseup", this.handleMouseUp_);
  89354. this.off(doc, "touchmove", this.handleMouseMove_);
  89355. this.off(doc, "touchend", this.handleMouseUp_);
  89356. this.removeAttribute("tabindex");
  89357. this.addClass("disabled");
  89358. if (this.playerEvent) {
  89359. this.off(this.player_, this.playerEvent, this.update);
  89360. }
  89361. this.enabled_ = false;
  89362. };
  89363. _proto.createEl = function createEl2(type2, props, attributes) {
  89364. if (props === void 0) {
  89365. props = {};
  89366. }
  89367. if (attributes === void 0) {
  89368. attributes = {};
  89369. }
  89370. props.className = props.className + " vjs-slider";
  89371. props = assign({
  89372. tabIndex: 0
  89373. }, props);
  89374. attributes = assign({
  89375. "role": "slider",
  89376. "aria-valuenow": 0,
  89377. "aria-valuemin": 0,
  89378. "aria-valuemax": 100,
  89379. "tabIndex": 0
  89380. }, attributes);
  89381. return _Component.prototype.createEl.call(this, type2, props, attributes);
  89382. };
  89383. _proto.handleMouseDown = function handleMouseDown(event2) {
  89384. var doc = this.bar.el_.ownerDocument;
  89385. if (event2.type === "mousedown") {
  89386. event2.preventDefault();
  89387. }
  89388. if (event2.type === "touchstart" && !IS_CHROME) {
  89389. event2.preventDefault();
  89390. }
  89391. blockTextSelection();
  89392. this.addClass("vjs-sliding");
  89393. this.trigger("slideractive");
  89394. this.on(doc, "mousemove", this.handleMouseMove_);
  89395. this.on(doc, "mouseup", this.handleMouseUp_);
  89396. this.on(doc, "touchmove", this.handleMouseMove_);
  89397. this.on(doc, "touchend", this.handleMouseUp_);
  89398. this.handleMouseMove(event2, true);
  89399. };
  89400. _proto.handleMouseMove = function handleMouseMove(event2) {
  89401. };
  89402. _proto.handleMouseUp = function handleMouseUp() {
  89403. var doc = this.bar.el_.ownerDocument;
  89404. unblockTextSelection();
  89405. this.removeClass("vjs-sliding");
  89406. this.trigger("sliderinactive");
  89407. this.off(doc, "mousemove", this.handleMouseMove_);
  89408. this.off(doc, "mouseup", this.handleMouseUp_);
  89409. this.off(doc, "touchmove", this.handleMouseMove_);
  89410. this.off(doc, "touchend", this.handleMouseUp_);
  89411. this.update();
  89412. };
  89413. _proto.update = function update() {
  89414. var _this2 = this;
  89415. if (!this.el_ || !this.bar) {
  89416. return;
  89417. }
  89418. var progress = this.getProgress();
  89419. if (progress === this.progress_) {
  89420. return progress;
  89421. }
  89422. this.progress_ = progress;
  89423. this.requestNamedAnimationFrame("Slider#update", function() {
  89424. var sizeKey = _this2.vertical() ? "height" : "width";
  89425. _this2.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  89426. });
  89427. return progress;
  89428. };
  89429. _proto.getProgress = function getProgress() {
  89430. return Number(clamp(this.getPercent(), 0, 1).toFixed(4));
  89431. };
  89432. _proto.calculateDistance = function calculateDistance(event2) {
  89433. var position2 = getPointerPosition(this.el_, event2);
  89434. if (this.vertical()) {
  89435. return position2.y;
  89436. }
  89437. return position2.x;
  89438. };
  89439. _proto.handleKeyDown = function handleKeyDown(event2) {
  89440. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  89441. event2.preventDefault();
  89442. event2.stopPropagation();
  89443. this.stepBack();
  89444. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  89445. event2.preventDefault();
  89446. event2.stopPropagation();
  89447. this.stepForward();
  89448. } else {
  89449. _Component.prototype.handleKeyDown.call(this, event2);
  89450. }
  89451. };
  89452. _proto.handleClick = function handleClick(event2) {
  89453. event2.stopPropagation();
  89454. event2.preventDefault();
  89455. };
  89456. _proto.vertical = function vertical(bool) {
  89457. if (bool === void 0) {
  89458. return this.vertical_ || false;
  89459. }
  89460. this.vertical_ = !!bool;
  89461. if (this.vertical_) {
  89462. this.addClass("vjs-slider-vertical");
  89463. } else {
  89464. this.addClass("vjs-slider-horizontal");
  89465. }
  89466. };
  89467. return Slider2;
  89468. }(Component$1);
  89469. Component$1.registerComponent("Slider", Slider);
  89470. var percentify = function percentify2(time, end) {
  89471. return clamp(time / end * 100, 0, 100).toFixed(2) + "%";
  89472. };
  89473. var LoadProgressBar = /* @__PURE__ */ function(_Component) {
  89474. _inheritsLoose(LoadProgressBar2, _Component);
  89475. function LoadProgressBar2(player, options2) {
  89476. var _this;
  89477. _this = _Component.call(this, player, options2) || this;
  89478. _this.partEls_ = [];
  89479. _this.on(player, "progress", function(e) {
  89480. return _this.update(e);
  89481. });
  89482. return _this;
  89483. }
  89484. var _proto = LoadProgressBar2.prototype;
  89485. _proto.createEl = function createEl$12() {
  89486. var el = _Component.prototype.createEl.call(this, "div", {
  89487. className: "vjs-load-progress"
  89488. });
  89489. var wrapper = createEl("span", {
  89490. className: "vjs-control-text"
  89491. });
  89492. var loadedText = createEl("span", {
  89493. textContent: this.localize("Loaded")
  89494. });
  89495. var separator = document_1.createTextNode(": ");
  89496. this.percentageEl_ = createEl("span", {
  89497. className: "vjs-control-text-loaded-percentage",
  89498. textContent: "0%"
  89499. });
  89500. el.appendChild(wrapper);
  89501. wrapper.appendChild(loadedText);
  89502. wrapper.appendChild(separator);
  89503. wrapper.appendChild(this.percentageEl_);
  89504. return el;
  89505. };
  89506. _proto.dispose = function dispose() {
  89507. this.partEls_ = null;
  89508. this.percentageEl_ = null;
  89509. _Component.prototype.dispose.call(this);
  89510. };
  89511. _proto.update = function update(event2) {
  89512. var _this2 = this;
  89513. this.requestNamedAnimationFrame("LoadProgressBar#update", function() {
  89514. var liveTracker = _this2.player_.liveTracker;
  89515. var buffered = _this2.player_.buffered();
  89516. var duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration();
  89517. var bufferedEnd = _this2.player_.bufferedEnd();
  89518. var children = _this2.partEls_;
  89519. var percent = percentify(bufferedEnd, duration5);
  89520. if (_this2.percent_ !== percent) {
  89521. _this2.el_.style.width = percent;
  89522. textContent(_this2.percentageEl_, percent);
  89523. _this2.percent_ = percent;
  89524. }
  89525. for (var i2 = 0; i2 < buffered.length; i2++) {
  89526. var start2 = buffered.start(i2);
  89527. var end = buffered.end(i2);
  89528. var part = children[i2];
  89529. if (!part) {
  89530. part = _this2.el_.appendChild(createEl());
  89531. children[i2] = part;
  89532. }
  89533. if (part.dataset.start === start2 && part.dataset.end === end) {
  89534. continue;
  89535. }
  89536. part.dataset.start = start2;
  89537. part.dataset.end = end;
  89538. part.style.left = percentify(start2, bufferedEnd);
  89539. part.style.width = percentify(end - start2, bufferedEnd);
  89540. }
  89541. for (var _i = children.length; _i > buffered.length; _i--) {
  89542. _this2.el_.removeChild(children[_i - 1]);
  89543. }
  89544. children.length = buffered.length;
  89545. });
  89546. };
  89547. return LoadProgressBar2;
  89548. }(Component$1);
  89549. Component$1.registerComponent("LoadProgressBar", LoadProgressBar);
  89550. var TimeTooltip = /* @__PURE__ */ function(_Component) {
  89551. _inheritsLoose(TimeTooltip2, _Component);
  89552. function TimeTooltip2(player, options2) {
  89553. var _this;
  89554. _this = _Component.call(this, player, options2) || this;
  89555. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89556. return _this;
  89557. }
  89558. var _proto = TimeTooltip2.prototype;
  89559. _proto.createEl = function createEl2() {
  89560. return _Component.prototype.createEl.call(this, "div", {
  89561. className: "vjs-time-tooltip"
  89562. }, {
  89563. "aria-hidden": "true"
  89564. });
  89565. };
  89566. _proto.update = function update(seekBarRect, seekBarPoint, content) {
  89567. var tooltipRect = findPosition(this.el_);
  89568. var playerRect = getBoundingClientRect(this.player_.el());
  89569. var seekBarPointPx = seekBarRect.width * seekBarPoint;
  89570. if (!playerRect || !tooltipRect) {
  89571. return;
  89572. }
  89573. var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  89574. var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  89575. var pullTooltipBy = tooltipRect.width / 2;
  89576. if (spaceLeftOfPoint < pullTooltipBy) {
  89577. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  89578. } else if (spaceRightOfPoint < pullTooltipBy) {
  89579. pullTooltipBy = spaceRightOfPoint;
  89580. }
  89581. if (pullTooltipBy < 0) {
  89582. pullTooltipBy = 0;
  89583. } else if (pullTooltipBy > tooltipRect.width) {
  89584. pullTooltipBy = tooltipRect.width;
  89585. }
  89586. pullTooltipBy = Math.round(pullTooltipBy);
  89587. this.el_.style.right = "-" + pullTooltipBy + "px";
  89588. this.write(content);
  89589. };
  89590. _proto.write = function write(content) {
  89591. textContent(this.el_, content);
  89592. };
  89593. _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {
  89594. var _this2 = this;
  89595. this.requestNamedAnimationFrame("TimeTooltip#updateTime", function() {
  89596. var content;
  89597. var duration5 = _this2.player_.duration();
  89598. if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive()) {
  89599. var liveWindow = _this2.player_.liveTracker.liveWindow();
  89600. var secondsBehind = liveWindow - seekBarPoint * liveWindow;
  89601. content = (secondsBehind < 1 ? "" : "-") + formatTime(secondsBehind, liveWindow);
  89602. } else {
  89603. content = formatTime(time, duration5);
  89604. }
  89605. _this2.update(seekBarRect, seekBarPoint, content);
  89606. if (cb) {
  89607. cb();
  89608. }
  89609. });
  89610. };
  89611. return TimeTooltip2;
  89612. }(Component$1);
  89613. Component$1.registerComponent("TimeTooltip", TimeTooltip);
  89614. var PlayProgressBar = /* @__PURE__ */ function(_Component) {
  89615. _inheritsLoose(PlayProgressBar2, _Component);
  89616. function PlayProgressBar2(player, options2) {
  89617. var _this;
  89618. _this = _Component.call(this, player, options2) || this;
  89619. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89620. return _this;
  89621. }
  89622. var _proto = PlayProgressBar2.prototype;
  89623. _proto.createEl = function createEl2() {
  89624. return _Component.prototype.createEl.call(this, "div", {
  89625. className: "vjs-play-progress vjs-slider-bar"
  89626. }, {
  89627. "aria-hidden": "true"
  89628. });
  89629. };
  89630. _proto.update = function update(seekBarRect, seekBarPoint) {
  89631. var timeTooltip = this.getChild("timeTooltip");
  89632. if (!timeTooltip) {
  89633. return;
  89634. }
  89635. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89636. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  89637. };
  89638. return PlayProgressBar2;
  89639. }(Component$1);
  89640. PlayProgressBar.prototype.options_ = {
  89641. children: []
  89642. };
  89643. if (!IS_IOS && !IS_ANDROID) {
  89644. PlayProgressBar.prototype.options_.children.push("timeTooltip");
  89645. }
  89646. Component$1.registerComponent("PlayProgressBar", PlayProgressBar);
  89647. var MouseTimeDisplay = /* @__PURE__ */ function(_Component) {
  89648. _inheritsLoose(MouseTimeDisplay2, _Component);
  89649. function MouseTimeDisplay2(player, options2) {
  89650. var _this;
  89651. _this = _Component.call(this, player, options2) || this;
  89652. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89653. return _this;
  89654. }
  89655. var _proto = MouseTimeDisplay2.prototype;
  89656. _proto.createEl = function createEl2() {
  89657. return _Component.prototype.createEl.call(this, "div", {
  89658. className: "vjs-mouse-display"
  89659. });
  89660. };
  89661. _proto.update = function update(seekBarRect, seekBarPoint) {
  89662. var _this2 = this;
  89663. var time = seekBarPoint * this.player_.duration();
  89664. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, function() {
  89665. _this2.el_.style.left = seekBarRect.width * seekBarPoint + "px";
  89666. });
  89667. };
  89668. return MouseTimeDisplay2;
  89669. }(Component$1);
  89670. MouseTimeDisplay.prototype.options_ = {
  89671. children: ["timeTooltip"]
  89672. };
  89673. Component$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay);
  89674. var STEP_SECONDS = 5;
  89675. var PAGE_KEY_MULTIPLIER = 12;
  89676. var SeekBar = /* @__PURE__ */ function(_Slider) {
  89677. _inheritsLoose(SeekBar2, _Slider);
  89678. function SeekBar2(player, options2) {
  89679. var _this;
  89680. _this = _Slider.call(this, player, options2) || this;
  89681. _this.setEventHandlers_();
  89682. return _this;
  89683. }
  89684. var _proto = SeekBar2.prototype;
  89685. _proto.setEventHandlers_ = function setEventHandlers_() {
  89686. var _this2 = this;
  89687. this.update_ = bind(this, this.update);
  89688. this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);
  89689. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89690. if (this.player_.liveTracker) {
  89691. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  89692. }
  89693. this.updateInterval = null;
  89694. this.enableIntervalHandler_ = function(e) {
  89695. return _this2.enableInterval_(e);
  89696. };
  89697. this.disableIntervalHandler_ = function(e) {
  89698. return _this2.disableInterval_(e);
  89699. };
  89700. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  89701. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89702. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89703. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  89704. }
  89705. };
  89706. _proto.toggleVisibility_ = function toggleVisibility_(e) {
  89707. if (document_1.visibilityState === "hidden") {
  89708. this.cancelNamedAnimationFrame("SeekBar#update");
  89709. this.cancelNamedAnimationFrame("Slider#update");
  89710. this.disableInterval_(e);
  89711. } else {
  89712. if (!this.player_.ended() && !this.player_.paused()) {
  89713. this.enableInterval_();
  89714. }
  89715. this.update();
  89716. }
  89717. };
  89718. _proto.enableInterval_ = function enableInterval_() {
  89719. if (this.updateInterval) {
  89720. return;
  89721. }
  89722. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);
  89723. };
  89724. _proto.disableInterval_ = function disableInterval_(e) {
  89725. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  89726. return;
  89727. }
  89728. if (!this.updateInterval) {
  89729. return;
  89730. }
  89731. this.clearInterval(this.updateInterval);
  89732. this.updateInterval = null;
  89733. };
  89734. _proto.createEl = function createEl2() {
  89735. return _Slider.prototype.createEl.call(this, "div", {
  89736. className: "vjs-progress-holder"
  89737. }, {
  89738. "aria-label": this.localize("Progress Bar")
  89739. });
  89740. };
  89741. _proto.update = function update(event2) {
  89742. var _this3 = this;
  89743. if (document_1.visibilityState === "hidden") {
  89744. return;
  89745. }
  89746. var percent = _Slider.prototype.update.call(this);
  89747. this.requestNamedAnimationFrame("SeekBar#update", function() {
  89748. var currentTime = _this3.player_.ended() ? _this3.player_.duration() : _this3.getCurrentTime_();
  89749. var liveTracker = _this3.player_.liveTracker;
  89750. var duration5 = _this3.player_.duration();
  89751. if (liveTracker && liveTracker.isLive()) {
  89752. duration5 = _this3.player_.liveTracker.liveCurrentTime();
  89753. }
  89754. if (_this3.percent_ !== percent) {
  89755. _this3.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  89756. _this3.percent_ = percent;
  89757. }
  89758. if (_this3.currentTime_ !== currentTime || _this3.duration_ !== duration5) {
  89759. _this3.el_.setAttribute("aria-valuetext", _this3.localize("progress bar timing: currentTime={1} duration={2}", [formatTime(currentTime, duration5), formatTime(duration5, duration5)], "{1} of {2}"));
  89760. _this3.currentTime_ = currentTime;
  89761. _this3.duration_ = duration5;
  89762. }
  89763. if (_this3.bar) {
  89764. _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress());
  89765. }
  89766. });
  89767. return percent;
  89768. };
  89769. _proto.userSeek_ = function userSeek_(ct2) {
  89770. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  89771. this.player_.liveTracker.nextSeekedFromUser();
  89772. }
  89773. this.player_.currentTime(ct2);
  89774. };
  89775. _proto.getCurrentTime_ = function getCurrentTime_() {
  89776. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89777. };
  89778. _proto.getPercent = function getPercent() {
  89779. var currentTime = this.getCurrentTime_();
  89780. var percent;
  89781. var liveTracker = this.player_.liveTracker;
  89782. if (liveTracker && liveTracker.isLive()) {
  89783. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  89784. if (liveTracker.atLiveEdge()) {
  89785. percent = 1;
  89786. }
  89787. } else {
  89788. percent = currentTime / this.player_.duration();
  89789. }
  89790. return percent;
  89791. };
  89792. _proto.handleMouseDown = function handleMouseDown(event2) {
  89793. if (!isSingleLeftClick(event2)) {
  89794. return;
  89795. }
  89796. event2.stopPropagation();
  89797. this.videoWasPlaying = !this.player_.paused();
  89798. this.player_.pause();
  89799. _Slider.prototype.handleMouseDown.call(this, event2);
  89800. };
  89801. _proto.handleMouseMove = function handleMouseMove(event2, mouseDown) {
  89802. if (mouseDown === void 0) {
  89803. mouseDown = false;
  89804. }
  89805. if (!isSingleLeftClick(event2)) {
  89806. return;
  89807. }
  89808. if (!mouseDown && !this.player_.scrubbing()) {
  89809. this.player_.scrubbing(true);
  89810. }
  89811. var newTime;
  89812. var distance2 = this.calculateDistance(event2);
  89813. var liveTracker = this.player_.liveTracker;
  89814. if (!liveTracker || !liveTracker.isLive()) {
  89815. newTime = distance2 * this.player_.duration();
  89816. if (newTime === this.player_.duration()) {
  89817. newTime = newTime - 0.1;
  89818. }
  89819. } else {
  89820. if (distance2 >= 0.99) {
  89821. liveTracker.seekToLiveEdge();
  89822. return;
  89823. }
  89824. var seekableStart = liveTracker.seekableStart();
  89825. var seekableEnd = liveTracker.liveCurrentTime();
  89826. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  89827. if (newTime >= seekableEnd) {
  89828. newTime = seekableEnd;
  89829. }
  89830. if (newTime <= seekableStart) {
  89831. newTime = seekableStart + 0.1;
  89832. }
  89833. if (newTime === Infinity) {
  89834. return;
  89835. }
  89836. }
  89837. this.userSeek_(newTime);
  89838. };
  89839. _proto.enable = function enable() {
  89840. _Slider.prototype.enable.call(this);
  89841. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89842. if (!mouseTimeDisplay) {
  89843. return;
  89844. }
  89845. mouseTimeDisplay.show();
  89846. };
  89847. _proto.disable = function disable() {
  89848. _Slider.prototype.disable.call(this);
  89849. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89850. if (!mouseTimeDisplay) {
  89851. return;
  89852. }
  89853. mouseTimeDisplay.hide();
  89854. };
  89855. _proto.handleMouseUp = function handleMouseUp(event2) {
  89856. _Slider.prototype.handleMouseUp.call(this, event2);
  89857. if (event2) {
  89858. event2.stopPropagation();
  89859. }
  89860. this.player_.scrubbing(false);
  89861. this.player_.trigger({
  89862. type: "timeupdate",
  89863. target: this,
  89864. manuallyTriggered: true
  89865. });
  89866. if (this.videoWasPlaying) {
  89867. silencePromise(this.player_.play());
  89868. } else {
  89869. this.update_();
  89870. }
  89871. };
  89872. _proto.stepForward = function stepForward() {
  89873. this.userSeek_(this.player_.currentTime() + STEP_SECONDS);
  89874. };
  89875. _proto.stepBack = function stepBack() {
  89876. this.userSeek_(this.player_.currentTime() - STEP_SECONDS);
  89877. };
  89878. _proto.handleAction = function handleAction(event2) {
  89879. if (this.player_.paused()) {
  89880. this.player_.play();
  89881. } else {
  89882. this.player_.pause();
  89883. }
  89884. };
  89885. _proto.handleKeyDown = function handleKeyDown(event2) {
  89886. var liveTracker = this.player_.liveTracker;
  89887. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  89888. event2.preventDefault();
  89889. event2.stopPropagation();
  89890. this.handleAction(event2);
  89891. } else if (keycode.isEventKey(event2, "Home")) {
  89892. event2.preventDefault();
  89893. event2.stopPropagation();
  89894. this.userSeek_(0);
  89895. } else if (keycode.isEventKey(event2, "End")) {
  89896. event2.preventDefault();
  89897. event2.stopPropagation();
  89898. if (liveTracker && liveTracker.isLive()) {
  89899. this.userSeek_(liveTracker.liveCurrentTime());
  89900. } else {
  89901. this.userSeek_(this.player_.duration());
  89902. }
  89903. } else if (/^[0-9]$/.test(keycode(event2))) {
  89904. event2.preventDefault();
  89905. event2.stopPropagation();
  89906. var gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  89907. if (liveTracker && liveTracker.isLive()) {
  89908. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  89909. } else {
  89910. this.userSeek_(this.player_.duration() * gotoFraction);
  89911. }
  89912. } else if (keycode.isEventKey(event2, "PgDn")) {
  89913. event2.preventDefault();
  89914. event2.stopPropagation();
  89915. this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89916. } else if (keycode.isEventKey(event2, "PgUp")) {
  89917. event2.preventDefault();
  89918. event2.stopPropagation();
  89919. this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89920. } else {
  89921. _Slider.prototype.handleKeyDown.call(this, event2);
  89922. }
  89923. };
  89924. _proto.dispose = function dispose() {
  89925. this.disableInterval_();
  89926. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89927. if (this.player_.liveTracker) {
  89928. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  89929. }
  89930. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  89931. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89932. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89933. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  89934. }
  89935. _Slider.prototype.dispose.call(this);
  89936. };
  89937. return SeekBar2;
  89938. }(Slider);
  89939. SeekBar.prototype.options_ = {
  89940. children: ["loadProgressBar", "playProgressBar"],
  89941. barName: "playProgressBar"
  89942. };
  89943. if (!IS_IOS && !IS_ANDROID) {
  89944. SeekBar.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  89945. }
  89946. Component$1.registerComponent("SeekBar", SeekBar);
  89947. var ProgressControl = /* @__PURE__ */ function(_Component) {
  89948. _inheritsLoose(ProgressControl2, _Component);
  89949. function ProgressControl2(player, options2) {
  89950. var _this;
  89951. _this = _Component.call(this, player, options2) || this;
  89952. _this.handleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  89953. _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_this), _this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);
  89954. _this.handleMouseUpHandler_ = function(e) {
  89955. return _this.handleMouseUp(e);
  89956. };
  89957. _this.handleMouseDownHandler_ = function(e) {
  89958. return _this.handleMouseDown(e);
  89959. };
  89960. _this.enable();
  89961. return _this;
  89962. }
  89963. var _proto = ProgressControl2.prototype;
  89964. _proto.createEl = function createEl2() {
  89965. return _Component.prototype.createEl.call(this, "div", {
  89966. className: "vjs-progress-control vjs-control"
  89967. });
  89968. };
  89969. _proto.handleMouseMove = function handleMouseMove(event2) {
  89970. var seekBar = this.getChild("seekBar");
  89971. if (!seekBar) {
  89972. return;
  89973. }
  89974. var playProgressBar = seekBar.getChild("playProgressBar");
  89975. var mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  89976. if (!playProgressBar && !mouseTimeDisplay) {
  89977. return;
  89978. }
  89979. var seekBarEl = seekBar.el();
  89980. var seekBarRect = findPosition(seekBarEl);
  89981. var seekBarPoint = getPointerPosition(seekBarEl, event2).x;
  89982. seekBarPoint = clamp(seekBarPoint, 0, 1);
  89983. if (mouseTimeDisplay) {
  89984. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  89985. }
  89986. if (playProgressBar) {
  89987. playProgressBar.update(seekBarRect, seekBar.getProgress());
  89988. }
  89989. };
  89990. _proto.handleMouseSeek = function handleMouseSeek(event2) {
  89991. var seekBar = this.getChild("seekBar");
  89992. if (seekBar) {
  89993. seekBar.handleMouseMove(event2);
  89994. }
  89995. };
  89996. _proto.enabled = function enabled() {
  89997. return this.enabled_;
  89998. };
  89999. _proto.disable = function disable() {
  90000. this.children().forEach(function(child) {
  90001. return child.disable && child.disable();
  90002. });
  90003. if (!this.enabled()) {
  90004. return;
  90005. }
  90006. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  90007. this.off(this.el_, "mousemove", this.handleMouseMove);
  90008. this.removeListenersAddedOnMousedownAndTouchstart();
  90009. this.addClass("disabled");
  90010. this.enabled_ = false;
  90011. if (this.player_.scrubbing()) {
  90012. var seekBar = this.getChild("seekBar");
  90013. this.player_.scrubbing(false);
  90014. if (seekBar.videoWasPlaying) {
  90015. silencePromise(this.player_.play());
  90016. }
  90017. }
  90018. };
  90019. _proto.enable = function enable() {
  90020. this.children().forEach(function(child) {
  90021. return child.enable && child.enable();
  90022. });
  90023. if (this.enabled()) {
  90024. return;
  90025. }
  90026. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  90027. this.on(this.el_, "mousemove", this.handleMouseMove);
  90028. this.removeClass("disabled");
  90029. this.enabled_ = true;
  90030. };
  90031. _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() {
  90032. var doc = this.el_.ownerDocument;
  90033. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  90034. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  90035. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90036. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90037. };
  90038. _proto.handleMouseDown = function handleMouseDown(event2) {
  90039. var doc = this.el_.ownerDocument;
  90040. var seekBar = this.getChild("seekBar");
  90041. if (seekBar) {
  90042. seekBar.handleMouseDown(event2);
  90043. }
  90044. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  90045. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  90046. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90047. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90048. };
  90049. _proto.handleMouseUp = function handleMouseUp(event2) {
  90050. var seekBar = this.getChild("seekBar");
  90051. if (seekBar) {
  90052. seekBar.handleMouseUp(event2);
  90053. }
  90054. this.removeListenersAddedOnMousedownAndTouchstart();
  90055. };
  90056. return ProgressControl2;
  90057. }(Component$1);
  90058. ProgressControl.prototype.options_ = {
  90059. children: ["seekBar"]
  90060. };
  90061. Component$1.registerComponent("ProgressControl", ProgressControl);
  90062. var PictureInPictureToggle = /* @__PURE__ */ function(_Button) {
  90063. _inheritsLoose(PictureInPictureToggle2, _Button);
  90064. function PictureInPictureToggle2(player, options2) {
  90065. var _this;
  90066. _this = _Button.call(this, player, options2) || this;
  90067. _this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], function(e) {
  90068. return _this.handlePictureInPictureChange(e);
  90069. });
  90070. _this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], function(e) {
  90071. return _this.handlePictureInPictureEnabledChange(e);
  90072. });
  90073. _this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], function() {
  90074. var isSourceAudio = player.currentType().substring(0, 5) === "audio";
  90075. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  90076. if (player.isInPictureInPicture()) {
  90077. player.exitPictureInPicture();
  90078. }
  90079. _this.hide();
  90080. } else {
  90081. _this.show();
  90082. }
  90083. });
  90084. _this.disable();
  90085. return _this;
  90086. }
  90087. var _proto = PictureInPictureToggle2.prototype;
  90088. _proto.buildCSSClass = function buildCSSClass() {
  90089. return "vjs-picture-in-picture-control " + _Button.prototype.buildCSSClass.call(this);
  90090. };
  90091. _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() {
  90092. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false) {
  90093. this.enable();
  90094. } else {
  90095. this.disable();
  90096. }
  90097. };
  90098. _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event2) {
  90099. if (this.player_.isInPictureInPicture()) {
  90100. this.controlText("Exit Picture-in-Picture");
  90101. } else {
  90102. this.controlText("Picture-in-Picture");
  90103. }
  90104. this.handlePictureInPictureEnabledChange();
  90105. };
  90106. _proto.handleClick = function handleClick(event2) {
  90107. if (!this.player_.isInPictureInPicture()) {
  90108. this.player_.requestPictureInPicture();
  90109. } else {
  90110. this.player_.exitPictureInPicture();
  90111. }
  90112. };
  90113. return PictureInPictureToggle2;
  90114. }(Button);
  90115. PictureInPictureToggle.prototype.controlText_ = "Picture-in-Picture";
  90116. Component$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle);
  90117. var FullscreenToggle = /* @__PURE__ */ function(_Button) {
  90118. _inheritsLoose(FullscreenToggle2, _Button);
  90119. function FullscreenToggle2(player, options2) {
  90120. var _this;
  90121. _this = _Button.call(this, player, options2) || this;
  90122. _this.on(player, "fullscreenchange", function(e) {
  90123. return _this.handleFullscreenChange(e);
  90124. });
  90125. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  90126. _this.disable();
  90127. }
  90128. return _this;
  90129. }
  90130. var _proto = FullscreenToggle2.prototype;
  90131. _proto.buildCSSClass = function buildCSSClass() {
  90132. return "vjs-fullscreen-control " + _Button.prototype.buildCSSClass.call(this);
  90133. };
  90134. _proto.handleFullscreenChange = function handleFullscreenChange(event2) {
  90135. if (this.player_.isFullscreen()) {
  90136. this.controlText("Non-Fullscreen");
  90137. } else {
  90138. this.controlText("Fullscreen");
  90139. }
  90140. };
  90141. _proto.handleClick = function handleClick(event2) {
  90142. if (!this.player_.isFullscreen()) {
  90143. this.player_.requestFullscreen();
  90144. } else {
  90145. this.player_.exitFullscreen();
  90146. }
  90147. };
  90148. return FullscreenToggle2;
  90149. }(Button);
  90150. FullscreenToggle.prototype.controlText_ = "Fullscreen";
  90151. Component$1.registerComponent("FullscreenToggle", FullscreenToggle);
  90152. var checkVolumeSupport = function checkVolumeSupport2(self2, player) {
  90153. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  90154. self2.addClass("vjs-hidden");
  90155. }
  90156. self2.on(player, "loadstart", function() {
  90157. if (!player.tech_.featuresVolumeControl) {
  90158. self2.addClass("vjs-hidden");
  90159. } else {
  90160. self2.removeClass("vjs-hidden");
  90161. }
  90162. });
  90163. };
  90164. var VolumeLevel = /* @__PURE__ */ function(_Component) {
  90165. _inheritsLoose(VolumeLevel2, _Component);
  90166. function VolumeLevel2() {
  90167. return _Component.apply(this, arguments) || this;
  90168. }
  90169. var _proto = VolumeLevel2.prototype;
  90170. _proto.createEl = function createEl2() {
  90171. var el = _Component.prototype.createEl.call(this, "div", {
  90172. className: "vjs-volume-level"
  90173. });
  90174. el.appendChild(_Component.prototype.createEl.call(this, "span", {
  90175. className: "vjs-control-text"
  90176. }));
  90177. return el;
  90178. };
  90179. return VolumeLevel2;
  90180. }(Component$1);
  90181. Component$1.registerComponent("VolumeLevel", VolumeLevel);
  90182. var VolumeLevelTooltip = /* @__PURE__ */ function(_Component) {
  90183. _inheritsLoose(VolumeLevelTooltip2, _Component);
  90184. function VolumeLevelTooltip2(player, options2) {
  90185. var _this;
  90186. _this = _Component.call(this, player, options2) || this;
  90187. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90188. return _this;
  90189. }
  90190. var _proto = VolumeLevelTooltip2.prototype;
  90191. _proto.createEl = function createEl2() {
  90192. return _Component.prototype.createEl.call(this, "div", {
  90193. className: "vjs-volume-tooltip"
  90194. }, {
  90195. "aria-hidden": "true"
  90196. });
  90197. };
  90198. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) {
  90199. if (!vertical) {
  90200. var tooltipRect = getBoundingClientRect(this.el_);
  90201. var playerRect = getBoundingClientRect(this.player_.el());
  90202. var volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  90203. if (!playerRect || !tooltipRect) {
  90204. return;
  90205. }
  90206. var spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  90207. var spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  90208. var pullTooltipBy = tooltipRect.width / 2;
  90209. if (spaceLeftOfPoint < pullTooltipBy) {
  90210. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  90211. } else if (spaceRightOfPoint < pullTooltipBy) {
  90212. pullTooltipBy = spaceRightOfPoint;
  90213. }
  90214. if (pullTooltipBy < 0) {
  90215. pullTooltipBy = 0;
  90216. } else if (pullTooltipBy > tooltipRect.width) {
  90217. pullTooltipBy = tooltipRect.width;
  90218. }
  90219. this.el_.style.right = "-" + pullTooltipBy + "px";
  90220. }
  90221. this.write(content + "%");
  90222. };
  90223. _proto.write = function write(content) {
  90224. textContent(this.el_, content);
  90225. };
  90226. _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  90227. var _this2 = this;
  90228. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", function() {
  90229. _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  90230. if (cb) {
  90231. cb();
  90232. }
  90233. });
  90234. };
  90235. return VolumeLevelTooltip2;
  90236. }(Component$1);
  90237. Component$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip);
  90238. var MouseVolumeLevelDisplay = /* @__PURE__ */ function(_Component) {
  90239. _inheritsLoose(MouseVolumeLevelDisplay2, _Component);
  90240. function MouseVolumeLevelDisplay2(player, options2) {
  90241. var _this;
  90242. _this = _Component.call(this, player, options2) || this;
  90243. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90244. return _this;
  90245. }
  90246. var _proto = MouseVolumeLevelDisplay2.prototype;
  90247. _proto.createEl = function createEl2() {
  90248. return _Component.prototype.createEl.call(this, "div", {
  90249. className: "vjs-mouse-display"
  90250. });
  90251. };
  90252. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) {
  90253. var _this2 = this;
  90254. var volume = 100 * rangeBarPoint;
  90255. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function() {
  90256. if (vertical) {
  90257. _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + "px";
  90258. } else {
  90259. _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + "px";
  90260. }
  90261. });
  90262. };
  90263. return MouseVolumeLevelDisplay2;
  90264. }(Component$1);
  90265. MouseVolumeLevelDisplay.prototype.options_ = {
  90266. children: ["volumeLevelTooltip"]
  90267. };
  90268. Component$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay);
  90269. var VolumeBar = /* @__PURE__ */ function(_Slider) {
  90270. _inheritsLoose(VolumeBar2, _Slider);
  90271. function VolumeBar2(player, options2) {
  90272. var _this;
  90273. _this = _Slider.call(this, player, options2) || this;
  90274. _this.on("slideractive", function(e) {
  90275. return _this.updateLastVolume_(e);
  90276. });
  90277. _this.on(player, "volumechange", function(e) {
  90278. return _this.updateARIAAttributes(e);
  90279. });
  90280. player.ready(function() {
  90281. return _this.updateARIAAttributes();
  90282. });
  90283. return _this;
  90284. }
  90285. var _proto = VolumeBar2.prototype;
  90286. _proto.createEl = function createEl2() {
  90287. return _Slider.prototype.createEl.call(this, "div", {
  90288. className: "vjs-volume-bar vjs-slider-bar"
  90289. }, {
  90290. "aria-label": this.localize("Volume Level"),
  90291. "aria-live": "polite"
  90292. });
  90293. };
  90294. _proto.handleMouseDown = function handleMouseDown(event2) {
  90295. if (!isSingleLeftClick(event2)) {
  90296. return;
  90297. }
  90298. _Slider.prototype.handleMouseDown.call(this, event2);
  90299. };
  90300. _proto.handleMouseMove = function handleMouseMove(event2) {
  90301. var mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  90302. if (mouseVolumeLevelDisplay) {
  90303. var volumeBarEl = this.el();
  90304. var volumeBarRect = getBoundingClientRect(volumeBarEl);
  90305. var vertical = this.vertical();
  90306. var volumeBarPoint = getPointerPosition(volumeBarEl, event2);
  90307. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  90308. volumeBarPoint = clamp(volumeBarPoint, 0, 1);
  90309. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  90310. }
  90311. if (!isSingleLeftClick(event2)) {
  90312. return;
  90313. }
  90314. this.checkMuted();
  90315. this.player_.volume(this.calculateDistance(event2));
  90316. };
  90317. _proto.checkMuted = function checkMuted() {
  90318. if (this.player_.muted()) {
  90319. this.player_.muted(false);
  90320. }
  90321. };
  90322. _proto.getPercent = function getPercent() {
  90323. if (this.player_.muted()) {
  90324. return 0;
  90325. }
  90326. return this.player_.volume();
  90327. };
  90328. _proto.stepForward = function stepForward() {
  90329. this.checkMuted();
  90330. this.player_.volume(this.player_.volume() + 0.1);
  90331. };
  90332. _proto.stepBack = function stepBack() {
  90333. this.checkMuted();
  90334. this.player_.volume(this.player_.volume() - 0.1);
  90335. };
  90336. _proto.updateARIAAttributes = function updateARIAAttributes(event2) {
  90337. var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  90338. this.el_.setAttribute("aria-valuenow", ariaValue);
  90339. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  90340. };
  90341. _proto.volumeAsPercentage_ = function volumeAsPercentage_() {
  90342. return Math.round(this.player_.volume() * 100);
  90343. };
  90344. _proto.updateLastVolume_ = function updateLastVolume_() {
  90345. var _this2 = this;
  90346. var volumeBeforeDrag = this.player_.volume();
  90347. this.one("sliderinactive", function() {
  90348. if (_this2.player_.volume() === 0) {
  90349. _this2.player_.lastVolume_(volumeBeforeDrag);
  90350. }
  90351. });
  90352. };
  90353. return VolumeBar2;
  90354. }(Slider);
  90355. VolumeBar.prototype.options_ = {
  90356. children: ["volumeLevel"],
  90357. barName: "volumeLevel"
  90358. };
  90359. if (!IS_IOS && !IS_ANDROID) {
  90360. VolumeBar.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  90361. }
  90362. VolumeBar.prototype.playerEvent = "volumechange";
  90363. Component$1.registerComponent("VolumeBar", VolumeBar);
  90364. var VolumeControl = /* @__PURE__ */ function(_Component) {
  90365. _inheritsLoose(VolumeControl2, _Component);
  90366. function VolumeControl2(player, options2) {
  90367. var _this;
  90368. if (options2 === void 0) {
  90369. options2 = {};
  90370. }
  90371. options2.vertical = options2.vertical || false;
  90372. if (typeof options2.volumeBar === "undefined" || isPlain(options2.volumeBar)) {
  90373. options2.volumeBar = options2.volumeBar || {};
  90374. options2.volumeBar.vertical = options2.vertical;
  90375. }
  90376. _this = _Component.call(this, player, options2) || this;
  90377. checkVolumeSupport(_assertThisInitialized(_this), player);
  90378. _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  90379. _this.handleMouseUpHandler_ = function(e) {
  90380. return _this.handleMouseUp(e);
  90381. };
  90382. _this.on("mousedown", function(e) {
  90383. return _this.handleMouseDown(e);
  90384. });
  90385. _this.on("touchstart", function(e) {
  90386. return _this.handleMouseDown(e);
  90387. });
  90388. _this.on("mousemove", function(e) {
  90389. return _this.handleMouseMove(e);
  90390. });
  90391. _this.on(_this.volumeBar, ["focus", "slideractive"], function() {
  90392. _this.volumeBar.addClass("vjs-slider-active");
  90393. _this.addClass("vjs-slider-active");
  90394. _this.trigger("slideractive");
  90395. });
  90396. _this.on(_this.volumeBar, ["blur", "sliderinactive"], function() {
  90397. _this.volumeBar.removeClass("vjs-slider-active");
  90398. _this.removeClass("vjs-slider-active");
  90399. _this.trigger("sliderinactive");
  90400. });
  90401. return _this;
  90402. }
  90403. var _proto = VolumeControl2.prototype;
  90404. _proto.createEl = function createEl2() {
  90405. var orientationClass = "vjs-volume-horizontal";
  90406. if (this.options_.vertical) {
  90407. orientationClass = "vjs-volume-vertical";
  90408. }
  90409. return _Component.prototype.createEl.call(this, "div", {
  90410. className: "vjs-volume-control vjs-control " + orientationClass
  90411. });
  90412. };
  90413. _proto.handleMouseDown = function handleMouseDown(event2) {
  90414. var doc = this.el_.ownerDocument;
  90415. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  90416. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  90417. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90418. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90419. };
  90420. _proto.handleMouseUp = function handleMouseUp(event2) {
  90421. var doc = this.el_.ownerDocument;
  90422. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  90423. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  90424. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90425. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90426. };
  90427. _proto.handleMouseMove = function handleMouseMove(event2) {
  90428. this.volumeBar.handleMouseMove(event2);
  90429. };
  90430. return VolumeControl2;
  90431. }(Component$1);
  90432. VolumeControl.prototype.options_ = {
  90433. children: ["volumeBar"]
  90434. };
  90435. Component$1.registerComponent("VolumeControl", VolumeControl);
  90436. var checkMuteSupport = function checkMuteSupport2(self2, player) {
  90437. if (player.tech_ && !player.tech_.featuresMuteControl) {
  90438. self2.addClass("vjs-hidden");
  90439. }
  90440. self2.on(player, "loadstart", function() {
  90441. if (!player.tech_.featuresMuteControl) {
  90442. self2.addClass("vjs-hidden");
  90443. } else {
  90444. self2.removeClass("vjs-hidden");
  90445. }
  90446. });
  90447. };
  90448. var MuteToggle = /* @__PURE__ */ function(_Button) {
  90449. _inheritsLoose(MuteToggle2, _Button);
  90450. function MuteToggle2(player, options2) {
  90451. var _this;
  90452. _this = _Button.call(this, player, options2) || this;
  90453. checkMuteSupport(_assertThisInitialized(_this), player);
  90454. _this.on(player, ["loadstart", "volumechange"], function(e) {
  90455. return _this.update(e);
  90456. });
  90457. return _this;
  90458. }
  90459. var _proto = MuteToggle2.prototype;
  90460. _proto.buildCSSClass = function buildCSSClass() {
  90461. return "vjs-mute-control " + _Button.prototype.buildCSSClass.call(this);
  90462. };
  90463. _proto.handleClick = function handleClick(event2) {
  90464. var vol = this.player_.volume();
  90465. var lastVolume = this.player_.lastVolume_();
  90466. if (vol === 0) {
  90467. var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  90468. this.player_.volume(volumeToSet);
  90469. this.player_.muted(false);
  90470. } else {
  90471. this.player_.muted(this.player_.muted() ? false : true);
  90472. }
  90473. };
  90474. _proto.update = function update(event2) {
  90475. this.updateIcon_();
  90476. this.updateControlText_();
  90477. };
  90478. _proto.updateIcon_ = function updateIcon_() {
  90479. var vol = this.player_.volume();
  90480. var level = 3;
  90481. if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {
  90482. this.player_.muted(this.player_.tech_.el_.muted);
  90483. }
  90484. if (vol === 0 || this.player_.muted()) {
  90485. level = 0;
  90486. } else if (vol < 0.33) {
  90487. level = 1;
  90488. } else if (vol < 0.67) {
  90489. level = 2;
  90490. }
  90491. for (var i2 = 0; i2 < 4; i2++) {
  90492. removeClass(this.el_, "vjs-vol-" + i2);
  90493. }
  90494. addClass(this.el_, "vjs-vol-" + level);
  90495. };
  90496. _proto.updateControlText_ = function updateControlText_() {
  90497. var soundOff = this.player_.muted() || this.player_.volume() === 0;
  90498. var text = soundOff ? "Unmute" : "Mute";
  90499. if (this.controlText() !== text) {
  90500. this.controlText(text);
  90501. }
  90502. };
  90503. return MuteToggle2;
  90504. }(Button);
  90505. MuteToggle.prototype.controlText_ = "Mute";
  90506. Component$1.registerComponent("MuteToggle", MuteToggle);
  90507. var VolumePanel = /* @__PURE__ */ function(_Component) {
  90508. _inheritsLoose(VolumePanel2, _Component);
  90509. function VolumePanel2(player, options2) {
  90510. var _this;
  90511. if (options2 === void 0) {
  90512. options2 = {};
  90513. }
  90514. if (typeof options2.inline !== "undefined") {
  90515. options2.inline = options2.inline;
  90516. } else {
  90517. options2.inline = true;
  90518. }
  90519. if (typeof options2.volumeControl === "undefined" || isPlain(options2.volumeControl)) {
  90520. options2.volumeControl = options2.volumeControl || {};
  90521. options2.volumeControl.vertical = !options2.inline;
  90522. }
  90523. _this = _Component.call(this, player, options2) || this;
  90524. _this.handleKeyPressHandler_ = function(e) {
  90525. return _this.handleKeyPress(e);
  90526. };
  90527. _this.on(player, ["loadstart"], function(e) {
  90528. return _this.volumePanelState_(e);
  90529. });
  90530. _this.on(_this.muteToggle, "keyup", function(e) {
  90531. return _this.handleKeyPress(e);
  90532. });
  90533. _this.on(_this.volumeControl, "keyup", function(e) {
  90534. return _this.handleVolumeControlKeyUp(e);
  90535. });
  90536. _this.on("keydown", function(e) {
  90537. return _this.handleKeyPress(e);
  90538. });
  90539. _this.on("mouseover", function(e) {
  90540. return _this.handleMouseOver(e);
  90541. });
  90542. _this.on("mouseout", function(e) {
  90543. return _this.handleMouseOut(e);
  90544. });
  90545. _this.on(_this.volumeControl, ["slideractive"], _this.sliderActive_);
  90546. _this.on(_this.volumeControl, ["sliderinactive"], _this.sliderInactive_);
  90547. return _this;
  90548. }
  90549. var _proto = VolumePanel2.prototype;
  90550. _proto.sliderActive_ = function sliderActive_() {
  90551. this.addClass("vjs-slider-active");
  90552. };
  90553. _proto.sliderInactive_ = function sliderInactive_() {
  90554. this.removeClass("vjs-slider-active");
  90555. };
  90556. _proto.volumePanelState_ = function volumePanelState_() {
  90557. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  90558. this.addClass("vjs-hidden");
  90559. }
  90560. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  90561. this.addClass("vjs-mute-toggle-only");
  90562. }
  90563. };
  90564. _proto.createEl = function createEl2() {
  90565. var orientationClass = "vjs-volume-panel-horizontal";
  90566. if (!this.options_.inline) {
  90567. orientationClass = "vjs-volume-panel-vertical";
  90568. }
  90569. return _Component.prototype.createEl.call(this, "div", {
  90570. className: "vjs-volume-panel vjs-control " + orientationClass
  90571. });
  90572. };
  90573. _proto.dispose = function dispose() {
  90574. this.handleMouseOut();
  90575. _Component.prototype.dispose.call(this);
  90576. };
  90577. _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event2) {
  90578. if (keycode.isEventKey(event2, "Esc")) {
  90579. this.muteToggle.focus();
  90580. }
  90581. };
  90582. _proto.handleMouseOver = function handleMouseOver(event2) {
  90583. this.addClass("vjs-hover");
  90584. on(document_1, "keyup", this.handleKeyPressHandler_);
  90585. };
  90586. _proto.handleMouseOut = function handleMouseOut(event2) {
  90587. this.removeClass("vjs-hover");
  90588. off(document_1, "keyup", this.handleKeyPressHandler_);
  90589. };
  90590. _proto.handleKeyPress = function handleKeyPress(event2) {
  90591. if (keycode.isEventKey(event2, "Esc")) {
  90592. this.handleMouseOut();
  90593. }
  90594. };
  90595. return VolumePanel2;
  90596. }(Component$1);
  90597. VolumePanel.prototype.options_ = {
  90598. children: ["muteToggle", "volumeControl"]
  90599. };
  90600. Component$1.registerComponent("VolumePanel", VolumePanel);
  90601. var Menu = /* @__PURE__ */ function(_Component) {
  90602. _inheritsLoose(Menu2, _Component);
  90603. function Menu2(player, options2) {
  90604. var _this;
  90605. _this = _Component.call(this, player, options2) || this;
  90606. if (options2) {
  90607. _this.menuButton_ = options2.menuButton;
  90608. }
  90609. _this.focusedChild_ = -1;
  90610. _this.on("keydown", function(e) {
  90611. return _this.handleKeyDown(e);
  90612. });
  90613. _this.boundHandleBlur_ = function(e) {
  90614. return _this.handleBlur(e);
  90615. };
  90616. _this.boundHandleTapClick_ = function(e) {
  90617. return _this.handleTapClick(e);
  90618. };
  90619. return _this;
  90620. }
  90621. var _proto = Menu2.prototype;
  90622. _proto.addEventListenerForItem = function addEventListenerForItem(component) {
  90623. if (!(component instanceof Component$1)) {
  90624. return;
  90625. }
  90626. this.on(component, "blur", this.boundHandleBlur_);
  90627. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  90628. };
  90629. _proto.removeEventListenerForItem = function removeEventListenerForItem(component) {
  90630. if (!(component instanceof Component$1)) {
  90631. return;
  90632. }
  90633. this.off(component, "blur", this.boundHandleBlur_);
  90634. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  90635. };
  90636. _proto.removeChild = function removeChild(component) {
  90637. if (typeof component === "string") {
  90638. component = this.getChild(component);
  90639. }
  90640. this.removeEventListenerForItem(component);
  90641. _Component.prototype.removeChild.call(this, component);
  90642. };
  90643. _proto.addItem = function addItem(component) {
  90644. var childComponent = this.addChild(component);
  90645. if (childComponent) {
  90646. this.addEventListenerForItem(childComponent);
  90647. }
  90648. };
  90649. _proto.createEl = function createEl$12() {
  90650. var contentElType = this.options_.contentElType || "ul";
  90651. this.contentEl_ = createEl(contentElType, {
  90652. className: "vjs-menu-content"
  90653. });
  90654. this.contentEl_.setAttribute("role", "menu");
  90655. var el = _Component.prototype.createEl.call(this, "div", {
  90656. append: this.contentEl_,
  90657. className: "vjs-menu"
  90658. });
  90659. el.appendChild(this.contentEl_);
  90660. on(el, "click", function(event2) {
  90661. event2.preventDefault();
  90662. event2.stopImmediatePropagation();
  90663. });
  90664. return el;
  90665. };
  90666. _proto.dispose = function dispose() {
  90667. this.contentEl_ = null;
  90668. this.boundHandleBlur_ = null;
  90669. this.boundHandleTapClick_ = null;
  90670. _Component.prototype.dispose.call(this);
  90671. };
  90672. _proto.handleBlur = function handleBlur(event2) {
  90673. var relatedTarget = event2.relatedTarget || document_1.activeElement;
  90674. if (!this.children().some(function(element) {
  90675. return element.el() === relatedTarget;
  90676. })) {
  90677. var btn = this.menuButton_;
  90678. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  90679. btn.unpressButton();
  90680. }
  90681. }
  90682. };
  90683. _proto.handleTapClick = function handleTapClick(event2) {
  90684. if (this.menuButton_) {
  90685. this.menuButton_.unpressButton();
  90686. var childComponents = this.children();
  90687. if (!Array.isArray(childComponents)) {
  90688. return;
  90689. }
  90690. var foundComponent = childComponents.filter(function(component) {
  90691. return component.el() === event2.target;
  90692. })[0];
  90693. if (!foundComponent) {
  90694. return;
  90695. }
  90696. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  90697. this.menuButton_.focus();
  90698. }
  90699. }
  90700. };
  90701. _proto.handleKeyDown = function handleKeyDown(event2) {
  90702. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  90703. event2.preventDefault();
  90704. event2.stopPropagation();
  90705. this.stepForward();
  90706. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  90707. event2.preventDefault();
  90708. event2.stopPropagation();
  90709. this.stepBack();
  90710. }
  90711. };
  90712. _proto.stepForward = function stepForward() {
  90713. var stepChild = 0;
  90714. if (this.focusedChild_ !== void 0) {
  90715. stepChild = this.focusedChild_ + 1;
  90716. }
  90717. this.focus(stepChild);
  90718. };
  90719. _proto.stepBack = function stepBack() {
  90720. var stepChild = 0;
  90721. if (this.focusedChild_ !== void 0) {
  90722. stepChild = this.focusedChild_ - 1;
  90723. }
  90724. this.focus(stepChild);
  90725. };
  90726. _proto.focus = function focus(item) {
  90727. if (item === void 0) {
  90728. item = 0;
  90729. }
  90730. var children = this.children().slice();
  90731. var haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  90732. if (haveTitle) {
  90733. children.shift();
  90734. }
  90735. if (children.length > 0) {
  90736. if (item < 0) {
  90737. item = 0;
  90738. } else if (item >= children.length) {
  90739. item = children.length - 1;
  90740. }
  90741. this.focusedChild_ = item;
  90742. children[item].el_.focus();
  90743. }
  90744. };
  90745. return Menu2;
  90746. }(Component$1);
  90747. Component$1.registerComponent("Menu", Menu);
  90748. var MenuButton = /* @__PURE__ */ function(_Component) {
  90749. _inheritsLoose(MenuButton2, _Component);
  90750. function MenuButton2(player, options2) {
  90751. var _this;
  90752. if (options2 === void 0) {
  90753. options2 = {};
  90754. }
  90755. _this = _Component.call(this, player, options2) || this;
  90756. _this.menuButton_ = new Button(player, options2);
  90757. _this.menuButton_.controlText(_this.controlText_);
  90758. _this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  90759. var buttonClass = Button.prototype.buildCSSClass();
  90760. _this.menuButton_.el_.className = _this.buildCSSClass() + " " + buttonClass;
  90761. _this.menuButton_.removeClass("vjs-control");
  90762. _this.addChild(_this.menuButton_);
  90763. _this.update();
  90764. _this.enabled_ = true;
  90765. var handleClick = function handleClick2(e) {
  90766. return _this.handleClick(e);
  90767. };
  90768. _this.handleMenuKeyUp_ = function(e) {
  90769. return _this.handleMenuKeyUp(e);
  90770. };
  90771. _this.on(_this.menuButton_, "tap", handleClick);
  90772. _this.on(_this.menuButton_, "click", handleClick);
  90773. _this.on(_this.menuButton_, "keydown", function(e) {
  90774. return _this.handleKeyDown(e);
  90775. });
  90776. _this.on(_this.menuButton_, "mouseenter", function() {
  90777. _this.addClass("vjs-hover");
  90778. _this.menu.show();
  90779. on(document_1, "keyup", _this.handleMenuKeyUp_);
  90780. });
  90781. _this.on("mouseleave", function(e) {
  90782. return _this.handleMouseLeave(e);
  90783. });
  90784. _this.on("keydown", function(e) {
  90785. return _this.handleSubmenuKeyDown(e);
  90786. });
  90787. return _this;
  90788. }
  90789. var _proto = MenuButton2.prototype;
  90790. _proto.update = function update() {
  90791. var menu = this.createMenu();
  90792. if (this.menu) {
  90793. this.menu.dispose();
  90794. this.removeChild(this.menu);
  90795. }
  90796. this.menu = menu;
  90797. this.addChild(menu);
  90798. this.buttonPressed_ = false;
  90799. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90800. if (this.items && this.items.length <= this.hideThreshold_) {
  90801. this.hide();
  90802. this.menu.contentEl_.removeAttribute("role");
  90803. } else {
  90804. this.show();
  90805. this.menu.contentEl_.setAttribute("role", "menu");
  90806. }
  90807. };
  90808. _proto.createMenu = function createMenu() {
  90809. var menu = new Menu(this.player_, {
  90810. menuButton: this
  90811. });
  90812. this.hideThreshold_ = 0;
  90813. if (this.options_.title) {
  90814. var titleEl = createEl("li", {
  90815. className: "vjs-menu-title",
  90816. textContent: toTitleCase$1(this.options_.title),
  90817. tabIndex: -1
  90818. });
  90819. var titleComponent = new Component$1(this.player_, {
  90820. el: titleEl
  90821. });
  90822. menu.addItem(titleComponent);
  90823. }
  90824. this.items = this.createItems();
  90825. if (this.items) {
  90826. for (var i2 = 0; i2 < this.items.length; i2++) {
  90827. menu.addItem(this.items[i2]);
  90828. }
  90829. }
  90830. return menu;
  90831. };
  90832. _proto.createItems = function createItems() {
  90833. };
  90834. _proto.createEl = function createEl2() {
  90835. return _Component.prototype.createEl.call(this, "div", {
  90836. className: this.buildWrapperCSSClass()
  90837. }, {});
  90838. };
  90839. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  90840. var menuButtonClass = "vjs-menu-button";
  90841. if (this.options_.inline === true) {
  90842. menuButtonClass += "-inline";
  90843. } else {
  90844. menuButtonClass += "-popup";
  90845. }
  90846. var buttonClass = Button.prototype.buildCSSClass();
  90847. return "vjs-menu-button " + menuButtonClass + " " + buttonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90848. };
  90849. _proto.buildCSSClass = function buildCSSClass() {
  90850. var menuButtonClass = "vjs-menu-button";
  90851. if (this.options_.inline === true) {
  90852. menuButtonClass += "-inline";
  90853. } else {
  90854. menuButtonClass += "-popup";
  90855. }
  90856. return "vjs-menu-button " + menuButtonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90857. };
  90858. _proto.controlText = function controlText(text, el) {
  90859. if (el === void 0) {
  90860. el = this.menuButton_.el();
  90861. }
  90862. return this.menuButton_.controlText(text, el);
  90863. };
  90864. _proto.dispose = function dispose() {
  90865. this.handleMouseLeave();
  90866. _Component.prototype.dispose.call(this);
  90867. };
  90868. _proto.handleClick = function handleClick(event2) {
  90869. if (this.buttonPressed_) {
  90870. this.unpressButton();
  90871. } else {
  90872. this.pressButton();
  90873. }
  90874. };
  90875. _proto.handleMouseLeave = function handleMouseLeave(event2) {
  90876. this.removeClass("vjs-hover");
  90877. off(document_1, "keyup", this.handleMenuKeyUp_);
  90878. };
  90879. _proto.focus = function focus() {
  90880. this.menuButton_.focus();
  90881. };
  90882. _proto.blur = function blur() {
  90883. this.menuButton_.blur();
  90884. };
  90885. _proto.handleKeyDown = function handleKeyDown(event2) {
  90886. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90887. if (this.buttonPressed_) {
  90888. this.unpressButton();
  90889. }
  90890. if (!keycode.isEventKey(event2, "Tab")) {
  90891. event2.preventDefault();
  90892. this.menuButton_.focus();
  90893. }
  90894. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  90895. if (!this.buttonPressed_) {
  90896. event2.preventDefault();
  90897. this.pressButton();
  90898. }
  90899. }
  90900. };
  90901. _proto.handleMenuKeyUp = function handleMenuKeyUp(event2) {
  90902. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90903. this.removeClass("vjs-hover");
  90904. }
  90905. };
  90906. _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event2) {
  90907. this.handleSubmenuKeyDown(event2);
  90908. };
  90909. _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event2) {
  90910. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90911. if (this.buttonPressed_) {
  90912. this.unpressButton();
  90913. }
  90914. if (!keycode.isEventKey(event2, "Tab")) {
  90915. event2.preventDefault();
  90916. this.menuButton_.focus();
  90917. }
  90918. }
  90919. };
  90920. _proto.pressButton = function pressButton() {
  90921. if (this.enabled_) {
  90922. this.buttonPressed_ = true;
  90923. this.menu.show();
  90924. this.menu.lockShowing();
  90925. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  90926. if (IS_IOS && isInFrame()) {
  90927. return;
  90928. }
  90929. this.menu.focus();
  90930. }
  90931. };
  90932. _proto.unpressButton = function unpressButton() {
  90933. if (this.enabled_) {
  90934. this.buttonPressed_ = false;
  90935. this.menu.unlockShowing();
  90936. this.menu.hide();
  90937. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90938. }
  90939. };
  90940. _proto.disable = function disable() {
  90941. this.unpressButton();
  90942. this.enabled_ = false;
  90943. this.addClass("vjs-disabled");
  90944. this.menuButton_.disable();
  90945. };
  90946. _proto.enable = function enable() {
  90947. this.enabled_ = true;
  90948. this.removeClass("vjs-disabled");
  90949. this.menuButton_.enable();
  90950. };
  90951. return MenuButton2;
  90952. }(Component$1);
  90953. Component$1.registerComponent("MenuButton", MenuButton);
  90954. var TrackButton = /* @__PURE__ */ function(_MenuButton) {
  90955. _inheritsLoose(TrackButton2, _MenuButton);
  90956. function TrackButton2(player, options2) {
  90957. var _this;
  90958. var tracks = options2.tracks;
  90959. _this = _MenuButton.call(this, player, options2) || this;
  90960. if (_this.items.length <= 1) {
  90961. _this.hide();
  90962. }
  90963. if (!tracks) {
  90964. return _assertThisInitialized(_this);
  90965. }
  90966. var updateHandler = bind(_assertThisInitialized(_this), _this.update);
  90967. tracks.addEventListener("removetrack", updateHandler);
  90968. tracks.addEventListener("addtrack", updateHandler);
  90969. tracks.addEventListener("labelchange", updateHandler);
  90970. _this.player_.on("ready", updateHandler);
  90971. _this.player_.on("dispose", function() {
  90972. tracks.removeEventListener("removetrack", updateHandler);
  90973. tracks.removeEventListener("addtrack", updateHandler);
  90974. tracks.removeEventListener("labelchange", updateHandler);
  90975. });
  90976. return _this;
  90977. }
  90978. return TrackButton2;
  90979. }(MenuButton);
  90980. Component$1.registerComponent("TrackButton", TrackButton);
  90981. var MenuKeys = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  90982. var MenuItem = /* @__PURE__ */ function(_ClickableComponent) {
  90983. _inheritsLoose(MenuItem2, _ClickableComponent);
  90984. function MenuItem2(player, options2) {
  90985. var _this;
  90986. _this = _ClickableComponent.call(this, player, options2) || this;
  90987. _this.selectable = options2.selectable;
  90988. _this.isSelected_ = options2.selected || false;
  90989. _this.multiSelectable = options2.multiSelectable;
  90990. _this.selected(_this.isSelected_);
  90991. if (_this.selectable) {
  90992. if (_this.multiSelectable) {
  90993. _this.el_.setAttribute("role", "menuitemcheckbox");
  90994. } else {
  90995. _this.el_.setAttribute("role", "menuitemradio");
  90996. }
  90997. } else {
  90998. _this.el_.setAttribute("role", "menuitem");
  90999. }
  91000. return _this;
  91001. }
  91002. var _proto = MenuItem2.prototype;
  91003. _proto.createEl = function createEl$12(type2, props, attrs) {
  91004. this.nonIconControl = true;
  91005. var el = _ClickableComponent.prototype.createEl.call(this, "li", assign({
  91006. className: "vjs-menu-item",
  91007. tabIndex: -1
  91008. }, props), attrs);
  91009. el.replaceChild(createEl("span", {
  91010. className: "vjs-menu-item-text",
  91011. textContent: this.localize(this.options_.label)
  91012. }), el.querySelector(".vjs-icon-placeholder"));
  91013. return el;
  91014. };
  91015. _proto.handleKeyDown = function handleKeyDown(event2) {
  91016. if (!MenuKeys.some(function(key) {
  91017. return keycode.isEventKey(event2, key);
  91018. })) {
  91019. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  91020. }
  91021. };
  91022. _proto.handleClick = function handleClick(event2) {
  91023. this.selected(true);
  91024. };
  91025. _proto.selected = function selected(_selected) {
  91026. if (this.selectable) {
  91027. if (_selected) {
  91028. this.addClass("vjs-selected");
  91029. this.el_.setAttribute("aria-checked", "true");
  91030. this.controlText(", selected");
  91031. this.isSelected_ = true;
  91032. } else {
  91033. this.removeClass("vjs-selected");
  91034. this.el_.setAttribute("aria-checked", "false");
  91035. this.controlText("");
  91036. this.isSelected_ = false;
  91037. }
  91038. }
  91039. };
  91040. return MenuItem2;
  91041. }(ClickableComponent);
  91042. Component$1.registerComponent("MenuItem", MenuItem);
  91043. var TextTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91044. _inheritsLoose(TextTrackMenuItem2, _MenuItem);
  91045. function TextTrackMenuItem2(player, options2) {
  91046. var _this;
  91047. var track = options2.track;
  91048. var tracks = player.textTracks();
  91049. options2.label = track.label || track.language || "Unknown";
  91050. options2.selected = track.mode === "showing";
  91051. _this = _MenuItem.call(this, player, options2) || this;
  91052. _this.track = track;
  91053. _this.kinds = (options2.kinds || [options2.kind || _this.track.kind]).filter(Boolean);
  91054. var changeHandler = function changeHandler2() {
  91055. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91056. args[_key] = arguments[_key];
  91057. }
  91058. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91059. };
  91060. var selectedLanguageChangeHandler = function selectedLanguageChangeHandler2() {
  91061. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  91062. args[_key2] = arguments[_key2];
  91063. }
  91064. _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_this), args);
  91065. };
  91066. player.on(["loadstart", "texttrackchange"], changeHandler);
  91067. tracks.addEventListener("change", changeHandler);
  91068. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91069. _this.on("dispose", function() {
  91070. player.off(["loadstart", "texttrackchange"], changeHandler);
  91071. tracks.removeEventListener("change", changeHandler);
  91072. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91073. });
  91074. if (tracks.onchange === void 0) {
  91075. var event2;
  91076. _this.on(["tap", "click"], function() {
  91077. if (typeof window_1.Event !== "object") {
  91078. try {
  91079. event2 = new window_1.Event("change");
  91080. } catch (err) {
  91081. }
  91082. }
  91083. if (!event2) {
  91084. event2 = document_1.createEvent("Event");
  91085. event2.initEvent("change", true, true);
  91086. }
  91087. tracks.dispatchEvent(event2);
  91088. });
  91089. }
  91090. _this.handleTracksChange();
  91091. return _this;
  91092. }
  91093. var _proto = TextTrackMenuItem2.prototype;
  91094. _proto.handleClick = function handleClick(event2) {
  91095. var referenceTrack = this.track;
  91096. var tracks = this.player_.textTracks();
  91097. _MenuItem.prototype.handleClick.call(this, event2);
  91098. if (!tracks) {
  91099. return;
  91100. }
  91101. for (var i2 = 0; i2 < tracks.length; i2++) {
  91102. var track = tracks[i2];
  91103. if (this.kinds.indexOf(track.kind) === -1) {
  91104. continue;
  91105. }
  91106. if (track === referenceTrack) {
  91107. if (track.mode !== "showing") {
  91108. track.mode = "showing";
  91109. }
  91110. } else if (track.mode !== "disabled") {
  91111. track.mode = "disabled";
  91112. }
  91113. }
  91114. };
  91115. _proto.handleTracksChange = function handleTracksChange(event2) {
  91116. var shouldBeSelected = this.track.mode === "showing";
  91117. if (shouldBeSelected !== this.isSelected_) {
  91118. this.selected(shouldBeSelected);
  91119. }
  91120. };
  91121. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91122. if (this.track.mode === "showing") {
  91123. var selectedLanguage = this.player_.cache_.selectedLanguage;
  91124. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  91125. return;
  91126. }
  91127. this.player_.cache_.selectedLanguage = {
  91128. enabled: true,
  91129. language: this.track.language,
  91130. kind: this.track.kind
  91131. };
  91132. }
  91133. };
  91134. _proto.dispose = function dispose() {
  91135. this.track = null;
  91136. _MenuItem.prototype.dispose.call(this);
  91137. };
  91138. return TextTrackMenuItem2;
  91139. }(MenuItem);
  91140. Component$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem);
  91141. var OffTextTrackMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91142. _inheritsLoose(OffTextTrackMenuItem2, _TextTrackMenuItem);
  91143. function OffTextTrackMenuItem2(player, options2) {
  91144. options2.track = {
  91145. player,
  91146. kind: options2.kind,
  91147. kinds: options2.kinds,
  91148. "default": false,
  91149. mode: "disabled"
  91150. };
  91151. if (!options2.kinds) {
  91152. options2.kinds = [options2.kind];
  91153. }
  91154. if (options2.label) {
  91155. options2.track.label = options2.label;
  91156. } else {
  91157. options2.track.label = options2.kinds.join(" and ") + " off";
  91158. }
  91159. options2.selectable = true;
  91160. options2.multiSelectable = false;
  91161. return _TextTrackMenuItem.call(this, player, options2) || this;
  91162. }
  91163. var _proto = OffTextTrackMenuItem2.prototype;
  91164. _proto.handleTracksChange = function handleTracksChange(event2) {
  91165. var tracks = this.player().textTracks();
  91166. var shouldBeSelected = true;
  91167. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91168. var track = tracks[i2];
  91169. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  91170. shouldBeSelected = false;
  91171. break;
  91172. }
  91173. }
  91174. if (shouldBeSelected !== this.isSelected_) {
  91175. this.selected(shouldBeSelected);
  91176. }
  91177. };
  91178. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91179. var tracks = this.player().textTracks();
  91180. var allHidden = true;
  91181. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91182. var track = tracks[i2];
  91183. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  91184. allHidden = false;
  91185. break;
  91186. }
  91187. }
  91188. if (allHidden) {
  91189. this.player_.cache_.selectedLanguage = {
  91190. enabled: false
  91191. };
  91192. }
  91193. };
  91194. return OffTextTrackMenuItem2;
  91195. }(TextTrackMenuItem);
  91196. Component$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem);
  91197. var TextTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91198. _inheritsLoose(TextTrackButton2, _TrackButton);
  91199. function TextTrackButton2(player, options2) {
  91200. if (options2 === void 0) {
  91201. options2 = {};
  91202. }
  91203. options2.tracks = player.textTracks();
  91204. return _TrackButton.call(this, player, options2) || this;
  91205. }
  91206. var _proto = TextTrackButton2.prototype;
  91207. _proto.createItems = function createItems(items, TrackMenuItem) {
  91208. if (items === void 0) {
  91209. items = [];
  91210. }
  91211. if (TrackMenuItem === void 0) {
  91212. TrackMenuItem = TextTrackMenuItem;
  91213. }
  91214. var label;
  91215. if (this.label_) {
  91216. label = this.label_ + " off";
  91217. }
  91218. items.push(new OffTextTrackMenuItem(this.player_, {
  91219. kinds: this.kinds_,
  91220. kind: this.kind_,
  91221. label
  91222. }));
  91223. this.hideThreshold_ += 1;
  91224. var tracks = this.player_.textTracks();
  91225. if (!Array.isArray(this.kinds_)) {
  91226. this.kinds_ = [this.kind_];
  91227. }
  91228. for (var i2 = 0; i2 < tracks.length; i2++) {
  91229. var track = tracks[i2];
  91230. if (this.kinds_.indexOf(track.kind) > -1) {
  91231. var item = new TrackMenuItem(this.player_, {
  91232. track,
  91233. kinds: this.kinds_,
  91234. kind: this.kind_,
  91235. selectable: true,
  91236. multiSelectable: false
  91237. });
  91238. item.addClass("vjs-" + track.kind + "-menu-item");
  91239. items.push(item);
  91240. }
  91241. }
  91242. return items;
  91243. };
  91244. return TextTrackButton2;
  91245. }(TrackButton);
  91246. Component$1.registerComponent("TextTrackButton", TextTrackButton);
  91247. var ChaptersTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91248. _inheritsLoose(ChaptersTrackMenuItem2, _MenuItem);
  91249. function ChaptersTrackMenuItem2(player, options2) {
  91250. var _this;
  91251. var track = options2.track;
  91252. var cue = options2.cue;
  91253. var currentTime = player.currentTime();
  91254. options2.selectable = true;
  91255. options2.multiSelectable = false;
  91256. options2.label = cue.text;
  91257. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  91258. _this = _MenuItem.call(this, player, options2) || this;
  91259. _this.track = track;
  91260. _this.cue = cue;
  91261. return _this;
  91262. }
  91263. var _proto = ChaptersTrackMenuItem2.prototype;
  91264. _proto.handleClick = function handleClick(event2) {
  91265. _MenuItem.prototype.handleClick.call(this);
  91266. this.player_.currentTime(this.cue.startTime);
  91267. };
  91268. return ChaptersTrackMenuItem2;
  91269. }(MenuItem);
  91270. Component$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem);
  91271. var ChaptersButton = /* @__PURE__ */ function(_TextTrackButton) {
  91272. _inheritsLoose(ChaptersButton2, _TextTrackButton);
  91273. function ChaptersButton2(player, options2, ready) {
  91274. var _this;
  91275. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91276. _this.selectCurrentItem_ = function() {
  91277. _this.items.forEach(function(item) {
  91278. item.selected(_this.track_.activeCues[0] === item.cue);
  91279. });
  91280. };
  91281. return _this;
  91282. }
  91283. var _proto = ChaptersButton2.prototype;
  91284. _proto.buildCSSClass = function buildCSSClass() {
  91285. return "vjs-chapters-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91286. };
  91287. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91288. return "vjs-chapters-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91289. };
  91290. _proto.update = function update(event2) {
  91291. if (event2 && event2.track && event2.track.kind !== "chapters") {
  91292. return;
  91293. }
  91294. var track = this.findChaptersTrack();
  91295. if (track !== this.track_) {
  91296. this.setTrack(track);
  91297. _TextTrackButton.prototype.update.call(this);
  91298. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  91299. _TextTrackButton.prototype.update.call(this);
  91300. }
  91301. };
  91302. _proto.setTrack = function setTrack(track) {
  91303. if (this.track_ === track) {
  91304. return;
  91305. }
  91306. if (!this.updateHandler_) {
  91307. this.updateHandler_ = this.update.bind(this);
  91308. }
  91309. if (this.track_) {
  91310. var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91311. if (remoteTextTrackEl) {
  91312. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  91313. }
  91314. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  91315. this.track_ = null;
  91316. }
  91317. this.track_ = track;
  91318. if (this.track_) {
  91319. this.track_.mode = "hidden";
  91320. var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91321. if (_remoteTextTrackEl) {
  91322. _remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  91323. }
  91324. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  91325. }
  91326. };
  91327. _proto.findChaptersTrack = function findChaptersTrack() {
  91328. var tracks = this.player_.textTracks() || [];
  91329. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  91330. var track = tracks[i2];
  91331. if (track.kind === this.kind_) {
  91332. return track;
  91333. }
  91334. }
  91335. };
  91336. _proto.getMenuCaption = function getMenuCaption() {
  91337. if (this.track_ && this.track_.label) {
  91338. return this.track_.label;
  91339. }
  91340. return this.localize(toTitleCase$1(this.kind_));
  91341. };
  91342. _proto.createMenu = function createMenu() {
  91343. this.options_.title = this.getMenuCaption();
  91344. return _TextTrackButton.prototype.createMenu.call(this);
  91345. };
  91346. _proto.createItems = function createItems() {
  91347. var items = [];
  91348. if (!this.track_) {
  91349. return items;
  91350. }
  91351. var cues = this.track_.cues;
  91352. if (!cues) {
  91353. return items;
  91354. }
  91355. for (var i2 = 0, l = cues.length; i2 < l; i2++) {
  91356. var cue = cues[i2];
  91357. var mi = new ChaptersTrackMenuItem(this.player_, {
  91358. track: this.track_,
  91359. cue
  91360. });
  91361. items.push(mi);
  91362. }
  91363. return items;
  91364. };
  91365. return ChaptersButton2;
  91366. }(TextTrackButton);
  91367. ChaptersButton.prototype.kind_ = "chapters";
  91368. ChaptersButton.prototype.controlText_ = "Chapters";
  91369. Component$1.registerComponent("ChaptersButton", ChaptersButton);
  91370. var DescriptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91371. _inheritsLoose(DescriptionsButton2, _TextTrackButton);
  91372. function DescriptionsButton2(player, options2, ready) {
  91373. var _this;
  91374. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91375. var tracks = player.textTracks();
  91376. var changeHandler = bind(_assertThisInitialized(_this), _this.handleTracksChange);
  91377. tracks.addEventListener("change", changeHandler);
  91378. _this.on("dispose", function() {
  91379. tracks.removeEventListener("change", changeHandler);
  91380. });
  91381. return _this;
  91382. }
  91383. var _proto = DescriptionsButton2.prototype;
  91384. _proto.handleTracksChange = function handleTracksChange(event2) {
  91385. var tracks = this.player().textTracks();
  91386. var disabled = false;
  91387. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91388. var track = tracks[i2];
  91389. if (track.kind !== this.kind_ && track.mode === "showing") {
  91390. disabled = true;
  91391. break;
  91392. }
  91393. }
  91394. if (disabled) {
  91395. this.disable();
  91396. } else {
  91397. this.enable();
  91398. }
  91399. };
  91400. _proto.buildCSSClass = function buildCSSClass() {
  91401. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91402. };
  91403. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91404. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91405. };
  91406. return DescriptionsButton2;
  91407. }(TextTrackButton);
  91408. DescriptionsButton.prototype.kind_ = "descriptions";
  91409. DescriptionsButton.prototype.controlText_ = "Descriptions";
  91410. Component$1.registerComponent("DescriptionsButton", DescriptionsButton);
  91411. var SubtitlesButton = /* @__PURE__ */ function(_TextTrackButton) {
  91412. _inheritsLoose(SubtitlesButton2, _TextTrackButton);
  91413. function SubtitlesButton2(player, options2, ready) {
  91414. return _TextTrackButton.call(this, player, options2, ready) || this;
  91415. }
  91416. var _proto = SubtitlesButton2.prototype;
  91417. _proto.buildCSSClass = function buildCSSClass() {
  91418. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91419. };
  91420. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91421. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91422. };
  91423. return SubtitlesButton2;
  91424. }(TextTrackButton);
  91425. SubtitlesButton.prototype.kind_ = "subtitles";
  91426. SubtitlesButton.prototype.controlText_ = "Subtitles";
  91427. Component$1.registerComponent("SubtitlesButton", SubtitlesButton);
  91428. var CaptionSettingsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91429. _inheritsLoose(CaptionSettingsMenuItem2, _TextTrackMenuItem);
  91430. function CaptionSettingsMenuItem2(player, options2) {
  91431. var _this;
  91432. options2.track = {
  91433. player,
  91434. kind: options2.kind,
  91435. label: options2.kind + " settings",
  91436. selectable: false,
  91437. "default": false,
  91438. mode: "disabled"
  91439. };
  91440. options2.selectable = false;
  91441. options2.name = "CaptionSettingsMenuItem";
  91442. _this = _TextTrackMenuItem.call(this, player, options2) || this;
  91443. _this.addClass("vjs-texttrack-settings");
  91444. _this.controlText(", opens " + options2.kind + " settings dialog");
  91445. return _this;
  91446. }
  91447. var _proto = CaptionSettingsMenuItem2.prototype;
  91448. _proto.handleClick = function handleClick(event2) {
  91449. this.player().getChild("textTrackSettings").open();
  91450. };
  91451. return CaptionSettingsMenuItem2;
  91452. }(TextTrackMenuItem);
  91453. Component$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem);
  91454. var CaptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91455. _inheritsLoose(CaptionsButton2, _TextTrackButton);
  91456. function CaptionsButton2(player, options2, ready) {
  91457. return _TextTrackButton.call(this, player, options2, ready) || this;
  91458. }
  91459. var _proto = CaptionsButton2.prototype;
  91460. _proto.buildCSSClass = function buildCSSClass() {
  91461. return "vjs-captions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91462. };
  91463. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91464. return "vjs-captions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91465. };
  91466. _proto.createItems = function createItems() {
  91467. var items = [];
  91468. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91469. items.push(new CaptionSettingsMenuItem(this.player_, {
  91470. kind: this.kind_
  91471. }));
  91472. this.hideThreshold_ += 1;
  91473. }
  91474. return _TextTrackButton.prototype.createItems.call(this, items);
  91475. };
  91476. return CaptionsButton2;
  91477. }(TextTrackButton);
  91478. CaptionsButton.prototype.kind_ = "captions";
  91479. CaptionsButton.prototype.controlText_ = "Captions";
  91480. Component$1.registerComponent("CaptionsButton", CaptionsButton);
  91481. var SubsCapsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91482. _inheritsLoose(SubsCapsMenuItem2, _TextTrackMenuItem);
  91483. function SubsCapsMenuItem2() {
  91484. return _TextTrackMenuItem.apply(this, arguments) || this;
  91485. }
  91486. var _proto = SubsCapsMenuItem2.prototype;
  91487. _proto.createEl = function createEl$12(type2, props, attrs) {
  91488. var el = _TextTrackMenuItem.prototype.createEl.call(this, type2, props, attrs);
  91489. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91490. if (this.options_.track.kind === "captions") {
  91491. parentSpan.appendChild(createEl("span", {
  91492. className: "vjs-icon-placeholder"
  91493. }, {
  91494. "aria-hidden": true
  91495. }));
  91496. parentSpan.appendChild(createEl("span", {
  91497. className: "vjs-control-text",
  91498. textContent: " " + this.localize("Captions")
  91499. }));
  91500. }
  91501. return el;
  91502. };
  91503. return SubsCapsMenuItem2;
  91504. }(TextTrackMenuItem);
  91505. Component$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem);
  91506. var SubsCapsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91507. _inheritsLoose(SubsCapsButton2, _TextTrackButton);
  91508. function SubsCapsButton2(player, options2) {
  91509. var _this;
  91510. if (options2 === void 0) {
  91511. options2 = {};
  91512. }
  91513. _this = _TextTrackButton.call(this, player, options2) || this;
  91514. _this.label_ = "subtitles";
  91515. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(_this.player_.language_) > -1) {
  91516. _this.label_ = "captions";
  91517. }
  91518. _this.menuButton_.controlText(toTitleCase$1(_this.label_));
  91519. return _this;
  91520. }
  91521. var _proto = SubsCapsButton2.prototype;
  91522. _proto.buildCSSClass = function buildCSSClass() {
  91523. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91524. };
  91525. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91526. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91527. };
  91528. _proto.createItems = function createItems() {
  91529. var items = [];
  91530. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91531. items.push(new CaptionSettingsMenuItem(this.player_, {
  91532. kind: this.label_
  91533. }));
  91534. this.hideThreshold_ += 1;
  91535. }
  91536. items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);
  91537. return items;
  91538. };
  91539. return SubsCapsButton2;
  91540. }(TextTrackButton);
  91541. SubsCapsButton.prototype.kinds_ = ["captions", "subtitles"];
  91542. SubsCapsButton.prototype.controlText_ = "Subtitles";
  91543. Component$1.registerComponent("SubsCapsButton", SubsCapsButton);
  91544. var AudioTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91545. _inheritsLoose(AudioTrackMenuItem2, _MenuItem);
  91546. function AudioTrackMenuItem2(player, options2) {
  91547. var _this;
  91548. var track = options2.track;
  91549. var tracks = player.audioTracks();
  91550. options2.label = track.label || track.language || "Unknown";
  91551. options2.selected = track.enabled;
  91552. _this = _MenuItem.call(this, player, options2) || this;
  91553. _this.track = track;
  91554. _this.addClass("vjs-" + track.kind + "-menu-item");
  91555. var changeHandler = function changeHandler2() {
  91556. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91557. args[_key] = arguments[_key];
  91558. }
  91559. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91560. };
  91561. tracks.addEventListener("change", changeHandler);
  91562. _this.on("dispose", function() {
  91563. tracks.removeEventListener("change", changeHandler);
  91564. });
  91565. return _this;
  91566. }
  91567. var _proto = AudioTrackMenuItem2.prototype;
  91568. _proto.createEl = function createEl$12(type2, props, attrs) {
  91569. var el = _MenuItem.prototype.createEl.call(this, type2, props, attrs);
  91570. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91571. if (this.options_.track.kind === "main-desc") {
  91572. parentSpan.appendChild(createEl("span", {
  91573. className: "vjs-icon-placeholder"
  91574. }, {
  91575. "aria-hidden": true
  91576. }));
  91577. parentSpan.appendChild(createEl("span", {
  91578. className: "vjs-control-text",
  91579. textContent: " " + this.localize("Descriptions")
  91580. }));
  91581. }
  91582. return el;
  91583. };
  91584. _proto.handleClick = function handleClick(event2) {
  91585. _MenuItem.prototype.handleClick.call(this, event2);
  91586. this.track.enabled = true;
  91587. if (this.player_.tech_.featuresNativeAudioTracks) {
  91588. var tracks = this.player_.audioTracks();
  91589. for (var i2 = 0; i2 < tracks.length; i2++) {
  91590. var track = tracks[i2];
  91591. if (track === this.track) {
  91592. continue;
  91593. }
  91594. track.enabled = track === this.track;
  91595. }
  91596. }
  91597. };
  91598. _proto.handleTracksChange = function handleTracksChange(event2) {
  91599. this.selected(this.track.enabled);
  91600. };
  91601. return AudioTrackMenuItem2;
  91602. }(MenuItem);
  91603. Component$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem);
  91604. var AudioTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91605. _inheritsLoose(AudioTrackButton2, _TrackButton);
  91606. function AudioTrackButton2(player, options2) {
  91607. if (options2 === void 0) {
  91608. options2 = {};
  91609. }
  91610. options2.tracks = player.audioTracks();
  91611. return _TrackButton.call(this, player, options2) || this;
  91612. }
  91613. var _proto = AudioTrackButton2.prototype;
  91614. _proto.buildCSSClass = function buildCSSClass() {
  91615. return "vjs-audio-button " + _TrackButton.prototype.buildCSSClass.call(this);
  91616. };
  91617. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91618. return "vjs-audio-button " + _TrackButton.prototype.buildWrapperCSSClass.call(this);
  91619. };
  91620. _proto.createItems = function createItems(items) {
  91621. if (items === void 0) {
  91622. items = [];
  91623. }
  91624. this.hideThreshold_ = 1;
  91625. var tracks = this.player_.audioTracks();
  91626. for (var i2 = 0; i2 < tracks.length; i2++) {
  91627. var track = tracks[i2];
  91628. items.push(new AudioTrackMenuItem(this.player_, {
  91629. track,
  91630. selectable: true,
  91631. multiSelectable: false
  91632. }));
  91633. }
  91634. return items;
  91635. };
  91636. return AudioTrackButton2;
  91637. }(TrackButton);
  91638. AudioTrackButton.prototype.controlText_ = "Audio Track";
  91639. Component$1.registerComponent("AudioTrackButton", AudioTrackButton);
  91640. var PlaybackRateMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91641. _inheritsLoose(PlaybackRateMenuItem2, _MenuItem);
  91642. function PlaybackRateMenuItem2(player, options2) {
  91643. var _this;
  91644. var label = options2.rate;
  91645. var rate = parseFloat(label, 10);
  91646. options2.label = label;
  91647. options2.selected = rate === player.playbackRate();
  91648. options2.selectable = true;
  91649. options2.multiSelectable = false;
  91650. _this = _MenuItem.call(this, player, options2) || this;
  91651. _this.label = label;
  91652. _this.rate = rate;
  91653. _this.on(player, "ratechange", function(e) {
  91654. return _this.update(e);
  91655. });
  91656. return _this;
  91657. }
  91658. var _proto = PlaybackRateMenuItem2.prototype;
  91659. _proto.handleClick = function handleClick(event2) {
  91660. _MenuItem.prototype.handleClick.call(this);
  91661. this.player().playbackRate(this.rate);
  91662. };
  91663. _proto.update = function update(event2) {
  91664. this.selected(this.player().playbackRate() === this.rate);
  91665. };
  91666. return PlaybackRateMenuItem2;
  91667. }(MenuItem);
  91668. PlaybackRateMenuItem.prototype.contentElType = "button";
  91669. Component$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem);
  91670. var PlaybackRateMenuButton = /* @__PURE__ */ function(_MenuButton) {
  91671. _inheritsLoose(PlaybackRateMenuButton2, _MenuButton);
  91672. function PlaybackRateMenuButton2(player, options2) {
  91673. var _this;
  91674. _this = _MenuButton.call(this, player, options2) || this;
  91675. _this.menuButton_.el_.setAttribute("aria-describedby", _this.labelElId_);
  91676. _this.updateVisibility();
  91677. _this.updateLabel();
  91678. _this.on(player, "loadstart", function(e) {
  91679. return _this.updateVisibility(e);
  91680. });
  91681. _this.on(player, "ratechange", function(e) {
  91682. return _this.updateLabel(e);
  91683. });
  91684. _this.on(player, "playbackrateschange", function(e) {
  91685. return _this.handlePlaybackRateschange(e);
  91686. });
  91687. return _this;
  91688. }
  91689. var _proto = PlaybackRateMenuButton2.prototype;
  91690. _proto.createEl = function createEl$12() {
  91691. var el = _MenuButton.prototype.createEl.call(this);
  91692. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  91693. this.labelEl_ = createEl("div", {
  91694. className: "vjs-playback-rate-value",
  91695. id: this.labelElId_,
  91696. textContent: "1x"
  91697. });
  91698. el.appendChild(this.labelEl_);
  91699. return el;
  91700. };
  91701. _proto.dispose = function dispose() {
  91702. this.labelEl_ = null;
  91703. _MenuButton.prototype.dispose.call(this);
  91704. };
  91705. _proto.buildCSSClass = function buildCSSClass() {
  91706. return "vjs-playback-rate " + _MenuButton.prototype.buildCSSClass.call(this);
  91707. };
  91708. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91709. return "vjs-playback-rate " + _MenuButton.prototype.buildWrapperCSSClass.call(this);
  91710. };
  91711. _proto.createItems = function createItems() {
  91712. var rates = this.playbackRates();
  91713. var items = [];
  91714. for (var i2 = rates.length - 1; i2 >= 0; i2--) {
  91715. items.push(new PlaybackRateMenuItem(this.player(), {
  91716. rate: rates[i2] + "x"
  91717. }));
  91718. }
  91719. return items;
  91720. };
  91721. _proto.updateARIAAttributes = function updateARIAAttributes() {
  91722. this.el().setAttribute("aria-valuenow", this.player().playbackRate());
  91723. };
  91724. _proto.handleClick = function handleClick(event2) {
  91725. var currentRate = this.player().playbackRate();
  91726. var rates = this.playbackRates();
  91727. var currentIndex = rates.indexOf(currentRate);
  91728. var newIndex = (currentIndex + 1) % rates.length;
  91729. this.player().playbackRate(rates[newIndex]);
  91730. };
  91731. _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event2) {
  91732. this.update();
  91733. };
  91734. _proto.playbackRates = function playbackRates() {
  91735. var player = this.player();
  91736. return player.playbackRates && player.playbackRates() || [];
  91737. };
  91738. _proto.playbackRateSupported = function playbackRateSupported() {
  91739. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  91740. };
  91741. _proto.updateVisibility = function updateVisibility(event2) {
  91742. if (this.playbackRateSupported()) {
  91743. this.removeClass("vjs-hidden");
  91744. } else {
  91745. this.addClass("vjs-hidden");
  91746. }
  91747. };
  91748. _proto.updateLabel = function updateLabel(event2) {
  91749. if (this.playbackRateSupported()) {
  91750. this.labelEl_.textContent = this.player().playbackRate() + "x";
  91751. }
  91752. };
  91753. return PlaybackRateMenuButton2;
  91754. }(MenuButton);
  91755. PlaybackRateMenuButton.prototype.controlText_ = "Playback Rate";
  91756. Component$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton);
  91757. var Spacer = /* @__PURE__ */ function(_Component) {
  91758. _inheritsLoose(Spacer2, _Component);
  91759. function Spacer2() {
  91760. return _Component.apply(this, arguments) || this;
  91761. }
  91762. var _proto = Spacer2.prototype;
  91763. _proto.buildCSSClass = function buildCSSClass() {
  91764. return "vjs-spacer " + _Component.prototype.buildCSSClass.call(this);
  91765. };
  91766. _proto.createEl = function createEl2(tag, props, attributes) {
  91767. if (tag === void 0) {
  91768. tag = "div";
  91769. }
  91770. if (props === void 0) {
  91771. props = {};
  91772. }
  91773. if (attributes === void 0) {
  91774. attributes = {};
  91775. }
  91776. if (!props.className) {
  91777. props.className = this.buildCSSClass();
  91778. }
  91779. return _Component.prototype.createEl.call(this, tag, props, attributes);
  91780. };
  91781. return Spacer2;
  91782. }(Component$1);
  91783. Component$1.registerComponent("Spacer", Spacer);
  91784. var CustomControlSpacer = /* @__PURE__ */ function(_Spacer) {
  91785. _inheritsLoose(CustomControlSpacer2, _Spacer);
  91786. function CustomControlSpacer2() {
  91787. return _Spacer.apply(this, arguments) || this;
  91788. }
  91789. var _proto = CustomControlSpacer2.prototype;
  91790. _proto.buildCSSClass = function buildCSSClass() {
  91791. return "vjs-custom-control-spacer " + _Spacer.prototype.buildCSSClass.call(this);
  91792. };
  91793. _proto.createEl = function createEl2() {
  91794. return _Spacer.prototype.createEl.call(this, "div", {
  91795. className: this.buildCSSClass(),
  91796. textContent: "\xA0"
  91797. });
  91798. };
  91799. return CustomControlSpacer2;
  91800. }(Spacer);
  91801. Component$1.registerComponent("CustomControlSpacer", CustomControlSpacer);
  91802. var ControlBar = /* @__PURE__ */ function(_Component) {
  91803. _inheritsLoose(ControlBar2, _Component);
  91804. function ControlBar2() {
  91805. return _Component.apply(this, arguments) || this;
  91806. }
  91807. var _proto = ControlBar2.prototype;
  91808. _proto.createEl = function createEl2() {
  91809. return _Component.prototype.createEl.call(this, "div", {
  91810. className: "vjs-control-bar",
  91811. dir: "ltr"
  91812. });
  91813. };
  91814. return ControlBar2;
  91815. }(Component$1);
  91816. ControlBar.prototype.options_ = {
  91817. children: ["playToggle", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  91818. };
  91819. if ("exitPictureInPicture" in document_1) {
  91820. ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  91821. }
  91822. Component$1.registerComponent("ControlBar", ControlBar);
  91823. var ErrorDisplay = /* @__PURE__ */ function(_ModalDialog) {
  91824. _inheritsLoose(ErrorDisplay2, _ModalDialog);
  91825. function ErrorDisplay2(player, options2) {
  91826. var _this;
  91827. _this = _ModalDialog.call(this, player, options2) || this;
  91828. _this.on(player, "error", function(e) {
  91829. return _this.open(e);
  91830. });
  91831. return _this;
  91832. }
  91833. var _proto = ErrorDisplay2.prototype;
  91834. _proto.buildCSSClass = function buildCSSClass() {
  91835. return "vjs-error-display " + _ModalDialog.prototype.buildCSSClass.call(this);
  91836. };
  91837. _proto.content = function content() {
  91838. var error = this.player().error();
  91839. return error ? this.localize(error.message) : "";
  91840. };
  91841. return ErrorDisplay2;
  91842. }(ModalDialog);
  91843. ErrorDisplay.prototype.options_ = _extends$2({}, ModalDialog.prototype.options_, {
  91844. pauseOnOpen: false,
  91845. fillAlways: true,
  91846. temporary: false,
  91847. uncloseable: true
  91848. });
  91849. Component$1.registerComponent("ErrorDisplay", ErrorDisplay);
  91850. var LOCAL_STORAGE_KEY$1 = "vjs-text-track-settings";
  91851. var COLOR_BLACK = ["#000", "Black"];
  91852. var COLOR_BLUE = ["#00F", "Blue"];
  91853. var COLOR_CYAN = ["#0FF", "Cyan"];
  91854. var COLOR_GREEN = ["#0F0", "Green"];
  91855. var COLOR_MAGENTA = ["#F0F", "Magenta"];
  91856. var COLOR_RED = ["#F00", "Red"];
  91857. var COLOR_WHITE = ["#FFF", "White"];
  91858. var COLOR_YELLOW = ["#FF0", "Yellow"];
  91859. var OPACITY_OPAQUE = ["1", "Opaque"];
  91860. var OPACITY_SEMI = ["0.5", "Semi-Transparent"];
  91861. var OPACITY_TRANS = ["0", "Transparent"];
  91862. var selectConfigs = {
  91863. backgroundColor: {
  91864. selector: ".vjs-bg-color > select",
  91865. id: "captions-background-color-%s",
  91866. label: "Color",
  91867. options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91868. },
  91869. backgroundOpacity: {
  91870. selector: ".vjs-bg-opacity > select",
  91871. id: "captions-background-opacity-%s",
  91872. label: "Transparency",
  91873. options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]
  91874. },
  91875. color: {
  91876. selector: ".vjs-fg-color > select",
  91877. id: "captions-foreground-color-%s",
  91878. label: "Color",
  91879. options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91880. },
  91881. edgeStyle: {
  91882. selector: ".vjs-edge-style > select",
  91883. id: "%s",
  91884. label: "Text Edge Style",
  91885. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  91886. },
  91887. fontFamily: {
  91888. selector: ".vjs-font-family > select",
  91889. id: "captions-font-family-%s",
  91890. label: "Font Family",
  91891. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  91892. },
  91893. fontPercent: {
  91894. selector: ".vjs-font-percent > select",
  91895. id: "captions-font-size-%s",
  91896. label: "Font Size",
  91897. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  91898. "default": 2,
  91899. parser: function parser(v) {
  91900. return v === "1.00" ? null : Number(v);
  91901. }
  91902. },
  91903. textOpacity: {
  91904. selector: ".vjs-text-opacity > select",
  91905. id: "captions-foreground-opacity-%s",
  91906. label: "Transparency",
  91907. options: [OPACITY_OPAQUE, OPACITY_SEMI]
  91908. },
  91909. windowColor: {
  91910. selector: ".vjs-window-color > select",
  91911. id: "captions-window-color-%s",
  91912. label: "Color"
  91913. },
  91914. windowOpacity: {
  91915. selector: ".vjs-window-opacity > select",
  91916. id: "captions-window-opacity-%s",
  91917. label: "Transparency",
  91918. options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]
  91919. }
  91920. };
  91921. selectConfigs.windowColor.options = selectConfigs.backgroundColor.options;
  91922. function parseOptionValue(value, parser2) {
  91923. if (parser2) {
  91924. value = parser2(value);
  91925. }
  91926. if (value && value !== "none") {
  91927. return value;
  91928. }
  91929. }
  91930. function getSelectedOptionValue(el, parser2) {
  91931. var value = el.options[el.options.selectedIndex].value;
  91932. return parseOptionValue(value, parser2);
  91933. }
  91934. function setSelectedOption(el, value, parser2) {
  91935. if (!value) {
  91936. return;
  91937. }
  91938. for (var i2 = 0; i2 < el.options.length; i2++) {
  91939. if (parseOptionValue(el.options[i2].value, parser2) === value) {
  91940. el.selectedIndex = i2;
  91941. break;
  91942. }
  91943. }
  91944. }
  91945. var TextTrackSettings = /* @__PURE__ */ function(_ModalDialog) {
  91946. _inheritsLoose(TextTrackSettings2, _ModalDialog);
  91947. function TextTrackSettings2(player, options2) {
  91948. var _this;
  91949. options2.temporary = false;
  91950. _this = _ModalDialog.call(this, player, options2) || this;
  91951. _this.updateDisplay = _this.updateDisplay.bind(_assertThisInitialized(_this));
  91952. _this.fill();
  91953. _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;
  91954. _this.endDialog = createEl("p", {
  91955. className: "vjs-control-text",
  91956. textContent: _this.localize("End of dialog window.")
  91957. });
  91958. _this.el().appendChild(_this.endDialog);
  91959. _this.setDefaults();
  91960. if (options2.persistTextTrackSettings === void 0) {
  91961. _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;
  91962. }
  91963. _this.on(_this.$(".vjs-done-button"), "click", function() {
  91964. _this.saveSettings();
  91965. _this.close();
  91966. });
  91967. _this.on(_this.$(".vjs-default-button"), "click", function() {
  91968. _this.setDefaults();
  91969. _this.updateDisplay();
  91970. });
  91971. each(selectConfigs, function(config) {
  91972. _this.on(_this.$(config.selector), "change", _this.updateDisplay);
  91973. });
  91974. if (_this.options_.persistTextTrackSettings) {
  91975. _this.restoreSettings();
  91976. }
  91977. return _this;
  91978. }
  91979. var _proto = TextTrackSettings2.prototype;
  91980. _proto.dispose = function dispose() {
  91981. this.endDialog = null;
  91982. _ModalDialog.prototype.dispose.call(this);
  91983. };
  91984. _proto.createElSelect_ = function createElSelect_(key, legendId, type2) {
  91985. var _this2 = this;
  91986. if (legendId === void 0) {
  91987. legendId = "";
  91988. }
  91989. if (type2 === void 0) {
  91990. type2 = "label";
  91991. }
  91992. var config = selectConfigs[key];
  91993. var id = config.id.replace("%s", this.id_);
  91994. var selectLabelledbyIds = [legendId, id].join(" ").trim();
  91995. return ["<" + type2 + ' id="' + id + '" class="' + (type2 === "label" ? "vjs-label" : "") + '">', this.localize(config.label), "</" + type2 + ">", '<select aria-labelledby="' + selectLabelledbyIds + '">'].concat(config.options.map(function(o) {
  91996. var optionId = id + "-" + o[1].replace(/\W+/g, "");
  91997. return ['<option id="' + optionId + '" value="' + o[0] + '" ', 'aria-labelledby="' + selectLabelledbyIds + " " + optionId + '">', _this2.localize(o[1]), "</option>"].join("");
  91998. })).concat("</select>").join("");
  91999. };
  92000. _proto.createElFgColor_ = function createElFgColor_() {
  92001. var legendId = "captions-text-legend-" + this.id_;
  92002. return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", legendId), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  92003. };
  92004. _proto.createElBgColor_ = function createElBgColor_() {
  92005. var legendId = "captions-background-" + this.id_;
  92006. return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", legendId), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  92007. };
  92008. _proto.createElWinColor_ = function createElWinColor_() {
  92009. var legendId = "captions-window-" + this.id_;
  92010. return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", legendId), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  92011. };
  92012. _proto.createElColors_ = function createElColors_() {
  92013. return createEl("div", {
  92014. className: "vjs-track-settings-colors",
  92015. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  92016. });
  92017. };
  92018. _proto.createElFont_ = function createElFont_() {
  92019. return createEl("div", {
  92020. className: "vjs-track-settings-font",
  92021. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  92022. });
  92023. };
  92024. _proto.createElControls_ = function createElControls_() {
  92025. var defaultsDescription = this.localize("restore all settings to the default values");
  92026. return createEl("div", {
  92027. className: "vjs-track-settings-controls",
  92028. innerHTML: ['<button type="button" class="vjs-default-button" title="' + defaultsDescription + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + defaultsDescription + "</span>", "</button>", '<button type="button" class="vjs-done-button">' + this.localize("Done") + "</button>"].join("")
  92029. });
  92030. };
  92031. _proto.content = function content() {
  92032. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  92033. };
  92034. _proto.label = function label() {
  92035. return this.localize("Caption Settings Dialog");
  92036. };
  92037. _proto.description = function description() {
  92038. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  92039. };
  92040. _proto.buildCSSClass = function buildCSSClass() {
  92041. return _ModalDialog.prototype.buildCSSClass.call(this) + " vjs-text-track-settings";
  92042. };
  92043. _proto.getValues = function getValues() {
  92044. var _this3 = this;
  92045. return reduce(selectConfigs, function(accum, config, key) {
  92046. var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);
  92047. if (value !== void 0) {
  92048. accum[key] = value;
  92049. }
  92050. return accum;
  92051. }, {});
  92052. };
  92053. _proto.setValues = function setValues(values3) {
  92054. var _this4 = this;
  92055. each(selectConfigs, function(config, key) {
  92056. setSelectedOption(_this4.$(config.selector), values3[key], config.parser);
  92057. });
  92058. };
  92059. _proto.setDefaults = function setDefaults() {
  92060. var _this5 = this;
  92061. each(selectConfigs, function(config) {
  92062. var index2 = config.hasOwnProperty("default") ? config["default"] : 0;
  92063. _this5.$(config.selector).selectedIndex = index2;
  92064. });
  92065. };
  92066. _proto.restoreSettings = function restoreSettings() {
  92067. var values3;
  92068. try {
  92069. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1));
  92070. } catch (err) {
  92071. log$1.warn(err);
  92072. }
  92073. if (values3) {
  92074. this.setValues(values3);
  92075. }
  92076. };
  92077. _proto.saveSettings = function saveSettings() {
  92078. if (!this.options_.persistTextTrackSettings) {
  92079. return;
  92080. }
  92081. var values3 = this.getValues();
  92082. try {
  92083. if (Object.keys(values3).length) {
  92084. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values3));
  92085. } else {
  92086. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);
  92087. }
  92088. } catch (err) {
  92089. log$1.warn(err);
  92090. }
  92091. };
  92092. _proto.updateDisplay = function updateDisplay() {
  92093. var ttDisplay = this.player_.getChild("textTrackDisplay");
  92094. if (ttDisplay) {
  92095. ttDisplay.updateDisplay();
  92096. }
  92097. };
  92098. _proto.conditionalBlur_ = function conditionalBlur_() {
  92099. this.previouslyActiveEl_ = null;
  92100. var cb = this.player_.controlBar;
  92101. var subsCapsBtn = cb && cb.subsCapsButton;
  92102. var ccBtn = cb && cb.captionsButton;
  92103. if (subsCapsBtn) {
  92104. subsCapsBtn.focus();
  92105. } else if (ccBtn) {
  92106. ccBtn.focus();
  92107. }
  92108. };
  92109. return TextTrackSettings2;
  92110. }(ModalDialog);
  92111. Component$1.registerComponent("TextTrackSettings", TextTrackSettings);
  92112. var ResizeManager = /* @__PURE__ */ function(_Component) {
  92113. _inheritsLoose(ResizeManager2, _Component);
  92114. function ResizeManager2(player, options2) {
  92115. var _this;
  92116. var RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  92117. if (options2.ResizeObserver === null) {
  92118. RESIZE_OBSERVER_AVAILABLE = false;
  92119. }
  92120. var options_ = mergeOptions$3({
  92121. createEl: !RESIZE_OBSERVER_AVAILABLE,
  92122. reportTouchActivity: false
  92123. }, options2);
  92124. _this = _Component.call(this, player, options_) || this;
  92125. _this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  92126. _this.loadListener_ = null;
  92127. _this.resizeObserver_ = null;
  92128. _this.debouncedHandler_ = debounce(function() {
  92129. _this.resizeHandler();
  92130. }, 100, false, _assertThisInitialized(_this));
  92131. if (RESIZE_OBSERVER_AVAILABLE) {
  92132. _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);
  92133. _this.resizeObserver_.observe(player.el());
  92134. } else {
  92135. _this.loadListener_ = function() {
  92136. if (!_this.el_ || !_this.el_.contentWindow) {
  92137. return;
  92138. }
  92139. var debouncedHandler_ = _this.debouncedHandler_;
  92140. var unloadListener_ = _this.unloadListener_ = function() {
  92141. off(this, "resize", debouncedHandler_);
  92142. off(this, "unload", unloadListener_);
  92143. unloadListener_ = null;
  92144. };
  92145. on(_this.el_.contentWindow, "unload", unloadListener_);
  92146. on(_this.el_.contentWindow, "resize", debouncedHandler_);
  92147. };
  92148. _this.one("load", _this.loadListener_);
  92149. }
  92150. return _this;
  92151. }
  92152. var _proto = ResizeManager2.prototype;
  92153. _proto.createEl = function createEl2() {
  92154. return _Component.prototype.createEl.call(this, "iframe", {
  92155. className: "vjs-resize-manager",
  92156. tabIndex: -1,
  92157. title: this.localize("No content")
  92158. }, {
  92159. "aria-hidden": "true"
  92160. });
  92161. };
  92162. _proto.resizeHandler = function resizeHandler() {
  92163. if (!this.player_ || !this.player_.trigger) {
  92164. return;
  92165. }
  92166. this.player_.trigger("playerresize");
  92167. };
  92168. _proto.dispose = function dispose() {
  92169. if (this.debouncedHandler_) {
  92170. this.debouncedHandler_.cancel();
  92171. }
  92172. if (this.resizeObserver_) {
  92173. if (this.player_.el()) {
  92174. this.resizeObserver_.unobserve(this.player_.el());
  92175. }
  92176. this.resizeObserver_.disconnect();
  92177. }
  92178. if (this.loadListener_) {
  92179. this.off("load", this.loadListener_);
  92180. }
  92181. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  92182. this.unloadListener_.call(this.el_.contentWindow);
  92183. }
  92184. this.ResizeObserver = null;
  92185. this.resizeObserver = null;
  92186. this.debouncedHandler_ = null;
  92187. this.loadListener_ = null;
  92188. _Component.prototype.dispose.call(this);
  92189. };
  92190. return ResizeManager2;
  92191. }(Component$1);
  92192. Component$1.registerComponent("ResizeManager", ResizeManager);
  92193. var defaults$1 = {
  92194. trackingThreshold: 20,
  92195. liveTolerance: 15
  92196. };
  92197. var LiveTracker = /* @__PURE__ */ function(_Component) {
  92198. _inheritsLoose(LiveTracker2, _Component);
  92199. function LiveTracker2(player, options2) {
  92200. var _this;
  92201. var options_ = mergeOptions$3(defaults$1, options2, {
  92202. createEl: false
  92203. });
  92204. _this = _Component.call(this, player, options_) || this;
  92205. _this.handleVisibilityChange_ = function(e) {
  92206. return _this.handleVisibilityChange(e);
  92207. };
  92208. _this.trackLiveHandler_ = function() {
  92209. return _this.trackLive_();
  92210. };
  92211. _this.handlePlay_ = function(e) {
  92212. return _this.handlePlay(e);
  92213. };
  92214. _this.handleFirstTimeupdate_ = function(e) {
  92215. return _this.handleFirstTimeupdate(e);
  92216. };
  92217. _this.handleSeeked_ = function(e) {
  92218. return _this.handleSeeked(e);
  92219. };
  92220. _this.seekToLiveEdge_ = function(e) {
  92221. return _this.seekToLiveEdge(e);
  92222. };
  92223. _this.reset_();
  92224. _this.on(_this.player_, "durationchange", function(e) {
  92225. return _this.handleDurationchange(e);
  92226. });
  92227. _this.on(_this.player_, "canplay", function() {
  92228. return _this.toggleTracking();
  92229. });
  92230. if (IE_VERSION && "hidden" in document_1 && "visibilityState" in document_1) {
  92231. _this.on(document_1, "visibilitychange", _this.handleVisibilityChange_);
  92232. }
  92233. return _this;
  92234. }
  92235. var _proto = LiveTracker2.prototype;
  92236. _proto.handleVisibilityChange = function handleVisibilityChange() {
  92237. if (this.player_.duration() !== Infinity) {
  92238. return;
  92239. }
  92240. if (document_1.hidden) {
  92241. this.stopTracking();
  92242. } else {
  92243. this.startTracking();
  92244. }
  92245. };
  92246. _proto.trackLive_ = function trackLive_() {
  92247. var seekable3 = this.player_.seekable();
  92248. if (!seekable3 || !seekable3.length) {
  92249. return;
  92250. }
  92251. var newTime = Number(window_1.performance.now().toFixed(4));
  92252. var deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  92253. this.lastTime_ = newTime;
  92254. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  92255. var liveCurrentTime = this.liveCurrentTime();
  92256. var currentTime = this.player_.currentTime();
  92257. var isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  92258. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  92259. isBehind = false;
  92260. }
  92261. if (isBehind !== this.behindLiveEdge_) {
  92262. this.behindLiveEdge_ = isBehind;
  92263. this.trigger("liveedgechange");
  92264. }
  92265. };
  92266. _proto.handleDurationchange = function handleDurationchange() {
  92267. this.toggleTracking();
  92268. };
  92269. _proto.toggleTracking = function toggleTracking() {
  92270. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  92271. if (this.player_.options_.liveui) {
  92272. this.player_.addClass("vjs-liveui");
  92273. }
  92274. this.startTracking();
  92275. } else {
  92276. this.player_.removeClass("vjs-liveui");
  92277. this.stopTracking();
  92278. }
  92279. };
  92280. _proto.startTracking = function startTracking() {
  92281. if (this.isTracking()) {
  92282. return;
  92283. }
  92284. if (!this.timeupdateSeen_) {
  92285. this.timeupdateSeen_ = this.player_.hasStarted();
  92286. }
  92287. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);
  92288. this.trackLive_();
  92289. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92290. if (!this.timeupdateSeen_) {
  92291. this.one(this.player_, "play", this.handlePlay_);
  92292. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92293. } else {
  92294. this.on(this.player_, "seeked", this.handleSeeked_);
  92295. }
  92296. };
  92297. _proto.handleFirstTimeupdate = function handleFirstTimeupdate() {
  92298. this.timeupdateSeen_ = true;
  92299. this.on(this.player_, "seeked", this.handleSeeked_);
  92300. };
  92301. _proto.handleSeeked = function handleSeeked() {
  92302. var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  92303. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  92304. this.nextSeekedFromUser_ = false;
  92305. this.trackLive_();
  92306. };
  92307. _proto.handlePlay = function handlePlay() {
  92308. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  92309. };
  92310. _proto.reset_ = function reset_() {
  92311. this.lastTime_ = -1;
  92312. this.pastSeekEnd_ = 0;
  92313. this.lastSeekEnd_ = -1;
  92314. this.behindLiveEdge_ = true;
  92315. this.timeupdateSeen_ = false;
  92316. this.seekedBehindLive_ = false;
  92317. this.nextSeekedFromUser_ = false;
  92318. this.clearInterval(this.trackingInterval_);
  92319. this.trackingInterval_ = null;
  92320. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92321. this.off(this.player_, "seeked", this.handleSeeked_);
  92322. this.off(this.player_, "play", this.handlePlay_);
  92323. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92324. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  92325. };
  92326. _proto.nextSeekedFromUser = function nextSeekedFromUser() {
  92327. this.nextSeekedFromUser_ = true;
  92328. };
  92329. _proto.stopTracking = function stopTracking() {
  92330. if (!this.isTracking()) {
  92331. return;
  92332. }
  92333. this.reset_();
  92334. this.trigger("liveedgechange");
  92335. };
  92336. _proto.seekableEnd = function seekableEnd() {
  92337. var seekable3 = this.player_.seekable();
  92338. var seekableEnds = [];
  92339. var i2 = seekable3 ? seekable3.length : 0;
  92340. while (i2--) {
  92341. seekableEnds.push(seekable3.end(i2));
  92342. }
  92343. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  92344. };
  92345. _proto.seekableStart = function seekableStart() {
  92346. var seekable3 = this.player_.seekable();
  92347. var seekableStarts = [];
  92348. var i2 = seekable3 ? seekable3.length : 0;
  92349. while (i2--) {
  92350. seekableStarts.push(seekable3.start(i2));
  92351. }
  92352. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  92353. };
  92354. _proto.liveWindow = function liveWindow() {
  92355. var liveCurrentTime = this.liveCurrentTime();
  92356. if (liveCurrentTime === Infinity) {
  92357. return 0;
  92358. }
  92359. return liveCurrentTime - this.seekableStart();
  92360. };
  92361. _proto.isLive = function isLive() {
  92362. return this.isTracking();
  92363. };
  92364. _proto.atLiveEdge = function atLiveEdge() {
  92365. return !this.behindLiveEdge();
  92366. };
  92367. _proto.liveCurrentTime = function liveCurrentTime() {
  92368. return this.pastSeekEnd() + this.seekableEnd();
  92369. };
  92370. _proto.pastSeekEnd = function pastSeekEnd() {
  92371. var seekableEnd = this.seekableEnd();
  92372. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  92373. this.pastSeekEnd_ = 0;
  92374. }
  92375. this.lastSeekEnd_ = seekableEnd;
  92376. return this.pastSeekEnd_;
  92377. };
  92378. _proto.behindLiveEdge = function behindLiveEdge() {
  92379. return this.behindLiveEdge_;
  92380. };
  92381. _proto.isTracking = function isTracking() {
  92382. return typeof this.trackingInterval_ === "number";
  92383. };
  92384. _proto.seekToLiveEdge = function seekToLiveEdge() {
  92385. this.seekedBehindLive_ = false;
  92386. if (this.atLiveEdge()) {
  92387. return;
  92388. }
  92389. this.nextSeekedFromUser_ = false;
  92390. this.player_.currentTime(this.liveCurrentTime());
  92391. };
  92392. _proto.dispose = function dispose() {
  92393. this.off(document_1, "visibilitychange", this.handleVisibilityChange_);
  92394. this.stopTracking();
  92395. _Component.prototype.dispose.call(this);
  92396. };
  92397. return LiveTracker2;
  92398. }(Component$1);
  92399. Component$1.registerComponent("LiveTracker", LiveTracker);
  92400. var sourcesetLoad = function sourcesetLoad2(tech) {
  92401. var el = tech.el();
  92402. if (el.hasAttribute("src")) {
  92403. tech.triggerSourceset(el.src);
  92404. return true;
  92405. }
  92406. var sources = tech.$$("source");
  92407. var srcUrls = [];
  92408. var src = "";
  92409. if (!sources.length) {
  92410. return false;
  92411. }
  92412. for (var i2 = 0; i2 < sources.length; i2++) {
  92413. var url = sources[i2].src;
  92414. if (url && srcUrls.indexOf(url) === -1) {
  92415. srcUrls.push(url);
  92416. }
  92417. }
  92418. if (!srcUrls.length) {
  92419. return false;
  92420. }
  92421. if (srcUrls.length === 1) {
  92422. src = srcUrls[0];
  92423. }
  92424. tech.triggerSourceset(src);
  92425. return true;
  92426. };
  92427. var innerHTMLDescriptorPolyfill = Object.defineProperty({}, "innerHTML", {
  92428. get: function get2() {
  92429. return this.cloneNode(true).innerHTML;
  92430. },
  92431. set: function set2(v) {
  92432. var dummy = document_1.createElement(this.nodeName.toLowerCase());
  92433. dummy.innerHTML = v;
  92434. var docFrag = document_1.createDocumentFragment();
  92435. while (dummy.childNodes.length) {
  92436. docFrag.appendChild(dummy.childNodes[0]);
  92437. }
  92438. this.innerText = "";
  92439. window_1.Element.prototype.appendChild.call(this, docFrag);
  92440. return this.innerHTML;
  92441. }
  92442. });
  92443. var getDescriptor = function getDescriptor2(priority, prop) {
  92444. var descriptor = {};
  92445. for (var i2 = 0; i2 < priority.length; i2++) {
  92446. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  92447. if (descriptor && descriptor.set && descriptor.get) {
  92448. break;
  92449. }
  92450. }
  92451. descriptor.enumerable = true;
  92452. descriptor.configurable = true;
  92453. return descriptor;
  92454. };
  92455. var getInnerHTMLDescriptor = function getInnerHTMLDescriptor2(tech) {
  92456. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill], "innerHTML");
  92457. };
  92458. var firstSourceWatch = function firstSourceWatch2(tech) {
  92459. var el = tech.el();
  92460. if (el.resetSourceWatch_) {
  92461. return;
  92462. }
  92463. var old = {};
  92464. var innerDescriptor = getInnerHTMLDescriptor(tech);
  92465. var appendWrapper = function appendWrapper2(appendFn) {
  92466. return function() {
  92467. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  92468. args[_key] = arguments[_key];
  92469. }
  92470. var retval = appendFn.apply(el, args);
  92471. sourcesetLoad(tech);
  92472. return retval;
  92473. };
  92474. };
  92475. ["append", "appendChild", "insertAdjacentHTML"].forEach(function(k) {
  92476. if (!el[k]) {
  92477. return;
  92478. }
  92479. old[k] = el[k];
  92480. el[k] = appendWrapper(old[k]);
  92481. });
  92482. Object.defineProperty(el, "innerHTML", mergeOptions$3(innerDescriptor, {
  92483. set: appendWrapper(innerDescriptor.set)
  92484. }));
  92485. el.resetSourceWatch_ = function() {
  92486. el.resetSourceWatch_ = null;
  92487. Object.keys(old).forEach(function(k) {
  92488. el[k] = old[k];
  92489. });
  92490. Object.defineProperty(el, "innerHTML", innerDescriptor);
  92491. };
  92492. tech.one("sourceset", el.resetSourceWatch_);
  92493. };
  92494. var srcDescriptorPolyfill = Object.defineProperty({}, "src", {
  92495. get: function get3() {
  92496. if (this.hasAttribute("src")) {
  92497. return getAbsoluteURL(window_1.Element.prototype.getAttribute.call(this, "src"));
  92498. }
  92499. return "";
  92500. },
  92501. set: function set3(v) {
  92502. window_1.Element.prototype.setAttribute.call(this, "src", v);
  92503. return v;
  92504. }
  92505. });
  92506. var getSrcDescriptor = function getSrcDescriptor2(tech) {
  92507. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill], "src");
  92508. };
  92509. var setupSourceset = function setupSourceset2(tech) {
  92510. if (!tech.featuresSourceset) {
  92511. return;
  92512. }
  92513. var el = tech.el();
  92514. if (el.resetSourceset_) {
  92515. return;
  92516. }
  92517. var srcDescriptor = getSrcDescriptor(tech);
  92518. var oldSetAttribute = el.setAttribute;
  92519. var oldLoad = el.load;
  92520. Object.defineProperty(el, "src", mergeOptions$3(srcDescriptor, {
  92521. set: function set4(v) {
  92522. var retval = srcDescriptor.set.call(el, v);
  92523. tech.triggerSourceset(el.src);
  92524. return retval;
  92525. }
  92526. }));
  92527. el.setAttribute = function(n, v) {
  92528. var retval = oldSetAttribute.call(el, n, v);
  92529. if (/src/i.test(n)) {
  92530. tech.triggerSourceset(el.src);
  92531. }
  92532. return retval;
  92533. };
  92534. el.load = function() {
  92535. var retval = oldLoad.call(el);
  92536. if (!sourcesetLoad(tech)) {
  92537. tech.triggerSourceset("");
  92538. firstSourceWatch(tech);
  92539. }
  92540. return retval;
  92541. };
  92542. if (el.currentSrc) {
  92543. tech.triggerSourceset(el.currentSrc);
  92544. } else if (!sourcesetLoad(tech)) {
  92545. firstSourceWatch(tech);
  92546. }
  92547. el.resetSourceset_ = function() {
  92548. el.resetSourceset_ = null;
  92549. el.load = oldLoad;
  92550. el.setAttribute = oldSetAttribute;
  92551. Object.defineProperty(el, "src", srcDescriptor);
  92552. if (el.resetSourceWatch_) {
  92553. el.resetSourceWatch_();
  92554. }
  92555. };
  92556. };
  92557. var defineLazyProperty = function defineLazyProperty2(obj, key, getValue2, setter) {
  92558. if (setter === void 0) {
  92559. setter = true;
  92560. }
  92561. var set4 = function set5(value) {
  92562. return Object.defineProperty(obj, key, {
  92563. value,
  92564. enumerable: true,
  92565. writable: true
  92566. });
  92567. };
  92568. var options2 = {
  92569. configurable: true,
  92570. enumerable: true,
  92571. get: function get7() {
  92572. var value = getValue2();
  92573. set4(value);
  92574. return value;
  92575. }
  92576. };
  92577. if (setter) {
  92578. options2.set = set4;
  92579. }
  92580. return Object.defineProperty(obj, key, options2);
  92581. };
  92582. var Html5$1 = /* @__PURE__ */ function(_Tech) {
  92583. _inheritsLoose(Html52, _Tech);
  92584. function Html52(options2, ready) {
  92585. var _this;
  92586. _this = _Tech.call(this, options2, ready) || this;
  92587. var source = options2.source;
  92588. var crossoriginTracks = false;
  92589. _this.featuresVideoFrameCallback = _this.featuresVideoFrameCallback && _this.el_.tagName === "VIDEO";
  92590. if (source && (_this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  92591. _this.setSource(source);
  92592. } else {
  92593. _this.handleLateInit_(_this.el_);
  92594. }
  92595. if (options2.enableSourceset) {
  92596. _this.setupSourcesetHandling_();
  92597. }
  92598. _this.isScrubbing_ = false;
  92599. if (_this.el_.hasChildNodes()) {
  92600. var nodes = _this.el_.childNodes;
  92601. var nodesLength = nodes.length;
  92602. var removeNodes = [];
  92603. while (nodesLength--) {
  92604. var node = nodes[nodesLength];
  92605. var nodeName = node.nodeName.toLowerCase();
  92606. if (nodeName === "track") {
  92607. if (!_this.featuresNativeTextTracks) {
  92608. removeNodes.push(node);
  92609. } else {
  92610. _this.remoteTextTrackEls().addTrackElement_(node);
  92611. _this.remoteTextTracks().addTrack(node.track);
  92612. _this.textTracks().addTrack(node.track);
  92613. if (!crossoriginTracks && !_this.el_.hasAttribute("crossorigin") && isCrossOrigin(node.src)) {
  92614. crossoriginTracks = true;
  92615. }
  92616. }
  92617. }
  92618. }
  92619. for (var i2 = 0; i2 < removeNodes.length; i2++) {
  92620. _this.el_.removeChild(removeNodes[i2]);
  92621. }
  92622. }
  92623. _this.proxyNativeTracks_();
  92624. if (_this.featuresNativeTextTracks && crossoriginTracks) {
  92625. log$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  92626. }
  92627. _this.restoreMetadataTracksInIOSNativePlayer_();
  92628. if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options2.nativeControlsForTouch === true) {
  92629. _this.setControls(true);
  92630. }
  92631. _this.proxyWebkitFullscreen_();
  92632. _this.triggerReady();
  92633. return _this;
  92634. }
  92635. var _proto = Html52.prototype;
  92636. _proto.dispose = function dispose() {
  92637. if (this.el_ && this.el_.resetSourceset_) {
  92638. this.el_.resetSourceset_();
  92639. }
  92640. Html52.disposeMediaElement(this.el_);
  92641. this.options_ = null;
  92642. _Tech.prototype.dispose.call(this);
  92643. };
  92644. _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {
  92645. setupSourceset(this);
  92646. };
  92647. _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {
  92648. var textTracks = this.textTracks();
  92649. var metadataTracksPreFullscreenState;
  92650. var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot2() {
  92651. metadataTracksPreFullscreenState = [];
  92652. for (var i2 = 0; i2 < textTracks.length; i2++) {
  92653. var track = textTracks[i2];
  92654. if (track.kind === "metadata") {
  92655. metadataTracksPreFullscreenState.push({
  92656. track,
  92657. storedMode: track.mode
  92658. });
  92659. }
  92660. }
  92661. };
  92662. takeMetadataTrackSnapshot();
  92663. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92664. this.on("dispose", function() {
  92665. return textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92666. });
  92667. var restoreTrackMode = function restoreTrackMode2() {
  92668. for (var i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  92669. var storedTrack = metadataTracksPreFullscreenState[i2];
  92670. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  92671. storedTrack.track.mode = storedTrack.storedMode;
  92672. }
  92673. }
  92674. textTracks.removeEventListener("change", restoreTrackMode2);
  92675. };
  92676. this.on("webkitbeginfullscreen", function() {
  92677. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92678. textTracks.removeEventListener("change", restoreTrackMode);
  92679. textTracks.addEventListener("change", restoreTrackMode);
  92680. });
  92681. this.on("webkitendfullscreen", function() {
  92682. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92683. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92684. textTracks.removeEventListener("change", restoreTrackMode);
  92685. });
  92686. };
  92687. _proto.overrideNative_ = function overrideNative_(type2, override) {
  92688. var _this2 = this;
  92689. if (override !== this["featuresNative" + type2 + "Tracks"]) {
  92690. return;
  92691. }
  92692. var lowerCaseType = type2.toLowerCase();
  92693. if (this[lowerCaseType + "TracksListeners_"]) {
  92694. Object.keys(this[lowerCaseType + "TracksListeners_"]).forEach(function(eventName) {
  92695. var elTracks = _this2.el()[lowerCaseType + "Tracks"];
  92696. elTracks.removeEventListener(eventName, _this2[lowerCaseType + "TracksListeners_"][eventName]);
  92697. });
  92698. }
  92699. this["featuresNative" + type2 + "Tracks"] = !override;
  92700. this[lowerCaseType + "TracksListeners_"] = null;
  92701. this.proxyNativeTracksForType_(lowerCaseType);
  92702. };
  92703. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {
  92704. this.overrideNative_("Audio", override);
  92705. };
  92706. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {
  92707. this.overrideNative_("Video", override);
  92708. };
  92709. _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {
  92710. var _this3 = this;
  92711. var props = NORMAL[name];
  92712. var elTracks = this.el()[props.getterName];
  92713. var techTracks = this[props.getterName]();
  92714. if (!this["featuresNative" + props.capitalName + "Tracks"] || !elTracks || !elTracks.addEventListener) {
  92715. return;
  92716. }
  92717. var listeners = {
  92718. change: function change(e) {
  92719. var event2 = {
  92720. type: "change",
  92721. target: techTracks,
  92722. currentTarget: techTracks,
  92723. srcElement: techTracks
  92724. };
  92725. techTracks.trigger(event2);
  92726. if (name === "text") {
  92727. _this3[REMOTE.remoteText.getterName]().trigger(event2);
  92728. }
  92729. },
  92730. addtrack: function addtrack(e) {
  92731. techTracks.addTrack(e.track);
  92732. },
  92733. removetrack: function removetrack(e) {
  92734. techTracks.removeTrack(e.track);
  92735. }
  92736. };
  92737. var removeOldTracks = function removeOldTracks2() {
  92738. var removeTracks = [];
  92739. for (var i2 = 0; i2 < techTracks.length; i2++) {
  92740. var found = false;
  92741. for (var j = 0; j < elTracks.length; j++) {
  92742. if (elTracks[j] === techTracks[i2]) {
  92743. found = true;
  92744. break;
  92745. }
  92746. }
  92747. if (!found) {
  92748. removeTracks.push(techTracks[i2]);
  92749. }
  92750. }
  92751. while (removeTracks.length) {
  92752. techTracks.removeTrack(removeTracks.shift());
  92753. }
  92754. };
  92755. this[props.getterName + "Listeners_"] = listeners;
  92756. Object.keys(listeners).forEach(function(eventName) {
  92757. var listener = listeners[eventName];
  92758. elTracks.addEventListener(eventName, listener);
  92759. _this3.on("dispose", function(e) {
  92760. return elTracks.removeEventListener(eventName, listener);
  92761. });
  92762. });
  92763. this.on("loadstart", removeOldTracks);
  92764. this.on("dispose", function(e) {
  92765. return _this3.off("loadstart", removeOldTracks);
  92766. });
  92767. };
  92768. _proto.proxyNativeTracks_ = function proxyNativeTracks_() {
  92769. var _this4 = this;
  92770. NORMAL.names.forEach(function(name) {
  92771. _this4.proxyNativeTracksForType_(name);
  92772. });
  92773. };
  92774. _proto.createEl = function createEl2() {
  92775. var el = this.options_.tag;
  92776. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  92777. if (el) {
  92778. var clone = el.cloneNode(true);
  92779. if (el.parentNode) {
  92780. el.parentNode.insertBefore(clone, el);
  92781. }
  92782. Html52.disposeMediaElement(el);
  92783. el = clone;
  92784. } else {
  92785. el = document_1.createElement("video");
  92786. var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);
  92787. var attributes = mergeOptions$3({}, tagAttributes);
  92788. if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {
  92789. delete attributes.controls;
  92790. }
  92791. setAttributes(el, assign(attributes, {
  92792. id: this.options_.techId,
  92793. "class": "vjs-tech"
  92794. }));
  92795. }
  92796. el.playerId = this.options_.playerId;
  92797. }
  92798. if (typeof this.options_.preload !== "undefined") {
  92799. setAttribute(el, "preload", this.options_.preload);
  92800. }
  92801. if (this.options_.disablePictureInPicture !== void 0) {
  92802. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  92803. }
  92804. var settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  92805. for (var i2 = 0; i2 < settingsAttrs.length; i2++) {
  92806. var attr = settingsAttrs[i2];
  92807. var value = this.options_[attr];
  92808. if (typeof value !== "undefined") {
  92809. if (value) {
  92810. setAttribute(el, attr, attr);
  92811. } else {
  92812. removeAttribute(el, attr);
  92813. }
  92814. el[attr] = value;
  92815. }
  92816. }
  92817. return el;
  92818. };
  92819. _proto.handleLateInit_ = function handleLateInit_(el) {
  92820. if (el.networkState === 0 || el.networkState === 3) {
  92821. return;
  92822. }
  92823. if (el.readyState === 0) {
  92824. var loadstartFired = false;
  92825. var setLoadstartFired = function setLoadstartFired2() {
  92826. loadstartFired = true;
  92827. };
  92828. this.on("loadstart", setLoadstartFired);
  92829. var triggerLoadstart = function triggerLoadstart2() {
  92830. if (!loadstartFired) {
  92831. this.trigger("loadstart");
  92832. }
  92833. };
  92834. this.on("loadedmetadata", triggerLoadstart);
  92835. this.ready(function() {
  92836. this.off("loadstart", setLoadstartFired);
  92837. this.off("loadedmetadata", triggerLoadstart);
  92838. if (!loadstartFired) {
  92839. this.trigger("loadstart");
  92840. }
  92841. });
  92842. return;
  92843. }
  92844. var eventsToTrigger = ["loadstart"];
  92845. eventsToTrigger.push("loadedmetadata");
  92846. if (el.readyState >= 2) {
  92847. eventsToTrigger.push("loadeddata");
  92848. }
  92849. if (el.readyState >= 3) {
  92850. eventsToTrigger.push("canplay");
  92851. }
  92852. if (el.readyState >= 4) {
  92853. eventsToTrigger.push("canplaythrough");
  92854. }
  92855. this.ready(function() {
  92856. eventsToTrigger.forEach(function(type2) {
  92857. this.trigger(type2);
  92858. }, this);
  92859. });
  92860. };
  92861. _proto.setScrubbing = function setScrubbing(isScrubbing) {
  92862. this.isScrubbing_ = isScrubbing;
  92863. };
  92864. _proto.scrubbing = function scrubbing() {
  92865. return this.isScrubbing_;
  92866. };
  92867. _proto.setCurrentTime = function setCurrentTime(seconds) {
  92868. try {
  92869. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {
  92870. this.el_.fastSeek(seconds);
  92871. } else {
  92872. this.el_.currentTime = seconds;
  92873. }
  92874. } catch (e) {
  92875. log$1(e, "Video is not ready. (Video.js)");
  92876. }
  92877. };
  92878. _proto.duration = function duration5() {
  92879. var _this5 = this;
  92880. if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {
  92881. var checkProgress = function checkProgress2() {
  92882. if (_this5.el_.currentTime > 0) {
  92883. if (_this5.el_.duration === Infinity) {
  92884. _this5.trigger("durationchange");
  92885. }
  92886. _this5.off("timeupdate", checkProgress2);
  92887. }
  92888. };
  92889. this.on("timeupdate", checkProgress);
  92890. return NaN;
  92891. }
  92892. return this.el_.duration || NaN;
  92893. };
  92894. _proto.width = function width2() {
  92895. return this.el_.offsetWidth;
  92896. };
  92897. _proto.height = function height2() {
  92898. return this.el_.offsetHeight;
  92899. };
  92900. _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {
  92901. var _this6 = this;
  92902. if (!("webkitDisplayingFullscreen" in this.el_)) {
  92903. return;
  92904. }
  92905. var endFn = function endFn2() {
  92906. this.trigger("fullscreenchange", {
  92907. isFullscreen: false
  92908. });
  92909. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  92910. this.el_.controls = false;
  92911. }
  92912. };
  92913. var beginFn = function beginFn2() {
  92914. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  92915. this.one("webkitendfullscreen", endFn);
  92916. this.trigger("fullscreenchange", {
  92917. isFullscreen: true,
  92918. nativeIOSFullscreen: true
  92919. });
  92920. }
  92921. };
  92922. this.on("webkitbeginfullscreen", beginFn);
  92923. this.on("dispose", function() {
  92924. _this6.off("webkitbeginfullscreen", beginFn);
  92925. _this6.off("webkitendfullscreen", endFn);
  92926. });
  92927. };
  92928. _proto.supportsFullScreen = function supportsFullScreen() {
  92929. if (typeof this.el_.webkitEnterFullScreen === "function") {
  92930. var userAgent = window_1.navigator && window_1.navigator.userAgent || "";
  92931. if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {
  92932. return true;
  92933. }
  92934. }
  92935. return false;
  92936. };
  92937. _proto.enterFullScreen = function enterFullScreen() {
  92938. var video = this.el_;
  92939. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  92940. silencePromise(this.el_.play());
  92941. this.setTimeout(function() {
  92942. video.pause();
  92943. try {
  92944. video.webkitEnterFullScreen();
  92945. } catch (e) {
  92946. this.trigger("fullscreenerror", e);
  92947. }
  92948. }, 0);
  92949. } else {
  92950. try {
  92951. video.webkitEnterFullScreen();
  92952. } catch (e) {
  92953. this.trigger("fullscreenerror", e);
  92954. }
  92955. }
  92956. };
  92957. _proto.exitFullScreen = function exitFullScreen() {
  92958. if (!this.el_.webkitDisplayingFullscreen) {
  92959. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  92960. return;
  92961. }
  92962. this.el_.webkitExitFullScreen();
  92963. };
  92964. _proto.requestPictureInPicture = function requestPictureInPicture() {
  92965. return this.el_.requestPictureInPicture();
  92966. };
  92967. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  92968. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  92969. return this.el_.requestVideoFrameCallback(cb);
  92970. }
  92971. return _Tech.prototype.requestVideoFrameCallback.call(this, cb);
  92972. };
  92973. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  92974. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  92975. this.el_.cancelVideoFrameCallback(id);
  92976. } else {
  92977. _Tech.prototype.cancelVideoFrameCallback.call(this, id);
  92978. }
  92979. };
  92980. _proto.src = function src(_src) {
  92981. if (_src === void 0) {
  92982. return this.el_.src;
  92983. }
  92984. this.setSrc(_src);
  92985. };
  92986. _proto.reset = function reset3() {
  92987. Html52.resetMediaElement(this.el_);
  92988. };
  92989. _proto.currentSrc = function currentSrc() {
  92990. if (this.currentSource_) {
  92991. return this.currentSource_.src;
  92992. }
  92993. return this.el_.currentSrc;
  92994. };
  92995. _proto.setControls = function setControls(val) {
  92996. this.el_.controls = !!val;
  92997. };
  92998. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  92999. if (!this.featuresNativeTextTracks) {
  93000. return _Tech.prototype.addTextTrack.call(this, kind, label, language);
  93001. }
  93002. return this.el_.addTextTrack(kind, label, language);
  93003. };
  93004. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  93005. if (!this.featuresNativeTextTracks) {
  93006. return _Tech.prototype.createRemoteTextTrack.call(this, options2);
  93007. }
  93008. var htmlTrackElement = document_1.createElement("track");
  93009. if (options2.kind) {
  93010. htmlTrackElement.kind = options2.kind;
  93011. }
  93012. if (options2.label) {
  93013. htmlTrackElement.label = options2.label;
  93014. }
  93015. if (options2.language || options2.srclang) {
  93016. htmlTrackElement.srclang = options2.language || options2.srclang;
  93017. }
  93018. if (options2["default"]) {
  93019. htmlTrackElement["default"] = options2["default"];
  93020. }
  93021. if (options2.id) {
  93022. htmlTrackElement.id = options2.id;
  93023. }
  93024. if (options2.src) {
  93025. htmlTrackElement.src = options2.src;
  93026. }
  93027. return htmlTrackElement;
  93028. };
  93029. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  93030. var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options2, manualCleanup);
  93031. if (this.featuresNativeTextTracks) {
  93032. this.el().appendChild(htmlTrackElement);
  93033. }
  93034. return htmlTrackElement;
  93035. };
  93036. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  93037. _Tech.prototype.removeRemoteTextTrack.call(this, track);
  93038. if (this.featuresNativeTextTracks) {
  93039. var tracks = this.$$("track");
  93040. var i2 = tracks.length;
  93041. while (i2--) {
  93042. if (track === tracks[i2] || track === tracks[i2].track) {
  93043. this.el().removeChild(tracks[i2]);
  93044. }
  93045. }
  93046. }
  93047. };
  93048. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  93049. if (typeof this.el().getVideoPlaybackQuality === "function") {
  93050. return this.el().getVideoPlaybackQuality();
  93051. }
  93052. var videoPlaybackQuality = {};
  93053. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  93054. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  93055. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  93056. }
  93057. if (window_1.performance && typeof window_1.performance.now === "function") {
  93058. videoPlaybackQuality.creationTime = window_1.performance.now();
  93059. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  93060. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  93061. }
  93062. return videoPlaybackQuality;
  93063. };
  93064. return Html52;
  93065. }(Tech$1);
  93066. defineLazyProperty(Html5$1, "TEST_VID", function() {
  93067. if (!isReal()) {
  93068. return;
  93069. }
  93070. var video = document_1.createElement("video");
  93071. var track = document_1.createElement("track");
  93072. track.kind = "captions";
  93073. track.srclang = "en";
  93074. track.label = "English";
  93075. video.appendChild(track);
  93076. return video;
  93077. });
  93078. Html5$1.isSupported = function() {
  93079. try {
  93080. Html5$1.TEST_VID.volume = 0.5;
  93081. } catch (e) {
  93082. return false;
  93083. }
  93084. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.canPlayType);
  93085. };
  93086. Html5$1.canPlayType = function(type2) {
  93087. return Html5$1.TEST_VID.canPlayType(type2);
  93088. };
  93089. Html5$1.canPlaySource = function(srcObj, options2) {
  93090. return Html5$1.canPlayType(srcObj.type);
  93091. };
  93092. Html5$1.canControlVolume = function() {
  93093. try {
  93094. var volume = Html5$1.TEST_VID.volume;
  93095. Html5$1.TEST_VID.volume = volume / 2 + 0.1;
  93096. var canControl = volume !== Html5$1.TEST_VID.volume;
  93097. if (canControl && IS_IOS) {
  93098. window_1.setTimeout(function() {
  93099. if (Html5$1 && Html5$1.prototype) {
  93100. Html5$1.prototype.featuresVolumeControl = volume !== Html5$1.TEST_VID.volume;
  93101. }
  93102. });
  93103. return false;
  93104. }
  93105. return canControl;
  93106. } catch (e) {
  93107. return false;
  93108. }
  93109. };
  93110. Html5$1.canMuteVolume = function() {
  93111. try {
  93112. var muted = Html5$1.TEST_VID.muted;
  93113. Html5$1.TEST_VID.muted = !muted;
  93114. if (Html5$1.TEST_VID.muted) {
  93115. setAttribute(Html5$1.TEST_VID, "muted", "muted");
  93116. } else {
  93117. removeAttribute(Html5$1.TEST_VID, "muted", "muted");
  93118. }
  93119. return muted !== Html5$1.TEST_VID.muted;
  93120. } catch (e) {
  93121. return false;
  93122. }
  93123. };
  93124. Html5$1.canControlPlaybackRate = function() {
  93125. if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {
  93126. return false;
  93127. }
  93128. try {
  93129. var playbackRate = Html5$1.TEST_VID.playbackRate;
  93130. Html5$1.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  93131. return playbackRate !== Html5$1.TEST_VID.playbackRate;
  93132. } catch (e) {
  93133. return false;
  93134. }
  93135. };
  93136. Html5$1.canOverrideAttributes = function() {
  93137. try {
  93138. var noop2 = function noop3() {
  93139. };
  93140. Object.defineProperty(document_1.createElement("video"), "src", {
  93141. get: noop2,
  93142. set: noop2
  93143. });
  93144. Object.defineProperty(document_1.createElement("audio"), "src", {
  93145. get: noop2,
  93146. set: noop2
  93147. });
  93148. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  93149. get: noop2,
  93150. set: noop2
  93151. });
  93152. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  93153. get: noop2,
  93154. set: noop2
  93155. });
  93156. } catch (e) {
  93157. return false;
  93158. }
  93159. return true;
  93160. };
  93161. Html5$1.supportsNativeTextTracks = function() {
  93162. return IS_ANY_SAFARI || IS_IOS && IS_CHROME;
  93163. };
  93164. Html5$1.supportsNativeVideoTracks = function() {
  93165. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.videoTracks);
  93166. };
  93167. Html5$1.supportsNativeAudioTracks = function() {
  93168. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.audioTracks);
  93169. };
  93170. Html5$1.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  93171. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(_ref) {
  93172. var key = _ref[0], fn2 = _ref[1];
  93173. defineLazyProperty(Html5$1.prototype, key, function() {
  93174. return Html5$1[fn2]();
  93175. }, true);
  93176. });
  93177. Html5$1.prototype.featuresVolumeControl = Html5$1.canControlVolume();
  93178. Html5$1.prototype.movingMediaElementInDOM = !IS_IOS;
  93179. Html5$1.prototype.featuresFullscreenResize = true;
  93180. Html5$1.prototype.featuresProgressEvents = true;
  93181. Html5$1.prototype.featuresTimeupdateEvents = true;
  93182. Html5$1.prototype.featuresVideoFrameCallback = !!(Html5$1.TEST_VID && Html5$1.TEST_VID.requestVideoFrameCallback);
  93183. var canPlayType;
  93184. Html5$1.patchCanPlayType = function() {
  93185. if (ANDROID_VERSION >= 4 && !IS_FIREFOX && !IS_CHROME) {
  93186. canPlayType = Html5$1.TEST_VID && Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93187. Html5$1.TEST_VID.constructor.prototype.canPlayType = function(type2) {
  93188. var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i;
  93189. if (type2 && mpegurlRE.test(type2)) {
  93190. return "maybe";
  93191. }
  93192. return canPlayType.call(this, type2);
  93193. };
  93194. }
  93195. };
  93196. Html5$1.unpatchCanPlayType = function() {
  93197. var r2 = Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93198. if (canPlayType) {
  93199. Html5$1.TEST_VID.constructor.prototype.canPlayType = canPlayType;
  93200. }
  93201. return r2;
  93202. };
  93203. Html5$1.patchCanPlayType();
  93204. Html5$1.disposeMediaElement = function(el) {
  93205. if (!el) {
  93206. return;
  93207. }
  93208. if (el.parentNode) {
  93209. el.parentNode.removeChild(el);
  93210. }
  93211. while (el.hasChildNodes()) {
  93212. el.removeChild(el.firstChild);
  93213. }
  93214. el.removeAttribute("src");
  93215. if (typeof el.load === "function") {
  93216. (function() {
  93217. try {
  93218. el.load();
  93219. } catch (e) {
  93220. }
  93221. })();
  93222. }
  93223. };
  93224. Html5$1.resetMediaElement = function(el) {
  93225. if (!el) {
  93226. return;
  93227. }
  93228. var sources = el.querySelectorAll("source");
  93229. var i2 = sources.length;
  93230. while (i2--) {
  93231. el.removeChild(sources[i2]);
  93232. }
  93233. el.removeAttribute("src");
  93234. if (typeof el.load === "function") {
  93235. (function() {
  93236. try {
  93237. el.load();
  93238. } catch (e) {
  93239. }
  93240. })();
  93241. }
  93242. };
  93243. [
  93244. "muted",
  93245. "defaultMuted",
  93246. "autoplay",
  93247. "controls",
  93248. "loop",
  93249. "playsinline"
  93250. ].forEach(function(prop) {
  93251. Html5$1.prototype[prop] = function() {
  93252. return this.el_[prop] || this.el_.hasAttribute(prop);
  93253. };
  93254. });
  93255. [
  93256. "muted",
  93257. "defaultMuted",
  93258. "autoplay",
  93259. "loop",
  93260. "playsinline"
  93261. ].forEach(function(prop) {
  93262. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93263. this.el_[prop] = v;
  93264. if (v) {
  93265. this.el_.setAttribute(prop, prop);
  93266. } else {
  93267. this.el_.removeAttribute(prop);
  93268. }
  93269. };
  93270. });
  93271. [
  93272. "paused",
  93273. "currentTime",
  93274. "buffered",
  93275. "volume",
  93276. "poster",
  93277. "preload",
  93278. "error",
  93279. "seeking",
  93280. "seekable",
  93281. "ended",
  93282. "playbackRate",
  93283. "defaultPlaybackRate",
  93284. "disablePictureInPicture",
  93285. "played",
  93286. "networkState",
  93287. "readyState",
  93288. "videoWidth",
  93289. "videoHeight",
  93290. "crossOrigin"
  93291. ].forEach(function(prop) {
  93292. Html5$1.prototype[prop] = function() {
  93293. return this.el_[prop];
  93294. };
  93295. });
  93296. [
  93297. "volume",
  93298. "src",
  93299. "poster",
  93300. "preload",
  93301. "playbackRate",
  93302. "defaultPlaybackRate",
  93303. "disablePictureInPicture",
  93304. "crossOrigin"
  93305. ].forEach(function(prop) {
  93306. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93307. this.el_[prop] = v;
  93308. };
  93309. });
  93310. [
  93311. "pause",
  93312. "load",
  93313. "play"
  93314. ].forEach(function(prop) {
  93315. Html5$1.prototype[prop] = function() {
  93316. return this.el_[prop]();
  93317. };
  93318. });
  93319. Tech$1.withSourceHandlers(Html5$1);
  93320. Html5$1.nativeSourceHandler = {};
  93321. Html5$1.nativeSourceHandler.canPlayType = function(type2) {
  93322. try {
  93323. return Html5$1.TEST_VID.canPlayType(type2);
  93324. } catch (e) {
  93325. return "";
  93326. }
  93327. };
  93328. Html5$1.nativeSourceHandler.canHandleSource = function(source, options2) {
  93329. if (source.type) {
  93330. return Html5$1.nativeSourceHandler.canPlayType(source.type);
  93331. } else if (source.src) {
  93332. var ext = getFileExtension(source.src);
  93333. return Html5$1.nativeSourceHandler.canPlayType("video/" + ext);
  93334. }
  93335. return "";
  93336. };
  93337. Html5$1.nativeSourceHandler.handleSource = function(source, tech, options2) {
  93338. tech.setSrc(source.src);
  93339. };
  93340. Html5$1.nativeSourceHandler.dispose = function() {
  93341. };
  93342. Html5$1.registerSourceHandler(Html5$1.nativeSourceHandler);
  93343. Tech$1.registerTech("Html5", Html5$1);
  93344. var TECH_EVENTS_RETRIGGER = [
  93345. "progress",
  93346. "abort",
  93347. "suspend",
  93348. "emptied",
  93349. "stalled",
  93350. "loadedmetadata",
  93351. "loadeddata",
  93352. "timeupdate",
  93353. "resize",
  93354. "volumechange",
  93355. "texttrackchange"
  93356. ];
  93357. var TECH_EVENTS_QUEUE = {
  93358. canplay: "CanPlay",
  93359. canplaythrough: "CanPlayThrough",
  93360. playing: "Playing",
  93361. seeked: "Seeked"
  93362. };
  93363. var BREAKPOINT_ORDER = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  93364. var BREAKPOINT_CLASSES = {};
  93365. BREAKPOINT_ORDER.forEach(function(k) {
  93366. var v = k.charAt(0) === "x" ? "x-" + k.substring(1) : k;
  93367. BREAKPOINT_CLASSES[k] = "vjs-layout-" + v;
  93368. });
  93369. var DEFAULT_BREAKPOINTS = {
  93370. tiny: 210,
  93371. xsmall: 320,
  93372. small: 425,
  93373. medium: 768,
  93374. large: 1440,
  93375. xlarge: 2560,
  93376. huge: Infinity
  93377. };
  93378. var Player = /* @__PURE__ */ function(_Component) {
  93379. _inheritsLoose(Player2, _Component);
  93380. function Player2(tag, options2, ready) {
  93381. var _this;
  93382. tag.id = tag.id || options2.id || "vjs_video_" + newGUID();
  93383. options2 = assign(Player2.getTagSettings(tag), options2);
  93384. options2.initChildren = false;
  93385. options2.createEl = false;
  93386. options2.evented = false;
  93387. options2.reportTouchActivity = false;
  93388. if (!options2.language) {
  93389. if (typeof tag.closest === "function") {
  93390. var closest = tag.closest("[lang]");
  93391. if (closest && closest.getAttribute) {
  93392. options2.language = closest.getAttribute("lang");
  93393. }
  93394. } else {
  93395. var element = tag;
  93396. while (element && element.nodeType === 1) {
  93397. if (getAttributes(element).hasOwnProperty("lang")) {
  93398. options2.language = element.getAttribute("lang");
  93399. break;
  93400. }
  93401. element = element.parentNode;
  93402. }
  93403. }
  93404. }
  93405. _this = _Component.call(this, null, options2, ready) || this;
  93406. _this.boundDocumentFullscreenChange_ = function(e) {
  93407. return _this.documentFullscreenChange_(e);
  93408. };
  93409. _this.boundFullWindowOnEscKey_ = function(e) {
  93410. return _this.fullWindowOnEscKey(e);
  93411. };
  93412. _this.boundUpdateStyleEl_ = function(e) {
  93413. return _this.updateStyleEl_(e);
  93414. };
  93415. _this.boundApplyInitTime_ = function(e) {
  93416. return _this.applyInitTime_(e);
  93417. };
  93418. _this.boundUpdateCurrentBreakpoint_ = function(e) {
  93419. return _this.updateCurrentBreakpoint_(e);
  93420. };
  93421. _this.boundHandleTechClick_ = function(e) {
  93422. return _this.handleTechClick_(e);
  93423. };
  93424. _this.boundHandleTechDoubleClick_ = function(e) {
  93425. return _this.handleTechDoubleClick_(e);
  93426. };
  93427. _this.boundHandleTechTouchStart_ = function(e) {
  93428. return _this.handleTechTouchStart_(e);
  93429. };
  93430. _this.boundHandleTechTouchMove_ = function(e) {
  93431. return _this.handleTechTouchMove_(e);
  93432. };
  93433. _this.boundHandleTechTouchEnd_ = function(e) {
  93434. return _this.handleTechTouchEnd_(e);
  93435. };
  93436. _this.boundHandleTechTap_ = function(e) {
  93437. return _this.handleTechTap_(e);
  93438. };
  93439. _this.isFullscreen_ = false;
  93440. _this.log = createLogger(_this.id_);
  93441. _this.fsApi_ = FullscreenApi;
  93442. _this.isPosterFromTech_ = false;
  93443. _this.queuedCallbacks_ = [];
  93444. _this.isReady_ = false;
  93445. _this.hasStarted_ = false;
  93446. _this.userActive_ = false;
  93447. _this.debugEnabled_ = false;
  93448. _this.audioOnlyMode_ = false;
  93449. _this.audioPosterMode_ = false;
  93450. _this.audioOnlyCache_ = {
  93451. playerHeight: null,
  93452. hiddenChildren: []
  93453. };
  93454. if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {
  93455. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  93456. }
  93457. _this.tag = tag;
  93458. _this.tagAttributes = tag && getAttributes(tag);
  93459. _this.language(_this.options_.language);
  93460. if (options2.languages) {
  93461. var languagesToLower = {};
  93462. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  93463. languagesToLower[name.toLowerCase()] = options2.languages[name];
  93464. });
  93465. _this.languages_ = languagesToLower;
  93466. } else {
  93467. _this.languages_ = Player2.prototype.options_.languages;
  93468. }
  93469. _this.resetCache_();
  93470. _this.poster_ = options2.poster || "";
  93471. _this.controls_ = !!options2.controls;
  93472. tag.controls = false;
  93473. tag.removeAttribute("controls");
  93474. _this.changingSrc_ = false;
  93475. _this.playCallbacks_ = [];
  93476. _this.playTerminatedQueue_ = [];
  93477. if (tag.hasAttribute("autoplay")) {
  93478. _this.autoplay(true);
  93479. } else {
  93480. _this.autoplay(_this.options_.autoplay);
  93481. }
  93482. if (options2.plugins) {
  93483. Object.keys(options2.plugins).forEach(function(name) {
  93484. if (typeof _this[name] !== "function") {
  93485. throw new Error('plugin "' + name + '" does not exist');
  93486. }
  93487. });
  93488. }
  93489. _this.scrubbing_ = false;
  93490. _this.el_ = _this.createEl();
  93491. evented(_assertThisInitialized(_this), {
  93492. eventBusKey: "el_"
  93493. });
  93494. if (_this.fsApi_.requestFullscreen) {
  93495. on(document_1, _this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93496. _this.on(_this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93497. }
  93498. if (_this.fluid_) {
  93499. _this.on(["playerreset", "resize"], _this.boundUpdateStyleEl_);
  93500. }
  93501. var playerOptionsCopy = mergeOptions$3(_this.options_);
  93502. if (options2.plugins) {
  93503. Object.keys(options2.plugins).forEach(function(name) {
  93504. _this[name](options2.plugins[name]);
  93505. });
  93506. }
  93507. if (options2.debug) {
  93508. _this.debug(true);
  93509. }
  93510. _this.options_.playerOptions = playerOptionsCopy;
  93511. _this.middleware_ = [];
  93512. _this.playbackRates(options2.playbackRates);
  93513. _this.initChildren();
  93514. _this.isAudio(tag.nodeName.toLowerCase() === "audio");
  93515. if (_this.controls()) {
  93516. _this.addClass("vjs-controls-enabled");
  93517. } else {
  93518. _this.addClass("vjs-controls-disabled");
  93519. }
  93520. _this.el_.setAttribute("role", "region");
  93521. if (_this.isAudio()) {
  93522. _this.el_.setAttribute("aria-label", _this.localize("Audio Player"));
  93523. } else {
  93524. _this.el_.setAttribute("aria-label", _this.localize("Video Player"));
  93525. }
  93526. if (_this.isAudio()) {
  93527. _this.addClass("vjs-audio");
  93528. }
  93529. if (_this.flexNotSupported_()) {
  93530. _this.addClass("vjs-no-flex");
  93531. }
  93532. if (TOUCH_ENABLED) {
  93533. _this.addClass("vjs-touch-enabled");
  93534. }
  93535. if (!IS_IOS) {
  93536. _this.addClass("vjs-workinghover");
  93537. }
  93538. Player2.players[_this.id_] = _assertThisInitialized(_this);
  93539. var majorVersion = version$5.split(".")[0];
  93540. _this.addClass("vjs-v" + majorVersion);
  93541. _this.userActive(true);
  93542. _this.reportUserActivity();
  93543. _this.one("play", function(e) {
  93544. return _this.listenForUserActivity_(e);
  93545. });
  93546. _this.on("stageclick", function(e) {
  93547. return _this.handleStageClick_(e);
  93548. });
  93549. _this.on("keydown", function(e) {
  93550. return _this.handleKeyDown(e);
  93551. });
  93552. _this.on("languagechange", function(e) {
  93553. return _this.handleLanguagechange(e);
  93554. });
  93555. _this.breakpoints(_this.options_.breakpoints);
  93556. _this.responsive(_this.options_.responsive);
  93557. _this.on("ready", function() {
  93558. _this.audioPosterMode(_this.options_.audioPosterMode);
  93559. _this.audioOnlyMode(_this.options_.audioOnlyMode);
  93560. });
  93561. return _this;
  93562. }
  93563. var _proto = Player2.prototype;
  93564. _proto.dispose = function dispose() {
  93565. var _this2 = this;
  93566. this.trigger("dispose");
  93567. this.off("dispose");
  93568. off(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  93569. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  93570. if (this.styleEl_ && this.styleEl_.parentNode) {
  93571. this.styleEl_.parentNode.removeChild(this.styleEl_);
  93572. this.styleEl_ = null;
  93573. }
  93574. Player2.players[this.id_] = null;
  93575. if (this.tag && this.tag.player) {
  93576. this.tag.player = null;
  93577. }
  93578. if (this.el_ && this.el_.player) {
  93579. this.el_.player = null;
  93580. }
  93581. if (this.tech_) {
  93582. this.tech_.dispose();
  93583. this.isPosterFromTech_ = false;
  93584. this.poster_ = "";
  93585. }
  93586. if (this.playerElIngest_) {
  93587. this.playerElIngest_ = null;
  93588. }
  93589. if (this.tag) {
  93590. this.tag = null;
  93591. }
  93592. clearCacheForPlayer(this);
  93593. ALL.names.forEach(function(name) {
  93594. var props = ALL[name];
  93595. var list = _this2[props.getterName]();
  93596. if (list && list.off) {
  93597. list.off();
  93598. }
  93599. });
  93600. _Component.prototype.dispose.call(this, {
  93601. restoreEl: this.options_.restoreEl
  93602. });
  93603. };
  93604. _proto.createEl = function createEl2() {
  93605. var tag = this.tag;
  93606. var el;
  93607. var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  93608. var divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  93609. if (playerElIngest) {
  93610. el = this.el_ = tag.parentNode;
  93611. } else if (!divEmbed) {
  93612. el = this.el_ = _Component.prototype.createEl.call(this, "div");
  93613. }
  93614. var attrs = getAttributes(tag);
  93615. if (divEmbed) {
  93616. el = this.el_ = tag;
  93617. tag = this.tag = document_1.createElement("video");
  93618. while (el.children.length) {
  93619. tag.appendChild(el.firstChild);
  93620. }
  93621. if (!hasClass(el, "video-js")) {
  93622. addClass(el, "video-js");
  93623. }
  93624. el.appendChild(tag);
  93625. playerElIngest = this.playerElIngest_ = el;
  93626. Object.keys(el).forEach(function(k) {
  93627. try {
  93628. tag[k] = el[k];
  93629. } catch (e) {
  93630. }
  93631. });
  93632. }
  93633. tag.setAttribute("tabindex", "-1");
  93634. attrs.tabindex = "-1";
  93635. if (IE_VERSION || IS_CHROME && IS_WINDOWS) {
  93636. tag.setAttribute("role", "application");
  93637. attrs.role = "application";
  93638. }
  93639. tag.removeAttribute("width");
  93640. tag.removeAttribute("height");
  93641. if ("width" in attrs) {
  93642. delete attrs.width;
  93643. }
  93644. if ("height" in attrs) {
  93645. delete attrs.height;
  93646. }
  93647. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  93648. if (!(divEmbed && attr === "class")) {
  93649. el.setAttribute(attr, attrs[attr]);
  93650. }
  93651. if (divEmbed) {
  93652. tag.setAttribute(attr, attrs[attr]);
  93653. }
  93654. });
  93655. tag.playerId = tag.id;
  93656. tag.id += "_html5_api";
  93657. tag.className = "vjs-tech";
  93658. tag.player = el.player = this;
  93659. this.addClass("vjs-paused");
  93660. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  93661. this.styleEl_ = createStyleElement("vjs-styles-dimensions");
  93662. var defaultsStyleEl = $(".vjs-styles-defaults");
  93663. var head = $("head");
  93664. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  93665. }
  93666. this.fill_ = false;
  93667. this.fluid_ = false;
  93668. this.width(this.options_.width);
  93669. this.height(this.options_.height);
  93670. this.fill(this.options_.fill);
  93671. this.fluid(this.options_.fluid);
  93672. this.aspectRatio(this.options_.aspectRatio);
  93673. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  93674. var links = tag.getElementsByTagName("a");
  93675. for (var i2 = 0; i2 < links.length; i2++) {
  93676. var linkEl = links.item(i2);
  93677. addClass(linkEl, "vjs-hidden");
  93678. linkEl.setAttribute("hidden", "hidden");
  93679. }
  93680. tag.initNetworkState_ = tag.networkState;
  93681. if (tag.parentNode && !playerElIngest) {
  93682. tag.parentNode.insertBefore(el, tag);
  93683. }
  93684. prependTo(tag, el);
  93685. this.children_.unshift(tag);
  93686. this.el_.setAttribute("lang", this.language_);
  93687. this.el_.setAttribute("translate", "no");
  93688. this.el_ = el;
  93689. return el;
  93690. };
  93691. _proto.crossOrigin = function crossOrigin(value) {
  93692. if (!value) {
  93693. return this.techGet_("crossOrigin");
  93694. }
  93695. if (value !== "anonymous" && value !== "use-credentials") {
  93696. log$1.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + value + '"');
  93697. return;
  93698. }
  93699. this.techCall_("setCrossOrigin", value);
  93700. return;
  93701. };
  93702. _proto.width = function width2(value) {
  93703. return this.dimension("width", value);
  93704. };
  93705. _proto.height = function height2(value) {
  93706. return this.dimension("height", value);
  93707. };
  93708. _proto.dimension = function dimension(_dimension, value) {
  93709. var privDimension = _dimension + "_";
  93710. if (value === void 0) {
  93711. return this[privDimension] || 0;
  93712. }
  93713. if (value === "" || value === "auto") {
  93714. this[privDimension] = void 0;
  93715. this.updateStyleEl_();
  93716. return;
  93717. }
  93718. var parsedVal = parseFloat(value);
  93719. if (isNaN(parsedVal)) {
  93720. log$1.error('Improper value "' + value + '" supplied for for ' + _dimension);
  93721. return;
  93722. }
  93723. this[privDimension] = parsedVal;
  93724. this.updateStyleEl_();
  93725. };
  93726. _proto.fluid = function fluid(bool) {
  93727. var _this3 = this;
  93728. if (bool === void 0) {
  93729. return !!this.fluid_;
  93730. }
  93731. this.fluid_ = !!bool;
  93732. if (isEvented(this)) {
  93733. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  93734. }
  93735. if (bool) {
  93736. this.addClass("vjs-fluid");
  93737. this.fill(false);
  93738. addEventedCallback(this, function() {
  93739. _this3.on(["playerreset", "resize"], _this3.boundUpdateStyleEl_);
  93740. });
  93741. } else {
  93742. this.removeClass("vjs-fluid");
  93743. }
  93744. this.updateStyleEl_();
  93745. };
  93746. _proto.fill = function fill(bool) {
  93747. if (bool === void 0) {
  93748. return !!this.fill_;
  93749. }
  93750. this.fill_ = !!bool;
  93751. if (bool) {
  93752. this.addClass("vjs-fill");
  93753. this.fluid(false);
  93754. } else {
  93755. this.removeClass("vjs-fill");
  93756. }
  93757. };
  93758. _proto.aspectRatio = function aspectRatio(ratio) {
  93759. if (ratio === void 0) {
  93760. return this.aspectRatio_;
  93761. }
  93762. if (!/^\d+\:\d+$/.test(ratio)) {
  93763. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  93764. }
  93765. this.aspectRatio_ = ratio;
  93766. this.fluid(true);
  93767. this.updateStyleEl_();
  93768. };
  93769. _proto.updateStyleEl_ = function updateStyleEl_() {
  93770. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  93771. var _width = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  93772. var _height = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  93773. var techEl = this.tech_ && this.tech_.el();
  93774. if (techEl) {
  93775. if (_width >= 0) {
  93776. techEl.width = _width;
  93777. }
  93778. if (_height >= 0) {
  93779. techEl.height = _height;
  93780. }
  93781. }
  93782. return;
  93783. }
  93784. var width2;
  93785. var height2;
  93786. var aspectRatio;
  93787. var idClass;
  93788. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  93789. aspectRatio = this.aspectRatio_;
  93790. } else if (this.videoWidth() > 0) {
  93791. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  93792. } else {
  93793. aspectRatio = "16:9";
  93794. }
  93795. var ratioParts = aspectRatio.split(":");
  93796. var ratioMultiplier = ratioParts[1] / ratioParts[0];
  93797. if (this.width_ !== void 0) {
  93798. width2 = this.width_;
  93799. } else if (this.height_ !== void 0) {
  93800. width2 = this.height_ / ratioMultiplier;
  93801. } else {
  93802. width2 = this.videoWidth() || 300;
  93803. }
  93804. if (this.height_ !== void 0) {
  93805. height2 = this.height_;
  93806. } else {
  93807. height2 = width2 * ratioMultiplier;
  93808. }
  93809. if (/^[^a-zA-Z]/.test(this.id())) {
  93810. idClass = "dimensions-" + this.id();
  93811. } else {
  93812. idClass = this.id() + "-dimensions";
  93813. }
  93814. this.addClass(idClass);
  93815. setTextContent(this.styleEl_, "\n ." + idClass + " {\n width: " + width2 + "px;\n height: " + height2 + "px;\n }\n\n ." + idClass + ".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: " + ratioMultiplier * 100 + "%;\n }\n ");
  93816. };
  93817. _proto.loadTech_ = function loadTech_(techName, source) {
  93818. var _this4 = this;
  93819. if (this.tech_) {
  93820. this.unloadTech_();
  93821. }
  93822. var titleTechName = toTitleCase$1(techName);
  93823. var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  93824. if (titleTechName !== "Html5" && this.tag) {
  93825. Tech$1.getTech("Html5").disposeMediaElement(this.tag);
  93826. this.tag.player = null;
  93827. this.tag = null;
  93828. }
  93829. this.techName_ = titleTechName;
  93830. this.isReady_ = false;
  93831. var autoplay = this.autoplay();
  93832. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  93833. autoplay = false;
  93834. }
  93835. var techOptions = {
  93836. source,
  93837. autoplay,
  93838. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  93839. "playerId": this.id(),
  93840. "techId": this.id() + "_" + camelTechName + "_api",
  93841. "playsinline": this.options_.playsinline,
  93842. "preload": this.options_.preload,
  93843. "loop": this.options_.loop,
  93844. "disablePictureInPicture": this.options_.disablePictureInPicture,
  93845. "muted": this.options_.muted,
  93846. "poster": this.poster(),
  93847. "language": this.language(),
  93848. "playerElIngest": this.playerElIngest_ || false,
  93849. "vtt.js": this.options_["vtt.js"],
  93850. "canOverridePoster": !!this.options_.techCanOverridePoster,
  93851. "enableSourceset": this.options_.enableSourceset,
  93852. "Promise": this.options_.Promise
  93853. };
  93854. ALL.names.forEach(function(name) {
  93855. var props = ALL[name];
  93856. techOptions[props.getterName] = _this4[props.privateName];
  93857. });
  93858. assign(techOptions, this.options_[titleTechName]);
  93859. assign(techOptions, this.options_[camelTechName]);
  93860. assign(techOptions, this.options_[techName.toLowerCase()]);
  93861. if (this.tag) {
  93862. techOptions.tag = this.tag;
  93863. }
  93864. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  93865. techOptions.startTime = this.cache_.currentTime;
  93866. }
  93867. var TechClass = Tech$1.getTech(techName);
  93868. if (!TechClass) {
  93869. throw new Error("No Tech named '" + titleTechName + "' exists! '" + titleTechName + "' should be registered using videojs.registerTech()'");
  93870. }
  93871. this.tech_ = new TechClass(techOptions);
  93872. this.tech_.ready(bind(this, this.handleTechReady_), true);
  93873. textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  93874. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  93875. _this4.on(_this4.tech_, event2, function(e) {
  93876. return _this4["handleTech" + toTitleCase$1(event2) + "_"](e);
  93877. });
  93878. });
  93879. Object.keys(TECH_EVENTS_QUEUE).forEach(function(event2) {
  93880. _this4.on(_this4.tech_, event2, function(eventObj) {
  93881. if (_this4.tech_.playbackRate() === 0 && _this4.tech_.seeking()) {
  93882. _this4.queuedCallbacks_.push({
  93883. callback: _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"].bind(_this4),
  93884. event: eventObj
  93885. });
  93886. return;
  93887. }
  93888. _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"](eventObj);
  93889. });
  93890. });
  93891. this.on(this.tech_, "loadstart", function(e) {
  93892. return _this4.handleTechLoadStart_(e);
  93893. });
  93894. this.on(this.tech_, "sourceset", function(e) {
  93895. return _this4.handleTechSourceset_(e);
  93896. });
  93897. this.on(this.tech_, "waiting", function(e) {
  93898. return _this4.handleTechWaiting_(e);
  93899. });
  93900. this.on(this.tech_, "ended", function(e) {
  93901. return _this4.handleTechEnded_(e);
  93902. });
  93903. this.on(this.tech_, "seeking", function(e) {
  93904. return _this4.handleTechSeeking_(e);
  93905. });
  93906. this.on(this.tech_, "play", function(e) {
  93907. return _this4.handleTechPlay_(e);
  93908. });
  93909. this.on(this.tech_, "firstplay", function(e) {
  93910. return _this4.handleTechFirstPlay_(e);
  93911. });
  93912. this.on(this.tech_, "pause", function(e) {
  93913. return _this4.handleTechPause_(e);
  93914. });
  93915. this.on(this.tech_, "durationchange", function(e) {
  93916. return _this4.handleTechDurationChange_(e);
  93917. });
  93918. this.on(this.tech_, "fullscreenchange", function(e, data) {
  93919. return _this4.handleTechFullscreenChange_(e, data);
  93920. });
  93921. this.on(this.tech_, "fullscreenerror", function(e, err) {
  93922. return _this4.handleTechFullscreenError_(e, err);
  93923. });
  93924. this.on(this.tech_, "enterpictureinpicture", function(e) {
  93925. return _this4.handleTechEnterPictureInPicture_(e);
  93926. });
  93927. this.on(this.tech_, "leavepictureinpicture", function(e) {
  93928. return _this4.handleTechLeavePictureInPicture_(e);
  93929. });
  93930. this.on(this.tech_, "error", function(e) {
  93931. return _this4.handleTechError_(e);
  93932. });
  93933. this.on(this.tech_, "posterchange", function(e) {
  93934. return _this4.handleTechPosterChange_(e);
  93935. });
  93936. this.on(this.tech_, "textdata", function(e) {
  93937. return _this4.handleTechTextData_(e);
  93938. });
  93939. this.on(this.tech_, "ratechange", function(e) {
  93940. return _this4.handleTechRateChange_(e);
  93941. });
  93942. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  93943. this.usingNativeControls(this.techGet_("controls"));
  93944. if (this.controls() && !this.usingNativeControls()) {
  93945. this.addTechControlsListeners_();
  93946. }
  93947. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  93948. prependTo(this.tech_.el(), this.el());
  93949. }
  93950. if (this.tag) {
  93951. this.tag.player = null;
  93952. this.tag = null;
  93953. }
  93954. };
  93955. _proto.unloadTech_ = function unloadTech_() {
  93956. var _this5 = this;
  93957. ALL.names.forEach(function(name) {
  93958. var props = ALL[name];
  93959. _this5[props.privateName] = _this5[props.getterName]();
  93960. });
  93961. this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);
  93962. this.isReady_ = false;
  93963. this.tech_.dispose();
  93964. this.tech_ = false;
  93965. if (this.isPosterFromTech_) {
  93966. this.poster_ = "";
  93967. this.trigger("posterchange");
  93968. }
  93969. this.isPosterFromTech_ = false;
  93970. };
  93971. _proto.tech = function tech(safety) {
  93972. if (safety === void 0) {
  93973. log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  93974. }
  93975. return this.tech_;
  93976. };
  93977. _proto.addTechControlsListeners_ = function addTechControlsListeners_() {
  93978. this.removeTechControlsListeners_();
  93979. this.on(this.tech_, "click", this.boundHandleTechClick_);
  93980. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  93981. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  93982. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  93983. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  93984. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  93985. };
  93986. _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {
  93987. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  93988. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  93989. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  93990. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  93991. this.off(this.tech_, "click", this.boundHandleTechClick_);
  93992. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  93993. };
  93994. _proto.handleTechReady_ = function handleTechReady_() {
  93995. this.triggerReady();
  93996. if (this.cache_.volume) {
  93997. this.techCall_("setVolume", this.cache_.volume);
  93998. }
  93999. this.handleTechPosterChange_();
  94000. this.handleTechDurationChange_();
  94001. };
  94002. _proto.handleTechLoadStart_ = function handleTechLoadStart_() {
  94003. this.removeClass("vjs-ended");
  94004. this.removeClass("vjs-seeking");
  94005. this.error(null);
  94006. this.handleTechDurationChange_();
  94007. if (!this.paused()) {
  94008. this.trigger("loadstart");
  94009. this.trigger("firstplay");
  94010. } else {
  94011. this.hasStarted(false);
  94012. this.trigger("loadstart");
  94013. }
  94014. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  94015. };
  94016. _proto.manualAutoplay_ = function manualAutoplay_(type2) {
  94017. var _this6 = this;
  94018. if (!this.tech_ || typeof type2 !== "string") {
  94019. return;
  94020. }
  94021. var resolveMuted = function resolveMuted2() {
  94022. var previouslyMuted = _this6.muted();
  94023. _this6.muted(true);
  94024. var restoreMuted = function restoreMuted2() {
  94025. _this6.muted(previouslyMuted);
  94026. };
  94027. _this6.playTerminatedQueue_.push(restoreMuted);
  94028. var mutedPromise = _this6.play();
  94029. if (!isPromise(mutedPromise)) {
  94030. return;
  94031. }
  94032. return mutedPromise["catch"](function(err) {
  94033. restoreMuted();
  94034. throw new Error("Rejection at manualAutoplay. Restoring muted value. " + (err ? err : ""));
  94035. });
  94036. };
  94037. var promise;
  94038. if (type2 === "any" && !this.muted()) {
  94039. promise = this.play();
  94040. if (isPromise(promise)) {
  94041. promise = promise["catch"](resolveMuted);
  94042. }
  94043. } else if (type2 === "muted" && !this.muted()) {
  94044. promise = resolveMuted();
  94045. } else {
  94046. promise = this.play();
  94047. }
  94048. if (!isPromise(promise)) {
  94049. return;
  94050. }
  94051. return promise.then(function() {
  94052. _this6.trigger({
  94053. type: "autoplay-success",
  94054. autoplay: type2
  94055. });
  94056. })["catch"](function() {
  94057. _this6.trigger({
  94058. type: "autoplay-failure",
  94059. autoplay: type2
  94060. });
  94061. });
  94062. };
  94063. _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {
  94064. if (srcObj === void 0) {
  94065. srcObj = "";
  94066. }
  94067. var src = srcObj;
  94068. var type2 = "";
  94069. if (typeof src !== "string") {
  94070. src = srcObj.src;
  94071. type2 = srcObj.type;
  94072. }
  94073. this.cache_.source = this.cache_.source || {};
  94074. this.cache_.sources = this.cache_.sources || [];
  94075. if (src && !type2) {
  94076. type2 = findMimetype(this, src);
  94077. }
  94078. this.cache_.source = mergeOptions$3({}, srcObj, {
  94079. src,
  94080. type: type2
  94081. });
  94082. var matchingSources = this.cache_.sources.filter(function(s) {
  94083. return s.src && s.src === src;
  94084. });
  94085. var sourceElSources = [];
  94086. var sourceEls = this.$$("source");
  94087. var matchingSourceEls = [];
  94088. for (var i2 = 0; i2 < sourceEls.length; i2++) {
  94089. var sourceObj = getAttributes(sourceEls[i2]);
  94090. sourceElSources.push(sourceObj);
  94091. if (sourceObj.src && sourceObj.src === src) {
  94092. matchingSourceEls.push(sourceObj.src);
  94093. }
  94094. }
  94095. if (matchingSourceEls.length && !matchingSources.length) {
  94096. this.cache_.sources = sourceElSources;
  94097. } else if (!matchingSources.length) {
  94098. this.cache_.sources = [this.cache_.source];
  94099. }
  94100. this.cache_.src = src;
  94101. };
  94102. _proto.handleTechSourceset_ = function handleTechSourceset_(event2) {
  94103. var _this7 = this;
  94104. if (!this.changingSrc_) {
  94105. var updateSourceCaches = function updateSourceCaches2(src) {
  94106. return _this7.updateSourceCaches_(src);
  94107. };
  94108. var playerSrc = this.currentSource().src;
  94109. var eventSrc = event2.src;
  94110. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  94111. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  94112. updateSourceCaches = function updateSourceCaches2() {
  94113. };
  94114. }
  94115. }
  94116. updateSourceCaches(eventSrc);
  94117. if (!event2.src) {
  94118. this.tech_.any(["sourceset", "loadstart"], function(e) {
  94119. if (e.type === "sourceset") {
  94120. return;
  94121. }
  94122. var techSrc = _this7.techGet("currentSrc");
  94123. _this7.lastSource_.tech = techSrc;
  94124. _this7.updateSourceCaches_(techSrc);
  94125. });
  94126. }
  94127. }
  94128. this.lastSource_ = {
  94129. player: this.currentSource().src,
  94130. tech: event2.src
  94131. };
  94132. this.trigger({
  94133. src: event2.src,
  94134. type: "sourceset"
  94135. });
  94136. };
  94137. _proto.hasStarted = function hasStarted(request) {
  94138. if (request === void 0) {
  94139. return this.hasStarted_;
  94140. }
  94141. if (request === this.hasStarted_) {
  94142. return;
  94143. }
  94144. this.hasStarted_ = request;
  94145. if (this.hasStarted_) {
  94146. this.addClass("vjs-has-started");
  94147. this.trigger("firstplay");
  94148. } else {
  94149. this.removeClass("vjs-has-started");
  94150. }
  94151. };
  94152. _proto.handleTechPlay_ = function handleTechPlay_() {
  94153. this.removeClass("vjs-ended");
  94154. this.removeClass("vjs-paused");
  94155. this.addClass("vjs-playing");
  94156. this.hasStarted(true);
  94157. this.trigger("play");
  94158. };
  94159. _proto.handleTechRateChange_ = function handleTechRateChange_() {
  94160. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  94161. this.queuedCallbacks_.forEach(function(queued) {
  94162. return queued.callback(queued.event);
  94163. });
  94164. this.queuedCallbacks_ = [];
  94165. }
  94166. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  94167. this.trigger("ratechange");
  94168. };
  94169. _proto.handleTechWaiting_ = function handleTechWaiting_() {
  94170. var _this8 = this;
  94171. this.addClass("vjs-waiting");
  94172. this.trigger("waiting");
  94173. var timeWhenWaiting = this.currentTime();
  94174. var timeUpdateListener = function timeUpdateListener2() {
  94175. if (timeWhenWaiting !== _this8.currentTime()) {
  94176. _this8.removeClass("vjs-waiting");
  94177. _this8.off("timeupdate", timeUpdateListener2);
  94178. }
  94179. };
  94180. this.on("timeupdate", timeUpdateListener);
  94181. };
  94182. _proto.handleTechCanPlay_ = function handleTechCanPlay_() {
  94183. this.removeClass("vjs-waiting");
  94184. this.trigger("canplay");
  94185. };
  94186. _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {
  94187. this.removeClass("vjs-waiting");
  94188. this.trigger("canplaythrough");
  94189. };
  94190. _proto.handleTechPlaying_ = function handleTechPlaying_() {
  94191. this.removeClass("vjs-waiting");
  94192. this.trigger("playing");
  94193. };
  94194. _proto.handleTechSeeking_ = function handleTechSeeking_() {
  94195. this.addClass("vjs-seeking");
  94196. this.trigger("seeking");
  94197. };
  94198. _proto.handleTechSeeked_ = function handleTechSeeked_() {
  94199. this.removeClass("vjs-seeking");
  94200. this.removeClass("vjs-ended");
  94201. this.trigger("seeked");
  94202. };
  94203. _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {
  94204. if (this.options_.starttime) {
  94205. log$1.warn("Passing the `starttime` option to the player will be deprecated in 6.0");
  94206. this.currentTime(this.options_.starttime);
  94207. }
  94208. this.addClass("vjs-has-started");
  94209. this.trigger("firstplay");
  94210. };
  94211. _proto.handleTechPause_ = function handleTechPause_() {
  94212. this.removeClass("vjs-playing");
  94213. this.addClass("vjs-paused");
  94214. this.trigger("pause");
  94215. };
  94216. _proto.handleTechEnded_ = function handleTechEnded_() {
  94217. this.addClass("vjs-ended");
  94218. this.removeClass("vjs-waiting");
  94219. if (this.options_.loop) {
  94220. this.currentTime(0);
  94221. this.play();
  94222. } else if (!this.paused()) {
  94223. this.pause();
  94224. }
  94225. this.trigger("ended");
  94226. };
  94227. _proto.handleTechDurationChange_ = function handleTechDurationChange_() {
  94228. this.duration(this.techGet_("duration"));
  94229. };
  94230. _proto.handleTechClick_ = function handleTechClick_(event2) {
  94231. if (!this.controls_) {
  94232. return;
  94233. }
  94234. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  94235. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  94236. this.options_.userActions.click.call(this, event2);
  94237. } else if (this.paused()) {
  94238. silencePromise(this.play());
  94239. } else {
  94240. this.pause();
  94241. }
  94242. }
  94243. };
  94244. _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event2) {
  94245. if (!this.controls_) {
  94246. return;
  94247. }
  94248. var inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(el) {
  94249. return el.contains(event2.target);
  94250. });
  94251. if (!inAllowedEls) {
  94252. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  94253. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  94254. this.options_.userActions.doubleClick.call(this, event2);
  94255. } else if (this.isFullscreen()) {
  94256. this.exitFullscreen();
  94257. } else {
  94258. this.requestFullscreen();
  94259. }
  94260. }
  94261. }
  94262. };
  94263. _proto.handleTechTap_ = function handleTechTap_() {
  94264. this.userActive(!this.userActive());
  94265. };
  94266. _proto.handleTechTouchStart_ = function handleTechTouchStart_() {
  94267. this.userWasActive = this.userActive();
  94268. };
  94269. _proto.handleTechTouchMove_ = function handleTechTouchMove_() {
  94270. if (this.userWasActive) {
  94271. this.reportUserActivity();
  94272. }
  94273. };
  94274. _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event2) {
  94275. if (event2.cancelable) {
  94276. event2.preventDefault();
  94277. }
  94278. };
  94279. _proto.handleStageClick_ = function handleStageClick_() {
  94280. this.reportUserActivity();
  94281. };
  94282. _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() {
  94283. if (this.isFullscreen()) {
  94284. this.addClass("vjs-fullscreen");
  94285. } else {
  94286. this.removeClass("vjs-fullscreen");
  94287. }
  94288. };
  94289. _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) {
  94290. var targetPlayer = e.target.player;
  94291. if (targetPlayer && targetPlayer !== this) {
  94292. return;
  94293. }
  94294. var el = this.el();
  94295. var isFs = document_1[this.fsApi_.fullscreenElement] === el;
  94296. if (!isFs && el.matches) {
  94297. isFs = el.matches(":" + this.fsApi_.fullscreen);
  94298. } else if (!isFs && el.msMatchesSelector) {
  94299. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  94300. }
  94301. this.isFullscreen(isFs);
  94302. };
  94303. _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event2, data) {
  94304. var _this9 = this;
  94305. if (data) {
  94306. if (data.nativeIOSFullscreen) {
  94307. this.addClass("vjs-ios-native-fs");
  94308. this.tech_.one("webkitendfullscreen", function() {
  94309. _this9.removeClass("vjs-ios-native-fs");
  94310. });
  94311. }
  94312. this.isFullscreen(data.isFullscreen);
  94313. }
  94314. };
  94315. _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event2, err) {
  94316. this.trigger("fullscreenerror", err);
  94317. };
  94318. _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() {
  94319. if (this.isInPictureInPicture()) {
  94320. this.addClass("vjs-picture-in-picture");
  94321. } else {
  94322. this.removeClass("vjs-picture-in-picture");
  94323. }
  94324. };
  94325. _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event2) {
  94326. this.isInPictureInPicture(true);
  94327. };
  94328. _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event2) {
  94329. this.isInPictureInPicture(false);
  94330. };
  94331. _proto.handleTechError_ = function handleTechError_() {
  94332. var error = this.tech_.error();
  94333. this.error(error);
  94334. };
  94335. _proto.handleTechTextData_ = function handleTechTextData_() {
  94336. var data = null;
  94337. if (arguments.length > 1) {
  94338. data = arguments[1];
  94339. }
  94340. this.trigger("textdata", data);
  94341. };
  94342. _proto.getCache = function getCache() {
  94343. return this.cache_;
  94344. };
  94345. _proto.resetCache_ = function resetCache_() {
  94346. this.cache_ = {
  94347. currentTime: 0,
  94348. initTime: 0,
  94349. inactivityTimeout: this.options_.inactivityTimeout,
  94350. duration: NaN,
  94351. lastVolume: 1,
  94352. lastPlaybackRate: this.defaultPlaybackRate(),
  94353. media: null,
  94354. src: "",
  94355. source: {},
  94356. sources: [],
  94357. playbackRates: [],
  94358. volume: 1
  94359. };
  94360. };
  94361. _proto.techCall_ = function techCall_(method, arg) {
  94362. this.ready(function() {
  94363. if (method in allowedSetters) {
  94364. return set(this.middleware_, this.tech_, method, arg);
  94365. } else if (method in allowedMediators) {
  94366. return mediate(this.middleware_, this.tech_, method, arg);
  94367. }
  94368. try {
  94369. if (this.tech_) {
  94370. this.tech_[method](arg);
  94371. }
  94372. } catch (e) {
  94373. log$1(e);
  94374. throw e;
  94375. }
  94376. }, true);
  94377. };
  94378. _proto.techGet_ = function techGet_(method) {
  94379. if (!this.tech_ || !this.tech_.isReady_) {
  94380. return;
  94381. }
  94382. if (method in allowedGetters) {
  94383. return get(this.middleware_, this.tech_, method);
  94384. } else if (method in allowedMediators) {
  94385. return mediate(this.middleware_, this.tech_, method);
  94386. }
  94387. try {
  94388. return this.tech_[method]();
  94389. } catch (e) {
  94390. if (this.tech_[method] === void 0) {
  94391. log$1("Video.js: " + method + " method not defined for " + this.techName_ + " playback technology.", e);
  94392. throw e;
  94393. }
  94394. if (e.name === "TypeError") {
  94395. log$1("Video.js: " + method + " unavailable on " + this.techName_ + " playback technology element.", e);
  94396. this.tech_.isReady_ = false;
  94397. throw e;
  94398. }
  94399. log$1(e);
  94400. throw e;
  94401. }
  94402. };
  94403. _proto.play = function play() {
  94404. var _this10 = this;
  94405. var PromiseClass = this.options_.Promise || window_1.Promise;
  94406. if (PromiseClass) {
  94407. return new PromiseClass(function(resolve2) {
  94408. _this10.play_(resolve2);
  94409. });
  94410. }
  94411. return this.play_();
  94412. };
  94413. _proto.play_ = function play_(callback2) {
  94414. var _this11 = this;
  94415. if (callback2 === void 0) {
  94416. callback2 = silencePromise;
  94417. }
  94418. this.playCallbacks_.push(callback2);
  94419. var isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  94420. var isSafariOrIOS = Boolean(IS_ANY_SAFARI || IS_IOS);
  94421. if (this.waitToPlay_) {
  94422. this.off(["ready", "loadstart"], this.waitToPlay_);
  94423. this.waitToPlay_ = null;
  94424. }
  94425. if (!this.isReady_ || !isSrcReady) {
  94426. this.waitToPlay_ = function(e) {
  94427. _this11.play_();
  94428. };
  94429. this.one(["ready", "loadstart"], this.waitToPlay_);
  94430. if (!isSrcReady && isSafariOrIOS) {
  94431. this.load();
  94432. }
  94433. return;
  94434. }
  94435. var val = this.techGet_("play");
  94436. var isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  94437. if (isNativeReplay) {
  94438. this.resetProgressBar_();
  94439. }
  94440. if (val === null) {
  94441. this.runPlayTerminatedQueue_();
  94442. } else {
  94443. this.runPlayCallbacks_(val);
  94444. }
  94445. };
  94446. _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() {
  94447. var queue = this.playTerminatedQueue_.slice(0);
  94448. this.playTerminatedQueue_ = [];
  94449. queue.forEach(function(q2) {
  94450. q2();
  94451. });
  94452. };
  94453. _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) {
  94454. var callbacks = this.playCallbacks_.slice(0);
  94455. this.playCallbacks_ = [];
  94456. this.playTerminatedQueue_ = [];
  94457. callbacks.forEach(function(cb) {
  94458. cb(val);
  94459. });
  94460. };
  94461. _proto.pause = function pause() {
  94462. this.techCall_("pause");
  94463. };
  94464. _proto.paused = function paused() {
  94465. return this.techGet_("paused") === false ? false : true;
  94466. };
  94467. _proto.played = function played() {
  94468. return this.techGet_("played") || createTimeRanges(0, 0);
  94469. };
  94470. _proto.scrubbing = function scrubbing(isScrubbing) {
  94471. if (typeof isScrubbing === "undefined") {
  94472. return this.scrubbing_;
  94473. }
  94474. this.scrubbing_ = !!isScrubbing;
  94475. this.techCall_("setScrubbing", this.scrubbing_);
  94476. if (isScrubbing) {
  94477. this.addClass("vjs-scrubbing");
  94478. } else {
  94479. this.removeClass("vjs-scrubbing");
  94480. }
  94481. };
  94482. _proto.currentTime = function currentTime(seconds) {
  94483. if (typeof seconds !== "undefined") {
  94484. if (seconds < 0) {
  94485. seconds = 0;
  94486. }
  94487. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  94488. this.cache_.initTime = seconds;
  94489. this.off("canplay", this.boundApplyInitTime_);
  94490. this.one("canplay", this.boundApplyInitTime_);
  94491. return;
  94492. }
  94493. this.techCall_("setCurrentTime", seconds);
  94494. this.cache_.initTime = 0;
  94495. return;
  94496. }
  94497. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  94498. return this.cache_.currentTime;
  94499. };
  94500. _proto.applyInitTime_ = function applyInitTime_() {
  94501. this.currentTime(this.cache_.initTime);
  94502. };
  94503. _proto.duration = function duration5(seconds) {
  94504. if (seconds === void 0) {
  94505. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  94506. }
  94507. seconds = parseFloat(seconds);
  94508. if (seconds < 0) {
  94509. seconds = Infinity;
  94510. }
  94511. if (seconds !== this.cache_.duration) {
  94512. this.cache_.duration = seconds;
  94513. if (seconds === Infinity) {
  94514. this.addClass("vjs-live");
  94515. } else {
  94516. this.removeClass("vjs-live");
  94517. }
  94518. if (!isNaN(seconds)) {
  94519. this.trigger("durationchange");
  94520. }
  94521. }
  94522. };
  94523. _proto.remainingTime = function remainingTime() {
  94524. return this.duration() - this.currentTime();
  94525. };
  94526. _proto.remainingTimeDisplay = function remainingTimeDisplay() {
  94527. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  94528. };
  94529. _proto.buffered = function buffered() {
  94530. var buffered2 = this.techGet_("buffered");
  94531. if (!buffered2 || !buffered2.length) {
  94532. buffered2 = createTimeRanges(0, 0);
  94533. }
  94534. return buffered2;
  94535. };
  94536. _proto.bufferedPercent = function bufferedPercent$12() {
  94537. return bufferedPercent(this.buffered(), this.duration());
  94538. };
  94539. _proto.bufferedEnd = function bufferedEnd() {
  94540. var buffered = this.buffered();
  94541. var duration5 = this.duration();
  94542. var end = buffered.end(buffered.length - 1);
  94543. if (end > duration5) {
  94544. end = duration5;
  94545. }
  94546. return end;
  94547. };
  94548. _proto.volume = function volume(percentAsDecimal) {
  94549. var vol;
  94550. if (percentAsDecimal !== void 0) {
  94551. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  94552. this.cache_.volume = vol;
  94553. this.techCall_("setVolume", vol);
  94554. if (vol > 0) {
  94555. this.lastVolume_(vol);
  94556. }
  94557. return;
  94558. }
  94559. vol = parseFloat(this.techGet_("volume"));
  94560. return isNaN(vol) ? 1 : vol;
  94561. };
  94562. _proto.muted = function muted(_muted) {
  94563. if (_muted !== void 0) {
  94564. this.techCall_("setMuted", _muted);
  94565. return;
  94566. }
  94567. return this.techGet_("muted") || false;
  94568. };
  94569. _proto.defaultMuted = function defaultMuted(_defaultMuted) {
  94570. if (_defaultMuted !== void 0) {
  94571. return this.techCall_("setDefaultMuted", _defaultMuted);
  94572. }
  94573. return this.techGet_("defaultMuted") || false;
  94574. };
  94575. _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {
  94576. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  94577. this.cache_.lastVolume = percentAsDecimal;
  94578. return;
  94579. }
  94580. return this.cache_.lastVolume;
  94581. };
  94582. _proto.supportsFullScreen = function supportsFullScreen() {
  94583. return this.techGet_("supportsFullScreen") || false;
  94584. };
  94585. _proto.isFullscreen = function isFullscreen(isFS) {
  94586. if (isFS !== void 0) {
  94587. var oldValue = this.isFullscreen_;
  94588. this.isFullscreen_ = Boolean(isFS);
  94589. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  94590. this.trigger("fullscreenchange");
  94591. }
  94592. this.toggleFullscreenClass_();
  94593. return;
  94594. }
  94595. return this.isFullscreen_;
  94596. };
  94597. _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) {
  94598. var PromiseClass = this.options_.Promise || window_1.Promise;
  94599. if (PromiseClass) {
  94600. var self2 = this;
  94601. return new PromiseClass(function(resolve2, reject2) {
  94602. function offHandler() {
  94603. self2.off("fullscreenerror", errorHandler);
  94604. self2.off("fullscreenchange", changeHandler);
  94605. }
  94606. function changeHandler() {
  94607. offHandler();
  94608. resolve2();
  94609. }
  94610. function errorHandler(e, err) {
  94611. offHandler();
  94612. reject2(err);
  94613. }
  94614. self2.one("fullscreenchange", changeHandler);
  94615. self2.one("fullscreenerror", errorHandler);
  94616. var promise = self2.requestFullscreenHelper_(fullscreenOptions);
  94617. if (promise) {
  94618. promise.then(offHandler, offHandler);
  94619. promise.then(resolve2, reject2);
  94620. }
  94621. });
  94622. }
  94623. return this.requestFullscreenHelper_();
  94624. };
  94625. _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) {
  94626. var _this12 = this;
  94627. var fsOptions;
  94628. if (!this.fsApi_.prefixed) {
  94629. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  94630. if (fullscreenOptions !== void 0) {
  94631. fsOptions = fullscreenOptions;
  94632. }
  94633. }
  94634. if (this.fsApi_.requestFullscreen) {
  94635. var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  94636. if (promise) {
  94637. promise.then(function() {
  94638. return _this12.isFullscreen(true);
  94639. }, function() {
  94640. return _this12.isFullscreen(false);
  94641. });
  94642. }
  94643. return promise;
  94644. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94645. this.techCall_("enterFullScreen");
  94646. } else {
  94647. this.enterFullWindow();
  94648. }
  94649. };
  94650. _proto.exitFullscreen = function exitFullscreen() {
  94651. var PromiseClass = this.options_.Promise || window_1.Promise;
  94652. if (PromiseClass) {
  94653. var self2 = this;
  94654. return new PromiseClass(function(resolve2, reject2) {
  94655. function offHandler() {
  94656. self2.off("fullscreenerror", errorHandler);
  94657. self2.off("fullscreenchange", changeHandler);
  94658. }
  94659. function changeHandler() {
  94660. offHandler();
  94661. resolve2();
  94662. }
  94663. function errorHandler(e, err) {
  94664. offHandler();
  94665. reject2(err);
  94666. }
  94667. self2.one("fullscreenchange", changeHandler);
  94668. self2.one("fullscreenerror", errorHandler);
  94669. var promise = self2.exitFullscreenHelper_();
  94670. if (promise) {
  94671. promise.then(offHandler, offHandler);
  94672. promise.then(resolve2, reject2);
  94673. }
  94674. });
  94675. }
  94676. return this.exitFullscreenHelper_();
  94677. };
  94678. _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() {
  94679. var _this13 = this;
  94680. if (this.fsApi_.requestFullscreen) {
  94681. var promise = document_1[this.fsApi_.exitFullscreen]();
  94682. if (promise) {
  94683. silencePromise(promise.then(function() {
  94684. return _this13.isFullscreen(false);
  94685. }));
  94686. }
  94687. return promise;
  94688. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94689. this.techCall_("exitFullScreen");
  94690. } else {
  94691. this.exitFullWindow();
  94692. }
  94693. };
  94694. _proto.enterFullWindow = function enterFullWindow() {
  94695. this.isFullscreen(true);
  94696. this.isFullWindow = true;
  94697. this.docOrigOverflow = document_1.documentElement.style.overflow;
  94698. on(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94699. document_1.documentElement.style.overflow = "hidden";
  94700. addClass(document_1.body, "vjs-full-window");
  94701. this.trigger("enterFullWindow");
  94702. };
  94703. _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event2) {
  94704. if (keycode.isEventKey(event2, "Esc")) {
  94705. if (this.isFullscreen() === true) {
  94706. if (!this.isFullWindow) {
  94707. this.exitFullscreen();
  94708. } else {
  94709. this.exitFullWindow();
  94710. }
  94711. }
  94712. }
  94713. };
  94714. _proto.exitFullWindow = function exitFullWindow() {
  94715. this.isFullscreen(false);
  94716. this.isFullWindow = false;
  94717. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94718. document_1.documentElement.style.overflow = this.docOrigOverflow;
  94719. removeClass(document_1.body, "vjs-full-window");
  94720. this.trigger("exitFullWindow");
  94721. };
  94722. _proto.disablePictureInPicture = function disablePictureInPicture(value) {
  94723. if (value === void 0) {
  94724. return this.techGet_("disablePictureInPicture");
  94725. }
  94726. this.techCall_("setDisablePictureInPicture", value);
  94727. this.options_.disablePictureInPicture = value;
  94728. this.trigger("disablepictureinpicturechanged");
  94729. };
  94730. _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) {
  94731. if (isPiP !== void 0) {
  94732. this.isInPictureInPicture_ = !!isPiP;
  94733. this.togglePictureInPictureClass_();
  94734. return;
  94735. }
  94736. return !!this.isInPictureInPicture_;
  94737. };
  94738. _proto.requestPictureInPicture = function requestPictureInPicture() {
  94739. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  94740. return this.techGet_("requestPictureInPicture");
  94741. }
  94742. };
  94743. _proto.exitPictureInPicture = function exitPictureInPicture() {
  94744. if ("pictureInPictureEnabled" in document_1) {
  94745. return document_1.exitPictureInPicture();
  94746. }
  94747. };
  94748. _proto.handleKeyDown = function handleKeyDown(event2) {
  94749. var userActions = this.options_.userActions;
  94750. if (!userActions || !userActions.hotkeys) {
  94751. return;
  94752. }
  94753. var excludeElement = function excludeElement2(el) {
  94754. var tagName = el.tagName.toLowerCase();
  94755. if (el.isContentEditable) {
  94756. return true;
  94757. }
  94758. var allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  94759. if (tagName === "input") {
  94760. return allowedInputTypes.indexOf(el.type) === -1;
  94761. }
  94762. var excludedTags = ["textarea"];
  94763. return excludedTags.indexOf(tagName) !== -1;
  94764. };
  94765. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  94766. return;
  94767. }
  94768. if (typeof userActions.hotkeys === "function") {
  94769. userActions.hotkeys.call(this, event2);
  94770. } else {
  94771. this.handleHotkeys(event2);
  94772. }
  94773. };
  94774. _proto.handleHotkeys = function handleHotkeys(event2) {
  94775. var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  94776. var _hotkeys$fullscreenKe = hotkeys.fullscreenKey, fullscreenKey = _hotkeys$fullscreenKe === void 0 ? function(keydownEvent) {
  94777. return keycode.isEventKey(keydownEvent, "f");
  94778. } : _hotkeys$fullscreenKe, _hotkeys$muteKey = hotkeys.muteKey, muteKey = _hotkeys$muteKey === void 0 ? function(keydownEvent) {
  94779. return keycode.isEventKey(keydownEvent, "m");
  94780. } : _hotkeys$muteKey, _hotkeys$playPauseKey = hotkeys.playPauseKey, playPauseKey = _hotkeys$playPauseKey === void 0 ? function(keydownEvent) {
  94781. return keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space");
  94782. } : _hotkeys$playPauseKey;
  94783. if (fullscreenKey.call(this, event2)) {
  94784. event2.preventDefault();
  94785. event2.stopPropagation();
  94786. var FSToggle = Component$1.getComponent("FullscreenToggle");
  94787. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  94788. FSToggle.prototype.handleClick.call(this, event2);
  94789. }
  94790. } else if (muteKey.call(this, event2)) {
  94791. event2.preventDefault();
  94792. event2.stopPropagation();
  94793. var MuteToggle2 = Component$1.getComponent("MuteToggle");
  94794. MuteToggle2.prototype.handleClick.call(this, event2);
  94795. } else if (playPauseKey.call(this, event2)) {
  94796. event2.preventDefault();
  94797. event2.stopPropagation();
  94798. var PlayToggle2 = Component$1.getComponent("PlayToggle");
  94799. PlayToggle2.prototype.handleClick.call(this, event2);
  94800. }
  94801. };
  94802. _proto.canPlayType = function canPlayType3(type2) {
  94803. var can;
  94804. for (var i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  94805. var techName = j[i2];
  94806. var tech = Tech$1.getTech(techName);
  94807. if (!tech) {
  94808. tech = Component$1.getComponent(techName);
  94809. }
  94810. if (!tech) {
  94811. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94812. continue;
  94813. }
  94814. if (tech.isSupported()) {
  94815. can = tech.canPlayType(type2);
  94816. if (can) {
  94817. return can;
  94818. }
  94819. }
  94820. }
  94821. return "";
  94822. };
  94823. _proto.selectSource = function selectSource(sources) {
  94824. var _this14 = this;
  94825. var techs = this.options_.techOrder.map(function(techName) {
  94826. return [techName, Tech$1.getTech(techName)];
  94827. }).filter(function(_ref) {
  94828. var techName = _ref[0], tech = _ref[1];
  94829. if (tech) {
  94830. return tech.isSupported();
  94831. }
  94832. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94833. return false;
  94834. });
  94835. var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair2(outerArray, innerArray, tester) {
  94836. var found;
  94837. outerArray.some(function(outerChoice) {
  94838. return innerArray.some(function(innerChoice) {
  94839. found = tester(outerChoice, innerChoice);
  94840. if (found) {
  94841. return true;
  94842. }
  94843. });
  94844. });
  94845. return found;
  94846. };
  94847. var foundSourceAndTech;
  94848. var flip = function flip2(fn2) {
  94849. return function(a, b) {
  94850. return fn2(b, a);
  94851. };
  94852. };
  94853. var finder = function finder2(_ref2, source) {
  94854. var techName = _ref2[0], tech = _ref2[1];
  94855. if (tech.canPlaySource(source, _this14.options_[techName.toLowerCase()])) {
  94856. return {
  94857. source,
  94858. tech: techName
  94859. };
  94860. }
  94861. };
  94862. if (this.options_.sourceOrder) {
  94863. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  94864. } else {
  94865. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  94866. }
  94867. return foundSourceAndTech || false;
  94868. };
  94869. _proto.handleSrc_ = function handleSrc_(source, isRetry) {
  94870. var _this15 = this;
  94871. if (typeof source === "undefined") {
  94872. return this.cache_.src || "";
  94873. }
  94874. if (this.resetRetryOnError_) {
  94875. this.resetRetryOnError_();
  94876. }
  94877. var sources = filterSource(source);
  94878. if (!sources.length) {
  94879. this.setTimeout(function() {
  94880. this.error({
  94881. code: 4,
  94882. message: this.options_.notSupportedMessage
  94883. });
  94884. }, 0);
  94885. return;
  94886. }
  94887. this.changingSrc_ = true;
  94888. if (!isRetry) {
  94889. this.cache_.sources = sources;
  94890. }
  94891. this.updateSourceCaches_(sources[0]);
  94892. setSource(this, sources[0], function(middlewareSource, mws) {
  94893. _this15.middleware_ = mws;
  94894. if (!isRetry) {
  94895. _this15.cache_.sources = sources;
  94896. }
  94897. _this15.updateSourceCaches_(middlewareSource);
  94898. var err = _this15.src_(middlewareSource);
  94899. if (err) {
  94900. if (sources.length > 1) {
  94901. return _this15.handleSrc_(sources.slice(1));
  94902. }
  94903. _this15.changingSrc_ = false;
  94904. _this15.setTimeout(function() {
  94905. this.error({
  94906. code: 4,
  94907. message: this.options_.notSupportedMessage
  94908. });
  94909. }, 0);
  94910. _this15.triggerReady();
  94911. return;
  94912. }
  94913. setTech(mws, _this15.tech_);
  94914. });
  94915. if (this.options_.retryOnError && sources.length > 1) {
  94916. var retry = function retry2() {
  94917. _this15.error(null);
  94918. _this15.handleSrc_(sources.slice(1), true);
  94919. };
  94920. var stopListeningForErrors = function stopListeningForErrors2() {
  94921. _this15.off("error", retry);
  94922. };
  94923. this.one("error", retry);
  94924. this.one("playing", stopListeningForErrors);
  94925. this.resetRetryOnError_ = function() {
  94926. _this15.off("error", retry);
  94927. _this15.off("playing", stopListeningForErrors);
  94928. };
  94929. }
  94930. };
  94931. _proto.src = function src(source) {
  94932. return this.handleSrc_(source, false);
  94933. };
  94934. _proto.src_ = function src_(source) {
  94935. var _this16 = this;
  94936. var sourceTech = this.selectSource([source]);
  94937. if (!sourceTech) {
  94938. return true;
  94939. }
  94940. if (!titleCaseEquals(sourceTech.tech, this.techName_)) {
  94941. this.changingSrc_ = true;
  94942. this.loadTech_(sourceTech.tech, sourceTech.source);
  94943. this.tech_.ready(function() {
  94944. _this16.changingSrc_ = false;
  94945. });
  94946. return false;
  94947. }
  94948. this.ready(function() {
  94949. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  94950. this.techCall_("setSource", source);
  94951. } else {
  94952. this.techCall_("src", source.src);
  94953. }
  94954. this.changingSrc_ = false;
  94955. }, true);
  94956. return false;
  94957. };
  94958. _proto.load = function load() {
  94959. this.techCall_("load");
  94960. };
  94961. _proto.reset = function reset3() {
  94962. var _this17 = this;
  94963. var PromiseClass = this.options_.Promise || window_1.Promise;
  94964. if (this.paused() || !PromiseClass) {
  94965. this.doReset_();
  94966. } else {
  94967. var playPromise = this.play();
  94968. silencePromise(playPromise.then(function() {
  94969. return _this17.doReset_();
  94970. }));
  94971. }
  94972. };
  94973. _proto.doReset_ = function doReset_() {
  94974. if (this.tech_) {
  94975. this.tech_.clearTracks("text");
  94976. }
  94977. this.resetCache_();
  94978. this.poster("");
  94979. this.loadTech_(this.options_.techOrder[0], null);
  94980. this.techCall_("reset");
  94981. this.resetControlBarUI_();
  94982. if (isEvented(this)) {
  94983. this.trigger("playerreset");
  94984. }
  94985. };
  94986. _proto.resetControlBarUI_ = function resetControlBarUI_() {
  94987. this.resetProgressBar_();
  94988. this.resetPlaybackRate_();
  94989. this.resetVolumeBar_();
  94990. };
  94991. _proto.resetProgressBar_ = function resetProgressBar_() {
  94992. this.currentTime(0);
  94993. var _ref3 = this.controlBar || {}, durationDisplay = _ref3.durationDisplay, remainingTimeDisplay = _ref3.remainingTimeDisplay;
  94994. if (durationDisplay) {
  94995. durationDisplay.updateContent();
  94996. }
  94997. if (remainingTimeDisplay) {
  94998. remainingTimeDisplay.updateContent();
  94999. }
  95000. };
  95001. _proto.resetPlaybackRate_ = function resetPlaybackRate_() {
  95002. this.playbackRate(this.defaultPlaybackRate());
  95003. this.handleTechRateChange_();
  95004. };
  95005. _proto.resetVolumeBar_ = function resetVolumeBar_() {
  95006. this.volume(1);
  95007. this.trigger("volumechange");
  95008. };
  95009. _proto.currentSources = function currentSources() {
  95010. var source = this.currentSource();
  95011. var sources = [];
  95012. if (Object.keys(source).length !== 0) {
  95013. sources.push(source);
  95014. }
  95015. return this.cache_.sources || sources;
  95016. };
  95017. _proto.currentSource = function currentSource() {
  95018. return this.cache_.source || {};
  95019. };
  95020. _proto.currentSrc = function currentSrc() {
  95021. return this.currentSource() && this.currentSource().src || "";
  95022. };
  95023. _proto.currentType = function currentType() {
  95024. return this.currentSource() && this.currentSource().type || "";
  95025. };
  95026. _proto.preload = function preload(value) {
  95027. if (value !== void 0) {
  95028. this.techCall_("setPreload", value);
  95029. this.options_.preload = value;
  95030. return;
  95031. }
  95032. return this.techGet_("preload");
  95033. };
  95034. _proto.autoplay = function autoplay(value) {
  95035. if (value === void 0) {
  95036. return this.options_.autoplay || false;
  95037. }
  95038. var techAutoplay;
  95039. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  95040. this.options_.autoplay = value;
  95041. this.manualAutoplay_(typeof value === "string" ? value : "play");
  95042. techAutoplay = false;
  95043. } else if (!value) {
  95044. this.options_.autoplay = false;
  95045. } else {
  95046. this.options_.autoplay = true;
  95047. }
  95048. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  95049. if (this.tech_) {
  95050. this.techCall_("setAutoplay", techAutoplay);
  95051. }
  95052. };
  95053. _proto.playsinline = function playsinline(value) {
  95054. if (value !== void 0) {
  95055. this.techCall_("setPlaysinline", value);
  95056. this.options_.playsinline = value;
  95057. return this;
  95058. }
  95059. return this.techGet_("playsinline");
  95060. };
  95061. _proto.loop = function loop(value) {
  95062. if (value !== void 0) {
  95063. this.techCall_("setLoop", value);
  95064. this.options_.loop = value;
  95065. return;
  95066. }
  95067. return this.techGet_("loop");
  95068. };
  95069. _proto.poster = function poster(src) {
  95070. if (src === void 0) {
  95071. return this.poster_;
  95072. }
  95073. if (!src) {
  95074. src = "";
  95075. }
  95076. if (src === this.poster_) {
  95077. return;
  95078. }
  95079. this.poster_ = src;
  95080. this.techCall_("setPoster", src);
  95081. this.isPosterFromTech_ = false;
  95082. this.trigger("posterchange");
  95083. };
  95084. _proto.handleTechPosterChange_ = function handleTechPosterChange_() {
  95085. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  95086. var newPoster = this.tech_.poster() || "";
  95087. if (newPoster !== this.poster_) {
  95088. this.poster_ = newPoster;
  95089. this.isPosterFromTech_ = true;
  95090. this.trigger("posterchange");
  95091. }
  95092. }
  95093. };
  95094. _proto.controls = function controls(bool) {
  95095. if (bool === void 0) {
  95096. return !!this.controls_;
  95097. }
  95098. bool = !!bool;
  95099. if (this.controls_ === bool) {
  95100. return;
  95101. }
  95102. this.controls_ = bool;
  95103. if (this.usingNativeControls()) {
  95104. this.techCall_("setControls", bool);
  95105. }
  95106. if (this.controls_) {
  95107. this.removeClass("vjs-controls-disabled");
  95108. this.addClass("vjs-controls-enabled");
  95109. this.trigger("controlsenabled");
  95110. if (!this.usingNativeControls()) {
  95111. this.addTechControlsListeners_();
  95112. }
  95113. } else {
  95114. this.removeClass("vjs-controls-enabled");
  95115. this.addClass("vjs-controls-disabled");
  95116. this.trigger("controlsdisabled");
  95117. if (!this.usingNativeControls()) {
  95118. this.removeTechControlsListeners_();
  95119. }
  95120. }
  95121. };
  95122. _proto.usingNativeControls = function usingNativeControls(bool) {
  95123. if (bool === void 0) {
  95124. return !!this.usingNativeControls_;
  95125. }
  95126. bool = !!bool;
  95127. if (this.usingNativeControls_ === bool) {
  95128. return;
  95129. }
  95130. this.usingNativeControls_ = bool;
  95131. if (this.usingNativeControls_) {
  95132. this.addClass("vjs-using-native-controls");
  95133. this.trigger("usingnativecontrols");
  95134. } else {
  95135. this.removeClass("vjs-using-native-controls");
  95136. this.trigger("usingcustomcontrols");
  95137. }
  95138. };
  95139. _proto.error = function error(err) {
  95140. var _this18 = this;
  95141. if (err === void 0) {
  95142. return this.error_ || null;
  95143. }
  95144. hooks("beforeerror").forEach(function(hookFunction) {
  95145. var newErr = hookFunction(_this18, err);
  95146. if (!(isObject2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  95147. _this18.log.error("please return a value that MediaError expects in beforeerror hooks");
  95148. return;
  95149. }
  95150. err = newErr;
  95151. });
  95152. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  95153. var triggerSuppressedError = function triggerSuppressedError2() {
  95154. this.error(err);
  95155. };
  95156. this.options_.suppressNotSupportedError = false;
  95157. this.any(["click", "touchstart"], triggerSuppressedError);
  95158. this.one("loadstart", function() {
  95159. this.off(["click", "touchstart"], triggerSuppressedError);
  95160. });
  95161. return;
  95162. }
  95163. if (err === null) {
  95164. this.error_ = err;
  95165. this.removeClass("vjs-error");
  95166. if (this.errorDisplay) {
  95167. this.errorDisplay.close();
  95168. }
  95169. return;
  95170. }
  95171. this.error_ = new MediaError(err);
  95172. this.addClass("vjs-error");
  95173. log$1.error("(CODE:" + this.error_.code + " " + MediaError.errorTypes[this.error_.code] + ")", this.error_.message, this.error_);
  95174. this.trigger("error");
  95175. hooks("error").forEach(function(hookFunction) {
  95176. return hookFunction(_this18, _this18.error_);
  95177. });
  95178. return;
  95179. };
  95180. _proto.reportUserActivity = function reportUserActivity(event2) {
  95181. this.userActivity_ = true;
  95182. };
  95183. _proto.userActive = function userActive(bool) {
  95184. if (bool === void 0) {
  95185. return this.userActive_;
  95186. }
  95187. bool = !!bool;
  95188. if (bool === this.userActive_) {
  95189. return;
  95190. }
  95191. this.userActive_ = bool;
  95192. if (this.userActive_) {
  95193. this.userActivity_ = true;
  95194. this.removeClass("vjs-user-inactive");
  95195. this.addClass("vjs-user-active");
  95196. this.trigger("useractive");
  95197. return;
  95198. }
  95199. if (this.tech_) {
  95200. this.tech_.one("mousemove", function(e) {
  95201. e.stopPropagation();
  95202. e.preventDefault();
  95203. });
  95204. }
  95205. this.userActivity_ = false;
  95206. this.removeClass("vjs-user-active");
  95207. this.addClass("vjs-user-inactive");
  95208. this.trigger("userinactive");
  95209. };
  95210. _proto.listenForUserActivity_ = function listenForUserActivity_() {
  95211. var mouseInProgress;
  95212. var lastMoveX;
  95213. var lastMoveY;
  95214. var handleActivity = bind(this, this.reportUserActivity);
  95215. var handleMouseMove = function handleMouseMove2(e) {
  95216. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  95217. lastMoveX = e.screenX;
  95218. lastMoveY = e.screenY;
  95219. handleActivity();
  95220. }
  95221. };
  95222. var handleMouseDown = function handleMouseDown2() {
  95223. handleActivity();
  95224. this.clearInterval(mouseInProgress);
  95225. mouseInProgress = this.setInterval(handleActivity, 250);
  95226. };
  95227. var handleMouseUpAndMouseLeave = function handleMouseUpAndMouseLeave2(event2) {
  95228. handleActivity();
  95229. this.clearInterval(mouseInProgress);
  95230. };
  95231. this.on("mousedown", handleMouseDown);
  95232. this.on("mousemove", handleMouseMove);
  95233. this.on("mouseup", handleMouseUpAndMouseLeave);
  95234. this.on("mouseleave", handleMouseUpAndMouseLeave);
  95235. var controlBar = this.getChild("controlBar");
  95236. if (controlBar && !IS_IOS && !IS_ANDROID) {
  95237. controlBar.on("mouseenter", function(event2) {
  95238. if (this.player().options_.inactivityTimeout !== 0) {
  95239. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  95240. }
  95241. this.player().options_.inactivityTimeout = 0;
  95242. });
  95243. controlBar.on("mouseleave", function(event2) {
  95244. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  95245. });
  95246. }
  95247. this.on("keydown", handleActivity);
  95248. this.on("keyup", handleActivity);
  95249. var inactivityTimeout;
  95250. this.setInterval(function() {
  95251. if (!this.userActivity_) {
  95252. return;
  95253. }
  95254. this.userActivity_ = false;
  95255. this.userActive(true);
  95256. this.clearTimeout(inactivityTimeout);
  95257. var timeout = this.options_.inactivityTimeout;
  95258. if (timeout <= 0) {
  95259. return;
  95260. }
  95261. inactivityTimeout = this.setTimeout(function() {
  95262. if (!this.userActivity_) {
  95263. this.userActive(false);
  95264. }
  95265. }, timeout);
  95266. }, 250);
  95267. };
  95268. _proto.playbackRate = function playbackRate(rate) {
  95269. if (rate !== void 0) {
  95270. this.techCall_("setPlaybackRate", rate);
  95271. return;
  95272. }
  95273. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95274. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  95275. }
  95276. return 1;
  95277. };
  95278. _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {
  95279. if (rate !== void 0) {
  95280. return this.techCall_("setDefaultPlaybackRate", rate);
  95281. }
  95282. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95283. return this.techGet_("defaultPlaybackRate");
  95284. }
  95285. return 1;
  95286. };
  95287. _proto.isAudio = function isAudio(bool) {
  95288. if (bool !== void 0) {
  95289. this.isAudio_ = !!bool;
  95290. return;
  95291. }
  95292. return !!this.isAudio_;
  95293. };
  95294. _proto.enableAudioOnlyUI_ = function enableAudioOnlyUI_() {
  95295. var _this19 = this;
  95296. this.addClass("vjs-audio-only-mode");
  95297. var playerChildren = this.children();
  95298. var controlBar = this.getChild("ControlBar");
  95299. var controlBarHeight = controlBar && controlBar.currentHeight();
  95300. playerChildren.forEach(function(child) {
  95301. if (child === controlBar) {
  95302. return;
  95303. }
  95304. if (child.el_ && !child.hasClass("vjs-hidden")) {
  95305. child.hide();
  95306. _this19.audioOnlyCache_.hiddenChildren.push(child);
  95307. }
  95308. });
  95309. this.audioOnlyCache_.playerHeight = this.currentHeight();
  95310. this.height(controlBarHeight);
  95311. this.trigger("audioonlymodechange");
  95312. };
  95313. _proto.disableAudioOnlyUI_ = function disableAudioOnlyUI_() {
  95314. this.removeClass("vjs-audio-only-mode");
  95315. this.audioOnlyCache_.hiddenChildren.forEach(function(child) {
  95316. return child.show();
  95317. });
  95318. this.height(this.audioOnlyCache_.playerHeight);
  95319. this.trigger("audioonlymodechange");
  95320. };
  95321. _proto.audioOnlyMode = function audioOnlyMode(value) {
  95322. var _this20 = this;
  95323. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  95324. return this.audioOnlyMode_;
  95325. }
  95326. this.audioOnlyMode_ = value;
  95327. var PromiseClass = this.options_.Promise || window_1.Promise;
  95328. if (PromiseClass) {
  95329. if (value) {
  95330. var exitPromises = [];
  95331. if (this.isInPictureInPicture()) {
  95332. exitPromises.push(this.exitPictureInPicture());
  95333. }
  95334. if (this.isFullscreen()) {
  95335. exitPromises.push(this.exitFullscreen());
  95336. }
  95337. if (this.audioPosterMode()) {
  95338. exitPromises.push(this.audioPosterMode(false));
  95339. }
  95340. return PromiseClass.all(exitPromises).then(function() {
  95341. return _this20.enableAudioOnlyUI_();
  95342. });
  95343. }
  95344. return PromiseClass.resolve().then(function() {
  95345. return _this20.disableAudioOnlyUI_();
  95346. });
  95347. }
  95348. if (value) {
  95349. if (this.isInPictureInPicture()) {
  95350. this.exitPictureInPicture();
  95351. }
  95352. if (this.isFullscreen()) {
  95353. this.exitFullscreen();
  95354. }
  95355. this.enableAudioOnlyUI_();
  95356. } else {
  95357. this.disableAudioOnlyUI_();
  95358. }
  95359. };
  95360. _proto.enablePosterModeUI_ = function enablePosterModeUI_() {
  95361. var tech = this.tech_ && this.tech_;
  95362. tech.hide();
  95363. this.addClass("vjs-audio-poster-mode");
  95364. this.trigger("audiopostermodechange");
  95365. };
  95366. _proto.disablePosterModeUI_ = function disablePosterModeUI_() {
  95367. var tech = this.tech_ && this.tech_;
  95368. tech.show();
  95369. this.removeClass("vjs-audio-poster-mode");
  95370. this.trigger("audiopostermodechange");
  95371. };
  95372. _proto.audioPosterMode = function audioPosterMode(value) {
  95373. var _this21 = this;
  95374. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  95375. return this.audioPosterMode_;
  95376. }
  95377. this.audioPosterMode_ = value;
  95378. var PromiseClass = this.options_.Promise || window_1.Promise;
  95379. if (PromiseClass) {
  95380. if (value) {
  95381. if (this.audioOnlyMode()) {
  95382. var audioOnlyModePromise = this.audioOnlyMode(false);
  95383. return audioOnlyModePromise.then(function() {
  95384. _this21.enablePosterModeUI_();
  95385. });
  95386. }
  95387. return PromiseClass.resolve().then(function() {
  95388. _this21.enablePosterModeUI_();
  95389. });
  95390. }
  95391. return PromiseClass.resolve().then(function() {
  95392. _this21.disablePosterModeUI_();
  95393. });
  95394. }
  95395. if (value) {
  95396. if (this.audioOnlyMode()) {
  95397. this.audioOnlyMode(false);
  95398. }
  95399. this.enablePosterModeUI_();
  95400. return;
  95401. }
  95402. this.disablePosterModeUI_();
  95403. };
  95404. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  95405. if (this.tech_) {
  95406. return this.tech_.addTextTrack(kind, label, language);
  95407. }
  95408. };
  95409. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  95410. if (this.tech_) {
  95411. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  95412. }
  95413. };
  95414. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {
  95415. if (obj === void 0) {
  95416. obj = {};
  95417. }
  95418. var _obj = obj, track = _obj.track;
  95419. if (!track) {
  95420. track = obj;
  95421. }
  95422. if (this.tech_) {
  95423. return this.tech_.removeRemoteTextTrack(track);
  95424. }
  95425. };
  95426. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  95427. return this.techGet_("getVideoPlaybackQuality");
  95428. };
  95429. _proto.videoWidth = function videoWidth() {
  95430. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  95431. };
  95432. _proto.videoHeight = function videoHeight() {
  95433. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  95434. };
  95435. _proto.language = function language(code) {
  95436. if (code === void 0) {
  95437. return this.language_;
  95438. }
  95439. if (this.language_ !== String(code).toLowerCase()) {
  95440. this.language_ = String(code).toLowerCase();
  95441. if (isEvented(this)) {
  95442. this.trigger("languagechange");
  95443. }
  95444. }
  95445. };
  95446. _proto.languages = function languages() {
  95447. return mergeOptions$3(Player2.prototype.options_.languages, this.languages_);
  95448. };
  95449. _proto.toJSON = function toJSON() {
  95450. var options2 = mergeOptions$3(this.options_);
  95451. var tracks = options2.tracks;
  95452. options2.tracks = [];
  95453. for (var i2 = 0; i2 < tracks.length; i2++) {
  95454. var track = tracks[i2];
  95455. track = mergeOptions$3(track);
  95456. track.player = void 0;
  95457. options2.tracks[i2] = track;
  95458. }
  95459. return options2;
  95460. };
  95461. _proto.createModal = function createModal(content, options2) {
  95462. var _this22 = this;
  95463. options2 = options2 || {};
  95464. options2.content = content || "";
  95465. var modal = new ModalDialog(this, options2);
  95466. this.addChild(modal);
  95467. modal.on("dispose", function() {
  95468. _this22.removeChild(modal);
  95469. });
  95470. modal.open();
  95471. return modal;
  95472. };
  95473. _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {
  95474. if (!this.responsive()) {
  95475. return;
  95476. }
  95477. var currentBreakpoint = this.currentBreakpoint();
  95478. var currentWidth = this.currentWidth();
  95479. for (var i2 = 0; i2 < BREAKPOINT_ORDER.length; i2++) {
  95480. var candidateBreakpoint = BREAKPOINT_ORDER[i2];
  95481. var maxWidth = this.breakpoints_[candidateBreakpoint];
  95482. if (currentWidth <= maxWidth) {
  95483. if (currentBreakpoint === candidateBreakpoint) {
  95484. return;
  95485. }
  95486. if (currentBreakpoint) {
  95487. this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);
  95488. }
  95489. this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);
  95490. this.breakpoint_ = candidateBreakpoint;
  95491. break;
  95492. }
  95493. }
  95494. };
  95495. _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {
  95496. var className = this.currentBreakpointClass();
  95497. this.breakpoint_ = "";
  95498. if (className) {
  95499. this.removeClass(className);
  95500. }
  95501. };
  95502. _proto.breakpoints = function breakpoints(_breakpoints) {
  95503. if (_breakpoints === void 0) {
  95504. return assign(this.breakpoints_);
  95505. }
  95506. this.breakpoint_ = "";
  95507. this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints);
  95508. this.updateCurrentBreakpoint_();
  95509. return assign(this.breakpoints_);
  95510. };
  95511. _proto.responsive = function responsive(value) {
  95512. if (value === void 0) {
  95513. return this.responsive_;
  95514. }
  95515. value = Boolean(value);
  95516. var current = this.responsive_;
  95517. if (value === current) {
  95518. return;
  95519. }
  95520. this.responsive_ = value;
  95521. if (value) {
  95522. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  95523. this.updateCurrentBreakpoint_();
  95524. } else {
  95525. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  95526. this.removeCurrentBreakpoint_();
  95527. }
  95528. return value;
  95529. };
  95530. _proto.currentBreakpoint = function currentBreakpoint() {
  95531. return this.breakpoint_;
  95532. };
  95533. _proto.currentBreakpointClass = function currentBreakpointClass() {
  95534. return BREAKPOINT_CLASSES[this.breakpoint_] || "";
  95535. };
  95536. _proto.loadMedia = function loadMedia(media, ready) {
  95537. var _this23 = this;
  95538. if (!media || typeof media !== "object") {
  95539. return;
  95540. }
  95541. this.reset();
  95542. this.cache_.media = mergeOptions$3(media);
  95543. var _this$cache_$media = this.cache_.media, artwork = _this$cache_$media.artwork, poster = _this$cache_$media.poster, src = _this$cache_$media.src, textTracks = _this$cache_$media.textTracks;
  95544. if (!artwork && poster) {
  95545. this.cache_.media.artwork = [{
  95546. src: poster,
  95547. type: getMimetype(poster)
  95548. }];
  95549. }
  95550. if (src) {
  95551. this.src(src);
  95552. }
  95553. if (poster) {
  95554. this.poster(poster);
  95555. }
  95556. if (Array.isArray(textTracks)) {
  95557. textTracks.forEach(function(tt2) {
  95558. return _this23.addRemoteTextTrack(tt2, false);
  95559. });
  95560. }
  95561. this.ready(ready);
  95562. };
  95563. _proto.getMedia = function getMedia() {
  95564. if (!this.cache_.media) {
  95565. var poster = this.poster();
  95566. var src = this.currentSources();
  95567. var textTracks = Array.prototype.map.call(this.remoteTextTracks(), function(tt2) {
  95568. return {
  95569. kind: tt2.kind,
  95570. label: tt2.label,
  95571. language: tt2.language,
  95572. src: tt2.src
  95573. };
  95574. });
  95575. var media = {
  95576. src,
  95577. textTracks
  95578. };
  95579. if (poster) {
  95580. media.poster = poster;
  95581. media.artwork = [{
  95582. src: media.poster,
  95583. type: getMimetype(media.poster)
  95584. }];
  95585. }
  95586. return media;
  95587. }
  95588. return mergeOptions$3(this.cache_.media);
  95589. };
  95590. Player2.getTagSettings = function getTagSettings(tag) {
  95591. var baseOptions = {
  95592. sources: [],
  95593. tracks: []
  95594. };
  95595. var tagOptions = getAttributes(tag);
  95596. var dataSetup = tagOptions["data-setup"];
  95597. if (hasClass(tag, "vjs-fill")) {
  95598. tagOptions.fill = true;
  95599. }
  95600. if (hasClass(tag, "vjs-fluid")) {
  95601. tagOptions.fluid = true;
  95602. }
  95603. if (dataSetup !== null) {
  95604. var _safeParseTuple = tuple(dataSetup || "{}"), err = _safeParseTuple[0], data = _safeParseTuple[1];
  95605. if (err) {
  95606. log$1.error(err);
  95607. }
  95608. assign(tagOptions, data);
  95609. }
  95610. assign(baseOptions, tagOptions);
  95611. if (tag.hasChildNodes()) {
  95612. var children = tag.childNodes;
  95613. for (var i2 = 0, j = children.length; i2 < j; i2++) {
  95614. var child = children[i2];
  95615. var childName = child.nodeName.toLowerCase();
  95616. if (childName === "source") {
  95617. baseOptions.sources.push(getAttributes(child));
  95618. } else if (childName === "track") {
  95619. baseOptions.tracks.push(getAttributes(child));
  95620. }
  95621. }
  95622. }
  95623. return baseOptions;
  95624. };
  95625. _proto.flexNotSupported_ = function flexNotSupported_() {
  95626. var elem = document_1.createElement("i");
  95627. return !("flexBasis" in elem.style || "webkitFlexBasis" in elem.style || "mozFlexBasis" in elem.style || "msFlexBasis" in elem.style || "msFlexOrder" in elem.style);
  95628. };
  95629. _proto.debug = function debug(enabled) {
  95630. if (enabled === void 0) {
  95631. return this.debugEnabled_;
  95632. }
  95633. if (enabled) {
  95634. this.trigger("debugon");
  95635. this.previousLogLevel_ = this.log.level;
  95636. this.log.level("debug");
  95637. this.debugEnabled_ = true;
  95638. } else {
  95639. this.trigger("debugoff");
  95640. this.log.level(this.previousLogLevel_);
  95641. this.previousLogLevel_ = void 0;
  95642. this.debugEnabled_ = false;
  95643. }
  95644. };
  95645. _proto.playbackRates = function playbackRates(newRates) {
  95646. if (newRates === void 0) {
  95647. return this.cache_.playbackRates;
  95648. }
  95649. if (!Array.isArray(newRates)) {
  95650. return;
  95651. }
  95652. if (!newRates.every(function(rate) {
  95653. return typeof rate === "number";
  95654. })) {
  95655. return;
  95656. }
  95657. this.cache_.playbackRates = newRates;
  95658. this.trigger("playbackrateschange");
  95659. };
  95660. return Player2;
  95661. }(Component$1);
  95662. ALL.names.forEach(function(name) {
  95663. var props = ALL[name];
  95664. Player.prototype[props.getterName] = function() {
  95665. if (this.tech_) {
  95666. return this.tech_[props.getterName]();
  95667. }
  95668. this[props.privateName] = this[props.privateName] || new props.ListClass();
  95669. return this[props.privateName];
  95670. };
  95671. });
  95672. Player.prototype.crossorigin = Player.prototype.crossOrigin;
  95673. Player.players = {};
  95674. var navigator$2 = window_1.navigator;
  95675. Player.prototype.options_ = {
  95676. techOrder: Tech$1.defaultTechOrder_,
  95677. html5: {},
  95678. inactivityTimeout: 2e3,
  95679. playbackRates: [],
  95680. liveui: false,
  95681. children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  95682. language: navigator$2 && (navigator$2.languages && navigator$2.languages[0] || navigator$2.userLanguage || navigator$2.language) || "en",
  95683. languages: {},
  95684. notSupportedMessage: "No compatible source was found for this media.",
  95685. normalizeAutoplay: false,
  95686. fullscreen: {
  95687. options: {
  95688. navigationUI: "hide"
  95689. }
  95690. },
  95691. breakpoints: {},
  95692. responsive: false,
  95693. audioOnlyMode: false,
  95694. audioPosterMode: false
  95695. };
  95696. [
  95697. "ended",
  95698. "seeking",
  95699. "seekable",
  95700. "networkState",
  95701. "readyState"
  95702. ].forEach(function(fn2) {
  95703. Player.prototype[fn2] = function() {
  95704. return this.techGet_(fn2);
  95705. };
  95706. });
  95707. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  95708. Player.prototype["handleTech" + toTitleCase$1(event2) + "_"] = function() {
  95709. return this.trigger(event2);
  95710. };
  95711. });
  95712. Component$1.registerComponent("Player", Player);
  95713. var BASE_PLUGIN_NAME = "plugin";
  95714. var PLUGIN_CACHE_KEY = "activePlugins_";
  95715. var pluginStorage = {};
  95716. var pluginExists = function pluginExists2(name) {
  95717. return pluginStorage.hasOwnProperty(name);
  95718. };
  95719. var getPlugin = function getPlugin2(name) {
  95720. return pluginExists(name) ? pluginStorage[name] : void 0;
  95721. };
  95722. var markPluginAsActive = function markPluginAsActive2(player, name) {
  95723. player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};
  95724. player[PLUGIN_CACHE_KEY][name] = true;
  95725. };
  95726. var triggerSetupEvent = function triggerSetupEvent2(player, hash, before) {
  95727. var eventName = (before ? "before" : "") + "pluginsetup";
  95728. player.trigger(eventName, hash);
  95729. player.trigger(eventName + ":" + hash.name, hash);
  95730. };
  95731. var createBasicPlugin = function createBasicPlugin2(name, plugin) {
  95732. var basicPluginWrapper = function basicPluginWrapper2() {
  95733. triggerSetupEvent(this, {
  95734. name,
  95735. plugin,
  95736. instance: null
  95737. }, true);
  95738. var instance = plugin.apply(this, arguments);
  95739. markPluginAsActive(this, name);
  95740. triggerSetupEvent(this, {
  95741. name,
  95742. plugin,
  95743. instance
  95744. });
  95745. return instance;
  95746. };
  95747. Object.keys(plugin).forEach(function(prop) {
  95748. basicPluginWrapper[prop] = plugin[prop];
  95749. });
  95750. return basicPluginWrapper;
  95751. };
  95752. var createPluginFactory = function createPluginFactory2(name, PluginSubClass) {
  95753. PluginSubClass.prototype.name = name;
  95754. return function() {
  95755. triggerSetupEvent(this, {
  95756. name,
  95757. plugin: PluginSubClass,
  95758. instance: null
  95759. }, true);
  95760. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  95761. args[_key] = arguments[_key];
  95762. }
  95763. var instance = _construct(PluginSubClass, [this].concat(args));
  95764. this[name] = function() {
  95765. return instance;
  95766. };
  95767. triggerSetupEvent(this, instance.getEventHash());
  95768. return instance;
  95769. };
  95770. };
  95771. var Plugin = /* @__PURE__ */ function() {
  95772. function Plugin2(player) {
  95773. if (this.constructor === Plugin2) {
  95774. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  95775. }
  95776. this.player = player;
  95777. if (!this.log) {
  95778. this.log = this.player.log.createLogger(this.name);
  95779. }
  95780. evented(this);
  95781. delete this.trigger;
  95782. stateful(this, this.constructor.defaultState);
  95783. markPluginAsActive(player, this.name);
  95784. this.dispose = this.dispose.bind(this);
  95785. player.on("dispose", this.dispose);
  95786. }
  95787. var _proto = Plugin2.prototype;
  95788. _proto.version = function version2() {
  95789. return this.constructor.VERSION;
  95790. };
  95791. _proto.getEventHash = function getEventHash(hash) {
  95792. if (hash === void 0) {
  95793. hash = {};
  95794. }
  95795. hash.name = this.name;
  95796. hash.plugin = this.constructor;
  95797. hash.instance = this;
  95798. return hash;
  95799. };
  95800. _proto.trigger = function trigger$13(event2, hash) {
  95801. if (hash === void 0) {
  95802. hash = {};
  95803. }
  95804. return trigger(this.eventBusEl_, event2, this.getEventHash(hash));
  95805. };
  95806. _proto.handleStateChanged = function handleStateChanged(e) {
  95807. };
  95808. _proto.dispose = function dispose() {
  95809. var name = this.name, player = this.player;
  95810. this.trigger("dispose");
  95811. this.off();
  95812. player.off("dispose", this.dispose);
  95813. player[PLUGIN_CACHE_KEY][name] = false;
  95814. this.player = this.state = null;
  95815. player[name] = createPluginFactory(name, pluginStorage[name]);
  95816. };
  95817. Plugin2.isBasic = function isBasic(plugin) {
  95818. var p = typeof plugin === "string" ? getPlugin(plugin) : plugin;
  95819. return typeof p === "function" && !Plugin2.prototype.isPrototypeOf(p.prototype);
  95820. };
  95821. Plugin2.registerPlugin = function registerPlugin(name, plugin) {
  95822. if (typeof name !== "string") {
  95823. throw new Error('Illegal plugin name, "' + name + '", must be a string, was ' + typeof name + ".");
  95824. }
  95825. if (pluginExists(name)) {
  95826. log$1.warn('A plugin named "' + name + '" already exists. You may want to avoid re-registering plugins!');
  95827. } else if (Player.prototype.hasOwnProperty(name)) {
  95828. throw new Error('Illegal plugin name, "' + name + '", cannot share a name with an existing player method!');
  95829. }
  95830. if (typeof plugin !== "function") {
  95831. throw new Error('Illegal plugin for "' + name + '", must be a function, was ' + typeof plugin + ".");
  95832. }
  95833. pluginStorage[name] = plugin;
  95834. if (name !== BASE_PLUGIN_NAME) {
  95835. if (Plugin2.isBasic(plugin)) {
  95836. Player.prototype[name] = createBasicPlugin(name, plugin);
  95837. } else {
  95838. Player.prototype[name] = createPluginFactory(name, plugin);
  95839. }
  95840. }
  95841. return plugin;
  95842. };
  95843. Plugin2.deregisterPlugin = function deregisterPlugin(name) {
  95844. if (name === BASE_PLUGIN_NAME) {
  95845. throw new Error("Cannot de-register base plugin.");
  95846. }
  95847. if (pluginExists(name)) {
  95848. delete pluginStorage[name];
  95849. delete Player.prototype[name];
  95850. }
  95851. };
  95852. Plugin2.getPlugins = function getPlugins(names2) {
  95853. if (names2 === void 0) {
  95854. names2 = Object.keys(pluginStorage);
  95855. }
  95856. var result;
  95857. names2.forEach(function(name) {
  95858. var plugin = getPlugin(name);
  95859. if (plugin) {
  95860. result = result || {};
  95861. result[name] = plugin;
  95862. }
  95863. });
  95864. return result;
  95865. };
  95866. Plugin2.getPluginVersion = function getPluginVersion(name) {
  95867. var plugin = getPlugin(name);
  95868. return plugin && plugin.VERSION || "";
  95869. };
  95870. return Plugin2;
  95871. }();
  95872. Plugin.getPlugin = getPlugin;
  95873. Plugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;
  95874. Plugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);
  95875. Player.prototype.usingPlugin = function(name) {
  95876. return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;
  95877. };
  95878. Player.prototype.hasPlugin = function(name) {
  95879. return !!pluginExists(name);
  95880. };
  95881. var hasLogged = false;
  95882. var extend = function extend2(superClass, subClassMethods) {
  95883. if (subClassMethods === void 0) {
  95884. subClassMethods = {};
  95885. }
  95886. if (!hasLogged) {
  95887. log$1.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0");
  95888. hasLogged = true;
  95889. }
  95890. var subClass = function subClass2() {
  95891. superClass.apply(this, arguments);
  95892. };
  95893. var methods = {};
  95894. if (typeof subClassMethods === "object") {
  95895. if (subClassMethods.constructor !== Object.prototype.constructor) {
  95896. subClass = subClassMethods.constructor;
  95897. }
  95898. methods = subClassMethods;
  95899. } else if (typeof subClassMethods === "function") {
  95900. subClass = subClassMethods;
  95901. }
  95902. _inherits(subClass, superClass);
  95903. if (superClass) {
  95904. subClass.super_ = superClass;
  95905. }
  95906. for (var name in methods) {
  95907. if (methods.hasOwnProperty(name)) {
  95908. subClass.prototype[name] = methods[name];
  95909. }
  95910. }
  95911. return subClass;
  95912. };
  95913. var normalizeId = function normalizeId2(id) {
  95914. return id.indexOf("#") === 0 ? id.slice(1) : id;
  95915. };
  95916. function videojs(id, options2, ready) {
  95917. var player = videojs.getPlayer(id);
  95918. if (player) {
  95919. if (options2) {
  95920. log$1.warn('Player "' + id + '" is already initialised. Options will not be applied.');
  95921. }
  95922. if (ready) {
  95923. player.ready(ready);
  95924. }
  95925. return player;
  95926. }
  95927. var el = typeof id === "string" ? $("#" + normalizeId(id)) : id;
  95928. if (!isEl(el)) {
  95929. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  95930. }
  95931. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  95932. log$1.warn("The element supplied is not included in the DOM");
  95933. }
  95934. options2 = options2 || {};
  95935. if (options2.restoreEl === true) {
  95936. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  95937. }
  95938. hooks("beforesetup").forEach(function(hookFunction) {
  95939. var opts = hookFunction(el, mergeOptions$3(options2));
  95940. if (!isObject2(opts) || Array.isArray(opts)) {
  95941. log$1.error("please return an object in beforesetup hooks");
  95942. return;
  95943. }
  95944. options2 = mergeOptions$3(options2, opts);
  95945. });
  95946. var PlayerComponent = Component$1.getComponent("Player");
  95947. player = new PlayerComponent(el, options2, ready);
  95948. hooks("setup").forEach(function(hookFunction) {
  95949. return hookFunction(player);
  95950. });
  95951. return player;
  95952. }
  95953. videojs.hooks_ = hooks_;
  95954. videojs.hooks = hooks;
  95955. videojs.hook = hook;
  95956. videojs.hookOnce = hookOnce;
  95957. videojs.removeHook = removeHook;
  95958. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {
  95959. var style = $(".vjs-styles-defaults");
  95960. if (!style) {
  95961. style = createStyleElement("vjs-styles-defaults");
  95962. var head = $("head");
  95963. if (head) {
  95964. head.insertBefore(style, head.firstChild);
  95965. }
  95966. setTextContent(style, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ");
  95967. }
  95968. }
  95969. autoSetupTimeout(1, videojs);
  95970. videojs.VERSION = version$5;
  95971. videojs.options = Player.prototype.options_;
  95972. videojs.getPlayers = function() {
  95973. return Player.players;
  95974. };
  95975. videojs.getPlayer = function(id) {
  95976. var players = Player.players;
  95977. var tag;
  95978. if (typeof id === "string") {
  95979. var nId = normalizeId(id);
  95980. var player = players[nId];
  95981. if (player) {
  95982. return player;
  95983. }
  95984. tag = $("#" + nId);
  95985. } else {
  95986. tag = id;
  95987. }
  95988. if (isEl(tag)) {
  95989. var _tag = tag, _player = _tag.player, playerId = _tag.playerId;
  95990. if (_player || players[playerId]) {
  95991. return _player || players[playerId];
  95992. }
  95993. }
  95994. };
  95995. videojs.getAllPlayers = function() {
  95996. return Object.keys(Player.players).map(function(k) {
  95997. return Player.players[k];
  95998. }).filter(Boolean);
  95999. };
  96000. videojs.players = Player.players;
  96001. videojs.getComponent = Component$1.getComponent;
  96002. videojs.registerComponent = function(name, comp) {
  96003. if (Tech$1.isTech(comp)) {
  96004. log$1.warn("The " + name + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)");
  96005. }
  96006. Component$1.registerComponent.call(Component$1, name, comp);
  96007. };
  96008. videojs.getTech = Tech$1.getTech;
  96009. videojs.registerTech = Tech$1.registerTech;
  96010. videojs.use = use;
  96011. Object.defineProperty(videojs, "middleware", {
  96012. value: {},
  96013. writeable: false,
  96014. enumerable: true
  96015. });
  96016. Object.defineProperty(videojs.middleware, "TERMINATOR", {
  96017. value: TERMINATOR,
  96018. writeable: false,
  96019. enumerable: true
  96020. });
  96021. videojs.browser = browser;
  96022. videojs.TOUCH_ENABLED = TOUCH_ENABLED;
  96023. videojs.extend = extend;
  96024. videojs.mergeOptions = mergeOptions$3;
  96025. videojs.bind = bind;
  96026. videojs.registerPlugin = Plugin.registerPlugin;
  96027. videojs.deregisterPlugin = Plugin.deregisterPlugin;
  96028. videojs.plugin = function(name, plugin) {
  96029. log$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  96030. return Plugin.registerPlugin(name, plugin);
  96031. };
  96032. videojs.getPlugins = Plugin.getPlugins;
  96033. videojs.getPlugin = Plugin.getPlugin;
  96034. videojs.getPluginVersion = Plugin.getPluginVersion;
  96035. videojs.addLanguage = function(code, data) {
  96036. var _mergeOptions;
  96037. code = ("" + code).toLowerCase();
  96038. videojs.options.languages = mergeOptions$3(videojs.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));
  96039. return videojs.options.languages[code];
  96040. };
  96041. videojs.log = log$1;
  96042. videojs.createLogger = createLogger;
  96043. videojs.createTimeRange = videojs.createTimeRanges = createTimeRanges;
  96044. videojs.formatTime = formatTime;
  96045. videojs.setFormatTime = setFormatTime;
  96046. videojs.resetFormatTime = resetFormatTime;
  96047. videojs.parseUrl = parseUrl;
  96048. videojs.isCrossOrigin = isCrossOrigin;
  96049. videojs.EventTarget = EventTarget$2;
  96050. videojs.on = on;
  96051. videojs.one = one;
  96052. videojs.off = off;
  96053. videojs.trigger = trigger;
  96054. videojs.xhr = XHR;
  96055. videojs.TextTrack = TextTrack;
  96056. videojs.AudioTrack = AudioTrack;
  96057. videojs.VideoTrack = VideoTrack;
  96058. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(k) {
  96059. videojs[k] = function() {
  96060. log$1.warn("videojs." + k + "() is deprecated; use videojs.dom." + k + "() instead");
  96061. return Dom$1[k].apply(null, arguments);
  96062. };
  96063. });
  96064. videojs.computedStyle = computedStyle;
  96065. videojs.dom = Dom$1;
  96066. videojs.url = Url$1;
  96067. videojs.defineLazyProperty = defineLazyProperty;
  96068. videojs.addLanguage("en", {
  96069. "Non-Fullscreen": "Exit Fullscreen"
  96070. });
  96071. /*! @name @videojs/http-streaming @version 2.16.2 @license Apache-2.0 */
  96072. var resolveUrl4 = resolveUrl$1;
  96073. var resolveManifestRedirect = function resolveManifestRedirect2(handleManifestRedirect, url, req) {
  96074. if (handleManifestRedirect && req && req.responseURL && url !== req.responseURL) {
  96075. return req.responseURL;
  96076. }
  96077. return url;
  96078. };
  96079. var logger = function logger2(source) {
  96080. if (videojs.log.debug) {
  96081. return videojs.log.debug.bind(videojs, "VHS:", source + " >");
  96082. }
  96083. return function() {
  96084. };
  96085. };
  96086. var TIME_FUDGE_FACTOR = 1 / 30;
  96087. var SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;
  96088. var filterRanges = function filterRanges2(timeRanges, predicate) {
  96089. var results = [];
  96090. var i2;
  96091. if (timeRanges && timeRanges.length) {
  96092. for (i2 = 0; i2 < timeRanges.length; i2++) {
  96093. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  96094. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  96095. }
  96096. }
  96097. }
  96098. return videojs.createTimeRanges(results);
  96099. };
  96100. var findRange = function findRange2(buffered, time) {
  96101. return filterRanges(buffered, function(start2, end) {
  96102. return start2 - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;
  96103. });
  96104. };
  96105. var findNextRange = function findNextRange2(timeRanges, time) {
  96106. return filterRanges(timeRanges, function(start2) {
  96107. return start2 - TIME_FUDGE_FACTOR >= time;
  96108. });
  96109. };
  96110. var findGaps = function findGaps2(buffered) {
  96111. if (buffered.length < 2) {
  96112. return videojs.createTimeRanges();
  96113. }
  96114. var ranges = [];
  96115. for (var i2 = 1; i2 < buffered.length; i2++) {
  96116. var start2 = buffered.end(i2 - 1);
  96117. var end = buffered.start(i2);
  96118. ranges.push([start2, end]);
  96119. }
  96120. return videojs.createTimeRanges(ranges);
  96121. };
  96122. var bufferIntersection = function bufferIntersection2(bufferA, bufferB) {
  96123. var start2 = null;
  96124. var end = null;
  96125. var arity = 0;
  96126. var extents = [];
  96127. var ranges = [];
  96128. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  96129. return videojs.createTimeRange();
  96130. }
  96131. var count = bufferA.length;
  96132. while (count--) {
  96133. extents.push({
  96134. time: bufferA.start(count),
  96135. type: "start"
  96136. });
  96137. extents.push({
  96138. time: bufferA.end(count),
  96139. type: "end"
  96140. });
  96141. }
  96142. count = bufferB.length;
  96143. while (count--) {
  96144. extents.push({
  96145. time: bufferB.start(count),
  96146. type: "start"
  96147. });
  96148. extents.push({
  96149. time: bufferB.end(count),
  96150. type: "end"
  96151. });
  96152. }
  96153. extents.sort(function(a, b) {
  96154. return a.time - b.time;
  96155. });
  96156. for (count = 0; count < extents.length; count++) {
  96157. if (extents[count].type === "start") {
  96158. arity++;
  96159. if (arity === 2) {
  96160. start2 = extents[count].time;
  96161. }
  96162. } else if (extents[count].type === "end") {
  96163. arity--;
  96164. if (arity === 1) {
  96165. end = extents[count].time;
  96166. }
  96167. }
  96168. if (start2 !== null && end !== null) {
  96169. ranges.push([start2, end]);
  96170. start2 = null;
  96171. end = null;
  96172. }
  96173. }
  96174. return videojs.createTimeRanges(ranges);
  96175. };
  96176. var printableRange = function printableRange2(range3) {
  96177. var strArr = [];
  96178. if (!range3 || !range3.length) {
  96179. return "";
  96180. }
  96181. for (var i2 = 0; i2 < range3.length; i2++) {
  96182. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  96183. }
  96184. return strArr.join(", ");
  96185. };
  96186. var timeUntilRebuffer = function timeUntilRebuffer2(buffered, currentTime, playbackRate) {
  96187. if (playbackRate === void 0) {
  96188. playbackRate = 1;
  96189. }
  96190. var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  96191. return (bufferedEnd - currentTime) / playbackRate;
  96192. };
  96193. var timeRangesToArray = function timeRangesToArray2(timeRanges) {
  96194. var timeRangesList = [];
  96195. for (var i2 = 0; i2 < timeRanges.length; i2++) {
  96196. timeRangesList.push({
  96197. start: timeRanges.start(i2),
  96198. end: timeRanges.end(i2)
  96199. });
  96200. }
  96201. return timeRangesList;
  96202. };
  96203. var isRangeDifferent = function isRangeDifferent2(a, b) {
  96204. if (a === b) {
  96205. return false;
  96206. }
  96207. if (!a && b || !b && a) {
  96208. return true;
  96209. }
  96210. if (a.length !== b.length) {
  96211. return true;
  96212. }
  96213. for (var i2 = 0; i2 < a.length; i2++) {
  96214. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  96215. return true;
  96216. }
  96217. }
  96218. return false;
  96219. };
  96220. var lastBufferedEnd = function lastBufferedEnd2(a) {
  96221. if (!a || !a.length || !a.end) {
  96222. return;
  96223. }
  96224. return a.end(a.length - 1);
  96225. };
  96226. var timeAheadOf = function timeAheadOf2(range3, startTime) {
  96227. var time = 0;
  96228. if (!range3 || !range3.length) {
  96229. return time;
  96230. }
  96231. for (var i2 = 0; i2 < range3.length; i2++) {
  96232. var start2 = range3.start(i2);
  96233. var end = range3.end(i2);
  96234. if (startTime > end) {
  96235. continue;
  96236. }
  96237. if (startTime > start2 && startTime <= end) {
  96238. time += end - startTime;
  96239. continue;
  96240. }
  96241. time += end - start2;
  96242. }
  96243. return time;
  96244. };
  96245. var createTimeRange$1 = videojs.createTimeRange;
  96246. var segmentDurationWithParts = function segmentDurationWithParts2(playlist, segment) {
  96247. if (!segment.preload) {
  96248. return segment.duration;
  96249. }
  96250. var result = 0;
  96251. (segment.parts || []).forEach(function(p) {
  96252. result += p.duration;
  96253. });
  96254. (segment.preloadHints || []).forEach(function(p) {
  96255. if (p.type === "PART") {
  96256. result += playlist.partTargetDuration;
  96257. }
  96258. });
  96259. return result;
  96260. };
  96261. var getPartsAndSegments = function getPartsAndSegments2(playlist) {
  96262. return (playlist.segments || []).reduce(function(acc, segment, si) {
  96263. if (segment.parts) {
  96264. segment.parts.forEach(function(part, pi) {
  96265. acc.push({
  96266. duration: part.duration,
  96267. segmentIndex: si,
  96268. partIndex: pi,
  96269. part,
  96270. segment
  96271. });
  96272. });
  96273. } else {
  96274. acc.push({
  96275. duration: segment.duration,
  96276. segmentIndex: si,
  96277. partIndex: null,
  96278. segment,
  96279. part: null
  96280. });
  96281. }
  96282. return acc;
  96283. }, []);
  96284. };
  96285. var getLastParts = function getLastParts2(media) {
  96286. var lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  96287. return lastSegment && lastSegment.parts || [];
  96288. };
  96289. var getKnownPartCount = function getKnownPartCount2(_ref) {
  96290. var preloadSegment = _ref.preloadSegment;
  96291. if (!preloadSegment) {
  96292. return;
  96293. }
  96294. var parts = preloadSegment.parts, preloadHints = preloadSegment.preloadHints;
  96295. var partCount = (preloadHints || []).reduce(function(count, hint) {
  96296. return count + (hint.type === "PART" ? 1 : 0);
  96297. }, 0);
  96298. partCount += parts && parts.length ? parts.length : 0;
  96299. return partCount;
  96300. };
  96301. var liveEdgeDelay = function liveEdgeDelay2(master, media) {
  96302. if (media.endList) {
  96303. return 0;
  96304. }
  96305. if (master && master.suggestedPresentationDelay) {
  96306. return master.suggestedPresentationDelay;
  96307. }
  96308. var hasParts = getLastParts(media).length > 0;
  96309. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  96310. return media.serverControl.partHoldBack;
  96311. } else if (hasParts && media.partTargetDuration) {
  96312. return media.partTargetDuration * 3;
  96313. } else if (media.serverControl && media.serverControl.holdBack) {
  96314. return media.serverControl.holdBack;
  96315. } else if (media.targetDuration) {
  96316. return media.targetDuration * 3;
  96317. }
  96318. return 0;
  96319. };
  96320. var backwardDuration = function backwardDuration2(playlist, endSequence) {
  96321. var result = 0;
  96322. var i2 = endSequence - playlist.mediaSequence;
  96323. var segment = playlist.segments[i2];
  96324. if (segment) {
  96325. if (typeof segment.start !== "undefined") {
  96326. return {
  96327. result: segment.start,
  96328. precise: true
  96329. };
  96330. }
  96331. if (typeof segment.end !== "undefined") {
  96332. return {
  96333. result: segment.end - segment.duration,
  96334. precise: true
  96335. };
  96336. }
  96337. }
  96338. while (i2--) {
  96339. segment = playlist.segments[i2];
  96340. if (typeof segment.end !== "undefined") {
  96341. return {
  96342. result: result + segment.end,
  96343. precise: true
  96344. };
  96345. }
  96346. result += segmentDurationWithParts(playlist, segment);
  96347. if (typeof segment.start !== "undefined") {
  96348. return {
  96349. result: result + segment.start,
  96350. precise: true
  96351. };
  96352. }
  96353. }
  96354. return {
  96355. result,
  96356. precise: false
  96357. };
  96358. };
  96359. var forwardDuration = function forwardDuration2(playlist, endSequence) {
  96360. var result = 0;
  96361. var segment;
  96362. var i2 = endSequence - playlist.mediaSequence;
  96363. for (; i2 < playlist.segments.length; i2++) {
  96364. segment = playlist.segments[i2];
  96365. if (typeof segment.start !== "undefined") {
  96366. return {
  96367. result: segment.start - result,
  96368. precise: true
  96369. };
  96370. }
  96371. result += segmentDurationWithParts(playlist, segment);
  96372. if (typeof segment.end !== "undefined") {
  96373. return {
  96374. result: segment.end - result,
  96375. precise: true
  96376. };
  96377. }
  96378. }
  96379. return {
  96380. result: -1,
  96381. precise: false
  96382. };
  96383. };
  96384. var intervalDuration = function intervalDuration2(playlist, endSequence, expired) {
  96385. if (typeof endSequence === "undefined") {
  96386. endSequence = playlist.mediaSequence + playlist.segments.length;
  96387. }
  96388. if (endSequence < playlist.mediaSequence) {
  96389. return 0;
  96390. }
  96391. var backward = backwardDuration(playlist, endSequence);
  96392. if (backward.precise) {
  96393. return backward.result;
  96394. }
  96395. var forward = forwardDuration(playlist, endSequence);
  96396. if (forward.precise) {
  96397. return forward.result;
  96398. }
  96399. return backward.result + expired;
  96400. };
  96401. var duration2 = function duration3(playlist, endSequence, expired) {
  96402. if (!playlist) {
  96403. return 0;
  96404. }
  96405. if (typeof expired !== "number") {
  96406. expired = 0;
  96407. }
  96408. if (typeof endSequence === "undefined") {
  96409. if (playlist.totalDuration) {
  96410. return playlist.totalDuration;
  96411. }
  96412. if (!playlist.endList) {
  96413. return window_1.Infinity;
  96414. }
  96415. }
  96416. return intervalDuration(playlist, endSequence, expired);
  96417. };
  96418. var sumDurations = function sumDurations2(_ref2) {
  96419. var defaultDuration = _ref2.defaultDuration, durationList = _ref2.durationList, startIndex = _ref2.startIndex, endIndex = _ref2.endIndex;
  96420. var durations = 0;
  96421. if (startIndex > endIndex) {
  96422. var _ref3 = [endIndex, startIndex];
  96423. startIndex = _ref3[0];
  96424. endIndex = _ref3[1];
  96425. }
  96426. if (startIndex < 0) {
  96427. for (var i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  96428. durations += defaultDuration;
  96429. }
  96430. startIndex = 0;
  96431. }
  96432. for (var _i = startIndex; _i < endIndex; _i++) {
  96433. durations += durationList[_i].duration;
  96434. }
  96435. return durations;
  96436. };
  96437. var playlistEnd = function playlistEnd2(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  96438. if (!playlist || !playlist.segments) {
  96439. return null;
  96440. }
  96441. if (playlist.endList) {
  96442. return duration2(playlist);
  96443. }
  96444. if (expired === null) {
  96445. return null;
  96446. }
  96447. expired = expired || 0;
  96448. var lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  96449. if (useSafeLiveEnd) {
  96450. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay(null, playlist);
  96451. lastSegmentEndTime -= liveEdgePadding;
  96452. }
  96453. return Math.max(0, lastSegmentEndTime);
  96454. };
  96455. var seekable = function seekable2(playlist, expired, liveEdgePadding) {
  96456. var useSafeLiveEnd = true;
  96457. var seekableStart = expired || 0;
  96458. var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  96459. if (seekableEnd === null) {
  96460. return createTimeRange$1();
  96461. }
  96462. return createTimeRange$1(seekableStart, seekableEnd);
  96463. };
  96464. var getMediaInfoForTime = function getMediaInfoForTime2(_ref4) {
  96465. var playlist = _ref4.playlist, currentTime = _ref4.currentTime, startingSegmentIndex = _ref4.startingSegmentIndex, startingPartIndex = _ref4.startingPartIndex, startTime = _ref4.startTime, experimentalExactManifestTimings = _ref4.experimentalExactManifestTimings;
  96466. var time = currentTime - startTime;
  96467. var partsAndSegments = getPartsAndSegments(playlist);
  96468. var startIndex = 0;
  96469. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  96470. var partAndSegment = partsAndSegments[i2];
  96471. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  96472. continue;
  96473. }
  96474. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  96475. continue;
  96476. }
  96477. startIndex = i2;
  96478. break;
  96479. }
  96480. if (time < 0) {
  96481. if (startIndex > 0) {
  96482. for (var _i2 = startIndex - 1; _i2 >= 0; _i2--) {
  96483. var _partAndSegment = partsAndSegments[_i2];
  96484. time += _partAndSegment.duration;
  96485. if (experimentalExactManifestTimings) {
  96486. if (time < 0) {
  96487. continue;
  96488. }
  96489. } else if (time + TIME_FUDGE_FACTOR <= 0) {
  96490. continue;
  96491. }
  96492. return {
  96493. partIndex: _partAndSegment.partIndex,
  96494. segmentIndex: _partAndSegment.segmentIndex,
  96495. startTime: startTime - sumDurations({
  96496. defaultDuration: playlist.targetDuration,
  96497. durationList: partsAndSegments,
  96498. startIndex,
  96499. endIndex: _i2
  96500. })
  96501. };
  96502. }
  96503. }
  96504. return {
  96505. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96506. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96507. startTime: currentTime
  96508. };
  96509. }
  96510. if (startIndex < 0) {
  96511. for (var _i3 = startIndex; _i3 < 0; _i3++) {
  96512. time -= playlist.targetDuration;
  96513. if (time < 0) {
  96514. return {
  96515. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96516. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96517. startTime: currentTime
  96518. };
  96519. }
  96520. }
  96521. startIndex = 0;
  96522. }
  96523. for (var _i4 = startIndex; _i4 < partsAndSegments.length; _i4++) {
  96524. var _partAndSegment2 = partsAndSegments[_i4];
  96525. time -= _partAndSegment2.duration;
  96526. if (experimentalExactManifestTimings) {
  96527. if (time > 0) {
  96528. continue;
  96529. }
  96530. } else if (time - TIME_FUDGE_FACTOR >= 0) {
  96531. continue;
  96532. }
  96533. return {
  96534. partIndex: _partAndSegment2.partIndex,
  96535. segmentIndex: _partAndSegment2.segmentIndex,
  96536. startTime: startTime + sumDurations({
  96537. defaultDuration: playlist.targetDuration,
  96538. durationList: partsAndSegments,
  96539. startIndex,
  96540. endIndex: _i4
  96541. })
  96542. };
  96543. }
  96544. return {
  96545. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  96546. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  96547. startTime: currentTime
  96548. };
  96549. };
  96550. var isBlacklisted = function isBlacklisted2(playlist) {
  96551. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  96552. };
  96553. var isIncompatible = function isIncompatible2(playlist) {
  96554. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  96555. };
  96556. var isEnabled = function isEnabled2(playlist) {
  96557. var blacklisted = isBlacklisted(playlist);
  96558. return !playlist.disabled && !blacklisted;
  96559. };
  96560. var isDisabled = function isDisabled2(playlist) {
  96561. return playlist.disabled;
  96562. };
  96563. var isAes = function isAes2(media) {
  96564. for (var i2 = 0; i2 < media.segments.length; i2++) {
  96565. if (media.segments[i2].key) {
  96566. return true;
  96567. }
  96568. }
  96569. return false;
  96570. };
  96571. var hasAttribute = function hasAttribute2(attr, playlist) {
  96572. return playlist.attributes && playlist.attributes[attr];
  96573. };
  96574. var estimateSegmentRequestTime = function estimateSegmentRequestTime2(segmentDuration, bandwidth2, playlist, bytesReceived) {
  96575. if (bytesReceived === void 0) {
  96576. bytesReceived = 0;
  96577. }
  96578. if (!hasAttribute("BANDWIDTH", playlist)) {
  96579. return NaN;
  96580. }
  96581. var size = segmentDuration * playlist.attributes.BANDWIDTH;
  96582. return (size - bytesReceived * 8) / bandwidth2;
  96583. };
  96584. var isLowestEnabledRendition = function isLowestEnabledRendition2(master, media) {
  96585. if (master.playlists.length === 1) {
  96586. return true;
  96587. }
  96588. var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  96589. return master.playlists.filter(function(playlist) {
  96590. if (!isEnabled(playlist)) {
  96591. return false;
  96592. }
  96593. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  96594. }).length === 0;
  96595. };
  96596. var playlistMatch = function playlistMatch2(a, b) {
  96597. if (!a && !b || !a && b || a && !b) {
  96598. return false;
  96599. }
  96600. if (a === b) {
  96601. return true;
  96602. }
  96603. if (a.id && b.id && a.id === b.id) {
  96604. return true;
  96605. }
  96606. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  96607. return true;
  96608. }
  96609. if (a.uri && b.uri && a.uri === b.uri) {
  96610. return true;
  96611. }
  96612. return false;
  96613. };
  96614. var someAudioVariant = function someAudioVariant2(master, callback2) {
  96615. var AUDIO5 = master && master.mediaGroups && master.mediaGroups.AUDIO || {};
  96616. var found = false;
  96617. for (var groupName in AUDIO5) {
  96618. for (var label in AUDIO5[groupName]) {
  96619. found = callback2(AUDIO5[groupName][label]);
  96620. if (found) {
  96621. break;
  96622. }
  96623. }
  96624. if (found) {
  96625. break;
  96626. }
  96627. }
  96628. return !!found;
  96629. };
  96630. var isAudioOnly = function isAudioOnly2(master) {
  96631. if (!master || !master.playlists || !master.playlists.length) {
  96632. var found = someAudioVariant(master, function(variant) {
  96633. return variant.playlists && variant.playlists.length || variant.uri;
  96634. });
  96635. return found;
  96636. }
  96637. var _loop = function _loop2(i3) {
  96638. var playlist = master.playlists[i3];
  96639. var CODECS = playlist.attributes && playlist.attributes.CODECS;
  96640. if (CODECS && CODECS.split(",").every(function(c) {
  96641. return isAudioCodec2(c);
  96642. })) {
  96643. return "continue";
  96644. }
  96645. var found2 = someAudioVariant(master, function(variant) {
  96646. return playlistMatch(playlist, variant);
  96647. });
  96648. if (found2) {
  96649. return "continue";
  96650. }
  96651. return {
  96652. v: false
  96653. };
  96654. };
  96655. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96656. var _ret = _loop(i2);
  96657. if (_ret === "continue")
  96658. continue;
  96659. if (typeof _ret === "object")
  96660. return _ret.v;
  96661. }
  96662. return true;
  96663. };
  96664. var Playlist = {
  96665. liveEdgeDelay,
  96666. duration: duration2,
  96667. seekable,
  96668. getMediaInfoForTime,
  96669. isEnabled,
  96670. isDisabled,
  96671. isBlacklisted,
  96672. isIncompatible,
  96673. playlistEnd,
  96674. isAes,
  96675. hasAttribute,
  96676. estimateSegmentRequestTime,
  96677. isLowestEnabledRendition,
  96678. isAudioOnly,
  96679. playlistMatch,
  96680. segmentDurationWithParts
  96681. };
  96682. var log = videojs.log;
  96683. var createPlaylistID = function createPlaylistID2(index2, uri) {
  96684. return index2 + "-" + uri;
  96685. };
  96686. var groupID = function groupID2(type2, group, label) {
  96687. return "placeholder-uri-" + type2 + "-" + group + "-" + label;
  96688. };
  96689. var parseManifest = function parseManifest2(_ref) {
  96690. var onwarn = _ref.onwarn, oninfo = _ref.oninfo, manifestString = _ref.manifestString, _ref$customTagParsers = _ref.customTagParsers, customTagParsers = _ref$customTagParsers === void 0 ? [] : _ref$customTagParsers, _ref$customTagMappers = _ref.customTagMappers, customTagMappers = _ref$customTagMappers === void 0 ? [] : _ref$customTagMappers, experimentalLLHLS = _ref.experimentalLLHLS;
  96691. var parser2 = new Parser();
  96692. if (onwarn) {
  96693. parser2.on("warn", onwarn);
  96694. }
  96695. if (oninfo) {
  96696. parser2.on("info", oninfo);
  96697. }
  96698. customTagParsers.forEach(function(customParser) {
  96699. return parser2.addParser(customParser);
  96700. });
  96701. customTagMappers.forEach(function(mapper) {
  96702. return parser2.addTagMapper(mapper);
  96703. });
  96704. parser2.push(manifestString);
  96705. parser2.end();
  96706. var manifest = parser2.manifest;
  96707. if (!experimentalLLHLS) {
  96708. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  96709. if (manifest.hasOwnProperty(k)) {
  96710. delete manifest[k];
  96711. }
  96712. });
  96713. if (manifest.segments) {
  96714. manifest.segments.forEach(function(segment) {
  96715. ["parts", "preloadHints"].forEach(function(k) {
  96716. if (segment.hasOwnProperty(k)) {
  96717. delete segment[k];
  96718. }
  96719. });
  96720. });
  96721. }
  96722. }
  96723. if (!manifest.targetDuration) {
  96724. var targetDuration = 10;
  96725. if (manifest.segments && manifest.segments.length) {
  96726. targetDuration = manifest.segments.reduce(function(acc, s) {
  96727. return Math.max(acc, s.duration);
  96728. }, 0);
  96729. }
  96730. if (onwarn) {
  96731. onwarn("manifest has no targetDuration defaulting to " + targetDuration);
  96732. }
  96733. manifest.targetDuration = targetDuration;
  96734. }
  96735. var parts = getLastParts(manifest);
  96736. if (parts.length && !manifest.partTargetDuration) {
  96737. var partTargetDuration = parts.reduce(function(acc, p) {
  96738. return Math.max(acc, p.duration);
  96739. }, 0);
  96740. if (onwarn) {
  96741. onwarn("manifest has no partTargetDuration defaulting to " + partTargetDuration);
  96742. log.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  96743. }
  96744. manifest.partTargetDuration = partTargetDuration;
  96745. }
  96746. return manifest;
  96747. };
  96748. var forEachMediaGroup3 = function forEachMediaGroup4(master, callback2) {
  96749. if (!master.mediaGroups) {
  96750. return;
  96751. }
  96752. ["AUDIO", "SUBTITLES"].forEach(function(mediaType) {
  96753. if (!master.mediaGroups[mediaType]) {
  96754. return;
  96755. }
  96756. for (var groupKey in master.mediaGroups[mediaType]) {
  96757. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  96758. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  96759. callback2(mediaProperties, mediaType, groupKey, labelKey);
  96760. }
  96761. }
  96762. });
  96763. };
  96764. var setupMediaPlaylist = function setupMediaPlaylist2(_ref2) {
  96765. var playlist = _ref2.playlist, uri = _ref2.uri, id = _ref2.id;
  96766. playlist.id = id;
  96767. playlist.playlistErrors_ = 0;
  96768. if (uri) {
  96769. playlist.uri = uri;
  96770. }
  96771. playlist.attributes = playlist.attributes || {};
  96772. };
  96773. var setupMediaPlaylists = function setupMediaPlaylists2(master) {
  96774. var i2 = master.playlists.length;
  96775. while (i2--) {
  96776. var playlist = master.playlists[i2];
  96777. setupMediaPlaylist({
  96778. playlist,
  96779. id: createPlaylistID(i2, playlist.uri)
  96780. });
  96781. playlist.resolvedUri = resolveUrl4(master.uri, playlist.uri);
  96782. master.playlists[playlist.id] = playlist;
  96783. master.playlists[playlist.uri] = playlist;
  96784. if (!playlist.attributes.BANDWIDTH) {
  96785. log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  96786. }
  96787. }
  96788. };
  96789. var resolveMediaGroupUris = function resolveMediaGroupUris2(master) {
  96790. forEachMediaGroup3(master, function(properties) {
  96791. if (properties.uri) {
  96792. properties.resolvedUri = resolveUrl4(master.uri, properties.uri);
  96793. }
  96794. });
  96795. };
  96796. var masterForMedia = function masterForMedia2(media, uri) {
  96797. var id = createPlaylistID(0, uri);
  96798. var master = {
  96799. mediaGroups: {
  96800. "AUDIO": {},
  96801. "VIDEO": {},
  96802. "CLOSED-CAPTIONS": {},
  96803. "SUBTITLES": {}
  96804. },
  96805. uri: window_1.location.href,
  96806. resolvedUri: window_1.location.href,
  96807. playlists: [{
  96808. uri,
  96809. id,
  96810. resolvedUri: uri,
  96811. attributes: {}
  96812. }]
  96813. };
  96814. master.playlists[id] = master.playlists[0];
  96815. master.playlists[uri] = master.playlists[0];
  96816. return master;
  96817. };
  96818. var addPropertiesToMaster = function addPropertiesToMaster2(master, uri, createGroupID) {
  96819. if (createGroupID === void 0) {
  96820. createGroupID = groupID;
  96821. }
  96822. master.uri = uri;
  96823. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96824. if (!master.playlists[i2].uri) {
  96825. var phonyUri = "placeholder-uri-" + i2;
  96826. master.playlists[i2].uri = phonyUri;
  96827. }
  96828. }
  96829. var audioOnlyMaster = isAudioOnly(master);
  96830. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  96831. if (!properties.playlists || !properties.playlists.length) {
  96832. if (audioOnlyMaster && mediaType === "AUDIO" && !properties.uri) {
  96833. for (var _i = 0; _i < master.playlists.length; _i++) {
  96834. var p = master.playlists[_i];
  96835. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  96836. return;
  96837. }
  96838. }
  96839. }
  96840. properties.playlists = [_extends$2({}, properties)];
  96841. }
  96842. properties.playlists.forEach(function(p2, i3) {
  96843. var groupId = createGroupID(mediaType, groupKey, labelKey, p2);
  96844. var id = createPlaylistID(i3, groupId);
  96845. if (p2.uri) {
  96846. p2.resolvedUri = p2.resolvedUri || resolveUrl4(master.uri, p2.uri);
  96847. } else {
  96848. p2.uri = i3 === 0 ? groupId : id;
  96849. p2.resolvedUri = p2.uri;
  96850. }
  96851. p2.id = p2.id || id;
  96852. p2.attributes = p2.attributes || {};
  96853. master.playlists[p2.id] = p2;
  96854. master.playlists[p2.uri] = p2;
  96855. });
  96856. });
  96857. setupMediaPlaylists(master);
  96858. resolveMediaGroupUris(master);
  96859. };
  96860. var mergeOptions$2 = videojs.mergeOptions, EventTarget$1 = videojs.EventTarget;
  96861. var addLLHLSQueryDirectives = function addLLHLSQueryDirectives2(uri, media) {
  96862. if (media.endList || !media.serverControl) {
  96863. return uri;
  96864. }
  96865. var parameters = {};
  96866. if (media.serverControl.canBlockReload) {
  96867. var preloadSegment = media.preloadSegment;
  96868. var nextMSN = media.mediaSequence + media.segments.length;
  96869. if (preloadSegment) {
  96870. var parts = preloadSegment.parts || [];
  96871. var nextPart = getKnownPartCount(media) - 1;
  96872. if (nextPart > -1 && nextPart !== parts.length - 1) {
  96873. parameters._HLS_part = nextPart;
  96874. }
  96875. if (nextPart > -1 || parts.length) {
  96876. nextMSN--;
  96877. }
  96878. }
  96879. parameters._HLS_msn = nextMSN;
  96880. }
  96881. if (media.serverControl && media.serverControl.canSkipUntil) {
  96882. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  96883. }
  96884. if (Object.keys(parameters).length) {
  96885. var parsedUri = new window_1.URL(uri);
  96886. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  96887. if (!parameters.hasOwnProperty(name)) {
  96888. return;
  96889. }
  96890. parsedUri.searchParams.set(name, parameters[name]);
  96891. });
  96892. uri = parsedUri.toString();
  96893. }
  96894. return uri;
  96895. };
  96896. var updateSegment = function updateSegment2(a, b) {
  96897. if (!a) {
  96898. return b;
  96899. }
  96900. var result = mergeOptions$2(a, b);
  96901. if (a.preloadHints && !b.preloadHints) {
  96902. delete result.preloadHints;
  96903. }
  96904. if (a.parts && !b.parts) {
  96905. delete result.parts;
  96906. } else if (a.parts && b.parts) {
  96907. for (var i2 = 0; i2 < b.parts.length; i2++) {
  96908. if (a.parts && a.parts[i2]) {
  96909. result.parts[i2] = mergeOptions$2(a.parts[i2], b.parts[i2]);
  96910. }
  96911. }
  96912. }
  96913. if (!a.skipped && b.skipped) {
  96914. result.skipped = false;
  96915. }
  96916. if (a.preload && !b.preload) {
  96917. result.preload = false;
  96918. }
  96919. return result;
  96920. };
  96921. var updateSegments = function updateSegments2(original, update, offset) {
  96922. var oldSegments = original.slice();
  96923. var newSegments = update.slice();
  96924. offset = offset || 0;
  96925. var result = [];
  96926. var currentMap;
  96927. for (var newIndex = 0; newIndex < newSegments.length; newIndex++) {
  96928. var oldSegment = oldSegments[newIndex + offset];
  96929. var newSegment = newSegments[newIndex];
  96930. if (oldSegment) {
  96931. currentMap = oldSegment.map || currentMap;
  96932. result.push(updateSegment(oldSegment, newSegment));
  96933. } else {
  96934. if (currentMap && !newSegment.map) {
  96935. newSegment.map = currentMap;
  96936. }
  96937. result.push(newSegment);
  96938. }
  96939. }
  96940. return result;
  96941. };
  96942. var resolveSegmentUris = function resolveSegmentUris2(segment, baseUri) {
  96943. if (!segment.resolvedUri && segment.uri) {
  96944. segment.resolvedUri = resolveUrl4(baseUri, segment.uri);
  96945. }
  96946. if (segment.key && !segment.key.resolvedUri) {
  96947. segment.key.resolvedUri = resolveUrl4(baseUri, segment.key.uri);
  96948. }
  96949. if (segment.map && !segment.map.resolvedUri) {
  96950. segment.map.resolvedUri = resolveUrl4(baseUri, segment.map.uri);
  96951. }
  96952. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  96953. segment.map.key.resolvedUri = resolveUrl4(baseUri, segment.map.key.uri);
  96954. }
  96955. if (segment.parts && segment.parts.length) {
  96956. segment.parts.forEach(function(p) {
  96957. if (p.resolvedUri) {
  96958. return;
  96959. }
  96960. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  96961. });
  96962. }
  96963. if (segment.preloadHints && segment.preloadHints.length) {
  96964. segment.preloadHints.forEach(function(p) {
  96965. if (p.resolvedUri) {
  96966. return;
  96967. }
  96968. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  96969. });
  96970. }
  96971. };
  96972. var getAllSegments = function getAllSegments2(media) {
  96973. var segments = media.segments || [];
  96974. var preloadSegment = media.preloadSegment;
  96975. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  96976. if (preloadSegment.preloadHints) {
  96977. for (var i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  96978. if (preloadSegment.preloadHints[i2].type === "MAP") {
  96979. return segments;
  96980. }
  96981. }
  96982. }
  96983. preloadSegment.duration = media.targetDuration;
  96984. preloadSegment.preload = true;
  96985. segments.push(preloadSegment);
  96986. }
  96987. return segments;
  96988. };
  96989. var isPlaylistUnchanged = function isPlaylistUnchanged2(a, b) {
  96990. return a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  96991. };
  96992. var updateMaster$1 = function updateMaster(master, newMedia, unchangedCheck) {
  96993. if (unchangedCheck === void 0) {
  96994. unchangedCheck = isPlaylistUnchanged;
  96995. }
  96996. var result = mergeOptions$2(master, {});
  96997. var oldMedia = result.playlists[newMedia.id];
  96998. if (!oldMedia) {
  96999. return null;
  97000. }
  97001. if (unchangedCheck(oldMedia, newMedia)) {
  97002. return null;
  97003. }
  97004. newMedia.segments = getAllSegments(newMedia);
  97005. var mergedPlaylist = mergeOptions$2(oldMedia, newMedia);
  97006. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  97007. delete mergedPlaylist.preloadSegment;
  97008. }
  97009. if (oldMedia.segments) {
  97010. if (newMedia.skip) {
  97011. newMedia.segments = newMedia.segments || [];
  97012. for (var i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  97013. newMedia.segments.unshift({
  97014. skipped: true
  97015. });
  97016. }
  97017. }
  97018. mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  97019. }
  97020. mergedPlaylist.segments.forEach(function(segment) {
  97021. resolveSegmentUris(segment, mergedPlaylist.resolvedUri);
  97022. });
  97023. for (var _i = 0; _i < result.playlists.length; _i++) {
  97024. if (result.playlists[_i].id === newMedia.id) {
  97025. result.playlists[_i] = mergedPlaylist;
  97026. }
  97027. }
  97028. result.playlists[newMedia.id] = mergedPlaylist;
  97029. result.playlists[newMedia.uri] = mergedPlaylist;
  97030. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97031. if (!properties.playlists) {
  97032. return;
  97033. }
  97034. for (var _i2 = 0; _i2 < properties.playlists.length; _i2++) {
  97035. if (newMedia.id === properties.playlists[_i2].id) {
  97036. properties.playlists[_i2] = mergedPlaylist;
  97037. }
  97038. }
  97039. });
  97040. return result;
  97041. };
  97042. var refreshDelay = function refreshDelay2(media, update) {
  97043. var segments = media.segments || [];
  97044. var lastSegment = segments[segments.length - 1];
  97045. var lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  97046. var lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  97047. if (update && lastDuration) {
  97048. return lastDuration * 1e3;
  97049. }
  97050. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  97051. };
  97052. var PlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97053. _inheritsLoose(PlaylistLoader2, _EventTarget);
  97054. function PlaylistLoader2(src, vhs, options2) {
  97055. var _this;
  97056. if (options2 === void 0) {
  97057. options2 = {};
  97058. }
  97059. _this = _EventTarget.call(this) || this;
  97060. if (!src) {
  97061. throw new Error("A non-empty playlist URL or object is required");
  97062. }
  97063. _this.logger_ = logger("PlaylistLoader");
  97064. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97065. _this.src = src;
  97066. _this.vhs_ = vhs;
  97067. _this.withCredentials = withCredentials;
  97068. _this.handleManifestRedirects = handleManifestRedirects;
  97069. var vhsOptions = vhs.options_;
  97070. _this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  97071. _this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  97072. _this.experimentalLLHLS = vhsOptions && vhsOptions.experimentalLLHLS || false;
  97073. if (videojs.browser.IE_VERSION) {
  97074. _this.experimentalLLHLS = false;
  97075. }
  97076. _this.state = "HAVE_NOTHING";
  97077. _this.handleMediaupdatetimeout_ = _this.handleMediaupdatetimeout_.bind(_assertThisInitialized(_this));
  97078. _this.on("mediaupdatetimeout", _this.handleMediaupdatetimeout_);
  97079. return _this;
  97080. }
  97081. var _proto = PlaylistLoader2.prototype;
  97082. _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() {
  97083. var _this2 = this;
  97084. if (this.state !== "HAVE_METADATA") {
  97085. return;
  97086. }
  97087. var media = this.media();
  97088. var uri = resolveUrl4(this.master.uri, media.uri);
  97089. if (this.experimentalLLHLS) {
  97090. uri = addLLHLSQueryDirectives(uri, media);
  97091. }
  97092. this.state = "HAVE_CURRENT_METADATA";
  97093. this.request = this.vhs_.xhr({
  97094. uri,
  97095. withCredentials: this.withCredentials
  97096. }, function(error, req) {
  97097. if (!_this2.request) {
  97098. return;
  97099. }
  97100. if (error) {
  97101. return _this2.playlistRequestError(_this2.request, _this2.media(), "HAVE_METADATA");
  97102. }
  97103. _this2.haveMetadata({
  97104. playlistString: _this2.request.responseText,
  97105. url: _this2.media().uri,
  97106. id: _this2.media().id
  97107. });
  97108. });
  97109. };
  97110. _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) {
  97111. var uri = playlist.uri, id = playlist.id;
  97112. this.request = null;
  97113. if (startingState) {
  97114. this.state = startingState;
  97115. }
  97116. this.error = {
  97117. playlist: this.master.playlists[id],
  97118. status: xhr.status,
  97119. message: "HLS playlist request error at URL: " + uri + ".",
  97120. responseText: xhr.responseText,
  97121. code: xhr.status >= 500 ? 4 : 2
  97122. };
  97123. this.trigger("error");
  97124. };
  97125. _proto.parseManifest_ = function parseManifest_(_ref) {
  97126. var _this3 = this;
  97127. var url = _ref.url, manifestString = _ref.manifestString;
  97128. return parseManifest({
  97129. onwarn: function onwarn(_ref2) {
  97130. var message = _ref2.message;
  97131. return _this3.logger_("m3u8-parser warn for " + url + ": " + message);
  97132. },
  97133. oninfo: function oninfo(_ref3) {
  97134. var message = _ref3.message;
  97135. return _this3.logger_("m3u8-parser info for " + url + ": " + message);
  97136. },
  97137. manifestString,
  97138. customTagParsers: this.customTagParsers,
  97139. customTagMappers: this.customTagMappers,
  97140. experimentalLLHLS: this.experimentalLLHLS
  97141. });
  97142. };
  97143. _proto.haveMetadata = function haveMetadata(_ref4) {
  97144. var playlistString = _ref4.playlistString, playlistObject = _ref4.playlistObject, url = _ref4.url, id = _ref4.id;
  97145. this.request = null;
  97146. this.state = "HAVE_METADATA";
  97147. var playlist = playlistObject || this.parseManifest_({
  97148. url,
  97149. manifestString: playlistString
  97150. });
  97151. playlist.lastRequest = Date.now();
  97152. setupMediaPlaylist({
  97153. playlist,
  97154. uri: url,
  97155. id
  97156. });
  97157. var update = updateMaster$1(this.master, playlist);
  97158. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  97159. this.pendingMedia_ = null;
  97160. if (update) {
  97161. this.master = update;
  97162. this.media_ = this.master.playlists[id];
  97163. } else {
  97164. this.trigger("playlistunchanged");
  97165. }
  97166. this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));
  97167. this.trigger("loadedplaylist");
  97168. };
  97169. _proto.dispose = function dispose() {
  97170. this.trigger("dispose");
  97171. this.stopRequest();
  97172. window_1.clearTimeout(this.mediaUpdateTimeout);
  97173. window_1.clearTimeout(this.finalRenditionTimeout);
  97174. this.off();
  97175. };
  97176. _proto.stopRequest = function stopRequest() {
  97177. if (this.request) {
  97178. var oldRequest = this.request;
  97179. this.request = null;
  97180. oldRequest.onreadystatechange = null;
  97181. oldRequest.abort();
  97182. }
  97183. };
  97184. _proto.media = function media(playlist, shouldDelay) {
  97185. var _this4 = this;
  97186. if (!playlist) {
  97187. return this.media_;
  97188. }
  97189. if (this.state === "HAVE_NOTHING") {
  97190. throw new Error("Cannot switch media playlist from " + this.state);
  97191. }
  97192. if (typeof playlist === "string") {
  97193. if (!this.master.playlists[playlist]) {
  97194. throw new Error("Unknown playlist URI: " + playlist);
  97195. }
  97196. playlist = this.master.playlists[playlist];
  97197. }
  97198. window_1.clearTimeout(this.finalRenditionTimeout);
  97199. if (shouldDelay) {
  97200. var delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  97201. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  97202. return;
  97203. }
  97204. var startingState = this.state;
  97205. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  97206. var masterPlaylistRef = this.master.playlists[playlist.id];
  97207. if (masterPlaylistRef && masterPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  97208. if (this.request) {
  97209. this.request.onreadystatechange = null;
  97210. this.request.abort();
  97211. this.request = null;
  97212. }
  97213. this.state = "HAVE_METADATA";
  97214. this.media_ = playlist;
  97215. if (mediaChange) {
  97216. this.trigger("mediachanging");
  97217. if (startingState === "HAVE_MASTER") {
  97218. this.trigger("loadedmetadata");
  97219. } else {
  97220. this.trigger("mediachange");
  97221. }
  97222. }
  97223. return;
  97224. }
  97225. this.updateMediaUpdateTimeout_(refreshDelay(playlist, true));
  97226. if (!mediaChange) {
  97227. return;
  97228. }
  97229. this.state = "SWITCHING_MEDIA";
  97230. if (this.request) {
  97231. if (playlist.resolvedUri === this.request.url) {
  97232. return;
  97233. }
  97234. this.request.onreadystatechange = null;
  97235. this.request.abort();
  97236. this.request = null;
  97237. }
  97238. if (this.media_) {
  97239. this.trigger("mediachanging");
  97240. }
  97241. this.pendingMedia_ = playlist;
  97242. this.request = this.vhs_.xhr({
  97243. uri: playlist.resolvedUri,
  97244. withCredentials: this.withCredentials
  97245. }, function(error, req) {
  97246. if (!_this4.request) {
  97247. return;
  97248. }
  97249. playlist.lastRequest = Date.now();
  97250. playlist.resolvedUri = resolveManifestRedirect(_this4.handleManifestRedirects, playlist.resolvedUri, req);
  97251. if (error) {
  97252. return _this4.playlistRequestError(_this4.request, playlist, startingState);
  97253. }
  97254. _this4.haveMetadata({
  97255. playlistString: req.responseText,
  97256. url: playlist.uri,
  97257. id: playlist.id
  97258. });
  97259. if (startingState === "HAVE_MASTER") {
  97260. _this4.trigger("loadedmetadata");
  97261. } else {
  97262. _this4.trigger("mediachange");
  97263. }
  97264. });
  97265. };
  97266. _proto.pause = function pause() {
  97267. if (this.mediaUpdateTimeout) {
  97268. window_1.clearTimeout(this.mediaUpdateTimeout);
  97269. this.mediaUpdateTimeout = null;
  97270. }
  97271. this.stopRequest();
  97272. if (this.state === "HAVE_NOTHING") {
  97273. this.started = false;
  97274. }
  97275. if (this.state === "SWITCHING_MEDIA") {
  97276. if (this.media_) {
  97277. this.state = "HAVE_METADATA";
  97278. } else {
  97279. this.state = "HAVE_MASTER";
  97280. }
  97281. } else if (this.state === "HAVE_CURRENT_METADATA") {
  97282. this.state = "HAVE_METADATA";
  97283. }
  97284. };
  97285. _proto.load = function load(shouldDelay) {
  97286. var _this5 = this;
  97287. if (this.mediaUpdateTimeout) {
  97288. window_1.clearTimeout(this.mediaUpdateTimeout);
  97289. this.mediaUpdateTimeout = null;
  97290. }
  97291. var media = this.media();
  97292. if (shouldDelay) {
  97293. var delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  97294. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97295. _this5.mediaUpdateTimeout = null;
  97296. _this5.load();
  97297. }, delay);
  97298. return;
  97299. }
  97300. if (!this.started) {
  97301. this.start();
  97302. return;
  97303. }
  97304. if (media && !media.endList) {
  97305. this.trigger("mediaupdatetimeout");
  97306. } else {
  97307. this.trigger("loadedplaylist");
  97308. }
  97309. };
  97310. _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) {
  97311. var _this6 = this;
  97312. if (this.mediaUpdateTimeout) {
  97313. window_1.clearTimeout(this.mediaUpdateTimeout);
  97314. this.mediaUpdateTimeout = null;
  97315. }
  97316. if (!this.media() || this.media().endList) {
  97317. return;
  97318. }
  97319. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97320. _this6.mediaUpdateTimeout = null;
  97321. _this6.trigger("mediaupdatetimeout");
  97322. _this6.updateMediaUpdateTimeout_(delay);
  97323. }, delay);
  97324. };
  97325. _proto.start = function start2() {
  97326. var _this7 = this;
  97327. this.started = true;
  97328. if (typeof this.src === "object") {
  97329. if (!this.src.uri) {
  97330. this.src.uri = window_1.location.href;
  97331. }
  97332. this.src.resolvedUri = this.src.uri;
  97333. setTimeout(function() {
  97334. _this7.setupInitialPlaylist(_this7.src);
  97335. }, 0);
  97336. return;
  97337. }
  97338. this.request = this.vhs_.xhr({
  97339. uri: this.src,
  97340. withCredentials: this.withCredentials
  97341. }, function(error, req) {
  97342. if (!_this7.request) {
  97343. return;
  97344. }
  97345. _this7.request = null;
  97346. if (error) {
  97347. _this7.error = {
  97348. status: req.status,
  97349. message: "HLS playlist request error at URL: " + _this7.src + ".",
  97350. responseText: req.responseText,
  97351. code: 2
  97352. };
  97353. if (_this7.state === "HAVE_NOTHING") {
  97354. _this7.started = false;
  97355. }
  97356. return _this7.trigger("error");
  97357. }
  97358. _this7.src = resolveManifestRedirect(_this7.handleManifestRedirects, _this7.src, req);
  97359. var manifest = _this7.parseManifest_({
  97360. manifestString: req.responseText,
  97361. url: _this7.src
  97362. });
  97363. _this7.setupInitialPlaylist(manifest);
  97364. });
  97365. };
  97366. _proto.srcUri = function srcUri() {
  97367. return typeof this.src === "string" ? this.src : this.src.uri;
  97368. };
  97369. _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) {
  97370. this.state = "HAVE_MASTER";
  97371. if (manifest.playlists) {
  97372. this.master = manifest;
  97373. addPropertiesToMaster(this.master, this.srcUri());
  97374. manifest.playlists.forEach(function(playlist) {
  97375. playlist.segments = getAllSegments(playlist);
  97376. playlist.segments.forEach(function(segment) {
  97377. resolveSegmentUris(segment, playlist.resolvedUri);
  97378. });
  97379. });
  97380. this.trigger("loadedplaylist");
  97381. if (!this.request) {
  97382. this.media(this.master.playlists[0]);
  97383. }
  97384. return;
  97385. }
  97386. var uri = this.srcUri() || window_1.location.href;
  97387. this.master = masterForMedia(manifest, uri);
  97388. this.haveMetadata({
  97389. playlistObject: manifest,
  97390. url: uri,
  97391. id: this.master.playlists[0].id
  97392. });
  97393. this.trigger("loadedmetadata");
  97394. };
  97395. return PlaylistLoader2;
  97396. }(EventTarget$1);
  97397. var videojsXHR = videojs.xhr, mergeOptions$1$1 = videojs.mergeOptions;
  97398. var callbackWrapper = function callbackWrapper2(request, error, response, callback2) {
  97399. var reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  97400. if (!error && reqResponse) {
  97401. request.responseTime = Date.now();
  97402. request.roundTripTime = request.responseTime - request.requestTime;
  97403. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  97404. if (!request.bandwidth) {
  97405. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  97406. }
  97407. }
  97408. if (response.headers) {
  97409. request.responseHeaders = response.headers;
  97410. }
  97411. if (error && error.code === "ETIMEDOUT") {
  97412. request.timedout = true;
  97413. }
  97414. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  97415. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  97416. }
  97417. callback2(error, request);
  97418. };
  97419. var xhrFactory = function xhrFactory2() {
  97420. var xhr = function XhrFunction(options2, callback2) {
  97421. options2 = mergeOptions$1$1({
  97422. timeout: 45e3
  97423. }, options2);
  97424. var beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest;
  97425. if (beforeRequest && typeof beforeRequest === "function") {
  97426. var newOptions = beforeRequest(options2);
  97427. if (newOptions) {
  97428. options2 = newOptions;
  97429. }
  97430. }
  97431. var xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr;
  97432. var request = xhrMethod(options2, function(error, response) {
  97433. return callbackWrapper(request, error, response, callback2);
  97434. });
  97435. var originalAbort = request.abort;
  97436. request.abort = function() {
  97437. request.aborted = true;
  97438. return originalAbort.apply(request, arguments);
  97439. };
  97440. request.uri = options2.uri;
  97441. request.requestTime = Date.now();
  97442. return request;
  97443. };
  97444. xhr.original = true;
  97445. return xhr;
  97446. };
  97447. var byterangeStr = function byterangeStr2(byterange) {
  97448. var byterangeEnd;
  97449. var byterangeStart = byterange.offset;
  97450. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  97451. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  97452. } else {
  97453. byterangeEnd = byterange.offset + byterange.length - 1;
  97454. }
  97455. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  97456. };
  97457. var segmentXhrHeaders = function segmentXhrHeaders2(segment) {
  97458. var headers = {};
  97459. if (segment.byterange) {
  97460. headers.Range = byterangeStr(segment.byterange);
  97461. }
  97462. return headers;
  97463. };
  97464. var textRange = function textRange2(range3, i2) {
  97465. return range3.start(i2) + "-" + range3.end(i2);
  97466. };
  97467. var formatHexString = function formatHexString2(e, i2) {
  97468. var value = e.toString(16);
  97469. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  97470. };
  97471. var formatAsciiString = function formatAsciiString2(e) {
  97472. if (e >= 32 && e < 126) {
  97473. return String.fromCharCode(e);
  97474. }
  97475. return ".";
  97476. };
  97477. var createTransferableMessage = function createTransferableMessage2(message) {
  97478. var transferable = {};
  97479. Object.keys(message).forEach(function(key) {
  97480. var value = message[key];
  97481. if (isArrayBufferView2(value)) {
  97482. transferable[key] = {
  97483. bytes: value.buffer,
  97484. byteOffset: value.byteOffset,
  97485. byteLength: value.byteLength
  97486. };
  97487. } else {
  97488. transferable[key] = value;
  97489. }
  97490. });
  97491. return transferable;
  97492. };
  97493. var initSegmentId = function initSegmentId2(initSegment) {
  97494. var byterange = initSegment.byterange || {
  97495. length: Infinity,
  97496. offset: 0
  97497. };
  97498. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  97499. };
  97500. var segmentKeyId = function segmentKeyId2(key) {
  97501. return key.resolvedUri;
  97502. };
  97503. var hexDump = function hexDump2(data) {
  97504. var bytes = Array.prototype.slice.call(data);
  97505. var step = 16;
  97506. var result = "";
  97507. var hex;
  97508. var ascii;
  97509. for (var j = 0; j < bytes.length / step; j++) {
  97510. hex = bytes.slice(j * step, j * step + step).map(formatHexString).join("");
  97511. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join("");
  97512. result += hex + " " + ascii + "\n";
  97513. }
  97514. return result;
  97515. };
  97516. var tagDump = function tagDump2(_ref) {
  97517. var bytes = _ref.bytes;
  97518. return hexDump(bytes);
  97519. };
  97520. var textRanges = function textRanges2(ranges) {
  97521. var result = "";
  97522. var i2;
  97523. for (i2 = 0; i2 < ranges.length; i2++) {
  97524. result += textRange(ranges, i2) + " ";
  97525. }
  97526. return result;
  97527. };
  97528. var utils = /* @__PURE__ */ Object.freeze({
  97529. __proto__: null,
  97530. createTransferableMessage,
  97531. initSegmentId,
  97532. segmentKeyId,
  97533. hexDump,
  97534. tagDump,
  97535. textRanges
  97536. });
  97537. var SEGMENT_END_FUDGE_PERCENT = 0.25;
  97538. var playerTimeToProgramTime = function playerTimeToProgramTime2(playerTime, segment) {
  97539. if (!segment.dateTimeObject) {
  97540. return null;
  97541. }
  97542. var transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  97543. var transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  97544. var startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  97545. var offsetFromSegmentStart = playerTime - startOfSegment;
  97546. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  97547. };
  97548. var originalSegmentVideoDuration = function originalSegmentVideoDuration2(videoTimingInfo) {
  97549. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  97550. };
  97551. var findSegmentForProgramTime = function findSegmentForProgramTime2(programTime, playlist) {
  97552. var dateTimeObject;
  97553. try {
  97554. dateTimeObject = new Date(programTime);
  97555. } catch (e) {
  97556. return null;
  97557. }
  97558. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97559. return null;
  97560. }
  97561. var segment = playlist.segments[0];
  97562. if (dateTimeObject < segment.dateTimeObject) {
  97563. return null;
  97564. }
  97565. for (var i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  97566. segment = playlist.segments[i2];
  97567. var nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  97568. if (dateTimeObject < nextSegmentStart) {
  97569. break;
  97570. }
  97571. }
  97572. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97573. var lastSegmentStart = lastSegment.dateTimeObject;
  97574. var lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;
  97575. var lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  97576. if (dateTimeObject > lastSegmentEnd) {
  97577. return null;
  97578. }
  97579. if (dateTimeObject > lastSegmentStart) {
  97580. segment = lastSegment;
  97581. }
  97582. return {
  97583. segment,
  97584. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  97585. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97586. };
  97587. };
  97588. var findSegmentForPlayerTime = function findSegmentForPlayerTime2(time, playlist) {
  97589. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97590. return null;
  97591. }
  97592. var segmentEnd = 0;
  97593. var segment;
  97594. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97595. segment = playlist.segments[i2];
  97596. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  97597. if (time <= segmentEnd) {
  97598. break;
  97599. }
  97600. }
  97601. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97602. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  97603. return null;
  97604. }
  97605. if (time > segmentEnd) {
  97606. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {
  97607. return null;
  97608. }
  97609. segment = lastSegment;
  97610. }
  97611. return {
  97612. segment,
  97613. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  97614. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97615. };
  97616. };
  97617. var getOffsetFromTimestamp = function getOffsetFromTimestamp2(comparisonTimeStamp, programTime) {
  97618. var segmentDateTime;
  97619. var programDateTime;
  97620. try {
  97621. segmentDateTime = new Date(comparisonTimeStamp);
  97622. programDateTime = new Date(programTime);
  97623. } catch (e) {
  97624. }
  97625. var segmentTimeEpoch = segmentDateTime.getTime();
  97626. var programTimeEpoch = programDateTime.getTime();
  97627. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  97628. };
  97629. var verifyProgramDateTimeTags = function verifyProgramDateTimeTags2(playlist) {
  97630. if (!playlist.segments || playlist.segments.length === 0) {
  97631. return false;
  97632. }
  97633. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97634. var segment = playlist.segments[i2];
  97635. if (!segment.dateTimeObject) {
  97636. return false;
  97637. }
  97638. }
  97639. return true;
  97640. };
  97641. var getProgramTime = function getProgramTime2(_ref) {
  97642. var playlist = _ref.playlist, _ref$time = _ref.time, time = _ref$time === void 0 ? void 0 : _ref$time, callback2 = _ref.callback;
  97643. if (!callback2) {
  97644. throw new Error("getProgramTime: callback must be provided");
  97645. }
  97646. if (!playlist || time === void 0) {
  97647. return callback2({
  97648. message: "getProgramTime: playlist and time must be provided"
  97649. });
  97650. }
  97651. var matchedSegment = findSegmentForPlayerTime(time, playlist);
  97652. if (!matchedSegment) {
  97653. return callback2({
  97654. message: "valid programTime was not found"
  97655. });
  97656. }
  97657. if (matchedSegment.type === "estimate") {
  97658. return callback2({
  97659. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  97660. seekTime: matchedSegment.estimatedStart
  97661. });
  97662. }
  97663. var programTimeObject = {
  97664. mediaSeconds: time
  97665. };
  97666. var programTime = playerTimeToProgramTime(time, matchedSegment.segment);
  97667. if (programTime) {
  97668. programTimeObject.programDateTime = programTime.toISOString();
  97669. }
  97670. return callback2(null, programTimeObject);
  97671. };
  97672. var seekToProgramTime = function seekToProgramTime2(_ref2) {
  97673. var programTime = _ref2.programTime, playlist = _ref2.playlist, _ref2$retryCount = _ref2.retryCount, retryCount = _ref2$retryCount === void 0 ? 2 : _ref2$retryCount, seekTo = _ref2.seekTo, _ref2$pauseAfterSeek = _ref2.pauseAfterSeek, pauseAfterSeek = _ref2$pauseAfterSeek === void 0 ? true : _ref2$pauseAfterSeek, tech = _ref2.tech, callback2 = _ref2.callback;
  97674. if (!callback2) {
  97675. throw new Error("seekToProgramTime: callback must be provided");
  97676. }
  97677. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  97678. return callback2({
  97679. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  97680. });
  97681. }
  97682. if (!playlist.endList && !tech.hasStarted_) {
  97683. return callback2({
  97684. message: "player must be playing a live stream to start buffering"
  97685. });
  97686. }
  97687. if (!verifyProgramDateTimeTags(playlist)) {
  97688. return callback2({
  97689. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  97690. });
  97691. }
  97692. var matchedSegment = findSegmentForProgramTime(programTime, playlist);
  97693. if (!matchedSegment) {
  97694. return callback2({
  97695. message: programTime + " was not found in the stream"
  97696. });
  97697. }
  97698. var segment = matchedSegment.segment;
  97699. var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);
  97700. if (matchedSegment.type === "estimate") {
  97701. if (retryCount === 0) {
  97702. return callback2({
  97703. message: programTime + " is not buffered yet. Try again"
  97704. });
  97705. }
  97706. seekTo(matchedSegment.estimatedStart + mediaOffset);
  97707. tech.one("seeked", function() {
  97708. seekToProgramTime2({
  97709. programTime,
  97710. playlist,
  97711. retryCount: retryCount - 1,
  97712. seekTo,
  97713. pauseAfterSeek,
  97714. tech,
  97715. callback: callback2
  97716. });
  97717. });
  97718. return;
  97719. }
  97720. var seekToTime = segment.start + mediaOffset;
  97721. var seekedCallback = function seekedCallback2() {
  97722. return callback2(null, tech.currentTime());
  97723. };
  97724. tech.one("seeked", seekedCallback);
  97725. if (pauseAfterSeek) {
  97726. tech.pause();
  97727. }
  97728. seekTo(seekToTime);
  97729. };
  97730. var callbackOnCompleted = function callbackOnCompleted2(request, cb) {
  97731. if (request.readyState === 4) {
  97732. return cb();
  97733. }
  97734. return;
  97735. };
  97736. var containerRequest = function containerRequest2(uri, xhr, cb) {
  97737. var bytes = [];
  97738. var id3Offset;
  97739. var finished = false;
  97740. var endRequestAndCallback = function endRequestAndCallback2(err, req, type2, _bytes) {
  97741. req.abort();
  97742. finished = true;
  97743. return cb(err, req, type2, _bytes);
  97744. };
  97745. var progressListener = function progressListener2(error, request2) {
  97746. if (finished) {
  97747. return;
  97748. }
  97749. if (error) {
  97750. return endRequestAndCallback(error, request2, "", bytes);
  97751. }
  97752. var newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  97753. bytes = concatTypedArrays2(bytes, stringToBytes2(newPart, true));
  97754. id3Offset = id3Offset || getId3Offset2(bytes);
  97755. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  97756. return callbackOnCompleted(request2, function() {
  97757. return endRequestAndCallback(error, request2, "", bytes);
  97758. });
  97759. }
  97760. var type2 = detectContainerForBytes2(bytes);
  97761. if (type2 === "ts" && bytes.length < 188) {
  97762. return callbackOnCompleted(request2, function() {
  97763. return endRequestAndCallback(error, request2, "", bytes);
  97764. });
  97765. }
  97766. if (!type2 && bytes.length < 376) {
  97767. return callbackOnCompleted(request2, function() {
  97768. return endRequestAndCallback(error, request2, "", bytes);
  97769. });
  97770. }
  97771. return endRequestAndCallback(null, request2, type2, bytes);
  97772. };
  97773. var options2 = {
  97774. uri,
  97775. beforeSend: function beforeSend(request2) {
  97776. request2.overrideMimeType("text/plain; charset=x-user-defined");
  97777. request2.addEventListener("progress", function(_ref) {
  97778. _ref.total;
  97779. _ref.loaded;
  97780. return callbackWrapper(request2, null, {
  97781. statusCode: request2.status
  97782. }, progressListener);
  97783. });
  97784. }
  97785. };
  97786. var request = xhr(options2, function(error, response) {
  97787. return callbackWrapper(request, error, response, progressListener);
  97788. });
  97789. return request;
  97790. };
  97791. var EventTarget2 = videojs.EventTarget, mergeOptions$4 = videojs.mergeOptions;
  97792. var dashPlaylistUnchanged = function dashPlaylistUnchanged2(a, b) {
  97793. if (!isPlaylistUnchanged(a, b)) {
  97794. return false;
  97795. }
  97796. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  97797. return false;
  97798. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  97799. return false;
  97800. }
  97801. if (a.segments && !b.segments || !a.segments && b.segments) {
  97802. return false;
  97803. }
  97804. if (!a.segments && !b.segments) {
  97805. return true;
  97806. }
  97807. for (var i2 = 0; i2 < a.segments.length; i2++) {
  97808. var aSegment = a.segments[i2];
  97809. var bSegment = b.segments[i2];
  97810. if (aSegment.uri !== bSegment.uri) {
  97811. return false;
  97812. }
  97813. if (!aSegment.byterange && !bSegment.byterange) {
  97814. continue;
  97815. }
  97816. var aByterange = aSegment.byterange;
  97817. var bByterange = bSegment.byterange;
  97818. if (aByterange && !bByterange || !aByterange && bByterange) {
  97819. return false;
  97820. }
  97821. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  97822. return false;
  97823. }
  97824. }
  97825. return true;
  97826. };
  97827. var dashGroupId = function dashGroupId2(type2, group, label, playlist) {
  97828. var playlistId = playlist.attributes.NAME || label;
  97829. return "placeholder-uri-" + type2 + "-" + group + "-" + playlistId;
  97830. };
  97831. var parseMasterXml = function parseMasterXml2(_ref) {
  97832. var masterXml = _ref.masterXml, srcUrl = _ref.srcUrl, clientOffset = _ref.clientOffset, sidxMapping = _ref.sidxMapping, previousManifest = _ref.previousManifest;
  97833. var manifest = parse(masterXml, {
  97834. manifestUri: srcUrl,
  97835. clientOffset,
  97836. sidxMapping,
  97837. previousManifest
  97838. });
  97839. addPropertiesToMaster(manifest, srcUrl, dashGroupId);
  97840. return manifest;
  97841. };
  97842. var removeOldMediaGroupLabels = function removeOldMediaGroupLabels2(update, newMaster) {
  97843. forEachMediaGroup3(update, function(properties, type2, group, label) {
  97844. if (!(label in newMaster.mediaGroups[type2][group])) {
  97845. delete update.mediaGroups[type2][group][label];
  97846. }
  97847. });
  97848. };
  97849. var updateMaster2 = function updateMaster3(oldMaster, newMaster, sidxMapping) {
  97850. var noChanges = true;
  97851. var update = mergeOptions$4(oldMaster, {
  97852. duration: newMaster.duration,
  97853. minimumUpdatePeriod: newMaster.minimumUpdatePeriod,
  97854. timelineStarts: newMaster.timelineStarts
  97855. });
  97856. for (var i2 = 0; i2 < newMaster.playlists.length; i2++) {
  97857. var playlist = newMaster.playlists[i2];
  97858. if (playlist.sidx) {
  97859. var sidxKey = generateSidxKey(playlist.sidx);
  97860. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  97861. addSidxSegmentsToPlaylist$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  97862. }
  97863. }
  97864. var playlistUpdate = updateMaster$1(update, playlist, dashPlaylistUnchanged);
  97865. if (playlistUpdate) {
  97866. update = playlistUpdate;
  97867. noChanges = false;
  97868. }
  97869. }
  97870. forEachMediaGroup3(newMaster, function(properties, type2, group, label) {
  97871. if (properties.playlists && properties.playlists.length) {
  97872. var id = properties.playlists[0].id;
  97873. var _playlistUpdate = updateMaster$1(update, properties.playlists[0], dashPlaylistUnchanged);
  97874. if (_playlistUpdate) {
  97875. update = _playlistUpdate;
  97876. if (!(label in update.mediaGroups[type2][group])) {
  97877. update.mediaGroups[type2][group][label] = properties;
  97878. }
  97879. update.mediaGroups[type2][group][label].playlists[0] = update.playlists[id];
  97880. noChanges = false;
  97881. }
  97882. }
  97883. });
  97884. removeOldMediaGroupLabels(update, newMaster);
  97885. if (newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  97886. noChanges = false;
  97887. }
  97888. if (noChanges) {
  97889. return null;
  97890. }
  97891. return update;
  97892. };
  97893. var equivalentSidx = function equivalentSidx2(a, b) {
  97894. var neitherMap = Boolean(!a.map && !b.map);
  97895. var equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  97896. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  97897. };
  97898. var compareSidxEntry = function compareSidxEntry2(playlists, oldSidxMapping) {
  97899. var newSidxMapping = {};
  97900. for (var id in playlists) {
  97901. var playlist = playlists[id];
  97902. var currentSidxInfo = playlist.sidx;
  97903. if (currentSidxInfo) {
  97904. var key = generateSidxKey(currentSidxInfo);
  97905. if (!oldSidxMapping[key]) {
  97906. break;
  97907. }
  97908. var savedSidxInfo = oldSidxMapping[key].sidxInfo;
  97909. if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {
  97910. newSidxMapping[key] = oldSidxMapping[key];
  97911. }
  97912. }
  97913. }
  97914. return newSidxMapping;
  97915. };
  97916. var filterChangedSidxMappings = function filterChangedSidxMappings2(master, oldSidxMapping) {
  97917. var videoSidx = compareSidxEntry(master.playlists, oldSidxMapping);
  97918. var mediaGroupSidx = videoSidx;
  97919. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97920. if (properties.playlists && properties.playlists.length) {
  97921. var playlists = properties.playlists;
  97922. mediaGroupSidx = mergeOptions$4(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));
  97923. }
  97924. });
  97925. return mediaGroupSidx;
  97926. };
  97927. var DashPlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97928. _inheritsLoose(DashPlaylistLoader2, _EventTarget);
  97929. function DashPlaylistLoader2(srcUrlOrPlaylist, vhs, options2, masterPlaylistLoader) {
  97930. var _this;
  97931. if (options2 === void 0) {
  97932. options2 = {};
  97933. }
  97934. _this = _EventTarget.call(this) || this;
  97935. _this.masterPlaylistLoader_ = masterPlaylistLoader || _assertThisInitialized(_this);
  97936. if (!masterPlaylistLoader) {
  97937. _this.isMaster_ = true;
  97938. }
  97939. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97940. _this.vhs_ = vhs;
  97941. _this.withCredentials = withCredentials;
  97942. _this.handleManifestRedirects = handleManifestRedirects;
  97943. if (!srcUrlOrPlaylist) {
  97944. throw new Error("A non-empty playlist URL or object is required");
  97945. }
  97946. _this.on("minimumUpdatePeriod", function() {
  97947. _this.refreshXml_();
  97948. });
  97949. _this.on("mediaupdatetimeout", function() {
  97950. _this.refreshMedia_(_this.media().id);
  97951. });
  97952. _this.state = "HAVE_NOTHING";
  97953. _this.loadedPlaylists_ = {};
  97954. _this.logger_ = logger("DashPlaylistLoader");
  97955. if (_this.isMaster_) {
  97956. _this.masterPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  97957. _this.masterPlaylistLoader_.sidxMapping_ = {};
  97958. } else {
  97959. _this.childPlaylist_ = srcUrlOrPlaylist;
  97960. }
  97961. return _this;
  97962. }
  97963. var _proto = DashPlaylistLoader2.prototype;
  97964. _proto.requestErrored_ = function requestErrored_(err, request, startingState) {
  97965. if (!this.request) {
  97966. return true;
  97967. }
  97968. this.request = null;
  97969. if (err) {
  97970. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  97971. status: request.status,
  97972. message: "DASH request error at URL: " + request.uri,
  97973. response: request.response,
  97974. code: 2
  97975. };
  97976. if (startingState) {
  97977. this.state = startingState;
  97978. }
  97979. this.trigger("error");
  97980. return true;
  97981. }
  97982. };
  97983. _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) {
  97984. var _this2 = this;
  97985. var sidxKey = playlist.sidx && generateSidxKey(playlist.sidx);
  97986. if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) {
  97987. this.mediaRequest_ = window_1.setTimeout(function() {
  97988. return cb(false);
  97989. }, 0);
  97990. return;
  97991. }
  97992. var uri = resolveManifestRedirect(this.handleManifestRedirects, playlist.sidx.resolvedUri);
  97993. var fin = function fin2(err, request) {
  97994. if (_this2.requestErrored_(err, request, startingState)) {
  97995. return;
  97996. }
  97997. var sidxMapping = _this2.masterPlaylistLoader_.sidxMapping_;
  97998. var sidx;
  97999. try {
  98000. sidx = parseSidx_1(toUint82(request.response).subarray(8));
  98001. } catch (e) {
  98002. _this2.requestErrored_(e, request, startingState);
  98003. return;
  98004. }
  98005. sidxMapping[sidxKey] = {
  98006. sidxInfo: playlist.sidx,
  98007. sidx
  98008. };
  98009. addSidxSegmentsToPlaylist$1(playlist, sidx, playlist.sidx.resolvedUri);
  98010. return cb(true);
  98011. };
  98012. this.request = containerRequest(uri, this.vhs_.xhr, function(err, request, container, bytes) {
  98013. if (err) {
  98014. return fin(err, request);
  98015. }
  98016. if (!container || container !== "mp4") {
  98017. return fin({
  98018. status: request.status,
  98019. message: "Unsupported " + (container || "unknown") + " container type for sidx segment at URL: " + uri,
  98020. response: "",
  98021. playlist,
  98022. internal: true,
  98023. blacklistDuration: Infinity,
  98024. code: 2
  98025. }, request);
  98026. }
  98027. var _playlist$sidx$bytera = playlist.sidx.byterange, offset = _playlist$sidx$bytera.offset, length = _playlist$sidx$bytera.length;
  98028. if (bytes.length >= length + offset) {
  98029. return fin(err, {
  98030. response: bytes.subarray(offset, offset + length),
  98031. status: request.status,
  98032. uri: request.uri
  98033. });
  98034. }
  98035. _this2.request = _this2.vhs_.xhr({
  98036. uri,
  98037. responseType: "arraybuffer",
  98038. headers: segmentXhrHeaders({
  98039. byterange: playlist.sidx.byterange
  98040. })
  98041. }, fin);
  98042. });
  98043. };
  98044. _proto.dispose = function dispose() {
  98045. this.trigger("dispose");
  98046. this.stopRequest();
  98047. this.loadedPlaylists_ = {};
  98048. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  98049. window_1.clearTimeout(this.mediaRequest_);
  98050. window_1.clearTimeout(this.mediaUpdateTimeout);
  98051. this.mediaUpdateTimeout = null;
  98052. this.mediaRequest_ = null;
  98053. this.minimumUpdatePeriodTimeout_ = null;
  98054. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98055. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98056. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98057. }
  98058. this.off();
  98059. };
  98060. _proto.hasPendingRequest = function hasPendingRequest() {
  98061. return this.request || this.mediaRequest_;
  98062. };
  98063. _proto.stopRequest = function stopRequest() {
  98064. if (this.request) {
  98065. var oldRequest = this.request;
  98066. this.request = null;
  98067. oldRequest.onreadystatechange = null;
  98068. oldRequest.abort();
  98069. }
  98070. };
  98071. _proto.media = function media(playlist) {
  98072. var _this3 = this;
  98073. if (!playlist) {
  98074. return this.media_;
  98075. }
  98076. if (this.state === "HAVE_NOTHING") {
  98077. throw new Error("Cannot switch media playlist from " + this.state);
  98078. }
  98079. var startingState = this.state;
  98080. if (typeof playlist === "string") {
  98081. if (!this.masterPlaylistLoader_.master.playlists[playlist]) {
  98082. throw new Error("Unknown playlist URI: " + playlist);
  98083. }
  98084. playlist = this.masterPlaylistLoader_.master.playlists[playlist];
  98085. }
  98086. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  98087. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  98088. this.state = "HAVE_METADATA";
  98089. this.media_ = playlist;
  98090. if (mediaChange) {
  98091. this.trigger("mediachanging");
  98092. this.trigger("mediachange");
  98093. }
  98094. return;
  98095. }
  98096. if (!mediaChange) {
  98097. return;
  98098. }
  98099. if (this.media_) {
  98100. this.trigger("mediachanging");
  98101. }
  98102. this.addSidxSegments_(playlist, startingState, function(sidxChanged) {
  98103. _this3.haveMetadata({
  98104. startingState,
  98105. playlist
  98106. });
  98107. });
  98108. };
  98109. _proto.haveMetadata = function haveMetadata(_ref2) {
  98110. var startingState = _ref2.startingState, playlist = _ref2.playlist;
  98111. this.state = "HAVE_METADATA";
  98112. this.loadedPlaylists_[playlist.id] = playlist;
  98113. this.mediaRequest_ = null;
  98114. this.refreshMedia_(playlist.id);
  98115. if (startingState === "HAVE_MASTER") {
  98116. this.trigger("loadedmetadata");
  98117. } else {
  98118. this.trigger("mediachange");
  98119. }
  98120. };
  98121. _proto.pause = function pause() {
  98122. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98123. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98124. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98125. }
  98126. this.stopRequest();
  98127. window_1.clearTimeout(this.mediaUpdateTimeout);
  98128. this.mediaUpdateTimeout = null;
  98129. if (this.isMaster_) {
  98130. window_1.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_);
  98131. this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  98132. }
  98133. if (this.state === "HAVE_NOTHING") {
  98134. this.started = false;
  98135. }
  98136. };
  98137. _proto.load = function load(isFinalRendition) {
  98138. var _this4 = this;
  98139. window_1.clearTimeout(this.mediaUpdateTimeout);
  98140. this.mediaUpdateTimeout = null;
  98141. var media = this.media();
  98142. if (isFinalRendition) {
  98143. var delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  98144. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  98145. return _this4.load();
  98146. }, delay);
  98147. return;
  98148. }
  98149. if (!this.started) {
  98150. this.start();
  98151. return;
  98152. }
  98153. if (media && !media.endList) {
  98154. if (this.isMaster_ && !this.minimumUpdatePeriodTimeout_) {
  98155. this.trigger("minimumUpdatePeriod");
  98156. this.updateMinimumUpdatePeriodTimeout_();
  98157. }
  98158. this.trigger("mediaupdatetimeout");
  98159. } else {
  98160. this.trigger("loadedplaylist");
  98161. }
  98162. };
  98163. _proto.start = function start2() {
  98164. var _this5 = this;
  98165. this.started = true;
  98166. if (!this.isMaster_) {
  98167. this.mediaRequest_ = window_1.setTimeout(function() {
  98168. return _this5.haveMaster_();
  98169. }, 0);
  98170. return;
  98171. }
  98172. this.requestMaster_(function(req, masterChanged) {
  98173. _this5.haveMaster_();
  98174. if (!_this5.hasPendingRequest() && !_this5.media_) {
  98175. _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]);
  98176. }
  98177. });
  98178. };
  98179. _proto.requestMaster_ = function requestMaster_(cb) {
  98180. var _this6 = this;
  98181. this.request = this.vhs_.xhr({
  98182. uri: this.masterPlaylistLoader_.srcUrl,
  98183. withCredentials: this.withCredentials
  98184. }, function(error, req) {
  98185. if (_this6.requestErrored_(error, req)) {
  98186. if (_this6.state === "HAVE_NOTHING") {
  98187. _this6.started = false;
  98188. }
  98189. return;
  98190. }
  98191. var masterChanged = req.responseText !== _this6.masterPlaylistLoader_.masterXml_;
  98192. _this6.masterPlaylistLoader_.masterXml_ = req.responseText;
  98193. if (req.responseHeaders && req.responseHeaders.date) {
  98194. _this6.masterLoaded_ = Date.parse(req.responseHeaders.date);
  98195. } else {
  98196. _this6.masterLoaded_ = Date.now();
  98197. }
  98198. _this6.masterPlaylistLoader_.srcUrl = resolveManifestRedirect(_this6.handleManifestRedirects, _this6.masterPlaylistLoader_.srcUrl, req);
  98199. if (masterChanged) {
  98200. _this6.handleMaster_();
  98201. _this6.syncClientServerClock_(function() {
  98202. return cb(req, masterChanged);
  98203. });
  98204. return;
  98205. }
  98206. return cb(req, masterChanged);
  98207. });
  98208. };
  98209. _proto.syncClientServerClock_ = function syncClientServerClock_(done) {
  98210. var _this7 = this;
  98211. var utcTiming = parseUTCTiming(this.masterPlaylistLoader_.masterXml_);
  98212. if (utcTiming === null) {
  98213. this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now();
  98214. return done();
  98215. }
  98216. if (utcTiming.method === "DIRECT") {
  98217. this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  98218. return done();
  98219. }
  98220. this.request = this.vhs_.xhr({
  98221. uri: resolveUrl4(this.masterPlaylistLoader_.srcUrl, utcTiming.value),
  98222. method: utcTiming.method,
  98223. withCredentials: this.withCredentials
  98224. }, function(error, req) {
  98225. if (!_this7.request) {
  98226. return;
  98227. }
  98228. if (error) {
  98229. _this7.masterPlaylistLoader_.clientOffset_ = _this7.masterLoaded_ - Date.now();
  98230. return done();
  98231. }
  98232. var serverTime;
  98233. if (utcTiming.method === "HEAD") {
  98234. if (!req.responseHeaders || !req.responseHeaders.date) {
  98235. serverTime = _this7.masterLoaded_;
  98236. } else {
  98237. serverTime = Date.parse(req.responseHeaders.date);
  98238. }
  98239. } else {
  98240. serverTime = Date.parse(req.responseText);
  98241. }
  98242. _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  98243. done();
  98244. });
  98245. };
  98246. _proto.haveMaster_ = function haveMaster_() {
  98247. this.state = "HAVE_MASTER";
  98248. if (this.isMaster_) {
  98249. this.trigger("loadedplaylist");
  98250. } else if (!this.media_) {
  98251. this.media(this.childPlaylist_);
  98252. }
  98253. };
  98254. _proto.handleMaster_ = function handleMaster_() {
  98255. this.mediaRequest_ = null;
  98256. var oldMaster = this.masterPlaylistLoader_.master;
  98257. var newMaster = parseMasterXml({
  98258. masterXml: this.masterPlaylistLoader_.masterXml_,
  98259. srcUrl: this.masterPlaylistLoader_.srcUrl,
  98260. clientOffset: this.masterPlaylistLoader_.clientOffset_,
  98261. sidxMapping: this.masterPlaylistLoader_.sidxMapping_,
  98262. previousManifest: oldMaster
  98263. });
  98264. if (oldMaster) {
  98265. newMaster = updateMaster2(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_);
  98266. }
  98267. this.masterPlaylistLoader_.master = newMaster ? newMaster : oldMaster;
  98268. var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0];
  98269. if (location && location !== this.masterPlaylistLoader_.srcUrl) {
  98270. this.masterPlaylistLoader_.srcUrl = location;
  98271. }
  98272. if (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  98273. this.updateMinimumUpdatePeriodTimeout_();
  98274. }
  98275. return Boolean(newMaster);
  98276. };
  98277. _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() {
  98278. var mpl = this.masterPlaylistLoader_;
  98279. if (mpl.createMupOnMedia_) {
  98280. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  98281. mpl.createMupOnMedia_ = null;
  98282. }
  98283. if (mpl.minimumUpdatePeriodTimeout_) {
  98284. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  98285. mpl.minimumUpdatePeriodTimeout_ = null;
  98286. }
  98287. var mup = mpl.master && mpl.master.minimumUpdatePeriod;
  98288. if (mup === 0) {
  98289. if (mpl.media()) {
  98290. mup = mpl.media().targetDuration * 1e3;
  98291. } else {
  98292. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  98293. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  98294. }
  98295. }
  98296. if (typeof mup !== "number" || mup <= 0) {
  98297. if (mup < 0) {
  98298. this.logger_("found invalid minimumUpdatePeriod of " + mup + ", not setting a timeout");
  98299. }
  98300. return;
  98301. }
  98302. this.createMUPTimeout_(mup);
  98303. };
  98304. _proto.createMUPTimeout_ = function createMUPTimeout_(mup) {
  98305. var mpl = this.masterPlaylistLoader_;
  98306. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(function() {
  98307. mpl.minimumUpdatePeriodTimeout_ = null;
  98308. mpl.trigger("minimumUpdatePeriod");
  98309. mpl.createMUPTimeout_(mup);
  98310. }, mup);
  98311. };
  98312. _proto.refreshXml_ = function refreshXml_() {
  98313. var _this8 = this;
  98314. this.requestMaster_(function(req, masterChanged) {
  98315. if (!masterChanged) {
  98316. return;
  98317. }
  98318. if (_this8.media_) {
  98319. _this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id];
  98320. }
  98321. _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_);
  98322. _this8.addSidxSegments_(_this8.media(), _this8.state, function(sidxChanged) {
  98323. _this8.refreshMedia_(_this8.media().id);
  98324. });
  98325. });
  98326. };
  98327. _proto.refreshMedia_ = function refreshMedia_(mediaID) {
  98328. var _this9 = this;
  98329. if (!mediaID) {
  98330. throw new Error("refreshMedia_ must take a media id");
  98331. }
  98332. if (this.media_ && this.isMaster_) {
  98333. this.handleMaster_();
  98334. }
  98335. var playlists = this.masterPlaylistLoader_.master.playlists;
  98336. var mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  98337. if (mediaChanged) {
  98338. this.media_ = playlists[mediaID];
  98339. } else {
  98340. this.trigger("playlistunchanged");
  98341. }
  98342. if (!this.mediaUpdateTimeout) {
  98343. var createMediaUpdateTimeout = function createMediaUpdateTimeout2() {
  98344. if (_this9.media().endList) {
  98345. return;
  98346. }
  98347. _this9.mediaUpdateTimeout = window_1.setTimeout(function() {
  98348. _this9.trigger("mediaupdatetimeout");
  98349. createMediaUpdateTimeout2();
  98350. }, refreshDelay(_this9.media(), Boolean(mediaChanged)));
  98351. };
  98352. createMediaUpdateTimeout();
  98353. }
  98354. this.trigger("loadedplaylist");
  98355. };
  98356. return DashPlaylistLoader2;
  98357. }(EventTarget2);
  98358. var Config = {
  98359. GOAL_BUFFER_LENGTH: 30,
  98360. MAX_GOAL_BUFFER_LENGTH: 60,
  98361. BACK_BUFFER_LENGTH: 30,
  98362. GOAL_BUFFER_LENGTH_RATE: 1,
  98363. INITIAL_BANDWIDTH: 4194304,
  98364. BANDWIDTH_VARIANCE: 1.2,
  98365. BUFFER_LOW_WATER_LINE: 0,
  98366. MAX_BUFFER_LOW_WATER_LINE: 30,
  98367. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  98368. BUFFER_LOW_WATER_LINE_RATE: 1,
  98369. BUFFER_HIGH_WATER_LINE: 30
  98370. };
  98371. var stringToArrayBuffer = function stringToArrayBuffer2(string) {
  98372. var view = new Uint8Array(new ArrayBuffer(string.length));
  98373. for (var i2 = 0; i2 < string.length; i2++) {
  98374. view[i2] = string.charCodeAt(i2);
  98375. }
  98376. return view.buffer;
  98377. };
  98378. var browserWorkerPolyFill = function browserWorkerPolyFill2(workerObj) {
  98379. workerObj.on = workerObj.addEventListener;
  98380. workerObj.off = workerObj.removeEventListener;
  98381. return workerObj;
  98382. };
  98383. var createObjectURL = function createObjectURL2(str) {
  98384. try {
  98385. return URL.createObjectURL(new Blob([str], {
  98386. type: "application/javascript"
  98387. }));
  98388. } catch (e) {
  98389. var blob = new BlobBuilder();
  98390. blob.append(str);
  98391. return URL.createObjectURL(blob.getBlob());
  98392. }
  98393. };
  98394. var factory = function factory2(code) {
  98395. return function() {
  98396. var objectUrl = createObjectURL(code);
  98397. var worker = browserWorkerPolyFill(new Worker(objectUrl));
  98398. worker.objURL = objectUrl;
  98399. var terminate = worker.terminate;
  98400. worker.on = worker.addEventListener;
  98401. worker.off = worker.removeEventListener;
  98402. worker.terminate = function() {
  98403. URL.revokeObjectURL(objectUrl);
  98404. return terminate.call(this);
  98405. };
  98406. return worker;
  98407. };
  98408. };
  98409. var transform = function transform2(code) {
  98410. return "var browserWorkerPolyFill = " + browserWorkerPolyFill.toString() + ";\nbrowserWorkerPolyFill(self);\n" + code;
  98411. };
  98412. var getWorkerString = function getWorkerString2(fn2) {
  98413. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  98414. };
  98415. var workerCode$1 = transform(getWorkerString(function() {
  98416. var Stream2 = function Stream3() {
  98417. this.init = function() {
  98418. var listeners = {};
  98419. this.on = function(type3, listener) {
  98420. if (!listeners[type3]) {
  98421. listeners[type3] = [];
  98422. }
  98423. listeners[type3] = listeners[type3].concat(listener);
  98424. };
  98425. this.off = function(type3, listener) {
  98426. var index2;
  98427. if (!listeners[type3]) {
  98428. return false;
  98429. }
  98430. index2 = listeners[type3].indexOf(listener);
  98431. listeners[type3] = listeners[type3].slice();
  98432. listeners[type3].splice(index2, 1);
  98433. return index2 > -1;
  98434. };
  98435. this.trigger = function(type3) {
  98436. var callbacks, i2, length, args;
  98437. callbacks = listeners[type3];
  98438. if (!callbacks) {
  98439. return;
  98440. }
  98441. if (arguments.length === 2) {
  98442. length = callbacks.length;
  98443. for (i2 = 0; i2 < length; ++i2) {
  98444. callbacks[i2].call(this, arguments[1]);
  98445. }
  98446. } else {
  98447. args = [];
  98448. i2 = arguments.length;
  98449. for (i2 = 1; i2 < arguments.length; ++i2) {
  98450. args.push(arguments[i2]);
  98451. }
  98452. length = callbacks.length;
  98453. for (i2 = 0; i2 < length; ++i2) {
  98454. callbacks[i2].apply(this, args);
  98455. }
  98456. }
  98457. };
  98458. this.dispose = function() {
  98459. listeners = {};
  98460. };
  98461. };
  98462. };
  98463. Stream2.prototype.pipe = function(destination2) {
  98464. this.on("data", function(data) {
  98465. destination2.push(data);
  98466. });
  98467. this.on("done", function(flushSource) {
  98468. destination2.flush(flushSource);
  98469. });
  98470. this.on("partialdone", function(flushSource) {
  98471. destination2.partialFlush(flushSource);
  98472. });
  98473. this.on("endedtimeline", function(flushSource) {
  98474. destination2.endTimeline(flushSource);
  98475. });
  98476. this.on("reset", function(flushSource) {
  98477. destination2.reset(flushSource);
  98478. });
  98479. return destination2;
  98480. };
  98481. Stream2.prototype.push = function(data) {
  98482. this.trigger("data", data);
  98483. };
  98484. Stream2.prototype.flush = function(flushSource) {
  98485. this.trigger("done", flushSource);
  98486. };
  98487. Stream2.prototype.partialFlush = function(flushSource) {
  98488. this.trigger("partialdone", flushSource);
  98489. };
  98490. Stream2.prototype.endTimeline = function(flushSource) {
  98491. this.trigger("endedtimeline", flushSource);
  98492. };
  98493. Stream2.prototype.reset = function(flushSource) {
  98494. this.trigger("reset", flushSource);
  98495. };
  98496. var stream = Stream2;
  98497. var MAX_UINT32$12 = Math.pow(2, 32);
  98498. var getUint64$22 = function getUint643(uint8) {
  98499. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  98500. var value;
  98501. if (dv.getBigUint64) {
  98502. value = dv.getBigUint64(0);
  98503. if (value < Number.MAX_SAFE_INTEGER) {
  98504. return Number(value);
  98505. }
  98506. return value;
  98507. }
  98508. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  98509. };
  98510. var numbers2 = {
  98511. getUint64: getUint64$22,
  98512. MAX_UINT32: MAX_UINT32$12
  98513. };
  98514. var MAX_UINT322 = numbers2.MAX_UINT32;
  98515. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  98516. (function() {
  98517. var i2;
  98518. types = {
  98519. avc1: [],
  98520. avcC: [],
  98521. btrt: [],
  98522. dinf: [],
  98523. dref: [],
  98524. esds: [],
  98525. ftyp: [],
  98526. hdlr: [],
  98527. mdat: [],
  98528. mdhd: [],
  98529. mdia: [],
  98530. mfhd: [],
  98531. minf: [],
  98532. moof: [],
  98533. moov: [],
  98534. mp4a: [],
  98535. mvex: [],
  98536. mvhd: [],
  98537. pasp: [],
  98538. sdtp: [],
  98539. smhd: [],
  98540. stbl: [],
  98541. stco: [],
  98542. stsc: [],
  98543. stsd: [],
  98544. stsz: [],
  98545. stts: [],
  98546. styp: [],
  98547. tfdt: [],
  98548. tfhd: [],
  98549. traf: [],
  98550. trak: [],
  98551. trun: [],
  98552. trex: [],
  98553. tkhd: [],
  98554. vmhd: []
  98555. };
  98556. if (typeof Uint8Array === "undefined") {
  98557. return;
  98558. }
  98559. for (i2 in types) {
  98560. if (types.hasOwnProperty(i2)) {
  98561. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  98562. }
  98563. }
  98564. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  98565. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  98566. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  98567. VIDEO_HDLR = new Uint8Array([
  98568. 0,
  98569. 0,
  98570. 0,
  98571. 0,
  98572. 0,
  98573. 0,
  98574. 0,
  98575. 0,
  98576. 118,
  98577. 105,
  98578. 100,
  98579. 101,
  98580. 0,
  98581. 0,
  98582. 0,
  98583. 0,
  98584. 0,
  98585. 0,
  98586. 0,
  98587. 0,
  98588. 0,
  98589. 0,
  98590. 0,
  98591. 0,
  98592. 86,
  98593. 105,
  98594. 100,
  98595. 101,
  98596. 111,
  98597. 72,
  98598. 97,
  98599. 110,
  98600. 100,
  98601. 108,
  98602. 101,
  98603. 114,
  98604. 0
  98605. ]);
  98606. AUDIO_HDLR = new Uint8Array([
  98607. 0,
  98608. 0,
  98609. 0,
  98610. 0,
  98611. 0,
  98612. 0,
  98613. 0,
  98614. 0,
  98615. 115,
  98616. 111,
  98617. 117,
  98618. 110,
  98619. 0,
  98620. 0,
  98621. 0,
  98622. 0,
  98623. 0,
  98624. 0,
  98625. 0,
  98626. 0,
  98627. 0,
  98628. 0,
  98629. 0,
  98630. 0,
  98631. 83,
  98632. 111,
  98633. 117,
  98634. 110,
  98635. 100,
  98636. 72,
  98637. 97,
  98638. 110,
  98639. 100,
  98640. 108,
  98641. 101,
  98642. 114,
  98643. 0
  98644. ]);
  98645. HDLR_TYPES = {
  98646. video: VIDEO_HDLR,
  98647. audio: AUDIO_HDLR
  98648. };
  98649. DREF = new Uint8Array([
  98650. 0,
  98651. 0,
  98652. 0,
  98653. 0,
  98654. 0,
  98655. 0,
  98656. 0,
  98657. 1,
  98658. 0,
  98659. 0,
  98660. 0,
  98661. 12,
  98662. 117,
  98663. 114,
  98664. 108,
  98665. 32,
  98666. 0,
  98667. 0,
  98668. 0,
  98669. 1
  98670. ]);
  98671. SMHD = new Uint8Array([
  98672. 0,
  98673. 0,
  98674. 0,
  98675. 0,
  98676. 0,
  98677. 0,
  98678. 0,
  98679. 0
  98680. ]);
  98681. STCO = new Uint8Array([
  98682. 0,
  98683. 0,
  98684. 0,
  98685. 0,
  98686. 0,
  98687. 0,
  98688. 0,
  98689. 0
  98690. ]);
  98691. STSC = STCO;
  98692. STSZ = new Uint8Array([
  98693. 0,
  98694. 0,
  98695. 0,
  98696. 0,
  98697. 0,
  98698. 0,
  98699. 0,
  98700. 0,
  98701. 0,
  98702. 0,
  98703. 0,
  98704. 0
  98705. ]);
  98706. STTS = STCO;
  98707. VMHD = new Uint8Array([
  98708. 0,
  98709. 0,
  98710. 0,
  98711. 1,
  98712. 0,
  98713. 0,
  98714. 0,
  98715. 0,
  98716. 0,
  98717. 0,
  98718. 0,
  98719. 0
  98720. ]);
  98721. })();
  98722. box = function box2(type3) {
  98723. var payload = [], size = 0, i2, result, view;
  98724. for (i2 = 1; i2 < arguments.length; i2++) {
  98725. payload.push(arguments[i2]);
  98726. }
  98727. i2 = payload.length;
  98728. while (i2--) {
  98729. size += payload[i2].byteLength;
  98730. }
  98731. result = new Uint8Array(size + 8);
  98732. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  98733. view.setUint32(0, result.byteLength);
  98734. result.set(type3, 4);
  98735. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  98736. result.set(payload[i2], size);
  98737. size += payload[i2].byteLength;
  98738. }
  98739. return result;
  98740. };
  98741. dinf = function dinf2() {
  98742. return box(types.dinf, box(types.dref, DREF));
  98743. };
  98744. esds = function esds2(track) {
  98745. return box(types.esds, new Uint8Array([
  98746. 0,
  98747. 0,
  98748. 0,
  98749. 0,
  98750. 3,
  98751. 25,
  98752. 0,
  98753. 0,
  98754. 0,
  98755. 4,
  98756. 17,
  98757. 64,
  98758. 21,
  98759. 0,
  98760. 6,
  98761. 0,
  98762. 0,
  98763. 0,
  98764. 218,
  98765. 192,
  98766. 0,
  98767. 0,
  98768. 218,
  98769. 192,
  98770. 5,
  98771. 2,
  98772. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  98773. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  98774. 6,
  98775. 1,
  98776. 2
  98777. ]));
  98778. };
  98779. ftyp = function ftyp2() {
  98780. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  98781. };
  98782. hdlr = function hdlr2(type3) {
  98783. return box(types.hdlr, HDLR_TYPES[type3]);
  98784. };
  98785. mdat = function mdat2(data) {
  98786. return box(types.mdat, data);
  98787. };
  98788. mdhd = function mdhd2(track) {
  98789. var result = new Uint8Array([
  98790. 0,
  98791. 0,
  98792. 0,
  98793. 0,
  98794. 0,
  98795. 0,
  98796. 0,
  98797. 2,
  98798. 0,
  98799. 0,
  98800. 0,
  98801. 3,
  98802. 0,
  98803. 1,
  98804. 95,
  98805. 144,
  98806. track.duration >>> 24 & 255,
  98807. track.duration >>> 16 & 255,
  98808. track.duration >>> 8 & 255,
  98809. track.duration & 255,
  98810. 85,
  98811. 196,
  98812. 0,
  98813. 0
  98814. ]);
  98815. if (track.samplerate) {
  98816. result[12] = track.samplerate >>> 24 & 255;
  98817. result[13] = track.samplerate >>> 16 & 255;
  98818. result[14] = track.samplerate >>> 8 & 255;
  98819. result[15] = track.samplerate & 255;
  98820. }
  98821. return box(types.mdhd, result);
  98822. };
  98823. mdia = function mdia2(track) {
  98824. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  98825. };
  98826. mfhd = function mfhd2(sequenceNumber) {
  98827. return box(types.mfhd, new Uint8Array([
  98828. 0,
  98829. 0,
  98830. 0,
  98831. 0,
  98832. (sequenceNumber & 4278190080) >> 24,
  98833. (sequenceNumber & 16711680) >> 16,
  98834. (sequenceNumber & 65280) >> 8,
  98835. sequenceNumber & 255
  98836. ]));
  98837. };
  98838. minf = function minf2(track) {
  98839. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  98840. };
  98841. moof = function moof2(sequenceNumber, tracks) {
  98842. var trackFragments = [], i2 = tracks.length;
  98843. while (i2--) {
  98844. trackFragments[i2] = traf(tracks[i2]);
  98845. }
  98846. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  98847. };
  98848. moov = function moov2(tracks) {
  98849. var i2 = tracks.length, boxes = [];
  98850. while (i2--) {
  98851. boxes[i2] = trak(tracks[i2]);
  98852. }
  98853. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  98854. };
  98855. mvex = function mvex2(tracks) {
  98856. var i2 = tracks.length, boxes = [];
  98857. while (i2--) {
  98858. boxes[i2] = trex(tracks[i2]);
  98859. }
  98860. return box.apply(null, [types.mvex].concat(boxes));
  98861. };
  98862. mvhd = function mvhd2(duration5) {
  98863. var bytes = new Uint8Array([
  98864. 0,
  98865. 0,
  98866. 0,
  98867. 0,
  98868. 0,
  98869. 0,
  98870. 0,
  98871. 1,
  98872. 0,
  98873. 0,
  98874. 0,
  98875. 2,
  98876. 0,
  98877. 1,
  98878. 95,
  98879. 144,
  98880. (duration5 & 4278190080) >> 24,
  98881. (duration5 & 16711680) >> 16,
  98882. (duration5 & 65280) >> 8,
  98883. duration5 & 255,
  98884. 0,
  98885. 1,
  98886. 0,
  98887. 0,
  98888. 1,
  98889. 0,
  98890. 0,
  98891. 0,
  98892. 0,
  98893. 0,
  98894. 0,
  98895. 0,
  98896. 0,
  98897. 0,
  98898. 0,
  98899. 0,
  98900. 0,
  98901. 1,
  98902. 0,
  98903. 0,
  98904. 0,
  98905. 0,
  98906. 0,
  98907. 0,
  98908. 0,
  98909. 0,
  98910. 0,
  98911. 0,
  98912. 0,
  98913. 0,
  98914. 0,
  98915. 0,
  98916. 0,
  98917. 1,
  98918. 0,
  98919. 0,
  98920. 0,
  98921. 0,
  98922. 0,
  98923. 0,
  98924. 0,
  98925. 0,
  98926. 0,
  98927. 0,
  98928. 0,
  98929. 0,
  98930. 0,
  98931. 0,
  98932. 64,
  98933. 0,
  98934. 0,
  98935. 0,
  98936. 0,
  98937. 0,
  98938. 0,
  98939. 0,
  98940. 0,
  98941. 0,
  98942. 0,
  98943. 0,
  98944. 0,
  98945. 0,
  98946. 0,
  98947. 0,
  98948. 0,
  98949. 0,
  98950. 0,
  98951. 0,
  98952. 0,
  98953. 0,
  98954. 0,
  98955. 0,
  98956. 0,
  98957. 0,
  98958. 0,
  98959. 0,
  98960. 255,
  98961. 255,
  98962. 255,
  98963. 255
  98964. ]);
  98965. return box(types.mvhd, bytes);
  98966. };
  98967. sdtp = function sdtp2(track) {
  98968. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  98969. for (i2 = 0; i2 < samples.length; i2++) {
  98970. flags = samples[i2].flags;
  98971. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  98972. }
  98973. return box(types.sdtp, bytes);
  98974. };
  98975. stbl = function stbl2(track) {
  98976. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  98977. };
  98978. (function() {
  98979. var videoSample, audioSample;
  98980. stsd = function stsd2(track) {
  98981. return box(types.stsd, new Uint8Array([
  98982. 0,
  98983. 0,
  98984. 0,
  98985. 0,
  98986. 0,
  98987. 0,
  98988. 0,
  98989. 1
  98990. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  98991. };
  98992. videoSample = function videoSample2(track) {
  98993. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  98994. for (i2 = 0; i2 < sps.length; i2++) {
  98995. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  98996. sequenceParameterSets.push(sps[i2].byteLength & 255);
  98997. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  98998. }
  98999. for (i2 = 0; i2 < pps.length; i2++) {
  99000. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  99001. pictureParameterSets.push(pps[i2].byteLength & 255);
  99002. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  99003. }
  99004. avc1Box = [types.avc1, new Uint8Array([
  99005. 0,
  99006. 0,
  99007. 0,
  99008. 0,
  99009. 0,
  99010. 0,
  99011. 0,
  99012. 1,
  99013. 0,
  99014. 0,
  99015. 0,
  99016. 0,
  99017. 0,
  99018. 0,
  99019. 0,
  99020. 0,
  99021. 0,
  99022. 0,
  99023. 0,
  99024. 0,
  99025. 0,
  99026. 0,
  99027. 0,
  99028. 0,
  99029. (track.width & 65280) >> 8,
  99030. track.width & 255,
  99031. (track.height & 65280) >> 8,
  99032. track.height & 255,
  99033. 0,
  99034. 72,
  99035. 0,
  99036. 0,
  99037. 0,
  99038. 72,
  99039. 0,
  99040. 0,
  99041. 0,
  99042. 0,
  99043. 0,
  99044. 0,
  99045. 0,
  99046. 1,
  99047. 19,
  99048. 118,
  99049. 105,
  99050. 100,
  99051. 101,
  99052. 111,
  99053. 106,
  99054. 115,
  99055. 45,
  99056. 99,
  99057. 111,
  99058. 110,
  99059. 116,
  99060. 114,
  99061. 105,
  99062. 98,
  99063. 45,
  99064. 104,
  99065. 108,
  99066. 115,
  99067. 0,
  99068. 0,
  99069. 0,
  99070. 0,
  99071. 0,
  99072. 0,
  99073. 0,
  99074. 0,
  99075. 0,
  99076. 0,
  99077. 0,
  99078. 0,
  99079. 0,
  99080. 24,
  99081. 17,
  99082. 17
  99083. ]), box(types.avcC, new Uint8Array([
  99084. 1,
  99085. track.profileIdc,
  99086. track.profileCompatibility,
  99087. track.levelIdc,
  99088. 255
  99089. ].concat(
  99090. [sps.length],
  99091. sequenceParameterSets,
  99092. [pps.length],
  99093. pictureParameterSets
  99094. ))), box(types.btrt, new Uint8Array([
  99095. 0,
  99096. 28,
  99097. 156,
  99098. 128,
  99099. 0,
  99100. 45,
  99101. 198,
  99102. 192,
  99103. 0,
  99104. 45,
  99105. 198,
  99106. 192
  99107. ]))];
  99108. if (track.sarRatio) {
  99109. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  99110. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  99111. }
  99112. return box.apply(null, avc1Box);
  99113. };
  99114. audioSample = function audioSample2(track) {
  99115. return box(types.mp4a, new Uint8Array([
  99116. 0,
  99117. 0,
  99118. 0,
  99119. 0,
  99120. 0,
  99121. 0,
  99122. 0,
  99123. 1,
  99124. 0,
  99125. 0,
  99126. 0,
  99127. 0,
  99128. 0,
  99129. 0,
  99130. 0,
  99131. 0,
  99132. (track.channelcount & 65280) >> 8,
  99133. track.channelcount & 255,
  99134. (track.samplesize & 65280) >> 8,
  99135. track.samplesize & 255,
  99136. 0,
  99137. 0,
  99138. 0,
  99139. 0,
  99140. (track.samplerate & 65280) >> 8,
  99141. track.samplerate & 255,
  99142. 0,
  99143. 0
  99144. ]), esds(track));
  99145. };
  99146. })();
  99147. tkhd = function tkhd2(track) {
  99148. var result = new Uint8Array([
  99149. 0,
  99150. 0,
  99151. 0,
  99152. 7,
  99153. 0,
  99154. 0,
  99155. 0,
  99156. 0,
  99157. 0,
  99158. 0,
  99159. 0,
  99160. 0,
  99161. (track.id & 4278190080) >> 24,
  99162. (track.id & 16711680) >> 16,
  99163. (track.id & 65280) >> 8,
  99164. track.id & 255,
  99165. 0,
  99166. 0,
  99167. 0,
  99168. 0,
  99169. (track.duration & 4278190080) >> 24,
  99170. (track.duration & 16711680) >> 16,
  99171. (track.duration & 65280) >> 8,
  99172. track.duration & 255,
  99173. 0,
  99174. 0,
  99175. 0,
  99176. 0,
  99177. 0,
  99178. 0,
  99179. 0,
  99180. 0,
  99181. 0,
  99182. 0,
  99183. 0,
  99184. 0,
  99185. 1,
  99186. 0,
  99187. 0,
  99188. 0,
  99189. 0,
  99190. 1,
  99191. 0,
  99192. 0,
  99193. 0,
  99194. 0,
  99195. 0,
  99196. 0,
  99197. 0,
  99198. 0,
  99199. 0,
  99200. 0,
  99201. 0,
  99202. 0,
  99203. 0,
  99204. 0,
  99205. 0,
  99206. 1,
  99207. 0,
  99208. 0,
  99209. 0,
  99210. 0,
  99211. 0,
  99212. 0,
  99213. 0,
  99214. 0,
  99215. 0,
  99216. 0,
  99217. 0,
  99218. 0,
  99219. 0,
  99220. 0,
  99221. 64,
  99222. 0,
  99223. 0,
  99224. 0,
  99225. (track.width & 65280) >> 8,
  99226. track.width & 255,
  99227. 0,
  99228. 0,
  99229. (track.height & 65280) >> 8,
  99230. track.height & 255,
  99231. 0,
  99232. 0
  99233. ]);
  99234. return box(types.tkhd, result);
  99235. };
  99236. traf = function traf2(track) {
  99237. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  99238. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  99239. 0,
  99240. 0,
  99241. 0,
  99242. 58,
  99243. (track.id & 4278190080) >> 24,
  99244. (track.id & 16711680) >> 16,
  99245. (track.id & 65280) >> 8,
  99246. track.id & 255,
  99247. 0,
  99248. 0,
  99249. 0,
  99250. 1,
  99251. 0,
  99252. 0,
  99253. 0,
  99254. 0,
  99255. 0,
  99256. 0,
  99257. 0,
  99258. 0,
  99259. 0,
  99260. 0,
  99261. 0,
  99262. 0
  99263. ]));
  99264. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  99265. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  99266. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  99267. 1,
  99268. 0,
  99269. 0,
  99270. 0,
  99271. upperWordBaseMediaDecodeTime >>> 24 & 255,
  99272. upperWordBaseMediaDecodeTime >>> 16 & 255,
  99273. upperWordBaseMediaDecodeTime >>> 8 & 255,
  99274. upperWordBaseMediaDecodeTime & 255,
  99275. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  99276. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  99277. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  99278. lowerWordBaseMediaDecodeTime & 255
  99279. ]));
  99280. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  99281. if (track.type === "audio") {
  99282. trackFragmentRun = trun$1(track, dataOffset);
  99283. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  99284. }
  99285. sampleDependencyTable = sdtp(track);
  99286. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  99287. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  99288. };
  99289. trak = function trak2(track) {
  99290. track.duration = track.duration || 4294967295;
  99291. return box(types.trak, tkhd(track), mdia(track));
  99292. };
  99293. trex = function trex2(track) {
  99294. var result = new Uint8Array([
  99295. 0,
  99296. 0,
  99297. 0,
  99298. 0,
  99299. (track.id & 4278190080) >> 24,
  99300. (track.id & 16711680) >> 16,
  99301. (track.id & 65280) >> 8,
  99302. track.id & 255,
  99303. 0,
  99304. 0,
  99305. 0,
  99306. 1,
  99307. 0,
  99308. 0,
  99309. 0,
  99310. 0,
  99311. 0,
  99312. 0,
  99313. 0,
  99314. 0,
  99315. 0,
  99316. 1,
  99317. 0,
  99318. 1
  99319. ]);
  99320. if (track.type !== "video") {
  99321. result[result.length - 1] = 0;
  99322. }
  99323. return box(types.trex, result);
  99324. };
  99325. (function() {
  99326. var audioTrun, videoTrun, trunHeader;
  99327. trunHeader = function trunHeader2(samples, offset) {
  99328. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  99329. if (samples.length) {
  99330. if (samples[0].duration !== void 0) {
  99331. durationPresent = 1;
  99332. }
  99333. if (samples[0].size !== void 0) {
  99334. sizePresent = 2;
  99335. }
  99336. if (samples[0].flags !== void 0) {
  99337. flagsPresent = 4;
  99338. }
  99339. if (samples[0].compositionTimeOffset !== void 0) {
  99340. compositionTimeOffset = 8;
  99341. }
  99342. }
  99343. return [
  99344. 0,
  99345. 0,
  99346. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  99347. 1,
  99348. (samples.length & 4278190080) >>> 24,
  99349. (samples.length & 16711680) >>> 16,
  99350. (samples.length & 65280) >>> 8,
  99351. samples.length & 255,
  99352. (offset & 4278190080) >>> 24,
  99353. (offset & 16711680) >>> 16,
  99354. (offset & 65280) >>> 8,
  99355. offset & 255
  99356. ];
  99357. };
  99358. videoTrun = function videoTrun2(track, offset) {
  99359. var bytesOffest, bytes, header, samples, sample, i2;
  99360. samples = track.samples || [];
  99361. offset += 8 + 12 + 16 * samples.length;
  99362. header = trunHeader(samples, offset);
  99363. bytes = new Uint8Array(header.length + samples.length * 16);
  99364. bytes.set(header);
  99365. bytesOffest = header.length;
  99366. for (i2 = 0; i2 < samples.length; i2++) {
  99367. sample = samples[i2];
  99368. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99369. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99370. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99371. bytes[bytesOffest++] = sample.duration & 255;
  99372. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99373. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99374. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99375. bytes[bytesOffest++] = sample.size & 255;
  99376. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  99377. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  99378. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  99379. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  99380. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  99381. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  99382. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  99383. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  99384. }
  99385. return box(types.trun, bytes);
  99386. };
  99387. audioTrun = function audioTrun2(track, offset) {
  99388. var bytes, bytesOffest, header, samples, sample, i2;
  99389. samples = track.samples || [];
  99390. offset += 8 + 12 + 8 * samples.length;
  99391. header = trunHeader(samples, offset);
  99392. bytes = new Uint8Array(header.length + samples.length * 8);
  99393. bytes.set(header);
  99394. bytesOffest = header.length;
  99395. for (i2 = 0; i2 < samples.length; i2++) {
  99396. sample = samples[i2];
  99397. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99398. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99399. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99400. bytes[bytesOffest++] = sample.duration & 255;
  99401. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99402. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99403. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99404. bytes[bytesOffest++] = sample.size & 255;
  99405. }
  99406. return box(types.trun, bytes);
  99407. };
  99408. trun$1 = function trun2(track, offset) {
  99409. if (track.type === "audio") {
  99410. return audioTrun(track, offset);
  99411. }
  99412. return videoTrun(track, offset);
  99413. };
  99414. })();
  99415. var mp4Generator = {
  99416. ftyp,
  99417. mdat,
  99418. moof,
  99419. moov,
  99420. initSegment: function initSegment(tracks) {
  99421. var fileType = ftyp(), movie = moov(tracks), result;
  99422. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  99423. result.set(fileType);
  99424. result.set(movie, fileType.byteLength);
  99425. return result;
  99426. }
  99427. };
  99428. var groupNalsIntoFrames = function groupNalsIntoFrames2(nalUnits) {
  99429. var i2, currentNal, currentFrame = [], frames = [];
  99430. frames.byteLength = 0;
  99431. frames.nalCount = 0;
  99432. frames.duration = 0;
  99433. currentFrame.byteLength = 0;
  99434. for (i2 = 0; i2 < nalUnits.length; i2++) {
  99435. currentNal = nalUnits[i2];
  99436. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  99437. if (currentFrame.length) {
  99438. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99439. frames.byteLength += currentFrame.byteLength;
  99440. frames.nalCount += currentFrame.length;
  99441. frames.duration += currentFrame.duration;
  99442. frames.push(currentFrame);
  99443. }
  99444. currentFrame = [currentNal];
  99445. currentFrame.byteLength = currentNal.data.byteLength;
  99446. currentFrame.pts = currentNal.pts;
  99447. currentFrame.dts = currentNal.dts;
  99448. } else {
  99449. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  99450. currentFrame.keyFrame = true;
  99451. }
  99452. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99453. currentFrame.byteLength += currentNal.data.byteLength;
  99454. currentFrame.push(currentNal);
  99455. }
  99456. }
  99457. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  99458. currentFrame.duration = frames[frames.length - 1].duration;
  99459. }
  99460. frames.byteLength += currentFrame.byteLength;
  99461. frames.nalCount += currentFrame.length;
  99462. frames.duration += currentFrame.duration;
  99463. frames.push(currentFrame);
  99464. return frames;
  99465. };
  99466. var groupFramesIntoGops = function groupFramesIntoGops2(frames) {
  99467. var i2, currentFrame, currentGop = [], gops = [];
  99468. currentGop.byteLength = 0;
  99469. currentGop.nalCount = 0;
  99470. currentGop.duration = 0;
  99471. currentGop.pts = frames[0].pts;
  99472. currentGop.dts = frames[0].dts;
  99473. gops.byteLength = 0;
  99474. gops.nalCount = 0;
  99475. gops.duration = 0;
  99476. gops.pts = frames[0].pts;
  99477. gops.dts = frames[0].dts;
  99478. for (i2 = 0; i2 < frames.length; i2++) {
  99479. currentFrame = frames[i2];
  99480. if (currentFrame.keyFrame) {
  99481. if (currentGop.length) {
  99482. gops.push(currentGop);
  99483. gops.byteLength += currentGop.byteLength;
  99484. gops.nalCount += currentGop.nalCount;
  99485. gops.duration += currentGop.duration;
  99486. }
  99487. currentGop = [currentFrame];
  99488. currentGop.nalCount = currentFrame.length;
  99489. currentGop.byteLength = currentFrame.byteLength;
  99490. currentGop.pts = currentFrame.pts;
  99491. currentGop.dts = currentFrame.dts;
  99492. currentGop.duration = currentFrame.duration;
  99493. } else {
  99494. currentGop.duration += currentFrame.duration;
  99495. currentGop.nalCount += currentFrame.length;
  99496. currentGop.byteLength += currentFrame.byteLength;
  99497. currentGop.push(currentFrame);
  99498. }
  99499. }
  99500. if (gops.length && currentGop.duration <= 0) {
  99501. currentGop.duration = gops[gops.length - 1].duration;
  99502. }
  99503. gops.byteLength += currentGop.byteLength;
  99504. gops.nalCount += currentGop.nalCount;
  99505. gops.duration += currentGop.duration;
  99506. gops.push(currentGop);
  99507. return gops;
  99508. };
  99509. var extendFirstKeyFrame = function extendFirstKeyFrame2(gops) {
  99510. var currentGop;
  99511. if (!gops[0][0].keyFrame && gops.length > 1) {
  99512. currentGop = gops.shift();
  99513. gops.byteLength -= currentGop.byteLength;
  99514. gops.nalCount -= currentGop.nalCount;
  99515. gops[0][0].dts = currentGop.dts;
  99516. gops[0][0].pts = currentGop.pts;
  99517. gops[0][0].duration += currentGop.duration;
  99518. }
  99519. return gops;
  99520. };
  99521. var createDefaultSample = function createDefaultSample2() {
  99522. return {
  99523. size: 0,
  99524. flags: {
  99525. isLeading: 0,
  99526. dependsOn: 1,
  99527. isDependedOn: 0,
  99528. hasRedundancy: 0,
  99529. degradationPriority: 0,
  99530. isNonSyncSample: 1
  99531. }
  99532. };
  99533. };
  99534. var sampleForFrame = function sampleForFrame2(frame, dataOffset) {
  99535. var sample = createDefaultSample();
  99536. sample.dataOffset = dataOffset;
  99537. sample.compositionTimeOffset = frame.pts - frame.dts;
  99538. sample.duration = frame.duration;
  99539. sample.size = 4 * frame.length;
  99540. sample.size += frame.byteLength;
  99541. if (frame.keyFrame) {
  99542. sample.flags.dependsOn = 2;
  99543. sample.flags.isNonSyncSample = 0;
  99544. }
  99545. return sample;
  99546. };
  99547. var generateSampleTable$1 = function generateSampleTable2(gops, baseDataOffset) {
  99548. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  99549. for (h2 = 0; h2 < gops.length; h2++) {
  99550. currentGop = gops[h2];
  99551. for (i2 = 0; i2 < currentGop.length; i2++) {
  99552. currentFrame = currentGop[i2];
  99553. sample = sampleForFrame(currentFrame, dataOffset);
  99554. dataOffset += sample.size;
  99555. samples.push(sample);
  99556. }
  99557. }
  99558. return samples;
  99559. };
  99560. var concatenateNalData = function concatenateNalData2(gops) {
  99561. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99562. for (h2 = 0; h2 < gops.length; h2++) {
  99563. currentGop = gops[h2];
  99564. for (i2 = 0; i2 < currentGop.length; i2++) {
  99565. currentFrame = currentGop[i2];
  99566. for (j = 0; j < currentFrame.length; j++) {
  99567. currentNal = currentFrame[j];
  99568. view.setUint32(dataOffset, currentNal.data.byteLength);
  99569. dataOffset += 4;
  99570. data.set(currentNal.data, dataOffset);
  99571. dataOffset += currentNal.data.byteLength;
  99572. }
  99573. }
  99574. }
  99575. return data;
  99576. };
  99577. var generateSampleTableForFrame = function generateSampleTableForFrame2(frame, baseDataOffset) {
  99578. var sample, dataOffset = baseDataOffset || 0, samples = [];
  99579. sample = sampleForFrame(frame, dataOffset);
  99580. samples.push(sample);
  99581. return samples;
  99582. };
  99583. var concatenateNalDataForFrame = function concatenateNalDataForFrame2(frame) {
  99584. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99585. for (i2 = 0; i2 < frame.length; i2++) {
  99586. currentNal = frame[i2];
  99587. view.setUint32(dataOffset, currentNal.data.byteLength);
  99588. dataOffset += 4;
  99589. data.set(currentNal.data, dataOffset);
  99590. dataOffset += currentNal.data.byteLength;
  99591. }
  99592. return data;
  99593. };
  99594. var frameUtils = {
  99595. groupNalsIntoFrames,
  99596. groupFramesIntoGops,
  99597. extendFirstKeyFrame,
  99598. generateSampleTable: generateSampleTable$1,
  99599. concatenateNalData,
  99600. generateSampleTableForFrame,
  99601. concatenateNalDataForFrame
  99602. };
  99603. var highPrefix = [33, 16, 5, 32, 164, 27];
  99604. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  99605. var zeroFill = function zeroFill2(count) {
  99606. var a = [];
  99607. while (count--) {
  99608. a.push(0);
  99609. }
  99610. return a;
  99611. };
  99612. var makeTable = function makeTable2(metaTable) {
  99613. return Object.keys(metaTable).reduce(function(obj, key) {
  99614. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  99615. return arr.concat(part);
  99616. }, []));
  99617. return obj;
  99618. }, {});
  99619. };
  99620. var silence;
  99621. var silence_1 = function silence_12() {
  99622. if (!silence) {
  99623. var coneOfSilence = {
  99624. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  99625. 88200: [highPrefix, [231], zeroFill(170), [56]],
  99626. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  99627. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  99628. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  99629. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  99630. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  99631. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  99632. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  99633. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  99634. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  99635. };
  99636. silence = makeTable(coneOfSilence);
  99637. }
  99638. return silence;
  99639. };
  99640. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  99641. secondsToVideoTs2 = function secondsToVideoTs3(seconds) {
  99642. return seconds * ONE_SECOND_IN_TS$4;
  99643. };
  99644. secondsToAudioTs2 = function secondsToAudioTs3(seconds, sampleRate) {
  99645. return seconds * sampleRate;
  99646. };
  99647. videoTsToSeconds2 = function videoTsToSeconds3(timestamp) {
  99648. return timestamp / ONE_SECOND_IN_TS$4;
  99649. };
  99650. audioTsToSeconds2 = function audioTsToSeconds3(timestamp, sampleRate) {
  99651. return timestamp / sampleRate;
  99652. };
  99653. audioTsToVideoTs2 = function audioTsToVideoTs3(timestamp, sampleRate) {
  99654. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  99655. };
  99656. videoTsToAudioTs2 = function videoTsToAudioTs3(timestamp, sampleRate) {
  99657. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  99658. };
  99659. metadataTsToSeconds2 = function metadataTsToSeconds3(timestamp, timelineStartPts, keepOriginalTimestamps) {
  99660. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  99661. };
  99662. var clock2 = {
  99663. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  99664. secondsToVideoTs: secondsToVideoTs2,
  99665. secondsToAudioTs: secondsToAudioTs2,
  99666. videoTsToSeconds: videoTsToSeconds2,
  99667. audioTsToSeconds: audioTsToSeconds2,
  99668. audioTsToVideoTs: audioTsToVideoTs2,
  99669. videoTsToAudioTs: videoTsToAudioTs2,
  99670. metadataTsToSeconds: metadataTsToSeconds2
  99671. };
  99672. var sumFrameByteLengths = function sumFrameByteLengths2(array) {
  99673. var i2, currentObj, sum = 0;
  99674. for (i2 = 0; i2 < array.length; i2++) {
  99675. currentObj = array[i2];
  99676. sum += currentObj.data.byteLength;
  99677. }
  99678. return sum;
  99679. };
  99680. var prefixWithSilence = function prefixWithSilence2(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  99681. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  99682. if (!frames.length) {
  99683. return;
  99684. }
  99685. baseMediaDecodeTimeTs = clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  99686. frameDuration = Math.ceil(clock2.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  99687. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  99688. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  99689. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  99690. audioFillDuration = audioFillFrameCount * frameDuration;
  99691. }
  99692. if (audioFillFrameCount < 1 || audioFillDuration > clock2.ONE_SECOND_IN_TS / 2) {
  99693. return;
  99694. }
  99695. silentFrame = silence_1()[track.samplerate];
  99696. if (!silentFrame) {
  99697. silentFrame = frames[0].data;
  99698. }
  99699. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  99700. firstFrame = frames[0];
  99701. frames.splice(0, 0, {
  99702. data: silentFrame,
  99703. dts: firstFrame.dts - frameDuration,
  99704. pts: firstFrame.pts - frameDuration
  99705. });
  99706. }
  99707. track.baseMediaDecodeTime -= Math.floor(clock2.videoTsToAudioTs(audioFillDuration, track.samplerate));
  99708. return audioFillDuration;
  99709. };
  99710. var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts2(adtsFrames, track, earliestAllowedDts) {
  99711. if (track.minSegmentDts >= earliestAllowedDts) {
  99712. return adtsFrames;
  99713. }
  99714. track.minSegmentDts = Infinity;
  99715. return adtsFrames.filter(function(currentFrame) {
  99716. if (currentFrame.dts >= earliestAllowedDts) {
  99717. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  99718. track.minSegmentPts = track.minSegmentDts;
  99719. return true;
  99720. }
  99721. return false;
  99722. });
  99723. };
  99724. var generateSampleTable = function generateSampleTable2(frames) {
  99725. var i2, currentFrame, samples = [];
  99726. for (i2 = 0; i2 < frames.length; i2++) {
  99727. currentFrame = frames[i2];
  99728. samples.push({
  99729. size: currentFrame.data.byteLength,
  99730. duration: 1024
  99731. });
  99732. }
  99733. return samples;
  99734. };
  99735. var concatenateFrameData = function concatenateFrameData2(frames) {
  99736. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  99737. for (i2 = 0; i2 < frames.length; i2++) {
  99738. currentFrame = frames[i2];
  99739. data.set(currentFrame.data, dataOffset);
  99740. dataOffset += currentFrame.data.byteLength;
  99741. }
  99742. return data;
  99743. };
  99744. var audioFrameUtils = {
  99745. prefixWithSilence,
  99746. trimAdtsFramesByEarliestDts,
  99747. generateSampleTable,
  99748. concatenateFrameData
  99749. };
  99750. var ONE_SECOND_IN_TS$3 = clock2.ONE_SECOND_IN_TS;
  99751. var collectDtsInfo = function collectDtsInfo2(track, data) {
  99752. if (typeof data.pts === "number") {
  99753. if (track.timelineStartInfo.pts === void 0) {
  99754. track.timelineStartInfo.pts = data.pts;
  99755. }
  99756. if (track.minSegmentPts === void 0) {
  99757. track.minSegmentPts = data.pts;
  99758. } else {
  99759. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  99760. }
  99761. if (track.maxSegmentPts === void 0) {
  99762. track.maxSegmentPts = data.pts;
  99763. } else {
  99764. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  99765. }
  99766. }
  99767. if (typeof data.dts === "number") {
  99768. if (track.timelineStartInfo.dts === void 0) {
  99769. track.timelineStartInfo.dts = data.dts;
  99770. }
  99771. if (track.minSegmentDts === void 0) {
  99772. track.minSegmentDts = data.dts;
  99773. } else {
  99774. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  99775. }
  99776. if (track.maxSegmentDts === void 0) {
  99777. track.maxSegmentDts = data.dts;
  99778. } else {
  99779. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  99780. }
  99781. }
  99782. };
  99783. var clearDtsInfo = function clearDtsInfo2(track) {
  99784. delete track.minSegmentDts;
  99785. delete track.maxSegmentDts;
  99786. delete track.minSegmentPts;
  99787. delete track.maxSegmentPts;
  99788. };
  99789. var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime2(track, keepOriginalTimestamps) {
  99790. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  99791. if (!keepOriginalTimestamps) {
  99792. minSegmentDts -= track.timelineStartInfo.dts;
  99793. }
  99794. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  99795. baseMediaDecodeTime += minSegmentDts;
  99796. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  99797. if (track.type === "audio") {
  99798. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  99799. baseMediaDecodeTime *= scale;
  99800. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  99801. }
  99802. return baseMediaDecodeTime;
  99803. };
  99804. var trackDecodeInfo = {
  99805. clearDtsInfo,
  99806. calculateTrackBaseMediaDecodeTime,
  99807. collectDtsInfo
  99808. };
  99809. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  99810. var parseSei = function parseSei2(bytes) {
  99811. var i2 = 0, result = {
  99812. payloadType: -1,
  99813. payloadSize: 0
  99814. }, payloadType = 0, payloadSize = 0;
  99815. while (i2 < bytes.byteLength) {
  99816. if (bytes[i2] === RBSP_TRAILING_BITS) {
  99817. break;
  99818. }
  99819. while (bytes[i2] === 255) {
  99820. payloadType += 255;
  99821. i2++;
  99822. }
  99823. payloadType += bytes[i2++];
  99824. while (bytes[i2] === 255) {
  99825. payloadSize += 255;
  99826. i2++;
  99827. }
  99828. payloadSize += bytes[i2++];
  99829. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  99830. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  99831. if (userIdentifier === "GA94") {
  99832. result.payloadType = payloadType;
  99833. result.payloadSize = payloadSize;
  99834. result.payload = bytes.subarray(i2, i2 + payloadSize);
  99835. break;
  99836. } else {
  99837. result.payload = void 0;
  99838. }
  99839. }
  99840. i2 += payloadSize;
  99841. payloadType = 0;
  99842. payloadSize = 0;
  99843. }
  99844. return result;
  99845. };
  99846. var parseUserData = function parseUserData2(sei) {
  99847. if (sei.payload[0] !== 181) {
  99848. return null;
  99849. }
  99850. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  99851. return null;
  99852. }
  99853. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  99854. return null;
  99855. }
  99856. if (sei.payload[7] !== 3) {
  99857. return null;
  99858. }
  99859. return sei.payload.subarray(8, sei.payload.length - 1);
  99860. };
  99861. var parseCaptionPackets = function parseCaptionPackets2(pts, userData) {
  99862. var results = [], i2, count, offset, data;
  99863. if (!(userData[0] & 64)) {
  99864. return results;
  99865. }
  99866. count = userData[0] & 31;
  99867. for (i2 = 0; i2 < count; i2++) {
  99868. offset = i2 * 3;
  99869. data = {
  99870. type: userData[offset + 2] & 3,
  99871. pts
  99872. };
  99873. if (userData[offset + 2] & 4) {
  99874. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  99875. results.push(data);
  99876. }
  99877. }
  99878. return results;
  99879. };
  99880. var discardEmulationPreventionBytes$12 = function discardEmulationPreventionBytes5(data) {
  99881. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  99882. while (i2 < length - 2) {
  99883. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  99884. emulationPreventionBytesPositions.push(i2 + 2);
  99885. i2 += 2;
  99886. } else {
  99887. i2++;
  99888. }
  99889. }
  99890. if (emulationPreventionBytesPositions.length === 0) {
  99891. return data;
  99892. }
  99893. newLength = length - emulationPreventionBytesPositions.length;
  99894. newData = new Uint8Array(newLength);
  99895. var sourceIndex = 0;
  99896. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  99897. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  99898. sourceIndex++;
  99899. emulationPreventionBytesPositions.shift();
  99900. }
  99901. newData[i2] = data[sourceIndex];
  99902. }
  99903. return newData;
  99904. };
  99905. var captionPacketParser = {
  99906. parseSei,
  99907. parseUserData,
  99908. parseCaptionPackets,
  99909. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  99910. USER_DATA_REGISTERED_ITU_T_T35
  99911. };
  99912. var CaptionStream$1 = function CaptionStream2(options2) {
  99913. options2 = options2 || {};
  99914. CaptionStream2.prototype.init.call(this);
  99915. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  99916. this.captionPackets_ = [];
  99917. this.ccStreams_ = [
  99918. new Cea608Stream(0, 0),
  99919. new Cea608Stream(0, 1),
  99920. new Cea608Stream(1, 0),
  99921. new Cea608Stream(1, 1)
  99922. ];
  99923. if (this.parse708captions_) {
  99924. this.cc708Stream_ = new Cea708Stream({
  99925. captionServices: options2.captionServices
  99926. });
  99927. }
  99928. this.reset();
  99929. this.ccStreams_.forEach(function(cc) {
  99930. cc.on("data", this.trigger.bind(this, "data"));
  99931. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  99932. cc.on("done", this.trigger.bind(this, "done"));
  99933. }, this);
  99934. if (this.parse708captions_) {
  99935. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  99936. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  99937. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  99938. }
  99939. };
  99940. CaptionStream$1.prototype = new stream();
  99941. CaptionStream$1.prototype.push = function(event2) {
  99942. var sei, userData, newCaptionPackets;
  99943. if (event2.nalUnitType !== "sei_rbsp") {
  99944. return;
  99945. }
  99946. sei = captionPacketParser.parseSei(event2.escapedRBSP);
  99947. if (!sei.payload) {
  99948. return;
  99949. }
  99950. if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {
  99951. return;
  99952. }
  99953. userData = captionPacketParser.parseUserData(sei);
  99954. if (!userData) {
  99955. return;
  99956. }
  99957. if (event2.dts < this.latestDts_) {
  99958. this.ignoreNextEqualDts_ = true;
  99959. return;
  99960. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  99961. this.numSameDts_--;
  99962. if (!this.numSameDts_) {
  99963. this.ignoreNextEqualDts_ = false;
  99964. }
  99965. return;
  99966. }
  99967. newCaptionPackets = captionPacketParser.parseCaptionPackets(event2.pts, userData);
  99968. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  99969. if (this.latestDts_ !== event2.dts) {
  99970. this.numSameDts_ = 0;
  99971. }
  99972. this.numSameDts_++;
  99973. this.latestDts_ = event2.dts;
  99974. };
  99975. CaptionStream$1.prototype.flushCCStreams = function(flushType) {
  99976. this.ccStreams_.forEach(function(cc) {
  99977. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  99978. }, this);
  99979. };
  99980. CaptionStream$1.prototype.flushStream = function(flushType) {
  99981. if (!this.captionPackets_.length) {
  99982. this.flushCCStreams(flushType);
  99983. return;
  99984. }
  99985. this.captionPackets_.forEach(function(elem, idx) {
  99986. elem.presortIndex = idx;
  99987. });
  99988. this.captionPackets_.sort(function(a, b) {
  99989. if (a.pts === b.pts) {
  99990. return a.presortIndex - b.presortIndex;
  99991. }
  99992. return a.pts - b.pts;
  99993. });
  99994. this.captionPackets_.forEach(function(packet) {
  99995. if (packet.type < 2) {
  99996. this.dispatchCea608Packet(packet);
  99997. } else {
  99998. this.dispatchCea708Packet(packet);
  99999. }
  100000. }, this);
  100001. this.captionPackets_.length = 0;
  100002. this.flushCCStreams(flushType);
  100003. };
  100004. CaptionStream$1.prototype.flush = function() {
  100005. return this.flushStream("flush");
  100006. };
  100007. CaptionStream$1.prototype.partialFlush = function() {
  100008. return this.flushStream("partialFlush");
  100009. };
  100010. CaptionStream$1.prototype.reset = function() {
  100011. this.latestDts_ = null;
  100012. this.ignoreNextEqualDts_ = false;
  100013. this.numSameDts_ = 0;
  100014. this.activeCea608Channel_ = [null, null];
  100015. this.ccStreams_.forEach(function(ccStream) {
  100016. ccStream.reset();
  100017. });
  100018. };
  100019. CaptionStream$1.prototype.dispatchCea608Packet = function(packet) {
  100020. if (this.setsTextOrXDSActive(packet)) {
  100021. this.activeCea608Channel_[packet.type] = null;
  100022. } else if (this.setsChannel1Active(packet)) {
  100023. this.activeCea608Channel_[packet.type] = 0;
  100024. } else if (this.setsChannel2Active(packet)) {
  100025. this.activeCea608Channel_[packet.type] = 1;
  100026. }
  100027. if (this.activeCea608Channel_[packet.type] === null) {
  100028. return;
  100029. }
  100030. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  100031. };
  100032. CaptionStream$1.prototype.setsChannel1Active = function(packet) {
  100033. return (packet.ccData & 30720) === 4096;
  100034. };
  100035. CaptionStream$1.prototype.setsChannel2Active = function(packet) {
  100036. return (packet.ccData & 30720) === 6144;
  100037. };
  100038. CaptionStream$1.prototype.setsTextOrXDSActive = function(packet) {
  100039. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  100040. };
  100041. CaptionStream$1.prototype.dispatchCea708Packet = function(packet) {
  100042. if (this.parse708captions_) {
  100043. this.cc708Stream_.push(packet);
  100044. }
  100045. };
  100046. var CHARACTER_TRANSLATION_708 = {
  100047. 127: 9834,
  100048. 4128: 32,
  100049. 4129: 160,
  100050. 4133: 8230,
  100051. 4138: 352,
  100052. 4140: 338,
  100053. 4144: 9608,
  100054. 4145: 8216,
  100055. 4146: 8217,
  100056. 4147: 8220,
  100057. 4148: 8221,
  100058. 4149: 8226,
  100059. 4153: 8482,
  100060. 4154: 353,
  100061. 4156: 339,
  100062. 4157: 8480,
  100063. 4159: 376,
  100064. 4214: 8539,
  100065. 4215: 8540,
  100066. 4216: 8541,
  100067. 4217: 8542,
  100068. 4218: 9168,
  100069. 4219: 9124,
  100070. 4220: 9123,
  100071. 4221: 9135,
  100072. 4222: 9126,
  100073. 4223: 9121,
  100074. 4256: 12600
  100075. };
  100076. var get708CharFromCode = function get708CharFromCode2(code) {
  100077. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  100078. if (code & 4096 && code === newCode) {
  100079. return "";
  100080. }
  100081. return String.fromCharCode(newCode);
  100082. };
  100083. var within708TextBlock = function within708TextBlock2(b) {
  100084. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  100085. };
  100086. var Cea708Window = function Cea708Window2(windowNum) {
  100087. this.windowNum = windowNum;
  100088. this.reset();
  100089. };
  100090. Cea708Window.prototype.reset = function() {
  100091. this.clearText();
  100092. this.pendingNewLine = false;
  100093. this.winAttr = {};
  100094. this.penAttr = {};
  100095. this.penLoc = {};
  100096. this.penColor = {};
  100097. this.visible = 0;
  100098. this.rowLock = 0;
  100099. this.columnLock = 0;
  100100. this.priority = 0;
  100101. this.relativePositioning = 0;
  100102. this.anchorVertical = 0;
  100103. this.anchorHorizontal = 0;
  100104. this.anchorPoint = 0;
  100105. this.rowCount = 1;
  100106. this.virtualRowCount = this.rowCount + 1;
  100107. this.columnCount = 41;
  100108. this.windowStyle = 0;
  100109. this.penStyle = 0;
  100110. };
  100111. Cea708Window.prototype.getText = function() {
  100112. return this.rows.join("\n");
  100113. };
  100114. Cea708Window.prototype.clearText = function() {
  100115. this.rows = [""];
  100116. this.rowIdx = 0;
  100117. };
  100118. Cea708Window.prototype.newLine = function(pts) {
  100119. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  100120. this.beforeRowOverflow(pts);
  100121. }
  100122. if (this.rows.length > 0) {
  100123. this.rows.push("");
  100124. this.rowIdx++;
  100125. }
  100126. while (this.rows.length > this.virtualRowCount) {
  100127. this.rows.shift();
  100128. this.rowIdx--;
  100129. }
  100130. };
  100131. Cea708Window.prototype.isEmpty = function() {
  100132. if (this.rows.length === 0) {
  100133. return true;
  100134. } else if (this.rows.length === 1) {
  100135. return this.rows[0] === "";
  100136. }
  100137. return false;
  100138. };
  100139. Cea708Window.prototype.addText = function(text) {
  100140. this.rows[this.rowIdx] += text;
  100141. };
  100142. Cea708Window.prototype.backspace = function() {
  100143. if (!this.isEmpty()) {
  100144. var row = this.rows[this.rowIdx];
  100145. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  100146. }
  100147. };
  100148. var Cea708Service = function Cea708Service2(serviceNum, encoding, stream2) {
  100149. this.serviceNum = serviceNum;
  100150. this.text = "";
  100151. this.currentWindow = new Cea708Window(-1);
  100152. this.windows = [];
  100153. this.stream = stream2;
  100154. if (typeof encoding === "string") {
  100155. this.createTextDecoder(encoding);
  100156. }
  100157. };
  100158. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  100159. this.startPts = pts;
  100160. for (var win3 = 0; win3 < 8; win3++) {
  100161. this.windows[win3] = new Cea708Window(win3);
  100162. if (typeof beforeRowOverflow === "function") {
  100163. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  100164. }
  100165. }
  100166. };
  100167. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  100168. this.currentWindow = this.windows[windowNum];
  100169. };
  100170. Cea708Service.prototype.createTextDecoder = function(encoding) {
  100171. if (typeof TextDecoder === "undefined") {
  100172. this.stream.trigger("log", {
  100173. level: "warn",
  100174. message: "The `encoding` option is unsupported without TextDecoder support"
  100175. });
  100176. } else {
  100177. try {
  100178. this.textDecoder_ = new TextDecoder(encoding);
  100179. } catch (error) {
  100180. this.stream.trigger("log", {
  100181. level: "warn",
  100182. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  100183. });
  100184. }
  100185. }
  100186. };
  100187. var Cea708Stream = function Cea708Stream2(options2) {
  100188. options2 = options2 || {};
  100189. Cea708Stream2.prototype.init.call(this);
  100190. var self2 = this;
  100191. var captionServices = options2.captionServices || {};
  100192. var captionServiceEncodings = {};
  100193. var serviceProps;
  100194. Object.keys(captionServices).forEach(function(serviceName) {
  100195. serviceProps = captionServices[serviceName];
  100196. if (/^SERVICE/.test(serviceName)) {
  100197. captionServiceEncodings[serviceName] = serviceProps.encoding;
  100198. }
  100199. });
  100200. this.serviceEncodings = captionServiceEncodings;
  100201. this.current708Packet = null;
  100202. this.services = {};
  100203. this.push = function(packet) {
  100204. if (packet.type === 3) {
  100205. self2.new708Packet();
  100206. self2.add708Bytes(packet);
  100207. } else {
  100208. if (self2.current708Packet === null) {
  100209. self2.new708Packet();
  100210. }
  100211. self2.add708Bytes(packet);
  100212. }
  100213. };
  100214. };
  100215. Cea708Stream.prototype = new stream();
  100216. Cea708Stream.prototype.new708Packet = function() {
  100217. if (this.current708Packet !== null) {
  100218. this.push708Packet();
  100219. }
  100220. this.current708Packet = {
  100221. data: [],
  100222. ptsVals: []
  100223. };
  100224. };
  100225. Cea708Stream.prototype.add708Bytes = function(packet) {
  100226. var data = packet.ccData;
  100227. var byte0 = data >>> 8;
  100228. var byte1 = data & 255;
  100229. this.current708Packet.ptsVals.push(packet.pts);
  100230. this.current708Packet.data.push(byte0);
  100231. this.current708Packet.data.push(byte1);
  100232. };
  100233. Cea708Stream.prototype.push708Packet = function() {
  100234. var packet708 = this.current708Packet;
  100235. var packetData = packet708.data;
  100236. var serviceNum = null;
  100237. var blockSize = null;
  100238. var i2 = 0;
  100239. var b = packetData[i2++];
  100240. packet708.seq = b >> 6;
  100241. packet708.sizeCode = b & 63;
  100242. for (; i2 < packetData.length; i2++) {
  100243. b = packetData[i2++];
  100244. serviceNum = b >> 5;
  100245. blockSize = b & 31;
  100246. if (serviceNum === 7 && blockSize > 0) {
  100247. b = packetData[i2++];
  100248. serviceNum = b;
  100249. }
  100250. this.pushServiceBlock(serviceNum, i2, blockSize);
  100251. if (blockSize > 0) {
  100252. i2 += blockSize - 1;
  100253. }
  100254. }
  100255. };
  100256. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  100257. var b;
  100258. var i2 = start2;
  100259. var packetData = this.current708Packet.data;
  100260. var service = this.services[serviceNum];
  100261. if (!service) {
  100262. service = this.initService(serviceNum, i2);
  100263. }
  100264. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  100265. b = packetData[i2];
  100266. if (within708TextBlock(b)) {
  100267. i2 = this.handleText(i2, service);
  100268. } else if (b === 24) {
  100269. i2 = this.multiByteCharacter(i2, service);
  100270. } else if (b === 16) {
  100271. i2 = this.extendedCommands(i2, service);
  100272. } else if (128 <= b && b <= 135) {
  100273. i2 = this.setCurrentWindow(i2, service);
  100274. } else if (152 <= b && b <= 159) {
  100275. i2 = this.defineWindow(i2, service);
  100276. } else if (b === 136) {
  100277. i2 = this.clearWindows(i2, service);
  100278. } else if (b === 140) {
  100279. i2 = this.deleteWindows(i2, service);
  100280. } else if (b === 137) {
  100281. i2 = this.displayWindows(i2, service);
  100282. } else if (b === 138) {
  100283. i2 = this.hideWindows(i2, service);
  100284. } else if (b === 139) {
  100285. i2 = this.toggleWindows(i2, service);
  100286. } else if (b === 151) {
  100287. i2 = this.setWindowAttributes(i2, service);
  100288. } else if (b === 144) {
  100289. i2 = this.setPenAttributes(i2, service);
  100290. } else if (b === 145) {
  100291. i2 = this.setPenColor(i2, service);
  100292. } else if (b === 146) {
  100293. i2 = this.setPenLocation(i2, service);
  100294. } else if (b === 143) {
  100295. service = this.reset(i2, service);
  100296. } else if (b === 8) {
  100297. service.currentWindow.backspace();
  100298. } else if (b === 12) {
  100299. service.currentWindow.clearText();
  100300. } else if (b === 13) {
  100301. service.currentWindow.pendingNewLine = true;
  100302. } else if (b === 14) {
  100303. service.currentWindow.clearText();
  100304. } else if (b === 141) {
  100305. i2++;
  100306. } else
  100307. ;
  100308. }
  100309. };
  100310. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  100311. var packetData = this.current708Packet.data;
  100312. var b = packetData[++i2];
  100313. if (within708TextBlock(b)) {
  100314. i2 = this.handleText(i2, service, {
  100315. isExtended: true
  100316. });
  100317. }
  100318. return i2;
  100319. };
  100320. Cea708Stream.prototype.getPts = function(byteIndex) {
  100321. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  100322. };
  100323. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  100324. var serviceName = "SERVICE" + serviceNum;
  100325. var self2 = this;
  100326. var serviceName;
  100327. var encoding;
  100328. if (serviceName in this.serviceEncodings) {
  100329. encoding = this.serviceEncodings[serviceName];
  100330. }
  100331. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  100332. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  100333. self2.flushDisplayed(pts, self2.services[serviceNum]);
  100334. });
  100335. return this.services[serviceNum];
  100336. };
  100337. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  100338. var isExtended = options2 && options2.isExtended;
  100339. var isMultiByte = options2 && options2.isMultiByte;
  100340. var packetData = this.current708Packet.data;
  100341. var extended = isExtended ? 4096 : 0;
  100342. var currentByte = packetData[i2];
  100343. var nextByte = packetData[i2 + 1];
  100344. var win3 = service.currentWindow;
  100345. var _char;
  100346. var charCodeArray;
  100347. if (service.textDecoder_ && !isExtended) {
  100348. if (isMultiByte) {
  100349. charCodeArray = [currentByte, nextByte];
  100350. i2++;
  100351. } else {
  100352. charCodeArray = [currentByte];
  100353. }
  100354. _char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  100355. } else {
  100356. _char = get708CharFromCode(extended | currentByte);
  100357. }
  100358. if (win3.pendingNewLine && !win3.isEmpty()) {
  100359. win3.newLine(this.getPts(i2));
  100360. }
  100361. win3.pendingNewLine = false;
  100362. win3.addText(_char);
  100363. return i2;
  100364. };
  100365. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  100366. var packetData = this.current708Packet.data;
  100367. var firstByte = packetData[i2 + 1];
  100368. var secondByte = packetData[i2 + 2];
  100369. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  100370. i2 = this.handleText(++i2, service, {
  100371. isMultiByte: true
  100372. });
  100373. }
  100374. return i2;
  100375. };
  100376. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  100377. var packetData = this.current708Packet.data;
  100378. var b = packetData[i2];
  100379. var windowNum = b & 7;
  100380. service.setCurrentWindow(windowNum);
  100381. return i2;
  100382. };
  100383. Cea708Stream.prototype.defineWindow = function(i2, service) {
  100384. var packetData = this.current708Packet.data;
  100385. var b = packetData[i2];
  100386. var windowNum = b & 7;
  100387. service.setCurrentWindow(windowNum);
  100388. var win3 = service.currentWindow;
  100389. b = packetData[++i2];
  100390. win3.visible = (b & 32) >> 5;
  100391. win3.rowLock = (b & 16) >> 4;
  100392. win3.columnLock = (b & 8) >> 3;
  100393. win3.priority = b & 7;
  100394. b = packetData[++i2];
  100395. win3.relativePositioning = (b & 128) >> 7;
  100396. win3.anchorVertical = b & 127;
  100397. b = packetData[++i2];
  100398. win3.anchorHorizontal = b;
  100399. b = packetData[++i2];
  100400. win3.anchorPoint = (b & 240) >> 4;
  100401. win3.rowCount = b & 15;
  100402. b = packetData[++i2];
  100403. win3.columnCount = b & 63;
  100404. b = packetData[++i2];
  100405. win3.windowStyle = (b & 56) >> 3;
  100406. win3.penStyle = b & 7;
  100407. win3.virtualRowCount = win3.rowCount + 1;
  100408. return i2;
  100409. };
  100410. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  100411. var packetData = this.current708Packet.data;
  100412. var b = packetData[i2];
  100413. var winAttr = service.currentWindow.winAttr;
  100414. b = packetData[++i2];
  100415. winAttr.fillOpacity = (b & 192) >> 6;
  100416. winAttr.fillRed = (b & 48) >> 4;
  100417. winAttr.fillGreen = (b & 12) >> 2;
  100418. winAttr.fillBlue = b & 3;
  100419. b = packetData[++i2];
  100420. winAttr.borderType = (b & 192) >> 6;
  100421. winAttr.borderRed = (b & 48) >> 4;
  100422. winAttr.borderGreen = (b & 12) >> 2;
  100423. winAttr.borderBlue = b & 3;
  100424. b = packetData[++i2];
  100425. winAttr.borderType += (b & 128) >> 5;
  100426. winAttr.wordWrap = (b & 64) >> 6;
  100427. winAttr.printDirection = (b & 48) >> 4;
  100428. winAttr.scrollDirection = (b & 12) >> 2;
  100429. winAttr.justify = b & 3;
  100430. b = packetData[++i2];
  100431. winAttr.effectSpeed = (b & 240) >> 4;
  100432. winAttr.effectDirection = (b & 12) >> 2;
  100433. winAttr.displayEffect = b & 3;
  100434. return i2;
  100435. };
  100436. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  100437. var displayedText = [];
  100438. for (var winId = 0; winId < 8; winId++) {
  100439. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  100440. displayedText.push(service.windows[winId].getText());
  100441. }
  100442. }
  100443. service.endPts = pts;
  100444. service.text = displayedText.join("\n\n");
  100445. this.pushCaption(service);
  100446. service.startPts = pts;
  100447. };
  100448. Cea708Stream.prototype.pushCaption = function(service) {
  100449. if (service.text !== "") {
  100450. this.trigger("data", {
  100451. startPts: service.startPts,
  100452. endPts: service.endPts,
  100453. text: service.text,
  100454. stream: "cc708_" + service.serviceNum
  100455. });
  100456. service.text = "";
  100457. service.startPts = service.endPts;
  100458. }
  100459. };
  100460. Cea708Stream.prototype.displayWindows = function(i2, service) {
  100461. var packetData = this.current708Packet.data;
  100462. var b = packetData[++i2];
  100463. var pts = this.getPts(i2);
  100464. this.flushDisplayed(pts, service);
  100465. for (var winId = 0; winId < 8; winId++) {
  100466. if (b & 1 << winId) {
  100467. service.windows[winId].visible = 1;
  100468. }
  100469. }
  100470. return i2;
  100471. };
  100472. Cea708Stream.prototype.hideWindows = function(i2, service) {
  100473. var packetData = this.current708Packet.data;
  100474. var b = packetData[++i2];
  100475. var pts = this.getPts(i2);
  100476. this.flushDisplayed(pts, service);
  100477. for (var winId = 0; winId < 8; winId++) {
  100478. if (b & 1 << winId) {
  100479. service.windows[winId].visible = 0;
  100480. }
  100481. }
  100482. return i2;
  100483. };
  100484. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  100485. var packetData = this.current708Packet.data;
  100486. var b = packetData[++i2];
  100487. var pts = this.getPts(i2);
  100488. this.flushDisplayed(pts, service);
  100489. for (var winId = 0; winId < 8; winId++) {
  100490. if (b & 1 << winId) {
  100491. service.windows[winId].visible ^= 1;
  100492. }
  100493. }
  100494. return i2;
  100495. };
  100496. Cea708Stream.prototype.clearWindows = function(i2, service) {
  100497. var packetData = this.current708Packet.data;
  100498. var b = packetData[++i2];
  100499. var pts = this.getPts(i2);
  100500. this.flushDisplayed(pts, service);
  100501. for (var winId = 0; winId < 8; winId++) {
  100502. if (b & 1 << winId) {
  100503. service.windows[winId].clearText();
  100504. }
  100505. }
  100506. return i2;
  100507. };
  100508. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  100509. var packetData = this.current708Packet.data;
  100510. var b = packetData[++i2];
  100511. var pts = this.getPts(i2);
  100512. this.flushDisplayed(pts, service);
  100513. for (var winId = 0; winId < 8; winId++) {
  100514. if (b & 1 << winId) {
  100515. service.windows[winId].reset();
  100516. }
  100517. }
  100518. return i2;
  100519. };
  100520. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  100521. var packetData = this.current708Packet.data;
  100522. var b = packetData[i2];
  100523. var penAttr = service.currentWindow.penAttr;
  100524. b = packetData[++i2];
  100525. penAttr.textTag = (b & 240) >> 4;
  100526. penAttr.offset = (b & 12) >> 2;
  100527. penAttr.penSize = b & 3;
  100528. b = packetData[++i2];
  100529. penAttr.italics = (b & 128) >> 7;
  100530. penAttr.underline = (b & 64) >> 6;
  100531. penAttr.edgeType = (b & 56) >> 3;
  100532. penAttr.fontStyle = b & 7;
  100533. return i2;
  100534. };
  100535. Cea708Stream.prototype.setPenColor = function(i2, service) {
  100536. var packetData = this.current708Packet.data;
  100537. var b = packetData[i2];
  100538. var penColor = service.currentWindow.penColor;
  100539. b = packetData[++i2];
  100540. penColor.fgOpacity = (b & 192) >> 6;
  100541. penColor.fgRed = (b & 48) >> 4;
  100542. penColor.fgGreen = (b & 12) >> 2;
  100543. penColor.fgBlue = b & 3;
  100544. b = packetData[++i2];
  100545. penColor.bgOpacity = (b & 192) >> 6;
  100546. penColor.bgRed = (b & 48) >> 4;
  100547. penColor.bgGreen = (b & 12) >> 2;
  100548. penColor.bgBlue = b & 3;
  100549. b = packetData[++i2];
  100550. penColor.edgeRed = (b & 48) >> 4;
  100551. penColor.edgeGreen = (b & 12) >> 2;
  100552. penColor.edgeBlue = b & 3;
  100553. return i2;
  100554. };
  100555. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  100556. var packetData = this.current708Packet.data;
  100557. var b = packetData[i2];
  100558. var penLoc = service.currentWindow.penLoc;
  100559. service.currentWindow.pendingNewLine = true;
  100560. b = packetData[++i2];
  100561. penLoc.row = b & 15;
  100562. b = packetData[++i2];
  100563. penLoc.column = b & 63;
  100564. return i2;
  100565. };
  100566. Cea708Stream.prototype.reset = function(i2, service) {
  100567. var pts = this.getPts(i2);
  100568. this.flushDisplayed(pts, service);
  100569. return this.initService(service.serviceNum, i2);
  100570. };
  100571. var CHARACTER_TRANSLATION = {
  100572. 42: 225,
  100573. 92: 233,
  100574. 94: 237,
  100575. 95: 243,
  100576. 96: 250,
  100577. 123: 231,
  100578. 124: 247,
  100579. 125: 209,
  100580. 126: 241,
  100581. 127: 9608,
  100582. 304: 174,
  100583. 305: 176,
  100584. 306: 189,
  100585. 307: 191,
  100586. 308: 8482,
  100587. 309: 162,
  100588. 310: 163,
  100589. 311: 9834,
  100590. 312: 224,
  100591. 313: 160,
  100592. 314: 232,
  100593. 315: 226,
  100594. 316: 234,
  100595. 317: 238,
  100596. 318: 244,
  100597. 319: 251,
  100598. 544: 193,
  100599. 545: 201,
  100600. 546: 211,
  100601. 547: 218,
  100602. 548: 220,
  100603. 549: 252,
  100604. 550: 8216,
  100605. 551: 161,
  100606. 552: 42,
  100607. 553: 39,
  100608. 554: 8212,
  100609. 555: 169,
  100610. 556: 8480,
  100611. 557: 8226,
  100612. 558: 8220,
  100613. 559: 8221,
  100614. 560: 192,
  100615. 561: 194,
  100616. 562: 199,
  100617. 563: 200,
  100618. 564: 202,
  100619. 565: 203,
  100620. 566: 235,
  100621. 567: 206,
  100622. 568: 207,
  100623. 569: 239,
  100624. 570: 212,
  100625. 571: 217,
  100626. 572: 249,
  100627. 573: 219,
  100628. 574: 171,
  100629. 575: 187,
  100630. 800: 195,
  100631. 801: 227,
  100632. 802: 205,
  100633. 803: 204,
  100634. 804: 236,
  100635. 805: 210,
  100636. 806: 242,
  100637. 807: 213,
  100638. 808: 245,
  100639. 809: 123,
  100640. 810: 125,
  100641. 811: 92,
  100642. 812: 94,
  100643. 813: 95,
  100644. 814: 124,
  100645. 815: 126,
  100646. 816: 196,
  100647. 817: 228,
  100648. 818: 214,
  100649. 819: 246,
  100650. 820: 223,
  100651. 821: 165,
  100652. 822: 164,
  100653. 823: 9474,
  100654. 824: 197,
  100655. 825: 229,
  100656. 826: 216,
  100657. 827: 248,
  100658. 828: 9484,
  100659. 829: 9488,
  100660. 830: 9492,
  100661. 831: 9496
  100662. };
  100663. var getCharFromCode = function getCharFromCode2(code) {
  100664. if (code === null) {
  100665. return "";
  100666. }
  100667. code = CHARACTER_TRANSLATION[code] || code;
  100668. return String.fromCharCode(code);
  100669. };
  100670. var BOTTOM_ROW = 14;
  100671. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  100672. var createDisplayBuffer = function createDisplayBuffer2() {
  100673. var result = [], i2 = BOTTOM_ROW + 1;
  100674. while (i2--) {
  100675. result.push("");
  100676. }
  100677. return result;
  100678. };
  100679. var Cea608Stream = function Cea608Stream2(field, dataChannel) {
  100680. Cea608Stream2.prototype.init.call(this);
  100681. this.field_ = field || 0;
  100682. this.dataChannel_ = dataChannel || 0;
  100683. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  100684. this.setConstants();
  100685. this.reset();
  100686. this.push = function(packet) {
  100687. var data, swap, char0, char1, text;
  100688. data = packet.ccData & 32639;
  100689. if (data === this.lastControlCode_) {
  100690. this.lastControlCode_ = null;
  100691. return;
  100692. }
  100693. if ((data & 61440) === 4096) {
  100694. this.lastControlCode_ = data;
  100695. } else if (data !== this.PADDING_) {
  100696. this.lastControlCode_ = null;
  100697. }
  100698. char0 = data >>> 8;
  100699. char1 = data & 255;
  100700. if (data === this.PADDING_) {
  100701. return;
  100702. } else if (data === this.RESUME_CAPTION_LOADING_) {
  100703. this.mode_ = "popOn";
  100704. } else if (data === this.END_OF_CAPTION_) {
  100705. this.mode_ = "popOn";
  100706. this.clearFormatting(packet.pts);
  100707. this.flushDisplayed(packet.pts);
  100708. swap = this.displayed_;
  100709. this.displayed_ = this.nonDisplayed_;
  100710. this.nonDisplayed_ = swap;
  100711. this.startPts_ = packet.pts;
  100712. } else if (data === this.ROLL_UP_2_ROWS_) {
  100713. this.rollUpRows_ = 2;
  100714. this.setRollUp(packet.pts);
  100715. } else if (data === this.ROLL_UP_3_ROWS_) {
  100716. this.rollUpRows_ = 3;
  100717. this.setRollUp(packet.pts);
  100718. } else if (data === this.ROLL_UP_4_ROWS_) {
  100719. this.rollUpRows_ = 4;
  100720. this.setRollUp(packet.pts);
  100721. } else if (data === this.CARRIAGE_RETURN_) {
  100722. this.clearFormatting(packet.pts);
  100723. this.flushDisplayed(packet.pts);
  100724. this.shiftRowsUp_();
  100725. this.startPts_ = packet.pts;
  100726. } else if (data === this.BACKSPACE_) {
  100727. if (this.mode_ === "popOn") {
  100728. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100729. } else {
  100730. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100731. }
  100732. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  100733. this.flushDisplayed(packet.pts);
  100734. this.displayed_ = createDisplayBuffer();
  100735. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  100736. this.nonDisplayed_ = createDisplayBuffer();
  100737. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  100738. if (this.mode_ !== "paintOn") {
  100739. this.flushDisplayed(packet.pts);
  100740. this.displayed_ = createDisplayBuffer();
  100741. }
  100742. this.mode_ = "paintOn";
  100743. this.startPts_ = packet.pts;
  100744. } else if (this.isSpecialCharacter(char0, char1)) {
  100745. char0 = (char0 & 3) << 8;
  100746. text = getCharFromCode(char0 | char1);
  100747. this[this.mode_](packet.pts, text);
  100748. this.column_++;
  100749. } else if (this.isExtCharacter(char0, char1)) {
  100750. if (this.mode_ === "popOn") {
  100751. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100752. } else {
  100753. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100754. }
  100755. char0 = (char0 & 3) << 8;
  100756. text = getCharFromCode(char0 | char1);
  100757. this[this.mode_](packet.pts, text);
  100758. this.column_++;
  100759. } else if (this.isMidRowCode(char0, char1)) {
  100760. this.clearFormatting(packet.pts);
  100761. this[this.mode_](packet.pts, " ");
  100762. this.column_++;
  100763. if ((char1 & 14) === 14) {
  100764. this.addFormatting(packet.pts, ["i"]);
  100765. }
  100766. if ((char1 & 1) === 1) {
  100767. this.addFormatting(packet.pts, ["u"]);
  100768. }
  100769. } else if (this.isOffsetControlCode(char0, char1)) {
  100770. this.column_ += char1 & 3;
  100771. } else if (this.isPAC(char0, char1)) {
  100772. var row = ROWS.indexOf(data & 7968);
  100773. if (this.mode_ === "rollUp") {
  100774. if (row - this.rollUpRows_ + 1 < 0) {
  100775. row = this.rollUpRows_ - 1;
  100776. }
  100777. this.setRollUp(packet.pts, row);
  100778. }
  100779. if (row !== this.row_) {
  100780. this.clearFormatting(packet.pts);
  100781. this.row_ = row;
  100782. }
  100783. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  100784. this.addFormatting(packet.pts, ["u"]);
  100785. }
  100786. if ((data & 16) === 16) {
  100787. this.column_ = ((data & 14) >> 1) * 4;
  100788. }
  100789. if (this.isColorPAC(char1)) {
  100790. if ((char1 & 14) === 14) {
  100791. this.addFormatting(packet.pts, ["i"]);
  100792. }
  100793. }
  100794. } else if (this.isNormalChar(char0)) {
  100795. if (char1 === 0) {
  100796. char1 = null;
  100797. }
  100798. text = getCharFromCode(char0);
  100799. text += getCharFromCode(char1);
  100800. this[this.mode_](packet.pts, text);
  100801. this.column_ += text.length;
  100802. }
  100803. };
  100804. };
  100805. Cea608Stream.prototype = new stream();
  100806. Cea608Stream.prototype.flushDisplayed = function(pts) {
  100807. var content = this.displayed_.map(function(row, index2) {
  100808. try {
  100809. return row.trim();
  100810. } catch (e) {
  100811. this.trigger("log", {
  100812. level: "warn",
  100813. message: "Skipping a malformed 608 caption at index " + index2 + "."
  100814. });
  100815. return "";
  100816. }
  100817. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  100818. if (content.length) {
  100819. this.trigger("data", {
  100820. startPts: this.startPts_,
  100821. endPts: pts,
  100822. text: content,
  100823. stream: this.name_
  100824. });
  100825. }
  100826. };
  100827. Cea608Stream.prototype.reset = function() {
  100828. this.mode_ = "popOn";
  100829. this.topRow_ = 0;
  100830. this.startPts_ = 0;
  100831. this.displayed_ = createDisplayBuffer();
  100832. this.nonDisplayed_ = createDisplayBuffer();
  100833. this.lastControlCode_ = null;
  100834. this.column_ = 0;
  100835. this.row_ = BOTTOM_ROW;
  100836. this.rollUpRows_ = 2;
  100837. this.formatting_ = [];
  100838. };
  100839. Cea608Stream.prototype.setConstants = function() {
  100840. if (this.dataChannel_ === 0) {
  100841. this.BASE_ = 16;
  100842. this.EXT_ = 17;
  100843. this.CONTROL_ = (20 | this.field_) << 8;
  100844. this.OFFSET_ = 23;
  100845. } else if (this.dataChannel_ === 1) {
  100846. this.BASE_ = 24;
  100847. this.EXT_ = 25;
  100848. this.CONTROL_ = (28 | this.field_) << 8;
  100849. this.OFFSET_ = 31;
  100850. }
  100851. this.PADDING_ = 0;
  100852. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  100853. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  100854. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  100855. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  100856. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  100857. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  100858. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  100859. this.BACKSPACE_ = this.CONTROL_ | 33;
  100860. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  100861. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  100862. };
  100863. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  100864. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  100865. };
  100866. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  100867. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  100868. };
  100869. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  100870. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  100871. };
  100872. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  100873. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  100874. };
  100875. Cea608Stream.prototype.isPAC = function(char0, char1) {
  100876. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  100877. };
  100878. Cea608Stream.prototype.isColorPAC = function(char1) {
  100879. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  100880. };
  100881. Cea608Stream.prototype.isNormalChar = function(_char2) {
  100882. return _char2 >= 32 && _char2 <= 127;
  100883. };
  100884. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  100885. if (this.mode_ !== "rollUp") {
  100886. this.row_ = BOTTOM_ROW;
  100887. this.mode_ = "rollUp";
  100888. this.flushDisplayed(pts);
  100889. this.nonDisplayed_ = createDisplayBuffer();
  100890. this.displayed_ = createDisplayBuffer();
  100891. }
  100892. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  100893. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  100894. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  100895. this.displayed_[this.row_ - i2] = "";
  100896. }
  100897. }
  100898. if (newBaseRow === void 0) {
  100899. newBaseRow = this.row_;
  100900. }
  100901. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  100902. };
  100903. Cea608Stream.prototype.addFormatting = function(pts, format) {
  100904. this.formatting_ = this.formatting_.concat(format);
  100905. var text = format.reduce(function(text2, format2) {
  100906. return text2 + "<" + format2 + ">";
  100907. }, "");
  100908. this[this.mode_](pts, text);
  100909. };
  100910. Cea608Stream.prototype.clearFormatting = function(pts) {
  100911. if (!this.formatting_.length) {
  100912. return;
  100913. }
  100914. var text = this.formatting_.reverse().reduce(function(text2, format) {
  100915. return text2 + "</" + format + ">";
  100916. }, "");
  100917. this.formatting_ = [];
  100918. this[this.mode_](pts, text);
  100919. };
  100920. Cea608Stream.prototype.popOn = function(pts, text) {
  100921. var baseRow = this.nonDisplayed_[this.row_];
  100922. baseRow += text;
  100923. this.nonDisplayed_[this.row_] = baseRow;
  100924. };
  100925. Cea608Stream.prototype.rollUp = function(pts, text) {
  100926. var baseRow = this.displayed_[this.row_];
  100927. baseRow += text;
  100928. this.displayed_[this.row_] = baseRow;
  100929. };
  100930. Cea608Stream.prototype.shiftRowsUp_ = function() {
  100931. var i2;
  100932. for (i2 = 0; i2 < this.topRow_; i2++) {
  100933. this.displayed_[i2] = "";
  100934. }
  100935. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  100936. this.displayed_[i2] = "";
  100937. }
  100938. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  100939. this.displayed_[i2] = this.displayed_[i2 + 1];
  100940. }
  100941. this.displayed_[this.row_] = "";
  100942. };
  100943. Cea608Stream.prototype.paintOn = function(pts, text) {
  100944. var baseRow = this.displayed_[this.row_];
  100945. baseRow += text;
  100946. this.displayed_[this.row_] = baseRow;
  100947. };
  100948. var captionStream = {
  100949. CaptionStream: CaptionStream$1,
  100950. Cea608Stream,
  100951. Cea708Stream
  100952. };
  100953. var streamTypes = {
  100954. H264_STREAM_TYPE: 27,
  100955. ADTS_STREAM_TYPE: 15,
  100956. METADATA_STREAM_TYPE: 21
  100957. };
  100958. var MAX_TS = 8589934592;
  100959. var RO_THRESH = 4294967296;
  100960. var TYPE_SHARED = "shared";
  100961. var handleRollover$1 = function handleRollover2(value, reference) {
  100962. var direction = 1;
  100963. if (value > reference) {
  100964. direction = -1;
  100965. }
  100966. while (Math.abs(reference - value) > RO_THRESH) {
  100967. value += direction * MAX_TS;
  100968. }
  100969. return value;
  100970. };
  100971. var TimestampRolloverStream$1 = function TimestampRolloverStream2(type3) {
  100972. var lastDTS, referenceDTS;
  100973. TimestampRolloverStream2.prototype.init.call(this);
  100974. this.type_ = type3 || TYPE_SHARED;
  100975. this.push = function(data) {
  100976. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  100977. return;
  100978. }
  100979. if (referenceDTS === void 0) {
  100980. referenceDTS = data.dts;
  100981. }
  100982. data.dts = handleRollover$1(data.dts, referenceDTS);
  100983. data.pts = handleRollover$1(data.pts, referenceDTS);
  100984. lastDTS = data.dts;
  100985. this.trigger("data", data);
  100986. };
  100987. this.flush = function() {
  100988. referenceDTS = lastDTS;
  100989. this.trigger("done");
  100990. };
  100991. this.endTimeline = function() {
  100992. this.flush();
  100993. this.trigger("endedtimeline");
  100994. };
  100995. this.discontinuity = function() {
  100996. referenceDTS = void 0;
  100997. lastDTS = void 0;
  100998. };
  100999. this.reset = function() {
  101000. this.discontinuity();
  101001. this.trigger("reset");
  101002. };
  101003. };
  101004. TimestampRolloverStream$1.prototype = new stream();
  101005. var timestampRolloverStream = {
  101006. TimestampRolloverStream: TimestampRolloverStream$1,
  101007. handleRollover: handleRollover$1
  101008. };
  101009. var percentEncode$1 = function percentEncode2(bytes, start2, end) {
  101010. var i2, result = "";
  101011. for (i2 = start2; i2 < end; i2++) {
  101012. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  101013. }
  101014. return result;
  101015. }, parseUtf8 = function parseUtf82(bytes, start2, end) {
  101016. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  101017. }, parseIso88591$1 = function parseIso885912(bytes, start2, end) {
  101018. return unescape(percentEncode$1(bytes, start2, end));
  101019. }, parseSyncSafeInteger$1 = function parseSyncSafeInteger2(data) {
  101020. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  101021. }, tagParsers = {
  101022. TXXX: function TXXX(tag) {
  101023. var i2;
  101024. if (tag.data[0] !== 3) {
  101025. return;
  101026. }
  101027. for (i2 = 1; i2 < tag.data.length; i2++) {
  101028. if (tag.data[i2] === 0) {
  101029. tag.description = parseUtf8(tag.data, 1, i2);
  101030. tag.value = parseUtf8(tag.data, i2 + 1, tag.data.length).replace(/\0*$/, "");
  101031. break;
  101032. }
  101033. }
  101034. tag.data = tag.value;
  101035. },
  101036. WXXX: function WXXX(tag) {
  101037. var i2;
  101038. if (tag.data[0] !== 3) {
  101039. return;
  101040. }
  101041. for (i2 = 1; i2 < tag.data.length; i2++) {
  101042. if (tag.data[i2] === 0) {
  101043. tag.description = parseUtf8(tag.data, 1, i2);
  101044. tag.url = parseUtf8(tag.data, i2 + 1, tag.data.length);
  101045. break;
  101046. }
  101047. }
  101048. },
  101049. PRIV: function PRIV(tag) {
  101050. var i2;
  101051. for (i2 = 0; i2 < tag.data.length; i2++) {
  101052. if (tag.data[i2] === 0) {
  101053. tag.owner = parseIso88591$1(tag.data, 0, i2);
  101054. break;
  101055. }
  101056. }
  101057. tag.privateData = tag.data.subarray(i2 + 1);
  101058. tag.data = tag.privateData;
  101059. }
  101060. }, _MetadataStream;
  101061. _MetadataStream = function MetadataStream(options2) {
  101062. var settings = {
  101063. descriptor: options2 && options2.descriptor
  101064. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  101065. _MetadataStream.prototype.init.call(this);
  101066. this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);
  101067. if (settings.descriptor) {
  101068. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  101069. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  101070. }
  101071. }
  101072. this.push = function(chunk) {
  101073. var tag, frameStart, frameSize, frame, i3, frameHeader;
  101074. if (chunk.type !== "timed-metadata") {
  101075. return;
  101076. }
  101077. if (chunk.dataAlignmentIndicator) {
  101078. bufferSize = 0;
  101079. buffer.length = 0;
  101080. }
  101081. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  101082. this.trigger("log", {
  101083. level: "warn",
  101084. message: "Skipping unrecognized metadata packet"
  101085. });
  101086. return;
  101087. }
  101088. buffer.push(chunk);
  101089. bufferSize += chunk.data.byteLength;
  101090. if (buffer.length === 1) {
  101091. tagSize = parseSyncSafeInteger$1(chunk.data.subarray(6, 10));
  101092. tagSize += 10;
  101093. }
  101094. if (bufferSize < tagSize) {
  101095. return;
  101096. }
  101097. tag = {
  101098. data: new Uint8Array(tagSize),
  101099. frames: [],
  101100. pts: buffer[0].pts,
  101101. dts: buffer[0].dts
  101102. };
  101103. for (i3 = 0; i3 < tagSize; ) {
  101104. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  101105. i3 += buffer[0].data.byteLength;
  101106. bufferSize -= buffer[0].data.byteLength;
  101107. buffer.shift();
  101108. }
  101109. frameStart = 10;
  101110. if (tag.data[5] & 64) {
  101111. frameStart += 4;
  101112. frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14));
  101113. tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20));
  101114. }
  101115. do {
  101116. frameSize = parseSyncSafeInteger$1(tag.data.subarray(frameStart + 4, frameStart + 8));
  101117. if (frameSize < 1) {
  101118. this.trigger("log", {
  101119. level: "warn",
  101120. message: "Malformed ID3 frame encountered. Skipping metadata parsing."
  101121. });
  101122. return;
  101123. }
  101124. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  101125. frame = {
  101126. id: frameHeader,
  101127. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  101128. };
  101129. frame.key = frame.id;
  101130. if (tagParsers[frame.id]) {
  101131. tagParsers[frame.id](frame);
  101132. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  101133. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  101134. size *= 4;
  101135. size += d2[7] & 3;
  101136. frame.timeStamp = size;
  101137. if (tag.pts === void 0 && tag.dts === void 0) {
  101138. tag.pts = frame.timeStamp;
  101139. tag.dts = frame.timeStamp;
  101140. }
  101141. this.trigger("timestamp", frame);
  101142. }
  101143. }
  101144. tag.frames.push(frame);
  101145. frameStart += 10;
  101146. frameStart += frameSize;
  101147. } while (frameStart < tagSize);
  101148. this.trigger("data", tag);
  101149. };
  101150. };
  101151. _MetadataStream.prototype = new stream();
  101152. var metadataStream = _MetadataStream;
  101153. var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  101154. var _TransportPacketStream, _TransportParseStream, _ElementaryStream;
  101155. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  101156. _TransportPacketStream = function TransportPacketStream() {
  101157. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  101158. _TransportPacketStream.prototype.init.call(this);
  101159. this.push = function(bytes) {
  101160. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  101161. if (bytesInBuffer) {
  101162. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  101163. everything.set(buffer.subarray(0, bytesInBuffer));
  101164. everything.set(bytes, bytesInBuffer);
  101165. bytesInBuffer = 0;
  101166. } else {
  101167. everything = bytes;
  101168. }
  101169. while (endIndex < everything.byteLength) {
  101170. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  101171. this.trigger("data", everything.subarray(startIndex, endIndex));
  101172. startIndex += MP2T_PACKET_LENGTH$1;
  101173. endIndex += MP2T_PACKET_LENGTH$1;
  101174. continue;
  101175. }
  101176. startIndex++;
  101177. endIndex++;
  101178. }
  101179. if (startIndex < everything.byteLength) {
  101180. buffer.set(everything.subarray(startIndex), 0);
  101181. bytesInBuffer = everything.byteLength - startIndex;
  101182. }
  101183. };
  101184. this.flush = function() {
  101185. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  101186. this.trigger("data", buffer);
  101187. bytesInBuffer = 0;
  101188. }
  101189. this.trigger("done");
  101190. };
  101191. this.endTimeline = function() {
  101192. this.flush();
  101193. this.trigger("endedtimeline");
  101194. };
  101195. this.reset = function() {
  101196. bytesInBuffer = 0;
  101197. this.trigger("reset");
  101198. };
  101199. };
  101200. _TransportPacketStream.prototype = new stream();
  101201. _TransportParseStream = function TransportParseStream() {
  101202. var parsePsi, parsePat2, parsePmt2, self2;
  101203. _TransportParseStream.prototype.init.call(this);
  101204. self2 = this;
  101205. this.packetsWaitingForPmt = [];
  101206. this.programMapTable = void 0;
  101207. parsePsi = function parsePsi2(payload, psi) {
  101208. var offset = 0;
  101209. if (psi.payloadUnitStartIndicator) {
  101210. offset += payload[offset] + 1;
  101211. }
  101212. if (psi.type === "pat") {
  101213. parsePat2(payload.subarray(offset), psi);
  101214. } else {
  101215. parsePmt2(payload.subarray(offset), psi);
  101216. }
  101217. };
  101218. parsePat2 = function parsePat3(payload, pat) {
  101219. pat.section_number = payload[7];
  101220. pat.last_section_number = payload[8];
  101221. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  101222. pat.pmtPid = self2.pmtPid;
  101223. };
  101224. parsePmt2 = function parsePmt3(payload, pmt) {
  101225. var sectionLength, tableEnd, programInfoLength, offset;
  101226. if (!(payload[5] & 1)) {
  101227. return;
  101228. }
  101229. self2.programMapTable = {
  101230. video: null,
  101231. audio: null,
  101232. "timed-metadata": {}
  101233. };
  101234. sectionLength = (payload[1] & 15) << 8 | payload[2];
  101235. tableEnd = 3 + sectionLength - 4;
  101236. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  101237. offset = 12 + programInfoLength;
  101238. while (offset < tableEnd) {
  101239. var streamType = payload[offset];
  101240. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  101241. if (streamType === streamTypes.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  101242. self2.programMapTable.video = pid;
  101243. } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  101244. self2.programMapTable.audio = pid;
  101245. } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {
  101246. self2.programMapTable["timed-metadata"][pid] = streamType;
  101247. }
  101248. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  101249. }
  101250. pmt.programMapTable = self2.programMapTable;
  101251. };
  101252. this.push = function(packet) {
  101253. var result = {}, offset = 4;
  101254. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  101255. result.pid = packet[1] & 31;
  101256. result.pid <<= 8;
  101257. result.pid |= packet[2];
  101258. if ((packet[3] & 48) >>> 4 > 1) {
  101259. offset += packet[offset] + 1;
  101260. }
  101261. if (result.pid === 0) {
  101262. result.type = "pat";
  101263. parsePsi(packet.subarray(offset), result);
  101264. this.trigger("data", result);
  101265. } else if (result.pid === this.pmtPid) {
  101266. result.type = "pmt";
  101267. parsePsi(packet.subarray(offset), result);
  101268. this.trigger("data", result);
  101269. while (this.packetsWaitingForPmt.length) {
  101270. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  101271. }
  101272. } else if (this.programMapTable === void 0) {
  101273. this.packetsWaitingForPmt.push([packet, offset, result]);
  101274. } else {
  101275. this.processPes_(packet, offset, result);
  101276. }
  101277. };
  101278. this.processPes_ = function(packet, offset, result) {
  101279. if (result.pid === this.programMapTable.video) {
  101280. result.streamType = streamTypes.H264_STREAM_TYPE;
  101281. } else if (result.pid === this.programMapTable.audio) {
  101282. result.streamType = streamTypes.ADTS_STREAM_TYPE;
  101283. } else {
  101284. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  101285. }
  101286. result.type = "pes";
  101287. result.data = packet.subarray(offset);
  101288. this.trigger("data", result);
  101289. };
  101290. };
  101291. _TransportParseStream.prototype = new stream();
  101292. _TransportParseStream.STREAM_TYPES = {
  101293. h264: 27,
  101294. adts: 15
  101295. };
  101296. _ElementaryStream = function ElementaryStream() {
  101297. var self2 = this, segmentHadPmt = false, video = {
  101298. data: [],
  101299. size: 0
  101300. }, audio = {
  101301. data: [],
  101302. size: 0
  101303. }, timedMetadata = {
  101304. data: [],
  101305. size: 0
  101306. }, programMapTable, parsePes = function parsePes2(payload, pes) {
  101307. var ptsDtsFlags;
  101308. var startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  101309. pes.data = new Uint8Array();
  101310. if (startPrefix !== 1) {
  101311. return;
  101312. }
  101313. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  101314. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  101315. ptsDtsFlags = payload[7];
  101316. if (ptsDtsFlags & 192) {
  101317. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  101318. pes.pts *= 4;
  101319. pes.pts += (payload[13] & 6) >>> 1;
  101320. pes.dts = pes.pts;
  101321. if (ptsDtsFlags & 64) {
  101322. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  101323. pes.dts *= 4;
  101324. pes.dts += (payload[18] & 6) >>> 1;
  101325. }
  101326. }
  101327. pes.data = payload.subarray(9 + payload[8]);
  101328. }, flushStream = function flushStream2(stream2, type3, forceFlush) {
  101329. var packetData = new Uint8Array(stream2.size), event2 = {
  101330. type: type3
  101331. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  101332. if (!stream2.data.length || stream2.size < 9) {
  101333. return;
  101334. }
  101335. event2.trackId = stream2.data[0].pid;
  101336. for (i2 = 0; i2 < stream2.data.length; i2++) {
  101337. fragment = stream2.data[i2];
  101338. packetData.set(fragment.data, offset);
  101339. offset += fragment.data.byteLength;
  101340. }
  101341. parsePes(packetData, event2);
  101342. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  101343. if (forceFlush || packetFlushable) {
  101344. stream2.size = 0;
  101345. stream2.data.length = 0;
  101346. }
  101347. if (packetFlushable) {
  101348. self2.trigger("data", event2);
  101349. }
  101350. };
  101351. _ElementaryStream.prototype.init.call(this);
  101352. this.push = function(data) {
  101353. ({
  101354. pat: function pat() {
  101355. },
  101356. pes: function pes() {
  101357. var stream2, streamType;
  101358. switch (data.streamType) {
  101359. case streamTypes.H264_STREAM_TYPE:
  101360. stream2 = video;
  101361. streamType = "video";
  101362. break;
  101363. case streamTypes.ADTS_STREAM_TYPE:
  101364. stream2 = audio;
  101365. streamType = "audio";
  101366. break;
  101367. case streamTypes.METADATA_STREAM_TYPE:
  101368. stream2 = timedMetadata;
  101369. streamType = "timed-metadata";
  101370. break;
  101371. default:
  101372. return;
  101373. }
  101374. if (data.payloadUnitStartIndicator) {
  101375. flushStream(stream2, streamType, true);
  101376. }
  101377. stream2.data.push(data);
  101378. stream2.size += data.data.byteLength;
  101379. },
  101380. pmt: function pmt() {
  101381. var event2 = {
  101382. type: "metadata",
  101383. tracks: []
  101384. };
  101385. programMapTable = data.programMapTable;
  101386. if (programMapTable.video !== null) {
  101387. event2.tracks.push({
  101388. timelineStartInfo: {
  101389. baseMediaDecodeTime: 0
  101390. },
  101391. id: +programMapTable.video,
  101392. codec: "avc",
  101393. type: "video"
  101394. });
  101395. }
  101396. if (programMapTable.audio !== null) {
  101397. event2.tracks.push({
  101398. timelineStartInfo: {
  101399. baseMediaDecodeTime: 0
  101400. },
  101401. id: +programMapTable.audio,
  101402. codec: "adts",
  101403. type: "audio"
  101404. });
  101405. }
  101406. segmentHadPmt = true;
  101407. self2.trigger("data", event2);
  101408. }
  101409. })[data.type]();
  101410. };
  101411. this.reset = function() {
  101412. video.size = 0;
  101413. video.data.length = 0;
  101414. audio.size = 0;
  101415. audio.data.length = 0;
  101416. this.trigger("reset");
  101417. };
  101418. this.flushStreams_ = function() {
  101419. flushStream(video, "video");
  101420. flushStream(audio, "audio");
  101421. flushStream(timedMetadata, "timed-metadata");
  101422. };
  101423. this.flush = function() {
  101424. if (!segmentHadPmt && programMapTable) {
  101425. var pmt = {
  101426. type: "metadata",
  101427. tracks: []
  101428. };
  101429. if (programMapTable.video !== null) {
  101430. pmt.tracks.push({
  101431. timelineStartInfo: {
  101432. baseMediaDecodeTime: 0
  101433. },
  101434. id: +programMapTable.video,
  101435. codec: "avc",
  101436. type: "video"
  101437. });
  101438. }
  101439. if (programMapTable.audio !== null) {
  101440. pmt.tracks.push({
  101441. timelineStartInfo: {
  101442. baseMediaDecodeTime: 0
  101443. },
  101444. id: +programMapTable.audio,
  101445. codec: "adts",
  101446. type: "audio"
  101447. });
  101448. }
  101449. self2.trigger("data", pmt);
  101450. }
  101451. segmentHadPmt = false;
  101452. this.flushStreams_();
  101453. this.trigger("done");
  101454. };
  101455. };
  101456. _ElementaryStream.prototype = new stream();
  101457. var m2ts = {
  101458. PAT_PID: 0,
  101459. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  101460. TransportPacketStream: _TransportPacketStream,
  101461. TransportParseStream: _TransportParseStream,
  101462. ElementaryStream: _ElementaryStream,
  101463. TimestampRolloverStream,
  101464. CaptionStream: captionStream.CaptionStream,
  101465. Cea608Stream: captionStream.Cea608Stream,
  101466. Cea708Stream: captionStream.Cea708Stream,
  101467. MetadataStream: metadataStream
  101468. };
  101469. for (var type2 in streamTypes) {
  101470. if (streamTypes.hasOwnProperty(type2)) {
  101471. m2ts[type2] = streamTypes[type2];
  101472. }
  101473. }
  101474. var m2ts_1 = m2ts;
  101475. var ONE_SECOND_IN_TS$2 = clock2.ONE_SECOND_IN_TS;
  101476. var _AdtsStream;
  101477. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  101478. _AdtsStream = function AdtsStream(handlePartialSegments) {
  101479. var buffer, frameNum = 0;
  101480. _AdtsStream.prototype.init.call(this);
  101481. this.skipWarn_ = function(start2, end) {
  101482. this.trigger("log", {
  101483. level: "warn",
  101484. message: "adts skiping bytes " + start2 + " to " + end + " in frame " + frameNum + " outside syncword"
  101485. });
  101486. };
  101487. this.push = function(packet) {
  101488. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  101489. if (!handlePartialSegments) {
  101490. frameNum = 0;
  101491. }
  101492. if (packet.type !== "audio") {
  101493. return;
  101494. }
  101495. if (buffer && buffer.length) {
  101496. oldBuffer = buffer;
  101497. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  101498. buffer.set(oldBuffer);
  101499. buffer.set(packet.data, oldBuffer.byteLength);
  101500. } else {
  101501. buffer = packet.data;
  101502. }
  101503. var skip;
  101504. while (i2 + 7 < buffer.length) {
  101505. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  101506. if (typeof skip !== "number") {
  101507. skip = i2;
  101508. }
  101509. i2++;
  101510. continue;
  101511. }
  101512. if (typeof skip === "number") {
  101513. this.skipWarn_(skip, i2);
  101514. skip = null;
  101515. }
  101516. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  101517. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  101518. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  101519. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  101520. if (buffer.byteLength - i2 < frameLength) {
  101521. break;
  101522. }
  101523. this.trigger("data", {
  101524. pts: packet.pts + frameNum * adtsFrameDuration,
  101525. dts: packet.dts + frameNum * adtsFrameDuration,
  101526. sampleCount,
  101527. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  101528. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  101529. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  101530. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  101531. samplesize: 16,
  101532. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  101533. });
  101534. frameNum++;
  101535. i2 += frameLength;
  101536. }
  101537. if (typeof skip === "number") {
  101538. this.skipWarn_(skip, i2);
  101539. skip = null;
  101540. }
  101541. buffer = buffer.subarray(i2);
  101542. };
  101543. this.flush = function() {
  101544. frameNum = 0;
  101545. this.trigger("done");
  101546. };
  101547. this.reset = function() {
  101548. buffer = void 0;
  101549. this.trigger("reset");
  101550. };
  101551. this.endTimeline = function() {
  101552. buffer = void 0;
  101553. this.trigger("endedtimeline");
  101554. };
  101555. };
  101556. _AdtsStream.prototype = new stream();
  101557. var adts = _AdtsStream;
  101558. var ExpGolomb;
  101559. ExpGolomb = function ExpGolomb2(workingData) {
  101560. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  101561. this.length = function() {
  101562. return 8 * workingBytesAvailable;
  101563. };
  101564. this.bitsAvailable = function() {
  101565. return 8 * workingBytesAvailable + workingBitsAvailable;
  101566. };
  101567. this.loadWord = function() {
  101568. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  101569. if (availableBytes === 0) {
  101570. throw new Error("no bytes available");
  101571. }
  101572. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  101573. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  101574. workingBitsAvailable = availableBytes * 8;
  101575. workingBytesAvailable -= availableBytes;
  101576. };
  101577. this.skipBits = function(count) {
  101578. var skipBytes;
  101579. if (workingBitsAvailable > count) {
  101580. workingWord <<= count;
  101581. workingBitsAvailable -= count;
  101582. } else {
  101583. count -= workingBitsAvailable;
  101584. skipBytes = Math.floor(count / 8);
  101585. count -= skipBytes * 8;
  101586. workingBytesAvailable -= skipBytes;
  101587. this.loadWord();
  101588. workingWord <<= count;
  101589. workingBitsAvailable -= count;
  101590. }
  101591. };
  101592. this.readBits = function(size) {
  101593. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  101594. workingBitsAvailable -= bits;
  101595. if (workingBitsAvailable > 0) {
  101596. workingWord <<= bits;
  101597. } else if (workingBytesAvailable > 0) {
  101598. this.loadWord();
  101599. }
  101600. bits = size - bits;
  101601. if (bits > 0) {
  101602. return valu << bits | this.readBits(bits);
  101603. }
  101604. return valu;
  101605. };
  101606. this.skipLeadingZeros = function() {
  101607. var leadingZeroCount;
  101608. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  101609. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  101610. workingWord <<= leadingZeroCount;
  101611. workingBitsAvailable -= leadingZeroCount;
  101612. return leadingZeroCount;
  101613. }
  101614. }
  101615. this.loadWord();
  101616. return leadingZeroCount + this.skipLeadingZeros();
  101617. };
  101618. this.skipUnsignedExpGolomb = function() {
  101619. this.skipBits(1 + this.skipLeadingZeros());
  101620. };
  101621. this.skipExpGolomb = function() {
  101622. this.skipBits(1 + this.skipLeadingZeros());
  101623. };
  101624. this.readUnsignedExpGolomb = function() {
  101625. var clz = this.skipLeadingZeros();
  101626. return this.readBits(clz + 1) - 1;
  101627. };
  101628. this.readExpGolomb = function() {
  101629. var valu = this.readUnsignedExpGolomb();
  101630. if (1 & valu) {
  101631. return 1 + valu >>> 1;
  101632. }
  101633. return -1 * (valu >>> 1);
  101634. };
  101635. this.readBoolean = function() {
  101636. return this.readBits(1) === 1;
  101637. };
  101638. this.readUnsignedByte = function() {
  101639. return this.readBits(8);
  101640. };
  101641. this.loadWord();
  101642. };
  101643. var expGolomb = ExpGolomb;
  101644. var _H264Stream, _NalByteStream;
  101645. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  101646. _NalByteStream = function NalByteStream() {
  101647. var syncPoint = 0, i2, buffer;
  101648. _NalByteStream.prototype.init.call(this);
  101649. this.push = function(data) {
  101650. var swapBuffer;
  101651. if (!buffer) {
  101652. buffer = data.data;
  101653. } else {
  101654. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  101655. swapBuffer.set(buffer);
  101656. swapBuffer.set(data.data, buffer.byteLength);
  101657. buffer = swapBuffer;
  101658. }
  101659. var len = buffer.byteLength;
  101660. for (; syncPoint < len - 3; syncPoint++) {
  101661. if (buffer[syncPoint + 2] === 1) {
  101662. i2 = syncPoint + 5;
  101663. break;
  101664. }
  101665. }
  101666. while (i2 < len) {
  101667. switch (buffer[i2]) {
  101668. case 0:
  101669. if (buffer[i2 - 1] !== 0) {
  101670. i2 += 2;
  101671. break;
  101672. } else if (buffer[i2 - 2] !== 0) {
  101673. i2++;
  101674. break;
  101675. }
  101676. if (syncPoint + 3 !== i2 - 2) {
  101677. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101678. }
  101679. do {
  101680. i2++;
  101681. } while (buffer[i2] !== 1 && i2 < len);
  101682. syncPoint = i2 - 2;
  101683. i2 += 3;
  101684. break;
  101685. case 1:
  101686. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  101687. i2 += 3;
  101688. break;
  101689. }
  101690. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101691. syncPoint = i2 - 2;
  101692. i2 += 3;
  101693. break;
  101694. default:
  101695. i2 += 3;
  101696. break;
  101697. }
  101698. }
  101699. buffer = buffer.subarray(syncPoint);
  101700. i2 -= syncPoint;
  101701. syncPoint = 0;
  101702. };
  101703. this.reset = function() {
  101704. buffer = null;
  101705. syncPoint = 0;
  101706. this.trigger("reset");
  101707. };
  101708. this.flush = function() {
  101709. if (buffer && buffer.byteLength > 3) {
  101710. this.trigger("data", buffer.subarray(syncPoint + 3));
  101711. }
  101712. buffer = null;
  101713. syncPoint = 0;
  101714. this.trigger("done");
  101715. };
  101716. this.endTimeline = function() {
  101717. this.flush();
  101718. this.trigger("endedtimeline");
  101719. };
  101720. };
  101721. _NalByteStream.prototype = new stream();
  101722. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  101723. 100: true,
  101724. 110: true,
  101725. 122: true,
  101726. 244: true,
  101727. 44: true,
  101728. 83: true,
  101729. 86: true,
  101730. 118: true,
  101731. 128: true,
  101732. 138: true,
  101733. 139: true,
  101734. 134: true
  101735. };
  101736. _H264Stream = function H264Stream2() {
  101737. var nalByteStream = new _NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  101738. _H264Stream.prototype.init.call(this);
  101739. self2 = this;
  101740. this.push = function(packet) {
  101741. if (packet.type !== "video") {
  101742. return;
  101743. }
  101744. trackId = packet.trackId;
  101745. currentPts = packet.pts;
  101746. currentDts = packet.dts;
  101747. nalByteStream.push(packet);
  101748. };
  101749. nalByteStream.on("data", function(data) {
  101750. var event2 = {
  101751. trackId,
  101752. pts: currentPts,
  101753. dts: currentDts,
  101754. data,
  101755. nalUnitTypeCode: data[0] & 31
  101756. };
  101757. switch (event2.nalUnitTypeCode) {
  101758. case 5:
  101759. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  101760. break;
  101761. case 6:
  101762. event2.nalUnitType = "sei_rbsp";
  101763. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101764. break;
  101765. case 7:
  101766. event2.nalUnitType = "seq_parameter_set_rbsp";
  101767. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101768. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  101769. break;
  101770. case 8:
  101771. event2.nalUnitType = "pic_parameter_set_rbsp";
  101772. break;
  101773. case 9:
  101774. event2.nalUnitType = "access_unit_delimiter_rbsp";
  101775. break;
  101776. }
  101777. self2.trigger("data", event2);
  101778. });
  101779. nalByteStream.on("done", function() {
  101780. self2.trigger("done");
  101781. });
  101782. nalByteStream.on("partialdone", function() {
  101783. self2.trigger("partialdone");
  101784. });
  101785. nalByteStream.on("reset", function() {
  101786. self2.trigger("reset");
  101787. });
  101788. nalByteStream.on("endedtimeline", function() {
  101789. self2.trigger("endedtimeline");
  101790. });
  101791. this.flush = function() {
  101792. nalByteStream.flush();
  101793. };
  101794. this.partialFlush = function() {
  101795. nalByteStream.partialFlush();
  101796. };
  101797. this.reset = function() {
  101798. nalByteStream.reset();
  101799. };
  101800. this.endTimeline = function() {
  101801. nalByteStream.endTimeline();
  101802. };
  101803. skipScalingList = function skipScalingList2(count, expGolombDecoder) {
  101804. var lastScale = 8, nextScale = 8, j, deltaScale;
  101805. for (j = 0; j < count; j++) {
  101806. if (nextScale !== 0) {
  101807. deltaScale = expGolombDecoder.readExpGolomb();
  101808. nextScale = (lastScale + deltaScale + 256) % 256;
  101809. }
  101810. lastScale = nextScale === 0 ? lastScale : nextScale;
  101811. }
  101812. };
  101813. discardEmulationPreventionBytes5 = function discardEmulationPreventionBytes6(data) {
  101814. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  101815. while (i2 < length - 2) {
  101816. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  101817. emulationPreventionBytesPositions.push(i2 + 2);
  101818. i2 += 2;
  101819. } else {
  101820. i2++;
  101821. }
  101822. }
  101823. if (emulationPreventionBytesPositions.length === 0) {
  101824. return data;
  101825. }
  101826. newLength = length - emulationPreventionBytesPositions.length;
  101827. newData = new Uint8Array(newLength);
  101828. var sourceIndex = 0;
  101829. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  101830. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  101831. sourceIndex++;
  101832. emulationPreventionBytesPositions.shift();
  101833. }
  101834. newData[i2] = data[sourceIndex];
  101835. }
  101836. return newData;
  101837. };
  101838. readSequenceParameterSet = function readSequenceParameterSet2(data) {
  101839. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  101840. expGolombDecoder = new expGolomb(data);
  101841. profileIdc = expGolombDecoder.readUnsignedByte();
  101842. profileCompatibility = expGolombDecoder.readUnsignedByte();
  101843. levelIdc = expGolombDecoder.readUnsignedByte();
  101844. expGolombDecoder.skipUnsignedExpGolomb();
  101845. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  101846. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  101847. if (chromaFormatIdc === 3) {
  101848. expGolombDecoder.skipBits(1);
  101849. }
  101850. expGolombDecoder.skipUnsignedExpGolomb();
  101851. expGolombDecoder.skipUnsignedExpGolomb();
  101852. expGolombDecoder.skipBits(1);
  101853. if (expGolombDecoder.readBoolean()) {
  101854. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  101855. for (i2 = 0; i2 < scalingListCount; i2++) {
  101856. if (expGolombDecoder.readBoolean()) {
  101857. if (i2 < 6) {
  101858. skipScalingList(16, expGolombDecoder);
  101859. } else {
  101860. skipScalingList(64, expGolombDecoder);
  101861. }
  101862. }
  101863. }
  101864. }
  101865. }
  101866. expGolombDecoder.skipUnsignedExpGolomb();
  101867. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  101868. if (picOrderCntType === 0) {
  101869. expGolombDecoder.readUnsignedExpGolomb();
  101870. } else if (picOrderCntType === 1) {
  101871. expGolombDecoder.skipBits(1);
  101872. expGolombDecoder.skipExpGolomb();
  101873. expGolombDecoder.skipExpGolomb();
  101874. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  101875. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  101876. expGolombDecoder.skipExpGolomb();
  101877. }
  101878. }
  101879. expGolombDecoder.skipUnsignedExpGolomb();
  101880. expGolombDecoder.skipBits(1);
  101881. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101882. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101883. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  101884. if (frameMbsOnlyFlag === 0) {
  101885. expGolombDecoder.skipBits(1);
  101886. }
  101887. expGolombDecoder.skipBits(1);
  101888. if (expGolombDecoder.readBoolean()) {
  101889. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  101890. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  101891. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  101892. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  101893. }
  101894. if (expGolombDecoder.readBoolean()) {
  101895. if (expGolombDecoder.readBoolean()) {
  101896. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  101897. switch (aspectRatioIdc) {
  101898. case 1:
  101899. sarRatio = [1, 1];
  101900. break;
  101901. case 2:
  101902. sarRatio = [12, 11];
  101903. break;
  101904. case 3:
  101905. sarRatio = [10, 11];
  101906. break;
  101907. case 4:
  101908. sarRatio = [16, 11];
  101909. break;
  101910. case 5:
  101911. sarRatio = [40, 33];
  101912. break;
  101913. case 6:
  101914. sarRatio = [24, 11];
  101915. break;
  101916. case 7:
  101917. sarRatio = [20, 11];
  101918. break;
  101919. case 8:
  101920. sarRatio = [32, 11];
  101921. break;
  101922. case 9:
  101923. sarRatio = [80, 33];
  101924. break;
  101925. case 10:
  101926. sarRatio = [18, 11];
  101927. break;
  101928. case 11:
  101929. sarRatio = [15, 11];
  101930. break;
  101931. case 12:
  101932. sarRatio = [64, 33];
  101933. break;
  101934. case 13:
  101935. sarRatio = [160, 99];
  101936. break;
  101937. case 14:
  101938. sarRatio = [4, 3];
  101939. break;
  101940. case 15:
  101941. sarRatio = [3, 2];
  101942. break;
  101943. case 16:
  101944. sarRatio = [2, 1];
  101945. break;
  101946. case 255: {
  101947. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  101948. break;
  101949. }
  101950. }
  101951. if (sarRatio) {
  101952. sarRatio[0] / sarRatio[1];
  101953. }
  101954. }
  101955. }
  101956. return {
  101957. profileIdc,
  101958. levelIdc,
  101959. profileCompatibility,
  101960. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  101961. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  101962. sarRatio
  101963. };
  101964. };
  101965. };
  101966. _H264Stream.prototype = new stream();
  101967. var h2643 = {
  101968. H264Stream: _H264Stream,
  101969. NalByteStream: _NalByteStream
  101970. };
  101971. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  101972. var parseId3TagSize = function parseId3TagSize2(header, byteIndex) {
  101973. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  101974. returnSize = returnSize >= 0 ? returnSize : 0;
  101975. if (footerPresent) {
  101976. return returnSize + 20;
  101977. }
  101978. return returnSize + 10;
  101979. };
  101980. var getId3Offset4 = function getId3Offset5(data, offset) {
  101981. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  101982. return offset;
  101983. }
  101984. offset += parseId3TagSize(data, offset);
  101985. return getId3Offset5(data, offset);
  101986. };
  101987. var isLikelyAacData$1 = function isLikelyAacData2(data) {
  101988. var offset = getId3Offset4(data, 0);
  101989. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  101990. };
  101991. var parseSyncSafeInteger = function parseSyncSafeInteger2(data) {
  101992. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  101993. };
  101994. var percentEncode = function percentEncode2(bytes, start2, end) {
  101995. var i2, result = "";
  101996. for (i2 = start2; i2 < end; i2++) {
  101997. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  101998. }
  101999. return result;
  102000. };
  102001. var parseIso88591 = function parseIso885912(bytes, start2, end) {
  102002. return unescape(percentEncode(bytes, start2, end));
  102003. };
  102004. var parseAdtsSize = function parseAdtsSize2(header, byteIndex) {
  102005. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  102006. return highTwo | middle | lowThree;
  102007. };
  102008. var parseType$2 = function parseType2(header, byteIndex) {
  102009. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  102010. return "timed-metadata";
  102011. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  102012. return "audio";
  102013. }
  102014. return null;
  102015. };
  102016. var parseSampleRate = function parseSampleRate2(packet) {
  102017. var i2 = 0;
  102018. while (i2 + 5 < packet.length) {
  102019. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  102020. i2++;
  102021. continue;
  102022. }
  102023. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  102024. }
  102025. return null;
  102026. };
  102027. var parseAacTimestamp = function parseAacTimestamp2(packet) {
  102028. var frameStart, frameSize, frame, frameHeader;
  102029. frameStart = 10;
  102030. if (packet[5] & 64) {
  102031. frameStart += 4;
  102032. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  102033. }
  102034. do {
  102035. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  102036. if (frameSize < 1) {
  102037. return null;
  102038. }
  102039. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  102040. if (frameHeader === "PRIV") {
  102041. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  102042. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  102043. if (frame[i2] === 0) {
  102044. var owner = parseIso88591(frame, 0, i2);
  102045. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  102046. var d2 = frame.subarray(i2 + 1);
  102047. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  102048. size *= 4;
  102049. size += d2[7] & 3;
  102050. return size;
  102051. }
  102052. break;
  102053. }
  102054. }
  102055. }
  102056. frameStart += 10;
  102057. frameStart += frameSize;
  102058. } while (frameStart < packet.byteLength);
  102059. return null;
  102060. };
  102061. var utils2 = {
  102062. isLikelyAacData: isLikelyAacData$1,
  102063. parseId3TagSize,
  102064. parseAdtsSize,
  102065. parseType: parseType$2,
  102066. parseSampleRate,
  102067. parseAacTimestamp
  102068. };
  102069. var _AacStream;
  102070. _AacStream = function AacStream() {
  102071. var everything = new Uint8Array(), timeStamp = 0;
  102072. _AacStream.prototype.init.call(this);
  102073. this.setTimestamp = function(timestamp) {
  102074. timeStamp = timestamp;
  102075. };
  102076. this.push = function(bytes) {
  102077. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  102078. if (everything.length) {
  102079. tempLength = everything.length;
  102080. everything = new Uint8Array(bytes.byteLength + tempLength);
  102081. everything.set(everything.subarray(0, tempLength));
  102082. everything.set(bytes, tempLength);
  102083. } else {
  102084. everything = bytes;
  102085. }
  102086. while (everything.length - byteIndex >= 3) {
  102087. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  102088. if (everything.length - byteIndex < 10) {
  102089. break;
  102090. }
  102091. frameSize = utils2.parseId3TagSize(everything, byteIndex);
  102092. if (byteIndex + frameSize > everything.length) {
  102093. break;
  102094. }
  102095. chunk = {
  102096. type: "timed-metadata",
  102097. data: everything.subarray(byteIndex, byteIndex + frameSize)
  102098. };
  102099. this.trigger("data", chunk);
  102100. byteIndex += frameSize;
  102101. continue;
  102102. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  102103. if (everything.length - byteIndex < 7) {
  102104. break;
  102105. }
  102106. frameSize = utils2.parseAdtsSize(everything, byteIndex);
  102107. if (byteIndex + frameSize > everything.length) {
  102108. break;
  102109. }
  102110. packet = {
  102111. type: "audio",
  102112. data: everything.subarray(byteIndex, byteIndex + frameSize),
  102113. pts: timeStamp,
  102114. dts: timeStamp
  102115. };
  102116. this.trigger("data", packet);
  102117. byteIndex += frameSize;
  102118. continue;
  102119. }
  102120. byteIndex++;
  102121. }
  102122. bytesLeft = everything.length - byteIndex;
  102123. if (bytesLeft > 0) {
  102124. everything = everything.subarray(byteIndex);
  102125. } else {
  102126. everything = new Uint8Array();
  102127. }
  102128. };
  102129. this.reset = function() {
  102130. everything = new Uint8Array();
  102131. this.trigger("reset");
  102132. };
  102133. this.endTimeline = function() {
  102134. everything = new Uint8Array();
  102135. this.trigger("endedtimeline");
  102136. };
  102137. };
  102138. _AacStream.prototype = new stream();
  102139. var aac3 = _AacStream;
  102140. var AUDIO_PROPERTIES = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  102141. var audioProperties = AUDIO_PROPERTIES;
  102142. var VIDEO_PROPERTIES = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  102143. var videoProperties = VIDEO_PROPERTIES;
  102144. var H264Stream = h2643.H264Stream;
  102145. var isLikelyAacData = utils2.isLikelyAacData;
  102146. var ONE_SECOND_IN_TS$12 = clock2.ONE_SECOND_IN_TS;
  102147. var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;
  102148. var retriggerForStream = function retriggerForStream2(key, event2) {
  102149. event2.stream = key;
  102150. this.trigger("log", event2);
  102151. };
  102152. var addPipelineLogRetriggers = function addPipelineLogRetriggers2(transmuxer2, pipeline) {
  102153. var keys3 = Object.keys(pipeline);
  102154. for (var i2 = 0; i2 < keys3.length; i2++) {
  102155. var key = keys3[i2];
  102156. if (key === "headOfPipeline" || !pipeline[key].on) {
  102157. continue;
  102158. }
  102159. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  102160. }
  102161. };
  102162. var arrayEquals = function arrayEquals2(a, b) {
  102163. var i2;
  102164. if (a.length !== b.length) {
  102165. return false;
  102166. }
  102167. for (i2 = 0; i2 < a.length; i2++) {
  102168. if (a[i2] !== b[i2]) {
  102169. return false;
  102170. }
  102171. }
  102172. return true;
  102173. };
  102174. var generateSegmentTimingInfo = function generateSegmentTimingInfo2(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  102175. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  102176. return {
  102177. start: {
  102178. dts: baseMediaDecodeTime,
  102179. pts: baseMediaDecodeTime + ptsOffsetFromDts
  102180. },
  102181. end: {
  102182. dts: baseMediaDecodeTime + decodeDuration,
  102183. pts: baseMediaDecodeTime + presentationDuration
  102184. },
  102185. prependedContentDuration,
  102186. baseMediaDecodeTime
  102187. };
  102188. };
  102189. _AudioSegmentStream = function AudioSegmentStream(track, options2) {
  102190. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  102191. options2 = options2 || {};
  102192. sequenceNumber = options2.firstSequenceNumber || 0;
  102193. _AudioSegmentStream.prototype.init.call(this);
  102194. this.push = function(data) {
  102195. trackDecodeInfo.collectDtsInfo(track, data);
  102196. if (track) {
  102197. audioProperties.forEach(function(prop) {
  102198. track[prop] = data[prop];
  102199. });
  102200. }
  102201. adtsFrames.push(data);
  102202. };
  102203. this.setEarliestDts = function(earliestDts) {
  102204. earliestAllowedDts = earliestDts;
  102205. };
  102206. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102207. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  102208. };
  102209. this.setAudioAppendStart = function(timestamp) {
  102210. audioAppendStartTs = timestamp;
  102211. };
  102212. this.flush = function() {
  102213. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  102214. if (adtsFrames.length === 0) {
  102215. this.trigger("done", "AudioSegmentStream");
  102216. return;
  102217. }
  102218. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  102219. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102220. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  102221. track.samples = audioFrameUtils.generateSampleTable(frames);
  102222. mdat2 = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));
  102223. adtsFrames = [];
  102224. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102225. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102226. sequenceNumber++;
  102227. boxes.set(moof2);
  102228. boxes.set(mdat2, moof2.byteLength);
  102229. trackDecodeInfo.clearDtsInfo(track);
  102230. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  102231. if (frames.length) {
  102232. segmentDuration = frames.length * frameDuration;
  102233. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  102234. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  102235. frames[0].dts,
  102236. frames[0].pts,
  102237. frames[0].dts + segmentDuration,
  102238. frames[0].pts + segmentDuration,
  102239. videoClockCyclesOfSilencePrefixed || 0
  102240. ));
  102241. this.trigger("timingInfo", {
  102242. start: frames[0].pts,
  102243. end: frames[0].pts + segmentDuration
  102244. });
  102245. }
  102246. this.trigger("data", {
  102247. track,
  102248. boxes
  102249. });
  102250. this.trigger("done", "AudioSegmentStream");
  102251. };
  102252. this.reset = function() {
  102253. trackDecodeInfo.clearDtsInfo(track);
  102254. adtsFrames = [];
  102255. this.trigger("reset");
  102256. };
  102257. };
  102258. _AudioSegmentStream.prototype = new stream();
  102259. _VideoSegmentStream = function VideoSegmentStream(track, options2) {
  102260. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  102261. options2 = options2 || {};
  102262. sequenceNumber = options2.firstSequenceNumber || 0;
  102263. _VideoSegmentStream.prototype.init.call(this);
  102264. delete track.minPTS;
  102265. this.gopCache_ = [];
  102266. this.push = function(nalUnit) {
  102267. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  102268. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  102269. config = nalUnit.config;
  102270. track.sps = [nalUnit.data];
  102271. videoProperties.forEach(function(prop) {
  102272. track[prop] = config[prop];
  102273. }, this);
  102274. }
  102275. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  102276. pps = nalUnit.data;
  102277. track.pps = [nalUnit.data];
  102278. }
  102279. nalUnits.push(nalUnit);
  102280. };
  102281. this.flush = function() {
  102282. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  102283. while (nalUnits.length) {
  102284. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  102285. break;
  102286. }
  102287. nalUnits.shift();
  102288. }
  102289. if (nalUnits.length === 0) {
  102290. this.resetStream_();
  102291. this.trigger("done", "VideoSegmentStream");
  102292. return;
  102293. }
  102294. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  102295. gops = frameUtils.groupFramesIntoGops(frames);
  102296. if (!gops[0][0].keyFrame) {
  102297. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  102298. if (gopForFusion) {
  102299. prependedContentDuration = gopForFusion.duration;
  102300. gops.unshift(gopForFusion);
  102301. gops.byteLength += gopForFusion.byteLength;
  102302. gops.nalCount += gopForFusion.nalCount;
  102303. gops.pts = gopForFusion.pts;
  102304. gops.dts = gopForFusion.dts;
  102305. gops.duration += gopForFusion.duration;
  102306. } else {
  102307. gops = frameUtils.extendFirstKeyFrame(gops);
  102308. }
  102309. }
  102310. if (gopsToAlignWith.length) {
  102311. var alignedGops;
  102312. if (options2.alignGopsAtEnd) {
  102313. alignedGops = this.alignGopsAtEnd_(gops);
  102314. } else {
  102315. alignedGops = this.alignGopsAtStart_(gops);
  102316. }
  102317. if (!alignedGops) {
  102318. this.gopCache_.unshift({
  102319. gop: gops.pop(),
  102320. pps: track.pps,
  102321. sps: track.sps
  102322. });
  102323. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102324. nalUnits = [];
  102325. this.resetStream_();
  102326. this.trigger("done", "VideoSegmentStream");
  102327. return;
  102328. }
  102329. trackDecodeInfo.clearDtsInfo(track);
  102330. gops = alignedGops;
  102331. }
  102332. trackDecodeInfo.collectDtsInfo(track, gops);
  102333. track.samples = frameUtils.generateSampleTable(gops);
  102334. mdat2 = mp4Generator.mdat(frameUtils.concatenateNalData(gops));
  102335. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102336. this.trigger("processedGopsInfo", gops.map(function(gop) {
  102337. return {
  102338. pts: gop.pts,
  102339. dts: gop.dts,
  102340. byteLength: gop.byteLength
  102341. };
  102342. }));
  102343. firstGop = gops[0];
  102344. lastGop = gops[gops.length - 1];
  102345. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  102346. this.trigger("timingInfo", {
  102347. start: gops[0].pts,
  102348. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  102349. });
  102350. this.gopCache_.unshift({
  102351. gop: gops.pop(),
  102352. pps: track.pps,
  102353. sps: track.sps
  102354. });
  102355. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102356. nalUnits = [];
  102357. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  102358. this.trigger("timelineStartInfo", track.timelineStartInfo);
  102359. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102360. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102361. sequenceNumber++;
  102362. boxes.set(moof2);
  102363. boxes.set(mdat2, moof2.byteLength);
  102364. this.trigger("data", {
  102365. track,
  102366. boxes
  102367. });
  102368. this.resetStream_();
  102369. this.trigger("done", "VideoSegmentStream");
  102370. };
  102371. this.reset = function() {
  102372. this.resetStream_();
  102373. nalUnits = [];
  102374. this.gopCache_.length = 0;
  102375. gopsToAlignWith.length = 0;
  102376. this.trigger("reset");
  102377. };
  102378. this.resetStream_ = function() {
  102379. trackDecodeInfo.clearDtsInfo(track);
  102380. config = void 0;
  102381. pps = void 0;
  102382. };
  102383. this.getGopForFusion_ = function(nalUnit) {
  102384. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  102385. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  102386. currentGopObj = this.gopCache_[i2];
  102387. currentGop = currentGopObj.gop;
  102388. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  102389. continue;
  102390. }
  102391. if (currentGop.dts < track.timelineStartInfo.dts) {
  102392. continue;
  102393. }
  102394. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  102395. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  102396. if (!nearestGopObj || nearestDistance > dtsDistance) {
  102397. nearestGopObj = currentGopObj;
  102398. nearestDistance = dtsDistance;
  102399. }
  102400. }
  102401. }
  102402. if (nearestGopObj) {
  102403. return nearestGopObj.gop;
  102404. }
  102405. return null;
  102406. };
  102407. this.alignGopsAtStart_ = function(gops) {
  102408. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  102409. byteLength = gops.byteLength;
  102410. nalCount = gops.nalCount;
  102411. duration5 = gops.duration;
  102412. alignIndex = gopIndex = 0;
  102413. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  102414. align = gopsToAlignWith[alignIndex];
  102415. gop = gops[gopIndex];
  102416. if (align.pts === gop.pts) {
  102417. break;
  102418. }
  102419. if (gop.pts > align.pts) {
  102420. alignIndex++;
  102421. continue;
  102422. }
  102423. gopIndex++;
  102424. byteLength -= gop.byteLength;
  102425. nalCount -= gop.nalCount;
  102426. duration5 -= gop.duration;
  102427. }
  102428. if (gopIndex === 0) {
  102429. return gops;
  102430. }
  102431. if (gopIndex === gops.length) {
  102432. return null;
  102433. }
  102434. alignedGops = gops.slice(gopIndex);
  102435. alignedGops.byteLength = byteLength;
  102436. alignedGops.duration = duration5;
  102437. alignedGops.nalCount = nalCount;
  102438. alignedGops.pts = alignedGops[0].pts;
  102439. alignedGops.dts = alignedGops[0].dts;
  102440. return alignedGops;
  102441. };
  102442. this.alignGopsAtEnd_ = function(gops) {
  102443. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  102444. alignIndex = gopsToAlignWith.length - 1;
  102445. gopIndex = gops.length - 1;
  102446. alignEndIndex = null;
  102447. matchFound = false;
  102448. while (alignIndex >= 0 && gopIndex >= 0) {
  102449. align = gopsToAlignWith[alignIndex];
  102450. gop = gops[gopIndex];
  102451. if (align.pts === gop.pts) {
  102452. matchFound = true;
  102453. break;
  102454. }
  102455. if (align.pts > gop.pts) {
  102456. alignIndex--;
  102457. continue;
  102458. }
  102459. if (alignIndex === gopsToAlignWith.length - 1) {
  102460. alignEndIndex = gopIndex;
  102461. }
  102462. gopIndex--;
  102463. }
  102464. if (!matchFound && alignEndIndex === null) {
  102465. return null;
  102466. }
  102467. var trimIndex;
  102468. if (matchFound) {
  102469. trimIndex = gopIndex;
  102470. } else {
  102471. trimIndex = alignEndIndex;
  102472. }
  102473. if (trimIndex === 0) {
  102474. return gops;
  102475. }
  102476. var alignedGops = gops.slice(trimIndex);
  102477. var metadata = alignedGops.reduce(function(total, gop2) {
  102478. total.byteLength += gop2.byteLength;
  102479. total.duration += gop2.duration;
  102480. total.nalCount += gop2.nalCount;
  102481. return total;
  102482. }, {
  102483. byteLength: 0,
  102484. duration: 0,
  102485. nalCount: 0
  102486. });
  102487. alignedGops.byteLength = metadata.byteLength;
  102488. alignedGops.duration = metadata.duration;
  102489. alignedGops.nalCount = metadata.nalCount;
  102490. alignedGops.pts = alignedGops[0].pts;
  102491. alignedGops.dts = alignedGops[0].dts;
  102492. return alignedGops;
  102493. };
  102494. this.alignGopsWith = function(newGopsToAlignWith) {
  102495. gopsToAlignWith = newGopsToAlignWith;
  102496. };
  102497. };
  102498. _VideoSegmentStream.prototype = new stream();
  102499. _CoalesceStream = function CoalesceStream(options2, metadataStream2) {
  102500. this.numberOfTracks = 0;
  102501. this.metadataStream = metadataStream2;
  102502. options2 = options2 || {};
  102503. if (typeof options2.remux !== "undefined") {
  102504. this.remuxTracks = !!options2.remux;
  102505. } else {
  102506. this.remuxTracks = true;
  102507. }
  102508. if (typeof options2.keepOriginalTimestamps === "boolean") {
  102509. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  102510. } else {
  102511. this.keepOriginalTimestamps = false;
  102512. }
  102513. this.pendingTracks = [];
  102514. this.videoTrack = null;
  102515. this.pendingBoxes = [];
  102516. this.pendingCaptions = [];
  102517. this.pendingMetadata = [];
  102518. this.pendingBytes = 0;
  102519. this.emittedTracks = 0;
  102520. _CoalesceStream.prototype.init.call(this);
  102521. this.push = function(output) {
  102522. if (output.text) {
  102523. return this.pendingCaptions.push(output);
  102524. }
  102525. if (output.frames) {
  102526. return this.pendingMetadata.push(output);
  102527. }
  102528. this.pendingTracks.push(output.track);
  102529. this.pendingBytes += output.boxes.byteLength;
  102530. if (output.track.type === "video") {
  102531. this.videoTrack = output.track;
  102532. this.pendingBoxes.push(output.boxes);
  102533. }
  102534. if (output.track.type === "audio") {
  102535. this.audioTrack = output.track;
  102536. this.pendingBoxes.unshift(output.boxes);
  102537. }
  102538. };
  102539. };
  102540. _CoalesceStream.prototype = new stream();
  102541. _CoalesceStream.prototype.flush = function(flushSource) {
  102542. var offset = 0, event2 = {
  102543. captions: [],
  102544. captionStreams: {},
  102545. metadata: [],
  102546. info: {}
  102547. }, caption, id3, initSegment, timelineStartPts = 0, i2;
  102548. if (this.pendingTracks.length < this.numberOfTracks) {
  102549. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  102550. return;
  102551. } else if (this.remuxTracks) {
  102552. return;
  102553. } else if (this.pendingTracks.length === 0) {
  102554. this.emittedTracks++;
  102555. if (this.emittedTracks >= this.numberOfTracks) {
  102556. this.trigger("done");
  102557. this.emittedTracks = 0;
  102558. }
  102559. return;
  102560. }
  102561. }
  102562. if (this.videoTrack) {
  102563. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  102564. videoProperties.forEach(function(prop) {
  102565. event2.info[prop] = this.videoTrack[prop];
  102566. }, this);
  102567. } else if (this.audioTrack) {
  102568. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  102569. audioProperties.forEach(function(prop) {
  102570. event2.info[prop] = this.audioTrack[prop];
  102571. }, this);
  102572. }
  102573. if (this.videoTrack || this.audioTrack) {
  102574. if (this.pendingTracks.length === 1) {
  102575. event2.type = this.pendingTracks[0].type;
  102576. } else {
  102577. event2.type = "combined";
  102578. }
  102579. this.emittedTracks += this.pendingTracks.length;
  102580. initSegment = mp4Generator.initSegment(this.pendingTracks);
  102581. event2.initSegment = new Uint8Array(initSegment.byteLength);
  102582. event2.initSegment.set(initSegment);
  102583. event2.data = new Uint8Array(this.pendingBytes);
  102584. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  102585. event2.data.set(this.pendingBoxes[i2], offset);
  102586. offset += this.pendingBoxes[i2].byteLength;
  102587. }
  102588. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  102589. caption = this.pendingCaptions[i2];
  102590. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  102591. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  102592. event2.captionStreams[caption.stream] = true;
  102593. event2.captions.push(caption);
  102594. }
  102595. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  102596. id3 = this.pendingMetadata[i2];
  102597. id3.cueTime = clock2.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);
  102598. event2.metadata.push(id3);
  102599. }
  102600. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  102601. this.pendingTracks.length = 0;
  102602. this.videoTrack = null;
  102603. this.pendingBoxes.length = 0;
  102604. this.pendingCaptions.length = 0;
  102605. this.pendingBytes = 0;
  102606. this.pendingMetadata.length = 0;
  102607. this.trigger("data", event2);
  102608. for (i2 = 0; i2 < event2.captions.length; i2++) {
  102609. caption = event2.captions[i2];
  102610. this.trigger("caption", caption);
  102611. }
  102612. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  102613. id3 = event2.metadata[i2];
  102614. this.trigger("id3Frame", id3);
  102615. }
  102616. }
  102617. if (this.emittedTracks >= this.numberOfTracks) {
  102618. this.trigger("done");
  102619. this.emittedTracks = 0;
  102620. }
  102621. };
  102622. _CoalesceStream.prototype.setRemux = function(val) {
  102623. this.remuxTracks = val;
  102624. };
  102625. _Transmuxer = function Transmuxer(options2) {
  102626. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  102627. _Transmuxer.prototype.init.call(this);
  102628. options2 = options2 || {};
  102629. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  102630. this.transmuxPipeline_ = {};
  102631. this.setupAacPipeline = function() {
  102632. var pipeline = {};
  102633. this.transmuxPipeline_ = pipeline;
  102634. pipeline.type = "aac";
  102635. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102636. pipeline.aacStream = new aac3();
  102637. pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("audio");
  102638. pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("timed-metadata");
  102639. pipeline.adtsStream = new adts();
  102640. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102641. pipeline.headOfPipeline = pipeline.aacStream;
  102642. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  102643. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102644. pipeline.metadataStream.on("timestamp", function(frame) {
  102645. pipeline.aacStream.setTimestamp(frame.timeStamp);
  102646. });
  102647. pipeline.aacStream.on("data", function(data) {
  102648. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  102649. return;
  102650. }
  102651. audioTrack = audioTrack || {
  102652. timelineStartInfo: {
  102653. baseMediaDecodeTime: self2.baseMediaDecodeTime
  102654. },
  102655. codec: "adts",
  102656. type: "audio"
  102657. };
  102658. pipeline.coalesceStream.numberOfTracks++;
  102659. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102660. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102661. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102662. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102663. self2.trigger("trackinfo", {
  102664. hasAudio: !!audioTrack,
  102665. hasVideo: !!videoTrack
  102666. });
  102667. });
  102668. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102669. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102670. addPipelineLogRetriggers(this, pipeline);
  102671. };
  102672. this.setupTsPipeline = function() {
  102673. var pipeline = {};
  102674. this.transmuxPipeline_ = pipeline;
  102675. pipeline.type = "ts";
  102676. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102677. pipeline.packetStream = new m2ts_1.TransportPacketStream();
  102678. pipeline.parseStream = new m2ts_1.TransportParseStream();
  102679. pipeline.elementaryStream = new m2ts_1.ElementaryStream();
  102680. pipeline.timestampRolloverStream = new m2ts_1.TimestampRolloverStream();
  102681. pipeline.adtsStream = new adts();
  102682. pipeline.h264Stream = new H264Stream();
  102683. pipeline.captionStream = new m2ts_1.CaptionStream(options2);
  102684. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102685. pipeline.headOfPipeline = pipeline.packetStream;
  102686. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  102687. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  102688. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  102689. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102690. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  102691. pipeline.elementaryStream.on("data", function(data) {
  102692. var i2;
  102693. if (data.type === "metadata") {
  102694. i2 = data.tracks.length;
  102695. while (i2--) {
  102696. if (!videoTrack && data.tracks[i2].type === "video") {
  102697. videoTrack = data.tracks[i2];
  102698. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102699. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  102700. audioTrack = data.tracks[i2];
  102701. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102702. }
  102703. }
  102704. if (videoTrack && !pipeline.videoSegmentStream) {
  102705. pipeline.coalesceStream.numberOfTracks++;
  102706. pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options2);
  102707. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  102708. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  102709. if (audioTrack && !options2.keepOriginalTimestamps) {
  102710. audioTrack.timelineStartInfo = timelineStartInfo;
  102711. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  102712. }
  102713. });
  102714. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  102715. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  102716. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  102717. if (audioTrack) {
  102718. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  102719. }
  102720. });
  102721. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  102722. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  102723. }
  102724. if (audioTrack && !pipeline.audioSegmentStream) {
  102725. pipeline.coalesceStream.numberOfTracks++;
  102726. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102727. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102728. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102729. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  102730. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102731. }
  102732. self2.trigger("trackinfo", {
  102733. hasAudio: !!audioTrack,
  102734. hasVideo: !!videoTrack
  102735. });
  102736. }
  102737. });
  102738. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102739. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  102740. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  102741. self2.trigger("id3Frame", id3Frame);
  102742. });
  102743. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  102744. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102745. addPipelineLogRetriggers(this, pipeline);
  102746. };
  102747. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102748. var pipeline = this.transmuxPipeline_;
  102749. if (!options2.keepOriginalTimestamps) {
  102750. this.baseMediaDecodeTime = baseMediaDecodeTime;
  102751. }
  102752. if (audioTrack) {
  102753. audioTrack.timelineStartInfo.dts = void 0;
  102754. audioTrack.timelineStartInfo.pts = void 0;
  102755. trackDecodeInfo.clearDtsInfo(audioTrack);
  102756. if (pipeline.audioTimestampRolloverStream) {
  102757. pipeline.audioTimestampRolloverStream.discontinuity();
  102758. }
  102759. }
  102760. if (videoTrack) {
  102761. if (pipeline.videoSegmentStream) {
  102762. pipeline.videoSegmentStream.gopCache_ = [];
  102763. }
  102764. videoTrack.timelineStartInfo.dts = void 0;
  102765. videoTrack.timelineStartInfo.pts = void 0;
  102766. trackDecodeInfo.clearDtsInfo(videoTrack);
  102767. pipeline.captionStream.reset();
  102768. }
  102769. if (pipeline.timestampRolloverStream) {
  102770. pipeline.timestampRolloverStream.discontinuity();
  102771. }
  102772. };
  102773. this.setAudioAppendStart = function(timestamp) {
  102774. if (audioTrack) {
  102775. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  102776. }
  102777. };
  102778. this.setRemux = function(val) {
  102779. var pipeline = this.transmuxPipeline_;
  102780. options2.remux = val;
  102781. if (pipeline && pipeline.coalesceStream) {
  102782. pipeline.coalesceStream.setRemux(val);
  102783. }
  102784. };
  102785. this.alignGopsWith = function(gopsToAlignWith) {
  102786. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  102787. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  102788. }
  102789. };
  102790. this.getLogTrigger_ = function(key) {
  102791. var self3 = this;
  102792. return function(event2) {
  102793. event2.stream = key;
  102794. self3.trigger("log", event2);
  102795. };
  102796. };
  102797. this.push = function(data) {
  102798. if (hasFlushed) {
  102799. var isAac = isLikelyAacData(data);
  102800. if (isAac && this.transmuxPipeline_.type !== "aac") {
  102801. this.setupAacPipeline();
  102802. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  102803. this.setupTsPipeline();
  102804. }
  102805. hasFlushed = false;
  102806. }
  102807. this.transmuxPipeline_.headOfPipeline.push(data);
  102808. };
  102809. this.flush = function() {
  102810. hasFlushed = true;
  102811. this.transmuxPipeline_.headOfPipeline.flush();
  102812. };
  102813. this.endTimeline = function() {
  102814. this.transmuxPipeline_.headOfPipeline.endTimeline();
  102815. };
  102816. this.reset = function() {
  102817. if (this.transmuxPipeline_.headOfPipeline) {
  102818. this.transmuxPipeline_.headOfPipeline.reset();
  102819. }
  102820. };
  102821. this.resetCaptions = function() {
  102822. if (this.transmuxPipeline_.captionStream) {
  102823. this.transmuxPipeline_.captionStream.reset();
  102824. }
  102825. };
  102826. };
  102827. _Transmuxer.prototype = new stream();
  102828. var transmuxer = {
  102829. Transmuxer: _Transmuxer,
  102830. VideoSegmentStream: _VideoSegmentStream,
  102831. AudioSegmentStream: _AudioSegmentStream,
  102832. AUDIO_PROPERTIES: audioProperties,
  102833. VIDEO_PROPERTIES: videoProperties,
  102834. generateSegmentTimingInfo
  102835. };
  102836. var toUnsigned$3 = function toUnsigned2(value) {
  102837. return value >>> 0;
  102838. };
  102839. var toHexString$1 = function toHexString2(value) {
  102840. return ("00" + value.toString(16)).slice(-2);
  102841. };
  102842. var bin = {
  102843. toUnsigned: toUnsigned$3,
  102844. toHexString: toHexString$1
  102845. };
  102846. var parseType$1 = function parseType2(buffer) {
  102847. var result = "";
  102848. result += String.fromCharCode(buffer[0]);
  102849. result += String.fromCharCode(buffer[1]);
  102850. result += String.fromCharCode(buffer[2]);
  102851. result += String.fromCharCode(buffer[3]);
  102852. return result;
  102853. };
  102854. var parseType_1 = parseType$1;
  102855. var toUnsigned$2 = bin.toUnsigned;
  102856. var findBox4 = function findBox5(data, path) {
  102857. var results = [], i2, size, type3, end, subresults;
  102858. if (!path.length) {
  102859. return null;
  102860. }
  102861. for (i2 = 0; i2 < data.byteLength; ) {
  102862. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  102863. type3 = parseType_1(data.subarray(i2 + 4, i2 + 8));
  102864. end = size > 1 ? i2 + size : data.byteLength;
  102865. if (type3 === path[0]) {
  102866. if (path.length === 1) {
  102867. results.push(data.subarray(i2 + 8, end));
  102868. } else {
  102869. subresults = findBox5(data.subarray(i2 + 8, end), path.slice(1));
  102870. if (subresults.length) {
  102871. results = results.concat(subresults);
  102872. }
  102873. }
  102874. }
  102875. i2 = end;
  102876. }
  102877. return results;
  102878. };
  102879. var findBox_1 = findBox4;
  102880. var toUnsigned$1 = bin.toUnsigned;
  102881. var getUint64$12 = numbers2.getUint64;
  102882. var tfdt = function tfdt2(data) {
  102883. var result = {
  102884. version: data[0],
  102885. flags: new Uint8Array(data.subarray(1, 4))
  102886. };
  102887. if (result.version === 1) {
  102888. result.baseMediaDecodeTime = getUint64$12(data.subarray(4));
  102889. } else {
  102890. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  102891. }
  102892. return result;
  102893. };
  102894. var parseTfdt = tfdt;
  102895. var parseSampleFlags = function parseSampleFlags2(flags) {
  102896. return {
  102897. isLeading: (flags[0] & 12) >>> 2,
  102898. dependsOn: flags[0] & 3,
  102899. isDependedOn: (flags[1] & 192) >>> 6,
  102900. hasRedundancy: (flags[1] & 48) >>> 4,
  102901. paddingValue: (flags[1] & 14) >>> 1,
  102902. isNonSyncSample: flags[1] & 1,
  102903. degradationPriority: flags[2] << 8 | flags[3]
  102904. };
  102905. };
  102906. var parseSampleFlags_1 = parseSampleFlags;
  102907. var trun = function trun2(data) {
  102908. var result = {
  102909. version: data[0],
  102910. flags: new Uint8Array(data.subarray(1, 4)),
  102911. samples: []
  102912. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  102913. if (dataOffsetPresent) {
  102914. result.dataOffset = view.getInt32(offset);
  102915. offset += 4;
  102916. }
  102917. if (firstSampleFlagsPresent && sampleCount) {
  102918. sample = {
  102919. flags: parseSampleFlags_1(data.subarray(offset, offset + 4))
  102920. };
  102921. offset += 4;
  102922. if (sampleDurationPresent) {
  102923. sample.duration = view.getUint32(offset);
  102924. offset += 4;
  102925. }
  102926. if (sampleSizePresent) {
  102927. sample.size = view.getUint32(offset);
  102928. offset += 4;
  102929. }
  102930. if (sampleCompositionTimeOffsetPresent) {
  102931. if (result.version === 1) {
  102932. sample.compositionTimeOffset = view.getInt32(offset);
  102933. } else {
  102934. sample.compositionTimeOffset = view.getUint32(offset);
  102935. }
  102936. offset += 4;
  102937. }
  102938. result.samples.push(sample);
  102939. sampleCount--;
  102940. }
  102941. while (sampleCount--) {
  102942. sample = {};
  102943. if (sampleDurationPresent) {
  102944. sample.duration = view.getUint32(offset);
  102945. offset += 4;
  102946. }
  102947. if (sampleSizePresent) {
  102948. sample.size = view.getUint32(offset);
  102949. offset += 4;
  102950. }
  102951. if (sampleFlagsPresent) {
  102952. sample.flags = parseSampleFlags_1(data.subarray(offset, offset + 4));
  102953. offset += 4;
  102954. }
  102955. if (sampleCompositionTimeOffsetPresent) {
  102956. if (result.version === 1) {
  102957. sample.compositionTimeOffset = view.getInt32(offset);
  102958. } else {
  102959. sample.compositionTimeOffset = view.getUint32(offset);
  102960. }
  102961. offset += 4;
  102962. }
  102963. result.samples.push(sample);
  102964. }
  102965. return result;
  102966. };
  102967. var parseTrun = trun;
  102968. var tfhd = function tfhd2(data) {
  102969. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  102970. version: data[0],
  102971. flags: new Uint8Array(data.subarray(1, 4)),
  102972. trackId: view.getUint32(4)
  102973. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  102974. i2 = 8;
  102975. if (baseDataOffsetPresent) {
  102976. i2 += 4;
  102977. result.baseDataOffset = view.getUint32(12);
  102978. i2 += 4;
  102979. }
  102980. if (sampleDescriptionIndexPresent) {
  102981. result.sampleDescriptionIndex = view.getUint32(i2);
  102982. i2 += 4;
  102983. }
  102984. if (defaultSampleDurationPresent) {
  102985. result.defaultSampleDuration = view.getUint32(i2);
  102986. i2 += 4;
  102987. }
  102988. if (defaultSampleSizePresent) {
  102989. result.defaultSampleSize = view.getUint32(i2);
  102990. i2 += 4;
  102991. }
  102992. if (defaultSampleFlagsPresent) {
  102993. result.defaultSampleFlags = view.getUint32(i2);
  102994. }
  102995. if (durationIsEmpty) {
  102996. result.durationIsEmpty = true;
  102997. }
  102998. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  102999. result.baseDataOffsetIsMoof = true;
  103000. }
  103001. return result;
  103002. };
  103003. var parseTfhd = tfhd;
  103004. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  103005. var win2;
  103006. if (typeof window !== "undefined") {
  103007. win2 = window;
  103008. } else if (typeof commonjsGlobal2 !== "undefined") {
  103009. win2 = commonjsGlobal2;
  103010. } else if (typeof self !== "undefined") {
  103011. win2 = self;
  103012. } else {
  103013. win2 = {};
  103014. }
  103015. var window_12 = win2;
  103016. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  103017. var CaptionStream = captionStream.CaptionStream;
  103018. var mapToSample = function mapToSample2(offset, samples) {
  103019. var approximateOffset = offset;
  103020. for (var i2 = 0; i2 < samples.length; i2++) {
  103021. var sample = samples[i2];
  103022. if (approximateOffset < sample.size) {
  103023. return sample;
  103024. }
  103025. approximateOffset -= sample.size;
  103026. }
  103027. return null;
  103028. };
  103029. var findSeiNals = function findSeiNals2(avcStream, samples, trackId) {
  103030. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  103031. logs: [],
  103032. seiNals: []
  103033. }, seiNal, i2, length, lastMatchedSample;
  103034. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  103035. length = avcView.getUint32(i2);
  103036. i2 += 4;
  103037. if (length <= 0) {
  103038. continue;
  103039. }
  103040. switch (avcStream[i2] & 31) {
  103041. case 6:
  103042. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  103043. var matchingSample = mapToSample(i2, samples);
  103044. seiNal = {
  103045. nalUnitType: "sei_rbsp",
  103046. size: length,
  103047. data,
  103048. escapedRBSP: discardEmulationPreventionBytes4(data),
  103049. trackId
  103050. };
  103051. if (matchingSample) {
  103052. seiNal.pts = matchingSample.pts;
  103053. seiNal.dts = matchingSample.dts;
  103054. lastMatchedSample = matchingSample;
  103055. } else if (lastMatchedSample) {
  103056. seiNal.pts = lastMatchedSample.pts;
  103057. seiNal.dts = lastMatchedSample.dts;
  103058. } else {
  103059. result.logs.push({
  103060. level: "warn",
  103061. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  103062. });
  103063. break;
  103064. }
  103065. result.seiNals.push(seiNal);
  103066. break;
  103067. }
  103068. }
  103069. return result;
  103070. };
  103071. var parseSamples = function parseSamples2(truns, baseMediaDecodeTime, tfhd2) {
  103072. var currentDts = baseMediaDecodeTime;
  103073. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  103074. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  103075. var trackId = tfhd2.trackId;
  103076. var allSamples = [];
  103077. truns.forEach(function(trun2) {
  103078. var trackRun = parseTrun(trun2);
  103079. var samples = trackRun.samples;
  103080. samples.forEach(function(sample) {
  103081. if (sample.duration === void 0) {
  103082. sample.duration = defaultSampleDuration;
  103083. }
  103084. if (sample.size === void 0) {
  103085. sample.size = defaultSampleSize;
  103086. }
  103087. sample.trackId = trackId;
  103088. sample.dts = currentDts;
  103089. if (sample.compositionTimeOffset === void 0) {
  103090. sample.compositionTimeOffset = 0;
  103091. }
  103092. if (typeof currentDts === "bigint") {
  103093. sample.pts = currentDts + window_12.BigInt(sample.compositionTimeOffset);
  103094. currentDts += window_12.BigInt(sample.duration);
  103095. } else {
  103096. sample.pts = currentDts + sample.compositionTimeOffset;
  103097. currentDts += sample.duration;
  103098. }
  103099. });
  103100. allSamples = allSamples.concat(samples);
  103101. });
  103102. return allSamples;
  103103. };
  103104. var parseCaptionNals = function parseCaptionNals2(segment, videoTrackId) {
  103105. var trafs = findBox_1(segment, ["moof", "traf"]);
  103106. var mdats = findBox_1(segment, ["mdat"]);
  103107. var captionNals = {};
  103108. var mdatTrafPairs = [];
  103109. mdats.forEach(function(mdat2, index2) {
  103110. var matchingTraf = trafs[index2];
  103111. mdatTrafPairs.push({
  103112. mdat: mdat2,
  103113. traf: matchingTraf
  103114. });
  103115. });
  103116. mdatTrafPairs.forEach(function(pair) {
  103117. var mdat2 = pair.mdat;
  103118. var traf2 = pair.traf;
  103119. var tfhd2 = findBox_1(traf2, ["tfhd"]);
  103120. var headerInfo = parseTfhd(tfhd2[0]);
  103121. var trackId = headerInfo.trackId;
  103122. var tfdt2 = findBox_1(traf2, ["tfdt"]);
  103123. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt(tfdt2[0]).baseMediaDecodeTime : 0;
  103124. var truns = findBox_1(traf2, ["trun"]);
  103125. var samples;
  103126. var result;
  103127. if (videoTrackId === trackId && truns.length > 0) {
  103128. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  103129. result = findSeiNals(mdat2, samples, trackId);
  103130. if (!captionNals[trackId]) {
  103131. captionNals[trackId] = {
  103132. seiNals: [],
  103133. logs: []
  103134. };
  103135. }
  103136. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  103137. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  103138. }
  103139. });
  103140. return captionNals;
  103141. };
  103142. var parseEmbeddedCaptions = function parseEmbeddedCaptions2(segment, trackId, timescale3) {
  103143. var captionNals;
  103144. if (trackId === null) {
  103145. return null;
  103146. }
  103147. captionNals = parseCaptionNals(segment, trackId);
  103148. var trackNals = captionNals[trackId] || {};
  103149. return {
  103150. seiNals: trackNals.seiNals,
  103151. logs: trackNals.logs,
  103152. timescale: timescale3
  103153. };
  103154. };
  103155. var CaptionParser = function CaptionParser2() {
  103156. var isInitialized = false;
  103157. var captionStream2;
  103158. var segmentCache;
  103159. var trackId;
  103160. var timescale3;
  103161. var parsedCaptions;
  103162. var parsingPartial;
  103163. this.isInitialized = function() {
  103164. return isInitialized;
  103165. };
  103166. this.init = function(options2) {
  103167. captionStream2 = new CaptionStream();
  103168. isInitialized = true;
  103169. parsingPartial = options2 ? options2.isPartial : false;
  103170. captionStream2.on("data", function(event2) {
  103171. event2.startTime = event2.startPts / timescale3;
  103172. event2.endTime = event2.endPts / timescale3;
  103173. parsedCaptions.captions.push(event2);
  103174. parsedCaptions.captionStreams[event2.stream] = true;
  103175. });
  103176. captionStream2.on("log", function(log2) {
  103177. parsedCaptions.logs.push(log2);
  103178. });
  103179. };
  103180. this.isNewInit = function(videoTrackIds, timescales) {
  103181. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  103182. return false;
  103183. }
  103184. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  103185. };
  103186. this.parse = function(segment, videoTrackIds, timescales) {
  103187. var parsedData;
  103188. if (!this.isInitialized()) {
  103189. return null;
  103190. } else if (!videoTrackIds || !timescales) {
  103191. return null;
  103192. } else if (this.isNewInit(videoTrackIds, timescales)) {
  103193. trackId = videoTrackIds[0];
  103194. timescale3 = timescales[trackId];
  103195. } else if (trackId === null || !timescale3) {
  103196. segmentCache.push(segment);
  103197. return null;
  103198. }
  103199. while (segmentCache.length > 0) {
  103200. var cachedSegment = segmentCache.shift();
  103201. this.parse(cachedSegment, videoTrackIds, timescales);
  103202. }
  103203. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  103204. if (parsedData && parsedData.logs) {
  103205. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  103206. }
  103207. if (parsedData === null || !parsedData.seiNals) {
  103208. if (parsedCaptions.logs.length) {
  103209. return {
  103210. logs: parsedCaptions.logs,
  103211. captions: [],
  103212. captionStreams: []
  103213. };
  103214. }
  103215. return null;
  103216. }
  103217. this.pushNals(parsedData.seiNals);
  103218. this.flushStream();
  103219. return parsedCaptions;
  103220. };
  103221. this.pushNals = function(nals) {
  103222. if (!this.isInitialized() || !nals || nals.length === 0) {
  103223. return null;
  103224. }
  103225. nals.forEach(function(nal) {
  103226. captionStream2.push(nal);
  103227. });
  103228. };
  103229. this.flushStream = function() {
  103230. if (!this.isInitialized()) {
  103231. return null;
  103232. }
  103233. if (!parsingPartial) {
  103234. captionStream2.flush();
  103235. } else {
  103236. captionStream2.partialFlush();
  103237. }
  103238. };
  103239. this.clearParsedCaptions = function() {
  103240. parsedCaptions.captions = [];
  103241. parsedCaptions.captionStreams = {};
  103242. parsedCaptions.logs = [];
  103243. };
  103244. this.resetCaptionStream = function() {
  103245. if (!this.isInitialized()) {
  103246. return null;
  103247. }
  103248. captionStream2.reset();
  103249. };
  103250. this.clearAllCaptions = function() {
  103251. this.clearParsedCaptions();
  103252. this.resetCaptionStream();
  103253. };
  103254. this.reset = function() {
  103255. segmentCache = [];
  103256. trackId = null;
  103257. timescale3 = null;
  103258. if (!parsedCaptions) {
  103259. parsedCaptions = {
  103260. captions: [],
  103261. captionStreams: {},
  103262. logs: []
  103263. };
  103264. } else {
  103265. this.clearParsedCaptions();
  103266. }
  103267. this.resetCaptionStream();
  103268. };
  103269. this.reset();
  103270. };
  103271. var captionParser = CaptionParser;
  103272. var toUnsigned = bin.toUnsigned;
  103273. var toHexString = bin.toHexString;
  103274. var getUint642 = numbers2.getUint64;
  103275. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader;
  103276. timescale2 = function timescale3(init) {
  103277. var result = {}, traks = findBox_1(init, ["moov", "trak"]);
  103278. return traks.reduce(function(result2, trak2) {
  103279. var tkhd2, version2, index2, id, mdhd2;
  103280. tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103281. if (!tkhd2) {
  103282. return null;
  103283. }
  103284. version2 = tkhd2[0];
  103285. index2 = version2 === 0 ? 12 : 20;
  103286. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  103287. mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103288. if (!mdhd2) {
  103289. return null;
  103290. }
  103291. version2 = mdhd2[0];
  103292. index2 = version2 === 0 ? 12 : 20;
  103293. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103294. return result2;
  103295. }, result);
  103296. };
  103297. startTime = function startTime2(timescale3, fragment) {
  103298. var trafs;
  103299. trafs = findBox_1(fragment, ["moof", "traf"]);
  103300. var lowestTime = trafs.reduce(function(acc, traf2) {
  103301. var tfhd2 = findBox_1(traf2, ["tfhd"])[0];
  103302. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  103303. var scale = timescale3[id] || 9e4;
  103304. var tfdt2 = findBox_1(traf2, ["tfdt"])[0];
  103305. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  103306. var baseTime;
  103307. if (tfdt2[0] === 1) {
  103308. baseTime = getUint642(tfdt2.subarray(4, 12));
  103309. } else {
  103310. baseTime = dv.getUint32(4);
  103311. }
  103312. var seconds;
  103313. if (typeof baseTime === "bigint") {
  103314. seconds = baseTime / window_12.BigInt(scale);
  103315. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  103316. seconds = baseTime / scale;
  103317. }
  103318. if (seconds < Number.MAX_SAFE_INTEGER) {
  103319. seconds = Number(seconds);
  103320. }
  103321. if (seconds < acc) {
  103322. acc = seconds;
  103323. }
  103324. return acc;
  103325. }, Infinity);
  103326. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  103327. };
  103328. compositionStartTime = function compositionStartTime2(timescales, fragment) {
  103329. var trafBoxes = findBox_1(fragment, ["moof", "traf"]);
  103330. var baseMediaDecodeTime = 0;
  103331. var compositionTimeOffset = 0;
  103332. var trackId;
  103333. if (trafBoxes && trafBoxes.length) {
  103334. var tfhd2 = findBox_1(trafBoxes[0], ["tfhd"])[0];
  103335. var trun2 = findBox_1(trafBoxes[0], ["trun"])[0];
  103336. var tfdt2 = findBox_1(trafBoxes[0], ["tfdt"])[0];
  103337. if (tfhd2) {
  103338. var parsedTfhd = parseTfhd(tfhd2);
  103339. trackId = parsedTfhd.trackId;
  103340. }
  103341. if (tfdt2) {
  103342. var parsedTfdt = parseTfdt(tfdt2);
  103343. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  103344. }
  103345. if (trun2) {
  103346. var parsedTrun = parseTrun(trun2);
  103347. if (parsedTrun.samples && parsedTrun.samples.length) {
  103348. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  103349. }
  103350. }
  103351. }
  103352. var timescale3 = timescales[trackId] || 9e4;
  103353. if (typeof baseMediaDecodeTime === "bigint") {
  103354. compositionTimeOffset = window_12.BigInt(compositionTimeOffset);
  103355. timescale3 = window_12.BigInt(timescale3);
  103356. }
  103357. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  103358. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  103359. result = Number(result);
  103360. }
  103361. return result;
  103362. };
  103363. getVideoTrackIds = function getVideoTrackIds2(init) {
  103364. var traks = findBox_1(init, ["moov", "trak"]);
  103365. var videoTrackIds = [];
  103366. traks.forEach(function(trak2) {
  103367. var hdlrs = findBox_1(trak2, ["mdia", "hdlr"]);
  103368. var tkhds = findBox_1(trak2, ["tkhd"]);
  103369. hdlrs.forEach(function(hdlr2, index2) {
  103370. var handlerType = parseType_1(hdlr2.subarray(8, 12));
  103371. var tkhd2 = tkhds[index2];
  103372. var view;
  103373. var version2;
  103374. var trackId;
  103375. if (handlerType === "vide") {
  103376. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103377. version2 = view.getUint8(0);
  103378. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  103379. videoTrackIds.push(trackId);
  103380. }
  103381. });
  103382. });
  103383. return videoTrackIds;
  103384. };
  103385. getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader2(mdhd2) {
  103386. var version2 = mdhd2[0];
  103387. var index2 = version2 === 0 ? 12 : 20;
  103388. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103389. };
  103390. getTracks = function getTracks2(init) {
  103391. var traks = findBox_1(init, ["moov", "trak"]);
  103392. var tracks = [];
  103393. traks.forEach(function(trak2) {
  103394. var track = {};
  103395. var tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103396. var view, tkhdVersion;
  103397. if (tkhd2) {
  103398. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103399. tkhdVersion = view.getUint8(0);
  103400. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  103401. }
  103402. var hdlr2 = findBox_1(trak2, ["mdia", "hdlr"])[0];
  103403. if (hdlr2) {
  103404. var type3 = parseType_1(hdlr2.subarray(8, 12));
  103405. if (type3 === "vide") {
  103406. track.type = "video";
  103407. } else if (type3 === "soun") {
  103408. track.type = "audio";
  103409. } else {
  103410. track.type = type3;
  103411. }
  103412. }
  103413. var stsd2 = findBox_1(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  103414. if (stsd2) {
  103415. var sampleDescriptions = stsd2.subarray(8);
  103416. track.codec = parseType_1(sampleDescriptions.subarray(4, 8));
  103417. var codecBox = findBox_1(sampleDescriptions, [track.codec])[0];
  103418. var codecConfig, codecConfigType;
  103419. if (codecBox) {
  103420. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  103421. codecConfig = codecBox.subarray(78);
  103422. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103423. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  103424. track.codec += ".";
  103425. track.codec += toHexString(codecConfig[9]);
  103426. track.codec += toHexString(codecConfig[10]);
  103427. track.codec += toHexString(codecConfig[11]);
  103428. } else {
  103429. track.codec = "avc1.4d400d";
  103430. }
  103431. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  103432. codecConfig = codecBox.subarray(28);
  103433. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103434. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  103435. track.codec += "." + toHexString(codecConfig[19]);
  103436. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  103437. } else {
  103438. track.codec = "mp4a.40.2";
  103439. }
  103440. } else {
  103441. track.codec = track.codec.toLowerCase();
  103442. }
  103443. }
  103444. }
  103445. var mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103446. if (mdhd2) {
  103447. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  103448. }
  103449. tracks.push(track);
  103450. });
  103451. return tracks;
  103452. };
  103453. var probe$2 = {
  103454. findBox: findBox_1,
  103455. parseType: parseType_1,
  103456. timescale: timescale2,
  103457. startTime,
  103458. compositionStartTime,
  103459. videoTrackIds: getVideoTrackIds,
  103460. tracks: getTracks,
  103461. getTimescaleFromMediaHeader
  103462. };
  103463. var parsePid = function parsePid2(packet) {
  103464. var pid = packet[1] & 31;
  103465. pid <<= 8;
  103466. pid |= packet[2];
  103467. return pid;
  103468. };
  103469. var parsePayloadUnitStartIndicator = function parsePayloadUnitStartIndicator2(packet) {
  103470. return !!(packet[1] & 64);
  103471. };
  103472. var parseAdaptionField = function parseAdaptionField2(packet) {
  103473. var offset = 0;
  103474. if ((packet[3] & 48) >>> 4 > 1) {
  103475. offset += packet[4] + 1;
  103476. }
  103477. return offset;
  103478. };
  103479. var parseType = function parseType2(packet, pmtPid) {
  103480. var pid = parsePid(packet);
  103481. if (pid === 0) {
  103482. return "pat";
  103483. } else if (pid === pmtPid) {
  103484. return "pmt";
  103485. } else if (pmtPid) {
  103486. return "pes";
  103487. }
  103488. return null;
  103489. };
  103490. var parsePat = function parsePat2(packet) {
  103491. var pusi = parsePayloadUnitStartIndicator(packet);
  103492. var offset = 4 + parseAdaptionField(packet);
  103493. if (pusi) {
  103494. offset += packet[offset] + 1;
  103495. }
  103496. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  103497. };
  103498. var parsePmt = function parsePmt2(packet) {
  103499. var programMapTable = {};
  103500. var pusi = parsePayloadUnitStartIndicator(packet);
  103501. var payloadOffset = 4 + parseAdaptionField(packet);
  103502. if (pusi) {
  103503. payloadOffset += packet[payloadOffset] + 1;
  103504. }
  103505. if (!(packet[payloadOffset + 5] & 1)) {
  103506. return;
  103507. }
  103508. var sectionLength, tableEnd, programInfoLength;
  103509. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  103510. tableEnd = 3 + sectionLength - 4;
  103511. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  103512. var offset = 12 + programInfoLength;
  103513. while (offset < tableEnd) {
  103514. var i2 = payloadOffset + offset;
  103515. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  103516. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  103517. }
  103518. return programMapTable;
  103519. };
  103520. var parsePesType = function parsePesType2(packet, programMapTable) {
  103521. var pid = parsePid(packet);
  103522. var type3 = programMapTable[pid];
  103523. switch (type3) {
  103524. case streamTypes.H264_STREAM_TYPE:
  103525. return "video";
  103526. case streamTypes.ADTS_STREAM_TYPE:
  103527. return "audio";
  103528. case streamTypes.METADATA_STREAM_TYPE:
  103529. return "timed-metadata";
  103530. default:
  103531. return null;
  103532. }
  103533. };
  103534. var parsePesTime = function parsePesTime2(packet) {
  103535. var pusi = parsePayloadUnitStartIndicator(packet);
  103536. if (!pusi) {
  103537. return null;
  103538. }
  103539. var offset = 4 + parseAdaptionField(packet);
  103540. if (offset >= packet.byteLength) {
  103541. return null;
  103542. }
  103543. var pes = null;
  103544. var ptsDtsFlags;
  103545. ptsDtsFlags = packet[offset + 7];
  103546. if (ptsDtsFlags & 192) {
  103547. pes = {};
  103548. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  103549. pes.pts *= 4;
  103550. pes.pts += (packet[offset + 13] & 6) >>> 1;
  103551. pes.dts = pes.pts;
  103552. if (ptsDtsFlags & 64) {
  103553. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  103554. pes.dts *= 4;
  103555. pes.dts += (packet[offset + 18] & 6) >>> 1;
  103556. }
  103557. }
  103558. return pes;
  103559. };
  103560. var parseNalUnitType = function parseNalUnitType2(type3) {
  103561. switch (type3) {
  103562. case 5:
  103563. return "slice_layer_without_partitioning_rbsp_idr";
  103564. case 6:
  103565. return "sei_rbsp";
  103566. case 7:
  103567. return "seq_parameter_set_rbsp";
  103568. case 8:
  103569. return "pic_parameter_set_rbsp";
  103570. case 9:
  103571. return "access_unit_delimiter_rbsp";
  103572. default:
  103573. return null;
  103574. }
  103575. };
  103576. var videoPacketContainsKeyFrame = function videoPacketContainsKeyFrame2(packet) {
  103577. var offset = 4 + parseAdaptionField(packet);
  103578. var frameBuffer = packet.subarray(offset);
  103579. var frameI = 0;
  103580. var frameSyncPoint = 0;
  103581. var foundKeyFrame = false;
  103582. var nalType;
  103583. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  103584. if (frameBuffer[frameSyncPoint + 2] === 1) {
  103585. frameI = frameSyncPoint + 5;
  103586. break;
  103587. }
  103588. }
  103589. while (frameI < frameBuffer.byteLength) {
  103590. switch (frameBuffer[frameI]) {
  103591. case 0:
  103592. if (frameBuffer[frameI - 1] !== 0) {
  103593. frameI += 2;
  103594. break;
  103595. } else if (frameBuffer[frameI - 2] !== 0) {
  103596. frameI++;
  103597. break;
  103598. }
  103599. if (frameSyncPoint + 3 !== frameI - 2) {
  103600. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103601. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103602. foundKeyFrame = true;
  103603. }
  103604. }
  103605. do {
  103606. frameI++;
  103607. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  103608. frameSyncPoint = frameI - 2;
  103609. frameI += 3;
  103610. break;
  103611. case 1:
  103612. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  103613. frameI += 3;
  103614. break;
  103615. }
  103616. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103617. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103618. foundKeyFrame = true;
  103619. }
  103620. frameSyncPoint = frameI - 2;
  103621. frameI += 3;
  103622. break;
  103623. default:
  103624. frameI += 3;
  103625. break;
  103626. }
  103627. }
  103628. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  103629. frameI -= frameSyncPoint;
  103630. frameSyncPoint = 0;
  103631. if (frameBuffer && frameBuffer.byteLength > 3) {
  103632. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103633. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103634. foundKeyFrame = true;
  103635. }
  103636. }
  103637. return foundKeyFrame;
  103638. };
  103639. var probe$1 = {
  103640. parseType,
  103641. parsePat,
  103642. parsePmt,
  103643. parsePayloadUnitStartIndicator,
  103644. parsePesType,
  103645. parsePesTime,
  103646. videoPacketContainsKeyFrame
  103647. };
  103648. var handleRollover = timestampRolloverStream.handleRollover;
  103649. var probe = {};
  103650. probe.ts = probe$1;
  103651. probe.aac = utils2;
  103652. var ONE_SECOND_IN_TS2 = clock2.ONE_SECOND_IN_TS;
  103653. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  103654. var parsePsi_ = function parsePsi_2(bytes, pmt) {
  103655. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  103656. while (endIndex < bytes.byteLength) {
  103657. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103658. packet = bytes.subarray(startIndex, endIndex);
  103659. type3 = probe.ts.parseType(packet, pmt.pid);
  103660. switch (type3) {
  103661. case "pat":
  103662. pmt.pid = probe.ts.parsePat(packet);
  103663. break;
  103664. case "pmt":
  103665. var table = probe.ts.parsePmt(packet);
  103666. pmt.table = pmt.table || {};
  103667. Object.keys(table).forEach(function(key) {
  103668. pmt.table[key] = table[key];
  103669. });
  103670. break;
  103671. }
  103672. startIndex += MP2T_PACKET_LENGTH;
  103673. endIndex += MP2T_PACKET_LENGTH;
  103674. continue;
  103675. }
  103676. startIndex++;
  103677. endIndex++;
  103678. }
  103679. };
  103680. var parseAudioPes_ = function parseAudioPes_2(bytes, pmt, result) {
  103681. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  103682. var endLoop = false;
  103683. while (endIndex <= bytes.byteLength) {
  103684. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103685. packet = bytes.subarray(startIndex, endIndex);
  103686. type3 = probe.ts.parseType(packet, pmt.pid);
  103687. switch (type3) {
  103688. case "pes":
  103689. pesType = probe.ts.parsePesType(packet, pmt.table);
  103690. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103691. if (pesType === "audio" && pusi) {
  103692. parsed = probe.ts.parsePesTime(packet);
  103693. if (parsed) {
  103694. parsed.type = "audio";
  103695. result.audio.push(parsed);
  103696. endLoop = true;
  103697. }
  103698. }
  103699. break;
  103700. }
  103701. if (endLoop) {
  103702. break;
  103703. }
  103704. startIndex += MP2T_PACKET_LENGTH;
  103705. endIndex += MP2T_PACKET_LENGTH;
  103706. continue;
  103707. }
  103708. startIndex++;
  103709. endIndex++;
  103710. }
  103711. endIndex = bytes.byteLength;
  103712. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103713. endLoop = false;
  103714. while (startIndex >= 0) {
  103715. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103716. packet = bytes.subarray(startIndex, endIndex);
  103717. type3 = probe.ts.parseType(packet, pmt.pid);
  103718. switch (type3) {
  103719. case "pes":
  103720. pesType = probe.ts.parsePesType(packet, pmt.table);
  103721. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103722. if (pesType === "audio" && pusi) {
  103723. parsed = probe.ts.parsePesTime(packet);
  103724. if (parsed) {
  103725. parsed.type = "audio";
  103726. result.audio.push(parsed);
  103727. endLoop = true;
  103728. }
  103729. }
  103730. break;
  103731. }
  103732. if (endLoop) {
  103733. break;
  103734. }
  103735. startIndex -= MP2T_PACKET_LENGTH;
  103736. endIndex -= MP2T_PACKET_LENGTH;
  103737. continue;
  103738. }
  103739. startIndex--;
  103740. endIndex--;
  103741. }
  103742. };
  103743. var parseVideoPes_ = function parseVideoPes_2(bytes, pmt, result) {
  103744. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  103745. var endLoop = false;
  103746. var currentFrame = {
  103747. data: [],
  103748. size: 0
  103749. };
  103750. while (endIndex < bytes.byteLength) {
  103751. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103752. packet = bytes.subarray(startIndex, endIndex);
  103753. type3 = probe.ts.parseType(packet, pmt.pid);
  103754. switch (type3) {
  103755. case "pes":
  103756. pesType = probe.ts.parsePesType(packet, pmt.table);
  103757. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103758. if (pesType === "video") {
  103759. if (pusi && !endLoop) {
  103760. parsed = probe.ts.parsePesTime(packet);
  103761. if (parsed) {
  103762. parsed.type = "video";
  103763. result.video.push(parsed);
  103764. endLoop = true;
  103765. }
  103766. }
  103767. if (!result.firstKeyFrame) {
  103768. if (pusi) {
  103769. if (currentFrame.size !== 0) {
  103770. frame = new Uint8Array(currentFrame.size);
  103771. i2 = 0;
  103772. while (currentFrame.data.length) {
  103773. pes = currentFrame.data.shift();
  103774. frame.set(pes, i2);
  103775. i2 += pes.byteLength;
  103776. }
  103777. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  103778. var firstKeyFrame = probe.ts.parsePesTime(frame);
  103779. if (firstKeyFrame) {
  103780. result.firstKeyFrame = firstKeyFrame;
  103781. result.firstKeyFrame.type = "video";
  103782. } else {
  103783. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  103784. }
  103785. }
  103786. currentFrame.size = 0;
  103787. }
  103788. }
  103789. currentFrame.data.push(packet);
  103790. currentFrame.size += packet.byteLength;
  103791. }
  103792. }
  103793. break;
  103794. }
  103795. if (endLoop && result.firstKeyFrame) {
  103796. break;
  103797. }
  103798. startIndex += MP2T_PACKET_LENGTH;
  103799. endIndex += MP2T_PACKET_LENGTH;
  103800. continue;
  103801. }
  103802. startIndex++;
  103803. endIndex++;
  103804. }
  103805. endIndex = bytes.byteLength;
  103806. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103807. endLoop = false;
  103808. while (startIndex >= 0) {
  103809. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103810. packet = bytes.subarray(startIndex, endIndex);
  103811. type3 = probe.ts.parseType(packet, pmt.pid);
  103812. switch (type3) {
  103813. case "pes":
  103814. pesType = probe.ts.parsePesType(packet, pmt.table);
  103815. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103816. if (pesType === "video" && pusi) {
  103817. parsed = probe.ts.parsePesTime(packet);
  103818. if (parsed) {
  103819. parsed.type = "video";
  103820. result.video.push(parsed);
  103821. endLoop = true;
  103822. }
  103823. }
  103824. break;
  103825. }
  103826. if (endLoop) {
  103827. break;
  103828. }
  103829. startIndex -= MP2T_PACKET_LENGTH;
  103830. endIndex -= MP2T_PACKET_LENGTH;
  103831. continue;
  103832. }
  103833. startIndex--;
  103834. endIndex--;
  103835. }
  103836. };
  103837. var adjustTimestamp_ = function adjustTimestamp_2(segmentInfo, baseTimestamp) {
  103838. if (segmentInfo.audio && segmentInfo.audio.length) {
  103839. var audioBaseTimestamp = baseTimestamp;
  103840. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  103841. audioBaseTimestamp = segmentInfo.audio[0].dts;
  103842. }
  103843. segmentInfo.audio.forEach(function(info) {
  103844. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  103845. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  103846. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103847. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103848. });
  103849. }
  103850. if (segmentInfo.video && segmentInfo.video.length) {
  103851. var videoBaseTimestamp = baseTimestamp;
  103852. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  103853. videoBaseTimestamp = segmentInfo.video[0].dts;
  103854. }
  103855. segmentInfo.video.forEach(function(info) {
  103856. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  103857. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  103858. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103859. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103860. });
  103861. if (segmentInfo.firstKeyFrame) {
  103862. var frame = segmentInfo.firstKeyFrame;
  103863. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  103864. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  103865. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  103866. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  103867. }
  103868. }
  103869. };
  103870. var inspectAac_ = function inspectAac_2(bytes) {
  103871. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  103872. while (bytes.length - byteIndex >= 3) {
  103873. var type3 = probe.aac.parseType(bytes, byteIndex);
  103874. switch (type3) {
  103875. case "timed-metadata":
  103876. if (bytes.length - byteIndex < 10) {
  103877. endLoop = true;
  103878. break;
  103879. }
  103880. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  103881. if (frameSize > bytes.length) {
  103882. endLoop = true;
  103883. break;
  103884. }
  103885. if (timestamp === null) {
  103886. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103887. timestamp = probe.aac.parseAacTimestamp(packet);
  103888. }
  103889. byteIndex += frameSize;
  103890. break;
  103891. case "audio":
  103892. if (bytes.length - byteIndex < 7) {
  103893. endLoop = true;
  103894. break;
  103895. }
  103896. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  103897. if (frameSize > bytes.length) {
  103898. endLoop = true;
  103899. break;
  103900. }
  103901. if (sampleRate === null) {
  103902. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103903. sampleRate = probe.aac.parseSampleRate(packet);
  103904. }
  103905. audioCount++;
  103906. byteIndex += frameSize;
  103907. break;
  103908. default:
  103909. byteIndex++;
  103910. break;
  103911. }
  103912. if (endLoop) {
  103913. return null;
  103914. }
  103915. }
  103916. if (sampleRate === null || timestamp === null) {
  103917. return null;
  103918. }
  103919. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  103920. var result = {
  103921. audio: [{
  103922. type: "audio",
  103923. dts: timestamp,
  103924. pts: timestamp
  103925. }, {
  103926. type: "audio",
  103927. dts: timestamp + audioCount * 1024 * audioTimescale,
  103928. pts: timestamp + audioCount * 1024 * audioTimescale
  103929. }]
  103930. };
  103931. return result;
  103932. };
  103933. var inspectTs_ = function inspectTs_2(bytes) {
  103934. var pmt = {
  103935. pid: null,
  103936. table: null
  103937. };
  103938. var result = {};
  103939. parsePsi_(bytes, pmt);
  103940. for (var pid in pmt.table) {
  103941. if (pmt.table.hasOwnProperty(pid)) {
  103942. var type3 = pmt.table[pid];
  103943. switch (type3) {
  103944. case streamTypes.H264_STREAM_TYPE:
  103945. result.video = [];
  103946. parseVideoPes_(bytes, pmt, result);
  103947. if (result.video.length === 0) {
  103948. delete result.video;
  103949. }
  103950. break;
  103951. case streamTypes.ADTS_STREAM_TYPE:
  103952. result.audio = [];
  103953. parseAudioPes_(bytes, pmt, result);
  103954. if (result.audio.length === 0) {
  103955. delete result.audio;
  103956. }
  103957. break;
  103958. }
  103959. }
  103960. }
  103961. return result;
  103962. };
  103963. var inspect = function inspect2(bytes, baseTimestamp) {
  103964. var isAacData = probe.aac.isLikelyAacData(bytes);
  103965. var result;
  103966. if (isAacData) {
  103967. result = inspectAac_(bytes);
  103968. } else {
  103969. result = inspectTs_(bytes);
  103970. }
  103971. if (!result || !result.audio && !result.video) {
  103972. return null;
  103973. }
  103974. adjustTimestamp_(result, baseTimestamp);
  103975. return result;
  103976. };
  103977. var tsInspector = {
  103978. inspect,
  103979. parseAudioPes_
  103980. };
  103981. var wireTransmuxerEvents = function wireTransmuxerEvents2(self2, transmuxer2) {
  103982. transmuxer2.on("data", function(segment) {
  103983. var initArray = segment.initSegment;
  103984. segment.initSegment = {
  103985. data: initArray.buffer,
  103986. byteOffset: initArray.byteOffset,
  103987. byteLength: initArray.byteLength
  103988. };
  103989. var typedArray = segment.data;
  103990. segment.data = typedArray.buffer;
  103991. self2.postMessage({
  103992. action: "data",
  103993. segment,
  103994. byteOffset: typedArray.byteOffset,
  103995. byteLength: typedArray.byteLength
  103996. }, [segment.data]);
  103997. });
  103998. transmuxer2.on("done", function(data) {
  103999. self2.postMessage({
  104000. action: "done"
  104001. });
  104002. });
  104003. transmuxer2.on("gopInfo", function(gopInfo) {
  104004. self2.postMessage({
  104005. action: "gopInfo",
  104006. gopInfo
  104007. });
  104008. });
  104009. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  104010. var videoSegmentTimingInfo = {
  104011. start: {
  104012. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  104013. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104014. },
  104015. end: {
  104016. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104017. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104018. },
  104019. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104020. };
  104021. if (timingInfo.prependedContentDuration) {
  104022. videoSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104023. }
  104024. self2.postMessage({
  104025. action: "videoSegmentTimingInfo",
  104026. videoSegmentTimingInfo
  104027. });
  104028. });
  104029. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  104030. var audioSegmentTimingInfo = {
  104031. start: {
  104032. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  104033. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104034. },
  104035. end: {
  104036. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104037. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104038. },
  104039. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104040. };
  104041. if (timingInfo.prependedContentDuration) {
  104042. audioSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104043. }
  104044. self2.postMessage({
  104045. action: "audioSegmentTimingInfo",
  104046. audioSegmentTimingInfo
  104047. });
  104048. });
  104049. transmuxer2.on("id3Frame", function(id3Frame) {
  104050. self2.postMessage({
  104051. action: "id3Frame",
  104052. id3Frame
  104053. });
  104054. });
  104055. transmuxer2.on("caption", function(caption) {
  104056. self2.postMessage({
  104057. action: "caption",
  104058. caption
  104059. });
  104060. });
  104061. transmuxer2.on("trackinfo", function(trackInfo) {
  104062. self2.postMessage({
  104063. action: "trackinfo",
  104064. trackInfo
  104065. });
  104066. });
  104067. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  104068. self2.postMessage({
  104069. action: "audioTimingInfo",
  104070. audioTimingInfo: {
  104071. start: clock2.videoTsToSeconds(audioTimingInfo.start),
  104072. end: clock2.videoTsToSeconds(audioTimingInfo.end)
  104073. }
  104074. });
  104075. });
  104076. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  104077. self2.postMessage({
  104078. action: "videoTimingInfo",
  104079. videoTimingInfo: {
  104080. start: clock2.videoTsToSeconds(videoTimingInfo.start),
  104081. end: clock2.videoTsToSeconds(videoTimingInfo.end)
  104082. }
  104083. });
  104084. });
  104085. transmuxer2.on("log", function(log2) {
  104086. self2.postMessage({
  104087. action: "log",
  104088. log: log2
  104089. });
  104090. });
  104091. };
  104092. var MessageHandlers = /* @__PURE__ */ function() {
  104093. function MessageHandlers2(self2, options2) {
  104094. this.options = options2 || {};
  104095. this.self = self2;
  104096. this.init();
  104097. }
  104098. var _proto = MessageHandlers2.prototype;
  104099. _proto.init = function init() {
  104100. if (this.transmuxer) {
  104101. this.transmuxer.dispose();
  104102. }
  104103. this.transmuxer = new transmuxer.Transmuxer(this.options);
  104104. wireTransmuxerEvents(this.self, this.transmuxer);
  104105. };
  104106. _proto.pushMp4Captions = function pushMp4Captions(data) {
  104107. if (!this.captionParser) {
  104108. this.captionParser = new captionParser();
  104109. this.captionParser.init();
  104110. }
  104111. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104112. var parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  104113. this.self.postMessage({
  104114. action: "mp4Captions",
  104115. captions: parsed && parsed.captions || [],
  104116. logs: parsed && parsed.logs || [],
  104117. data: segment.buffer
  104118. }, [segment.buffer]);
  104119. };
  104120. _proto.probeMp4StartTime = function probeMp4StartTime(_ref) {
  104121. var timescales = _ref.timescales, data = _ref.data;
  104122. var startTime2 = probe$2.startTime(timescales, data);
  104123. this.self.postMessage({
  104124. action: "probeMp4StartTime",
  104125. startTime: startTime2,
  104126. data
  104127. }, [data.buffer]);
  104128. };
  104129. _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) {
  104130. var data = _ref2.data;
  104131. var tracks = probe$2.tracks(data);
  104132. this.self.postMessage({
  104133. action: "probeMp4Tracks",
  104134. tracks,
  104135. data
  104136. }, [data.buffer]);
  104137. };
  104138. _proto.probeTs = function probeTs(_ref3) {
  104139. var data = _ref3.data, baseStartTime = _ref3.baseStartTime;
  104140. var tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock2.ONE_SECOND_IN_TS : void 0;
  104141. var timeInfo = tsInspector.inspect(data, tsStartTime);
  104142. var result = null;
  104143. if (timeInfo) {
  104144. result = {
  104145. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  104146. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  104147. };
  104148. if (result.hasVideo) {
  104149. result.videoStart = timeInfo.video[0].ptsTime;
  104150. }
  104151. if (result.hasAudio) {
  104152. result.audioStart = timeInfo.audio[0].ptsTime;
  104153. }
  104154. }
  104155. this.self.postMessage({
  104156. action: "probeTs",
  104157. result,
  104158. data
  104159. }, [data.buffer]);
  104160. };
  104161. _proto.clearAllMp4Captions = function clearAllMp4Captions() {
  104162. if (this.captionParser) {
  104163. this.captionParser.clearAllCaptions();
  104164. }
  104165. };
  104166. _proto.clearParsedMp4Captions = function clearParsedMp4Captions() {
  104167. if (this.captionParser) {
  104168. this.captionParser.clearParsedCaptions();
  104169. }
  104170. };
  104171. _proto.push = function push(data) {
  104172. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104173. this.transmuxer.push(segment);
  104174. };
  104175. _proto.reset = function reset3() {
  104176. this.transmuxer.reset();
  104177. };
  104178. _proto.setTimestampOffset = function setTimestampOffset(data) {
  104179. var timestampOffset2 = data.timestampOffset || 0;
  104180. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock2.secondsToVideoTs(timestampOffset2)));
  104181. };
  104182. _proto.setAudioAppendStart = function setAudioAppendStart(data) {
  104183. this.transmuxer.setAudioAppendStart(Math.ceil(clock2.secondsToVideoTs(data.appendStart)));
  104184. };
  104185. _proto.setRemux = function setRemux(data) {
  104186. this.transmuxer.setRemux(data.remux);
  104187. };
  104188. _proto.flush = function flush(data) {
  104189. this.transmuxer.flush();
  104190. self.postMessage({
  104191. action: "done",
  104192. type: "transmuxed"
  104193. });
  104194. };
  104195. _proto.endTimeline = function endTimeline3() {
  104196. this.transmuxer.endTimeline();
  104197. self.postMessage({
  104198. action: "endedtimeline",
  104199. type: "transmuxed"
  104200. });
  104201. };
  104202. _proto.alignGopsWith = function alignGopsWith(data) {
  104203. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  104204. };
  104205. return MessageHandlers2;
  104206. }();
  104207. self.onmessage = function(event2) {
  104208. if (event2.data.action === "init" && event2.data.options) {
  104209. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  104210. return;
  104211. }
  104212. if (!this.messageHandlers) {
  104213. this.messageHandlers = new MessageHandlers(self);
  104214. }
  104215. if (event2.data && event2.data.action && event2.data.action !== "init") {
  104216. if (this.messageHandlers[event2.data.action]) {
  104217. this.messageHandlers[event2.data.action](event2.data);
  104218. }
  104219. }
  104220. };
  104221. }));
  104222. var TransmuxWorker = factory(workerCode$1);
  104223. var handleData_ = function handleData_2(event2, transmuxedData, callback2) {
  104224. var _event$data$segment = event2.data.segment, type2 = _event$data$segment.type, initSegment = _event$data$segment.initSegment, captions = _event$data$segment.captions, captionStreams = _event$data$segment.captionStreams, metadata = _event$data$segment.metadata, videoFrameDtsTime = _event$data$segment.videoFrameDtsTime, videoFramePtsTime = _event$data$segment.videoFramePtsTime;
  104225. transmuxedData.buffer.push({
  104226. captions,
  104227. captionStreams,
  104228. metadata
  104229. });
  104230. var boxes = event2.data.segment.boxes || {
  104231. data: event2.data.segment.data
  104232. };
  104233. var result = {
  104234. type: type2,
  104235. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  104236. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  104237. };
  104238. if (typeof videoFrameDtsTime !== "undefined") {
  104239. result.videoFrameDtsTime = videoFrameDtsTime;
  104240. }
  104241. if (typeof videoFramePtsTime !== "undefined") {
  104242. result.videoFramePtsTime = videoFramePtsTime;
  104243. }
  104244. callback2(result);
  104245. };
  104246. var handleDone_ = function handleDone_2(_ref) {
  104247. var transmuxedData = _ref.transmuxedData, callback2 = _ref.callback;
  104248. transmuxedData.buffer = [];
  104249. callback2(transmuxedData);
  104250. };
  104251. var handleGopInfo_ = function handleGopInfo_2(event2, transmuxedData) {
  104252. transmuxedData.gopInfo = event2.data.gopInfo;
  104253. };
  104254. var processTransmux = function processTransmux2(options2) {
  104255. var transmuxer = options2.transmuxer, bytes = options2.bytes, audioAppendStart = options2.audioAppendStart, gopsToAlignWith = options2.gopsToAlignWith, remux = options2.remux, onData = options2.onData, onTrackInfo = options2.onTrackInfo, onAudioTimingInfo = options2.onAudioTimingInfo, onVideoTimingInfo = options2.onVideoTimingInfo, onVideoSegmentTimingInfo = options2.onVideoSegmentTimingInfo, onAudioSegmentTimingInfo = options2.onAudioSegmentTimingInfo, onId3 = options2.onId3, onCaptions = options2.onCaptions, onDone = options2.onDone, onEndedTimeline = options2.onEndedTimeline, onTransmuxerLog = options2.onTransmuxerLog, isEndOfTimeline = options2.isEndOfTimeline;
  104256. var transmuxedData = {
  104257. buffer: []
  104258. };
  104259. var waitForEndedTimelineEvent = isEndOfTimeline;
  104260. var handleMessage = function handleMessage2(event2) {
  104261. if (transmuxer.currentTransmux !== options2) {
  104262. return;
  104263. }
  104264. if (event2.data.action === "data") {
  104265. handleData_(event2, transmuxedData, onData);
  104266. }
  104267. if (event2.data.action === "trackinfo") {
  104268. onTrackInfo(event2.data.trackInfo);
  104269. }
  104270. if (event2.data.action === "gopInfo") {
  104271. handleGopInfo_(event2, transmuxedData);
  104272. }
  104273. if (event2.data.action === "audioTimingInfo") {
  104274. onAudioTimingInfo(event2.data.audioTimingInfo);
  104275. }
  104276. if (event2.data.action === "videoTimingInfo") {
  104277. onVideoTimingInfo(event2.data.videoTimingInfo);
  104278. }
  104279. if (event2.data.action === "videoSegmentTimingInfo") {
  104280. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  104281. }
  104282. if (event2.data.action === "audioSegmentTimingInfo") {
  104283. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  104284. }
  104285. if (event2.data.action === "id3Frame") {
  104286. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  104287. }
  104288. if (event2.data.action === "caption") {
  104289. onCaptions(event2.data.caption);
  104290. }
  104291. if (event2.data.action === "endedtimeline") {
  104292. waitForEndedTimelineEvent = false;
  104293. onEndedTimeline();
  104294. }
  104295. if (event2.data.action === "log") {
  104296. onTransmuxerLog(event2.data.log);
  104297. }
  104298. if (event2.data.type !== "transmuxed") {
  104299. return;
  104300. }
  104301. if (waitForEndedTimelineEvent) {
  104302. return;
  104303. }
  104304. transmuxer.onmessage = null;
  104305. handleDone_({
  104306. transmuxedData,
  104307. callback: onDone
  104308. });
  104309. dequeue(transmuxer);
  104310. };
  104311. transmuxer.onmessage = handleMessage;
  104312. if (audioAppendStart) {
  104313. transmuxer.postMessage({
  104314. action: "setAudioAppendStart",
  104315. appendStart: audioAppendStart
  104316. });
  104317. }
  104318. if (Array.isArray(gopsToAlignWith)) {
  104319. transmuxer.postMessage({
  104320. action: "alignGopsWith",
  104321. gopsToAlignWith
  104322. });
  104323. }
  104324. if (typeof remux !== "undefined") {
  104325. transmuxer.postMessage({
  104326. action: "setRemux",
  104327. remux
  104328. });
  104329. }
  104330. if (bytes.byteLength) {
  104331. var buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  104332. var byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  104333. transmuxer.postMessage({
  104334. action: "push",
  104335. data: buffer,
  104336. byteOffset,
  104337. byteLength: bytes.byteLength
  104338. }, [buffer]);
  104339. }
  104340. if (isEndOfTimeline) {
  104341. transmuxer.postMessage({
  104342. action: "endTimeline"
  104343. });
  104344. }
  104345. transmuxer.postMessage({
  104346. action: "flush"
  104347. });
  104348. };
  104349. var dequeue = function dequeue2(transmuxer) {
  104350. transmuxer.currentTransmux = null;
  104351. if (transmuxer.transmuxQueue.length) {
  104352. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  104353. if (typeof transmuxer.currentTransmux === "function") {
  104354. transmuxer.currentTransmux();
  104355. } else {
  104356. processTransmux(transmuxer.currentTransmux);
  104357. }
  104358. }
  104359. };
  104360. var processAction = function processAction2(transmuxer, action) {
  104361. transmuxer.postMessage({
  104362. action
  104363. });
  104364. dequeue(transmuxer);
  104365. };
  104366. var enqueueAction = function enqueueAction2(action, transmuxer) {
  104367. if (!transmuxer.currentTransmux) {
  104368. transmuxer.currentTransmux = action;
  104369. processAction(transmuxer, action);
  104370. return;
  104371. }
  104372. transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));
  104373. };
  104374. var reset = function reset2(transmuxer) {
  104375. enqueueAction("reset", transmuxer);
  104376. };
  104377. var endTimeline = function endTimeline2(transmuxer) {
  104378. enqueueAction("endTimeline", transmuxer);
  104379. };
  104380. var transmux = function transmux2(options2) {
  104381. if (!options2.transmuxer.currentTransmux) {
  104382. options2.transmuxer.currentTransmux = options2;
  104383. processTransmux(options2);
  104384. return;
  104385. }
  104386. options2.transmuxer.transmuxQueue.push(options2);
  104387. };
  104388. var createTransmuxer = function createTransmuxer2(options2) {
  104389. var transmuxer = new TransmuxWorker();
  104390. transmuxer.currentTransmux = null;
  104391. transmuxer.transmuxQueue = [];
  104392. var term = transmuxer.terminate;
  104393. transmuxer.terminate = function() {
  104394. transmuxer.currentTransmux = null;
  104395. transmuxer.transmuxQueue.length = 0;
  104396. return term.call(transmuxer);
  104397. };
  104398. transmuxer.postMessage({
  104399. action: "init",
  104400. options: options2
  104401. });
  104402. return transmuxer;
  104403. };
  104404. var segmentTransmuxer = {
  104405. reset,
  104406. endTimeline,
  104407. transmux,
  104408. createTransmuxer
  104409. };
  104410. var workerCallback = function workerCallback2(options2) {
  104411. var transmuxer = options2.transmuxer;
  104412. var endAction = options2.endAction || options2.action;
  104413. var callback2 = options2.callback;
  104414. var message = _extends$2({}, options2, {
  104415. endAction: null,
  104416. transmuxer: null,
  104417. callback: null
  104418. });
  104419. var listenForEndEvent = function listenForEndEvent2(event2) {
  104420. if (event2.data.action !== endAction) {
  104421. return;
  104422. }
  104423. transmuxer.removeEventListener("message", listenForEndEvent2);
  104424. if (event2.data.data) {
  104425. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  104426. if (options2.data) {
  104427. options2.data = event2.data.data;
  104428. }
  104429. }
  104430. callback2(event2.data);
  104431. };
  104432. transmuxer.addEventListener("message", listenForEndEvent);
  104433. if (options2.data) {
  104434. var isArrayBuffer = options2.data instanceof ArrayBuffer;
  104435. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  104436. message.byteLength = options2.data.byteLength;
  104437. var transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  104438. transmuxer.postMessage(message, transfers);
  104439. } else {
  104440. transmuxer.postMessage(message);
  104441. }
  104442. };
  104443. var REQUEST_ERRORS = {
  104444. FAILURE: 2,
  104445. TIMEOUT: -101,
  104446. ABORTED: -102
  104447. };
  104448. var abortAll = function abortAll2(activeXhrs) {
  104449. activeXhrs.forEach(function(xhr) {
  104450. xhr.abort();
  104451. });
  104452. };
  104453. var getRequestStats = function getRequestStats2(request) {
  104454. return {
  104455. bandwidth: request.bandwidth,
  104456. bytesReceived: request.bytesReceived || 0,
  104457. roundTripTime: request.roundTripTime || 0
  104458. };
  104459. };
  104460. var getProgressStats = function getProgressStats2(progressEvent) {
  104461. var request = progressEvent.target;
  104462. var roundTripTime = Date.now() - request.requestTime;
  104463. var stats = {
  104464. bandwidth: Infinity,
  104465. bytesReceived: 0,
  104466. roundTripTime: roundTripTime || 0
  104467. };
  104468. stats.bytesReceived = progressEvent.loaded;
  104469. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  104470. return stats;
  104471. };
  104472. var handleErrors = function handleErrors2(error, request) {
  104473. if (request.timedout) {
  104474. return {
  104475. status: request.status,
  104476. message: "HLS request timed-out at URL: " + request.uri,
  104477. code: REQUEST_ERRORS.TIMEOUT,
  104478. xhr: request
  104479. };
  104480. }
  104481. if (request.aborted) {
  104482. return {
  104483. status: request.status,
  104484. message: "HLS request aborted at URL: " + request.uri,
  104485. code: REQUEST_ERRORS.ABORTED,
  104486. xhr: request
  104487. };
  104488. }
  104489. if (error) {
  104490. return {
  104491. status: request.status,
  104492. message: "HLS request errored at URL: " + request.uri,
  104493. code: REQUEST_ERRORS.FAILURE,
  104494. xhr: request
  104495. };
  104496. }
  104497. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  104498. return {
  104499. status: request.status,
  104500. message: "Empty HLS response at URL: " + request.uri,
  104501. code: REQUEST_ERRORS.FAILURE,
  104502. xhr: request
  104503. };
  104504. }
  104505. return null;
  104506. };
  104507. var handleKeyResponse = function handleKeyResponse2(segment, objects, finishProcessingFn) {
  104508. return function(error, request) {
  104509. var response = request.response;
  104510. var errorObj = handleErrors(error, request);
  104511. if (errorObj) {
  104512. return finishProcessingFn(errorObj, segment);
  104513. }
  104514. if (response.byteLength !== 16) {
  104515. return finishProcessingFn({
  104516. status: request.status,
  104517. message: "Invalid HLS key at URL: " + request.uri,
  104518. code: REQUEST_ERRORS.FAILURE,
  104519. xhr: request
  104520. }, segment);
  104521. }
  104522. var view = new DataView(response);
  104523. var bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  104524. for (var i2 = 0; i2 < objects.length; i2++) {
  104525. objects[i2].bytes = bytes;
  104526. }
  104527. return finishProcessingFn(null, segment);
  104528. };
  104529. };
  104530. var parseInitSegment = function parseInitSegment2(segment, _callback) {
  104531. var type2 = detectContainerForBytes2(segment.map.bytes);
  104532. if (type2 !== "mp4") {
  104533. var uri = segment.map.resolvedUri || segment.map.uri;
  104534. return _callback({
  104535. internal: true,
  104536. message: "Found unsupported " + (type2 || "unknown") + " container for initialization segment at URL: " + uri,
  104537. code: REQUEST_ERRORS.FAILURE
  104538. });
  104539. }
  104540. workerCallback({
  104541. action: "probeMp4Tracks",
  104542. data: segment.map.bytes,
  104543. transmuxer: segment.transmuxer,
  104544. callback: function callback2(_ref) {
  104545. var tracks = _ref.tracks, data = _ref.data;
  104546. segment.map.bytes = data;
  104547. tracks.forEach(function(track) {
  104548. segment.map.tracks = segment.map.tracks || {};
  104549. if (segment.map.tracks[track.type]) {
  104550. return;
  104551. }
  104552. segment.map.tracks[track.type] = track;
  104553. if (typeof track.id === "number" && track.timescale) {
  104554. segment.map.timescales = segment.map.timescales || {};
  104555. segment.map.timescales[track.id] = track.timescale;
  104556. }
  104557. });
  104558. return _callback(null);
  104559. }
  104560. });
  104561. };
  104562. var handleInitSegmentResponse = function handleInitSegmentResponse2(_ref2) {
  104563. var segment = _ref2.segment, finishProcessingFn = _ref2.finishProcessingFn;
  104564. return function(error, request) {
  104565. var errorObj = handleErrors(error, request);
  104566. if (errorObj) {
  104567. return finishProcessingFn(errorObj, segment);
  104568. }
  104569. var bytes = new Uint8Array(request.response);
  104570. if (segment.map.key) {
  104571. segment.map.encryptedBytes = bytes;
  104572. return finishProcessingFn(null, segment);
  104573. }
  104574. segment.map.bytes = bytes;
  104575. parseInitSegment(segment, function(parseError) {
  104576. if (parseError) {
  104577. parseError.xhr = request;
  104578. parseError.status = request.status;
  104579. return finishProcessingFn(parseError, segment);
  104580. }
  104581. finishProcessingFn(null, segment);
  104582. });
  104583. };
  104584. };
  104585. var handleSegmentResponse = function handleSegmentResponse2(_ref3) {
  104586. var segment = _ref3.segment, finishProcessingFn = _ref3.finishProcessingFn, responseType = _ref3.responseType;
  104587. return function(error, request) {
  104588. var errorObj = handleErrors(error, request);
  104589. if (errorObj) {
  104590. return finishProcessingFn(errorObj, segment);
  104591. }
  104592. var newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));
  104593. segment.stats = getRequestStats(request);
  104594. if (segment.key) {
  104595. segment.encryptedBytes = new Uint8Array(newBytes);
  104596. } else {
  104597. segment.bytes = new Uint8Array(newBytes);
  104598. }
  104599. return finishProcessingFn(null, segment);
  104600. };
  104601. };
  104602. var transmuxAndNotify = function transmuxAndNotify2(_ref4) {
  104603. var segment = _ref4.segment, bytes = _ref4.bytes, trackInfoFn = _ref4.trackInfoFn, timingInfoFn = _ref4.timingInfoFn, videoSegmentTimingInfoFn = _ref4.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref4.audioSegmentTimingInfoFn, id3Fn = _ref4.id3Fn, captionsFn = _ref4.captionsFn, isEndOfTimeline = _ref4.isEndOfTimeline, endedTimelineFn = _ref4.endedTimelineFn, dataFn = _ref4.dataFn, doneFn = _ref4.doneFn, onTransmuxerLog = _ref4.onTransmuxerLog;
  104604. var fmp4Tracks = segment.map && segment.map.tracks || {};
  104605. var isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  104606. var audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  104607. var audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  104608. var videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  104609. var videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  104610. var finish = function finish2() {
  104611. return transmux({
  104612. bytes,
  104613. transmuxer: segment.transmuxer,
  104614. audioAppendStart: segment.audioAppendStart,
  104615. gopsToAlignWith: segment.gopsToAlignWith,
  104616. remux: isMuxed3,
  104617. onData: function onData(result) {
  104618. result.type = result.type === "combined" ? "video" : result.type;
  104619. dataFn(segment, result);
  104620. },
  104621. onTrackInfo: function onTrackInfo(trackInfo) {
  104622. if (trackInfoFn) {
  104623. if (isMuxed3) {
  104624. trackInfo.isMuxed = true;
  104625. }
  104626. trackInfoFn(segment, trackInfo);
  104627. }
  104628. },
  104629. onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) {
  104630. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  104631. audioStartFn(audioTimingInfo.start);
  104632. audioStartFn = null;
  104633. }
  104634. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  104635. audioEndFn(audioTimingInfo.end);
  104636. }
  104637. },
  104638. onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) {
  104639. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  104640. videoStartFn(videoTimingInfo.start);
  104641. videoStartFn = null;
  104642. }
  104643. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  104644. videoEndFn(videoTimingInfo.end);
  104645. }
  104646. },
  104647. onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) {
  104648. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  104649. },
  104650. onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) {
  104651. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  104652. },
  104653. onId3: function onId3(id3Frames, dispatchType) {
  104654. id3Fn(segment, id3Frames, dispatchType);
  104655. },
  104656. onCaptions: function onCaptions(captions) {
  104657. captionsFn(segment, [captions]);
  104658. },
  104659. isEndOfTimeline,
  104660. onEndedTimeline: function onEndedTimeline() {
  104661. endedTimelineFn();
  104662. },
  104663. onTransmuxerLog,
  104664. onDone: function onDone(result) {
  104665. if (!doneFn) {
  104666. return;
  104667. }
  104668. result.type = result.type === "combined" ? "video" : result.type;
  104669. doneFn(null, segment, result);
  104670. }
  104671. });
  104672. };
  104673. workerCallback({
  104674. action: "probeTs",
  104675. transmuxer: segment.transmuxer,
  104676. data: bytes,
  104677. baseStartTime: segment.baseStartTime,
  104678. callback: function callback2(data) {
  104679. segment.bytes = bytes = data.data;
  104680. var probeResult = data.result;
  104681. if (probeResult) {
  104682. trackInfoFn(segment, {
  104683. hasAudio: probeResult.hasAudio,
  104684. hasVideo: probeResult.hasVideo,
  104685. isMuxed: isMuxed3
  104686. });
  104687. trackInfoFn = null;
  104688. if (probeResult.hasAudio && !isMuxed3) {
  104689. audioStartFn(probeResult.audioStart);
  104690. }
  104691. if (probeResult.hasVideo) {
  104692. videoStartFn(probeResult.videoStart);
  104693. }
  104694. audioStartFn = null;
  104695. videoStartFn = null;
  104696. }
  104697. finish();
  104698. }
  104699. });
  104700. };
  104701. var handleSegmentBytes = function handleSegmentBytes2(_ref5) {
  104702. var segment = _ref5.segment, bytes = _ref5.bytes, trackInfoFn = _ref5.trackInfoFn, timingInfoFn = _ref5.timingInfoFn, videoSegmentTimingInfoFn = _ref5.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref5.audioSegmentTimingInfoFn, id3Fn = _ref5.id3Fn, captionsFn = _ref5.captionsFn, isEndOfTimeline = _ref5.isEndOfTimeline, endedTimelineFn = _ref5.endedTimelineFn, dataFn = _ref5.dataFn, doneFn = _ref5.doneFn, onTransmuxerLog = _ref5.onTransmuxerLog;
  104703. var bytesAsUint8Array = new Uint8Array(bytes);
  104704. if (isLikelyFmp4MediaSegment2(bytesAsUint8Array)) {
  104705. segment.isFmp4 = true;
  104706. var tracks = segment.map.tracks;
  104707. var trackInfo = {
  104708. isFmp4: true,
  104709. hasVideo: !!tracks.video,
  104710. hasAudio: !!tracks.audio
  104711. };
  104712. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  104713. trackInfo.audioCodec = tracks.audio.codec;
  104714. }
  104715. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  104716. trackInfo.videoCodec = tracks.video.codec;
  104717. }
  104718. if (tracks.video && tracks.audio) {
  104719. trackInfo.isMuxed = true;
  104720. }
  104721. trackInfoFn(segment, trackInfo);
  104722. var finishLoading = function finishLoading2(captions) {
  104723. dataFn(segment, {
  104724. data: bytesAsUint8Array,
  104725. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  104726. });
  104727. if (captions && captions.length) {
  104728. captionsFn(segment, captions);
  104729. }
  104730. doneFn(null, segment, {});
  104731. };
  104732. workerCallback({
  104733. action: "probeMp4StartTime",
  104734. timescales: segment.map.timescales,
  104735. data: bytesAsUint8Array,
  104736. transmuxer: segment.transmuxer,
  104737. callback: function callback2(_ref6) {
  104738. var data = _ref6.data, startTime = _ref6.startTime;
  104739. bytes = data.buffer;
  104740. segment.bytes = bytesAsUint8Array = data;
  104741. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  104742. timingInfoFn(segment, "audio", "start", startTime);
  104743. }
  104744. if (trackInfo.hasVideo) {
  104745. timingInfoFn(segment, "video", "start", startTime);
  104746. }
  104747. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  104748. finishLoading();
  104749. return;
  104750. }
  104751. workerCallback({
  104752. action: "pushMp4Captions",
  104753. endAction: "mp4Captions",
  104754. transmuxer: segment.transmuxer,
  104755. data: bytesAsUint8Array,
  104756. timescales: segment.map.timescales,
  104757. trackIds: [tracks.video.id],
  104758. callback: function callback3(message) {
  104759. bytes = message.data.buffer;
  104760. segment.bytes = bytesAsUint8Array = message.data;
  104761. message.logs.forEach(function(log2) {
  104762. onTransmuxerLog(videojs.mergeOptions(log2, {
  104763. stream: "mp4CaptionParser"
  104764. }));
  104765. });
  104766. finishLoading(message.captions);
  104767. }
  104768. });
  104769. }
  104770. });
  104771. return;
  104772. }
  104773. if (!segment.transmuxer) {
  104774. doneFn(null, segment, {});
  104775. return;
  104776. }
  104777. if (typeof segment.container === "undefined") {
  104778. segment.container = detectContainerForBytes2(bytesAsUint8Array);
  104779. }
  104780. if (segment.container !== "ts" && segment.container !== "aac") {
  104781. trackInfoFn(segment, {
  104782. hasAudio: false,
  104783. hasVideo: false
  104784. });
  104785. doneFn(null, segment, {});
  104786. return;
  104787. }
  104788. transmuxAndNotify({
  104789. segment,
  104790. bytes,
  104791. trackInfoFn,
  104792. timingInfoFn,
  104793. videoSegmentTimingInfoFn,
  104794. audioSegmentTimingInfoFn,
  104795. id3Fn,
  104796. captionsFn,
  104797. isEndOfTimeline,
  104798. endedTimelineFn,
  104799. dataFn,
  104800. doneFn,
  104801. onTransmuxerLog
  104802. });
  104803. };
  104804. var decrypt = function decrypt2(_ref7, callback2) {
  104805. var id = _ref7.id, key = _ref7.key, encryptedBytes = _ref7.encryptedBytes, decryptionWorker = _ref7.decryptionWorker;
  104806. var decryptionHandler = function decryptionHandler2(event2) {
  104807. if (event2.data.source === id) {
  104808. decryptionWorker.removeEventListener("message", decryptionHandler2);
  104809. var decrypted = event2.data.decrypted;
  104810. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  104811. }
  104812. };
  104813. decryptionWorker.addEventListener("message", decryptionHandler);
  104814. var keyBytes;
  104815. if (key.bytes.slice) {
  104816. keyBytes = key.bytes.slice();
  104817. } else {
  104818. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  104819. }
  104820. decryptionWorker.postMessage(createTransferableMessage({
  104821. source: id,
  104822. encrypted: encryptedBytes,
  104823. key: keyBytes,
  104824. iv: key.iv
  104825. }), [encryptedBytes.buffer, keyBytes.buffer]);
  104826. };
  104827. var decryptSegment = function decryptSegment2(_ref8) {
  104828. var decryptionWorker = _ref8.decryptionWorker, segment = _ref8.segment, trackInfoFn = _ref8.trackInfoFn, timingInfoFn = _ref8.timingInfoFn, videoSegmentTimingInfoFn = _ref8.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref8.audioSegmentTimingInfoFn, id3Fn = _ref8.id3Fn, captionsFn = _ref8.captionsFn, isEndOfTimeline = _ref8.isEndOfTimeline, endedTimelineFn = _ref8.endedTimelineFn, dataFn = _ref8.dataFn, doneFn = _ref8.doneFn, onTransmuxerLog = _ref8.onTransmuxerLog;
  104829. decrypt({
  104830. id: segment.requestId,
  104831. key: segment.key,
  104832. encryptedBytes: segment.encryptedBytes,
  104833. decryptionWorker
  104834. }, function(decryptedBytes) {
  104835. segment.bytes = decryptedBytes;
  104836. handleSegmentBytes({
  104837. segment,
  104838. bytes: segment.bytes,
  104839. trackInfoFn,
  104840. timingInfoFn,
  104841. videoSegmentTimingInfoFn,
  104842. audioSegmentTimingInfoFn,
  104843. id3Fn,
  104844. captionsFn,
  104845. isEndOfTimeline,
  104846. endedTimelineFn,
  104847. dataFn,
  104848. doneFn,
  104849. onTransmuxerLog
  104850. });
  104851. });
  104852. };
  104853. var waitForCompletion = function waitForCompletion2(_ref9) {
  104854. var activeXhrs = _ref9.activeXhrs, decryptionWorker = _ref9.decryptionWorker, trackInfoFn = _ref9.trackInfoFn, timingInfoFn = _ref9.timingInfoFn, videoSegmentTimingInfoFn = _ref9.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref9.audioSegmentTimingInfoFn, id3Fn = _ref9.id3Fn, captionsFn = _ref9.captionsFn, isEndOfTimeline = _ref9.isEndOfTimeline, endedTimelineFn = _ref9.endedTimelineFn, dataFn = _ref9.dataFn, doneFn = _ref9.doneFn, onTransmuxerLog = _ref9.onTransmuxerLog;
  104855. var count = 0;
  104856. var didError = false;
  104857. return function(error, segment) {
  104858. if (didError) {
  104859. return;
  104860. }
  104861. if (error) {
  104862. didError = true;
  104863. abortAll(activeXhrs);
  104864. return doneFn(error, segment);
  104865. }
  104866. count += 1;
  104867. if (count === activeXhrs.length) {
  104868. var segmentFinish = function segmentFinish2() {
  104869. if (segment.encryptedBytes) {
  104870. return decryptSegment({
  104871. decryptionWorker,
  104872. segment,
  104873. trackInfoFn,
  104874. timingInfoFn,
  104875. videoSegmentTimingInfoFn,
  104876. audioSegmentTimingInfoFn,
  104877. id3Fn,
  104878. captionsFn,
  104879. isEndOfTimeline,
  104880. endedTimelineFn,
  104881. dataFn,
  104882. doneFn,
  104883. onTransmuxerLog
  104884. });
  104885. }
  104886. handleSegmentBytes({
  104887. segment,
  104888. bytes: segment.bytes,
  104889. trackInfoFn,
  104890. timingInfoFn,
  104891. videoSegmentTimingInfoFn,
  104892. audioSegmentTimingInfoFn,
  104893. id3Fn,
  104894. captionsFn,
  104895. isEndOfTimeline,
  104896. endedTimelineFn,
  104897. dataFn,
  104898. doneFn,
  104899. onTransmuxerLog
  104900. });
  104901. };
  104902. segment.endOfAllRequests = Date.now();
  104903. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  104904. return decrypt({
  104905. decryptionWorker,
  104906. id: segment.requestId + "-init",
  104907. encryptedBytes: segment.map.encryptedBytes,
  104908. key: segment.map.key
  104909. }, function(decryptedBytes) {
  104910. segment.map.bytes = decryptedBytes;
  104911. parseInitSegment(segment, function(parseError) {
  104912. if (parseError) {
  104913. abortAll(activeXhrs);
  104914. return doneFn(parseError, segment);
  104915. }
  104916. segmentFinish();
  104917. });
  104918. });
  104919. }
  104920. segmentFinish();
  104921. }
  104922. };
  104923. };
  104924. var handleLoadEnd = function handleLoadEnd2(_ref10) {
  104925. var loadendState = _ref10.loadendState, abortFn = _ref10.abortFn;
  104926. return function(event2) {
  104927. var request = event2.target;
  104928. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  104929. abortFn();
  104930. loadendState.calledAbortFn = true;
  104931. }
  104932. };
  104933. };
  104934. var handleProgress = function handleProgress2(_ref11) {
  104935. var segment = _ref11.segment, progressFn = _ref11.progressFn;
  104936. _ref11.trackInfoFn;
  104937. _ref11.timingInfoFn;
  104938. _ref11.videoSegmentTimingInfoFn;
  104939. _ref11.audioSegmentTimingInfoFn;
  104940. _ref11.id3Fn;
  104941. _ref11.captionsFn;
  104942. _ref11.isEndOfTimeline;
  104943. _ref11.endedTimelineFn;
  104944. _ref11.dataFn;
  104945. return function(event2) {
  104946. var request = event2.target;
  104947. if (request.aborted) {
  104948. return;
  104949. }
  104950. segment.stats = videojs.mergeOptions(segment.stats, getProgressStats(event2));
  104951. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  104952. segment.stats.firstBytesReceivedAt = Date.now();
  104953. }
  104954. return progressFn(event2, segment);
  104955. };
  104956. };
  104957. var mediaSegmentRequest = function mediaSegmentRequest2(_ref12) {
  104958. var xhr = _ref12.xhr, xhrOptions = _ref12.xhrOptions, decryptionWorker = _ref12.decryptionWorker, segment = _ref12.segment, abortFn = _ref12.abortFn, progressFn = _ref12.progressFn, trackInfoFn = _ref12.trackInfoFn, timingInfoFn = _ref12.timingInfoFn, videoSegmentTimingInfoFn = _ref12.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref12.audioSegmentTimingInfoFn, id3Fn = _ref12.id3Fn, captionsFn = _ref12.captionsFn, isEndOfTimeline = _ref12.isEndOfTimeline, endedTimelineFn = _ref12.endedTimelineFn, dataFn = _ref12.dataFn, doneFn = _ref12.doneFn, onTransmuxerLog = _ref12.onTransmuxerLog;
  104959. var activeXhrs = [];
  104960. var finishProcessingFn = waitForCompletion({
  104961. activeXhrs,
  104962. decryptionWorker,
  104963. trackInfoFn,
  104964. timingInfoFn,
  104965. videoSegmentTimingInfoFn,
  104966. audioSegmentTimingInfoFn,
  104967. id3Fn,
  104968. captionsFn,
  104969. isEndOfTimeline,
  104970. endedTimelineFn,
  104971. dataFn,
  104972. doneFn,
  104973. onTransmuxerLog
  104974. });
  104975. if (segment.key && !segment.key.bytes) {
  104976. var objects = [segment.key];
  104977. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  104978. objects.push(segment.map.key);
  104979. }
  104980. var keyRequestOptions = videojs.mergeOptions(xhrOptions, {
  104981. uri: segment.key.resolvedUri,
  104982. responseType: "arraybuffer"
  104983. });
  104984. var keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);
  104985. var keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  104986. activeXhrs.push(keyXhr);
  104987. }
  104988. if (segment.map && !segment.map.bytes) {
  104989. var differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  104990. if (differentMapKey) {
  104991. var mapKeyRequestOptions = videojs.mergeOptions(xhrOptions, {
  104992. uri: segment.map.key.resolvedUri,
  104993. responseType: "arraybuffer"
  104994. });
  104995. var mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);
  104996. var mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  104997. activeXhrs.push(mapKeyXhr);
  104998. }
  104999. var initSegmentOptions = videojs.mergeOptions(xhrOptions, {
  105000. uri: segment.map.resolvedUri,
  105001. responseType: "arraybuffer",
  105002. headers: segmentXhrHeaders(segment.map)
  105003. });
  105004. var initSegmentRequestCallback = handleInitSegmentResponse({
  105005. segment,
  105006. finishProcessingFn
  105007. });
  105008. var initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  105009. activeXhrs.push(initSegmentXhr);
  105010. }
  105011. var segmentRequestOptions = videojs.mergeOptions(xhrOptions, {
  105012. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  105013. responseType: "arraybuffer",
  105014. headers: segmentXhrHeaders(segment)
  105015. });
  105016. var segmentRequestCallback = handleSegmentResponse({
  105017. segment,
  105018. finishProcessingFn,
  105019. responseType: segmentRequestOptions.responseType
  105020. });
  105021. var segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  105022. segmentXhr.addEventListener("progress", handleProgress({
  105023. segment,
  105024. progressFn,
  105025. trackInfoFn,
  105026. timingInfoFn,
  105027. videoSegmentTimingInfoFn,
  105028. audioSegmentTimingInfoFn,
  105029. id3Fn,
  105030. captionsFn,
  105031. isEndOfTimeline,
  105032. endedTimelineFn,
  105033. dataFn
  105034. }));
  105035. activeXhrs.push(segmentXhr);
  105036. var loadendState = {};
  105037. activeXhrs.forEach(function(activeXhr) {
  105038. activeXhr.addEventListener("loadend", handleLoadEnd({
  105039. loadendState,
  105040. abortFn
  105041. }));
  105042. });
  105043. return function() {
  105044. return abortAll(activeXhrs);
  105045. };
  105046. };
  105047. var logFn$1 = logger("CodecUtils");
  105048. var getCodecs = function getCodecs2(media) {
  105049. var mediaAttributes = media.attributes || {};
  105050. if (mediaAttributes.CODECS) {
  105051. return parseCodecs2(mediaAttributes.CODECS);
  105052. }
  105053. };
  105054. var isMaat = function isMaat2(master, media) {
  105055. var mediaAttributes = media.attributes || {};
  105056. return master && master.mediaGroups && master.mediaGroups.AUDIO && mediaAttributes.AUDIO && master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105057. };
  105058. var isMuxed = function isMuxed2(master, media) {
  105059. if (!isMaat(master, media)) {
  105060. return true;
  105061. }
  105062. var mediaAttributes = media.attributes || {};
  105063. var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105064. for (var groupId in audioGroup) {
  105065. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  105066. return true;
  105067. }
  105068. }
  105069. return false;
  105070. };
  105071. var unwrapCodecList = function unwrapCodecList2(codecList) {
  105072. var codecs = {};
  105073. codecList.forEach(function(_ref) {
  105074. var mediaType = _ref.mediaType, type2 = _ref.type, details = _ref.details;
  105075. codecs[mediaType] = codecs[mediaType] || [];
  105076. codecs[mediaType].push(translateLegacyCodec2("" + type2 + details));
  105077. });
  105078. Object.keys(codecs).forEach(function(mediaType) {
  105079. if (codecs[mediaType].length > 1) {
  105080. logFn$1("multiple " + mediaType + " codecs found as attributes: " + codecs[mediaType].join(", ") + ". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.");
  105081. codecs[mediaType] = null;
  105082. return;
  105083. }
  105084. codecs[mediaType] = codecs[mediaType][0];
  105085. });
  105086. return codecs;
  105087. };
  105088. var codecCount = function codecCount2(codecObj) {
  105089. var count = 0;
  105090. if (codecObj.audio) {
  105091. count++;
  105092. }
  105093. if (codecObj.video) {
  105094. count++;
  105095. }
  105096. return count;
  105097. };
  105098. var codecsForPlaylist = function codecsForPlaylist2(master, media) {
  105099. var mediaAttributes = media.attributes || {};
  105100. var codecInfo = unwrapCodecList(getCodecs(media) || []);
  105101. if (isMaat(master, media) && !codecInfo.audio) {
  105102. if (!isMuxed(master, media)) {
  105103. var defaultCodecs = unwrapCodecList(codecsFromDefault2(master, mediaAttributes.AUDIO) || []);
  105104. if (defaultCodecs.audio) {
  105105. codecInfo.audio = defaultCodecs.audio;
  105106. }
  105107. }
  105108. }
  105109. return codecInfo;
  105110. };
  105111. var logFn = logger("PlaylistSelector");
  105112. var representationToString = function representationToString2(representation) {
  105113. if (!representation || !representation.playlist) {
  105114. return;
  105115. }
  105116. var playlist = representation.playlist;
  105117. return JSON.stringify({
  105118. id: playlist.id,
  105119. bandwidth: representation.bandwidth,
  105120. width: representation.width,
  105121. height: representation.height,
  105122. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  105123. });
  105124. };
  105125. var safeGetComputedStyle = function safeGetComputedStyle2(el, property) {
  105126. if (!el) {
  105127. return "";
  105128. }
  105129. var result = window_1.getComputedStyle(el);
  105130. if (!result) {
  105131. return "";
  105132. }
  105133. return result[property];
  105134. };
  105135. var stableSort = function stableSort2(array, sortFn) {
  105136. var newArray = array.slice();
  105137. array.sort(function(left, right) {
  105138. var cmp = sortFn(left, right);
  105139. if (cmp === 0) {
  105140. return newArray.indexOf(left) - newArray.indexOf(right);
  105141. }
  105142. return cmp;
  105143. });
  105144. };
  105145. var comparePlaylistBandwidth = function comparePlaylistBandwidth2(left, right) {
  105146. var leftBandwidth;
  105147. var rightBandwidth;
  105148. if (left.attributes.BANDWIDTH) {
  105149. leftBandwidth = left.attributes.BANDWIDTH;
  105150. }
  105151. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  105152. if (right.attributes.BANDWIDTH) {
  105153. rightBandwidth = right.attributes.BANDWIDTH;
  105154. }
  105155. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  105156. return leftBandwidth - rightBandwidth;
  105157. };
  105158. var comparePlaylistResolution = function comparePlaylistResolution2(left, right) {
  105159. var leftWidth;
  105160. var rightWidth;
  105161. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  105162. leftWidth = left.attributes.RESOLUTION.width;
  105163. }
  105164. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  105165. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  105166. rightWidth = right.attributes.RESOLUTION.width;
  105167. }
  105168. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  105169. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  105170. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  105171. }
  105172. return leftWidth - rightWidth;
  105173. };
  105174. var simpleSelector = function simpleSelector2(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, masterPlaylistController) {
  105175. if (!master) {
  105176. return;
  105177. }
  105178. var options2 = {
  105179. bandwidth: playerBandwidth,
  105180. width: playerWidth,
  105181. height: playerHeight,
  105182. limitRenditionByPlayerDimensions
  105183. };
  105184. var playlists = master.playlists;
  105185. if (Playlist.isAudioOnly(master)) {
  105186. playlists = masterPlaylistController.getAudioTrackPlaylists_();
  105187. options2.audioOnly = true;
  105188. }
  105189. var sortedPlaylistReps = playlists.map(function(playlist) {
  105190. var bandwidth2;
  105191. var width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  105192. var height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  105193. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  105194. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  105195. return {
  105196. bandwidth: bandwidth2,
  105197. width: width2,
  105198. height: height2,
  105199. playlist
  105200. };
  105201. });
  105202. stableSort(sortedPlaylistReps, function(left, right) {
  105203. return left.bandwidth - right.bandwidth;
  105204. });
  105205. sortedPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105206. return !Playlist.isIncompatible(rep2.playlist);
  105207. });
  105208. var enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105209. return Playlist.isEnabled(rep2.playlist);
  105210. });
  105211. if (!enabledPlaylistReps.length) {
  105212. enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105213. return !Playlist.isDisabled(rep2.playlist);
  105214. });
  105215. }
  105216. var bandwidthPlaylistReps = enabledPlaylistReps.filter(function(rep2) {
  105217. return rep2.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;
  105218. });
  105219. var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  105220. var bandwidthBestRep = bandwidthPlaylistReps.filter(function(rep2) {
  105221. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105222. })[0];
  105223. if (limitRenditionByPlayerDimensions === false) {
  105224. var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105225. if (_chosenRep && _chosenRep.playlist) {
  105226. var type2 = "sortedPlaylistReps";
  105227. if (bandwidthBestRep) {
  105228. type2 = "bandwidthBestRep";
  105229. }
  105230. if (enabledPlaylistReps[0]) {
  105231. type2 = "enabledPlaylistReps";
  105232. }
  105233. logFn("choosing " + representationToString(_chosenRep) + " using " + type2 + " with options", options2);
  105234. return _chosenRep.playlist;
  105235. }
  105236. logFn("could not choose a playlist with options", options2);
  105237. return null;
  105238. }
  105239. var haveResolution = bandwidthPlaylistReps.filter(function(rep2) {
  105240. return rep2.width && rep2.height;
  105241. });
  105242. stableSort(haveResolution, function(left, right) {
  105243. return left.width - right.width;
  105244. });
  105245. var resolutionBestRepList = haveResolution.filter(function(rep2) {
  105246. return rep2.width === playerWidth && rep2.height === playerHeight;
  105247. });
  105248. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  105249. var resolutionBestRep = resolutionBestRepList.filter(function(rep2) {
  105250. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105251. })[0];
  105252. var resolutionPlusOneList;
  105253. var resolutionPlusOneSmallest;
  105254. var resolutionPlusOneRep;
  105255. if (!resolutionBestRep) {
  105256. resolutionPlusOneList = haveResolution.filter(function(rep2) {
  105257. return rep2.width > playerWidth || rep2.height > playerHeight;
  105258. });
  105259. resolutionPlusOneSmallest = resolutionPlusOneList.filter(function(rep2) {
  105260. return rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height;
  105261. });
  105262. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  105263. resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function(rep2) {
  105264. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105265. })[0];
  105266. }
  105267. var leastPixelDiffRep;
  105268. if (masterPlaylistController.experimentalLeastPixelDiffSelector) {
  105269. var leastPixelDiffList = haveResolution.map(function(rep2) {
  105270. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  105271. return rep2;
  105272. });
  105273. stableSort(leastPixelDiffList, function(left, right) {
  105274. if (left.pixelDiff === right.pixelDiff) {
  105275. return right.bandwidth - left.bandwidth;
  105276. }
  105277. return left.pixelDiff - right.pixelDiff;
  105278. });
  105279. leastPixelDiffRep = leastPixelDiffList[0];
  105280. }
  105281. var chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105282. if (chosenRep && chosenRep.playlist) {
  105283. var _type = "sortedPlaylistReps";
  105284. if (leastPixelDiffRep) {
  105285. _type = "leastPixelDiffRep";
  105286. } else if (resolutionPlusOneRep) {
  105287. _type = "resolutionPlusOneRep";
  105288. } else if (resolutionBestRep) {
  105289. _type = "resolutionBestRep";
  105290. } else if (bandwidthBestRep) {
  105291. _type = "bandwidthBestRep";
  105292. } else if (enabledPlaylistReps[0]) {
  105293. _type = "enabledPlaylistReps";
  105294. }
  105295. logFn("choosing " + representationToString(chosenRep) + " using " + _type + " with options", options2);
  105296. return chosenRep.playlist;
  105297. }
  105298. logFn("could not choose a playlist with options", options2);
  105299. return null;
  105300. };
  105301. var lastBandwidthSelector = function lastBandwidthSelector2() {
  105302. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105303. return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105304. };
  105305. var movingAverageBandwidthSelector = function movingAverageBandwidthSelector2(decay) {
  105306. var average = -1;
  105307. var lastSystemBandwidth = -1;
  105308. if (decay < 0 || decay > 1) {
  105309. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  105310. }
  105311. return function() {
  105312. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105313. if (average < 0) {
  105314. average = this.systemBandwidth;
  105315. lastSystemBandwidth = this.systemBandwidth;
  105316. }
  105317. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  105318. average = decay * this.systemBandwidth + (1 - decay) * average;
  105319. lastSystemBandwidth = this.systemBandwidth;
  105320. }
  105321. return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105322. };
  105323. };
  105324. var minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector2(settings) {
  105325. var master = settings.master, currentTime = settings.currentTime, bandwidth2 = settings.bandwidth, duration5 = settings.duration, segmentDuration = settings.segmentDuration, timeUntilRebuffer3 = settings.timeUntilRebuffer, currentTimeline = settings.currentTimeline, syncController = settings.syncController;
  105326. var compatiblePlaylists = master.playlists.filter(function(playlist) {
  105327. return !Playlist.isIncompatible(playlist);
  105328. });
  105329. var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);
  105330. if (!enabledPlaylists.length) {
  105331. enabledPlaylists = compatiblePlaylists.filter(function(playlist) {
  105332. return !Playlist.isDisabled(playlist);
  105333. });
  105334. }
  105335. var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, "BANDWIDTH"));
  105336. var rebufferingEstimates = bandwidthPlaylists.map(function(playlist) {
  105337. var syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  105338. var numRequests = syncPoint ? 1 : 2;
  105339. var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  105340. var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  105341. return {
  105342. playlist,
  105343. rebufferingImpact
  105344. };
  105345. });
  105346. var noRebufferingPlaylists = rebufferingEstimates.filter(function(estimate) {
  105347. return estimate.rebufferingImpact <= 0;
  105348. });
  105349. stableSort(noRebufferingPlaylists, function(a, b) {
  105350. return comparePlaylistBandwidth(b.playlist, a.playlist);
  105351. });
  105352. if (noRebufferingPlaylists.length) {
  105353. return noRebufferingPlaylists[0];
  105354. }
  105355. stableSort(rebufferingEstimates, function(a, b) {
  105356. return a.rebufferingImpact - b.rebufferingImpact;
  105357. });
  105358. return rebufferingEstimates[0] || null;
  105359. };
  105360. var lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector2() {
  105361. var _this = this;
  105362. var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled);
  105363. stableSort(playlists, function(a, b) {
  105364. return comparePlaylistBandwidth(a, b);
  105365. });
  105366. var playlistsWithVideo = playlists.filter(function(playlist) {
  105367. return !!codecsForPlaylist(_this.playlists.master, playlist).video;
  105368. });
  105369. return playlistsWithVideo[0] || null;
  105370. };
  105371. var concatSegments = function concatSegments2(segmentObj) {
  105372. var offset = 0;
  105373. var tempBuffer;
  105374. if (segmentObj.bytes) {
  105375. tempBuffer = new Uint8Array(segmentObj.bytes);
  105376. segmentObj.segments.forEach(function(segment) {
  105377. tempBuffer.set(segment, offset);
  105378. offset += segment.byteLength;
  105379. });
  105380. }
  105381. return tempBuffer;
  105382. };
  105383. var createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists2(inbandTextTracks, tech, captionStream) {
  105384. if (!inbandTextTracks[captionStream]) {
  105385. tech.trigger({
  105386. type: "usage",
  105387. name: "vhs-608"
  105388. });
  105389. tech.trigger({
  105390. type: "usage",
  105391. name: "hls-608"
  105392. });
  105393. var instreamId = captionStream;
  105394. if (/^cc708_/.test(captionStream)) {
  105395. instreamId = "SERVICE" + captionStream.split("_")[1];
  105396. }
  105397. var track = tech.textTracks().getTrackById(instreamId);
  105398. if (track) {
  105399. inbandTextTracks[captionStream] = track;
  105400. } else {
  105401. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  105402. var label = captionStream;
  105403. var language = captionStream;
  105404. var def = false;
  105405. var captionService = captionServices[instreamId];
  105406. if (captionService) {
  105407. label = captionService.label;
  105408. language = captionService.language;
  105409. def = captionService["default"];
  105410. }
  105411. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  105412. kind: "captions",
  105413. id: instreamId,
  105414. "default": def,
  105415. label,
  105416. language
  105417. }, false).track;
  105418. }
  105419. }
  105420. };
  105421. var addCaptionData = function addCaptionData2(_ref) {
  105422. var inbandTextTracks = _ref.inbandTextTracks, captionArray = _ref.captionArray, timestampOffset2 = _ref.timestampOffset;
  105423. if (!captionArray) {
  105424. return;
  105425. }
  105426. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105427. captionArray.forEach(function(caption) {
  105428. var track = caption.stream;
  105429. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  105430. });
  105431. };
  105432. var deprecateOldCue = function deprecateOldCue2(cue) {
  105433. Object.defineProperties(cue.frame, {
  105434. id: {
  105435. get: function get7() {
  105436. videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  105437. return cue.value.key;
  105438. }
  105439. },
  105440. value: {
  105441. get: function get7() {
  105442. videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  105443. return cue.value.data;
  105444. }
  105445. },
  105446. privateData: {
  105447. get: function get7() {
  105448. videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  105449. return cue.value.data;
  105450. }
  105451. }
  105452. });
  105453. };
  105454. var addMetadata = function addMetadata2(_ref2) {
  105455. var inbandTextTracks = _ref2.inbandTextTracks, metadataArray = _ref2.metadataArray, timestampOffset2 = _ref2.timestampOffset, videoDuration = _ref2.videoDuration;
  105456. if (!metadataArray) {
  105457. return;
  105458. }
  105459. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105460. var metadataTrack = inbandTextTracks.metadataTrack_;
  105461. if (!metadataTrack) {
  105462. return;
  105463. }
  105464. metadataArray.forEach(function(metadata) {
  105465. var time = metadata.cueTime + timestampOffset2;
  105466. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  105467. return;
  105468. }
  105469. metadata.frames.forEach(function(frame) {
  105470. var cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  105471. cue.frame = frame;
  105472. cue.value = frame;
  105473. deprecateOldCue(cue);
  105474. metadataTrack.addCue(cue);
  105475. });
  105476. });
  105477. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  105478. return;
  105479. }
  105480. var cues = metadataTrack.cues;
  105481. var cuesArray = [];
  105482. for (var i2 = 0; i2 < cues.length; i2++) {
  105483. if (cues[i2]) {
  105484. cuesArray.push(cues[i2]);
  105485. }
  105486. }
  105487. var cuesGroupedByStartTime = cuesArray.reduce(function(obj, cue) {
  105488. var timeSlot = obj[cue.startTime] || [];
  105489. timeSlot.push(cue);
  105490. obj[cue.startTime] = timeSlot;
  105491. return obj;
  105492. }, {});
  105493. var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function(a, b) {
  105494. return Number(a) - Number(b);
  105495. });
  105496. sortedStartTimes.forEach(function(startTime, idx) {
  105497. var cueGroup = cuesGroupedByStartTime[startTime];
  105498. var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  105499. cueGroup.forEach(function(cue) {
  105500. cue.endTime = nextTime;
  105501. });
  105502. });
  105503. };
  105504. var createMetadataTrackIfNotExists = function createMetadataTrackIfNotExists2(inbandTextTracks, dispatchType, tech) {
  105505. if (inbandTextTracks.metadataTrack_) {
  105506. return;
  105507. }
  105508. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  105509. kind: "metadata",
  105510. label: "Timed Metadata"
  105511. }, false).track;
  105512. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  105513. };
  105514. var removeCuesFromTrack = function removeCuesFromTrack2(start2, end, track) {
  105515. var i2;
  105516. var cue;
  105517. if (!track) {
  105518. return;
  105519. }
  105520. if (!track.cues) {
  105521. return;
  105522. }
  105523. i2 = track.cues.length;
  105524. while (i2--) {
  105525. cue = track.cues[i2];
  105526. if (cue.startTime >= start2 && cue.endTime <= end) {
  105527. track.removeCue(cue);
  105528. }
  105529. }
  105530. };
  105531. var removeDuplicateCuesFromTrack = function removeDuplicateCuesFromTrack2(track) {
  105532. var cues = track.cues;
  105533. if (!cues) {
  105534. return;
  105535. }
  105536. for (var i2 = 0; i2 < cues.length; i2++) {
  105537. var duplicates = [];
  105538. var occurrences = 0;
  105539. for (var j = 0; j < cues.length; j++) {
  105540. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  105541. occurrences++;
  105542. if (occurrences > 1) {
  105543. duplicates.push(cues[j]);
  105544. }
  105545. }
  105546. }
  105547. if (duplicates.length) {
  105548. duplicates.forEach(function(dupe) {
  105549. return track.removeCue(dupe);
  105550. });
  105551. }
  105552. }
  105553. };
  105554. var gopsSafeToAlignWith = function gopsSafeToAlignWith2(buffer, currentTime, mapping) {
  105555. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  105556. return [];
  105557. }
  105558. var currentTimePts = Math.ceil((currentTime - mapping + 3) * clock.ONE_SECOND_IN_TS);
  105559. var i2;
  105560. for (i2 = 0; i2 < buffer.length; i2++) {
  105561. if (buffer[i2].pts > currentTimePts) {
  105562. break;
  105563. }
  105564. }
  105565. return buffer.slice(i2);
  105566. };
  105567. var updateGopBuffer = function updateGopBuffer2(buffer, gops, replace) {
  105568. if (!gops.length) {
  105569. return buffer;
  105570. }
  105571. if (replace) {
  105572. return gops.slice();
  105573. }
  105574. var start2 = gops[0].pts;
  105575. var i2 = 0;
  105576. for (i2; i2 < buffer.length; i2++) {
  105577. if (buffer[i2].pts >= start2) {
  105578. break;
  105579. }
  105580. }
  105581. return buffer.slice(0, i2).concat(gops);
  105582. };
  105583. var removeGopBuffer = function removeGopBuffer2(buffer, start2, end, mapping) {
  105584. var startPts = Math.ceil((start2 - mapping) * clock.ONE_SECOND_IN_TS);
  105585. var endPts = Math.ceil((end - mapping) * clock.ONE_SECOND_IN_TS);
  105586. var updatedBuffer = buffer.slice();
  105587. var i2 = buffer.length;
  105588. while (i2--) {
  105589. if (buffer[i2].pts <= endPts) {
  105590. break;
  105591. }
  105592. }
  105593. if (i2 === -1) {
  105594. return updatedBuffer;
  105595. }
  105596. var j = i2 + 1;
  105597. while (j--) {
  105598. if (buffer[j].pts <= startPts) {
  105599. break;
  105600. }
  105601. }
  105602. j = Math.max(j, 0);
  105603. updatedBuffer.splice(j, i2 - j + 1);
  105604. return updatedBuffer;
  105605. };
  105606. var shallowEqual = function shallowEqual2(a, b) {
  105607. if (!a && !b || !a && b || a && !b) {
  105608. return false;
  105609. }
  105610. if (a === b) {
  105611. return true;
  105612. }
  105613. var akeys = Object.keys(a).sort();
  105614. var bkeys = Object.keys(b).sort();
  105615. if (akeys.length !== bkeys.length) {
  105616. return false;
  105617. }
  105618. for (var i2 = 0; i2 < akeys.length; i2++) {
  105619. var key = akeys[i2];
  105620. if (key !== bkeys[i2]) {
  105621. return false;
  105622. }
  105623. if (a[key] !== b[key]) {
  105624. return false;
  105625. }
  105626. }
  105627. return true;
  105628. };
  105629. var QUOTA_EXCEEDED_ERR = 22;
  105630. var getSyncSegmentCandidate = function getSyncSegmentCandidate2(currentTimeline, segments, targetTime) {
  105631. segments = segments || [];
  105632. var timelineSegments = [];
  105633. var time = 0;
  105634. for (var i2 = 0; i2 < segments.length; i2++) {
  105635. var segment = segments[i2];
  105636. if (currentTimeline === segment.timeline) {
  105637. timelineSegments.push(i2);
  105638. time += segment.duration;
  105639. if (time > targetTime) {
  105640. return i2;
  105641. }
  105642. }
  105643. }
  105644. if (timelineSegments.length === 0) {
  105645. return 0;
  105646. }
  105647. return timelineSegments[timelineSegments.length - 1];
  105648. };
  105649. var MIN_BACK_BUFFER = 1;
  105650. var CHECK_BUFFER_DELAY = 500;
  105651. var finite = function finite2(num) {
  105652. return typeof num === "number" && isFinite(num);
  105653. };
  105654. var MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;
  105655. var illegalMediaSwitch = function illegalMediaSwitch2(loaderType, startingMedia, trackInfo) {
  105656. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  105657. return null;
  105658. }
  105659. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  105660. return "Neither audio nor video found in segment.";
  105661. }
  105662. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  105663. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  105664. }
  105665. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  105666. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  105667. }
  105668. return null;
  105669. };
  105670. var safeBackBufferTrimTime = function safeBackBufferTrimTime2(seekable3, currentTime, targetDuration) {
  105671. var trimTime = currentTime - Config.BACK_BUFFER_LENGTH;
  105672. if (seekable3.length) {
  105673. trimTime = Math.max(trimTime, seekable3.start(0));
  105674. }
  105675. var maxTrimTime = currentTime - targetDuration;
  105676. return Math.min(maxTrimTime, trimTime);
  105677. };
  105678. var segmentInfoString = function segmentInfoString2(segmentInfo) {
  105679. var startOfSegment = segmentInfo.startOfSegment, duration5 = segmentInfo.duration, segment = segmentInfo.segment, part = segmentInfo.part, _segmentInfo$playlist = segmentInfo.playlist, seq = _segmentInfo$playlist.mediaSequence, id = _segmentInfo$playlist.id, _segmentInfo$playlist2 = _segmentInfo$playlist.segments, segments = _segmentInfo$playlist2 === void 0 ? [] : _segmentInfo$playlist2, index2 = segmentInfo.mediaIndex, partIndex = segmentInfo.partIndex, timeline = segmentInfo.timeline;
  105680. var segmentLen = segments.length - 1;
  105681. var selection = "mediaIndex/partIndex increment";
  105682. if (segmentInfo.getMediaInfoForTime) {
  105683. selection = "getMediaInfoForTime (" + segmentInfo.getMediaInfoForTime + ")";
  105684. } else if (segmentInfo.isSyncRequest) {
  105685. selection = "getSyncSegmentCandidate (isSyncRequest)";
  105686. }
  105687. if (segmentInfo.independent) {
  105688. selection += " with independent " + segmentInfo.independent;
  105689. }
  105690. var hasPartIndex = typeof partIndex === "number";
  105691. var name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  105692. var zeroBasedPartCount = hasPartIndex ? getKnownPartCount({
  105693. preloadSegment: segment
  105694. }) - 1 : 0;
  105695. return name + " [" + (seq + index2) + "/" + (seq + segmentLen) + "]" + (hasPartIndex ? " part [" + partIndex + "/" + zeroBasedPartCount + "]" : "") + (" segment start/end [" + segment.start + " => " + segment.end + "]") + (hasPartIndex ? " part start/end [" + part.start + " => " + part.end + "]" : "") + (" startOfSegment [" + startOfSegment + "]") + (" duration [" + duration5 + "]") + (" timeline [" + timeline + "]") + (" selected by [" + selection + "]") + (" playlist [" + id + "]");
  105696. };
  105697. var timingInfoPropertyForMedia = function timingInfoPropertyForMedia2(mediaType) {
  105698. return mediaType + "TimingInfo";
  105699. };
  105700. var timestampOffsetForSegment = function timestampOffsetForSegment2(_ref) {
  105701. var segmentTimeline = _ref.segmentTimeline, currentTimeline = _ref.currentTimeline, startOfSegment = _ref.startOfSegment, buffered = _ref.buffered, overrideCheck = _ref.overrideCheck;
  105702. if (!overrideCheck && segmentTimeline === currentTimeline) {
  105703. return null;
  105704. }
  105705. if (segmentTimeline < currentTimeline) {
  105706. return startOfSegment;
  105707. }
  105708. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  105709. };
  105710. var shouldWaitForTimelineChange = function shouldWaitForTimelineChange2(_ref2) {
  105711. var timelineChangeController = _ref2.timelineChangeController, currentTimeline = _ref2.currentTimeline, segmentTimeline = _ref2.segmentTimeline, loaderType = _ref2.loaderType, audioDisabled = _ref2.audioDisabled;
  105712. if (currentTimeline === segmentTimeline) {
  105713. return false;
  105714. }
  105715. if (loaderType === "audio") {
  105716. var lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  105717. type: "main"
  105718. });
  105719. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  105720. }
  105721. if (loaderType === "main" && audioDisabled) {
  105722. var pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  105723. type: "audio"
  105724. });
  105725. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  105726. return false;
  105727. }
  105728. return true;
  105729. }
  105730. return false;
  105731. };
  105732. var mediaDuration = function mediaDuration2(timingInfos) {
  105733. var maxDuration = 0;
  105734. ["video", "audio"].forEach(function(type2) {
  105735. var typeTimingInfo = timingInfos[type2 + "TimingInfo"];
  105736. if (!typeTimingInfo) {
  105737. return;
  105738. }
  105739. var start2 = typeTimingInfo.start, end = typeTimingInfo.end;
  105740. var duration5;
  105741. if (typeof start2 === "bigint" || typeof end === "bigint") {
  105742. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  105743. } else if (typeof start2 === "number" && typeof end === "number") {
  105744. duration5 = end - start2;
  105745. }
  105746. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  105747. maxDuration = duration5;
  105748. }
  105749. });
  105750. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  105751. maxDuration = Number(maxDuration);
  105752. }
  105753. return maxDuration;
  105754. };
  105755. var segmentTooLong = function segmentTooLong2(_ref3) {
  105756. var segmentDuration = _ref3.segmentDuration, maxDuration = _ref3.maxDuration;
  105757. if (!segmentDuration) {
  105758. return false;
  105759. }
  105760. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;
  105761. };
  105762. var getTroublesomeSegmentDurationMessage = function getTroublesomeSegmentDurationMessage2(segmentInfo, sourceType) {
  105763. if (sourceType !== "hls") {
  105764. return null;
  105765. }
  105766. var segmentDuration = mediaDuration({
  105767. audioTimingInfo: segmentInfo.audioTimingInfo,
  105768. videoTimingInfo: segmentInfo.videoTimingInfo
  105769. });
  105770. if (!segmentDuration) {
  105771. return null;
  105772. }
  105773. var targetDuration = segmentInfo.playlist.targetDuration;
  105774. var isSegmentWayTooLong = segmentTooLong({
  105775. segmentDuration,
  105776. maxDuration: targetDuration * 2
  105777. });
  105778. var isSegmentSlightlyTooLong = segmentTooLong({
  105779. segmentDuration,
  105780. maxDuration: targetDuration
  105781. });
  105782. var segmentTooLongMessage = "Segment with index " + segmentInfo.mediaIndex + " " + ("from playlist " + segmentInfo.playlist.id + " ") + ("has a duration of " + segmentDuration + " ") + ("when the reported duration is " + segmentInfo.duration + " ") + ("and the target duration is " + targetDuration + ". ") + "For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";
  105783. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  105784. return {
  105785. severity: isSegmentWayTooLong ? "warn" : "info",
  105786. message: segmentTooLongMessage
  105787. };
  105788. }
  105789. return null;
  105790. };
  105791. var SegmentLoader = /* @__PURE__ */ function(_videojs$EventTarget) {
  105792. _inheritsLoose(SegmentLoader2, _videojs$EventTarget);
  105793. function SegmentLoader2(settings, options2) {
  105794. var _this;
  105795. _this = _videojs$EventTarget.call(this) || this;
  105796. if (!settings) {
  105797. throw new TypeError("Initialization settings are required");
  105798. }
  105799. if (typeof settings.currentTime !== "function") {
  105800. throw new TypeError("No currentTime getter specified");
  105801. }
  105802. if (!settings.mediaSource) {
  105803. throw new TypeError("No MediaSource specified");
  105804. }
  105805. _this.bandwidth = settings.bandwidth;
  105806. _this.throughput = {
  105807. rate: 0,
  105808. count: 0
  105809. };
  105810. _this.roundTrip = NaN;
  105811. _this.resetStats_();
  105812. _this.mediaIndex = null;
  105813. _this.partIndex = null;
  105814. _this.hasPlayed_ = settings.hasPlayed;
  105815. _this.currentTime_ = settings.currentTime;
  105816. _this.seekable_ = settings.seekable;
  105817. _this.seeking_ = settings.seeking;
  105818. _this.duration_ = settings.duration;
  105819. _this.mediaSource_ = settings.mediaSource;
  105820. _this.vhs_ = settings.vhs;
  105821. _this.loaderType_ = settings.loaderType;
  105822. _this.currentMediaInfo_ = void 0;
  105823. _this.startingMediaInfo_ = void 0;
  105824. _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  105825. _this.goalBufferLength_ = settings.goalBufferLength;
  105826. _this.sourceType_ = settings.sourceType;
  105827. _this.sourceUpdater_ = settings.sourceUpdater;
  105828. _this.inbandTextTracks_ = settings.inbandTextTracks;
  105829. _this.state_ = "INIT";
  105830. _this.timelineChangeController_ = settings.timelineChangeController;
  105831. _this.shouldSaveSegmentTimingInfo_ = true;
  105832. _this.parse708captions_ = settings.parse708captions;
  105833. _this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  105834. _this.captionServices_ = settings.captionServices;
  105835. _this.experimentalExactManifestTimings = settings.experimentalExactManifestTimings;
  105836. _this.checkBufferTimeout_ = null;
  105837. _this.error_ = void 0;
  105838. _this.currentTimeline_ = -1;
  105839. _this.pendingSegment_ = null;
  105840. _this.xhrOptions_ = null;
  105841. _this.pendingSegments_ = [];
  105842. _this.audioDisabled_ = false;
  105843. _this.isPendingTimestampOffset_ = false;
  105844. _this.gopBuffer_ = [];
  105845. _this.timeMapping_ = 0;
  105846. _this.safeAppend_ = videojs.browser.IE_VERSION >= 11;
  105847. _this.appendInitSegment_ = {
  105848. audio: true,
  105849. video: true
  105850. };
  105851. _this.playlistOfLastInitSegment_ = {
  105852. audio: null,
  105853. video: null
  105854. };
  105855. _this.callQueue_ = [];
  105856. _this.loadQueue_ = [];
  105857. _this.metadataQueue_ = {
  105858. id3: [],
  105859. caption: []
  105860. };
  105861. _this.waitingOnRemove_ = false;
  105862. _this.quotaExceededErrorRetryTimeout_ = null;
  105863. _this.activeInitSegmentId_ = null;
  105864. _this.initSegments_ = {};
  105865. _this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  105866. _this.keyCache_ = {};
  105867. _this.decrypter_ = settings.decrypter;
  105868. _this.syncController_ = settings.syncController;
  105869. _this.syncPoint_ = {
  105870. segmentIndex: 0,
  105871. time: 0
  105872. };
  105873. _this.transmuxer_ = _this.createTransmuxer_();
  105874. _this.triggerSyncInfoUpdate_ = function() {
  105875. return _this.trigger("syncinfoupdate");
  105876. };
  105877. _this.syncController_.on("syncinfoupdate", _this.triggerSyncInfoUpdate_);
  105878. _this.mediaSource_.addEventListener("sourceopen", function() {
  105879. if (!_this.isEndOfStream_()) {
  105880. _this.ended_ = false;
  105881. }
  105882. });
  105883. _this.fetchAtBuffer_ = false;
  105884. _this.logger_ = logger("SegmentLoader[" + _this.loaderType_ + "]");
  105885. Object.defineProperty(_assertThisInitialized(_this), "state", {
  105886. get: function get7() {
  105887. return this.state_;
  105888. },
  105889. set: function set4(newState) {
  105890. if (newState !== this.state_) {
  105891. this.logger_(this.state_ + " -> " + newState);
  105892. this.state_ = newState;
  105893. this.trigger("statechange");
  105894. }
  105895. }
  105896. });
  105897. _this.sourceUpdater_.on("ready", function() {
  105898. if (_this.hasEnoughInfoToAppend_()) {
  105899. _this.processCallQueue_();
  105900. }
  105901. });
  105902. if (_this.loaderType_ === "main") {
  105903. _this.timelineChangeController_.on("pendingtimelinechange", function() {
  105904. if (_this.hasEnoughInfoToAppend_()) {
  105905. _this.processCallQueue_();
  105906. }
  105907. });
  105908. }
  105909. if (_this.loaderType_ === "audio") {
  105910. _this.timelineChangeController_.on("timelinechange", function() {
  105911. if (_this.hasEnoughInfoToLoad_()) {
  105912. _this.processLoadQueue_();
  105913. }
  105914. if (_this.hasEnoughInfoToAppend_()) {
  105915. _this.processCallQueue_();
  105916. }
  105917. });
  105918. }
  105919. return _this;
  105920. }
  105921. var _proto = SegmentLoader2.prototype;
  105922. _proto.createTransmuxer_ = function createTransmuxer_() {
  105923. return segmentTransmuxer.createTransmuxer({
  105924. remux: false,
  105925. alignGopsAtEnd: this.safeAppend_,
  105926. keepOriginalTimestamps: true,
  105927. parse708captions: this.parse708captions_,
  105928. captionServices: this.captionServices_
  105929. });
  105930. };
  105931. _proto.resetStats_ = function resetStats_() {
  105932. this.mediaBytesTransferred = 0;
  105933. this.mediaRequests = 0;
  105934. this.mediaRequestsAborted = 0;
  105935. this.mediaRequestsTimedout = 0;
  105936. this.mediaRequestsErrored = 0;
  105937. this.mediaTransferDuration = 0;
  105938. this.mediaSecondsLoaded = 0;
  105939. this.mediaAppends = 0;
  105940. };
  105941. _proto.dispose = function dispose() {
  105942. this.trigger("dispose");
  105943. this.state = "DISPOSED";
  105944. this.pause();
  105945. this.abort_();
  105946. if (this.transmuxer_) {
  105947. this.transmuxer_.terminate();
  105948. }
  105949. this.resetStats_();
  105950. if (this.checkBufferTimeout_) {
  105951. window_1.clearTimeout(this.checkBufferTimeout_);
  105952. }
  105953. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  105954. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  105955. }
  105956. this.off();
  105957. };
  105958. _proto.setAudio = function setAudio(enable) {
  105959. this.audioDisabled_ = !enable;
  105960. if (enable) {
  105961. this.appendInitSegment_.audio = true;
  105962. } else {
  105963. this.sourceUpdater_.removeAudio(0, this.duration_());
  105964. }
  105965. };
  105966. _proto.abort = function abort2() {
  105967. if (this.state !== "WAITING") {
  105968. if (this.pendingSegment_) {
  105969. this.pendingSegment_ = null;
  105970. }
  105971. return;
  105972. }
  105973. this.abort_();
  105974. this.state = "READY";
  105975. if (!this.paused()) {
  105976. this.monitorBuffer_();
  105977. }
  105978. };
  105979. _proto.abort_ = function abort_() {
  105980. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  105981. this.pendingSegment_.abortRequests();
  105982. }
  105983. this.pendingSegment_ = null;
  105984. this.callQueue_ = [];
  105985. this.loadQueue_ = [];
  105986. this.metadataQueue_.id3 = [];
  105987. this.metadataQueue_.caption = [];
  105988. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  105989. this.waitingOnRemove_ = false;
  105990. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  105991. this.quotaExceededErrorRetryTimeout_ = null;
  105992. };
  105993. _proto.checkForAbort_ = function checkForAbort_(requestId) {
  105994. if (this.state === "APPENDING" && !this.pendingSegment_) {
  105995. this.state = "READY";
  105996. return true;
  105997. }
  105998. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  105999. return true;
  106000. }
  106001. return false;
  106002. };
  106003. _proto.error = function error(_error) {
  106004. if (typeof _error !== "undefined") {
  106005. this.logger_("error occurred:", _error);
  106006. this.error_ = _error;
  106007. }
  106008. this.pendingSegment_ = null;
  106009. return this.error_;
  106010. };
  106011. _proto.endOfStream = function endOfStream2() {
  106012. this.ended_ = true;
  106013. if (this.transmuxer_) {
  106014. segmentTransmuxer.reset(this.transmuxer_);
  106015. }
  106016. this.gopBuffer_.length = 0;
  106017. this.pause();
  106018. this.trigger("ended");
  106019. };
  106020. _proto.buffered_ = function buffered_() {
  106021. var trackInfo = this.getMediaInfo_();
  106022. if (!this.sourceUpdater_ || !trackInfo) {
  106023. return videojs.createTimeRanges();
  106024. }
  106025. if (this.loaderType_ === "main") {
  106026. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106027. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  106028. return this.sourceUpdater_.buffered();
  106029. }
  106030. if (hasVideo) {
  106031. return this.sourceUpdater_.videoBuffered();
  106032. }
  106033. }
  106034. return this.sourceUpdater_.audioBuffered();
  106035. };
  106036. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  106037. if (set4 === void 0) {
  106038. set4 = false;
  106039. }
  106040. if (!map) {
  106041. return null;
  106042. }
  106043. var id = initSegmentId(map);
  106044. var storedMap = this.initSegments_[id];
  106045. if (set4 && !storedMap && map.bytes) {
  106046. this.initSegments_[id] = storedMap = {
  106047. resolvedUri: map.resolvedUri,
  106048. byterange: map.byterange,
  106049. bytes: map.bytes,
  106050. tracks: map.tracks,
  106051. timescales: map.timescales
  106052. };
  106053. }
  106054. return storedMap || map;
  106055. };
  106056. _proto.segmentKey = function segmentKey(key, set4) {
  106057. if (set4 === void 0) {
  106058. set4 = false;
  106059. }
  106060. if (!key) {
  106061. return null;
  106062. }
  106063. var id = segmentKeyId(key);
  106064. var storedKey = this.keyCache_[id];
  106065. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  106066. this.keyCache_[id] = storedKey = {
  106067. resolvedUri: key.resolvedUri,
  106068. bytes: key.bytes
  106069. };
  106070. }
  106071. var result = {
  106072. resolvedUri: (storedKey || key).resolvedUri
  106073. };
  106074. if (storedKey) {
  106075. result.bytes = storedKey.bytes;
  106076. }
  106077. return result;
  106078. };
  106079. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  106080. return this.playlist_ && !this.paused();
  106081. };
  106082. _proto.load = function load() {
  106083. this.monitorBuffer_();
  106084. if (!this.playlist_) {
  106085. return;
  106086. }
  106087. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106088. return this.init_();
  106089. }
  106090. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  106091. return;
  106092. }
  106093. this.state = "READY";
  106094. };
  106095. _proto.init_ = function init_() {
  106096. this.state = "READY";
  106097. this.resetEverything();
  106098. return this.monitorBuffer_();
  106099. };
  106100. _proto.playlist = function playlist(newPlaylist, options2) {
  106101. if (options2 === void 0) {
  106102. options2 = {};
  106103. }
  106104. if (!newPlaylist) {
  106105. return;
  106106. }
  106107. var oldPlaylist = this.playlist_;
  106108. var segmentInfo = this.pendingSegment_;
  106109. this.playlist_ = newPlaylist;
  106110. this.xhrOptions_ = options2;
  106111. if (this.state === "INIT") {
  106112. newPlaylist.syncInfo = {
  106113. mediaSequence: newPlaylist.mediaSequence,
  106114. time: 0
  106115. };
  106116. if (this.loaderType_ === "main") {
  106117. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  106118. }
  106119. }
  106120. var oldId = null;
  106121. if (oldPlaylist) {
  106122. if (oldPlaylist.id) {
  106123. oldId = oldPlaylist.id;
  106124. } else if (oldPlaylist.uri) {
  106125. oldId = oldPlaylist.uri;
  106126. }
  106127. }
  106128. this.logger_("playlist update [" + oldId + " => " + (newPlaylist.id || newPlaylist.uri) + "]");
  106129. this.trigger("syncinfoupdate");
  106130. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106131. return this.init_();
  106132. }
  106133. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  106134. if (this.mediaIndex !== null) {
  106135. if (!newPlaylist.endList) {
  106136. this.resetLoader();
  106137. } else {
  106138. this.resyncLoader();
  106139. }
  106140. }
  106141. this.currentMediaInfo_ = void 0;
  106142. this.trigger("playlistupdate");
  106143. return;
  106144. }
  106145. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  106146. this.logger_("live window shift [" + mediaSequenceDiff + "]");
  106147. if (this.mediaIndex !== null) {
  106148. this.mediaIndex -= mediaSequenceDiff;
  106149. if (this.mediaIndex < 0) {
  106150. this.mediaIndex = null;
  106151. this.partIndex = null;
  106152. } else {
  106153. var segment = this.playlist_.segments[this.mediaIndex];
  106154. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  106155. var mediaIndex = this.mediaIndex;
  106156. this.logger_("currently processing part (index " + this.partIndex + ") no longer exists.");
  106157. this.resetLoader();
  106158. this.mediaIndex = mediaIndex;
  106159. }
  106160. }
  106161. }
  106162. if (segmentInfo) {
  106163. segmentInfo.mediaIndex -= mediaSequenceDiff;
  106164. if (segmentInfo.mediaIndex < 0) {
  106165. segmentInfo.mediaIndex = null;
  106166. segmentInfo.partIndex = null;
  106167. } else {
  106168. if (segmentInfo.mediaIndex >= 0) {
  106169. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  106170. }
  106171. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  106172. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  106173. }
  106174. }
  106175. }
  106176. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  106177. };
  106178. _proto.pause = function pause() {
  106179. if (this.checkBufferTimeout_) {
  106180. window_1.clearTimeout(this.checkBufferTimeout_);
  106181. this.checkBufferTimeout_ = null;
  106182. }
  106183. };
  106184. _proto.paused = function paused() {
  106185. return this.checkBufferTimeout_ === null;
  106186. };
  106187. _proto.resetEverything = function resetEverything(done) {
  106188. this.ended_ = false;
  106189. this.activeInitSegmentId_ = null;
  106190. this.appendInitSegment_ = {
  106191. audio: true,
  106192. video: true
  106193. };
  106194. this.resetLoader();
  106195. this.remove(0, Infinity, done);
  106196. if (this.transmuxer_) {
  106197. this.transmuxer_.postMessage({
  106198. action: "clearAllMp4Captions"
  106199. });
  106200. this.transmuxer_.postMessage({
  106201. action: "reset"
  106202. });
  106203. }
  106204. };
  106205. _proto.resetLoader = function resetLoader() {
  106206. this.fetchAtBuffer_ = false;
  106207. this.resyncLoader();
  106208. };
  106209. _proto.resyncLoader = function resyncLoader() {
  106210. if (this.transmuxer_) {
  106211. segmentTransmuxer.reset(this.transmuxer_);
  106212. }
  106213. this.mediaIndex = null;
  106214. this.partIndex = null;
  106215. this.syncPoint_ = null;
  106216. this.isPendingTimestampOffset_ = false;
  106217. this.callQueue_ = [];
  106218. this.loadQueue_ = [];
  106219. this.metadataQueue_.id3 = [];
  106220. this.metadataQueue_.caption = [];
  106221. this.abort();
  106222. if (this.transmuxer_) {
  106223. this.transmuxer_.postMessage({
  106224. action: "clearParsedMp4Captions"
  106225. });
  106226. }
  106227. };
  106228. _proto.remove = function remove2(start2, end, done, force) {
  106229. if (done === void 0) {
  106230. done = function done2() {
  106231. };
  106232. }
  106233. if (force === void 0) {
  106234. force = false;
  106235. }
  106236. if (end === Infinity) {
  106237. end = this.duration_();
  106238. }
  106239. if (end <= start2) {
  106240. this.logger_("skipping remove because end ${end} is <= start ${start}");
  106241. return;
  106242. }
  106243. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  106244. this.logger_("skipping remove because no source updater or starting media info");
  106245. return;
  106246. }
  106247. var removesRemaining = 1;
  106248. var removeFinished = function removeFinished2() {
  106249. removesRemaining--;
  106250. if (removesRemaining === 0) {
  106251. done();
  106252. }
  106253. };
  106254. if (force || !this.audioDisabled_) {
  106255. removesRemaining++;
  106256. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  106257. }
  106258. if (force || this.loaderType_ === "main") {
  106259. this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start2, end, this.timeMapping_);
  106260. removesRemaining++;
  106261. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  106262. }
  106263. for (var track in this.inbandTextTracks_) {
  106264. removeCuesFromTrack(start2, end, this.inbandTextTracks_[track]);
  106265. }
  106266. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  106267. removeFinished();
  106268. };
  106269. _proto.monitorBuffer_ = function monitorBuffer_() {
  106270. if (this.checkBufferTimeout_) {
  106271. window_1.clearTimeout(this.checkBufferTimeout_);
  106272. }
  106273. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  106274. };
  106275. _proto.monitorBufferTick_ = function monitorBufferTick_() {
  106276. if (this.state === "READY") {
  106277. this.fillBuffer_();
  106278. }
  106279. if (this.checkBufferTimeout_) {
  106280. window_1.clearTimeout(this.checkBufferTimeout_);
  106281. }
  106282. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);
  106283. };
  106284. _proto.fillBuffer_ = function fillBuffer_() {
  106285. if (this.sourceUpdater_.updating()) {
  106286. return;
  106287. }
  106288. var segmentInfo = this.chooseNextRequest_();
  106289. if (!segmentInfo) {
  106290. return;
  106291. }
  106292. if (typeof segmentInfo.timestampOffset === "number") {
  106293. this.isPendingTimestampOffset_ = false;
  106294. this.timelineChangeController_.pendingTimelineChange({
  106295. type: this.loaderType_,
  106296. from: this.currentTimeline_,
  106297. to: segmentInfo.timeline
  106298. });
  106299. }
  106300. this.loadSegment_(segmentInfo);
  106301. };
  106302. _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) {
  106303. if (mediaIndex === void 0) {
  106304. mediaIndex = this.mediaIndex;
  106305. }
  106306. if (playlist === void 0) {
  106307. playlist = this.playlist_;
  106308. }
  106309. if (partIndex === void 0) {
  106310. partIndex = this.partIndex;
  106311. }
  106312. if (!playlist || !this.mediaSource_) {
  106313. return false;
  106314. }
  106315. var segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  106316. var appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  106317. var appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  106318. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  106319. };
  106320. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  106321. var buffered = this.buffered_();
  106322. var bufferedEnd = lastBufferedEnd(buffered) || 0;
  106323. var bufferedTime = timeAheadOf(buffered, this.currentTime_());
  106324. var preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  106325. var haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  106326. var segments = this.playlist_.segments;
  106327. if (!segments.length || preloaded || haveEnoughBuffer) {
  106328. return null;
  106329. }
  106330. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  106331. var next = {
  106332. partIndex: null,
  106333. mediaIndex: null,
  106334. startOfSegment: null,
  106335. playlist: this.playlist_,
  106336. isSyncRequest: Boolean(!this.syncPoint_)
  106337. };
  106338. if (next.isSyncRequest) {
  106339. next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);
  106340. } else if (this.mediaIndex !== null) {
  106341. var segment = segments[this.mediaIndex];
  106342. var partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  106343. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  106344. if (segment.parts && segment.parts[partIndex + 1]) {
  106345. next.mediaIndex = this.mediaIndex;
  106346. next.partIndex = partIndex + 1;
  106347. } else {
  106348. next.mediaIndex = this.mediaIndex + 1;
  106349. }
  106350. } else {
  106351. var _Playlist$getMediaInf = Playlist.getMediaInfoForTime({
  106352. experimentalExactManifestTimings: this.experimentalExactManifestTimings,
  106353. playlist: this.playlist_,
  106354. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  106355. startingPartIndex: this.syncPoint_.partIndex,
  106356. startingSegmentIndex: this.syncPoint_.segmentIndex,
  106357. startTime: this.syncPoint_.time
  106358. }), segmentIndex = _Playlist$getMediaInf.segmentIndex, startTime = _Playlist$getMediaInf.startTime, _partIndex = _Playlist$getMediaInf.partIndex;
  106359. next.getMediaInfoForTime = this.fetchAtBuffer_ ? "bufferedEnd " + bufferedEnd : "currentTime " + this.currentTime_();
  106360. next.mediaIndex = segmentIndex;
  106361. next.startOfSegment = startTime;
  106362. next.partIndex = _partIndex;
  106363. }
  106364. var nextSegment = segments[next.mediaIndex];
  106365. var nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  106366. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  106367. return null;
  106368. }
  106369. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  106370. next.partIndex = 0;
  106371. nextPart = nextSegment.parts[0];
  106372. }
  106373. if (!bufferedTime && nextPart && !nextPart.independent) {
  106374. if (next.partIndex === 0) {
  106375. var lastSegment = segments[next.mediaIndex - 1];
  106376. var lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  106377. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  106378. next.mediaIndex -= 1;
  106379. next.partIndex = lastSegment.parts.length - 1;
  106380. next.independent = "previous segment";
  106381. }
  106382. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  106383. next.partIndex -= 1;
  106384. next.independent = "previous part";
  106385. }
  106386. }
  106387. var ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  106388. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  106389. return null;
  106390. }
  106391. return this.generateSegmentInfo_(next);
  106392. };
  106393. _proto.generateSegmentInfo_ = function generateSegmentInfo_(options2) {
  106394. var independent = options2.independent, playlist = options2.playlist, mediaIndex = options2.mediaIndex, startOfSegment = options2.startOfSegment, isSyncRequest = options2.isSyncRequest, partIndex = options2.partIndex, forceTimestampOffset = options2.forceTimestampOffset, getMediaInfoForTime3 = options2.getMediaInfoForTime;
  106395. var segment = playlist.segments[mediaIndex];
  106396. var part = typeof partIndex === "number" && segment.parts[partIndex];
  106397. var segmentInfo = {
  106398. requestId: "segment-loader-" + Math.random(),
  106399. uri: part && part.resolvedUri || segment.resolvedUri,
  106400. mediaIndex,
  106401. partIndex: part ? partIndex : null,
  106402. isSyncRequest,
  106403. startOfSegment,
  106404. playlist,
  106405. bytes: null,
  106406. encryptedBytes: null,
  106407. timestampOffset: null,
  106408. timeline: segment.timeline,
  106409. duration: part && part.duration || segment.duration,
  106410. segment,
  106411. part,
  106412. byteLength: 0,
  106413. transmuxer: this.transmuxer_,
  106414. getMediaInfoForTime: getMediaInfoForTime3,
  106415. independent
  106416. };
  106417. var overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  106418. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  106419. segmentTimeline: segment.timeline,
  106420. currentTimeline: this.currentTimeline_,
  106421. startOfSegment,
  106422. buffered: this.buffered_(),
  106423. overrideCheck
  106424. });
  106425. var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());
  106426. if (typeof audioBufferedEnd === "number") {
  106427. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  106428. }
  106429. if (this.sourceUpdater_.videoBuffered().length) {
  106430. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(
  106431. this.gopBuffer_,
  106432. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  106433. this.timeMapping_
  106434. );
  106435. }
  106436. return segmentInfo;
  106437. };
  106438. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options2) {
  106439. return timestampOffsetForSegment(options2);
  106440. };
  106441. _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) {
  106442. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  106443. return;
  106444. }
  106445. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  106446. return;
  106447. }
  106448. var currentTime = this.currentTime_();
  106449. var measuredBandwidth = stats.bandwidth;
  106450. var segmentDuration = this.pendingSegment_.duration;
  106451. var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  106452. var timeUntilRebuffer$12 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  106453. if (requestTimeRemaining <= timeUntilRebuffer$12) {
  106454. return;
  106455. }
  106456. var switchCandidate = minRebufferMaxBandwidthSelector({
  106457. master: this.vhs_.playlists.master,
  106458. currentTime,
  106459. bandwidth: measuredBandwidth,
  106460. duration: this.duration_(),
  106461. segmentDuration,
  106462. timeUntilRebuffer: timeUntilRebuffer$12,
  106463. currentTimeline: this.currentTimeline_,
  106464. syncController: this.syncController_
  106465. });
  106466. if (!switchCandidate) {
  106467. return;
  106468. }
  106469. var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$12;
  106470. var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  106471. var minimumTimeSaving = 0.5;
  106472. if (timeUntilRebuffer$12 <= TIME_FUDGE_FACTOR) {
  106473. minimumTimeSaving = 1;
  106474. }
  106475. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  106476. return;
  106477. }
  106478. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;
  106479. this.trigger("earlyabort");
  106480. };
  106481. _proto.handleAbort_ = function handleAbort_(segmentInfo) {
  106482. this.logger_("Aborting " + segmentInfoString(segmentInfo));
  106483. this.mediaRequestsAborted += 1;
  106484. };
  106485. _proto.handleProgress_ = function handleProgress_(event2, simpleSegment) {
  106486. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106487. if (this.checkForAbort_(simpleSegment.requestId)) {
  106488. return;
  106489. }
  106490. this.trigger("progress");
  106491. };
  106492. _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) {
  106493. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106494. if (this.checkForAbort_(simpleSegment.requestId)) {
  106495. return;
  106496. }
  106497. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  106498. return;
  106499. }
  106500. trackInfo = trackInfo || {};
  106501. if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {
  106502. this.appendInitSegment_ = {
  106503. audio: true,
  106504. video: true
  106505. };
  106506. this.startingMediaInfo_ = trackInfo;
  106507. this.currentMediaInfo_ = trackInfo;
  106508. this.logger_("trackinfo update", trackInfo);
  106509. this.trigger("trackinfo");
  106510. }
  106511. if (this.checkForAbort_(simpleSegment.requestId)) {
  106512. return;
  106513. }
  106514. this.pendingSegment_.trackInfo = trackInfo;
  106515. if (this.hasEnoughInfoToAppend_()) {
  106516. this.processCallQueue_();
  106517. }
  106518. };
  106519. _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  106520. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106521. if (this.checkForAbort_(simpleSegment.requestId)) {
  106522. return;
  106523. }
  106524. var segmentInfo = this.pendingSegment_;
  106525. var timingInfoProperty = timingInfoPropertyForMedia(mediaType);
  106526. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  106527. segmentInfo[timingInfoProperty][timeType] = time;
  106528. this.logger_("timinginfo: " + mediaType + " - " + timeType + " - " + time);
  106529. if (this.hasEnoughInfoToAppend_()) {
  106530. this.processCallQueue_();
  106531. }
  106532. };
  106533. _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) {
  106534. var _this2 = this;
  106535. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106536. if (this.checkForAbort_(simpleSegment.requestId)) {
  106537. return;
  106538. }
  106539. if (captionData.length === 0) {
  106540. this.logger_("SegmentLoader received no captions from a caption event");
  106541. return;
  106542. }
  106543. var segmentInfo = this.pendingSegment_;
  106544. if (!segmentInfo.hasAppendedData_) {
  106545. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  106546. return;
  106547. }
  106548. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106549. var captionTracks = {};
  106550. captionData.forEach(function(caption) {
  106551. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  106552. startTime: Infinity,
  106553. captions: [],
  106554. endTime: 0
  106555. };
  106556. var captionTrack = captionTracks[caption.stream];
  106557. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  106558. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  106559. captionTrack.captions.push(caption);
  106560. });
  106561. Object.keys(captionTracks).forEach(function(trackName) {
  106562. var _captionTracks$trackN = captionTracks[trackName], startTime = _captionTracks$trackN.startTime, endTime = _captionTracks$trackN.endTime, captions = _captionTracks$trackN.captions;
  106563. var inbandTextTracks = _this2.inbandTextTracks_;
  106564. _this2.logger_("adding cues from " + startTime + " -> " + endTime + " for " + trackName);
  106565. createCaptionsTrackIfNotExists(inbandTextTracks, _this2.vhs_.tech_, trackName);
  106566. removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);
  106567. addCaptionData({
  106568. captionArray: captions,
  106569. inbandTextTracks,
  106570. timestampOffset: timestampOffset2
  106571. });
  106572. });
  106573. if (this.transmuxer_) {
  106574. this.transmuxer_.postMessage({
  106575. action: "clearParsedMp4Captions"
  106576. });
  106577. }
  106578. };
  106579. _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) {
  106580. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106581. if (this.checkForAbort_(simpleSegment.requestId)) {
  106582. return;
  106583. }
  106584. var segmentInfo = this.pendingSegment_;
  106585. if (!segmentInfo.hasAppendedData_) {
  106586. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  106587. return;
  106588. }
  106589. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106590. createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  106591. addMetadata({
  106592. inbandTextTracks: this.inbandTextTracks_,
  106593. metadataArray: id3Frames,
  106594. timestampOffset: timestampOffset2,
  106595. videoDuration: this.duration_()
  106596. });
  106597. };
  106598. _proto.processMetadataQueue_ = function processMetadataQueue_() {
  106599. this.metadataQueue_.id3.forEach(function(fn2) {
  106600. return fn2();
  106601. });
  106602. this.metadataQueue_.caption.forEach(function(fn2) {
  106603. return fn2();
  106604. });
  106605. this.metadataQueue_.id3 = [];
  106606. this.metadataQueue_.caption = [];
  106607. };
  106608. _proto.processCallQueue_ = function processCallQueue_() {
  106609. var callQueue = this.callQueue_;
  106610. this.callQueue_ = [];
  106611. callQueue.forEach(function(fun) {
  106612. return fun();
  106613. });
  106614. };
  106615. _proto.processLoadQueue_ = function processLoadQueue_() {
  106616. var loadQueue = this.loadQueue_;
  106617. this.loadQueue_ = [];
  106618. loadQueue.forEach(function(fun) {
  106619. return fun();
  106620. });
  106621. };
  106622. _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() {
  106623. if (this.loaderType_ !== "audio") {
  106624. return true;
  106625. }
  106626. var segmentInfo = this.pendingSegment_;
  106627. if (!segmentInfo) {
  106628. return false;
  106629. }
  106630. if (!this.getCurrentMediaInfo_()) {
  106631. return true;
  106632. }
  106633. if (shouldWaitForTimelineChange({
  106634. timelineChangeController: this.timelineChangeController_,
  106635. currentTimeline: this.currentTimeline_,
  106636. segmentTimeline: segmentInfo.timeline,
  106637. loaderType: this.loaderType_,
  106638. audioDisabled: this.audioDisabled_
  106639. })) {
  106640. return false;
  106641. }
  106642. return true;
  106643. };
  106644. _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) {
  106645. if (segmentInfo === void 0) {
  106646. segmentInfo = this.pendingSegment_;
  106647. }
  106648. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  106649. };
  106650. _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) {
  106651. if (segmentInfo === void 0) {
  106652. segmentInfo = this.pendingSegment_;
  106653. }
  106654. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  106655. };
  106656. _proto.getPendingSegmentPlaylist = function getPendingSegmentPlaylist() {
  106657. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  106658. };
  106659. _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() {
  106660. if (!this.sourceUpdater_.ready()) {
  106661. return false;
  106662. }
  106663. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  106664. return false;
  106665. }
  106666. var segmentInfo = this.pendingSegment_;
  106667. var trackInfo = this.getCurrentMediaInfo_();
  106668. if (!segmentInfo || !trackInfo) {
  106669. return false;
  106670. }
  106671. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106672. if (hasVideo && !segmentInfo.videoTimingInfo) {
  106673. return false;
  106674. }
  106675. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  106676. return false;
  106677. }
  106678. if (shouldWaitForTimelineChange({
  106679. timelineChangeController: this.timelineChangeController_,
  106680. currentTimeline: this.currentTimeline_,
  106681. segmentTimeline: segmentInfo.timeline,
  106682. loaderType: this.loaderType_,
  106683. audioDisabled: this.audioDisabled_
  106684. })) {
  106685. return false;
  106686. }
  106687. return true;
  106688. };
  106689. _proto.handleData_ = function handleData_3(simpleSegment, result) {
  106690. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106691. if (this.checkForAbort_(simpleSegment.requestId)) {
  106692. return;
  106693. }
  106694. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  106695. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  106696. return;
  106697. }
  106698. var segmentInfo = this.pendingSegment_;
  106699. this.setTimeMapping_(segmentInfo.timeline);
  106700. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  106701. if (this.mediaSource_.readyState === "closed") {
  106702. return;
  106703. }
  106704. if (simpleSegment.map) {
  106705. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  106706. segmentInfo.segment.map = simpleSegment.map;
  106707. }
  106708. if (simpleSegment.key) {
  106709. this.segmentKey(simpleSegment.key, true);
  106710. }
  106711. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  106712. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  106713. if (segmentInfo.isFmp4) {
  106714. this.trigger("fmp4");
  106715. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;
  106716. } else {
  106717. var trackInfo = this.getCurrentMediaInfo_();
  106718. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  106719. var firstVideoFrameTimeForData;
  106720. if (useVideoTimingInfo) {
  106721. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  106722. }
  106723. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  106724. currentStart: segmentInfo.timingInfo.start,
  106725. playlist: segmentInfo.playlist,
  106726. mediaIndex: segmentInfo.mediaIndex,
  106727. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  106728. useVideoTimingInfo,
  106729. firstVideoFrameTimeForData,
  106730. videoTimingInfo: segmentInfo.videoTimingInfo,
  106731. audioTimingInfo: segmentInfo.audioTimingInfo
  106732. });
  106733. }
  106734. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  106735. this.updateSourceBufferTimestampOffset_(segmentInfo);
  106736. if (segmentInfo.isSyncRequest) {
  106737. this.updateTimingInfoEnd_(segmentInfo);
  106738. this.syncController_.saveSegmentTimingInfo({
  106739. segmentInfo,
  106740. shouldSaveTimelineMapping: this.loaderType_ === "main"
  106741. });
  106742. var next = this.chooseNextRequest_();
  106743. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  106744. this.logger_("sync segment was incorrect, not appending");
  106745. return;
  106746. }
  106747. this.logger_("sync segment was correct, appending");
  106748. }
  106749. segmentInfo.hasAppendedData_ = true;
  106750. this.processMetadataQueue_();
  106751. this.appendData_(segmentInfo, result);
  106752. };
  106753. _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type2) {
  106754. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  106755. this.appendInitSegment_ = {
  106756. audio: true,
  106757. video: true
  106758. };
  106759. }
  106760. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  106761. this.appendInitSegment_[type2] = true;
  106762. }
  106763. };
  106764. _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) {
  106765. var type2 = _ref4.type, initSegment = _ref4.initSegment, map = _ref4.map, playlist = _ref4.playlist;
  106766. if (map) {
  106767. var id = initSegmentId(map);
  106768. if (this.activeInitSegmentId_ === id) {
  106769. return null;
  106770. }
  106771. initSegment = this.initSegmentForMap(map, true).bytes;
  106772. this.activeInitSegmentId_ = id;
  106773. }
  106774. if (initSegment && this.appendInitSegment_[type2]) {
  106775. this.playlistOfLastInitSegment_[type2] = playlist;
  106776. this.appendInitSegment_[type2] = false;
  106777. this.activeInitSegmentId_ = null;
  106778. return initSegment;
  106779. }
  106780. return null;
  106781. };
  106782. _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) {
  106783. var _this3 = this;
  106784. var segmentInfo = _ref5.segmentInfo, type2 = _ref5.type, bytes = _ref5.bytes;
  106785. var audioBuffered = this.sourceUpdater_.audioBuffered();
  106786. var videoBuffered = this.sourceUpdater_.videoBuffered();
  106787. if (audioBuffered.length > 1) {
  106788. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray(audioBuffered).join(", "));
  106789. }
  106790. if (videoBuffered.length > 1) {
  106791. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray(videoBuffered).join(", "));
  106792. }
  106793. var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  106794. var audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  106795. var videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  106796. var videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  106797. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {
  106798. this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. " + ("Appended byte length: " + bytes.byteLength + ", ") + ("audio buffer: " + timeRangesToArray(audioBuffered).join(", ") + ", ") + ("video buffer: " + timeRangesToArray(videoBuffered).join(", ") + ", "));
  106799. this.error({
  106800. message: "Quota exceeded error with append of a single segment of content",
  106801. excludeUntil: Infinity
  106802. });
  106803. this.trigger("error");
  106804. return;
  106805. }
  106806. this.waitingOnRemove_ = true;
  106807. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  106808. segmentInfo,
  106809. type: type2,
  106810. bytes
  106811. }));
  106812. var currentTime = this.currentTime_();
  106813. var timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;
  106814. this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to " + timeToRemoveUntil);
  106815. this.remove(0, timeToRemoveUntil, function() {
  106816. _this3.logger_("On QUOTA_EXCEEDED_ERR, retrying append in " + MIN_BACK_BUFFER + "s");
  106817. _this3.waitingOnRemove_ = false;
  106818. _this3.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(function() {
  106819. _this3.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  106820. _this3.quotaExceededErrorRetryTimeout_ = null;
  106821. _this3.processCallQueue_();
  106822. }, MIN_BACK_BUFFER * 1e3);
  106823. }, true);
  106824. };
  106825. _proto.handleAppendError_ = function handleAppendError_(_ref6, error) {
  106826. var segmentInfo = _ref6.segmentInfo, type2 = _ref6.type, bytes = _ref6.bytes;
  106827. if (!error) {
  106828. return;
  106829. }
  106830. if (error.code === QUOTA_EXCEEDED_ERR) {
  106831. this.handleQuotaExceededError_({
  106832. segmentInfo,
  106833. type: type2,
  106834. bytes
  106835. });
  106836. return;
  106837. }
  106838. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  106839. this.error(type2 + " append of " + bytes.length + "b failed for segment " + ("#" + segmentInfo.mediaIndex + " in playlist " + segmentInfo.playlist.id));
  106840. this.trigger("appenderror");
  106841. };
  106842. _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) {
  106843. var segmentInfo = _ref7.segmentInfo, type2 = _ref7.type, initSegment = _ref7.initSegment, data = _ref7.data, bytes = _ref7.bytes;
  106844. if (!bytes) {
  106845. var segments = [data];
  106846. var byteLength = data.byteLength;
  106847. if (initSegment) {
  106848. segments.unshift(initSegment);
  106849. byteLength += initSegment.byteLength;
  106850. }
  106851. bytes = concatSegments({
  106852. bytes: byteLength,
  106853. segments
  106854. });
  106855. }
  106856. this.sourceUpdater_.appendBuffer({
  106857. segmentInfo,
  106858. type: type2,
  106859. bytes
  106860. }, this.handleAppendError_.bind(this, {
  106861. segmentInfo,
  106862. type: type2,
  106863. bytes
  106864. }));
  106865. };
  106866. _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  106867. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  106868. return;
  106869. }
  106870. var segment = this.pendingSegment_.segment;
  106871. var timingInfoProperty = type2 + "TimingInfo";
  106872. if (!segment[timingInfoProperty]) {
  106873. segment[timingInfoProperty] = {};
  106874. }
  106875. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  106876. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  106877. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  106878. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  106879. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  106880. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  106881. };
  106882. _proto.appendData_ = function appendData_(segmentInfo, result) {
  106883. var type2 = result.type, data = result.data;
  106884. if (!data || !data.byteLength) {
  106885. return;
  106886. }
  106887. if (type2 === "audio" && this.audioDisabled_) {
  106888. return;
  106889. }
  106890. var initSegment = this.getInitSegmentAndUpdateState_({
  106891. type: type2,
  106892. initSegment: result.initSegment,
  106893. playlist: segmentInfo.playlist,
  106894. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  106895. });
  106896. this.appendToSourceBuffer_({
  106897. segmentInfo,
  106898. type: type2,
  106899. initSegment,
  106900. data
  106901. });
  106902. };
  106903. _proto.loadSegment_ = function loadSegment_(segmentInfo) {
  106904. var _this4 = this;
  106905. this.state = "WAITING";
  106906. this.pendingSegment_ = segmentInfo;
  106907. this.trimBackBuffer_(segmentInfo);
  106908. if (typeof segmentInfo.timestampOffset === "number") {
  106909. if (this.transmuxer_) {
  106910. this.transmuxer_.postMessage({
  106911. action: "clearAllMp4Captions"
  106912. });
  106913. }
  106914. }
  106915. if (!this.hasEnoughInfoToLoad_()) {
  106916. this.loadQueue_.push(function() {
  106917. var options2 = _extends$2({}, segmentInfo, {
  106918. forceTimestampOffset: true
  106919. });
  106920. _extends$2(segmentInfo, _this4.generateSegmentInfo_(options2));
  106921. _this4.isPendingTimestampOffset_ = false;
  106922. _this4.updateTransmuxerAndRequestSegment_(segmentInfo);
  106923. });
  106924. return;
  106925. }
  106926. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  106927. };
  106928. _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) {
  106929. var _this5 = this;
  106930. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  106931. this.gopBuffer_.length = 0;
  106932. segmentInfo.gopsToAlignWith = [];
  106933. this.timeMapping_ = 0;
  106934. this.transmuxer_.postMessage({
  106935. action: "reset"
  106936. });
  106937. this.transmuxer_.postMessage({
  106938. action: "setTimestampOffset",
  106939. timestampOffset: segmentInfo.timestampOffset
  106940. });
  106941. }
  106942. var simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  106943. var isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  106944. var isWalkingForward = this.mediaIndex !== null;
  106945. var isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  106946. var isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  106947. this.logger_("Requesting " + segmentInfoString(segmentInfo));
  106948. if (simpleSegment.map && !simpleSegment.map.bytes) {
  106949. this.logger_("going to request init segment.");
  106950. this.appendInitSegment_ = {
  106951. video: true,
  106952. audio: true
  106953. };
  106954. }
  106955. segmentInfo.abortRequests = mediaSegmentRequest({
  106956. xhr: this.vhs_.xhr,
  106957. xhrOptions: this.xhrOptions_,
  106958. decryptionWorker: this.decrypter_,
  106959. segment: simpleSegment,
  106960. abortFn: this.handleAbort_.bind(this, segmentInfo),
  106961. progressFn: this.handleProgress_.bind(this),
  106962. trackInfoFn: this.handleTrackInfo_.bind(this),
  106963. timingInfoFn: this.handleTimingInfo_.bind(this),
  106964. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  106965. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  106966. captionsFn: this.handleCaptions_.bind(this),
  106967. isEndOfTimeline,
  106968. endedTimelineFn: function endedTimelineFn() {
  106969. _this5.logger_("received endedtimeline callback");
  106970. },
  106971. id3Fn: this.handleId3_.bind(this),
  106972. dataFn: this.handleData_.bind(this),
  106973. doneFn: this.segmentRequestFinished_.bind(this),
  106974. onTransmuxerLog: function onTransmuxerLog(_ref8) {
  106975. var message = _ref8.message, level = _ref8.level, stream = _ref8.stream;
  106976. _this5.logger_(segmentInfoString(segmentInfo) + " logged from transmuxer stream " + stream + " as a " + level + ": " + message);
  106977. }
  106978. });
  106979. };
  106980. _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) {
  106981. var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  106982. if (removeToTime > 0) {
  106983. this.remove(0, removeToTime);
  106984. }
  106985. };
  106986. _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) {
  106987. var segment = segmentInfo.segment;
  106988. var part = segmentInfo.part;
  106989. var simpleSegment = {
  106990. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  106991. byterange: part ? part.byterange : segment.byterange,
  106992. requestId: segmentInfo.requestId,
  106993. transmuxer: segmentInfo.transmuxer,
  106994. audioAppendStart: segmentInfo.audioAppendStart,
  106995. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  106996. part: segmentInfo.part
  106997. };
  106998. var previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  106999. if (previousSegment && previousSegment.timeline === segment.timeline) {
  107000. if (previousSegment.videoTimingInfo) {
  107001. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  107002. } else if (previousSegment.audioTimingInfo) {
  107003. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  107004. }
  107005. }
  107006. if (segment.key) {
  107007. var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  107008. simpleSegment.key = this.segmentKey(segment.key);
  107009. simpleSegment.key.iv = iv;
  107010. }
  107011. if (segment.map) {
  107012. simpleSegment.map = this.initSegmentForMap(segment.map);
  107013. }
  107014. return simpleSegment;
  107015. };
  107016. _proto.saveTransferStats_ = function saveTransferStats_(stats) {
  107017. this.mediaRequests += 1;
  107018. if (stats) {
  107019. this.mediaBytesTransferred += stats.bytesReceived;
  107020. this.mediaTransferDuration += stats.roundTripTime;
  107021. }
  107022. };
  107023. _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration5, stats) {
  107024. this.pendingSegment_.byteLength = stats.bytesReceived;
  107025. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107026. this.logger_("Ignoring segment's bandwidth because its duration of " + duration5 + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107027. return;
  107028. }
  107029. this.bandwidth = stats.bandwidth;
  107030. this.roundTrip = stats.roundTripTime;
  107031. };
  107032. _proto.handleTimeout_ = function handleTimeout_() {
  107033. this.mediaRequestsTimedout += 1;
  107034. this.bandwidth = 1;
  107035. this.roundTrip = NaN;
  107036. this.trigger("bandwidthupdate");
  107037. this.trigger("timeout");
  107038. };
  107039. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  107040. if (this.callQueue_.length) {
  107041. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  107042. return;
  107043. }
  107044. this.saveTransferStats_(simpleSegment.stats);
  107045. if (!this.pendingSegment_) {
  107046. return;
  107047. }
  107048. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  107049. return;
  107050. }
  107051. if (error) {
  107052. this.pendingSegment_ = null;
  107053. this.state = "READY";
  107054. if (error.code === REQUEST_ERRORS.ABORTED) {
  107055. return;
  107056. }
  107057. this.pause();
  107058. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  107059. this.handleTimeout_();
  107060. return;
  107061. }
  107062. this.mediaRequestsErrored += 1;
  107063. this.error(error);
  107064. this.trigger("error");
  107065. return;
  107066. }
  107067. var segmentInfo = this.pendingSegment_;
  107068. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  107069. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  107070. if (result.gopInfo) {
  107071. this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  107072. }
  107073. this.state = "APPENDING";
  107074. this.trigger("appending");
  107075. this.waitForAppendsToComplete_(segmentInfo);
  107076. };
  107077. _proto.setTimeMapping_ = function setTimeMapping_(timeline) {
  107078. var timelineMapping = this.syncController_.mappingForTimeline(timeline);
  107079. if (timelineMapping !== null) {
  107080. this.timeMapping_ = timelineMapping;
  107081. }
  107082. };
  107083. _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) {
  107084. if (typeof segment.start === "number" && typeof segment.end === "number") {
  107085. this.mediaSecondsLoaded += segment.end - segment.start;
  107086. } else {
  107087. this.mediaSecondsLoaded += segment.duration;
  107088. }
  107089. };
  107090. _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  107091. if (timestampOffset2 === null) {
  107092. return false;
  107093. }
  107094. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  107095. return true;
  107096. }
  107097. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  107098. return true;
  107099. }
  107100. return false;
  107101. };
  107102. _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) {
  107103. var currentStart = _ref9.currentStart, playlist = _ref9.playlist, mediaIndex = _ref9.mediaIndex, firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData, currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset, useVideoTimingInfo = _ref9.useVideoTimingInfo, videoTimingInfo = _ref9.videoTimingInfo, audioTimingInfo = _ref9.audioTimingInfo;
  107104. if (typeof currentStart !== "undefined") {
  107105. return currentStart;
  107106. }
  107107. if (!useVideoTimingInfo) {
  107108. return audioTimingInfo.start;
  107109. }
  107110. var previousSegment = playlist.segments[mediaIndex - 1];
  107111. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  107112. return firstVideoFrameTimeForData;
  107113. }
  107114. return videoTimingInfo.start;
  107115. };
  107116. _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) {
  107117. var trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  107118. if (!trackInfo) {
  107119. this.error({
  107120. message: "No starting media returned, likely due to an unsupported media format.",
  107121. blacklistDuration: Infinity
  107122. });
  107123. this.trigger("error");
  107124. return;
  107125. }
  107126. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  107127. var waitForVideo = this.loaderType_ === "main" && hasVideo;
  107128. var waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  107129. segmentInfo.waitingOnAppends = 0;
  107130. if (!segmentInfo.hasAppendedData_) {
  107131. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  107132. this.isPendingTimestampOffset_ = true;
  107133. }
  107134. segmentInfo.timingInfo = {
  107135. start: 0
  107136. };
  107137. segmentInfo.waitingOnAppends++;
  107138. if (!this.isPendingTimestampOffset_) {
  107139. this.updateSourceBufferTimestampOffset_(segmentInfo);
  107140. this.processMetadataQueue_();
  107141. }
  107142. this.checkAppendsDone_(segmentInfo);
  107143. return;
  107144. }
  107145. if (waitForVideo) {
  107146. segmentInfo.waitingOnAppends++;
  107147. }
  107148. if (waitForAudio) {
  107149. segmentInfo.waitingOnAppends++;
  107150. }
  107151. if (waitForVideo) {
  107152. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107153. }
  107154. if (waitForAudio) {
  107155. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107156. }
  107157. };
  107158. _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) {
  107159. if (this.checkForAbort_(segmentInfo.requestId)) {
  107160. return;
  107161. }
  107162. segmentInfo.waitingOnAppends--;
  107163. if (segmentInfo.waitingOnAppends === 0) {
  107164. this.handleAppendsDone_();
  107165. }
  107166. };
  107167. _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) {
  107168. var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  107169. if (illegalMediaSwitchError) {
  107170. this.error({
  107171. message: illegalMediaSwitchError,
  107172. blacklistDuration: Infinity
  107173. });
  107174. this.trigger("error");
  107175. return true;
  107176. }
  107177. return false;
  107178. };
  107179. _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) {
  107180. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  107181. return;
  107182. }
  107183. var didChange = false;
  107184. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  107185. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  107186. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  107187. timingInfo: segmentInfo.timingInfo
  107188. });
  107189. segmentInfo.changedTimestampOffset = true;
  107190. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  107191. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  107192. didChange = true;
  107193. }
  107194. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  107195. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  107196. didChange = true;
  107197. }
  107198. if (didChange) {
  107199. this.trigger("timestampoffset");
  107200. }
  107201. };
  107202. _proto.getSegmentStartTimeForTimestampOffsetCalculation_ = function getSegmentStartTimeForTimestampOffsetCalculation_(_ref10) {
  107203. var videoTimingInfo = _ref10.videoTimingInfo, audioTimingInfo = _ref10.audioTimingInfo, timingInfo = _ref10.timingInfo;
  107204. if (!this.useDtsForTimestampOffset_) {
  107205. return timingInfo.start;
  107206. }
  107207. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  107208. return videoTimingInfo.transmuxedDecodeStart;
  107209. }
  107210. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  107211. return audioTimingInfo.transmuxedDecodeStart;
  107212. }
  107213. return timingInfo.start;
  107214. };
  107215. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) {
  107216. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  107217. var trackInfo = this.getMediaInfo_();
  107218. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  107219. var prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  107220. if (!prioritizedTimingInfo) {
  107221. return;
  107222. }
  107223. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  107224. };
  107225. _proto.handleAppendsDone_ = function handleAppendsDone_() {
  107226. if (this.pendingSegment_) {
  107227. this.trigger("appendsdone");
  107228. }
  107229. if (!this.pendingSegment_) {
  107230. this.state = "READY";
  107231. if (!this.paused()) {
  107232. this.monitorBuffer_();
  107233. }
  107234. return;
  107235. }
  107236. var segmentInfo = this.pendingSegment_;
  107237. this.updateTimingInfoEnd_(segmentInfo);
  107238. if (this.shouldSaveSegmentTimingInfo_) {
  107239. this.syncController_.saveSegmentTimingInfo({
  107240. segmentInfo,
  107241. shouldSaveTimelineMapping: this.loaderType_ === "main"
  107242. });
  107243. }
  107244. var segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);
  107245. if (segmentDurationMessage) {
  107246. if (segmentDurationMessage.severity === "warn") {
  107247. videojs.log.warn(segmentDurationMessage.message);
  107248. } else {
  107249. this.logger_(segmentDurationMessage.message);
  107250. }
  107251. }
  107252. this.recordThroughput_(segmentInfo);
  107253. this.pendingSegment_ = null;
  107254. this.state = "READY";
  107255. if (segmentInfo.isSyncRequest) {
  107256. this.trigger("syncinfoupdate");
  107257. if (!segmentInfo.hasAppendedData_) {
  107258. this.logger_("Throwing away un-appended sync request " + segmentInfoString(segmentInfo));
  107259. return;
  107260. }
  107261. }
  107262. this.logger_("Appended " + segmentInfoString(segmentInfo));
  107263. this.addSegmentMetadataCue_(segmentInfo);
  107264. this.fetchAtBuffer_ = true;
  107265. if (this.currentTimeline_ !== segmentInfo.timeline) {
  107266. this.timelineChangeController_.lastTimelineChange({
  107267. type: this.loaderType_,
  107268. from: this.currentTimeline_,
  107269. to: segmentInfo.timeline
  107270. });
  107271. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  107272. this.timelineChangeController_.lastTimelineChange({
  107273. type: "audio",
  107274. from: this.currentTimeline_,
  107275. to: segmentInfo.timeline
  107276. });
  107277. }
  107278. }
  107279. this.currentTimeline_ = segmentInfo.timeline;
  107280. this.trigger("syncinfoupdate");
  107281. var segment = segmentInfo.segment;
  107282. var part = segmentInfo.part;
  107283. var badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  107284. var badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  107285. if (badSegmentGuess || badPartGuess) {
  107286. this.logger_("bad " + (badSegmentGuess ? "segment" : "part") + " " + segmentInfoString(segmentInfo));
  107287. this.resetEverything();
  107288. return;
  107289. }
  107290. var isWalkingForward = this.mediaIndex !== null;
  107291. if (isWalkingForward) {
  107292. this.trigger("bandwidthupdate");
  107293. }
  107294. this.trigger("progress");
  107295. this.mediaIndex = segmentInfo.mediaIndex;
  107296. this.partIndex = segmentInfo.partIndex;
  107297. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  107298. this.endOfStream();
  107299. }
  107300. this.trigger("appended");
  107301. if (segmentInfo.hasAppendedData_) {
  107302. this.mediaAppends++;
  107303. }
  107304. if (!this.paused()) {
  107305. this.monitorBuffer_();
  107306. }
  107307. };
  107308. _proto.recordThroughput_ = function recordThroughput_(segmentInfo) {
  107309. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107310. this.logger_("Ignoring segment's throughput because its duration of " + segmentInfo.duration + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107311. return;
  107312. }
  107313. var rate = this.throughput.rate;
  107314. var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  107315. var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  107316. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  107317. };
  107318. _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) {
  107319. if (!this.segmentMetadataTrack_) {
  107320. return;
  107321. }
  107322. var segment = segmentInfo.segment;
  107323. var start2 = segment.start;
  107324. var end = segment.end;
  107325. if (!finite(start2) || !finite(end)) {
  107326. return;
  107327. }
  107328. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  107329. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  107330. var value = {
  107331. custom: segment.custom,
  107332. dateTimeObject: segment.dateTimeObject,
  107333. dateTimeString: segment.dateTimeString,
  107334. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  107335. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  107336. codecs: segmentInfo.playlist.attributes.CODECS,
  107337. byteLength: segmentInfo.byteLength,
  107338. uri: segmentInfo.uri,
  107339. timeline: segmentInfo.timeline,
  107340. playlist: segmentInfo.playlist.id,
  107341. start: start2,
  107342. end
  107343. };
  107344. var data = JSON.stringify(value);
  107345. var cue = new Cue(start2, end, data);
  107346. cue.value = value;
  107347. this.segmentMetadataTrack_.addCue(cue);
  107348. };
  107349. return SegmentLoader2;
  107350. }(videojs.EventTarget);
  107351. function noop() {
  107352. }
  107353. var toTitleCase2 = function toTitleCase3(string) {
  107354. if (typeof string !== "string") {
  107355. return string;
  107356. }
  107357. return string.replace(/./, function(w) {
  107358. return w.toUpperCase();
  107359. });
  107360. };
  107361. var bufferTypes = ["video", "audio"];
  107362. var _updating = function updating2(type2, sourceUpdater) {
  107363. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107364. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  107365. };
  107366. var nextQueueIndexOfType = function nextQueueIndexOfType2(type2, queue) {
  107367. for (var i2 = 0; i2 < queue.length; i2++) {
  107368. var queueEntry = queue[i2];
  107369. if (queueEntry.type === "mediaSource") {
  107370. return null;
  107371. }
  107372. if (queueEntry.type === type2) {
  107373. return i2;
  107374. }
  107375. }
  107376. return null;
  107377. };
  107378. var shiftQueue = function shiftQueue2(type2, sourceUpdater) {
  107379. if (sourceUpdater.queue.length === 0) {
  107380. return;
  107381. }
  107382. var queueIndex = 0;
  107383. var queueEntry = sourceUpdater.queue[queueIndex];
  107384. if (queueEntry.type === "mediaSource") {
  107385. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  107386. sourceUpdater.queue.shift();
  107387. queueEntry.action(sourceUpdater);
  107388. if (queueEntry.doneFn) {
  107389. queueEntry.doneFn();
  107390. }
  107391. shiftQueue2("audio", sourceUpdater);
  107392. shiftQueue2("video", sourceUpdater);
  107393. }
  107394. return;
  107395. }
  107396. if (type2 === "mediaSource") {
  107397. return;
  107398. }
  107399. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || _updating(type2, sourceUpdater)) {
  107400. return;
  107401. }
  107402. if (queueEntry.type !== type2) {
  107403. queueIndex = nextQueueIndexOfType(type2, sourceUpdater.queue);
  107404. if (queueIndex === null) {
  107405. return;
  107406. }
  107407. queueEntry = sourceUpdater.queue[queueIndex];
  107408. }
  107409. sourceUpdater.queue.splice(queueIndex, 1);
  107410. sourceUpdater.queuePending[type2] = queueEntry;
  107411. queueEntry.action(type2, sourceUpdater);
  107412. if (!queueEntry.doneFn) {
  107413. sourceUpdater.queuePending[type2] = null;
  107414. shiftQueue2(type2, sourceUpdater);
  107415. return;
  107416. }
  107417. };
  107418. var cleanupBuffer = function cleanupBuffer2(type2, sourceUpdater) {
  107419. var buffer = sourceUpdater[type2 + "Buffer"];
  107420. var titleType = toTitleCase2(type2);
  107421. if (!buffer) {
  107422. return;
  107423. }
  107424. buffer.removeEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107425. buffer.removeEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107426. sourceUpdater.codecs[type2] = null;
  107427. sourceUpdater[type2 + "Buffer"] = null;
  107428. };
  107429. var inSourceBuffers = function inSourceBuffers2(mediaSource, sourceBuffer) {
  107430. return mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  107431. };
  107432. var actions = {
  107433. appendBuffer: function appendBuffer(bytes, segmentInfo, onError2) {
  107434. return function(type2, sourceUpdater) {
  107435. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107436. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107437. return;
  107438. }
  107439. sourceUpdater.logger_("Appending segment " + segmentInfo.mediaIndex + "'s " + bytes.length + " bytes to " + type2 + "Buffer");
  107440. try {
  107441. sourceBuffer.appendBuffer(bytes);
  107442. } catch (e) {
  107443. sourceUpdater.logger_("Error with code " + e.code + " " + (e.code === QUOTA_EXCEEDED_ERR ? "(QUOTA_EXCEEDED_ERR) " : "") + ("when appending segment " + segmentInfo.mediaIndex + " to " + type2 + "Buffer"));
  107444. sourceUpdater.queuePending[type2] = null;
  107445. onError2(e);
  107446. }
  107447. };
  107448. },
  107449. remove: function remove(start2, end) {
  107450. return function(type2, sourceUpdater) {
  107451. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107452. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107453. return;
  107454. }
  107455. sourceUpdater.logger_("Removing " + start2 + " to " + end + " from " + type2 + "Buffer");
  107456. try {
  107457. sourceBuffer.remove(start2, end);
  107458. } catch (e) {
  107459. sourceUpdater.logger_("Remove " + start2 + " to " + end + " from " + type2 + "Buffer failed");
  107460. }
  107461. };
  107462. },
  107463. timestampOffset: function timestampOffset(offset) {
  107464. return function(type2, sourceUpdater) {
  107465. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107466. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107467. return;
  107468. }
  107469. sourceUpdater.logger_("Setting " + type2 + "timestampOffset to " + offset);
  107470. sourceBuffer.timestampOffset = offset;
  107471. };
  107472. },
  107473. callback: function callback(_callback) {
  107474. return function(type2, sourceUpdater) {
  107475. _callback();
  107476. };
  107477. },
  107478. endOfStream: function endOfStream(error) {
  107479. return function(sourceUpdater) {
  107480. if (sourceUpdater.mediaSource.readyState !== "open") {
  107481. return;
  107482. }
  107483. sourceUpdater.logger_("Calling mediaSource endOfStream(" + (error || "") + ")");
  107484. try {
  107485. sourceUpdater.mediaSource.endOfStream(error);
  107486. } catch (e) {
  107487. videojs.log.warn("Failed to call media source endOfStream", e);
  107488. }
  107489. };
  107490. },
  107491. duration: function duration4(_duration) {
  107492. return function(sourceUpdater) {
  107493. sourceUpdater.logger_("Setting mediaSource duration to " + _duration);
  107494. try {
  107495. sourceUpdater.mediaSource.duration = _duration;
  107496. } catch (e) {
  107497. videojs.log.warn("Failed to set media source duration", e);
  107498. }
  107499. };
  107500. },
  107501. abort: function abort() {
  107502. return function(type2, sourceUpdater) {
  107503. if (sourceUpdater.mediaSource.readyState !== "open") {
  107504. return;
  107505. }
  107506. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107507. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107508. return;
  107509. }
  107510. sourceUpdater.logger_("calling abort on " + type2 + "Buffer");
  107511. try {
  107512. sourceBuffer.abort();
  107513. } catch (e) {
  107514. videojs.log.warn("Failed to abort on " + type2 + "Buffer", e);
  107515. }
  107516. };
  107517. },
  107518. addSourceBuffer: function addSourceBuffer(type2, codec) {
  107519. return function(sourceUpdater) {
  107520. var titleType = toTitleCase2(type2);
  107521. var mime = getMimeForCodec2(codec);
  107522. sourceUpdater.logger_("Adding " + type2 + "Buffer with codec " + codec + " to mediaSource");
  107523. var sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  107524. sourceBuffer.addEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107525. sourceBuffer.addEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107526. sourceUpdater.codecs[type2] = codec;
  107527. sourceUpdater[type2 + "Buffer"] = sourceBuffer;
  107528. };
  107529. },
  107530. removeSourceBuffer: function removeSourceBuffer(type2) {
  107531. return function(sourceUpdater) {
  107532. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107533. cleanupBuffer(type2, sourceUpdater);
  107534. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107535. return;
  107536. }
  107537. sourceUpdater.logger_("Removing " + type2 + "Buffer with codec " + sourceUpdater.codecs[type2] + " from mediaSource");
  107538. try {
  107539. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  107540. } catch (e) {
  107541. videojs.log.warn("Failed to removeSourceBuffer " + type2 + "Buffer", e);
  107542. }
  107543. };
  107544. },
  107545. changeType: function changeType(codec) {
  107546. return function(type2, sourceUpdater) {
  107547. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107548. var mime = getMimeForCodec2(codec);
  107549. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107550. return;
  107551. }
  107552. if (sourceUpdater.codecs[type2] === codec) {
  107553. return;
  107554. }
  107555. sourceUpdater.logger_("changing " + type2 + "Buffer codec from " + sourceUpdater.codecs[type2] + " to " + codec);
  107556. sourceBuffer.changeType(mime);
  107557. sourceUpdater.codecs[type2] = codec;
  107558. };
  107559. }
  107560. };
  107561. var pushQueue = function pushQueue2(_ref) {
  107562. var type2 = _ref.type, sourceUpdater = _ref.sourceUpdater, action = _ref.action, doneFn = _ref.doneFn, name = _ref.name;
  107563. sourceUpdater.queue.push({
  107564. type: type2,
  107565. action,
  107566. doneFn,
  107567. name
  107568. });
  107569. shiftQueue(type2, sourceUpdater);
  107570. };
  107571. var onUpdateend = function onUpdateend2(type2, sourceUpdater) {
  107572. return function(e) {
  107573. if (sourceUpdater.queuePending[type2]) {
  107574. var doneFn = sourceUpdater.queuePending[type2].doneFn;
  107575. sourceUpdater.queuePending[type2] = null;
  107576. if (doneFn) {
  107577. doneFn(sourceUpdater[type2 + "Error_"]);
  107578. }
  107579. }
  107580. shiftQueue(type2, sourceUpdater);
  107581. };
  107582. };
  107583. var SourceUpdater = /* @__PURE__ */ function(_videojs$EventTarget) {
  107584. _inheritsLoose(SourceUpdater2, _videojs$EventTarget);
  107585. function SourceUpdater2(mediaSource) {
  107586. var _this;
  107587. _this = _videojs$EventTarget.call(this) || this;
  107588. _this.mediaSource = mediaSource;
  107589. _this.sourceopenListener_ = function() {
  107590. return shiftQueue("mediaSource", _assertThisInitialized(_this));
  107591. };
  107592. _this.mediaSource.addEventListener("sourceopen", _this.sourceopenListener_);
  107593. _this.logger_ = logger("SourceUpdater");
  107594. _this.audioTimestampOffset_ = 0;
  107595. _this.videoTimestampOffset_ = 0;
  107596. _this.queue = [];
  107597. _this.queuePending = {
  107598. audio: null,
  107599. video: null
  107600. };
  107601. _this.delayedAudioAppendQueue_ = [];
  107602. _this.videoAppendQueued_ = false;
  107603. _this.codecs = {};
  107604. _this.onVideoUpdateEnd_ = onUpdateend("video", _assertThisInitialized(_this));
  107605. _this.onAudioUpdateEnd_ = onUpdateend("audio", _assertThisInitialized(_this));
  107606. _this.onVideoError_ = function(e) {
  107607. _this.videoError_ = e;
  107608. };
  107609. _this.onAudioError_ = function(e) {
  107610. _this.audioError_ = e;
  107611. };
  107612. _this.createdSourceBuffers_ = false;
  107613. _this.initializedEme_ = false;
  107614. _this.triggeredReady_ = false;
  107615. return _this;
  107616. }
  107617. var _proto = SourceUpdater2.prototype;
  107618. _proto.initializedEme = function initializedEme() {
  107619. this.initializedEme_ = true;
  107620. this.triggerReady();
  107621. };
  107622. _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() {
  107623. return this.createdSourceBuffers_;
  107624. };
  107625. _proto.hasInitializedAnyEme = function hasInitializedAnyEme() {
  107626. return this.initializedEme_;
  107627. };
  107628. _proto.ready = function ready() {
  107629. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  107630. };
  107631. _proto.createSourceBuffers = function createSourceBuffers(codecs) {
  107632. if (this.hasCreatedSourceBuffers()) {
  107633. return;
  107634. }
  107635. this.addOrChangeSourceBuffers(codecs);
  107636. this.createdSourceBuffers_ = true;
  107637. this.trigger("createdsourcebuffers");
  107638. this.triggerReady();
  107639. };
  107640. _proto.triggerReady = function triggerReady() {
  107641. if (this.ready() && !this.triggeredReady_) {
  107642. this.triggeredReady_ = true;
  107643. this.trigger("ready");
  107644. }
  107645. };
  107646. _proto.addSourceBuffer = function addSourceBuffer2(type2, codec) {
  107647. pushQueue({
  107648. type: "mediaSource",
  107649. sourceUpdater: this,
  107650. action: actions.addSourceBuffer(type2, codec),
  107651. name: "addSourceBuffer"
  107652. });
  107653. };
  107654. _proto.abort = function abort2(type2) {
  107655. pushQueue({
  107656. type: type2,
  107657. sourceUpdater: this,
  107658. action: actions.abort(type2),
  107659. name: "abort"
  107660. });
  107661. };
  107662. _proto.removeSourceBuffer = function removeSourceBuffer2(type2) {
  107663. if (!this.canRemoveSourceBuffer()) {
  107664. videojs.log.error("removeSourceBuffer is not supported!");
  107665. return;
  107666. }
  107667. pushQueue({
  107668. type: "mediaSource",
  107669. sourceUpdater: this,
  107670. action: actions.removeSourceBuffer(type2),
  107671. name: "removeSourceBuffer"
  107672. });
  107673. };
  107674. _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() {
  107675. return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  107676. };
  107677. SourceUpdater2.canChangeType = function canChangeType() {
  107678. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  107679. };
  107680. _proto.canChangeType = function canChangeType() {
  107681. return this.constructor.canChangeType();
  107682. };
  107683. _proto.changeType = function changeType2(type2, codec) {
  107684. if (!this.canChangeType()) {
  107685. videojs.log.error("changeType is not supported!");
  107686. return;
  107687. }
  107688. pushQueue({
  107689. type: type2,
  107690. sourceUpdater: this,
  107691. action: actions.changeType(codec),
  107692. name: "changeType"
  107693. });
  107694. };
  107695. _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) {
  107696. var _this2 = this;
  107697. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  107698. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  107699. }
  107700. Object.keys(codecs).forEach(function(type2) {
  107701. var codec = codecs[type2];
  107702. if (!_this2.hasCreatedSourceBuffers()) {
  107703. return _this2.addSourceBuffer(type2, codec);
  107704. }
  107705. if (_this2.canChangeType()) {
  107706. _this2.changeType(type2, codec);
  107707. }
  107708. });
  107709. };
  107710. _proto.appendBuffer = function appendBuffer2(options2, doneFn) {
  107711. var _this3 = this;
  107712. var segmentInfo = options2.segmentInfo, type2 = options2.type, bytes = options2.bytes;
  107713. this.processedAppend_ = true;
  107714. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  107715. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  107716. this.logger_("delayed audio append of " + bytes.length + " until video append");
  107717. return;
  107718. }
  107719. var onError2 = doneFn;
  107720. pushQueue({
  107721. type: type2,
  107722. sourceUpdater: this,
  107723. action: actions.appendBuffer(bytes, segmentInfo || {
  107724. mediaIndex: -1
  107725. }, onError2),
  107726. doneFn,
  107727. name: "appendBuffer"
  107728. });
  107729. if (type2 === "video") {
  107730. this.videoAppendQueued_ = true;
  107731. if (!this.delayedAudioAppendQueue_.length) {
  107732. return;
  107733. }
  107734. var queue = this.delayedAudioAppendQueue_.slice();
  107735. this.logger_("queuing delayed audio " + queue.length + " appendBuffers");
  107736. this.delayedAudioAppendQueue_.length = 0;
  107737. queue.forEach(function(que) {
  107738. _this3.appendBuffer.apply(_this3, que);
  107739. });
  107740. }
  107741. };
  107742. _proto.audioBuffered = function audioBuffered() {
  107743. if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {
  107744. return videojs.createTimeRange();
  107745. }
  107746. return this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange();
  107747. };
  107748. _proto.videoBuffered = function videoBuffered() {
  107749. if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {
  107750. return videojs.createTimeRange();
  107751. }
  107752. return this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange();
  107753. };
  107754. _proto.buffered = function buffered() {
  107755. var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  107756. var audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  107757. if (audio && !video) {
  107758. return this.audioBuffered();
  107759. }
  107760. if (video && !audio) {
  107761. return this.videoBuffered();
  107762. }
  107763. return bufferIntersection(this.audioBuffered(), this.videoBuffered());
  107764. };
  107765. _proto.setDuration = function setDuration(duration5, doneFn) {
  107766. if (doneFn === void 0) {
  107767. doneFn = noop;
  107768. }
  107769. pushQueue({
  107770. type: "mediaSource",
  107771. sourceUpdater: this,
  107772. action: actions.duration(duration5),
  107773. name: "duration",
  107774. doneFn
  107775. });
  107776. };
  107777. _proto.endOfStream = function endOfStream2(error, doneFn) {
  107778. if (error === void 0) {
  107779. error = null;
  107780. }
  107781. if (doneFn === void 0) {
  107782. doneFn = noop;
  107783. }
  107784. if (typeof error !== "string") {
  107785. error = void 0;
  107786. }
  107787. pushQueue({
  107788. type: "mediaSource",
  107789. sourceUpdater: this,
  107790. action: actions.endOfStream(error),
  107791. name: "endOfStream",
  107792. doneFn
  107793. });
  107794. };
  107795. _proto.removeAudio = function removeAudio(start2, end, done) {
  107796. if (done === void 0) {
  107797. done = noop;
  107798. }
  107799. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  107800. done();
  107801. return;
  107802. }
  107803. pushQueue({
  107804. type: "audio",
  107805. sourceUpdater: this,
  107806. action: actions.remove(start2, end),
  107807. doneFn: done,
  107808. name: "remove"
  107809. });
  107810. };
  107811. _proto.removeVideo = function removeVideo(start2, end, done) {
  107812. if (done === void 0) {
  107813. done = noop;
  107814. }
  107815. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  107816. done();
  107817. return;
  107818. }
  107819. pushQueue({
  107820. type: "video",
  107821. sourceUpdater: this,
  107822. action: actions.remove(start2, end),
  107823. doneFn: done,
  107824. name: "remove"
  107825. });
  107826. };
  107827. _proto.updating = function updating3() {
  107828. if (_updating("audio", this) || _updating("video", this)) {
  107829. return true;
  107830. }
  107831. return false;
  107832. };
  107833. _proto.audioTimestampOffset = function audioTimestampOffset(offset) {
  107834. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  107835. pushQueue({
  107836. type: "audio",
  107837. sourceUpdater: this,
  107838. action: actions.timestampOffset(offset),
  107839. name: "timestampOffset"
  107840. });
  107841. this.audioTimestampOffset_ = offset;
  107842. }
  107843. return this.audioTimestampOffset_;
  107844. };
  107845. _proto.videoTimestampOffset = function videoTimestampOffset(offset) {
  107846. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  107847. pushQueue({
  107848. type: "video",
  107849. sourceUpdater: this,
  107850. action: actions.timestampOffset(offset),
  107851. name: "timestampOffset"
  107852. });
  107853. this.videoTimestampOffset_ = offset;
  107854. }
  107855. return this.videoTimestampOffset_;
  107856. };
  107857. _proto.audioQueueCallback = function audioQueueCallback(callback2) {
  107858. if (!this.audioBuffer) {
  107859. return;
  107860. }
  107861. pushQueue({
  107862. type: "audio",
  107863. sourceUpdater: this,
  107864. action: actions.callback(callback2),
  107865. name: "callback"
  107866. });
  107867. };
  107868. _proto.videoQueueCallback = function videoQueueCallback(callback2) {
  107869. if (!this.videoBuffer) {
  107870. return;
  107871. }
  107872. pushQueue({
  107873. type: "video",
  107874. sourceUpdater: this,
  107875. action: actions.callback(callback2),
  107876. name: "callback"
  107877. });
  107878. };
  107879. _proto.dispose = function dispose() {
  107880. var _this4 = this;
  107881. this.trigger("dispose");
  107882. bufferTypes.forEach(function(type2) {
  107883. _this4.abort(type2);
  107884. if (_this4.canRemoveSourceBuffer()) {
  107885. _this4.removeSourceBuffer(type2);
  107886. } else {
  107887. _this4[type2 + "QueueCallback"](function() {
  107888. return cleanupBuffer(type2, _this4);
  107889. });
  107890. }
  107891. });
  107892. this.videoAppendQueued_ = false;
  107893. this.delayedAudioAppendQueue_.length = 0;
  107894. if (this.sourceopenListener_) {
  107895. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  107896. }
  107897. this.off();
  107898. };
  107899. return SourceUpdater2;
  107900. }(videojs.EventTarget);
  107901. var uint8ToUtf8 = function uint8ToUtf82(uintArray) {
  107902. return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  107903. };
  107904. var VTT_LINE_TERMINATORS = new Uint8Array("\n\n".split("").map(function(_char3) {
  107905. return _char3.charCodeAt(0);
  107906. }));
  107907. var NoVttJsError = /* @__PURE__ */ function(_Error) {
  107908. _inheritsLoose(NoVttJsError2, _Error);
  107909. function NoVttJsError2() {
  107910. return _Error.call(this, "Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.") || this;
  107911. }
  107912. return NoVttJsError2;
  107913. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  107914. var VTTSegmentLoader = /* @__PURE__ */ function(_SegmentLoader) {
  107915. _inheritsLoose(VTTSegmentLoader2, _SegmentLoader);
  107916. function VTTSegmentLoader2(settings, options2) {
  107917. var _this;
  107918. if (options2 === void 0) {
  107919. options2 = {};
  107920. }
  107921. _this = _SegmentLoader.call(this, settings, options2) || this;
  107922. _this.mediaSource_ = null;
  107923. _this.subtitlesTrack_ = null;
  107924. _this.loaderType_ = "subtitle";
  107925. _this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  107926. _this.loadVttJs = settings.loadVttJs;
  107927. _this.shouldSaveSegmentTimingInfo_ = false;
  107928. return _this;
  107929. }
  107930. var _proto = VTTSegmentLoader2.prototype;
  107931. _proto.createTransmuxer_ = function createTransmuxer_() {
  107932. return null;
  107933. };
  107934. _proto.buffered_ = function buffered_() {
  107935. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  107936. return videojs.createTimeRanges();
  107937. }
  107938. var cues = this.subtitlesTrack_.cues;
  107939. var start2 = cues[0].startTime;
  107940. var end = cues[cues.length - 1].startTime;
  107941. return videojs.createTimeRanges([[start2, end]]);
  107942. };
  107943. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  107944. if (set4 === void 0) {
  107945. set4 = false;
  107946. }
  107947. if (!map) {
  107948. return null;
  107949. }
  107950. var id = initSegmentId(map);
  107951. var storedMap = this.initSegments_[id];
  107952. if (set4 && !storedMap && map.bytes) {
  107953. var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;
  107954. var combinedSegment = new Uint8Array(combinedByteLength);
  107955. combinedSegment.set(map.bytes);
  107956. combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);
  107957. this.initSegments_[id] = storedMap = {
  107958. resolvedUri: map.resolvedUri,
  107959. byterange: map.byterange,
  107960. bytes: combinedSegment
  107961. };
  107962. }
  107963. return storedMap || map;
  107964. };
  107965. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  107966. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  107967. };
  107968. _proto.init_ = function init_() {
  107969. this.state = "READY";
  107970. this.resetEverything();
  107971. return this.monitorBuffer_();
  107972. };
  107973. _proto.track = function track(_track) {
  107974. if (typeof _track === "undefined") {
  107975. return this.subtitlesTrack_;
  107976. }
  107977. this.subtitlesTrack_ = _track;
  107978. if (this.state === "INIT" && this.couldBeginLoading_()) {
  107979. this.init_();
  107980. }
  107981. return this.subtitlesTrack_;
  107982. };
  107983. _proto.remove = function remove2(start2, end) {
  107984. removeCuesFromTrack(start2, end, this.subtitlesTrack_);
  107985. };
  107986. _proto.fillBuffer_ = function fillBuffer_() {
  107987. var _this2 = this;
  107988. var segmentInfo = this.chooseNextRequest_();
  107989. if (!segmentInfo) {
  107990. return;
  107991. }
  107992. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  107993. var checkTimestampOffset = function checkTimestampOffset2() {
  107994. _this2.state = "READY";
  107995. if (!_this2.paused()) {
  107996. _this2.monitorBuffer_();
  107997. }
  107998. };
  107999. this.syncController_.one("timestampoffset", checkTimestampOffset);
  108000. this.state = "WAITING_ON_TIMELINE";
  108001. return;
  108002. }
  108003. this.loadSegment_(segmentInfo);
  108004. };
  108005. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() {
  108006. return null;
  108007. };
  108008. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  108009. return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this));
  108010. };
  108011. _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) {
  108012. while (segmentInfo && segmentInfo.segment.empty) {
  108013. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  108014. segmentInfo = null;
  108015. break;
  108016. }
  108017. segmentInfo = this.generateSegmentInfo_({
  108018. playlist: segmentInfo.playlist,
  108019. mediaIndex: segmentInfo.mediaIndex + 1,
  108020. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  108021. isSyncRequest: segmentInfo.isSyncRequest
  108022. });
  108023. }
  108024. return segmentInfo;
  108025. };
  108026. _proto.stopForError = function stopForError(error) {
  108027. this.error(error);
  108028. this.state = "READY";
  108029. this.pause();
  108030. this.trigger("error");
  108031. };
  108032. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  108033. var _this3 = this;
  108034. if (!this.subtitlesTrack_) {
  108035. this.state = "READY";
  108036. return;
  108037. }
  108038. this.saveTransferStats_(simpleSegment.stats);
  108039. if (!this.pendingSegment_) {
  108040. this.state = "READY";
  108041. this.mediaRequestsAborted += 1;
  108042. return;
  108043. }
  108044. if (error) {
  108045. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  108046. this.handleTimeout_();
  108047. }
  108048. if (error.code === REQUEST_ERRORS.ABORTED) {
  108049. this.mediaRequestsAborted += 1;
  108050. } else {
  108051. this.mediaRequestsErrored += 1;
  108052. }
  108053. this.stopForError(error);
  108054. return;
  108055. }
  108056. var segmentInfo = this.pendingSegment_;
  108057. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  108058. if (simpleSegment.key) {
  108059. this.segmentKey(simpleSegment.key, true);
  108060. }
  108061. this.state = "APPENDING";
  108062. this.trigger("appending");
  108063. var segment = segmentInfo.segment;
  108064. if (segment.map) {
  108065. segment.map.bytes = simpleSegment.map.bytes;
  108066. }
  108067. segmentInfo.bytes = simpleSegment.bytes;
  108068. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  108069. this.state = "WAITING_ON_VTTJS";
  108070. this.loadVttJs().then(function() {
  108071. return _this3.segmentRequestFinished_(error, simpleSegment, result);
  108072. }, function() {
  108073. return _this3.stopForError({
  108074. message: "Error loading vtt.js"
  108075. });
  108076. });
  108077. return;
  108078. }
  108079. segment.requested = true;
  108080. try {
  108081. this.parseVTTCues_(segmentInfo);
  108082. } catch (e) {
  108083. this.stopForError({
  108084. message: e.message
  108085. });
  108086. return;
  108087. }
  108088. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  108089. if (segmentInfo.cues.length) {
  108090. segmentInfo.timingInfo = {
  108091. start: segmentInfo.cues[0].startTime,
  108092. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  108093. };
  108094. } else {
  108095. segmentInfo.timingInfo = {
  108096. start: segmentInfo.startOfSegment,
  108097. end: segmentInfo.startOfSegment + segmentInfo.duration
  108098. };
  108099. }
  108100. if (segmentInfo.isSyncRequest) {
  108101. this.trigger("syncinfoupdate");
  108102. this.pendingSegment_ = null;
  108103. this.state = "READY";
  108104. return;
  108105. }
  108106. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  108107. this.mediaSecondsLoaded += segment.duration;
  108108. segmentInfo.cues.forEach(function(cue) {
  108109. _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  108110. });
  108111. removeDuplicateCuesFromTrack(this.subtitlesTrack_);
  108112. this.handleAppendsDone_();
  108113. };
  108114. _proto.handleData_ = function handleData_3() {
  108115. };
  108116. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {
  108117. };
  108118. _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) {
  108119. var decoder;
  108120. var decodeBytesToString = false;
  108121. if (typeof window_1.WebVTT !== "function") {
  108122. throw new NoVttJsError();
  108123. }
  108124. if (typeof window_1.TextDecoder === "function") {
  108125. decoder = new window_1.TextDecoder("utf8");
  108126. } else {
  108127. decoder = window_1.WebVTT.StringDecoder();
  108128. decodeBytesToString = true;
  108129. }
  108130. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  108131. segmentInfo.cues = [];
  108132. segmentInfo.timestampmap = {
  108133. MPEGTS: 0,
  108134. LOCAL: 0
  108135. };
  108136. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  108137. parser2.ontimestampmap = function(map) {
  108138. segmentInfo.timestampmap = map;
  108139. };
  108140. parser2.onparsingerror = function(error) {
  108141. videojs.log.warn("Error encountered when parsing cues: " + error.message);
  108142. };
  108143. if (segmentInfo.segment.map) {
  108144. var mapData = segmentInfo.segment.map.bytes;
  108145. if (decodeBytesToString) {
  108146. mapData = uint8ToUtf8(mapData);
  108147. }
  108148. parser2.parse(mapData);
  108149. }
  108150. var segmentData = segmentInfo.bytes;
  108151. if (decodeBytesToString) {
  108152. segmentData = uint8ToUtf8(segmentData);
  108153. }
  108154. parser2.parse(segmentData);
  108155. parser2.flush();
  108156. };
  108157. _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  108158. var segment = segmentInfo.segment;
  108159. if (!mappingObj) {
  108160. return;
  108161. }
  108162. if (!segmentInfo.cues.length) {
  108163. segment.empty = true;
  108164. return;
  108165. }
  108166. var timestampmap = segmentInfo.timestampmap;
  108167. var diff = timestampmap.MPEGTS / clock.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  108168. segmentInfo.cues.forEach(function(cue) {
  108169. cue.startTime += diff;
  108170. cue.endTime += diff;
  108171. });
  108172. if (!playlist.syncInfo) {
  108173. var firstStart = segmentInfo.cues[0].startTime;
  108174. var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  108175. playlist.syncInfo = {
  108176. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  108177. time: Math.min(firstStart, lastStart - segment.duration)
  108178. };
  108179. }
  108180. };
  108181. return VTTSegmentLoader2;
  108182. }(SegmentLoader);
  108183. var findAdCue = function findAdCue2(track, mediaTime) {
  108184. var cues = track.cues;
  108185. for (var i2 = 0; i2 < cues.length; i2++) {
  108186. var cue = cues[i2];
  108187. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  108188. return cue;
  108189. }
  108190. }
  108191. return null;
  108192. };
  108193. var updateAdCues = function updateAdCues2(media, track, offset) {
  108194. if (offset === void 0) {
  108195. offset = 0;
  108196. }
  108197. if (!media.segments) {
  108198. return;
  108199. }
  108200. var mediaTime = offset;
  108201. var cue;
  108202. for (var i2 = 0; i2 < media.segments.length; i2++) {
  108203. var segment = media.segments[i2];
  108204. if (!cue) {
  108205. cue = findAdCue(track, mediaTime + segment.duration / 2);
  108206. }
  108207. if (cue) {
  108208. if ("cueIn" in segment) {
  108209. cue.endTime = mediaTime;
  108210. cue.adEndTime = mediaTime;
  108211. mediaTime += segment.duration;
  108212. cue = null;
  108213. continue;
  108214. }
  108215. if (mediaTime < cue.endTime) {
  108216. mediaTime += segment.duration;
  108217. continue;
  108218. }
  108219. cue.endTime += segment.duration;
  108220. } else {
  108221. if ("cueOut" in segment) {
  108222. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  108223. cue.adStartTime = mediaTime;
  108224. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  108225. track.addCue(cue);
  108226. }
  108227. if ("cueOutCont" in segment) {
  108228. var _segment$cueOutCont$s = segment.cueOutCont.split("/").map(parseFloat), adOffset = _segment$cueOutCont$s[0], adTotal = _segment$cueOutCont$s[1];
  108229. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  108230. cue.adStartTime = mediaTime - adOffset;
  108231. cue.adEndTime = cue.adStartTime + adTotal;
  108232. track.addCue(cue);
  108233. }
  108234. }
  108235. mediaTime += segment.duration;
  108236. }
  108237. };
  108238. var MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;
  108239. var syncPointStrategies = [
  108240. {
  108241. name: "VOD",
  108242. run: function run(syncController, playlist, duration5, currentTimeline, currentTime) {
  108243. if (duration5 !== Infinity) {
  108244. var syncPoint = {
  108245. time: 0,
  108246. segmentIndex: 0,
  108247. partIndex: null
  108248. };
  108249. return syncPoint;
  108250. }
  108251. return null;
  108252. }
  108253. },
  108254. {
  108255. name: "ProgramDateTime",
  108256. run: function run2(syncController, playlist, duration5, currentTimeline, currentTime) {
  108257. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  108258. return null;
  108259. }
  108260. var syncPoint = null;
  108261. var lastDistance = null;
  108262. var partsAndSegments = getPartsAndSegments(playlist);
  108263. currentTime = currentTime || 0;
  108264. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108265. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108266. var partAndSegment = partsAndSegments[index2];
  108267. var segment = partAndSegment.segment;
  108268. var datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  108269. if (!datetimeMapping || !segment.dateTimeObject) {
  108270. continue;
  108271. }
  108272. var segmentTime = segment.dateTimeObject.getTime() / 1e3;
  108273. var start2 = segmentTime + datetimeMapping;
  108274. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  108275. for (var z = 0; z < partAndSegment.partIndex; z++) {
  108276. start2 += segment.parts[z].duration;
  108277. }
  108278. }
  108279. var distance2 = Math.abs(currentTime - start2);
  108280. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  108281. break;
  108282. }
  108283. lastDistance = distance2;
  108284. syncPoint = {
  108285. time: start2,
  108286. segmentIndex: partAndSegment.segmentIndex,
  108287. partIndex: partAndSegment.partIndex
  108288. };
  108289. }
  108290. return syncPoint;
  108291. }
  108292. },
  108293. {
  108294. name: "Segment",
  108295. run: function run3(syncController, playlist, duration5, currentTimeline, currentTime) {
  108296. var syncPoint = null;
  108297. var lastDistance = null;
  108298. currentTime = currentTime || 0;
  108299. var partsAndSegments = getPartsAndSegments(playlist);
  108300. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108301. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108302. var partAndSegment = partsAndSegments[index2];
  108303. var segment = partAndSegment.segment;
  108304. var start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  108305. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  108306. var distance2 = Math.abs(currentTime - start2);
  108307. if (lastDistance !== null && lastDistance < distance2) {
  108308. break;
  108309. }
  108310. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108311. lastDistance = distance2;
  108312. syncPoint = {
  108313. time: start2,
  108314. segmentIndex: partAndSegment.segmentIndex,
  108315. partIndex: partAndSegment.partIndex
  108316. };
  108317. }
  108318. }
  108319. }
  108320. return syncPoint;
  108321. }
  108322. },
  108323. {
  108324. name: "Discontinuity",
  108325. run: function run4(syncController, playlist, duration5, currentTimeline, currentTime) {
  108326. var syncPoint = null;
  108327. currentTime = currentTime || 0;
  108328. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108329. var lastDistance = null;
  108330. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108331. var segmentIndex = playlist.discontinuityStarts[i2];
  108332. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108333. var discontinuitySync = syncController.discontinuities[discontinuity];
  108334. if (discontinuitySync) {
  108335. var distance2 = Math.abs(currentTime - discontinuitySync.time);
  108336. if (lastDistance !== null && lastDistance < distance2) {
  108337. break;
  108338. }
  108339. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108340. lastDistance = distance2;
  108341. syncPoint = {
  108342. time: discontinuitySync.time,
  108343. segmentIndex,
  108344. partIndex: null
  108345. };
  108346. }
  108347. }
  108348. }
  108349. }
  108350. return syncPoint;
  108351. }
  108352. },
  108353. {
  108354. name: "Playlist",
  108355. run: function run5(syncController, playlist, duration5, currentTimeline, currentTime) {
  108356. if (playlist.syncInfo) {
  108357. var syncPoint = {
  108358. time: playlist.syncInfo.time,
  108359. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  108360. partIndex: null
  108361. };
  108362. return syncPoint;
  108363. }
  108364. return null;
  108365. }
  108366. }
  108367. ];
  108368. var SyncController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108369. _inheritsLoose(SyncController2, _videojs$EventTarget);
  108370. function SyncController2(options2) {
  108371. var _this;
  108372. _this = _videojs$EventTarget.call(this) || this;
  108373. _this.timelines = [];
  108374. _this.discontinuities = [];
  108375. _this.timelineToDatetimeMappings = {};
  108376. _this.logger_ = logger("SyncController");
  108377. return _this;
  108378. }
  108379. var _proto = SyncController2.prototype;
  108380. _proto.getSyncPoint = function getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  108381. var syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  108382. if (!syncPoints.length) {
  108383. return null;
  108384. }
  108385. return this.selectSyncPoint_(syncPoints, {
  108386. key: "time",
  108387. value: currentTime
  108388. });
  108389. };
  108390. _proto.getExpiredTime = function getExpiredTime(playlist, duration5) {
  108391. if (!playlist || !playlist.segments) {
  108392. return null;
  108393. }
  108394. var syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  108395. if (!syncPoints.length) {
  108396. return null;
  108397. }
  108398. var syncPoint = this.selectSyncPoint_(syncPoints, {
  108399. key: "segmentIndex",
  108400. value: 0
  108401. });
  108402. if (syncPoint.segmentIndex > 0) {
  108403. syncPoint.time *= -1;
  108404. }
  108405. return Math.abs(syncPoint.time + sumDurations({
  108406. defaultDuration: playlist.targetDuration,
  108407. durationList: playlist.segments,
  108408. startIndex: syncPoint.segmentIndex,
  108409. endIndex: 0
  108410. }));
  108411. };
  108412. _proto.runStrategies_ = function runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  108413. var syncPoints = [];
  108414. for (var i2 = 0; i2 < syncPointStrategies.length; i2++) {
  108415. var strategy = syncPointStrategies[i2];
  108416. var syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  108417. if (syncPoint) {
  108418. syncPoint.strategy = strategy.name;
  108419. syncPoints.push({
  108420. strategy: strategy.name,
  108421. syncPoint
  108422. });
  108423. }
  108424. }
  108425. return syncPoints;
  108426. };
  108427. _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) {
  108428. var bestSyncPoint = syncPoints[0].syncPoint;
  108429. var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  108430. var bestStrategy = syncPoints[0].strategy;
  108431. for (var i2 = 1; i2 < syncPoints.length; i2++) {
  108432. var newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  108433. if (newDistance < bestDistance) {
  108434. bestDistance = newDistance;
  108435. bestSyncPoint = syncPoints[i2].syncPoint;
  108436. bestStrategy = syncPoints[i2].strategy;
  108437. }
  108438. }
  108439. this.logger_("syncPoint for [" + target.key + ": " + target.value + "] chosen with strategy" + (" [" + bestStrategy + "]: [time:" + bestSyncPoint.time + ",") + (" segmentIndex:" + bestSyncPoint.segmentIndex) + (typeof bestSyncPoint.partIndex === "number" ? ",partIndex:" + bestSyncPoint.partIndex : "") + "]");
  108440. return bestSyncPoint;
  108441. };
  108442. _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  108443. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  108444. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {
  108445. videojs.log.warn("Not saving expired segment info. Media sequence gap " + mediaSequenceDiff + " is too large.");
  108446. return;
  108447. }
  108448. for (var i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  108449. var lastRemovedSegment = oldPlaylist.segments[i2];
  108450. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  108451. newPlaylist.syncInfo = {
  108452. mediaSequence: oldPlaylist.mediaSequence + i2,
  108453. time: lastRemovedSegment.start
  108454. };
  108455. this.logger_("playlist refresh sync: [time:" + newPlaylist.syncInfo.time + "," + (" mediaSequence: " + newPlaylist.syncInfo.mediaSequence + "]"));
  108456. this.trigger("syncinfoupdate");
  108457. break;
  108458. }
  108459. }
  108460. };
  108461. _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) {
  108462. this.timelineToDatetimeMappings = {};
  108463. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  108464. var firstSegment = playlist.segments[0];
  108465. var playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  108466. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  108467. }
  108468. };
  108469. _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) {
  108470. var segmentInfo = _ref.segmentInfo, shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping;
  108471. var didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  108472. var segment = segmentInfo.segment;
  108473. if (didCalculateSegmentTimeMapping) {
  108474. this.saveDiscontinuitySyncInfo_(segmentInfo);
  108475. if (!segmentInfo.playlist.syncInfo) {
  108476. segmentInfo.playlist.syncInfo = {
  108477. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  108478. time: segment.start
  108479. };
  108480. }
  108481. }
  108482. var dateTime = segment.dateTimeObject;
  108483. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  108484. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  108485. }
  108486. };
  108487. _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) {
  108488. if (typeof this.timelines[timeline] === "undefined") {
  108489. return null;
  108490. }
  108491. return this.timelines[timeline].time;
  108492. };
  108493. _proto.mappingForTimeline = function mappingForTimeline(timeline) {
  108494. if (typeof this.timelines[timeline] === "undefined") {
  108495. return null;
  108496. }
  108497. return this.timelines[timeline].mapping;
  108498. };
  108499. _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  108500. var segment = segmentInfo.segment;
  108501. var part = segmentInfo.part;
  108502. var mappingObj = this.timelines[segmentInfo.timeline];
  108503. var start2;
  108504. var end;
  108505. if (typeof segmentInfo.timestampOffset === "number") {
  108506. mappingObj = {
  108507. time: segmentInfo.startOfSegment,
  108508. mapping: segmentInfo.startOfSegment - timingInfo.start
  108509. };
  108510. if (shouldSaveTimelineMapping) {
  108511. this.timelines[segmentInfo.timeline] = mappingObj;
  108512. this.trigger("timestampoffset");
  108513. this.logger_("time mapping for timeline " + segmentInfo.timeline + ": " + ("[time: " + mappingObj.time + "] [mapping: " + mappingObj.mapping + "]"));
  108514. }
  108515. start2 = segmentInfo.startOfSegment;
  108516. end = timingInfo.end + mappingObj.mapping;
  108517. } else if (mappingObj) {
  108518. start2 = timingInfo.start + mappingObj.mapping;
  108519. end = timingInfo.end + mappingObj.mapping;
  108520. } else {
  108521. return false;
  108522. }
  108523. if (part) {
  108524. part.start = start2;
  108525. part.end = end;
  108526. }
  108527. if (!segment.start || start2 < segment.start) {
  108528. segment.start = start2;
  108529. }
  108530. segment.end = end;
  108531. return true;
  108532. };
  108533. _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) {
  108534. var playlist = segmentInfo.playlist;
  108535. var segment = segmentInfo.segment;
  108536. if (segment.discontinuity) {
  108537. this.discontinuities[segment.timeline] = {
  108538. time: segment.start,
  108539. accuracy: 0
  108540. };
  108541. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108542. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108543. var segmentIndex = playlist.discontinuityStarts[i2];
  108544. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108545. var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  108546. var accuracy = Math.abs(mediaIndexDiff);
  108547. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  108548. var time = void 0;
  108549. if (mediaIndexDiff < 0) {
  108550. time = segment.start - sumDurations({
  108551. defaultDuration: playlist.targetDuration,
  108552. durationList: playlist.segments,
  108553. startIndex: segmentInfo.mediaIndex,
  108554. endIndex: segmentIndex
  108555. });
  108556. } else {
  108557. time = segment.end + sumDurations({
  108558. defaultDuration: playlist.targetDuration,
  108559. durationList: playlist.segments,
  108560. startIndex: segmentInfo.mediaIndex + 1,
  108561. endIndex: segmentIndex
  108562. });
  108563. }
  108564. this.discontinuities[discontinuity] = {
  108565. time,
  108566. accuracy
  108567. };
  108568. }
  108569. }
  108570. }
  108571. };
  108572. _proto.dispose = function dispose() {
  108573. this.trigger("dispose");
  108574. this.off();
  108575. };
  108576. return SyncController2;
  108577. }(videojs.EventTarget);
  108578. var TimelineChangeController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108579. _inheritsLoose(TimelineChangeController2, _videojs$EventTarget);
  108580. function TimelineChangeController2() {
  108581. var _this;
  108582. _this = _videojs$EventTarget.call(this) || this;
  108583. _this.pendingTimelineChanges_ = {};
  108584. _this.lastTimelineChanges_ = {};
  108585. return _this;
  108586. }
  108587. var _proto = TimelineChangeController2.prototype;
  108588. _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type2) {
  108589. this.pendingTimelineChanges_[type2] = null;
  108590. this.trigger("pendingtimelinechange");
  108591. };
  108592. _proto.pendingTimelineChange = function pendingTimelineChange(_ref) {
  108593. var type2 = _ref.type, from3 = _ref.from, to = _ref.to;
  108594. if (typeof from3 === "number" && typeof to === "number") {
  108595. this.pendingTimelineChanges_[type2] = {
  108596. type: type2,
  108597. from: from3,
  108598. to
  108599. };
  108600. this.trigger("pendingtimelinechange");
  108601. }
  108602. return this.pendingTimelineChanges_[type2];
  108603. };
  108604. _proto.lastTimelineChange = function lastTimelineChange(_ref2) {
  108605. var type2 = _ref2.type, from3 = _ref2.from, to = _ref2.to;
  108606. if (typeof from3 === "number" && typeof to === "number") {
  108607. this.lastTimelineChanges_[type2] = {
  108608. type: type2,
  108609. from: from3,
  108610. to
  108611. };
  108612. delete this.pendingTimelineChanges_[type2];
  108613. this.trigger("timelinechange");
  108614. }
  108615. return this.lastTimelineChanges_[type2];
  108616. };
  108617. _proto.dispose = function dispose() {
  108618. this.trigger("dispose");
  108619. this.pendingTimelineChanges_ = {};
  108620. this.lastTimelineChanges_ = {};
  108621. this.off();
  108622. };
  108623. return TimelineChangeController2;
  108624. }(videojs.EventTarget);
  108625. var workerCode = transform(getWorkerString(function() {
  108626. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  108627. function createCommonjsModule(fn2, basedir, module2) {
  108628. return module2 = {
  108629. path: basedir,
  108630. exports: {},
  108631. require: function require2(path, base2) {
  108632. return commonjsRequire(path, base2 === void 0 || base2 === null ? module2.path : base2);
  108633. }
  108634. }, fn2(module2, module2.exports), module2.exports;
  108635. }
  108636. function commonjsRequire() {
  108637. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  108638. }
  108639. var createClass = createCommonjsModule(function(module2) {
  108640. function _defineProperties(target, props) {
  108641. for (var i2 = 0; i2 < props.length; i2++) {
  108642. var descriptor = props[i2];
  108643. descriptor.enumerable = descriptor.enumerable || false;
  108644. descriptor.configurable = true;
  108645. if ("value" in descriptor)
  108646. descriptor.writable = true;
  108647. Object.defineProperty(target, descriptor.key, descriptor);
  108648. }
  108649. }
  108650. function _createClass(Constructor, protoProps, staticProps) {
  108651. if (protoProps)
  108652. _defineProperties(Constructor.prototype, protoProps);
  108653. if (staticProps)
  108654. _defineProperties(Constructor, staticProps);
  108655. return Constructor;
  108656. }
  108657. module2.exports = _createClass;
  108658. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108659. });
  108660. var setPrototypeOf = createCommonjsModule(function(module2) {
  108661. function _setPrototypeOf2(o, p) {
  108662. module2.exports = _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) {
  108663. o2.__proto__ = p2;
  108664. return o2;
  108665. };
  108666. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108667. return _setPrototypeOf2(o, p);
  108668. }
  108669. module2.exports = _setPrototypeOf2;
  108670. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108671. });
  108672. var inheritsLoose = createCommonjsModule(function(module2) {
  108673. function _inheritsLoose2(subClass, superClass) {
  108674. subClass.prototype = Object.create(superClass.prototype);
  108675. subClass.prototype.constructor = subClass;
  108676. setPrototypeOf(subClass, superClass);
  108677. }
  108678. module2.exports = _inheritsLoose2;
  108679. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108680. });
  108681. var Stream2 = /* @__PURE__ */ function() {
  108682. function Stream3() {
  108683. this.listeners = {};
  108684. }
  108685. var _proto = Stream3.prototype;
  108686. _proto.on = function on3(type2, listener) {
  108687. if (!this.listeners[type2]) {
  108688. this.listeners[type2] = [];
  108689. }
  108690. this.listeners[type2].push(listener);
  108691. };
  108692. _proto.off = function off2(type2, listener) {
  108693. if (!this.listeners[type2]) {
  108694. return false;
  108695. }
  108696. var index2 = this.listeners[type2].indexOf(listener);
  108697. this.listeners[type2] = this.listeners[type2].slice(0);
  108698. this.listeners[type2].splice(index2, 1);
  108699. return index2 > -1;
  108700. };
  108701. _proto.trigger = function trigger2(type2) {
  108702. var callbacks = this.listeners[type2];
  108703. if (!callbacks) {
  108704. return;
  108705. }
  108706. if (arguments.length === 2) {
  108707. var length = callbacks.length;
  108708. for (var i2 = 0; i2 < length; ++i2) {
  108709. callbacks[i2].call(this, arguments[1]);
  108710. }
  108711. } else {
  108712. var args = Array.prototype.slice.call(arguments, 1);
  108713. var _length = callbacks.length;
  108714. for (var _i = 0; _i < _length; ++_i) {
  108715. callbacks[_i].apply(this, args);
  108716. }
  108717. }
  108718. };
  108719. _proto.dispose = function dispose() {
  108720. this.listeners = {};
  108721. };
  108722. _proto.pipe = function pipe(destination2) {
  108723. this.on("data", function(data) {
  108724. destination2.push(data);
  108725. });
  108726. };
  108727. return Stream3;
  108728. }();
  108729. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  108730. function unpad(padded) {
  108731. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  108732. }
  108733. /*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */
  108734. var precompute = function precompute2() {
  108735. var tables = [[[], [], [], [], []], [[], [], [], [], []]];
  108736. var encTable = tables[0];
  108737. var decTable = tables[1];
  108738. var sbox = encTable[4];
  108739. var sboxInv = decTable[4];
  108740. var i2;
  108741. var x;
  108742. var xInv;
  108743. var d2 = [];
  108744. var th = [];
  108745. var x2;
  108746. var x4;
  108747. var x8;
  108748. var s;
  108749. var tEnc;
  108750. var tDec;
  108751. for (i2 = 0; i2 < 256; i2++) {
  108752. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  108753. }
  108754. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  108755. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  108756. s = s >> 8 ^ s & 255 ^ 99;
  108757. sbox[x] = s;
  108758. sboxInv[s] = x;
  108759. x8 = d2[x4 = d2[x2 = d2[x]]];
  108760. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  108761. tEnc = d2[s] * 257 ^ s * 16843008;
  108762. for (i2 = 0; i2 < 4; i2++) {
  108763. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  108764. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  108765. }
  108766. }
  108767. for (i2 = 0; i2 < 5; i2++) {
  108768. encTable[i2] = encTable[i2].slice(0);
  108769. decTable[i2] = decTable[i2].slice(0);
  108770. }
  108771. return tables;
  108772. };
  108773. var aesTables = null;
  108774. var AES = /* @__PURE__ */ function() {
  108775. function AES2(key) {
  108776. if (!aesTables) {
  108777. aesTables = precompute();
  108778. }
  108779. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  108780. var i2;
  108781. var j;
  108782. var tmp;
  108783. var sbox = this._tables[0][4];
  108784. var decTable = this._tables[1];
  108785. var keyLen = key.length;
  108786. var rcon = 1;
  108787. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  108788. throw new Error("Invalid aes key size");
  108789. }
  108790. var encKey = key.slice(0);
  108791. var decKey = [];
  108792. this._key = [encKey, decKey];
  108793. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  108794. tmp = encKey[i2 - 1];
  108795. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  108796. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  108797. if (i2 % keyLen === 0) {
  108798. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  108799. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  108800. }
  108801. }
  108802. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  108803. }
  108804. for (j = 0; i2; j++, i2--) {
  108805. tmp = encKey[j & 3 ? i2 : i2 - 4];
  108806. if (i2 <= 4 || j < 4) {
  108807. decKey[j] = tmp;
  108808. } else {
  108809. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  108810. }
  108811. }
  108812. }
  108813. var _proto = AES2.prototype;
  108814. _proto.decrypt = function decrypt4(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  108815. var key = this._key[1];
  108816. var a = encrypted0 ^ key[0];
  108817. var b = encrypted3 ^ key[1];
  108818. var c = encrypted2 ^ key[2];
  108819. var d2 = encrypted1 ^ key[3];
  108820. var a2;
  108821. var b2;
  108822. var c2;
  108823. var nInnerRounds = key.length / 4 - 2;
  108824. var i2;
  108825. var kIndex = 4;
  108826. var table = this._tables[1];
  108827. var table0 = table[0];
  108828. var table1 = table[1];
  108829. var table2 = table[2];
  108830. var table3 = table[3];
  108831. var sbox = table[4];
  108832. for (i2 = 0; i2 < nInnerRounds; i2++) {
  108833. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  108834. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  108835. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  108836. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  108837. kIndex += 4;
  108838. a = a2;
  108839. b = b2;
  108840. c = c2;
  108841. }
  108842. for (i2 = 0; i2 < 4; i2++) {
  108843. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  108844. a2 = a;
  108845. a = b;
  108846. b = c;
  108847. c = d2;
  108848. d2 = a2;
  108849. }
  108850. };
  108851. return AES2;
  108852. }();
  108853. var AsyncStream = /* @__PURE__ */ function(_Stream) {
  108854. inheritsLoose(AsyncStream2, _Stream);
  108855. function AsyncStream2() {
  108856. var _this;
  108857. _this = _Stream.call(this, Stream2) || this;
  108858. _this.jobs = [];
  108859. _this.delay = 1;
  108860. _this.timeout_ = null;
  108861. return _this;
  108862. }
  108863. var _proto = AsyncStream2.prototype;
  108864. _proto.processJob_ = function processJob_() {
  108865. this.jobs.shift()();
  108866. if (this.jobs.length) {
  108867. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108868. } else {
  108869. this.timeout_ = null;
  108870. }
  108871. };
  108872. _proto.push = function push(job) {
  108873. this.jobs.push(job);
  108874. if (!this.timeout_) {
  108875. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108876. }
  108877. };
  108878. return AsyncStream2;
  108879. }(Stream2);
  108880. var ntoh = function ntoh2(word) {
  108881. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  108882. };
  108883. var decrypt3 = function decrypt4(encrypted, key, initVector) {
  108884. var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  108885. var decipher = new AES(Array.prototype.slice.call(key));
  108886. var decrypted = new Uint8Array(encrypted.byteLength);
  108887. var decrypted32 = new Int32Array(decrypted.buffer);
  108888. var init0;
  108889. var init1;
  108890. var init2;
  108891. var init3;
  108892. var encrypted0;
  108893. var encrypted1;
  108894. var encrypted2;
  108895. var encrypted3;
  108896. var wordIx;
  108897. init0 = initVector[0];
  108898. init1 = initVector[1];
  108899. init2 = initVector[2];
  108900. init3 = initVector[3];
  108901. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  108902. encrypted0 = ntoh(encrypted32[wordIx]);
  108903. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  108904. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  108905. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  108906. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  108907. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  108908. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  108909. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  108910. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  108911. init0 = encrypted0;
  108912. init1 = encrypted1;
  108913. init2 = encrypted2;
  108914. init3 = encrypted3;
  108915. }
  108916. return decrypted;
  108917. };
  108918. var Decrypter2 = /* @__PURE__ */ function() {
  108919. function Decrypter3(encrypted, key, initVector, done) {
  108920. var step = Decrypter3.STEP;
  108921. var encrypted32 = new Int32Array(encrypted.buffer);
  108922. var decrypted = new Uint8Array(encrypted.byteLength);
  108923. var i2 = 0;
  108924. this.asyncStream_ = new AsyncStream();
  108925. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108926. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  108927. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  108928. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108929. }
  108930. this.asyncStream_.push(function() {
  108931. done(null, unpad(decrypted));
  108932. });
  108933. }
  108934. var _proto = Decrypter3.prototype;
  108935. _proto.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {
  108936. return function() {
  108937. var bytes = decrypt3(encrypted, key, initVector);
  108938. decrypted.set(bytes, encrypted.byteOffset);
  108939. };
  108940. };
  108941. createClass(Decrypter3, null, [{
  108942. key: "STEP",
  108943. get: function get7() {
  108944. return 32e3;
  108945. }
  108946. }]);
  108947. return Decrypter3;
  108948. }();
  108949. var win2;
  108950. if (typeof window !== "undefined") {
  108951. win2 = window;
  108952. } else if (typeof commonjsGlobal2 !== "undefined") {
  108953. win2 = commonjsGlobal2;
  108954. } else if (typeof self !== "undefined") {
  108955. win2 = self;
  108956. } else {
  108957. win2 = {};
  108958. }
  108959. var window_12 = win2;
  108960. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  108961. if (ArrayBuffer.isView === "function") {
  108962. return ArrayBuffer.isView(obj);
  108963. }
  108964. return obj && obj.buffer instanceof ArrayBuffer;
  108965. };
  108966. var BigInt2 = window_12.BigInt || Number;
  108967. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  108968. var createTransferableMessage3 = function createTransferableMessage4(message) {
  108969. var transferable = {};
  108970. Object.keys(message).forEach(function(key) {
  108971. var value = message[key];
  108972. if (isArrayBufferView4(value)) {
  108973. transferable[key] = {
  108974. bytes: value.buffer,
  108975. byteOffset: value.byteOffset,
  108976. byteLength: value.byteLength
  108977. };
  108978. } else {
  108979. transferable[key] = value;
  108980. }
  108981. });
  108982. return transferable;
  108983. };
  108984. self.onmessage = function(event2) {
  108985. var data = event2.data;
  108986. var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  108987. var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  108988. var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  108989. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  108990. self.postMessage(createTransferableMessage3({
  108991. source: data.source,
  108992. decrypted: bytes
  108993. }), [bytes.buffer]);
  108994. });
  108995. };
  108996. }));
  108997. var Decrypter = factory(workerCode);
  108998. var audioTrackKind_ = function audioTrackKind_2(properties) {
  108999. var kind = properties["default"] ? "main" : "alternative";
  109000. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  109001. kind = "main-desc";
  109002. }
  109003. return kind;
  109004. };
  109005. var stopLoaders = function stopLoaders2(segmentLoader, mediaType) {
  109006. segmentLoader.abort();
  109007. segmentLoader.pause();
  109008. if (mediaType && mediaType.activePlaylistLoader) {
  109009. mediaType.activePlaylistLoader.pause();
  109010. mediaType.activePlaylistLoader = null;
  109011. }
  109012. };
  109013. var startLoaders = function startLoaders2(playlistLoader, mediaType) {
  109014. mediaType.activePlaylistLoader = playlistLoader;
  109015. playlistLoader.load();
  109016. };
  109017. var onGroupChanged = function onGroupChanged2(type2, settings) {
  109018. return function() {
  109019. var _settings$segmentLoad = settings.segmentLoaders, segmentLoader = _settings$segmentLoad[type2], mainSegmentLoader = _settings$segmentLoad.main, mediaType = settings.mediaTypes[type2];
  109020. var activeTrack2 = mediaType.activeTrack();
  109021. var activeGroup3 = mediaType.getActiveGroup();
  109022. var previousActiveLoader = mediaType.activePlaylistLoader;
  109023. var lastGroup = mediaType.lastGroup_;
  109024. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  109025. return;
  109026. }
  109027. mediaType.lastGroup_ = activeGroup3;
  109028. mediaType.lastTrack_ = activeTrack2;
  109029. stopLoaders(segmentLoader, mediaType);
  109030. if (!activeGroup3 || activeGroup3.isMasterPlaylist) {
  109031. return;
  109032. }
  109033. if (!activeGroup3.playlistLoader) {
  109034. if (previousActiveLoader) {
  109035. mainSegmentLoader.resetEverything();
  109036. }
  109037. return;
  109038. }
  109039. segmentLoader.resyncLoader();
  109040. startLoaders(activeGroup3.playlistLoader, mediaType);
  109041. };
  109042. };
  109043. var onGroupChanging = function onGroupChanging2(type2, settings) {
  109044. return function() {
  109045. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109046. mediaType.lastGroup_ = null;
  109047. segmentLoader.abort();
  109048. segmentLoader.pause();
  109049. };
  109050. };
  109051. var onTrackChanged = function onTrackChanged2(type2, settings) {
  109052. return function() {
  109053. var masterPlaylistLoader = settings.masterPlaylistLoader, _settings$segmentLoad2 = settings.segmentLoaders, segmentLoader = _settings$segmentLoad2[type2], mainSegmentLoader = _settings$segmentLoad2.main, mediaType = settings.mediaTypes[type2];
  109054. var activeTrack2 = mediaType.activeTrack();
  109055. var activeGroup3 = mediaType.getActiveGroup();
  109056. var previousActiveLoader = mediaType.activePlaylistLoader;
  109057. var lastTrack = mediaType.lastTrack_;
  109058. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  109059. return;
  109060. }
  109061. mediaType.lastGroup_ = activeGroup3;
  109062. mediaType.lastTrack_ = activeTrack2;
  109063. stopLoaders(segmentLoader, mediaType);
  109064. if (!activeGroup3) {
  109065. return;
  109066. }
  109067. if (activeGroup3.isMasterPlaylist) {
  109068. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  109069. return;
  109070. }
  109071. var mpc = settings.vhs.masterPlaylistController_;
  109072. var newPlaylist = mpc.selectPlaylist();
  109073. if (mpc.media() === newPlaylist) {
  109074. return;
  109075. }
  109076. mediaType.logger_("track change. Switching master audio from " + lastTrack.id + " to " + activeTrack2.id);
  109077. masterPlaylistLoader.pause();
  109078. mainSegmentLoader.resetEverything();
  109079. mpc.fastQualityChange_(newPlaylist);
  109080. return;
  109081. }
  109082. if (type2 === "AUDIO") {
  109083. if (!activeGroup3.playlistLoader) {
  109084. mainSegmentLoader.setAudio(true);
  109085. mainSegmentLoader.resetEverything();
  109086. return;
  109087. }
  109088. segmentLoader.setAudio(true);
  109089. mainSegmentLoader.setAudio(false);
  109090. }
  109091. if (previousActiveLoader === activeGroup3.playlistLoader) {
  109092. startLoaders(activeGroup3.playlistLoader, mediaType);
  109093. return;
  109094. }
  109095. if (segmentLoader.track) {
  109096. segmentLoader.track(activeTrack2);
  109097. }
  109098. segmentLoader.resetEverything();
  109099. startLoaders(activeGroup3.playlistLoader, mediaType);
  109100. };
  109101. };
  109102. var onError = {
  109103. AUDIO: function AUDIO(type2, settings) {
  109104. return function() {
  109105. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2], blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;
  109106. stopLoaders(segmentLoader, mediaType);
  109107. var activeTrack2 = mediaType.activeTrack();
  109108. var activeGroup3 = mediaType.activeGroup();
  109109. var id = (activeGroup3.filter(function(group) {
  109110. return group["default"];
  109111. })[0] || activeGroup3[0]).id;
  109112. var defaultTrack = mediaType.tracks[id];
  109113. if (activeTrack2 === defaultTrack) {
  109114. blacklistCurrentPlaylist({
  109115. message: "Problem encountered loading the default audio track."
  109116. });
  109117. return;
  109118. }
  109119. videojs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  109120. for (var trackId in mediaType.tracks) {
  109121. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  109122. }
  109123. mediaType.onTrackChanged();
  109124. };
  109125. },
  109126. SUBTITLES: function SUBTITLES(type2, settings) {
  109127. return function() {
  109128. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109129. videojs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  109130. stopLoaders(segmentLoader, mediaType);
  109131. var track = mediaType.activeTrack();
  109132. if (track) {
  109133. track.mode = "disabled";
  109134. }
  109135. mediaType.onTrackChanged();
  109136. };
  109137. }
  109138. };
  109139. var setupListeners = {
  109140. AUDIO: function AUDIO2(type2, playlistLoader, settings) {
  109141. if (!playlistLoader) {
  109142. return;
  109143. }
  109144. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2];
  109145. playlistLoader.on("loadedmetadata", function() {
  109146. var media = playlistLoader.media();
  109147. segmentLoader.playlist(media, requestOptions);
  109148. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109149. segmentLoader.load();
  109150. }
  109151. });
  109152. playlistLoader.on("loadedplaylist", function() {
  109153. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109154. if (!tech.paused()) {
  109155. segmentLoader.load();
  109156. }
  109157. });
  109158. playlistLoader.on("error", onError[type2](type2, settings));
  109159. },
  109160. SUBTITLES: function SUBTITLES2(type2, playlistLoader, settings) {
  109161. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109162. playlistLoader.on("loadedmetadata", function() {
  109163. var media = playlistLoader.media();
  109164. segmentLoader.playlist(media, requestOptions);
  109165. segmentLoader.track(mediaType.activeTrack());
  109166. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109167. segmentLoader.load();
  109168. }
  109169. });
  109170. playlistLoader.on("loadedplaylist", function() {
  109171. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109172. if (!tech.paused()) {
  109173. segmentLoader.load();
  109174. }
  109175. });
  109176. playlistLoader.on("error", onError[type2](type2, settings));
  109177. }
  109178. };
  109179. var initialize = {
  109180. "AUDIO": function AUDIO3(type2, settings) {
  109181. var vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$ = settings.mediaTypes[type2], groups = _settings$mediaTypes$.groups, tracks = _settings$mediaTypes$.tracks, logger_ = _settings$mediaTypes$.logger_, masterPlaylistLoader = settings.masterPlaylistLoader;
  109182. var audioOnlyMaster = isAudioOnly(masterPlaylistLoader.master);
  109183. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  109184. mediaGroups[type2] = {
  109185. main: {
  109186. "default": {
  109187. "default": true
  109188. }
  109189. }
  109190. };
  109191. if (audioOnlyMaster) {
  109192. mediaGroups[type2].main["default"].playlists = masterPlaylistLoader.master.playlists;
  109193. }
  109194. }
  109195. for (var groupId in mediaGroups[type2]) {
  109196. if (!groups[groupId]) {
  109197. groups[groupId] = [];
  109198. }
  109199. for (var variantLabel in mediaGroups[type2][groupId]) {
  109200. var properties = mediaGroups[type2][groupId][variantLabel];
  109201. var playlistLoader = void 0;
  109202. if (audioOnlyMaster) {
  109203. logger_("AUDIO group '" + groupId + "' label '" + variantLabel + "' is a master playlist");
  109204. properties.isMasterPlaylist = true;
  109205. playlistLoader = null;
  109206. } else if (sourceType === "vhs-json" && properties.playlists) {
  109207. playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);
  109208. } else if (properties.resolvedUri) {
  109209. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109210. } else if (properties.playlists && sourceType === "dash") {
  109211. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109212. } else {
  109213. playlistLoader = null;
  109214. }
  109215. properties = videojs.mergeOptions({
  109216. id: variantLabel,
  109217. playlistLoader
  109218. }, properties);
  109219. setupListeners[type2](type2, properties.playlistLoader, settings);
  109220. groups[groupId].push(properties);
  109221. if (typeof tracks[variantLabel] === "undefined") {
  109222. var track = new videojs.AudioTrack({
  109223. id: variantLabel,
  109224. kind: audioTrackKind_(properties),
  109225. enabled: false,
  109226. language: properties.language,
  109227. "default": properties["default"],
  109228. label: variantLabel
  109229. });
  109230. tracks[variantLabel] = track;
  109231. }
  109232. }
  109233. }
  109234. segmentLoader.on("error", onError[type2](type2, settings));
  109235. },
  109236. "SUBTITLES": function SUBTITLES3(type2, settings) {
  109237. var tech = settings.tech, vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$2 = settings.mediaTypes[type2], groups = _settings$mediaTypes$2.groups, tracks = _settings$mediaTypes$2.tracks, masterPlaylistLoader = settings.masterPlaylistLoader;
  109238. for (var groupId in mediaGroups[type2]) {
  109239. if (!groups[groupId]) {
  109240. groups[groupId] = [];
  109241. }
  109242. for (var variantLabel in mediaGroups[type2][groupId]) {
  109243. if (mediaGroups[type2][groupId][variantLabel].forced) {
  109244. continue;
  109245. }
  109246. var properties = mediaGroups[type2][groupId][variantLabel];
  109247. var playlistLoader = void 0;
  109248. if (sourceType === "hls") {
  109249. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109250. } else if (sourceType === "dash") {
  109251. var playlists = properties.playlists.filter(function(p) {
  109252. return p.excludeUntil !== Infinity;
  109253. });
  109254. if (!playlists.length) {
  109255. return;
  109256. }
  109257. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109258. } else if (sourceType === "vhs-json") {
  109259. playlistLoader = new PlaylistLoader(
  109260. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  109261. vhs,
  109262. requestOptions
  109263. );
  109264. }
  109265. properties = videojs.mergeOptions({
  109266. id: variantLabel,
  109267. playlistLoader
  109268. }, properties);
  109269. setupListeners[type2](type2, properties.playlistLoader, settings);
  109270. groups[groupId].push(properties);
  109271. if (typeof tracks[variantLabel] === "undefined") {
  109272. var track = tech.addRemoteTextTrack({
  109273. id: variantLabel,
  109274. kind: "subtitles",
  109275. "default": properties["default"] && properties.autoselect,
  109276. language: properties.language,
  109277. label: variantLabel
  109278. }, false).track;
  109279. tracks[variantLabel] = track;
  109280. }
  109281. }
  109282. }
  109283. segmentLoader.on("error", onError[type2](type2, settings));
  109284. },
  109285. "CLOSED-CAPTIONS": function CLOSEDCAPTIONS(type2, settings) {
  109286. var tech = settings.tech, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$3 = settings.mediaTypes[type2], groups = _settings$mediaTypes$3.groups, tracks = _settings$mediaTypes$3.tracks;
  109287. for (var groupId in mediaGroups[type2]) {
  109288. if (!groups[groupId]) {
  109289. groups[groupId] = [];
  109290. }
  109291. for (var variantLabel in mediaGroups[type2][groupId]) {
  109292. var properties = mediaGroups[type2][groupId][variantLabel];
  109293. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  109294. continue;
  109295. }
  109296. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  109297. var newProps = {
  109298. label: variantLabel,
  109299. language: properties.language,
  109300. instreamId: properties.instreamId,
  109301. "default": properties["default"] && properties.autoselect
  109302. };
  109303. if (captionServices[newProps.instreamId]) {
  109304. newProps = videojs.mergeOptions(newProps, captionServices[newProps.instreamId]);
  109305. }
  109306. if (newProps["default"] === void 0) {
  109307. delete newProps["default"];
  109308. }
  109309. groups[groupId].push(videojs.mergeOptions({
  109310. id: variantLabel
  109311. }, properties));
  109312. if (typeof tracks[variantLabel] === "undefined") {
  109313. var track = tech.addRemoteTextTrack({
  109314. id: newProps.instreamId,
  109315. kind: "captions",
  109316. "default": newProps["default"],
  109317. language: newProps.language,
  109318. label: newProps.label
  109319. }, false).track;
  109320. tracks[variantLabel] = track;
  109321. }
  109322. }
  109323. }
  109324. }
  109325. };
  109326. var groupMatch = function groupMatch2(list, media) {
  109327. for (var i2 = 0; i2 < list.length; i2++) {
  109328. if (playlistMatch(media, list[i2])) {
  109329. return true;
  109330. }
  109331. if (list[i2].playlists && groupMatch2(list[i2].playlists, media)) {
  109332. return true;
  109333. }
  109334. }
  109335. return false;
  109336. };
  109337. var activeGroup = function activeGroup2(type2, settings) {
  109338. return function(track) {
  109339. var masterPlaylistLoader = settings.masterPlaylistLoader, groups = settings.mediaTypes[type2].groups;
  109340. var media = masterPlaylistLoader.media();
  109341. if (!media) {
  109342. return null;
  109343. }
  109344. var variants = null;
  109345. if (media.attributes[type2]) {
  109346. variants = groups[media.attributes[type2]];
  109347. }
  109348. var groupKeys = Object.keys(groups);
  109349. if (!variants) {
  109350. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly(settings.master)) {
  109351. for (var i2 = 0; i2 < groupKeys.length; i2++) {
  109352. var groupPropertyList = groups[groupKeys[i2]];
  109353. if (groupMatch(groupPropertyList, media)) {
  109354. variants = groupPropertyList;
  109355. break;
  109356. }
  109357. }
  109358. } else if (groups.main) {
  109359. variants = groups.main;
  109360. } else if (groupKeys.length === 1) {
  109361. variants = groups[groupKeys[0]];
  109362. }
  109363. }
  109364. if (typeof track === "undefined") {
  109365. return variants;
  109366. }
  109367. if (track === null || !variants) {
  109368. return null;
  109369. }
  109370. return variants.filter(function(props) {
  109371. return props.id === track.id;
  109372. })[0] || null;
  109373. };
  109374. };
  109375. var activeTrack = {
  109376. AUDIO: function AUDIO4(type2, settings) {
  109377. return function() {
  109378. var tracks = settings.mediaTypes[type2].tracks;
  109379. for (var id in tracks) {
  109380. if (tracks[id].enabled) {
  109381. return tracks[id];
  109382. }
  109383. }
  109384. return null;
  109385. };
  109386. },
  109387. SUBTITLES: function SUBTITLES4(type2, settings) {
  109388. return function() {
  109389. var tracks = settings.mediaTypes[type2].tracks;
  109390. for (var id in tracks) {
  109391. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  109392. return tracks[id];
  109393. }
  109394. }
  109395. return null;
  109396. };
  109397. }
  109398. };
  109399. var getActiveGroup = function getActiveGroup2(type2, _ref) {
  109400. var mediaTypes2 = _ref.mediaTypes;
  109401. return function() {
  109402. var activeTrack_ = mediaTypes2[type2].activeTrack();
  109403. if (!activeTrack_) {
  109404. return null;
  109405. }
  109406. return mediaTypes2[type2].activeGroup(activeTrack_);
  109407. };
  109408. };
  109409. var setupMediaGroups = function setupMediaGroups2(settings) {
  109410. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109411. initialize[type2](type2, settings);
  109412. });
  109413. var mediaTypes2 = settings.mediaTypes, masterPlaylistLoader = settings.masterPlaylistLoader, tech = settings.tech, vhs = settings.vhs, _settings$segmentLoad3 = settings.segmentLoaders, audioSegmentLoader = _settings$segmentLoad3["AUDIO"], mainSegmentLoader = _settings$segmentLoad3.main;
  109414. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109415. mediaTypes2[type2].activeGroup = activeGroup(type2, settings);
  109416. mediaTypes2[type2].activeTrack = activeTrack[type2](type2, settings);
  109417. mediaTypes2[type2].onGroupChanged = onGroupChanged(type2, settings);
  109418. mediaTypes2[type2].onGroupChanging = onGroupChanging(type2, settings);
  109419. mediaTypes2[type2].onTrackChanged = onTrackChanged(type2, settings);
  109420. mediaTypes2[type2].getActiveGroup = getActiveGroup(type2, settings);
  109421. });
  109422. var audioGroup = mediaTypes2.AUDIO.activeGroup();
  109423. if (audioGroup) {
  109424. var groupId = (audioGroup.filter(function(group) {
  109425. return group["default"];
  109426. })[0] || audioGroup[0]).id;
  109427. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  109428. mediaTypes2.AUDIO.onGroupChanged();
  109429. mediaTypes2.AUDIO.onTrackChanged();
  109430. var activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  109431. if (!activeAudioGroup.playlistLoader) {
  109432. mainSegmentLoader.setAudio(true);
  109433. } else {
  109434. mainSegmentLoader.setAudio(false);
  109435. audioSegmentLoader.setAudio(true);
  109436. }
  109437. }
  109438. masterPlaylistLoader.on("mediachange", function() {
  109439. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109440. return mediaTypes2[type2].onGroupChanged();
  109441. });
  109442. });
  109443. masterPlaylistLoader.on("mediachanging", function() {
  109444. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109445. return mediaTypes2[type2].onGroupChanging();
  109446. });
  109447. });
  109448. var onAudioTrackChanged = function onAudioTrackChanged2() {
  109449. mediaTypes2.AUDIO.onTrackChanged();
  109450. tech.trigger({
  109451. type: "usage",
  109452. name: "vhs-audio-change"
  109453. });
  109454. tech.trigger({
  109455. type: "usage",
  109456. name: "hls-audio-change"
  109457. });
  109458. };
  109459. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  109460. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109461. vhs.on("dispose", function() {
  109462. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  109463. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109464. });
  109465. tech.clearTracks("audio");
  109466. for (var id in mediaTypes2.AUDIO.tracks) {
  109467. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  109468. }
  109469. };
  109470. var createMediaTypes = function createMediaTypes2() {
  109471. var mediaTypes2 = {};
  109472. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109473. mediaTypes2[type2] = {
  109474. groups: {},
  109475. tracks: {},
  109476. activePlaylistLoader: null,
  109477. activeGroup: noop,
  109478. activeTrack: noop,
  109479. getActiveGroup: noop,
  109480. onGroupChanged: noop,
  109481. onTrackChanged: noop,
  109482. lastTrack_: null,
  109483. logger_: logger("MediaGroups[" + type2 + "]")
  109484. };
  109485. });
  109486. return mediaTypes2;
  109487. };
  109488. var ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;
  109489. var Vhs$1;
  109490. var loaderStats = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  109491. var sumLoaderStat = function sumLoaderStat2(stat) {
  109492. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  109493. };
  109494. var shouldSwitchToMedia = function shouldSwitchToMedia2(_ref) {
  109495. var currentPlaylist = _ref.currentPlaylist, buffered = _ref.buffered, currentTime = _ref.currentTime, nextPlaylist = _ref.nextPlaylist, bufferLowWaterLine = _ref.bufferLowWaterLine, bufferHighWaterLine = _ref.bufferHighWaterLine, duration5 = _ref.duration, experimentalBufferBasedABR = _ref.experimentalBufferBasedABR, log2 = _ref.log;
  109496. if (!nextPlaylist) {
  109497. videojs.log.warn("We received no playlist to switch to. Please check your stream.");
  109498. return false;
  109499. }
  109500. var sharedLogLine = "allowing switch " + (currentPlaylist && currentPlaylist.id || "null") + " -> " + nextPlaylist.id;
  109501. if (!currentPlaylist) {
  109502. log2(sharedLogLine + " as current playlist is not set");
  109503. return true;
  109504. }
  109505. if (nextPlaylist.id === currentPlaylist.id) {
  109506. return false;
  109507. }
  109508. var isBuffered = Boolean(findRange(buffered, currentTime).length);
  109509. if (!currentPlaylist.endList) {
  109510. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  109511. log2("not " + sharedLogLine + " as current playlist is live llhls, but currentTime isn't in buffered.");
  109512. return false;
  109513. }
  109514. log2(sharedLogLine + " as current playlist is live");
  109515. return true;
  109516. }
  109517. var forwardBuffer = timeAheadOf(buffered, currentTime);
  109518. var maxBufferLowWaterLine = experimentalBufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE;
  109519. if (duration5 < maxBufferLowWaterLine) {
  109520. log2(sharedLogLine + " as duration < max low water line (" + duration5 + " < " + maxBufferLowWaterLine + ")");
  109521. return true;
  109522. }
  109523. var nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  109524. var currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  109525. if (nextBandwidth < currBandwidth && (!experimentalBufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  109526. var logLine = sharedLogLine + " as next bandwidth < current bandwidth (" + nextBandwidth + " < " + currBandwidth + ")";
  109527. if (experimentalBufferBasedABR) {
  109528. logLine += " and forwardBuffer < bufferHighWaterLine (" + forwardBuffer + " < " + bufferHighWaterLine + ")";
  109529. }
  109530. log2(logLine);
  109531. return true;
  109532. }
  109533. if ((!experimentalBufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  109534. var _logLine = sharedLogLine + " as forwardBuffer >= bufferLowWaterLine (" + forwardBuffer + " >= " + bufferLowWaterLine + ")";
  109535. if (experimentalBufferBasedABR) {
  109536. _logLine += " and next bandwidth > current bandwidth (" + nextBandwidth + " > " + currBandwidth + ")";
  109537. }
  109538. log2(_logLine);
  109539. return true;
  109540. }
  109541. log2("not " + sharedLogLine + " as no switching criteria met");
  109542. return false;
  109543. };
  109544. var MasterPlaylistController = /* @__PURE__ */ function(_videojs$EventTarget) {
  109545. _inheritsLoose(MasterPlaylistController2, _videojs$EventTarget);
  109546. function MasterPlaylistController2(options2) {
  109547. var _this;
  109548. _this = _videojs$EventTarget.call(this) || this;
  109549. var src = options2.src, handleManifestRedirects = options2.handleManifestRedirects, withCredentials = options2.withCredentials, tech = options2.tech, bandwidth2 = options2.bandwidth, externVhs = options2.externVhs, useCueTags = options2.useCueTags, blacklistDuration = options2.blacklistDuration, enableLowInitialPlaylist = options2.enableLowInitialPlaylist, sourceType = options2.sourceType, cacheEncryptionKeys = options2.cacheEncryptionKeys, experimentalBufferBasedABR = options2.experimentalBufferBasedABR, experimentalLeastPixelDiffSelector = options2.experimentalLeastPixelDiffSelector, captionServices = options2.captionServices;
  109550. if (!src) {
  109551. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  109552. }
  109553. var maxPlaylistRetries = options2.maxPlaylistRetries;
  109554. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  109555. maxPlaylistRetries = Infinity;
  109556. }
  109557. Vhs$1 = externVhs;
  109558. _this.experimentalBufferBasedABR = Boolean(experimentalBufferBasedABR);
  109559. _this.experimentalLeastPixelDiffSelector = Boolean(experimentalLeastPixelDiffSelector);
  109560. _this.withCredentials = withCredentials;
  109561. _this.tech_ = tech;
  109562. _this.vhs_ = tech.vhs;
  109563. _this.sourceType_ = sourceType;
  109564. _this.useCueTags_ = useCueTags;
  109565. _this.blacklistDuration = blacklistDuration;
  109566. _this.maxPlaylistRetries = maxPlaylistRetries;
  109567. _this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  109568. if (_this.useCueTags_) {
  109569. _this.cueTagsTrack_ = _this.tech_.addTextTrack("metadata", "ad-cues");
  109570. _this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  109571. }
  109572. _this.requestOptions_ = {
  109573. withCredentials,
  109574. handleManifestRedirects,
  109575. maxPlaylistRetries,
  109576. timeout: null
  109577. };
  109578. _this.on("error", _this.pauseLoading);
  109579. _this.mediaTypes_ = createMediaTypes();
  109580. _this.mediaSource = new window_1.MediaSource();
  109581. _this.handleDurationChange_ = _this.handleDurationChange_.bind(_assertThisInitialized(_this));
  109582. _this.handleSourceOpen_ = _this.handleSourceOpen_.bind(_assertThisInitialized(_this));
  109583. _this.handleSourceEnded_ = _this.handleSourceEnded_.bind(_assertThisInitialized(_this));
  109584. _this.mediaSource.addEventListener("durationchange", _this.handleDurationChange_);
  109585. _this.mediaSource.addEventListener("sourceopen", _this.handleSourceOpen_);
  109586. _this.mediaSource.addEventListener("sourceended", _this.handleSourceEnded_);
  109587. _this.seekable_ = videojs.createTimeRanges();
  109588. _this.hasPlayed_ = false;
  109589. _this.syncController_ = new SyncController(options2);
  109590. _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  109591. kind: "metadata",
  109592. label: "segment-metadata"
  109593. }, false).track;
  109594. _this.decrypter_ = new Decrypter();
  109595. _this.sourceUpdater_ = new SourceUpdater(_this.mediaSource);
  109596. _this.inbandTextTracks_ = {};
  109597. _this.timelineChangeController_ = new TimelineChangeController();
  109598. var segmentLoaderSettings = {
  109599. vhs: _this.vhs_,
  109600. parse708captions: options2.parse708captions,
  109601. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  109602. captionServices,
  109603. mediaSource: _this.mediaSource,
  109604. currentTime: _this.tech_.currentTime.bind(_this.tech_),
  109605. seekable: function seekable3() {
  109606. return _this.seekable();
  109607. },
  109608. seeking: function seeking() {
  109609. return _this.tech_.seeking();
  109610. },
  109611. duration: function duration5() {
  109612. return _this.duration();
  109613. },
  109614. hasPlayed: function hasPlayed() {
  109615. return _this.hasPlayed_;
  109616. },
  109617. goalBufferLength: function goalBufferLength() {
  109618. return _this.goalBufferLength();
  109619. },
  109620. bandwidth: bandwidth2,
  109621. syncController: _this.syncController_,
  109622. decrypter: _this.decrypter_,
  109623. sourceType: _this.sourceType_,
  109624. inbandTextTracks: _this.inbandTextTracks_,
  109625. cacheEncryptionKeys,
  109626. sourceUpdater: _this.sourceUpdater_,
  109627. timelineChangeController: _this.timelineChangeController_,
  109628. experimentalExactManifestTimings: options2.experimentalExactManifestTimings
  109629. };
  109630. _this.masterPlaylistLoader_ = _this.sourceType_ === "dash" ? new DashPlaylistLoader(src, _this.vhs_, _this.requestOptions_) : new PlaylistLoader(src, _this.vhs_, _this.requestOptions_);
  109631. _this.setupMasterPlaylistLoaderListeners_();
  109632. _this.mainSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109633. segmentMetadataTrack: _this.segmentMetadataTrack_,
  109634. loaderType: "main"
  109635. }), options2);
  109636. _this.audioSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109637. loaderType: "audio"
  109638. }), options2);
  109639. _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109640. loaderType: "vtt",
  109641. featuresNativeTextTracks: _this.tech_.featuresNativeTextTracks,
  109642. loadVttJs: function loadVttJs() {
  109643. return new Promise(function(resolve2, reject2) {
  109644. function onLoad() {
  109645. tech.off("vttjserror", onError2);
  109646. resolve2();
  109647. }
  109648. function onError2() {
  109649. tech.off("vttjsloaded", onLoad);
  109650. reject2();
  109651. }
  109652. tech.one("vttjsloaded", onLoad);
  109653. tech.one("vttjserror", onError2);
  109654. tech.addWebVttScript_();
  109655. });
  109656. }
  109657. }), options2);
  109658. _this.setupSegmentLoaderListeners_();
  109659. if (_this.experimentalBufferBasedABR) {
  109660. _this.masterPlaylistLoader_.one("loadedplaylist", function() {
  109661. return _this.startABRTimer_();
  109662. });
  109663. _this.tech_.on("pause", function() {
  109664. return _this.stopABRTimer_();
  109665. });
  109666. _this.tech_.on("play", function() {
  109667. return _this.startABRTimer_();
  109668. });
  109669. }
  109670. loaderStats.forEach(function(stat) {
  109671. _this[stat + "_"] = sumLoaderStat.bind(_assertThisInitialized(_this), stat);
  109672. });
  109673. _this.logger_ = logger("MPC");
  109674. _this.triggeredFmp4Usage = false;
  109675. if (_this.tech_.preload() === "none") {
  109676. _this.loadOnPlay_ = function() {
  109677. _this.loadOnPlay_ = null;
  109678. _this.masterPlaylistLoader_.load();
  109679. };
  109680. _this.tech_.one("play", _this.loadOnPlay_);
  109681. } else {
  109682. _this.masterPlaylistLoader_.load();
  109683. }
  109684. _this.timeToLoadedData__ = -1;
  109685. _this.mainAppendsToLoadedData__ = -1;
  109686. _this.audioAppendsToLoadedData__ = -1;
  109687. var event2 = _this.tech_.preload() === "none" ? "play" : "loadstart";
  109688. _this.tech_.one(event2, function() {
  109689. var timeToLoadedDataStart = Date.now();
  109690. _this.tech_.one("loadeddata", function() {
  109691. _this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  109692. _this.mainAppendsToLoadedData__ = _this.mainSegmentLoader_.mediaAppends;
  109693. _this.audioAppendsToLoadedData__ = _this.audioSegmentLoader_.mediaAppends;
  109694. });
  109695. });
  109696. return _this;
  109697. }
  109698. var _proto = MasterPlaylistController2.prototype;
  109699. _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() {
  109700. return this.mainAppendsToLoadedData__;
  109701. };
  109702. _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() {
  109703. return this.audioAppendsToLoadedData__;
  109704. };
  109705. _proto.appendsToLoadedData_ = function appendsToLoadedData_() {
  109706. var main = this.mainAppendsToLoadedData_();
  109707. var audio = this.audioAppendsToLoadedData_();
  109708. if (main === -1 || audio === -1) {
  109709. return -1;
  109710. }
  109711. return main + audio;
  109712. };
  109713. _proto.timeToLoadedData_ = function timeToLoadedData_() {
  109714. return this.timeToLoadedData__;
  109715. };
  109716. _proto.checkABR_ = function checkABR_(reason) {
  109717. if (reason === void 0) {
  109718. reason = "abr";
  109719. }
  109720. var nextPlaylist = this.selectPlaylist();
  109721. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  109722. this.switchMedia_(nextPlaylist, reason);
  109723. }
  109724. };
  109725. _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) {
  109726. var oldMedia = this.media();
  109727. var oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  109728. var newId = playlist.id || playlist.uri;
  109729. if (oldId && oldId !== newId) {
  109730. this.logger_("switch media " + oldId + " -> " + newId + " from " + cause);
  109731. this.tech_.trigger({
  109732. type: "usage",
  109733. name: "vhs-rendition-change-" + cause
  109734. });
  109735. }
  109736. this.masterPlaylistLoader_.media(playlist, delay);
  109737. };
  109738. _proto.startABRTimer_ = function startABRTimer_() {
  109739. var _this2 = this;
  109740. this.stopABRTimer_();
  109741. this.abrTimer_ = window_1.setInterval(function() {
  109742. return _this2.checkABR_();
  109743. }, 250);
  109744. };
  109745. _proto.stopABRTimer_ = function stopABRTimer_() {
  109746. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  109747. return;
  109748. }
  109749. window_1.clearInterval(this.abrTimer_);
  109750. this.abrTimer_ = null;
  109751. };
  109752. _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() {
  109753. var master = this.master();
  109754. var defaultPlaylists = master && master.playlists || [];
  109755. if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) {
  109756. return defaultPlaylists;
  109757. }
  109758. var AUDIO5 = master.mediaGroups.AUDIO;
  109759. var groupKeys = Object.keys(AUDIO5);
  109760. var track;
  109761. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  109762. track = this.mediaTypes_.AUDIO.activeTrack();
  109763. } else {
  109764. var defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  109765. for (var label in defaultGroup) {
  109766. if (defaultGroup[label]["default"]) {
  109767. track = {
  109768. label
  109769. };
  109770. break;
  109771. }
  109772. }
  109773. }
  109774. if (!track) {
  109775. return defaultPlaylists;
  109776. }
  109777. var playlists = [];
  109778. for (var group in AUDIO5) {
  109779. if (AUDIO5[group][track.label]) {
  109780. var properties = AUDIO5[group][track.label];
  109781. if (properties.playlists && properties.playlists.length) {
  109782. playlists.push.apply(playlists, properties.playlists);
  109783. } else if (properties.uri) {
  109784. playlists.push(properties);
  109785. } else if (master.playlists.length) {
  109786. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  109787. var playlist = master.playlists[i2];
  109788. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  109789. playlists.push(playlist);
  109790. }
  109791. }
  109792. }
  109793. }
  109794. }
  109795. if (!playlists.length) {
  109796. return defaultPlaylists;
  109797. }
  109798. return playlists;
  109799. };
  109800. _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() {
  109801. var _this3 = this;
  109802. this.masterPlaylistLoader_.on("loadedmetadata", function() {
  109803. var media = _this3.masterPlaylistLoader_.media();
  109804. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109805. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109806. _this3.requestOptions_.timeout = 0;
  109807. } else {
  109808. _this3.requestOptions_.timeout = requestTimeout;
  109809. }
  109810. if (media.endList && _this3.tech_.preload() !== "none") {
  109811. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109812. _this3.mainSegmentLoader_.load();
  109813. }
  109814. setupMediaGroups({
  109815. sourceType: _this3.sourceType_,
  109816. segmentLoaders: {
  109817. AUDIO: _this3.audioSegmentLoader_,
  109818. SUBTITLES: _this3.subtitleSegmentLoader_,
  109819. main: _this3.mainSegmentLoader_
  109820. },
  109821. tech: _this3.tech_,
  109822. requestOptions: _this3.requestOptions_,
  109823. masterPlaylistLoader: _this3.masterPlaylistLoader_,
  109824. vhs: _this3.vhs_,
  109825. master: _this3.master(),
  109826. mediaTypes: _this3.mediaTypes_,
  109827. blacklistCurrentPlaylist: _this3.blacklistCurrentPlaylist.bind(_this3)
  109828. });
  109829. _this3.triggerPresenceUsage_(_this3.master(), media);
  109830. _this3.setupFirstPlay();
  109831. if (!_this3.mediaTypes_.AUDIO.activePlaylistLoader || _this3.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  109832. _this3.trigger("selectedinitialmedia");
  109833. } else {
  109834. _this3.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", function() {
  109835. _this3.trigger("selectedinitialmedia");
  109836. });
  109837. }
  109838. });
  109839. this.masterPlaylistLoader_.on("loadedplaylist", function() {
  109840. if (_this3.loadOnPlay_) {
  109841. _this3.tech_.off("play", _this3.loadOnPlay_);
  109842. }
  109843. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109844. if (!updatedPlaylist) {
  109845. _this3.excludeUnsupportedVariants_();
  109846. var selectedMedia;
  109847. if (_this3.enableLowInitialPlaylist) {
  109848. selectedMedia = _this3.selectInitialPlaylist();
  109849. }
  109850. if (!selectedMedia) {
  109851. selectedMedia = _this3.selectPlaylist();
  109852. }
  109853. if (!selectedMedia || !_this3.shouldSwitchToMedia_(selectedMedia)) {
  109854. return;
  109855. }
  109856. _this3.initialMedia_ = selectedMedia;
  109857. _this3.switchMedia_(_this3.initialMedia_, "initial");
  109858. var haveJsonSource = _this3.sourceType_ === "vhs-json" && _this3.initialMedia_.segments;
  109859. if (!haveJsonSource) {
  109860. return;
  109861. }
  109862. updatedPlaylist = _this3.initialMedia_;
  109863. }
  109864. _this3.handleUpdatedMediaPlaylist(updatedPlaylist);
  109865. });
  109866. this.masterPlaylistLoader_.on("error", function() {
  109867. _this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error);
  109868. });
  109869. this.masterPlaylistLoader_.on("mediachanging", function() {
  109870. _this3.mainSegmentLoader_.abort();
  109871. _this3.mainSegmentLoader_.pause();
  109872. });
  109873. this.masterPlaylistLoader_.on("mediachange", function() {
  109874. var media = _this3.masterPlaylistLoader_.media();
  109875. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109876. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109877. _this3.requestOptions_.timeout = 0;
  109878. } else {
  109879. _this3.requestOptions_.timeout = requestTimeout;
  109880. }
  109881. _this3.masterPlaylistLoader_.load();
  109882. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109883. _this3.mainSegmentLoader_.load();
  109884. _this3.tech_.trigger({
  109885. type: "mediachange",
  109886. bubbles: true
  109887. });
  109888. });
  109889. this.masterPlaylistLoader_.on("playlistunchanged", function() {
  109890. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109891. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  109892. return;
  109893. }
  109894. var playlistOutdated = _this3.stuckAtPlaylistEnd_(updatedPlaylist);
  109895. if (playlistOutdated) {
  109896. _this3.blacklistCurrentPlaylist({
  109897. message: "Playlist no longer updating.",
  109898. reason: "playlist-unchanged"
  109899. });
  109900. _this3.tech_.trigger("playliststuck");
  109901. }
  109902. });
  109903. this.masterPlaylistLoader_.on("renditiondisabled", function() {
  109904. _this3.tech_.trigger({
  109905. type: "usage",
  109906. name: "vhs-rendition-disabled"
  109907. });
  109908. _this3.tech_.trigger({
  109909. type: "usage",
  109910. name: "hls-rendition-disabled"
  109911. });
  109912. });
  109913. this.masterPlaylistLoader_.on("renditionenabled", function() {
  109914. _this3.tech_.trigger({
  109915. type: "usage",
  109916. name: "vhs-rendition-enabled"
  109917. });
  109918. _this3.tech_.trigger({
  109919. type: "usage",
  109920. name: "hls-rendition-enabled"
  109921. });
  109922. });
  109923. };
  109924. _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) {
  109925. if (this.useCueTags_) {
  109926. this.updateAdCues_(updatedPlaylist);
  109927. }
  109928. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  109929. this.updateDuration(!updatedPlaylist.endList);
  109930. if (!this.tech_.paused()) {
  109931. this.mainSegmentLoader_.load();
  109932. if (this.audioSegmentLoader_) {
  109933. this.audioSegmentLoader_.load();
  109934. }
  109935. }
  109936. };
  109937. _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) {
  109938. var mediaGroups = master.mediaGroups || {};
  109939. var defaultDemuxed = true;
  109940. var audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  109941. for (var mediaGroup in mediaGroups.AUDIO) {
  109942. for (var label in mediaGroups.AUDIO[mediaGroup]) {
  109943. var properties = mediaGroups.AUDIO[mediaGroup][label];
  109944. if (!properties.uri) {
  109945. defaultDemuxed = false;
  109946. }
  109947. }
  109948. }
  109949. if (defaultDemuxed) {
  109950. this.tech_.trigger({
  109951. type: "usage",
  109952. name: "vhs-demuxed"
  109953. });
  109954. this.tech_.trigger({
  109955. type: "usage",
  109956. name: "hls-demuxed"
  109957. });
  109958. }
  109959. if (Object.keys(mediaGroups.SUBTITLES).length) {
  109960. this.tech_.trigger({
  109961. type: "usage",
  109962. name: "vhs-webvtt"
  109963. });
  109964. this.tech_.trigger({
  109965. type: "usage",
  109966. name: "hls-webvtt"
  109967. });
  109968. }
  109969. if (Vhs$1.Playlist.isAes(media)) {
  109970. this.tech_.trigger({
  109971. type: "usage",
  109972. name: "vhs-aes"
  109973. });
  109974. this.tech_.trigger({
  109975. type: "usage",
  109976. name: "hls-aes"
  109977. });
  109978. }
  109979. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  109980. this.tech_.trigger({
  109981. type: "usage",
  109982. name: "vhs-alternate-audio"
  109983. });
  109984. this.tech_.trigger({
  109985. type: "usage",
  109986. name: "hls-alternate-audio"
  109987. });
  109988. }
  109989. if (this.useCueTags_) {
  109990. this.tech_.trigger({
  109991. type: "usage",
  109992. name: "vhs-playlist-cue-tags"
  109993. });
  109994. this.tech_.trigger({
  109995. type: "usage",
  109996. name: "hls-playlist-cue-tags"
  109997. });
  109998. }
  109999. };
  110000. _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) {
  110001. var currentPlaylist = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_;
  110002. var currentTime = this.tech_.currentTime();
  110003. var bufferLowWaterLine = this.bufferLowWaterLine();
  110004. var bufferHighWaterLine = this.bufferHighWaterLine();
  110005. var buffered = this.tech_.buffered();
  110006. return shouldSwitchToMedia({
  110007. buffered,
  110008. currentTime,
  110009. currentPlaylist,
  110010. nextPlaylist,
  110011. bufferLowWaterLine,
  110012. bufferHighWaterLine,
  110013. duration: this.duration(),
  110014. experimentalBufferBasedABR: this.experimentalBufferBasedABR,
  110015. log: this.logger_
  110016. });
  110017. };
  110018. _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() {
  110019. var _this4 = this;
  110020. this.mainSegmentLoader_.on("bandwidthupdate", function() {
  110021. _this4.checkABR_("bandwidthupdate");
  110022. _this4.tech_.trigger("bandwidthupdate");
  110023. });
  110024. this.mainSegmentLoader_.on("timeout", function() {
  110025. if (_this4.experimentalBufferBasedABR) {
  110026. _this4.mainSegmentLoader_.load();
  110027. }
  110028. });
  110029. if (!this.experimentalBufferBasedABR) {
  110030. this.mainSegmentLoader_.on("progress", function() {
  110031. _this4.trigger("progress");
  110032. });
  110033. }
  110034. this.mainSegmentLoader_.on("error", function() {
  110035. _this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error());
  110036. });
  110037. this.mainSegmentLoader_.on("appenderror", function() {
  110038. _this4.error = _this4.mainSegmentLoader_.error_;
  110039. _this4.trigger("error");
  110040. });
  110041. this.mainSegmentLoader_.on("syncinfoupdate", function() {
  110042. _this4.onSyncInfoUpdate_();
  110043. });
  110044. this.mainSegmentLoader_.on("timestampoffset", function() {
  110045. _this4.tech_.trigger({
  110046. type: "usage",
  110047. name: "vhs-timestamp-offset"
  110048. });
  110049. _this4.tech_.trigger({
  110050. type: "usage",
  110051. name: "hls-timestamp-offset"
  110052. });
  110053. });
  110054. this.audioSegmentLoader_.on("syncinfoupdate", function() {
  110055. _this4.onSyncInfoUpdate_();
  110056. });
  110057. this.audioSegmentLoader_.on("appenderror", function() {
  110058. _this4.error = _this4.audioSegmentLoader_.error_;
  110059. _this4.trigger("error");
  110060. });
  110061. this.mainSegmentLoader_.on("ended", function() {
  110062. _this4.logger_("main segment loader ended");
  110063. _this4.onEndOfStream();
  110064. });
  110065. this.mainSegmentLoader_.on("earlyabort", function(event2) {
  110066. if (_this4.experimentalBufferBasedABR) {
  110067. return;
  110068. }
  110069. _this4.delegateLoaders_("all", ["abort"]);
  110070. _this4.blacklistCurrentPlaylist({
  110071. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  110072. }, ABORT_EARLY_BLACKLIST_SECONDS);
  110073. });
  110074. var updateCodecs = function updateCodecs2() {
  110075. if (!_this4.sourceUpdater_.hasCreatedSourceBuffers()) {
  110076. return _this4.tryToCreateSourceBuffers_();
  110077. }
  110078. var codecs = _this4.getCodecsOrExclude_();
  110079. if (!codecs) {
  110080. return;
  110081. }
  110082. _this4.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  110083. };
  110084. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  110085. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  110086. this.mainSegmentLoader_.on("fmp4", function() {
  110087. if (!_this4.triggeredFmp4Usage) {
  110088. _this4.tech_.trigger({
  110089. type: "usage",
  110090. name: "vhs-fmp4"
  110091. });
  110092. _this4.tech_.trigger({
  110093. type: "usage",
  110094. name: "hls-fmp4"
  110095. });
  110096. _this4.triggeredFmp4Usage = true;
  110097. }
  110098. });
  110099. this.audioSegmentLoader_.on("fmp4", function() {
  110100. if (!_this4.triggeredFmp4Usage) {
  110101. _this4.tech_.trigger({
  110102. type: "usage",
  110103. name: "vhs-fmp4"
  110104. });
  110105. _this4.tech_.trigger({
  110106. type: "usage",
  110107. name: "hls-fmp4"
  110108. });
  110109. _this4.triggeredFmp4Usage = true;
  110110. }
  110111. });
  110112. this.audioSegmentLoader_.on("ended", function() {
  110113. _this4.logger_("audioSegmentLoader ended");
  110114. _this4.onEndOfStream();
  110115. });
  110116. };
  110117. _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() {
  110118. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  110119. };
  110120. _proto.load = function load() {
  110121. this.mainSegmentLoader_.load();
  110122. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110123. this.audioSegmentLoader_.load();
  110124. }
  110125. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110126. this.subtitleSegmentLoader_.load();
  110127. }
  110128. };
  110129. _proto.smoothQualityChange_ = function smoothQualityChange_(media) {
  110130. if (media === void 0) {
  110131. media = this.selectPlaylist();
  110132. }
  110133. this.fastQualityChange_(media);
  110134. };
  110135. _proto.fastQualityChange_ = function fastQualityChange_(media) {
  110136. var _this5 = this;
  110137. if (media === void 0) {
  110138. media = this.selectPlaylist();
  110139. }
  110140. if (media === this.masterPlaylistLoader_.media()) {
  110141. this.logger_("skipping fastQualityChange because new media is same as old");
  110142. return;
  110143. }
  110144. this.switchMedia_(media, "fast-quality");
  110145. this.mainSegmentLoader_.resetEverything(function() {
  110146. if (videojs.browser.IE_VERSION || videojs.browser.IS_EDGE) {
  110147. _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04);
  110148. } else {
  110149. _this5.tech_.setCurrentTime(_this5.tech_.currentTime());
  110150. }
  110151. });
  110152. };
  110153. _proto.play = function play() {
  110154. if (this.setupFirstPlay()) {
  110155. return;
  110156. }
  110157. if (this.tech_.ended()) {
  110158. this.tech_.setCurrentTime(0);
  110159. }
  110160. if (this.hasPlayed_) {
  110161. this.load();
  110162. }
  110163. var seekable3 = this.tech_.seekable();
  110164. if (this.tech_.duration() === Infinity) {
  110165. if (this.tech_.currentTime() < seekable3.start(0)) {
  110166. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  110167. }
  110168. }
  110169. };
  110170. _proto.setupFirstPlay = function setupFirstPlay() {
  110171. var _this6 = this;
  110172. var media = this.masterPlaylistLoader_.media();
  110173. if (!media || this.tech_.paused() || this.hasPlayed_) {
  110174. return false;
  110175. }
  110176. if (!media.endList) {
  110177. var seekable3 = this.seekable();
  110178. if (!seekable3.length) {
  110179. return false;
  110180. }
  110181. if (videojs.browser.IE_VERSION && this.tech_.readyState() === 0) {
  110182. this.tech_.one("loadedmetadata", function() {
  110183. _this6.trigger("firstplay");
  110184. _this6.tech_.setCurrentTime(seekable3.end(0));
  110185. _this6.hasPlayed_ = true;
  110186. });
  110187. return false;
  110188. }
  110189. this.trigger("firstplay");
  110190. this.tech_.setCurrentTime(seekable3.end(0));
  110191. }
  110192. this.hasPlayed_ = true;
  110193. this.load();
  110194. return true;
  110195. };
  110196. _proto.handleSourceOpen_ = function handleSourceOpen_() {
  110197. this.tryToCreateSourceBuffers_();
  110198. if (this.tech_.autoplay()) {
  110199. var playPromise = this.tech_.play();
  110200. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  110201. playPromise.then(null, function(e) {
  110202. });
  110203. }
  110204. }
  110205. this.trigger("sourceopen");
  110206. };
  110207. _proto.handleSourceEnded_ = function handleSourceEnded_() {
  110208. if (!this.inbandTextTracks_.metadataTrack_) {
  110209. return;
  110210. }
  110211. var cues = this.inbandTextTracks_.metadataTrack_.cues;
  110212. if (!cues || !cues.length) {
  110213. return;
  110214. }
  110215. var duration5 = this.duration();
  110216. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  110217. };
  110218. _proto.handleDurationChange_ = function handleDurationChange_() {
  110219. this.tech_.trigger("durationchange");
  110220. };
  110221. _proto.onEndOfStream = function onEndOfStream() {
  110222. var isEndOfStream = this.mainSegmentLoader_.ended_;
  110223. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110224. var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  110225. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  110226. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  110227. } else {
  110228. isEndOfStream = this.audioSegmentLoader_.ended_;
  110229. }
  110230. }
  110231. if (!isEndOfStream) {
  110232. return;
  110233. }
  110234. this.stopABRTimer_();
  110235. this.sourceUpdater_.endOfStream();
  110236. };
  110237. _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) {
  110238. var seekable3 = this.seekable();
  110239. if (!seekable3.length) {
  110240. return false;
  110241. }
  110242. var expired = this.syncController_.getExpiredTime(playlist, this.duration());
  110243. if (expired === null) {
  110244. return false;
  110245. }
  110246. var absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);
  110247. var currentTime = this.tech_.currentTime();
  110248. var buffered = this.tech_.buffered();
  110249. if (!buffered.length) {
  110250. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;
  110251. }
  110252. var bufferedEnd = buffered.end(buffered.length - 1);
  110253. return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;
  110254. };
  110255. _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) {
  110256. if (error === void 0) {
  110257. error = {};
  110258. }
  110259. var currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();
  110260. blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration;
  110261. if (!currentPlaylist) {
  110262. this.error = error;
  110263. if (this.mediaSource.readyState !== "open") {
  110264. this.trigger("error");
  110265. } else {
  110266. this.sourceUpdater_.endOfStream("network");
  110267. }
  110268. return;
  110269. }
  110270. currentPlaylist.playlistErrors_++;
  110271. var playlists = this.masterPlaylistLoader_.master.playlists;
  110272. var enabledPlaylists = playlists.filter(isEnabled);
  110273. var isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist;
  110274. if (playlists.length === 1 && blacklistDuration !== Infinity) {
  110275. videojs.log.warn("Problem encountered with playlist " + currentPlaylist.id + ". Trying again since it is the only playlist.");
  110276. this.tech_.trigger("retryplaylist");
  110277. return this.masterPlaylistLoader_.load(isFinalRendition);
  110278. }
  110279. if (isFinalRendition) {
  110280. var reincluded = false;
  110281. playlists.forEach(function(playlist) {
  110282. if (playlist === currentPlaylist) {
  110283. return;
  110284. }
  110285. var excludeUntil2 = playlist.excludeUntil;
  110286. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  110287. reincluded = true;
  110288. delete playlist.excludeUntil;
  110289. }
  110290. });
  110291. if (reincluded) {
  110292. videojs.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  110293. this.tech_.trigger("retryplaylist");
  110294. }
  110295. }
  110296. var excludeUntil;
  110297. if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) {
  110298. excludeUntil = Infinity;
  110299. } else {
  110300. excludeUntil = Date.now() + blacklistDuration * 1e3;
  110301. }
  110302. currentPlaylist.excludeUntil = excludeUntil;
  110303. if (error.reason) {
  110304. currentPlaylist.lastExcludeReason_ = error.reason;
  110305. }
  110306. this.tech_.trigger("blacklistplaylist");
  110307. this.tech_.trigger({
  110308. type: "usage",
  110309. name: "vhs-rendition-blacklisted"
  110310. });
  110311. this.tech_.trigger({
  110312. type: "usage",
  110313. name: "hls-rendition-blacklisted"
  110314. });
  110315. var nextPlaylist = this.selectPlaylist();
  110316. if (!nextPlaylist) {
  110317. this.error = "Playback cannot continue. No available working or supported playlists.";
  110318. this.trigger("error");
  110319. return;
  110320. }
  110321. var logFn2 = error.internal ? this.logger_ : videojs.log.warn;
  110322. var errorMessage = error.message ? " " + error.message : "";
  110323. logFn2((error.internal ? "Internal problem" : "Problem") + " encountered with playlist " + currentPlaylist.id + "." + (errorMessage + " Switching to playlist " + nextPlaylist.id + "."));
  110324. if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) {
  110325. this.delegateLoaders_("audio", ["abort", "pause"]);
  110326. }
  110327. if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) {
  110328. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  110329. }
  110330. this.delegateLoaders_("main", ["abort", "pause"]);
  110331. var delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  110332. var shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  110333. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  110334. };
  110335. _proto.pauseLoading = function pauseLoading() {
  110336. this.delegateLoaders_("all", ["abort", "pause"]);
  110337. this.stopABRTimer_();
  110338. };
  110339. _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) {
  110340. var _this7 = this;
  110341. var loaders = [];
  110342. var dontFilterPlaylist = filter === "all";
  110343. if (dontFilterPlaylist || filter === "main") {
  110344. loaders.push(this.masterPlaylistLoader_);
  110345. }
  110346. var mediaTypes2 = [];
  110347. if (dontFilterPlaylist || filter === "audio") {
  110348. mediaTypes2.push("AUDIO");
  110349. }
  110350. if (dontFilterPlaylist || filter === "subtitle") {
  110351. mediaTypes2.push("CLOSED-CAPTIONS");
  110352. mediaTypes2.push("SUBTITLES");
  110353. }
  110354. mediaTypes2.forEach(function(mediaType) {
  110355. var loader = _this7.mediaTypes_[mediaType] && _this7.mediaTypes_[mediaType].activePlaylistLoader;
  110356. if (loader) {
  110357. loaders.push(loader);
  110358. }
  110359. });
  110360. ["main", "audio", "subtitle"].forEach(function(name) {
  110361. var loader = _this7[name + "SegmentLoader_"];
  110362. if (loader && (filter === name || filter === "all")) {
  110363. loaders.push(loader);
  110364. }
  110365. });
  110366. loaders.forEach(function(loader) {
  110367. return fnNames.forEach(function(fnName) {
  110368. if (typeof loader[fnName] === "function") {
  110369. loader[fnName]();
  110370. }
  110371. });
  110372. });
  110373. };
  110374. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  110375. var buffered = findRange(this.tech_.buffered(), currentTime);
  110376. if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {
  110377. return 0;
  110378. }
  110379. if (!this.masterPlaylistLoader_.media().segments) {
  110380. return 0;
  110381. }
  110382. if (buffered && buffered.length) {
  110383. return currentTime;
  110384. }
  110385. this.mainSegmentLoader_.resetEverything();
  110386. this.mainSegmentLoader_.abort();
  110387. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110388. this.audioSegmentLoader_.resetEverything();
  110389. this.audioSegmentLoader_.abort();
  110390. }
  110391. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110392. this.subtitleSegmentLoader_.resetEverything();
  110393. this.subtitleSegmentLoader_.abort();
  110394. }
  110395. this.load();
  110396. };
  110397. _proto.duration = function duration5() {
  110398. if (!this.masterPlaylistLoader_) {
  110399. return 0;
  110400. }
  110401. var media = this.masterPlaylistLoader_.media();
  110402. if (!media) {
  110403. return 0;
  110404. }
  110405. if (!media.endList) {
  110406. return Infinity;
  110407. }
  110408. if (this.mediaSource) {
  110409. return this.mediaSource.duration;
  110410. }
  110411. return Vhs$1.Playlist.duration(media);
  110412. };
  110413. _proto.seekable = function seekable3() {
  110414. return this.seekable_;
  110415. };
  110416. _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() {
  110417. var audioSeekable;
  110418. if (!this.masterPlaylistLoader_) {
  110419. return;
  110420. }
  110421. var media = this.masterPlaylistLoader_.media();
  110422. if (!media) {
  110423. return;
  110424. }
  110425. var expired = this.syncController_.getExpiredTime(media, this.duration());
  110426. if (expired === null) {
  110427. return;
  110428. }
  110429. var master = this.masterPlaylistLoader_.master;
  110430. var mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110431. if (mainSeekable.length === 0) {
  110432. return;
  110433. }
  110434. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110435. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  110436. expired = this.syncController_.getExpiredTime(media, this.duration());
  110437. if (expired === null) {
  110438. return;
  110439. }
  110440. audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110441. if (audioSeekable.length === 0) {
  110442. return;
  110443. }
  110444. }
  110445. var oldEnd;
  110446. var oldStart;
  110447. if (this.seekable_ && this.seekable_.length) {
  110448. oldEnd = this.seekable_.end(0);
  110449. oldStart = this.seekable_.start(0);
  110450. }
  110451. if (!audioSeekable) {
  110452. this.seekable_ = mainSeekable;
  110453. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  110454. this.seekable_ = mainSeekable;
  110455. } else {
  110456. this.seekable_ = videojs.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  110457. }
  110458. if (this.seekable_ && this.seekable_.length) {
  110459. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  110460. return;
  110461. }
  110462. }
  110463. this.logger_("seekable updated [" + printableRange(this.seekable_) + "]");
  110464. this.tech_.trigger("seekablechanged");
  110465. };
  110466. _proto.updateDuration = function updateDuration(isLive) {
  110467. if (this.updateDuration_) {
  110468. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110469. this.updateDuration_ = null;
  110470. }
  110471. if (this.mediaSource.readyState !== "open") {
  110472. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  110473. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  110474. return;
  110475. }
  110476. if (isLive) {
  110477. var seekable3 = this.seekable();
  110478. if (!seekable3.length) {
  110479. return;
  110480. }
  110481. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  110482. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  110483. }
  110484. return;
  110485. }
  110486. var buffered = this.tech_.buffered();
  110487. var duration5 = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());
  110488. if (buffered.length > 0) {
  110489. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  110490. }
  110491. if (this.mediaSource.duration !== duration5) {
  110492. this.sourceUpdater_.setDuration(duration5);
  110493. }
  110494. };
  110495. _proto.dispose = function dispose() {
  110496. var _this8 = this;
  110497. this.trigger("dispose");
  110498. this.decrypter_.terminate();
  110499. this.masterPlaylistLoader_.dispose();
  110500. this.mainSegmentLoader_.dispose();
  110501. if (this.loadOnPlay_) {
  110502. this.tech_.off("play", this.loadOnPlay_);
  110503. }
  110504. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  110505. var groups = _this8.mediaTypes_[type2].groups;
  110506. for (var id in groups) {
  110507. groups[id].forEach(function(group) {
  110508. if (group.playlistLoader) {
  110509. group.playlistLoader.dispose();
  110510. }
  110511. });
  110512. }
  110513. });
  110514. this.audioSegmentLoader_.dispose();
  110515. this.subtitleSegmentLoader_.dispose();
  110516. this.sourceUpdater_.dispose();
  110517. this.timelineChangeController_.dispose();
  110518. this.stopABRTimer_();
  110519. if (this.updateDuration_) {
  110520. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110521. }
  110522. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  110523. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  110524. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  110525. this.off();
  110526. };
  110527. _proto.master = function master() {
  110528. return this.masterPlaylistLoader_.master;
  110529. };
  110530. _proto.media = function media() {
  110531. return this.masterPlaylistLoader_.media() || this.initialMedia_;
  110532. };
  110533. _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() {
  110534. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110535. var hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  110536. var hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  110537. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  110538. return false;
  110539. }
  110540. return true;
  110541. };
  110542. _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() {
  110543. var _this9 = this;
  110544. var media = {
  110545. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  110546. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  110547. };
  110548. var playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  110549. media.video = media.main;
  110550. var playlistCodecs = codecsForPlaylist(this.master(), playlist);
  110551. var codecs = {};
  110552. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110553. if (media.main.hasVideo) {
  110554. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;
  110555. }
  110556. if (media.main.isMuxed) {
  110557. codecs.video += "," + (playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC);
  110558. }
  110559. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  110560. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC;
  110561. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  110562. }
  110563. if (!codecs.audio && !codecs.video) {
  110564. this.blacklistCurrentPlaylist({
  110565. playlist,
  110566. message: "Could not determine codecs for playlist.",
  110567. blacklistDuration: Infinity
  110568. });
  110569. return;
  110570. }
  110571. var supportFunction = function supportFunction2(isFmp4, codec) {
  110572. return isFmp4 ? browserSupportsCodec2(codec) : muxerSupportsCodec2(codec);
  110573. };
  110574. var unsupportedCodecs = {};
  110575. var unsupportedAudio;
  110576. ["video", "audio"].forEach(function(type2) {
  110577. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  110578. var supporter = media[type2].isFmp4 ? "browser" : "muxer";
  110579. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  110580. unsupportedCodecs[supporter].push(codecs[type2]);
  110581. if (type2 === "audio") {
  110582. unsupportedAudio = supporter;
  110583. }
  110584. }
  110585. });
  110586. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  110587. var audioGroup = playlist.attributes.AUDIO;
  110588. this.master().playlists.forEach(function(variant) {
  110589. var variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  110590. if (variantAudioGroup === audioGroup && variant !== playlist) {
  110591. variant.excludeUntil = Infinity;
  110592. }
  110593. });
  110594. this.logger_("excluding audio group " + audioGroup + " as " + unsupportedAudio + ' does not support codec(s): "' + codecs.audio + '"');
  110595. }
  110596. if (Object.keys(unsupportedCodecs).length) {
  110597. var message = Object.keys(unsupportedCodecs).reduce(function(acc, supporter) {
  110598. if (acc) {
  110599. acc += ", ";
  110600. }
  110601. acc += supporter + ' does not support codec(s): "' + unsupportedCodecs[supporter].join(",") + '"';
  110602. return acc;
  110603. }, "") + ".";
  110604. this.blacklistCurrentPlaylist({
  110605. playlist,
  110606. internal: true,
  110607. message,
  110608. blacklistDuration: Infinity
  110609. });
  110610. return;
  110611. }
  110612. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  110613. var switchMessages = [];
  110614. ["video", "audio"].forEach(function(type2) {
  110615. var newCodec = (parseCodecs2(_this9.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  110616. var oldCodec = (parseCodecs2(codecs[type2] || "")[0] || {}).type;
  110617. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  110618. switchMessages.push('"' + _this9.sourceUpdater_.codecs[type2] + '" -> "' + codecs[type2] + '"');
  110619. }
  110620. });
  110621. if (switchMessages.length) {
  110622. this.blacklistCurrentPlaylist({
  110623. playlist,
  110624. message: "Codec switching not supported: " + switchMessages.join(", ") + ".",
  110625. blacklistDuration: Infinity,
  110626. internal: true
  110627. });
  110628. return;
  110629. }
  110630. }
  110631. return codecs;
  110632. };
  110633. _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() {
  110634. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  110635. return;
  110636. }
  110637. if (!this.areMediaTypesKnown_()) {
  110638. return;
  110639. }
  110640. var codecs = this.getCodecsOrExclude_();
  110641. if (!codecs) {
  110642. return;
  110643. }
  110644. this.sourceUpdater_.createSourceBuffers(codecs);
  110645. var codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  110646. this.excludeIncompatibleVariants_(codecString);
  110647. };
  110648. _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() {
  110649. var _this10 = this;
  110650. var playlists = this.master().playlists;
  110651. var ids = [];
  110652. Object.keys(playlists).forEach(function(key) {
  110653. var variant = playlists[key];
  110654. if (ids.indexOf(variant.id) !== -1) {
  110655. return;
  110656. }
  110657. ids.push(variant.id);
  110658. var codecs = codecsForPlaylist(_this10.master, variant);
  110659. var unsupported = [];
  110660. if (codecs.audio && !muxerSupportsCodec2(codecs.audio) && !browserSupportsCodec2(codecs.audio)) {
  110661. unsupported.push("audio codec " + codecs.audio);
  110662. }
  110663. if (codecs.video && !muxerSupportsCodec2(codecs.video) && !browserSupportsCodec2(codecs.video)) {
  110664. unsupported.push("video codec " + codecs.video);
  110665. }
  110666. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  110667. unsupported.push("text codec " + codecs.text);
  110668. }
  110669. if (unsupported.length) {
  110670. variant.excludeUntil = Infinity;
  110671. _this10.logger_("excluding " + variant.id + " for unsupported: " + unsupported.join(", "));
  110672. }
  110673. });
  110674. };
  110675. _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) {
  110676. var _this11 = this;
  110677. var ids = [];
  110678. var playlists = this.master().playlists;
  110679. var codecs = unwrapCodecList(parseCodecs2(codecString));
  110680. var codecCount_ = codecCount(codecs);
  110681. var videoDetails = codecs.video && parseCodecs2(codecs.video)[0] || null;
  110682. var audioDetails = codecs.audio && parseCodecs2(codecs.audio)[0] || null;
  110683. Object.keys(playlists).forEach(function(key) {
  110684. var variant = playlists[key];
  110685. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  110686. return;
  110687. }
  110688. ids.push(variant.id);
  110689. var blacklistReasons = [];
  110690. var variantCodecs = codecsForPlaylist(_this11.masterPlaylistLoader_.master, variant);
  110691. var variantCodecCount = codecCount(variantCodecs);
  110692. if (!variantCodecs.audio && !variantCodecs.video) {
  110693. return;
  110694. }
  110695. if (variantCodecCount !== codecCount_) {
  110696. blacklistReasons.push('codec count "' + variantCodecCount + '" !== "' + codecCount_ + '"');
  110697. }
  110698. if (!_this11.sourceUpdater_.canChangeType()) {
  110699. var variantVideoDetails = variantCodecs.video && parseCodecs2(variantCodecs.video)[0] || null;
  110700. var variantAudioDetails = variantCodecs.audio && parseCodecs2(variantCodecs.audio)[0] || null;
  110701. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  110702. blacklistReasons.push('video codec "' + variantVideoDetails.type + '" !== "' + videoDetails.type + '"');
  110703. }
  110704. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  110705. blacklistReasons.push('audio codec "' + variantAudioDetails.type + '" !== "' + audioDetails.type + '"');
  110706. }
  110707. }
  110708. if (blacklistReasons.length) {
  110709. variant.excludeUntil = Infinity;
  110710. _this11.logger_("blacklisting " + variant.id + ": " + blacklistReasons.join(" && "));
  110711. }
  110712. });
  110713. };
  110714. _proto.updateAdCues_ = function updateAdCues_(media) {
  110715. var offset = 0;
  110716. var seekable3 = this.seekable();
  110717. if (seekable3.length) {
  110718. offset = seekable3.start(0);
  110719. }
  110720. updateAdCues(media, this.cueTagsTrack_, offset);
  110721. };
  110722. _proto.goalBufferLength = function goalBufferLength() {
  110723. var currentTime = this.tech_.currentTime();
  110724. var initial = Config.GOAL_BUFFER_LENGTH;
  110725. var rate = Config.GOAL_BUFFER_LENGTH_RATE;
  110726. var max2 = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);
  110727. return Math.min(initial + currentTime * rate, max2);
  110728. };
  110729. _proto.bufferLowWaterLine = function bufferLowWaterLine() {
  110730. var currentTime = this.tech_.currentTime();
  110731. var initial = Config.BUFFER_LOW_WATER_LINE;
  110732. var rate = Config.BUFFER_LOW_WATER_LINE_RATE;
  110733. var max2 = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);
  110734. var newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  110735. return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max2);
  110736. };
  110737. _proto.bufferHighWaterLine = function bufferHighWaterLine() {
  110738. return Config.BUFFER_HIGH_WATER_LINE;
  110739. };
  110740. return MasterPlaylistController2;
  110741. }(videojs.EventTarget);
  110742. var enableFunction = function enableFunction2(loader, playlistID, changePlaylistFn) {
  110743. return function(enable) {
  110744. var playlist = loader.master.playlists[playlistID];
  110745. var incompatible = isIncompatible(playlist);
  110746. var currentlyEnabled = isEnabled(playlist);
  110747. if (typeof enable === "undefined") {
  110748. return currentlyEnabled;
  110749. }
  110750. if (enable) {
  110751. delete playlist.disabled;
  110752. } else {
  110753. playlist.disabled = true;
  110754. }
  110755. if (enable !== currentlyEnabled && !incompatible) {
  110756. changePlaylistFn();
  110757. if (enable) {
  110758. loader.trigger("renditionenabled");
  110759. } else {
  110760. loader.trigger("renditiondisabled");
  110761. }
  110762. }
  110763. return enable;
  110764. };
  110765. };
  110766. var Representation = function Representation2(vhsHandler, playlist, id) {
  110767. var mpc = vhsHandler.masterPlaylistController_, smoothQualityChange = vhsHandler.options_.smoothQualityChange;
  110768. var changeType2 = smoothQualityChange ? "smooth" : "fast";
  110769. var qualityChangeFunction = mpc[changeType2 + "QualityChange_"].bind(mpc);
  110770. if (playlist.attributes) {
  110771. var resolution = playlist.attributes.RESOLUTION;
  110772. this.width = resolution && resolution.width;
  110773. this.height = resolution && resolution.height;
  110774. this.bandwidth = playlist.attributes.BANDWIDTH;
  110775. this.frameRate = playlist.attributes["FRAME-RATE"];
  110776. }
  110777. this.codecs = codecsForPlaylist(mpc.master(), playlist);
  110778. this.playlist = playlist;
  110779. this.id = id;
  110780. this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  110781. };
  110782. var renditionSelectionMixin = function renditionSelectionMixin2(vhsHandler) {
  110783. vhsHandler.representations = function() {
  110784. var master = vhsHandler.masterPlaylistController_.master();
  110785. var playlists = isAudioOnly(master) ? vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_() : master.playlists;
  110786. if (!playlists) {
  110787. return [];
  110788. }
  110789. return playlists.filter(function(media) {
  110790. return !isIncompatible(media);
  110791. }).map(function(e, i2) {
  110792. return new Representation(vhsHandler, e, e.id);
  110793. });
  110794. };
  110795. };
  110796. var timerCancelEvents = ["seeking", "seeked", "pause", "playing", "error"];
  110797. var PlaybackWatcher = /* @__PURE__ */ function() {
  110798. function PlaybackWatcher2(options2) {
  110799. var _this = this;
  110800. this.masterPlaylistController_ = options2.masterPlaylistController;
  110801. this.tech_ = options2.tech;
  110802. this.seekable = options2.seekable;
  110803. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  110804. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  110805. this.media = options2.media;
  110806. this.consecutiveUpdates = 0;
  110807. this.lastRecordedTime = null;
  110808. this.timer_ = null;
  110809. this.checkCurrentTimeTimeout_ = null;
  110810. this.logger_ = logger("PlaybackWatcher");
  110811. this.logger_("initialize");
  110812. var playHandler = function playHandler2() {
  110813. return _this.monitorCurrentTime_();
  110814. };
  110815. var canPlayHandler = function canPlayHandler2() {
  110816. return _this.monitorCurrentTime_();
  110817. };
  110818. var waitingHandler = function waitingHandler2() {
  110819. return _this.techWaiting_();
  110820. };
  110821. var cancelTimerHandler = function cancelTimerHandler2() {
  110822. return _this.cancelTimer_();
  110823. };
  110824. var mpc = this.masterPlaylistController_;
  110825. var loaderTypes = ["main", "subtitle", "audio"];
  110826. var loaderChecks = {};
  110827. loaderTypes.forEach(function(type2) {
  110828. loaderChecks[type2] = {
  110829. reset: function reset3() {
  110830. return _this.resetSegmentDownloads_(type2);
  110831. },
  110832. updateend: function updateend() {
  110833. return _this.checkSegmentDownloads_(type2);
  110834. }
  110835. };
  110836. mpc[type2 + "SegmentLoader_"].on("appendsdone", loaderChecks[type2].updateend);
  110837. mpc[type2 + "SegmentLoader_"].on("playlistupdate", loaderChecks[type2].reset);
  110838. _this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  110839. });
  110840. var setSeekingHandlers = function setSeekingHandlers2(fn2) {
  110841. ["main", "audio"].forEach(function(type2) {
  110842. mpc[type2 + "SegmentLoader_"][fn2]("appended", _this.seekingAppendCheck_);
  110843. });
  110844. };
  110845. this.seekingAppendCheck_ = function() {
  110846. if (_this.fixesBadSeeks_()) {
  110847. _this.consecutiveUpdates = 0;
  110848. _this.lastRecordedTime = _this.tech_.currentTime();
  110849. setSeekingHandlers("off");
  110850. }
  110851. };
  110852. this.clearSeekingAppendCheck_ = function() {
  110853. return setSeekingHandlers("off");
  110854. };
  110855. this.watchForBadSeeking_ = function() {
  110856. _this.clearSeekingAppendCheck_();
  110857. setSeekingHandlers("on");
  110858. };
  110859. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  110860. this.tech_.on("seeking", this.watchForBadSeeking_);
  110861. this.tech_.on("waiting", waitingHandler);
  110862. this.tech_.on(timerCancelEvents, cancelTimerHandler);
  110863. this.tech_.on("canplay", canPlayHandler);
  110864. this.tech_.one("play", playHandler);
  110865. this.dispose = function() {
  110866. _this.clearSeekingAppendCheck_();
  110867. _this.logger_("dispose");
  110868. _this.tech_.off("waiting", waitingHandler);
  110869. _this.tech_.off(timerCancelEvents, cancelTimerHandler);
  110870. _this.tech_.off("canplay", canPlayHandler);
  110871. _this.tech_.off("play", playHandler);
  110872. _this.tech_.off("seeking", _this.watchForBadSeeking_);
  110873. _this.tech_.off("seeked", _this.clearSeekingAppendCheck_);
  110874. loaderTypes.forEach(function(type2) {
  110875. mpc[type2 + "SegmentLoader_"].off("appendsdone", loaderChecks[type2].updateend);
  110876. mpc[type2 + "SegmentLoader_"].off("playlistupdate", loaderChecks[type2].reset);
  110877. _this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  110878. });
  110879. if (_this.checkCurrentTimeTimeout_) {
  110880. window_1.clearTimeout(_this.checkCurrentTimeTimeout_);
  110881. }
  110882. _this.cancelTimer_();
  110883. };
  110884. }
  110885. var _proto = PlaybackWatcher2.prototype;
  110886. _proto.monitorCurrentTime_ = function monitorCurrentTime_() {
  110887. this.checkCurrentTime_();
  110888. if (this.checkCurrentTimeTimeout_) {
  110889. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  110890. }
  110891. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  110892. };
  110893. _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type2) {
  110894. var loader = this.masterPlaylistController_[type2 + "SegmentLoader_"];
  110895. if (this[type2 + "StalledDownloads_"] > 0) {
  110896. this.logger_("resetting possible stalled download count for " + type2 + " loader");
  110897. }
  110898. this[type2 + "StalledDownloads_"] = 0;
  110899. this[type2 + "Buffered_"] = loader.buffered_();
  110900. };
  110901. _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type2) {
  110902. var mpc = this.masterPlaylistController_;
  110903. var loader = mpc[type2 + "SegmentLoader_"];
  110904. var buffered = loader.buffered_();
  110905. var isBufferedDifferent = isRangeDifferent(this[type2 + "Buffered_"], buffered);
  110906. this[type2 + "Buffered_"] = buffered;
  110907. if (isBufferedDifferent) {
  110908. this.resetSegmentDownloads_(type2);
  110909. return;
  110910. }
  110911. this[type2 + "StalledDownloads_"]++;
  110912. this.logger_("found #" + this[type2 + "StalledDownloads_"] + " " + type2 + " appends that did not increase buffer (possible stalled download)", {
  110913. playlistId: loader.playlist_ && loader.playlist_.id,
  110914. buffered: timeRangesToArray(buffered)
  110915. });
  110916. if (this[type2 + "StalledDownloads_"] < 10) {
  110917. return;
  110918. }
  110919. this.logger_(type2 + " loader stalled download exclusion");
  110920. this.resetSegmentDownloads_(type2);
  110921. this.tech_.trigger({
  110922. type: "usage",
  110923. name: "vhs-" + type2 + "-download-exclusion"
  110924. });
  110925. if (type2 === "subtitle") {
  110926. return;
  110927. }
  110928. mpc.blacklistCurrentPlaylist({
  110929. message: "Excessive " + type2 + " segment downloading detected."
  110930. }, Infinity);
  110931. };
  110932. _proto.checkCurrentTime_ = function checkCurrentTime_() {
  110933. if (this.tech_.paused() || this.tech_.seeking()) {
  110934. return;
  110935. }
  110936. var currentTime = this.tech_.currentTime();
  110937. var buffered = this.tech_.buffered();
  110938. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {
  110939. return this.techWaiting_();
  110940. }
  110941. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  110942. this.consecutiveUpdates++;
  110943. this.waiting_();
  110944. } else if (currentTime === this.lastRecordedTime) {
  110945. this.consecutiveUpdates++;
  110946. } else {
  110947. this.consecutiveUpdates = 0;
  110948. this.lastRecordedTime = currentTime;
  110949. }
  110950. };
  110951. _proto.cancelTimer_ = function cancelTimer_() {
  110952. this.consecutiveUpdates = 0;
  110953. if (this.timer_) {
  110954. this.logger_("cancelTimer_");
  110955. clearTimeout(this.timer_);
  110956. }
  110957. this.timer_ = null;
  110958. };
  110959. _proto.fixesBadSeeks_ = function fixesBadSeeks_() {
  110960. var seeking = this.tech_.seeking();
  110961. if (!seeking) {
  110962. return false;
  110963. }
  110964. var seekable3 = this.seekable();
  110965. var currentTime = this.tech_.currentTime();
  110966. var isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  110967. var seekTo;
  110968. if (isAfterSeekableRange) {
  110969. var seekableEnd = seekable3.end(seekable3.length - 1);
  110970. seekTo = seekableEnd;
  110971. }
  110972. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  110973. var seekableStart = seekable3.start(0);
  110974. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA);
  110975. }
  110976. if (typeof seekTo !== "undefined") {
  110977. this.logger_("Trying to seek outside of seekable at time " + currentTime + " with " + ("seekable range " + printableRange(seekable3) + ". Seeking to ") + (seekTo + "."));
  110978. this.tech_.setCurrentTime(seekTo);
  110979. return true;
  110980. }
  110981. var sourceUpdater = this.masterPlaylistController_.sourceUpdater_;
  110982. var buffered = this.tech_.buffered();
  110983. var audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  110984. var videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  110985. var media = this.media();
  110986. var minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2;
  110987. var bufferedToCheck = [audioBuffered, videoBuffered];
  110988. for (var i2 = 0; i2 < bufferedToCheck.length; i2++) {
  110989. if (!bufferedToCheck[i2]) {
  110990. continue;
  110991. }
  110992. var timeAhead = timeAheadOf(bufferedToCheck[i2], currentTime);
  110993. if (timeAhead < minAppendedDuration) {
  110994. return false;
  110995. }
  110996. }
  110997. var nextRange = findNextRange(buffered, currentTime);
  110998. if (nextRange.length === 0) {
  110999. return false;
  111000. }
  111001. seekTo = nextRange.start(0) + SAFE_TIME_DELTA;
  111002. this.logger_("Buffered region starts (" + nextRange.start(0) + ") " + (" just beyond seek point (" + currentTime + "). Seeking to " + seekTo + "."));
  111003. this.tech_.setCurrentTime(seekTo);
  111004. return true;
  111005. };
  111006. _proto.waiting_ = function waiting_() {
  111007. if (this.techWaiting_()) {
  111008. return;
  111009. }
  111010. var currentTime = this.tech_.currentTime();
  111011. var buffered = this.tech_.buffered();
  111012. var currentRange = findRange(buffered, currentTime);
  111013. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  111014. this.cancelTimer_();
  111015. this.tech_.setCurrentTime(currentTime);
  111016. this.logger_("Stopped at " + currentTime + " while inside a buffered region " + ("[" + currentRange.start(0) + " -> " + currentRange.end(0) + "]. Attempting to resume ") + "playback by seeking to the current time.");
  111017. this.tech_.trigger({
  111018. type: "usage",
  111019. name: "vhs-unknown-waiting"
  111020. });
  111021. this.tech_.trigger({
  111022. type: "usage",
  111023. name: "hls-unknown-waiting"
  111024. });
  111025. return;
  111026. }
  111027. };
  111028. _proto.techWaiting_ = function techWaiting_() {
  111029. var seekable3 = this.seekable();
  111030. var currentTime = this.tech_.currentTime();
  111031. if (this.tech_.seeking() || this.timer_ !== null) {
  111032. return true;
  111033. }
  111034. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  111035. var livePoint = seekable3.end(seekable3.length - 1);
  111036. this.logger_("Fell out of live window at time " + currentTime + ". Seeking to " + ("live point (seekable end) " + livePoint));
  111037. this.cancelTimer_();
  111038. this.tech_.setCurrentTime(livePoint);
  111039. this.tech_.trigger({
  111040. type: "usage",
  111041. name: "vhs-live-resync"
  111042. });
  111043. this.tech_.trigger({
  111044. type: "usage",
  111045. name: "hls-live-resync"
  111046. });
  111047. return true;
  111048. }
  111049. var sourceUpdater = this.tech_.vhs.masterPlaylistController_.sourceUpdater_;
  111050. var buffered = this.tech_.buffered();
  111051. var videoUnderflow = this.videoUnderflow_({
  111052. audioBuffered: sourceUpdater.audioBuffered(),
  111053. videoBuffered: sourceUpdater.videoBuffered(),
  111054. currentTime
  111055. });
  111056. if (videoUnderflow) {
  111057. this.cancelTimer_();
  111058. this.tech_.setCurrentTime(currentTime);
  111059. this.tech_.trigger({
  111060. type: "usage",
  111061. name: "vhs-video-underflow"
  111062. });
  111063. this.tech_.trigger({
  111064. type: "usage",
  111065. name: "hls-video-underflow"
  111066. });
  111067. return true;
  111068. }
  111069. var nextRange = findNextRange(buffered, currentTime);
  111070. if (nextRange.length > 0) {
  111071. var difference = nextRange.start(0) - currentTime;
  111072. this.logger_("Stopped at " + currentTime + ", setting timer for " + difference + ", seeking " + ("to " + nextRange.start(0)));
  111073. this.cancelTimer_();
  111074. this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1e3, currentTime);
  111075. return true;
  111076. }
  111077. return false;
  111078. };
  111079. _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) {
  111080. if (allowSeeksWithinUnsafeLiveWindow === void 0) {
  111081. allowSeeksWithinUnsafeLiveWindow = false;
  111082. }
  111083. if (!seekable3.length) {
  111084. return false;
  111085. }
  111086. var allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA;
  111087. var isLive = !playlist.endList;
  111088. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  111089. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  111090. }
  111091. if (currentTime > allowedEnd) {
  111092. return true;
  111093. }
  111094. return false;
  111095. };
  111096. _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable3, currentTime) {
  111097. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  111098. return true;
  111099. }
  111100. return false;
  111101. };
  111102. _proto.videoUnderflow_ = function videoUnderflow_(_ref) {
  111103. var videoBuffered = _ref.videoBuffered, audioBuffered = _ref.audioBuffered, currentTime = _ref.currentTime;
  111104. if (!videoBuffered) {
  111105. return;
  111106. }
  111107. var gap;
  111108. if (videoBuffered.length && audioBuffered.length) {
  111109. var lastVideoRange = findRange(videoBuffered, currentTime - 3);
  111110. var videoRange = findRange(videoBuffered, currentTime);
  111111. var audioRange = findRange(audioBuffered, currentTime);
  111112. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  111113. gap = {
  111114. start: lastVideoRange.end(0),
  111115. end: audioRange.end(0)
  111116. };
  111117. }
  111118. } else {
  111119. var nextRange = findNextRange(videoBuffered, currentTime);
  111120. if (!nextRange.length) {
  111121. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  111122. }
  111123. }
  111124. if (gap) {
  111125. this.logger_("Encountered a gap in video from " + gap.start + " to " + gap.end + ". " + ("Seeking to current time " + currentTime));
  111126. return true;
  111127. }
  111128. return false;
  111129. };
  111130. _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) {
  111131. var buffered = this.tech_.buffered();
  111132. var currentTime = this.tech_.currentTime();
  111133. var nextRange = findNextRange(buffered, currentTime);
  111134. this.cancelTimer_();
  111135. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  111136. return;
  111137. }
  111138. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  111139. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);
  111140. this.tech_.trigger({
  111141. type: "usage",
  111142. name: "vhs-gap-skip"
  111143. });
  111144. this.tech_.trigger({
  111145. type: "usage",
  111146. name: "hls-gap-skip"
  111147. });
  111148. };
  111149. _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) {
  111150. var gaps = findGaps(buffered);
  111151. for (var i2 = 0; i2 < gaps.length; i2++) {
  111152. var start2 = gaps.start(i2);
  111153. var end = gaps.end(i2);
  111154. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  111155. return {
  111156. start: start2,
  111157. end
  111158. };
  111159. }
  111160. }
  111161. return null;
  111162. };
  111163. return PlaybackWatcher2;
  111164. }();
  111165. var defaultOptions = {
  111166. errorInterval: 30,
  111167. getSource: function getSource(next) {
  111168. var tech = this.tech({
  111169. IWillNotUseThisInPlugins: true
  111170. });
  111171. var sourceObj = tech.currentSource_ || this.currentSource();
  111172. return next(sourceObj);
  111173. }
  111174. };
  111175. var initPlugin = function initPlugin2(player, options2) {
  111176. var lastCalled = 0;
  111177. var seekTo = 0;
  111178. var localOptions = videojs.mergeOptions(defaultOptions, options2);
  111179. player.ready(function() {
  111180. player.trigger({
  111181. type: "usage",
  111182. name: "vhs-error-reload-initialized"
  111183. });
  111184. player.trigger({
  111185. type: "usage",
  111186. name: "hls-error-reload-initialized"
  111187. });
  111188. });
  111189. var loadedMetadataHandler = function loadedMetadataHandler2() {
  111190. if (seekTo) {
  111191. player.currentTime(seekTo);
  111192. }
  111193. };
  111194. var setSource2 = function setSource3(sourceObj) {
  111195. if (sourceObj === null || sourceObj === void 0) {
  111196. return;
  111197. }
  111198. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  111199. player.one("loadedmetadata", loadedMetadataHandler);
  111200. player.src(sourceObj);
  111201. player.trigger({
  111202. type: "usage",
  111203. name: "vhs-error-reload"
  111204. });
  111205. player.trigger({
  111206. type: "usage",
  111207. name: "hls-error-reload"
  111208. });
  111209. player.play();
  111210. };
  111211. var errorHandler = function errorHandler2() {
  111212. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  111213. player.trigger({
  111214. type: "usage",
  111215. name: "vhs-error-reload-canceled"
  111216. });
  111217. player.trigger({
  111218. type: "usage",
  111219. name: "hls-error-reload-canceled"
  111220. });
  111221. return;
  111222. }
  111223. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  111224. videojs.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  111225. return;
  111226. }
  111227. lastCalled = Date.now();
  111228. return localOptions.getSource.call(player, setSource2);
  111229. };
  111230. var cleanupEvents = function cleanupEvents2() {
  111231. player.off("loadedmetadata", loadedMetadataHandler);
  111232. player.off("error", errorHandler);
  111233. player.off("dispose", cleanupEvents2);
  111234. };
  111235. var reinitPlugin = function reinitPlugin2(newOptions) {
  111236. cleanupEvents();
  111237. initPlugin2(player, newOptions);
  111238. };
  111239. player.on("error", errorHandler);
  111240. player.on("dispose", cleanupEvents);
  111241. player.reloadSourceOnError = reinitPlugin;
  111242. };
  111243. var reloadSourceOnError = function reloadSourceOnError2(options2) {
  111244. initPlugin(this, options2);
  111245. };
  111246. var version$4 = "2.16.2";
  111247. var version$3 = "6.0.1";
  111248. var version$2 = "0.22.1";
  111249. var version$1$1 = "4.8.0";
  111250. var version$6 = "3.1.3";
  111251. var Vhs = {
  111252. PlaylistLoader,
  111253. Playlist,
  111254. utils,
  111255. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,
  111256. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,
  111257. lastBandwidthSelector,
  111258. movingAverageBandwidthSelector,
  111259. comparePlaylistBandwidth,
  111260. comparePlaylistResolution,
  111261. xhr: xhrFactory()
  111262. };
  111263. Object.keys(Config).forEach(function(prop) {
  111264. Object.defineProperty(Vhs, prop, {
  111265. get: function get7() {
  111266. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111267. return Config[prop];
  111268. },
  111269. set: function set4(value) {
  111270. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111271. if (typeof value !== "number" || value < 0) {
  111272. videojs.log.warn("value of Vhs." + prop + " must be greater than or equal to 0");
  111273. return;
  111274. }
  111275. Config[prop] = value;
  111276. }
  111277. });
  111278. });
  111279. var LOCAL_STORAGE_KEY = "videojs-vhs";
  111280. var handleVhsMediaChange = function handleVhsMediaChange2(qualityLevels2, playlistLoader) {
  111281. var newPlaylist = playlistLoader.media();
  111282. var selectedIndex = -1;
  111283. for (var i2 = 0; i2 < qualityLevels2.length; i2++) {
  111284. if (qualityLevels2[i2].id === newPlaylist.id) {
  111285. selectedIndex = i2;
  111286. break;
  111287. }
  111288. }
  111289. qualityLevels2.selectedIndex_ = selectedIndex;
  111290. qualityLevels2.trigger({
  111291. selectedIndex,
  111292. type: "change"
  111293. });
  111294. };
  111295. var handleVhsLoadedMetadata = function handleVhsLoadedMetadata2(qualityLevels2, vhs) {
  111296. vhs.representations().forEach(function(rep2) {
  111297. qualityLevels2.addQualityLevel(rep2);
  111298. });
  111299. handleVhsMediaChange(qualityLevels2, vhs.playlists);
  111300. };
  111301. Vhs.canPlaySource = function() {
  111302. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111303. };
  111304. var emeKeySystems = function emeKeySystems2(keySystemOptions, mainPlaylist, audioPlaylist) {
  111305. if (!keySystemOptions) {
  111306. return keySystemOptions;
  111307. }
  111308. var codecs = {};
  111309. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  111310. codecs = unwrapCodecList(parseCodecs2(mainPlaylist.attributes.CODECS));
  111311. }
  111312. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  111313. codecs.audio = audioPlaylist.attributes.CODECS;
  111314. }
  111315. var videoContentType = getMimeForCodec2(codecs.video);
  111316. var audioContentType = getMimeForCodec2(codecs.audio);
  111317. var keySystemContentTypes = {};
  111318. for (var keySystem in keySystemOptions) {
  111319. keySystemContentTypes[keySystem] = {};
  111320. if (audioContentType) {
  111321. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  111322. }
  111323. if (videoContentType) {
  111324. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  111325. }
  111326. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  111327. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  111328. }
  111329. if (typeof keySystemOptions[keySystem] === "string") {
  111330. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  111331. }
  111332. }
  111333. return videojs.mergeOptions(keySystemOptions, keySystemContentTypes);
  111334. };
  111335. var getAllPsshKeySystemsOptions = function getAllPsshKeySystemsOptions2(playlists, keySystems) {
  111336. return playlists.reduce(function(keySystemsArr, playlist) {
  111337. if (!playlist.contentProtection) {
  111338. return keySystemsArr;
  111339. }
  111340. var keySystemsOptions = keySystems.reduce(function(keySystemsObj, keySystem) {
  111341. var keySystemOptions = playlist.contentProtection[keySystem];
  111342. if (keySystemOptions && keySystemOptions.pssh) {
  111343. keySystemsObj[keySystem] = {
  111344. pssh: keySystemOptions.pssh
  111345. };
  111346. }
  111347. return keySystemsObj;
  111348. }, {});
  111349. if (Object.keys(keySystemsOptions).length) {
  111350. keySystemsArr.push(keySystemsOptions);
  111351. }
  111352. return keySystemsArr;
  111353. }, []);
  111354. };
  111355. var waitForKeySessionCreation = function waitForKeySessionCreation2(_ref) {
  111356. var player = _ref.player, sourceKeySystems = _ref.sourceKeySystems, audioMedia = _ref.audioMedia, mainPlaylists = _ref.mainPlaylists;
  111357. if (!player.eme.initializeMediaKeys) {
  111358. return Promise.resolve();
  111359. }
  111360. var playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  111361. var keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));
  111362. var initializationFinishedPromises = [];
  111363. var keySessionCreatedPromises = [];
  111364. keySystemsOptionsArr.forEach(function(keySystemsOptions) {
  111365. keySessionCreatedPromises.push(new Promise(function(resolve2, reject2) {
  111366. player.tech_.one("keysessioncreated", resolve2);
  111367. }));
  111368. initializationFinishedPromises.push(new Promise(function(resolve2, reject2) {
  111369. player.eme.initializeMediaKeys({
  111370. keySystems: keySystemsOptions
  111371. }, function(err) {
  111372. if (err) {
  111373. reject2(err);
  111374. return;
  111375. }
  111376. resolve2();
  111377. });
  111378. }));
  111379. });
  111380. return Promise.race([
  111381. Promise.all(initializationFinishedPromises),
  111382. Promise.race(keySessionCreatedPromises)
  111383. ]);
  111384. };
  111385. var setupEmeOptions = function setupEmeOptions2(_ref2) {
  111386. var player = _ref2.player, sourceKeySystems = _ref2.sourceKeySystems, media = _ref2.media, audioMedia = _ref2.audioMedia;
  111387. var sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);
  111388. if (!sourceOptions) {
  111389. return false;
  111390. }
  111391. player.currentSource().keySystems = sourceOptions;
  111392. if (sourceOptions && !player.eme) {
  111393. videojs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  111394. return false;
  111395. }
  111396. return true;
  111397. };
  111398. var getVhsLocalStorage = function getVhsLocalStorage2() {
  111399. if (!window_1.localStorage) {
  111400. return null;
  111401. }
  111402. var storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY);
  111403. if (!storedObject) {
  111404. return null;
  111405. }
  111406. try {
  111407. return JSON.parse(storedObject);
  111408. } catch (e) {
  111409. return null;
  111410. }
  111411. };
  111412. var updateVhsLocalStorage = function updateVhsLocalStorage2(options2) {
  111413. if (!window_1.localStorage) {
  111414. return false;
  111415. }
  111416. var objectToStore = getVhsLocalStorage();
  111417. objectToStore = objectToStore ? videojs.mergeOptions(objectToStore, options2) : options2;
  111418. try {
  111419. window_1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));
  111420. } catch (e) {
  111421. return false;
  111422. }
  111423. return objectToStore;
  111424. };
  111425. var expandDataUri = function expandDataUri2(dataUri) {
  111426. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  111427. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  111428. }
  111429. return dataUri;
  111430. };
  111431. Vhs.supportsNativeHls = function() {
  111432. if (!document_1 || !document_1.createElement) {
  111433. return false;
  111434. }
  111435. var video = document_1.createElement("video");
  111436. if (!videojs.getTech("Html5").isSupported()) {
  111437. return false;
  111438. }
  111439. var canPlay = [
  111440. "application/vnd.apple.mpegurl",
  111441. "audio/mpegurl",
  111442. "audio/x-mpegurl",
  111443. "application/x-mpegurl",
  111444. "video/x-mpegurl",
  111445. "video/mpegurl",
  111446. "application/mpegurl"
  111447. ];
  111448. return canPlay.some(function(canItPlay) {
  111449. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  111450. });
  111451. }();
  111452. Vhs.supportsNativeDash = function() {
  111453. if (!document_1 || !document_1.createElement || !videojs.getTech("Html5").isSupported()) {
  111454. return false;
  111455. }
  111456. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  111457. }();
  111458. Vhs.supportsTypeNatively = function(type2) {
  111459. if (type2 === "hls") {
  111460. return Vhs.supportsNativeHls;
  111461. }
  111462. if (type2 === "dash") {
  111463. return Vhs.supportsNativeDash;
  111464. }
  111465. return false;
  111466. };
  111467. Vhs.isSupported = function() {
  111468. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111469. };
  111470. var Component = videojs.getComponent("Component");
  111471. var VhsHandler = /* @__PURE__ */ function(_Component) {
  111472. _inheritsLoose(VhsHandler2, _Component);
  111473. function VhsHandler2(source, tech, options2) {
  111474. var _this;
  111475. _this = _Component.call(this, tech, videojs.mergeOptions(options2.hls, options2.vhs)) || this;
  111476. if (options2.hls && Object.keys(options2.hls).length) {
  111477. videojs.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object.");
  111478. }
  111479. if (typeof options2.initialBandwidth === "number") {
  111480. _this.options_.bandwidth = options2.initialBandwidth;
  111481. }
  111482. _this.logger_ = logger("VhsHandler");
  111483. if (tech.options_ && tech.options_.playerId) {
  111484. var _player = videojs(tech.options_.playerId);
  111485. if (!_player.hasOwnProperty("hls")) {
  111486. Object.defineProperty(_player, "hls", {
  111487. get: function get7() {
  111488. videojs.log.warn("player.hls is deprecated. Use player.tech().vhs instead.");
  111489. tech.trigger({
  111490. type: "usage",
  111491. name: "hls-player-access"
  111492. });
  111493. return _assertThisInitialized(_this);
  111494. },
  111495. configurable: true
  111496. });
  111497. }
  111498. if (!_player.hasOwnProperty("vhs")) {
  111499. Object.defineProperty(_player, "vhs", {
  111500. get: function get7() {
  111501. videojs.log.warn("player.vhs is deprecated. Use player.tech().vhs instead.");
  111502. tech.trigger({
  111503. type: "usage",
  111504. name: "vhs-player-access"
  111505. });
  111506. return _assertThisInitialized(_this);
  111507. },
  111508. configurable: true
  111509. });
  111510. }
  111511. if (!_player.hasOwnProperty("dash")) {
  111512. Object.defineProperty(_player, "dash", {
  111513. get: function get7() {
  111514. videojs.log.warn("player.dash is deprecated. Use player.tech().vhs instead.");
  111515. return _assertThisInitialized(_this);
  111516. },
  111517. configurable: true
  111518. });
  111519. }
  111520. _this.player_ = _player;
  111521. }
  111522. _this.tech_ = tech;
  111523. _this.source_ = source;
  111524. _this.stats = {};
  111525. _this.ignoreNextSeekingEvent_ = false;
  111526. _this.setOptions_();
  111527. if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  111528. tech.overrideNativeAudioTracks(true);
  111529. tech.overrideNativeVideoTracks(true);
  111530. } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  111531. throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");
  111532. }
  111533. _this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], function(event2) {
  111534. var fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  111535. if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {
  111536. _this.masterPlaylistController_.fastQualityChange_();
  111537. } else {
  111538. _this.masterPlaylistController_.checkABR_();
  111539. }
  111540. });
  111541. _this.on(_this.tech_, "seeking", function() {
  111542. if (this.ignoreNextSeekingEvent_) {
  111543. this.ignoreNextSeekingEvent_ = false;
  111544. return;
  111545. }
  111546. this.setCurrentTime(this.tech_.currentTime());
  111547. });
  111548. _this.on(_this.tech_, "error", function() {
  111549. if (this.tech_.error() && this.masterPlaylistController_) {
  111550. this.masterPlaylistController_.pauseLoading();
  111551. }
  111552. });
  111553. _this.on(_this.tech_, "play", _this.play);
  111554. return _this;
  111555. }
  111556. var _proto = VhsHandler2.prototype;
  111557. _proto.setOptions_ = function setOptions_() {
  111558. var _this2 = this;
  111559. this.options_.withCredentials = this.options_.withCredentials || false;
  111560. this.options_.handleManifestRedirects = this.options_.handleManifestRedirects === false ? false : true;
  111561. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  111562. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  111563. this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;
  111564. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  111565. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  111566. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  111567. this.options_.customTagParsers = this.options_.customTagParsers || [];
  111568. this.options_.customTagMappers = this.options_.customTagMappers || [];
  111569. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  111570. if (typeof this.options_.blacklistDuration !== "number") {
  111571. this.options_.blacklistDuration = 5 * 60;
  111572. }
  111573. if (typeof this.options_.bandwidth !== "number") {
  111574. if (this.options_.useBandwidthFromLocalStorage) {
  111575. var storedObject = getVhsLocalStorage();
  111576. if (storedObject && storedObject.bandwidth) {
  111577. this.options_.bandwidth = storedObject.bandwidth;
  111578. this.tech_.trigger({
  111579. type: "usage",
  111580. name: "vhs-bandwidth-from-local-storage"
  111581. });
  111582. this.tech_.trigger({
  111583. type: "usage",
  111584. name: "hls-bandwidth-from-local-storage"
  111585. });
  111586. }
  111587. if (storedObject && storedObject.throughput) {
  111588. this.options_.throughput = storedObject.throughput;
  111589. this.tech_.trigger({
  111590. type: "usage",
  111591. name: "vhs-throughput-from-local-storage"
  111592. });
  111593. this.tech_.trigger({
  111594. type: "usage",
  111595. name: "hls-throughput-from-local-storage"
  111596. });
  111597. }
  111598. }
  111599. }
  111600. if (typeof this.options_.bandwidth !== "number") {
  111601. this.options_.bandwidth = Config.INITIAL_BANDWIDTH;
  111602. }
  111603. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH;
  111604. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "smoothQualityChange", "customTagParsers", "customTagMappers", "handleManifestRedirects", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "experimentalBufferBasedABR", "liveRangeSafeTimeDelta", "experimentalLLHLS", "useNetworkInformationApi", "useDtsForTimestampOffset", "experimentalExactManifestTimings", "experimentalLeastPixelDiffSelector"].forEach(function(option) {
  111605. if (typeof _this2.source_[option] !== "undefined") {
  111606. _this2.options_[option] = _this2.source_[option];
  111607. }
  111608. });
  111609. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  111610. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  111611. };
  111612. _proto.src = function src(_src, type2) {
  111613. var _this3 = this;
  111614. if (!_src) {
  111615. return;
  111616. }
  111617. this.setOptions_();
  111618. this.options_.src = expandDataUri(this.source_.src);
  111619. this.options_.tech = this.tech_;
  111620. this.options_.externVhs = Vhs;
  111621. this.options_.sourceType = simpleTypeFromSourceType2(type2);
  111622. this.options_.seekTo = function(time) {
  111623. _this3.tech_.setCurrentTime(time);
  111624. };
  111625. if (this.options_.smoothQualityChange) {
  111626. videojs.log.warn("smoothQualityChange is deprecated and will be removed in the next major version");
  111627. }
  111628. this.masterPlaylistController_ = new MasterPlaylistController(this.options_);
  111629. var playbackWatcherOptions = videojs.mergeOptions({
  111630. liveRangeSafeTimeDelta: SAFE_TIME_DELTA
  111631. }, this.options_, {
  111632. seekable: function seekable3() {
  111633. return _this3.seekable();
  111634. },
  111635. media: function media() {
  111636. return _this3.masterPlaylistController_.media();
  111637. },
  111638. masterPlaylistController: this.masterPlaylistController_
  111639. });
  111640. this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);
  111641. this.masterPlaylistController_.on("error", function() {
  111642. var player = videojs.players[_this3.tech_.options_.playerId];
  111643. var error = _this3.masterPlaylistController_.error;
  111644. if (typeof error === "object" && !error.code) {
  111645. error.code = 3;
  111646. } else if (typeof error === "string") {
  111647. error = {
  111648. message: error,
  111649. code: 3
  111650. };
  111651. }
  111652. player.error(error);
  111653. });
  111654. var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR;
  111655. this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  111656. this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this);
  111657. this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;
  111658. this.mediaSource = this.masterPlaylistController_.mediaSource;
  111659. Object.defineProperties(this, {
  111660. selectPlaylist: {
  111661. get: function get7() {
  111662. return this.masterPlaylistController_.selectPlaylist;
  111663. },
  111664. set: function set4(selectPlaylist) {
  111665. this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);
  111666. }
  111667. },
  111668. throughput: {
  111669. get: function get7() {
  111670. return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;
  111671. },
  111672. set: function set4(throughput) {
  111673. this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput;
  111674. this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;
  111675. }
  111676. },
  111677. bandwidth: {
  111678. get: function get7() {
  111679. var playerBandwidthEst = this.masterPlaylistController_.mainSegmentLoader_.bandwidth;
  111680. var networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  111681. var tenMbpsAsBitsPerSecond = 1e7;
  111682. if (this.options_.useNetworkInformationApi && networkInformation) {
  111683. var networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  111684. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  111685. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  111686. } else {
  111687. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  111688. }
  111689. }
  111690. return playerBandwidthEst;
  111691. },
  111692. set: function set4(bandwidth2) {
  111693. this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  111694. this.masterPlaylistController_.mainSegmentLoader_.throughput = {
  111695. rate: 0,
  111696. count: 0
  111697. };
  111698. }
  111699. },
  111700. systemBandwidth: {
  111701. get: function get7() {
  111702. var invBandwidth = 1 / (this.bandwidth || 1);
  111703. var invThroughput;
  111704. if (this.throughput > 0) {
  111705. invThroughput = 1 / this.throughput;
  111706. } else {
  111707. invThroughput = 0;
  111708. }
  111709. var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  111710. return systemBitrate;
  111711. },
  111712. set: function set4() {
  111713. videojs.log.error('The "systemBandwidth" property is read-only');
  111714. }
  111715. }
  111716. });
  111717. if (this.options_.bandwidth) {
  111718. this.bandwidth = this.options_.bandwidth;
  111719. }
  111720. if (this.options_.throughput) {
  111721. this.throughput = this.options_.throughput;
  111722. }
  111723. Object.defineProperties(this.stats, {
  111724. bandwidth: {
  111725. get: function get7() {
  111726. return _this3.bandwidth || 0;
  111727. },
  111728. enumerable: true
  111729. },
  111730. mediaRequests: {
  111731. get: function get7() {
  111732. return _this3.masterPlaylistController_.mediaRequests_() || 0;
  111733. },
  111734. enumerable: true
  111735. },
  111736. mediaRequestsAborted: {
  111737. get: function get7() {
  111738. return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;
  111739. },
  111740. enumerable: true
  111741. },
  111742. mediaRequestsTimedout: {
  111743. get: function get7() {
  111744. return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;
  111745. },
  111746. enumerable: true
  111747. },
  111748. mediaRequestsErrored: {
  111749. get: function get7() {
  111750. return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;
  111751. },
  111752. enumerable: true
  111753. },
  111754. mediaTransferDuration: {
  111755. get: function get7() {
  111756. return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;
  111757. },
  111758. enumerable: true
  111759. },
  111760. mediaBytesTransferred: {
  111761. get: function get7() {
  111762. return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;
  111763. },
  111764. enumerable: true
  111765. },
  111766. mediaSecondsLoaded: {
  111767. get: function get7() {
  111768. return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;
  111769. },
  111770. enumerable: true
  111771. },
  111772. mediaAppends: {
  111773. get: function get7() {
  111774. return _this3.masterPlaylistController_.mediaAppends_() || 0;
  111775. },
  111776. enumerable: true
  111777. },
  111778. mainAppendsToLoadedData: {
  111779. get: function get7() {
  111780. return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0;
  111781. },
  111782. enumerable: true
  111783. },
  111784. audioAppendsToLoadedData: {
  111785. get: function get7() {
  111786. return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0;
  111787. },
  111788. enumerable: true
  111789. },
  111790. appendsToLoadedData: {
  111791. get: function get7() {
  111792. return _this3.masterPlaylistController_.appendsToLoadedData_() || 0;
  111793. },
  111794. enumerable: true
  111795. },
  111796. timeToLoadedData: {
  111797. get: function get7() {
  111798. return _this3.masterPlaylistController_.timeToLoadedData_() || 0;
  111799. },
  111800. enumerable: true
  111801. },
  111802. buffered: {
  111803. get: function get7() {
  111804. return timeRangesToArray(_this3.tech_.buffered());
  111805. },
  111806. enumerable: true
  111807. },
  111808. currentTime: {
  111809. get: function get7() {
  111810. return _this3.tech_.currentTime();
  111811. },
  111812. enumerable: true
  111813. },
  111814. currentSource: {
  111815. get: function get7() {
  111816. return _this3.tech_.currentSource_;
  111817. },
  111818. enumerable: true
  111819. },
  111820. currentTech: {
  111821. get: function get7() {
  111822. return _this3.tech_.name_;
  111823. },
  111824. enumerable: true
  111825. },
  111826. duration: {
  111827. get: function get7() {
  111828. return _this3.tech_.duration();
  111829. },
  111830. enumerable: true
  111831. },
  111832. master: {
  111833. get: function get7() {
  111834. return _this3.playlists.master;
  111835. },
  111836. enumerable: true
  111837. },
  111838. playerDimensions: {
  111839. get: function get7() {
  111840. return _this3.tech_.currentDimensions();
  111841. },
  111842. enumerable: true
  111843. },
  111844. seekable: {
  111845. get: function get7() {
  111846. return timeRangesToArray(_this3.tech_.seekable());
  111847. },
  111848. enumerable: true
  111849. },
  111850. timestamp: {
  111851. get: function get7() {
  111852. return Date.now();
  111853. },
  111854. enumerable: true
  111855. },
  111856. videoPlaybackQuality: {
  111857. get: function get7() {
  111858. return _this3.tech_.getVideoPlaybackQuality();
  111859. },
  111860. enumerable: true
  111861. }
  111862. });
  111863. this.tech_.one("canplay", this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));
  111864. this.tech_.on("bandwidthupdate", function() {
  111865. if (_this3.options_.useBandwidthFromLocalStorage) {
  111866. updateVhsLocalStorage({
  111867. bandwidth: _this3.bandwidth,
  111868. throughput: Math.round(_this3.throughput)
  111869. });
  111870. }
  111871. });
  111872. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  111873. renditionSelectionMixin(_this3);
  111874. });
  111875. this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers", function() {
  111876. _this3.setupEme_();
  111877. });
  111878. this.on(this.masterPlaylistController_, "progress", function() {
  111879. this.tech_.trigger("progress");
  111880. });
  111881. this.on(this.masterPlaylistController_, "firstplay", function() {
  111882. this.ignoreNextSeekingEvent_ = true;
  111883. });
  111884. this.setupQualityLevels_();
  111885. if (!this.tech_.el()) {
  111886. return;
  111887. }
  111888. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.masterPlaylistController_.mediaSource);
  111889. this.tech_.src(this.mediaSourceUrl_);
  111890. };
  111891. _proto.createKeySessions_ = function createKeySessions_() {
  111892. var _this4 = this;
  111893. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111894. this.logger_("waiting for EME key session creation");
  111895. waitForKeySessionCreation({
  111896. player: this.player_,
  111897. sourceKeySystems: this.source_.keySystems,
  111898. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  111899. mainPlaylists: this.playlists.master.playlists
  111900. }).then(function() {
  111901. _this4.logger_("created EME key session");
  111902. _this4.masterPlaylistController_.sourceUpdater_.initializedEme();
  111903. })["catch"](function(err) {
  111904. _this4.logger_("error while creating EME key session", err);
  111905. _this4.player_.error({
  111906. message: "Failed to initialize media keys for EME",
  111907. code: 3
  111908. });
  111909. });
  111910. };
  111911. _proto.handleWaitingForKey_ = function handleWaitingForKey_() {
  111912. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  111913. this.createKeySessions_();
  111914. };
  111915. _proto.setupEme_ = function setupEme_() {
  111916. var _this5 = this;
  111917. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111918. var didSetupEmeOptions = setupEmeOptions({
  111919. player: this.player_,
  111920. sourceKeySystems: this.source_.keySystems,
  111921. media: this.playlists.media(),
  111922. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  111923. });
  111924. this.player_.tech_.on("keystatuschange", function(e) {
  111925. if (e.status !== "output-restricted") {
  111926. return;
  111927. }
  111928. var masterPlaylist = _this5.masterPlaylistController_.master();
  111929. if (!masterPlaylist || !masterPlaylist.playlists) {
  111930. return;
  111931. }
  111932. var excludedHDPlaylists = [];
  111933. masterPlaylist.playlists.forEach(function(playlist) {
  111934. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  111935. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  111936. playlist.excludeUntil = Infinity;
  111937. excludedHDPlaylists.push(playlist);
  111938. }
  111939. }
  111940. });
  111941. if (excludedHDPlaylists.length) {
  111942. var _videojs$log;
  111943. (_videojs$log = videojs.log).warn.apply(_videojs$log, ['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(excludedHDPlaylists));
  111944. _this5.masterPlaylistController_.fastQualityChange_();
  111945. }
  111946. });
  111947. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  111948. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  111949. if (videojs.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  111950. this.masterPlaylistController_.sourceUpdater_.initializedEme();
  111951. return;
  111952. }
  111953. this.createKeySessions_();
  111954. };
  111955. _proto.setupQualityLevels_ = function setupQualityLevels_() {
  111956. var _this6 = this;
  111957. var player = videojs.players[this.tech_.options_.playerId];
  111958. if (!player || !player.qualityLevels || this.qualityLevels_) {
  111959. return;
  111960. }
  111961. this.qualityLevels_ = player.qualityLevels();
  111962. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  111963. handleVhsLoadedMetadata(_this6.qualityLevels_, _this6);
  111964. });
  111965. this.playlists.on("mediachange", function() {
  111966. handleVhsMediaChange(_this6.qualityLevels_, _this6.playlists);
  111967. });
  111968. };
  111969. VhsHandler2.version = function version$52() {
  111970. return {
  111971. "@videojs/http-streaming": version$4,
  111972. "mux.js": version$3,
  111973. "mpd-parser": version$2,
  111974. "m3u8-parser": version$1$1,
  111975. "aes-decrypter": version$6
  111976. };
  111977. };
  111978. _proto.version = function version2() {
  111979. return this.constructor.version();
  111980. };
  111981. _proto.canChangeType = function canChangeType() {
  111982. return SourceUpdater.canChangeType();
  111983. };
  111984. _proto.play = function play() {
  111985. this.masterPlaylistController_.play();
  111986. };
  111987. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  111988. this.masterPlaylistController_.setCurrentTime(currentTime);
  111989. };
  111990. _proto.duration = function duration5() {
  111991. return this.masterPlaylistController_.duration();
  111992. };
  111993. _proto.seekable = function seekable3() {
  111994. return this.masterPlaylistController_.seekable();
  111995. };
  111996. _proto.dispose = function dispose() {
  111997. if (this.playbackWatcher_) {
  111998. this.playbackWatcher_.dispose();
  111999. }
  112000. if (this.masterPlaylistController_) {
  112001. this.masterPlaylistController_.dispose();
  112002. }
  112003. if (this.qualityLevels_) {
  112004. this.qualityLevels_.dispose();
  112005. }
  112006. if (this.player_) {
  112007. delete this.player_.vhs;
  112008. delete this.player_.dash;
  112009. delete this.player_.hls;
  112010. }
  112011. if (this.tech_ && this.tech_.vhs) {
  112012. delete this.tech_.vhs;
  112013. }
  112014. if (this.tech_) {
  112015. delete this.tech_.hls;
  112016. }
  112017. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  112018. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  112019. this.mediaSourceUrl_ = null;
  112020. }
  112021. if (this.tech_) {
  112022. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  112023. }
  112024. _Component.prototype.dispose.call(this);
  112025. };
  112026. _proto.convertToProgramTime = function convertToProgramTime(time, callback2) {
  112027. return getProgramTime({
  112028. playlist: this.masterPlaylistController_.media(),
  112029. time,
  112030. callback: callback2
  112031. });
  112032. };
  112033. _proto.seekToProgramTime = function seekToProgramTime$12(programTime, callback2, pauseAfterSeek, retryCount) {
  112034. if (pauseAfterSeek === void 0) {
  112035. pauseAfterSeek = true;
  112036. }
  112037. if (retryCount === void 0) {
  112038. retryCount = 2;
  112039. }
  112040. return seekToProgramTime({
  112041. programTime,
  112042. playlist: this.masterPlaylistController_.media(),
  112043. retryCount,
  112044. pauseAfterSeek,
  112045. seekTo: this.options_.seekTo,
  112046. tech: this.options_.tech,
  112047. callback: callback2
  112048. });
  112049. };
  112050. return VhsHandler2;
  112051. }(Component);
  112052. var VhsSourceHandler = {
  112053. name: "videojs-http-streaming",
  112054. VERSION: version$4,
  112055. canHandleSource: function canHandleSource(srcObj, options2) {
  112056. if (options2 === void 0) {
  112057. options2 = {};
  112058. }
  112059. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112060. return VhsSourceHandler.canPlayType(srcObj.type, localOptions);
  112061. },
  112062. handleSource: function handleSource(source, tech, options2) {
  112063. if (options2 === void 0) {
  112064. options2 = {};
  112065. }
  112066. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112067. tech.vhs = new VhsHandler(source, tech, localOptions);
  112068. if (!videojs.hasOwnProperty("hls")) {
  112069. Object.defineProperty(tech, "hls", {
  112070. get: function get7() {
  112071. videojs.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead.");
  112072. return tech.vhs;
  112073. },
  112074. configurable: true
  112075. });
  112076. }
  112077. tech.vhs.xhr = xhrFactory();
  112078. tech.vhs.src(source.src, source.type);
  112079. return tech.vhs;
  112080. },
  112081. canPlayType: function canPlayType2(type2, options2) {
  112082. var simpleType = simpleTypeFromSourceType2(type2);
  112083. if (!simpleType) {
  112084. return "";
  112085. }
  112086. var overrideNative = VhsSourceHandler.getOverrideNative(options2);
  112087. var supportsTypeNatively = Vhs.supportsTypeNatively(simpleType);
  112088. var canUseMsePlayback = !supportsTypeNatively || overrideNative;
  112089. return canUseMsePlayback ? "maybe" : "";
  112090. },
  112091. getOverrideNative: function getOverrideNative(options2) {
  112092. if (options2 === void 0) {
  112093. options2 = {};
  112094. }
  112095. var _options = options2, _options$vhs = _options.vhs, vhs = _options$vhs === void 0 ? {} : _options$vhs, _options$hls = _options.hls, hls = _options$hls === void 0 ? {} : _options$hls;
  112096. var defaultOverrideNative = !(videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS);
  112097. var _vhs$overrideNative = vhs.overrideNative, overrideNative = _vhs$overrideNative === void 0 ? defaultOverrideNative : _vhs$overrideNative;
  112098. var _hls$overrideNative = hls.overrideNative, legacyOverrideNative = _hls$overrideNative === void 0 ? false : _hls$overrideNative;
  112099. return legacyOverrideNative || overrideNative;
  112100. }
  112101. };
  112102. var supportsNativeMediaSources = function supportsNativeMediaSources2() {
  112103. return browserSupportsCodec2("avc1.4d400d,mp4a.40.2");
  112104. };
  112105. if (supportsNativeMediaSources()) {
  112106. videojs.getTech("Html5").registerSourceHandler(VhsSourceHandler, 0);
  112107. }
  112108. videojs.VhsHandler = VhsHandler;
  112109. Object.defineProperty(videojs, "HlsHandler", {
  112110. get: function get4() {
  112111. videojs.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.");
  112112. return VhsHandler;
  112113. },
  112114. configurable: true
  112115. });
  112116. videojs.VhsSourceHandler = VhsSourceHandler;
  112117. Object.defineProperty(videojs, "HlsSourceHandler", {
  112118. get: function get5() {
  112119. videojs.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead.");
  112120. return VhsSourceHandler;
  112121. },
  112122. configurable: true
  112123. });
  112124. videojs.Vhs = Vhs;
  112125. Object.defineProperty(videojs, "Hls", {
  112126. get: function get6() {
  112127. videojs.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead.");
  112128. return Vhs;
  112129. },
  112130. configurable: true
  112131. });
  112132. if (!videojs.use) {
  112133. videojs.registerComponent("Hls", Vhs);
  112134. videojs.registerComponent("Vhs", Vhs);
  112135. }
  112136. videojs.options.vhs = videojs.options.vhs || {};
  112137. videojs.options.hls = videojs.options.hls || {};
  112138. if (!videojs.getPlugin || !videojs.getPlugin("reloadSourceOnError")) {
  112139. var registerPlugin = videojs.registerPlugin || videojs.plugin;
  112140. registerPlugin("reloadSourceOnError", reloadSourceOnError);
  112141. }
  112142. const version = "5.4.2";
  112143. var version$1 = "2.2.1";
  112144. function FlashRtmpDecorator(Flash2) {
  112145. Flash2.streamingFormats = {
  112146. "rtmp/mp4": "MP4",
  112147. "rtmp/flv": "FLV"
  112148. };
  112149. Flash2.streamFromParts = function(connection, stream) {
  112150. return connection + "&" + stream;
  112151. };
  112152. Flash2.streamToParts = function(src) {
  112153. var parts = {
  112154. connection: "",
  112155. stream: ""
  112156. };
  112157. if (!src) {
  112158. return parts;
  112159. }
  112160. var connEnd = src.search(/&(?![\w-]+=)/);
  112161. var streamBegin = void 0;
  112162. if (connEnd !== -1) {
  112163. streamBegin = connEnd + 1;
  112164. } else {
  112165. connEnd = streamBegin = src.lastIndexOf("/") + 1;
  112166. if (connEnd === 0) {
  112167. connEnd = streamBegin = src.length;
  112168. }
  112169. }
  112170. parts.connection = src.substring(0, connEnd);
  112171. parts.stream = src.substring(streamBegin, src.length);
  112172. return parts;
  112173. };
  112174. Flash2.isStreamingType = function(srcType) {
  112175. return srcType in Flash2.streamingFormats;
  112176. };
  112177. Flash2.RTMP_RE = /^rtmp[set]?:\/\//i;
  112178. Flash2.isStreamingSrc = function(src) {
  112179. return Flash2.RTMP_RE.test(src);
  112180. };
  112181. Flash2.rtmpSourceHandler = {};
  112182. Flash2.rtmpSourceHandler.canPlayType = function(type2) {
  112183. if (Flash2.isStreamingType(type2)) {
  112184. return "maybe";
  112185. }
  112186. return "";
  112187. };
  112188. Flash2.rtmpSourceHandler.canHandleSource = function(source, options2) {
  112189. var can = Flash2.rtmpSourceHandler.canPlayType(source.type);
  112190. if (can) {
  112191. return can;
  112192. }
  112193. if (Flash2.isStreamingSrc(source.src)) {
  112194. return "maybe";
  112195. }
  112196. return "";
  112197. };
  112198. Flash2.rtmpSourceHandler.handleSource = function(source, tech, options2) {
  112199. var srcParts = Flash2.streamToParts(source.src);
  112200. tech.setRtmpConnection(srcParts.connection);
  112201. tech.setRtmpStream(srcParts.stream);
  112202. };
  112203. Flash2.registerSourceHandler(Flash2.rtmpSourceHandler);
  112204. return Flash2;
  112205. }
  112206. var classCallCheck = function(instance, Constructor) {
  112207. if (!(instance instanceof Constructor)) {
  112208. throw new TypeError("Cannot call a class as a function");
  112209. }
  112210. };
  112211. var inherits = function(subClass, superClass) {
  112212. if (typeof superClass !== "function" && superClass !== null) {
  112213. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  112214. }
  112215. subClass.prototype = Object.create(superClass && superClass.prototype, {
  112216. constructor: {
  112217. value: subClass,
  112218. enumerable: false,
  112219. writable: true,
  112220. configurable: true
  112221. }
  112222. });
  112223. if (superClass)
  112224. Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  112225. };
  112226. var possibleConstructorReturn = function(self2, call) {
  112227. if (!self2) {
  112228. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  112229. }
  112230. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  112231. };
  112232. var Tech = videojs.getComponent("Tech");
  112233. var Dom = videojs.dom;
  112234. var Url = videojs.url;
  112235. var createTimeRange = videojs.createTimeRange;
  112236. var mergeOptions$1 = videojs.mergeOptions;
  112237. var navigator$1 = window_1 && window_1.navigator || {};
  112238. var Flash = function(_Tech) {
  112239. inherits(Flash2, _Tech);
  112240. function Flash2(options2, ready) {
  112241. classCallCheck(this, Flash2);
  112242. var _this = possibleConstructorReturn(this, _Tech.call(this, options2, ready));
  112243. if (options2.source) {
  112244. _this.ready(function() {
  112245. this.setSource(options2.source);
  112246. }, true);
  112247. }
  112248. if (options2.startTime) {
  112249. _this.ready(function() {
  112250. this.load();
  112251. this.play();
  112252. this.currentTime(options2.startTime);
  112253. }, true);
  112254. }
  112255. window_1.videojs = window_1.videojs || {};
  112256. window_1.videojs.Flash = window_1.videojs.Flash || {};
  112257. window_1.videojs.Flash.onReady = Flash2.onReady;
  112258. window_1.videojs.Flash.onEvent = Flash2.onEvent;
  112259. window_1.videojs.Flash.onError = Flash2.onError;
  112260. _this.on("seeked", function() {
  112261. this.lastSeekTarget_ = void 0;
  112262. });
  112263. return _this;
  112264. }
  112265. Flash2.prototype.createEl = function createEl2() {
  112266. var options2 = this.options_;
  112267. if (!options2.swf) {
  112268. options2.swf = "https://vjs.zencdn.net/swf/" + version + "/video-js.swf";
  112269. }
  112270. var objId = options2.techId;
  112271. var flashVars = mergeOptions$1({
  112272. readyFunction: "videojs.Flash.onReady",
  112273. eventProxyFunction: "videojs.Flash.onEvent",
  112274. errorEventProxyFunction: "videojs.Flash.onError",
  112275. autoplay: options2.autoplay,
  112276. preload: options2.preload,
  112277. loop: options2.loop,
  112278. muted: options2.muted
  112279. }, options2.flashVars);
  112280. var params = mergeOptions$1({
  112281. wmode: "opaque",
  112282. bgcolor: "#000000"
  112283. }, options2.params);
  112284. var attributes = mergeOptions$1({
  112285. id: objId,
  112286. name: objId,
  112287. "class": "vjs-tech"
  112288. }, options2.attributes);
  112289. this.el_ = Flash2.embed(options2.swf, flashVars, params, attributes);
  112290. this.el_.tech = this;
  112291. return this.el_;
  112292. };
  112293. Flash2.prototype.play = function play() {
  112294. if (this.ended()) {
  112295. this.setCurrentTime(0);
  112296. }
  112297. this.el_.vjs_play();
  112298. };
  112299. Flash2.prototype.pause = function pause() {
  112300. this.el_.vjs_pause();
  112301. };
  112302. Flash2.prototype.src = function src(_src) {
  112303. if (_src === void 0) {
  112304. return this.currentSrc();
  112305. }
  112306. return this.setSrc(_src);
  112307. };
  112308. Flash2.prototype.setSrc = function setSrc(src) {
  112309. var _this2 = this;
  112310. src = Url.getAbsoluteURL(src);
  112311. this.el_.vjs_src(src);
  112312. if (this.autoplay()) {
  112313. this.setTimeout(function() {
  112314. return _this2.play();
  112315. }, 0);
  112316. }
  112317. };
  112318. Flash2.prototype.seeking = function seeking() {
  112319. return this.lastSeekTarget_ !== void 0;
  112320. };
  112321. Flash2.prototype.setCurrentTime = function setCurrentTime(time) {
  112322. var seekable3 = this.seekable();
  112323. if (seekable3.length) {
  112324. time = time > seekable3.start(0) ? time : seekable3.start(0);
  112325. time = time < seekable3.end(seekable3.length - 1) ? time : seekable3.end(seekable3.length - 1);
  112326. this.lastSeekTarget_ = time;
  112327. this.trigger("seeking");
  112328. this.el_.vjs_setProperty("currentTime", time);
  112329. _Tech.prototype.setCurrentTime.call(this);
  112330. }
  112331. };
  112332. Flash2.prototype.currentTime = function currentTime() {
  112333. if (this.seeking()) {
  112334. return this.lastSeekTarget_ || 0;
  112335. }
  112336. return this.el_.vjs_getProperty("currentTime");
  112337. };
  112338. Flash2.prototype.currentSrc = function currentSrc() {
  112339. if (this.currentSource_) {
  112340. return this.currentSource_.src;
  112341. }
  112342. return this.el_.vjs_getProperty("currentSrc");
  112343. };
  112344. Flash2.prototype.duration = function duration5() {
  112345. if (this.readyState() === 0) {
  112346. return NaN;
  112347. }
  112348. var duration6 = this.el_.vjs_getProperty("duration");
  112349. return duration6 >= 0 ? duration6 : Infinity;
  112350. };
  112351. Flash2.prototype.load = function load() {
  112352. this.el_.vjs_load();
  112353. };
  112354. Flash2.prototype.poster = function poster() {
  112355. this.el_.vjs_getProperty("poster");
  112356. };
  112357. Flash2.prototype.setPoster = function setPoster() {
  112358. };
  112359. Flash2.prototype.seekable = function seekable3() {
  112360. var duration5 = this.duration();
  112361. if (duration5 === 0) {
  112362. return createTimeRange();
  112363. }
  112364. return createTimeRange(0, duration5);
  112365. };
  112366. Flash2.prototype.buffered = function buffered() {
  112367. var ranges = this.el_.vjs_getProperty("buffered");
  112368. if (ranges.length === 0) {
  112369. return createTimeRange();
  112370. }
  112371. return createTimeRange(ranges[0][0], ranges[0][1]);
  112372. };
  112373. Flash2.prototype.supportsFullScreen = function supportsFullScreen() {
  112374. return false;
  112375. };
  112376. Flash2.prototype.enterFullScreen = function enterFullScreen() {
  112377. return false;
  112378. };
  112379. Flash2.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  112380. var videoPlaybackQuality = this.el_.vjs_getProperty("getVideoPlaybackQuality");
  112381. if (window_1.performance && typeof window_1.performance.now === "function") {
  112382. videoPlaybackQuality.creationTime = window_1.performance.now();
  112383. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  112384. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  112385. }
  112386. return videoPlaybackQuality;
  112387. };
  112388. return Flash2;
  112389. }(Tech);
  112390. var _readWrite = ["rtmpConnection", "rtmpStream", "preload", "defaultPlaybackRate", "playbackRate", "autoplay", "loop", "controls", "volume", "muted", "defaultMuted"];
  112391. var _readOnly = ["networkState", "readyState", "initialTime", "startOffsetTime", "paused", "ended", "videoWidth", "videoHeight"];
  112392. var _api = Flash.prototype;
  112393. function _createSetter(attr) {
  112394. var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1);
  112395. _api["set" + attrUpper] = function(val) {
  112396. return this.el_.vjs_setProperty(attr, val);
  112397. };
  112398. }
  112399. function _createGetter(attr) {
  112400. _api[attr] = function() {
  112401. return this.el_.vjs_getProperty(attr);
  112402. };
  112403. }
  112404. for (var i$1 = 0; i$1 < _readWrite.length; i$1++) {
  112405. _createGetter(_readWrite[i$1]);
  112406. _createSetter(_readWrite[i$1]);
  112407. }
  112408. for (var _i = 0; _i < _readOnly.length; _i++) {
  112409. _createGetter(_readOnly[_i]);
  112410. }
  112411. Flash.isSupported = function() {
  112412. if (videojs.browser.IS_CHROME && (!videojs.browser.IS_ANDROID || !videojs.browser.IS_IOS) || videojs.browser.IS_SAFARI && !videojs.browser.IS_IOS || videojs.browser.IS_EDGE) {
  112413. return true;
  112414. }
  112415. return Flash.version()[0] >= 10;
  112416. };
  112417. Tech.withSourceHandlers(Flash);
  112418. Flash.nativeSourceHandler = {};
  112419. Flash.nativeSourceHandler.canPlayType = function(type2) {
  112420. if (type2 in Flash.formats) {
  112421. return "maybe";
  112422. }
  112423. return "";
  112424. };
  112425. Flash.nativeSourceHandler.canHandleSource = function(source, options2) {
  112426. var type2 = void 0;
  112427. function guessMimeType(src) {
  112428. var ext = Url.getFileExtension(src);
  112429. if (ext) {
  112430. return "video/" + ext;
  112431. }
  112432. return "";
  112433. }
  112434. if (!source.type) {
  112435. type2 = guessMimeType(source.src);
  112436. } else {
  112437. type2 = source.type.replace(/;.*/, "").toLowerCase();
  112438. }
  112439. return Flash.nativeSourceHandler.canPlayType(type2);
  112440. };
  112441. Flash.nativeSourceHandler.handleSource = function(source, tech, options2) {
  112442. tech.setSrc(source.src);
  112443. };
  112444. Flash.nativeSourceHandler.dispose = function() {
  112445. };
  112446. Flash.registerSourceHandler(Flash.nativeSourceHandler);
  112447. Flash.formats = {
  112448. "video/flv": "FLV",
  112449. "video/x-flv": "FLV",
  112450. "video/mp4": "MP4",
  112451. "video/m4v": "MP4"
  112452. };
  112453. Flash.onReady = function(currSwf) {
  112454. var el = Dom.$("#" + currSwf);
  112455. var tech = el && el.tech;
  112456. if (tech && tech.el()) {
  112457. Flash.checkReady(tech);
  112458. }
  112459. };
  112460. Flash.checkReady = function(tech) {
  112461. if (!tech.el()) {
  112462. return;
  112463. }
  112464. if (tech.el().vjs_getProperty) {
  112465. tech.triggerReady();
  112466. } else {
  112467. this.setTimeout(function() {
  112468. Flash.checkReady(tech);
  112469. }, 50);
  112470. }
  112471. };
  112472. Flash.onEvent = function(swfID, eventName) {
  112473. var tech = Dom.$("#" + swfID).tech;
  112474. var args = Array.prototype.slice.call(arguments, 2);
  112475. tech.setTimeout(function() {
  112476. tech.trigger(eventName, args);
  112477. }, 1);
  112478. };
  112479. Flash.onError = function(swfID, err) {
  112480. var tech = Dom.$("#" + swfID).tech;
  112481. if (err === "srcnotfound") {
  112482. return tech.error(4);
  112483. }
  112484. if (typeof err === "string") {
  112485. tech.error("FLASH: " + err);
  112486. } else {
  112487. err.origin = "flash";
  112488. tech.error(err);
  112489. }
  112490. };
  112491. Flash.version = function() {
  112492. var version$$1 = "0,0,0";
  112493. try {
  112494. version$$1 = new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112495. } catch (e) {
  112496. try {
  112497. if (navigator$1.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  112498. version$$1 = (navigator$1.plugins["Shockwave Flash 2.0"] || navigator$1.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112499. }
  112500. } catch (err) {
  112501. }
  112502. }
  112503. return version$$1.split(",");
  112504. };
  112505. Flash.embed = function(swf, flashVars, params, attributes) {
  112506. var code = Flash.getEmbedCode(swf, flashVars, params, attributes);
  112507. var obj = Dom.createEl("div", { innerHTML: code }).childNodes[0];
  112508. return obj;
  112509. };
  112510. Flash.getEmbedCode = function(swf, flashVars, params, attributes) {
  112511. var objTag = '<object type="application/x-shockwave-flash" ';
  112512. var flashVarsString = "";
  112513. var paramsString = "";
  112514. var attrsString = "";
  112515. if (flashVars) {
  112516. Object.getOwnPropertyNames(flashVars).forEach(function(key) {
  112517. flashVarsString += key + "=" + flashVars[key] + "&amp;";
  112518. });
  112519. }
  112520. params = mergeOptions$1({
  112521. movie: swf,
  112522. flashvars: flashVarsString,
  112523. allowScriptAccess: "always",
  112524. allowNetworking: "all"
  112525. }, params);
  112526. Object.getOwnPropertyNames(params).forEach(function(key) {
  112527. paramsString += '<param name="' + key + '" value="' + params[key] + '" />';
  112528. });
  112529. attributes = mergeOptions$1({
  112530. data: swf,
  112531. width: "100%",
  112532. height: "100%"
  112533. }, attributes);
  112534. Object.getOwnPropertyNames(attributes).forEach(function(key) {
  112535. attrsString += key + '="' + attributes[key] + '" ';
  112536. });
  112537. return "" + objTag + attrsString + ">" + paramsString + "</object>";
  112538. };
  112539. FlashRtmpDecorator(Flash);
  112540. if (Tech.getTech("Flash")) {
  112541. videojs.log.warn("Not using videojs-flash as it appears to already be registered");
  112542. videojs.log.warn("videojs-flash should only be used with video.js@6 and above");
  112543. } else {
  112544. videojs.registerTech("Flash", Flash);
  112545. }
  112546. Flash.VERSION = version$1;
  112547. var flv = { exports: {} };
  112548. (function(module2, exports2) {
  112549. (function webpackUniversalModuleDefinition(root2, factory3) {
  112550. module2.exports = factory3();
  112551. })(self, function() {
  112552. return function() {
  112553. var __webpack_modules__ = {
  112554. "./node_modules/es6-promise/dist/es6-promise.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  112555. /*!
  112556. * @overview es6-promise - a tiny implementation of Promises/A+.
  112557. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  112558. * @license Licensed under MIT license
  112559. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  112560. * @version v4.2.8+1e68dce6
  112561. */
  112562. (function(global2, factory3) {
  112563. module3.exports = factory3();
  112564. })(this, function() {
  112565. function objectOrFunction(x) {
  112566. var type2 = typeof x;
  112567. return x !== null && (type2 === "object" || type2 === "function");
  112568. }
  112569. function isFunction2(x) {
  112570. return typeof x === "function";
  112571. }
  112572. var _isArray = void 0;
  112573. if (Array.isArray) {
  112574. _isArray = Array.isArray;
  112575. } else {
  112576. _isArray = function(x) {
  112577. return Object.prototype.toString.call(x) === "[object Array]";
  112578. };
  112579. }
  112580. var isArray2 = _isArray;
  112581. var len = 0;
  112582. var vertxNext = void 0;
  112583. var customSchedulerFn = void 0;
  112584. var asap = function asap2(callback2, arg) {
  112585. queue[len] = callback2;
  112586. queue[len + 1] = arg;
  112587. len += 2;
  112588. if (len === 2) {
  112589. if (customSchedulerFn) {
  112590. customSchedulerFn(flush);
  112591. } else {
  112592. scheduleFlush();
  112593. }
  112594. }
  112595. };
  112596. function setScheduler(scheduleFn) {
  112597. customSchedulerFn = scheduleFn;
  112598. }
  112599. function setAsap(asapFn) {
  112600. asap = asapFn;
  112601. }
  112602. var browserWindow = typeof window !== "undefined" ? window : void 0;
  112603. var browserGlobal = browserWindow || {};
  112604. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  112605. var isNode = typeof self === "undefined" && typeof process !== "undefined" && {}.toString.call(process) === "[object process]";
  112606. var isWorker = typeof Uint8ClampedArray !== "undefined" && typeof importScripts !== "undefined" && typeof MessageChannel !== "undefined";
  112607. function useNextTick() {
  112608. return function() {
  112609. return process.nextTick(flush);
  112610. };
  112611. }
  112612. function useVertxTimer() {
  112613. if (typeof vertxNext !== "undefined") {
  112614. return function() {
  112615. vertxNext(flush);
  112616. };
  112617. }
  112618. return useSetTimeout();
  112619. }
  112620. function useMutationObserver() {
  112621. var iterations = 0;
  112622. var observer = new BrowserMutationObserver(flush);
  112623. var node = document.createTextNode("");
  112624. observer.observe(node, { characterData: true });
  112625. return function() {
  112626. node.data = iterations = ++iterations % 2;
  112627. };
  112628. }
  112629. function useMessageChannel() {
  112630. var channel = new MessageChannel();
  112631. channel.port1.onmessage = flush;
  112632. return function() {
  112633. return channel.port2.postMessage(0);
  112634. };
  112635. }
  112636. function useSetTimeout() {
  112637. var globalSetTimeout = setTimeout;
  112638. return function() {
  112639. return globalSetTimeout(flush, 1);
  112640. };
  112641. }
  112642. var queue = new Array(1e3);
  112643. function flush() {
  112644. for (var i2 = 0; i2 < len; i2 += 2) {
  112645. var callback2 = queue[i2];
  112646. var arg = queue[i2 + 1];
  112647. callback2(arg);
  112648. queue[i2] = void 0;
  112649. queue[i2 + 1] = void 0;
  112650. }
  112651. len = 0;
  112652. }
  112653. function attemptVertx() {
  112654. try {
  112655. var vertx = Function("return this")().require("vertx");
  112656. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  112657. return useVertxTimer();
  112658. } catch (e) {
  112659. return useSetTimeout();
  112660. }
  112661. }
  112662. var scheduleFlush = void 0;
  112663. if (isNode) {
  112664. scheduleFlush = useNextTick();
  112665. } else if (BrowserMutationObserver) {
  112666. scheduleFlush = useMutationObserver();
  112667. } else if (isWorker) {
  112668. scheduleFlush = useMessageChannel();
  112669. } else if (browserWindow === void 0 && true) {
  112670. scheduleFlush = attemptVertx();
  112671. } else {
  112672. scheduleFlush = useSetTimeout();
  112673. }
  112674. function then(onFulfillment, onRejection) {
  112675. var parent = this;
  112676. var child = new this.constructor(noop2);
  112677. if (child[PROMISE_ID] === void 0) {
  112678. makePromise(child);
  112679. }
  112680. var _state = parent._state;
  112681. if (_state) {
  112682. var callback2 = arguments[_state - 1];
  112683. asap(function() {
  112684. return invokeCallback(_state, child, callback2, parent._result);
  112685. });
  112686. } else {
  112687. subscribe(parent, child, onFulfillment, onRejection);
  112688. }
  112689. return child;
  112690. }
  112691. function resolve$1(object) {
  112692. var Constructor = this;
  112693. if (object && typeof object === "object" && object.constructor === Constructor) {
  112694. return object;
  112695. }
  112696. var promise = new Constructor(noop2);
  112697. resolve2(promise, object);
  112698. return promise;
  112699. }
  112700. var PROMISE_ID = Math.random().toString(36).substring(2);
  112701. function noop2() {
  112702. }
  112703. var PENDING = void 0;
  112704. var FULFILLED = 1;
  112705. var REJECTED = 2;
  112706. function selfFulfillment() {
  112707. return new TypeError("You cannot resolve a promise with itself");
  112708. }
  112709. function cannotReturnOwn() {
  112710. return new TypeError("A promises callback cannot return that same promise.");
  112711. }
  112712. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  112713. try {
  112714. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  112715. } catch (e) {
  112716. return e;
  112717. }
  112718. }
  112719. function handleForeignThenable(promise, thenable, then$$1) {
  112720. asap(function(promise2) {
  112721. var sealed = false;
  112722. var error = tryThen(then$$1, thenable, function(value) {
  112723. if (sealed) {
  112724. return;
  112725. }
  112726. sealed = true;
  112727. if (thenable !== value) {
  112728. resolve2(promise2, value);
  112729. } else {
  112730. fulfill(promise2, value);
  112731. }
  112732. }, function(reason) {
  112733. if (sealed) {
  112734. return;
  112735. }
  112736. sealed = true;
  112737. reject2(promise2, reason);
  112738. }, "Settle: " + (promise2._label || " unknown promise"));
  112739. if (!sealed && error) {
  112740. sealed = true;
  112741. reject2(promise2, error);
  112742. }
  112743. }, promise);
  112744. }
  112745. function handleOwnThenable(promise, thenable) {
  112746. if (thenable._state === FULFILLED) {
  112747. fulfill(promise, thenable._result);
  112748. } else if (thenable._state === REJECTED) {
  112749. reject2(promise, thenable._result);
  112750. } else {
  112751. subscribe(thenable, void 0, function(value) {
  112752. return resolve2(promise, value);
  112753. }, function(reason) {
  112754. return reject2(promise, reason);
  112755. });
  112756. }
  112757. }
  112758. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  112759. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  112760. handleOwnThenable(promise, maybeThenable);
  112761. } else {
  112762. if (then$$1 === void 0) {
  112763. fulfill(promise, maybeThenable);
  112764. } else if (isFunction2(then$$1)) {
  112765. handleForeignThenable(promise, maybeThenable, then$$1);
  112766. } else {
  112767. fulfill(promise, maybeThenable);
  112768. }
  112769. }
  112770. }
  112771. function resolve2(promise, value) {
  112772. if (promise === value) {
  112773. reject2(promise, selfFulfillment());
  112774. } else if (objectOrFunction(value)) {
  112775. var then$$1 = void 0;
  112776. try {
  112777. then$$1 = value.then;
  112778. } catch (error) {
  112779. reject2(promise, error);
  112780. return;
  112781. }
  112782. handleMaybeThenable(promise, value, then$$1);
  112783. } else {
  112784. fulfill(promise, value);
  112785. }
  112786. }
  112787. function publishRejection(promise) {
  112788. if (promise._onerror) {
  112789. promise._onerror(promise._result);
  112790. }
  112791. publish(promise);
  112792. }
  112793. function fulfill(promise, value) {
  112794. if (promise._state !== PENDING) {
  112795. return;
  112796. }
  112797. promise._result = value;
  112798. promise._state = FULFILLED;
  112799. if (promise._subscribers.length !== 0) {
  112800. asap(publish, promise);
  112801. }
  112802. }
  112803. function reject2(promise, reason) {
  112804. if (promise._state !== PENDING) {
  112805. return;
  112806. }
  112807. promise._state = REJECTED;
  112808. promise._result = reason;
  112809. asap(publishRejection, promise);
  112810. }
  112811. function subscribe(parent, child, onFulfillment, onRejection) {
  112812. var _subscribers = parent._subscribers;
  112813. var length = _subscribers.length;
  112814. parent._onerror = null;
  112815. _subscribers[length] = child;
  112816. _subscribers[length + FULFILLED] = onFulfillment;
  112817. _subscribers[length + REJECTED] = onRejection;
  112818. if (length === 0 && parent._state) {
  112819. asap(publish, parent);
  112820. }
  112821. }
  112822. function publish(promise) {
  112823. var subscribers = promise._subscribers;
  112824. var settled = promise._state;
  112825. if (subscribers.length === 0) {
  112826. return;
  112827. }
  112828. var child = void 0, callback2 = void 0, detail = promise._result;
  112829. for (var i2 = 0; i2 < subscribers.length; i2 += 3) {
  112830. child = subscribers[i2];
  112831. callback2 = subscribers[i2 + settled];
  112832. if (child) {
  112833. invokeCallback(settled, child, callback2, detail);
  112834. } else {
  112835. callback2(detail);
  112836. }
  112837. }
  112838. promise._subscribers.length = 0;
  112839. }
  112840. function invokeCallback(settled, promise, callback2, detail) {
  112841. var hasCallback = isFunction2(callback2), value = void 0, error = void 0, succeeded = true;
  112842. if (hasCallback) {
  112843. try {
  112844. value = callback2(detail);
  112845. } catch (e) {
  112846. succeeded = false;
  112847. error = e;
  112848. }
  112849. if (promise === value) {
  112850. reject2(promise, cannotReturnOwn());
  112851. return;
  112852. }
  112853. } else {
  112854. value = detail;
  112855. }
  112856. if (promise._state !== PENDING)
  112857. ;
  112858. else if (hasCallback && succeeded) {
  112859. resolve2(promise, value);
  112860. } else if (succeeded === false) {
  112861. reject2(promise, error);
  112862. } else if (settled === FULFILLED) {
  112863. fulfill(promise, value);
  112864. } else if (settled === REJECTED) {
  112865. reject2(promise, value);
  112866. }
  112867. }
  112868. function initializePromise(promise, resolver) {
  112869. try {
  112870. resolver(function resolvePromise(value) {
  112871. resolve2(promise, value);
  112872. }, function rejectPromise(reason) {
  112873. reject2(promise, reason);
  112874. });
  112875. } catch (e) {
  112876. reject2(promise, e);
  112877. }
  112878. }
  112879. var id = 0;
  112880. function nextId() {
  112881. return id++;
  112882. }
  112883. function makePromise(promise) {
  112884. promise[PROMISE_ID] = id++;
  112885. promise._state = void 0;
  112886. promise._result = void 0;
  112887. promise._subscribers = [];
  112888. }
  112889. function validationError() {
  112890. return new Error("Array Methods must be provided an Array");
  112891. }
  112892. var Enumerator = function() {
  112893. function Enumerator2(Constructor, input) {
  112894. this._instanceConstructor = Constructor;
  112895. this.promise = new Constructor(noop2);
  112896. if (!this.promise[PROMISE_ID]) {
  112897. makePromise(this.promise);
  112898. }
  112899. if (isArray2(input)) {
  112900. this.length = input.length;
  112901. this._remaining = input.length;
  112902. this._result = new Array(this.length);
  112903. if (this.length === 0) {
  112904. fulfill(this.promise, this._result);
  112905. } else {
  112906. this.length = this.length || 0;
  112907. this._enumerate(input);
  112908. if (this._remaining === 0) {
  112909. fulfill(this.promise, this._result);
  112910. }
  112911. }
  112912. } else {
  112913. reject2(this.promise, validationError());
  112914. }
  112915. }
  112916. Enumerator2.prototype._enumerate = function _enumerate(input) {
  112917. for (var i2 = 0; this._state === PENDING && i2 < input.length; i2++) {
  112918. this._eachEntry(input[i2], i2);
  112919. }
  112920. };
  112921. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i2) {
  112922. var c = this._instanceConstructor;
  112923. var resolve$$1 = c.resolve;
  112924. if (resolve$$1 === resolve$1) {
  112925. var _then = void 0;
  112926. var error = void 0;
  112927. var didError = false;
  112928. try {
  112929. _then = entry.then;
  112930. } catch (e) {
  112931. didError = true;
  112932. error = e;
  112933. }
  112934. if (_then === then && entry._state !== PENDING) {
  112935. this._settledAt(entry._state, i2, entry._result);
  112936. } else if (typeof _then !== "function") {
  112937. this._remaining--;
  112938. this._result[i2] = entry;
  112939. } else if (c === Promise$12) {
  112940. var promise = new c(noop2);
  112941. if (didError) {
  112942. reject2(promise, error);
  112943. } else {
  112944. handleMaybeThenable(promise, entry, _then);
  112945. }
  112946. this._willSettleAt(promise, i2);
  112947. } else {
  112948. this._willSettleAt(new c(function(resolve$$12) {
  112949. return resolve$$12(entry);
  112950. }), i2);
  112951. }
  112952. } else {
  112953. this._willSettleAt(resolve$$1(entry), i2);
  112954. }
  112955. };
  112956. Enumerator2.prototype._settledAt = function _settledAt(state, i2, value) {
  112957. var promise = this.promise;
  112958. if (promise._state === PENDING) {
  112959. this._remaining--;
  112960. if (state === REJECTED) {
  112961. reject2(promise, value);
  112962. } else {
  112963. this._result[i2] = value;
  112964. }
  112965. }
  112966. if (this._remaining === 0) {
  112967. fulfill(promise, this._result);
  112968. }
  112969. };
  112970. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i2) {
  112971. var enumerator = this;
  112972. subscribe(promise, void 0, function(value) {
  112973. return enumerator._settledAt(FULFILLED, i2, value);
  112974. }, function(reason) {
  112975. return enumerator._settledAt(REJECTED, i2, reason);
  112976. });
  112977. };
  112978. return Enumerator2;
  112979. }();
  112980. function all(entries) {
  112981. return new Enumerator(this, entries).promise;
  112982. }
  112983. function race(entries) {
  112984. var Constructor = this;
  112985. if (!isArray2(entries)) {
  112986. return new Constructor(function(_, reject3) {
  112987. return reject3(new TypeError("You must pass an array to race."));
  112988. });
  112989. } else {
  112990. return new Constructor(function(resolve3, reject3) {
  112991. var length = entries.length;
  112992. for (var i2 = 0; i2 < length; i2++) {
  112993. Constructor.resolve(entries[i2]).then(resolve3, reject3);
  112994. }
  112995. });
  112996. }
  112997. }
  112998. function reject$1(reason) {
  112999. var Constructor = this;
  113000. var promise = new Constructor(noop2);
  113001. reject2(promise, reason);
  113002. return promise;
  113003. }
  113004. function needsResolver() {
  113005. throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
  113006. }
  113007. function needsNew() {
  113008. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  113009. }
  113010. var Promise$12 = function() {
  113011. function Promise2(resolver) {
  113012. this[PROMISE_ID] = nextId();
  113013. this._result = this._state = void 0;
  113014. this._subscribers = [];
  113015. if (noop2 !== resolver) {
  113016. typeof resolver !== "function" && needsResolver();
  113017. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  113018. }
  113019. }
  113020. Promise2.prototype.catch = function _catch(onRejection) {
  113021. return this.then(null, onRejection);
  113022. };
  113023. Promise2.prototype.finally = function _finally(callback2) {
  113024. var promise = this;
  113025. var constructor = promise.constructor;
  113026. if (isFunction2(callback2)) {
  113027. return promise.then(function(value) {
  113028. return constructor.resolve(callback2()).then(function() {
  113029. return value;
  113030. });
  113031. }, function(reason) {
  113032. return constructor.resolve(callback2()).then(function() {
  113033. throw reason;
  113034. });
  113035. });
  113036. }
  113037. return promise.then(callback2, callback2);
  113038. };
  113039. return Promise2;
  113040. }();
  113041. Promise$12.prototype.then = then;
  113042. Promise$12.all = all;
  113043. Promise$12.race = race;
  113044. Promise$12.resolve = resolve$1;
  113045. Promise$12.reject = reject$1;
  113046. Promise$12._setScheduler = setScheduler;
  113047. Promise$12._setAsap = setAsap;
  113048. Promise$12._asap = asap;
  113049. function polyfill() {
  113050. var local = void 0;
  113051. if (typeof __webpack_require__2.g !== "undefined") {
  113052. local = __webpack_require__2.g;
  113053. } else if (typeof self !== "undefined") {
  113054. local = self;
  113055. } else {
  113056. try {
  113057. local = Function("return this")();
  113058. } catch (e) {
  113059. throw new Error("polyfill failed because global object is unavailable in this environment");
  113060. }
  113061. }
  113062. var P2 = local.Promise;
  113063. if (P2) {
  113064. var promiseToString = null;
  113065. try {
  113066. promiseToString = Object.prototype.toString.call(P2.resolve());
  113067. } catch (e) {
  113068. }
  113069. if (promiseToString === "[object Promise]" && !P2.cast) {
  113070. return;
  113071. }
  113072. }
  113073. local.Promise = Promise$12;
  113074. }
  113075. Promise$12.polyfill = polyfill;
  113076. Promise$12.Promise = Promise$12;
  113077. return Promise$12;
  113078. });
  113079. },
  113080. "./node_modules/events/events.js": function(module3) {
  113081. var R2 = typeof Reflect === "object" ? Reflect : null;
  113082. var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
  113083. return Function.prototype.apply.call(target, receiver, args);
  113084. };
  113085. var ReflectOwnKeys;
  113086. if (R2 && typeof R2.ownKeys === "function") {
  113087. ReflectOwnKeys = R2.ownKeys;
  113088. } else if (Object.getOwnPropertySymbols) {
  113089. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113090. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  113091. };
  113092. } else {
  113093. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113094. return Object.getOwnPropertyNames(target);
  113095. };
  113096. }
  113097. function ProcessEmitWarning(warning) {
  113098. if (console && console.warn)
  113099. console.warn(warning);
  113100. }
  113101. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  113102. return value !== value;
  113103. };
  113104. function EventEmitter() {
  113105. EventEmitter.init.call(this);
  113106. }
  113107. module3.exports = EventEmitter;
  113108. module3.exports.once = once;
  113109. EventEmitter.EventEmitter = EventEmitter;
  113110. EventEmitter.prototype._events = void 0;
  113111. EventEmitter.prototype._eventsCount = 0;
  113112. EventEmitter.prototype._maxListeners = void 0;
  113113. var defaultMaxListeners = 10;
  113114. function checkListener(listener) {
  113115. if (typeof listener !== "function") {
  113116. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  113117. }
  113118. }
  113119. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  113120. enumerable: true,
  113121. get: function() {
  113122. return defaultMaxListeners;
  113123. },
  113124. set: function(arg) {
  113125. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  113126. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  113127. }
  113128. defaultMaxListeners = arg;
  113129. }
  113130. });
  113131. EventEmitter.init = function() {
  113132. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  113133. this._events = /* @__PURE__ */ Object.create(null);
  113134. this._eventsCount = 0;
  113135. }
  113136. this._maxListeners = this._maxListeners || void 0;
  113137. };
  113138. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  113139. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  113140. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  113141. }
  113142. this._maxListeners = n;
  113143. return this;
  113144. };
  113145. function _getMaxListeners(that) {
  113146. if (that._maxListeners === void 0)
  113147. return EventEmitter.defaultMaxListeners;
  113148. return that._maxListeners;
  113149. }
  113150. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  113151. return _getMaxListeners(this);
  113152. };
  113153. EventEmitter.prototype.emit = function emit(type2) {
  113154. var args = [];
  113155. for (var i2 = 1; i2 < arguments.length; i2++)
  113156. args.push(arguments[i2]);
  113157. var doError = type2 === "error";
  113158. var events = this._events;
  113159. if (events !== void 0)
  113160. doError = doError && events.error === void 0;
  113161. else if (!doError)
  113162. return false;
  113163. if (doError) {
  113164. var er;
  113165. if (args.length > 0)
  113166. er = args[0];
  113167. if (er instanceof Error) {
  113168. throw er;
  113169. }
  113170. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  113171. err.context = er;
  113172. throw err;
  113173. }
  113174. var handler = events[type2];
  113175. if (handler === void 0)
  113176. return false;
  113177. if (typeof handler === "function") {
  113178. ReflectApply(handler, this, args);
  113179. } else {
  113180. var len = handler.length;
  113181. var listeners = arrayClone(handler, len);
  113182. for (var i2 = 0; i2 < len; ++i2)
  113183. ReflectApply(listeners[i2], this, args);
  113184. }
  113185. return true;
  113186. };
  113187. function _addListener(target, type2, listener, prepend) {
  113188. var m;
  113189. var events;
  113190. var existing;
  113191. checkListener(listener);
  113192. events = target._events;
  113193. if (events === void 0) {
  113194. events = target._events = /* @__PURE__ */ Object.create(null);
  113195. target._eventsCount = 0;
  113196. } else {
  113197. if (events.newListener !== void 0) {
  113198. target.emit("newListener", type2, listener.listener ? listener.listener : listener);
  113199. events = target._events;
  113200. }
  113201. existing = events[type2];
  113202. }
  113203. if (existing === void 0) {
  113204. existing = events[type2] = listener;
  113205. ++target._eventsCount;
  113206. } else {
  113207. if (typeof existing === "function") {
  113208. existing = events[type2] = prepend ? [listener, existing] : [existing, listener];
  113209. } else if (prepend) {
  113210. existing.unshift(listener);
  113211. } else {
  113212. existing.push(listener);
  113213. }
  113214. m = _getMaxListeners(target);
  113215. if (m > 0 && existing.length > m && !existing.warned) {
  113216. existing.warned = true;
  113217. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  113218. w.name = "MaxListenersExceededWarning";
  113219. w.emitter = target;
  113220. w.type = type2;
  113221. w.count = existing.length;
  113222. ProcessEmitWarning(w);
  113223. }
  113224. }
  113225. return target;
  113226. }
  113227. EventEmitter.prototype.addListener = function addListener(type2, listener) {
  113228. return _addListener(this, type2, listener, false);
  113229. };
  113230. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  113231. EventEmitter.prototype.prependListener = function prependListener(type2, listener) {
  113232. return _addListener(this, type2, listener, true);
  113233. };
  113234. function onceWrapper() {
  113235. if (!this.fired) {
  113236. this.target.removeListener(this.type, this.wrapFn);
  113237. this.fired = true;
  113238. if (arguments.length === 0)
  113239. return this.listener.call(this.target);
  113240. return this.listener.apply(this.target, arguments);
  113241. }
  113242. }
  113243. function _onceWrap(target, type2, listener) {
  113244. var state = { fired: false, wrapFn: void 0, target, type: type2, listener };
  113245. var wrapped = onceWrapper.bind(state);
  113246. wrapped.listener = listener;
  113247. state.wrapFn = wrapped;
  113248. return wrapped;
  113249. }
  113250. EventEmitter.prototype.once = function once2(type2, listener) {
  113251. checkListener(listener);
  113252. this.on(type2, _onceWrap(this, type2, listener));
  113253. return this;
  113254. };
  113255. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) {
  113256. checkListener(listener);
  113257. this.prependListener(type2, _onceWrap(this, type2, listener));
  113258. return this;
  113259. };
  113260. EventEmitter.prototype.removeListener = function removeListener(type2, listener) {
  113261. var list, events, position2, i2, originalListener;
  113262. checkListener(listener);
  113263. events = this._events;
  113264. if (events === void 0)
  113265. return this;
  113266. list = events[type2];
  113267. if (list === void 0)
  113268. return this;
  113269. if (list === listener || list.listener === listener) {
  113270. if (--this._eventsCount === 0)
  113271. this._events = /* @__PURE__ */ Object.create(null);
  113272. else {
  113273. delete events[type2];
  113274. if (events.removeListener)
  113275. this.emit("removeListener", type2, list.listener || listener);
  113276. }
  113277. } else if (typeof list !== "function") {
  113278. position2 = -1;
  113279. for (i2 = list.length - 1; i2 >= 0; i2--) {
  113280. if (list[i2] === listener || list[i2].listener === listener) {
  113281. originalListener = list[i2].listener;
  113282. position2 = i2;
  113283. break;
  113284. }
  113285. }
  113286. if (position2 < 0)
  113287. return this;
  113288. if (position2 === 0)
  113289. list.shift();
  113290. else {
  113291. spliceOne(list, position2);
  113292. }
  113293. if (list.length === 1)
  113294. events[type2] = list[0];
  113295. if (events.removeListener !== void 0)
  113296. this.emit("removeListener", type2, originalListener || listener);
  113297. }
  113298. return this;
  113299. };
  113300. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  113301. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) {
  113302. var listeners, events, i2;
  113303. events = this._events;
  113304. if (events === void 0)
  113305. return this;
  113306. if (events.removeListener === void 0) {
  113307. if (arguments.length === 0) {
  113308. this._events = /* @__PURE__ */ Object.create(null);
  113309. this._eventsCount = 0;
  113310. } else if (events[type2] !== void 0) {
  113311. if (--this._eventsCount === 0)
  113312. this._events = /* @__PURE__ */ Object.create(null);
  113313. else
  113314. delete events[type2];
  113315. }
  113316. return this;
  113317. }
  113318. if (arguments.length === 0) {
  113319. var keys3 = Object.keys(events);
  113320. var key;
  113321. for (i2 = 0; i2 < keys3.length; ++i2) {
  113322. key = keys3[i2];
  113323. if (key === "removeListener")
  113324. continue;
  113325. this.removeAllListeners(key);
  113326. }
  113327. this.removeAllListeners("removeListener");
  113328. this._events = /* @__PURE__ */ Object.create(null);
  113329. this._eventsCount = 0;
  113330. return this;
  113331. }
  113332. listeners = events[type2];
  113333. if (typeof listeners === "function") {
  113334. this.removeListener(type2, listeners);
  113335. } else if (listeners !== void 0) {
  113336. for (i2 = listeners.length - 1; i2 >= 0; i2--) {
  113337. this.removeListener(type2, listeners[i2]);
  113338. }
  113339. }
  113340. return this;
  113341. };
  113342. function _listeners(target, type2, unwrap) {
  113343. var events = target._events;
  113344. if (events === void 0)
  113345. return [];
  113346. var evlistener = events[type2];
  113347. if (evlistener === void 0)
  113348. return [];
  113349. if (typeof evlistener === "function")
  113350. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  113351. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  113352. }
  113353. EventEmitter.prototype.listeners = function listeners(type2) {
  113354. return _listeners(this, type2, true);
  113355. };
  113356. EventEmitter.prototype.rawListeners = function rawListeners(type2) {
  113357. return _listeners(this, type2, false);
  113358. };
  113359. EventEmitter.listenerCount = function(emitter, type2) {
  113360. if (typeof emitter.listenerCount === "function") {
  113361. return emitter.listenerCount(type2);
  113362. } else {
  113363. return listenerCount.call(emitter, type2);
  113364. }
  113365. };
  113366. EventEmitter.prototype.listenerCount = listenerCount;
  113367. function listenerCount(type2) {
  113368. var events = this._events;
  113369. if (events !== void 0) {
  113370. var evlistener = events[type2];
  113371. if (typeof evlistener === "function") {
  113372. return 1;
  113373. } else if (evlistener !== void 0) {
  113374. return evlistener.length;
  113375. }
  113376. }
  113377. return 0;
  113378. }
  113379. EventEmitter.prototype.eventNames = function eventNames() {
  113380. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  113381. };
  113382. function arrayClone(arr, n) {
  113383. var copy2 = new Array(n);
  113384. for (var i2 = 0; i2 < n; ++i2)
  113385. copy2[i2] = arr[i2];
  113386. return copy2;
  113387. }
  113388. function spliceOne(list, index2) {
  113389. for (; index2 + 1 < list.length; index2++)
  113390. list[index2] = list[index2 + 1];
  113391. list.pop();
  113392. }
  113393. function unwrapListeners(arr) {
  113394. var ret = new Array(arr.length);
  113395. for (var i2 = 0; i2 < ret.length; ++i2) {
  113396. ret[i2] = arr[i2].listener || arr[i2];
  113397. }
  113398. return ret;
  113399. }
  113400. function once(emitter, name) {
  113401. return new Promise(function(resolve2, reject2) {
  113402. function errorListener(err) {
  113403. emitter.removeListener(name, resolver);
  113404. reject2(err);
  113405. }
  113406. function resolver() {
  113407. if (typeof emitter.removeListener === "function") {
  113408. emitter.removeListener("error", errorListener);
  113409. }
  113410. resolve2([].slice.call(arguments));
  113411. }
  113412. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  113413. if (name !== "error") {
  113414. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  113415. }
  113416. });
  113417. }
  113418. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  113419. if (typeof emitter.on === "function") {
  113420. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  113421. }
  113422. }
  113423. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  113424. if (typeof emitter.on === "function") {
  113425. if (flags.once) {
  113426. emitter.once(name, listener);
  113427. } else {
  113428. emitter.on(name, listener);
  113429. }
  113430. } else if (typeof emitter.addEventListener === "function") {
  113431. emitter.addEventListener(name, function wrapListener(arg) {
  113432. if (flags.once) {
  113433. emitter.removeEventListener(name, wrapListener);
  113434. }
  113435. listener(arg);
  113436. });
  113437. } else {
  113438. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  113439. }
  113440. }
  113441. },
  113442. "./node_modules/webworkify-webpack/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  113443. function webpackBootstrapFunc(modules) {
  113444. var installedModules = {};
  113445. function __nested_webpack_require_164__(moduleId) {
  113446. if (installedModules[moduleId])
  113447. return installedModules[moduleId].exports;
  113448. var module4 = installedModules[moduleId] = {
  113449. i: moduleId,
  113450. l: false,
  113451. exports: {}
  113452. };
  113453. modules[moduleId].call(module4.exports, module4, module4.exports, __nested_webpack_require_164__);
  113454. module4.l = true;
  113455. return module4.exports;
  113456. }
  113457. __nested_webpack_require_164__.m = modules;
  113458. __nested_webpack_require_164__.c = installedModules;
  113459. __nested_webpack_require_164__.i = function(value) {
  113460. return value;
  113461. };
  113462. __nested_webpack_require_164__.d = function(exports3, name, getter) {
  113463. if (!__nested_webpack_require_164__.o(exports3, name)) {
  113464. Object.defineProperty(exports3, name, {
  113465. configurable: false,
  113466. enumerable: true,
  113467. get: getter
  113468. });
  113469. }
  113470. };
  113471. __nested_webpack_require_164__.r = function(exports3) {
  113472. Object.defineProperty(exports3, "__esModule", { value: true });
  113473. };
  113474. __nested_webpack_require_164__.n = function(module4) {
  113475. var getter = module4 && module4.__esModule ? function getDefault() {
  113476. return module4["default"];
  113477. } : function getModuleExports() {
  113478. return module4;
  113479. };
  113480. __nested_webpack_require_164__.d(getter, "a", getter);
  113481. return getter;
  113482. };
  113483. __nested_webpack_require_164__.o = function(object, property) {
  113484. return Object.prototype.hasOwnProperty.call(object, property);
  113485. };
  113486. __nested_webpack_require_164__.p = "/";
  113487. __nested_webpack_require_164__.oe = function(err) {
  113488. console.error(err);
  113489. throw err;
  113490. };
  113491. var f = __nested_webpack_require_164__(__nested_webpack_require_164__.s = ENTRY_MODULE);
  113492. return f.default || f;
  113493. }
  113494. var moduleNameReqExp = "[\\.|\\-|\\+|\\w|/|@]+";
  113495. var dependencyRegExp = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + moduleNameReqExp + ").*?\\)";
  113496. function quoteRegExp(str) {
  113497. return (str + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
  113498. }
  113499. function isNumeric(n) {
  113500. return !isNaN(1 * n);
  113501. }
  113502. function getModuleDependencies(sources, module4, queueName) {
  113503. var retval = {};
  113504. retval[queueName] = [];
  113505. var fnString = module4.toString();
  113506. var wrapperSignature = fnString.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
  113507. if (!wrapperSignature)
  113508. return retval;
  113509. var webpackRequireName = wrapperSignature[1];
  113510. var re = new RegExp("(\\\\n|\\W)" + quoteRegExp(webpackRequireName) + dependencyRegExp, "g");
  113511. var match;
  113512. while (match = re.exec(fnString)) {
  113513. if (match[3] === "dll-reference")
  113514. continue;
  113515. retval[queueName].push(match[3]);
  113516. }
  113517. re = new RegExp("\\(" + quoteRegExp(webpackRequireName) + '\\("(dll-reference\\s(' + moduleNameReqExp + '))"\\)\\)' + dependencyRegExp, "g");
  113518. while (match = re.exec(fnString)) {
  113519. if (!sources[match[2]]) {
  113520. retval[queueName].push(match[1]);
  113521. sources[match[2]] = __webpack_require__2(match[1]).m;
  113522. }
  113523. retval[match[2]] = retval[match[2]] || [];
  113524. retval[match[2]].push(match[4]);
  113525. }
  113526. var keys3 = Object.keys(retval);
  113527. for (var i2 = 0; i2 < keys3.length; i2++) {
  113528. for (var j = 0; j < retval[keys3[i2]].length; j++) {
  113529. if (isNumeric(retval[keys3[i2]][j])) {
  113530. retval[keys3[i2]][j] = 1 * retval[keys3[i2]][j];
  113531. }
  113532. }
  113533. }
  113534. return retval;
  113535. }
  113536. function hasValuesInQueues(queues) {
  113537. var keys3 = Object.keys(queues);
  113538. return keys3.reduce(function(hasValues, key) {
  113539. return hasValues || queues[key].length > 0;
  113540. }, false);
  113541. }
  113542. function getRequiredModules(sources, moduleId) {
  113543. var modulesQueue = {
  113544. main: [moduleId]
  113545. };
  113546. var requiredModules = {
  113547. main: []
  113548. };
  113549. var seenModules = {
  113550. main: {}
  113551. };
  113552. while (hasValuesInQueues(modulesQueue)) {
  113553. var queues = Object.keys(modulesQueue);
  113554. for (var i2 = 0; i2 < queues.length; i2++) {
  113555. var queueName = queues[i2];
  113556. var queue = modulesQueue[queueName];
  113557. var moduleToCheck = queue.pop();
  113558. seenModules[queueName] = seenModules[queueName] || {};
  113559. if (seenModules[queueName][moduleToCheck] || !sources[queueName][moduleToCheck])
  113560. continue;
  113561. seenModules[queueName][moduleToCheck] = true;
  113562. requiredModules[queueName] = requiredModules[queueName] || [];
  113563. requiredModules[queueName].push(moduleToCheck);
  113564. var newModules = getModuleDependencies(sources, sources[queueName][moduleToCheck], queueName);
  113565. var newModulesKeys = Object.keys(newModules);
  113566. for (var j = 0; j < newModulesKeys.length; j++) {
  113567. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]] || [];
  113568. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]].concat(newModules[newModulesKeys[j]]);
  113569. }
  113570. }
  113571. }
  113572. return requiredModules;
  113573. }
  113574. module3.exports = function(moduleId, options2) {
  113575. options2 = options2 || {};
  113576. var sources = {
  113577. main: __webpack_require__2.m
  113578. };
  113579. var requiredModules = options2.all ? { main: Object.keys(sources.main) } : getRequiredModules(sources, moduleId);
  113580. var src = "";
  113581. Object.keys(requiredModules).filter(function(m) {
  113582. return m !== "main";
  113583. }).forEach(function(module4) {
  113584. var entryModule = 0;
  113585. while (requiredModules[module4][entryModule]) {
  113586. entryModule++;
  113587. }
  113588. requiredModules[module4].push(entryModule);
  113589. sources[module4][entryModule] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })";
  113590. src = src + "var " + module4 + " = (" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(entryModule)) + ")({" + requiredModules[module4].map(function(id) {
  113591. return "" + JSON.stringify(id) + ": " + sources[module4][id].toString();
  113592. }).join(",") + "});\n";
  113593. });
  113594. src = src + "new ((" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(moduleId)) + ")({" + requiredModules.main.map(function(id) {
  113595. return "" + JSON.stringify(id) + ": " + sources.main[id].toString();
  113596. }).join(",") + "}))(self);";
  113597. var blob = new window.Blob([src], { type: "text/javascript" });
  113598. if (options2.bare) {
  113599. return blob;
  113600. }
  113601. var URL2 = window.URL || window.webkitURL || window.mozURL || window.msURL;
  113602. var workerUrl = URL2.createObjectURL(blob);
  113603. var worker = new window.Worker(workerUrl);
  113604. worker.objectURL = workerUrl;
  113605. return worker;
  113606. };
  113607. },
  113608. "./src/config.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113609. __webpack_require__2.r(__webpack_exports__2);
  113610. __webpack_require__2.d(__webpack_exports__2, {
  113611. "defaultConfig": function() {
  113612. return defaultConfig;
  113613. },
  113614. "createDefaultConfig": function() {
  113615. return createDefaultConfig;
  113616. }
  113617. });
  113618. var defaultConfig = {
  113619. enableWorker: false,
  113620. enableStashBuffer: true,
  113621. stashInitialSize: void 0,
  113622. isLive: false,
  113623. lazyLoad: true,
  113624. lazyLoadMaxDuration: 3 * 60,
  113625. lazyLoadRecoverDuration: 30,
  113626. deferLoadAfterSourceOpen: true,
  113627. autoCleanupMaxBackwardDuration: 3 * 60,
  113628. autoCleanupMinBackwardDuration: 2 * 60,
  113629. statisticsInfoReportInterval: 600,
  113630. fixAudioTimestampGap: true,
  113631. accurateSeek: false,
  113632. seekType: "range",
  113633. seekParamStart: "bstart",
  113634. seekParamEnd: "bend",
  113635. rangeLoadZeroStart: false,
  113636. customSeekHandler: void 0,
  113637. reuseRedirectedURL: false,
  113638. headers: void 0,
  113639. customLoader: void 0
  113640. };
  113641. function createDefaultConfig() {
  113642. return Object.assign({}, defaultConfig);
  113643. }
  113644. },
  113645. "./src/core/features.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113646. __webpack_require__2.r(__webpack_exports__2);
  113647. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/io-controller.js");
  113648. var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/config.js");
  113649. var Features = function() {
  113650. function Features2() {
  113651. }
  113652. Features2.supportMSEH264Playback = function() {
  113653. return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
  113654. };
  113655. Features2.supportNetworkStreamIO = function() {
  113656. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113657. var loaderType = ioctl.loaderType;
  113658. ioctl.destroy();
  113659. return loaderType == "fetch-stream-loader" || loaderType == "xhr-moz-chunked-loader";
  113660. };
  113661. Features2.getNetworkLoaderTypeName = function() {
  113662. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113663. var loaderType = ioctl.loaderType;
  113664. ioctl.destroy();
  113665. return loaderType;
  113666. };
  113667. Features2.supportNativeMediaPlayback = function(mimeType) {
  113668. if (Features2.videoElement == void 0) {
  113669. Features2.videoElement = window.document.createElement("video");
  113670. }
  113671. var canPlay = Features2.videoElement.canPlayType(mimeType);
  113672. return canPlay === "probably" || canPlay == "maybe";
  113673. };
  113674. Features2.getFeatureList = function() {
  113675. var features = {
  113676. mseFlvPlayback: false,
  113677. mseLiveFlvPlayback: false,
  113678. networkStreamIO: false,
  113679. networkLoaderName: "",
  113680. nativeMP4H264Playback: false,
  113681. nativeWebmVP8Playback: false,
  113682. nativeWebmVP9Playback: false
  113683. };
  113684. features.mseFlvPlayback = Features2.supportMSEH264Playback();
  113685. features.networkStreamIO = Features2.supportNetworkStreamIO();
  113686. features.networkLoaderName = Features2.getNetworkLoaderTypeName();
  113687. features.mseLiveFlvPlayback = features.mseFlvPlayback && features.networkStreamIO;
  113688. features.nativeMP4H264Playback = Features2.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"');
  113689. features.nativeWebmVP8Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"');
  113690. features.nativeWebmVP9Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp9"');
  113691. return features;
  113692. };
  113693. return Features2;
  113694. }();
  113695. __webpack_exports__2["default"] = Features;
  113696. },
  113697. "./src/core/media-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113698. __webpack_require__2.r(__webpack_exports__2);
  113699. var MediaInfo = function() {
  113700. function MediaInfo2() {
  113701. this.mimeType = null;
  113702. this.duration = null;
  113703. this.hasAudio = null;
  113704. this.hasVideo = null;
  113705. this.audioCodec = null;
  113706. this.videoCodec = null;
  113707. this.audioDataRate = null;
  113708. this.videoDataRate = null;
  113709. this.audioSampleRate = null;
  113710. this.audioChannelCount = null;
  113711. this.width = null;
  113712. this.height = null;
  113713. this.fps = null;
  113714. this.profile = null;
  113715. this.level = null;
  113716. this.refFrames = null;
  113717. this.chromaFormat = null;
  113718. this.sarNum = null;
  113719. this.sarDen = null;
  113720. this.metadata = null;
  113721. this.segments = null;
  113722. this.segmentCount = null;
  113723. this.hasKeyframesIndex = null;
  113724. this.keyframesIndex = null;
  113725. }
  113726. MediaInfo2.prototype.isComplete = function() {
  113727. var audioInfoComplete = this.hasAudio === false || this.hasAudio === true && this.audioCodec != null && this.audioSampleRate != null && this.audioChannelCount != null;
  113728. var videoInfoComplete = this.hasVideo === false || this.hasVideo === true && this.videoCodec != null && this.width != null && this.height != null && this.fps != null && this.profile != null && this.level != null && this.refFrames != null && this.chromaFormat != null && this.sarNum != null && this.sarDen != null;
  113729. return this.mimeType != null && this.duration != null && this.metadata != null && this.hasKeyframesIndex != null && audioInfoComplete && videoInfoComplete;
  113730. };
  113731. MediaInfo2.prototype.isSeekable = function() {
  113732. return this.hasKeyframesIndex === true;
  113733. };
  113734. MediaInfo2.prototype.getNearestKeyframe = function(milliseconds) {
  113735. if (this.keyframesIndex == null) {
  113736. return null;
  113737. }
  113738. var table = this.keyframesIndex;
  113739. var keyframeIdx = this._search(table.times, milliseconds);
  113740. return {
  113741. index: keyframeIdx,
  113742. milliseconds: table.times[keyframeIdx],
  113743. fileposition: table.filepositions[keyframeIdx]
  113744. };
  113745. };
  113746. MediaInfo2.prototype._search = function(list, value) {
  113747. var idx = 0;
  113748. var last = list.length - 1;
  113749. var mid = 0;
  113750. var lbound = 0;
  113751. var ubound = last;
  113752. if (value < list[0]) {
  113753. idx = 0;
  113754. lbound = ubound + 1;
  113755. }
  113756. while (lbound <= ubound) {
  113757. mid = lbound + Math.floor((ubound - lbound) / 2);
  113758. if (mid === last || value >= list[mid] && value < list[mid + 1]) {
  113759. idx = mid;
  113760. break;
  113761. } else if (list[mid] < value) {
  113762. lbound = mid + 1;
  113763. } else {
  113764. ubound = mid - 1;
  113765. }
  113766. }
  113767. return idx;
  113768. };
  113769. return MediaInfo2;
  113770. }();
  113771. __webpack_exports__2["default"] = MediaInfo;
  113772. },
  113773. "./src/core/media-segment-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113774. __webpack_require__2.r(__webpack_exports__2);
  113775. __webpack_require__2.d(__webpack_exports__2, {
  113776. "SampleInfo": function() {
  113777. return SampleInfo;
  113778. },
  113779. "MediaSegmentInfo": function() {
  113780. return MediaSegmentInfo;
  113781. },
  113782. "IDRSampleList": function() {
  113783. return IDRSampleList;
  113784. },
  113785. "MediaSegmentInfoList": function() {
  113786. return MediaSegmentInfoList;
  113787. }
  113788. });
  113789. var SampleInfo = function() {
  113790. function SampleInfo2(dts, pts, duration5, originalDts, isSync) {
  113791. this.dts = dts;
  113792. this.pts = pts;
  113793. this.duration = duration5;
  113794. this.originalDts = originalDts;
  113795. this.isSyncPoint = isSync;
  113796. this.fileposition = null;
  113797. }
  113798. return SampleInfo2;
  113799. }();
  113800. var MediaSegmentInfo = function() {
  113801. function MediaSegmentInfo2() {
  113802. this.beginDts = 0;
  113803. this.endDts = 0;
  113804. this.beginPts = 0;
  113805. this.endPts = 0;
  113806. this.originalBeginDts = 0;
  113807. this.originalEndDts = 0;
  113808. this.syncPoints = [];
  113809. this.firstSample = null;
  113810. this.lastSample = null;
  113811. }
  113812. MediaSegmentInfo2.prototype.appendSyncPoint = function(sampleInfo) {
  113813. sampleInfo.isSyncPoint = true;
  113814. this.syncPoints.push(sampleInfo);
  113815. };
  113816. return MediaSegmentInfo2;
  113817. }();
  113818. var IDRSampleList = function() {
  113819. function IDRSampleList2() {
  113820. this._list = [];
  113821. }
  113822. IDRSampleList2.prototype.clear = function() {
  113823. this._list = [];
  113824. };
  113825. IDRSampleList2.prototype.appendArray = function(syncPoints) {
  113826. var list = this._list;
  113827. if (syncPoints.length === 0) {
  113828. return;
  113829. }
  113830. if (list.length > 0 && syncPoints[0].originalDts < list[list.length - 1].originalDts) {
  113831. this.clear();
  113832. }
  113833. Array.prototype.push.apply(list, syncPoints);
  113834. };
  113835. IDRSampleList2.prototype.getLastSyncPointBeforeDts = function(dts) {
  113836. if (this._list.length == 0) {
  113837. return null;
  113838. }
  113839. var list = this._list;
  113840. var idx = 0;
  113841. var last = list.length - 1;
  113842. var mid = 0;
  113843. var lbound = 0;
  113844. var ubound = last;
  113845. if (dts < list[0].dts) {
  113846. idx = 0;
  113847. lbound = ubound + 1;
  113848. }
  113849. while (lbound <= ubound) {
  113850. mid = lbound + Math.floor((ubound - lbound) / 2);
  113851. if (mid === last || dts >= list[mid].dts && dts < list[mid + 1].dts) {
  113852. idx = mid;
  113853. break;
  113854. } else if (list[mid].dts < dts) {
  113855. lbound = mid + 1;
  113856. } else {
  113857. ubound = mid - 1;
  113858. }
  113859. }
  113860. return this._list[idx];
  113861. };
  113862. return IDRSampleList2;
  113863. }();
  113864. var MediaSegmentInfoList = function() {
  113865. function MediaSegmentInfoList2(type2) {
  113866. this._type = type2;
  113867. this._list = [];
  113868. this._lastAppendLocation = -1;
  113869. }
  113870. Object.defineProperty(MediaSegmentInfoList2.prototype, "type", {
  113871. get: function() {
  113872. return this._type;
  113873. },
  113874. enumerable: false,
  113875. configurable: true
  113876. });
  113877. Object.defineProperty(MediaSegmentInfoList2.prototype, "length", {
  113878. get: function() {
  113879. return this._list.length;
  113880. },
  113881. enumerable: false,
  113882. configurable: true
  113883. });
  113884. MediaSegmentInfoList2.prototype.isEmpty = function() {
  113885. return this._list.length === 0;
  113886. };
  113887. MediaSegmentInfoList2.prototype.clear = function() {
  113888. this._list = [];
  113889. this._lastAppendLocation = -1;
  113890. };
  113891. MediaSegmentInfoList2.prototype._searchNearestSegmentBefore = function(originalBeginDts) {
  113892. var list = this._list;
  113893. if (list.length === 0) {
  113894. return -2;
  113895. }
  113896. var last = list.length - 1;
  113897. var mid = 0;
  113898. var lbound = 0;
  113899. var ubound = last;
  113900. var idx = 0;
  113901. if (originalBeginDts < list[0].originalBeginDts) {
  113902. idx = -1;
  113903. return idx;
  113904. }
  113905. while (lbound <= ubound) {
  113906. mid = lbound + Math.floor((ubound - lbound) / 2);
  113907. if (mid === last || originalBeginDts > list[mid].lastSample.originalDts && originalBeginDts < list[mid + 1].originalBeginDts) {
  113908. idx = mid;
  113909. break;
  113910. } else if (list[mid].originalBeginDts < originalBeginDts) {
  113911. lbound = mid + 1;
  113912. } else {
  113913. ubound = mid - 1;
  113914. }
  113915. }
  113916. return idx;
  113917. };
  113918. MediaSegmentInfoList2.prototype._searchNearestSegmentAfter = function(originalBeginDts) {
  113919. return this._searchNearestSegmentBefore(originalBeginDts) + 1;
  113920. };
  113921. MediaSegmentInfoList2.prototype.append = function(mediaSegmentInfo) {
  113922. var list = this._list;
  113923. var msi = mediaSegmentInfo;
  113924. var lastAppendIdx = this._lastAppendLocation;
  113925. var insertIdx = 0;
  113926. if (lastAppendIdx !== -1 && lastAppendIdx < list.length && msi.originalBeginDts >= list[lastAppendIdx].lastSample.originalDts && (lastAppendIdx === list.length - 1 || lastAppendIdx < list.length - 1 && msi.originalBeginDts < list[lastAppendIdx + 1].originalBeginDts)) {
  113927. insertIdx = lastAppendIdx + 1;
  113928. } else {
  113929. if (list.length > 0) {
  113930. insertIdx = this._searchNearestSegmentBefore(msi.originalBeginDts) + 1;
  113931. }
  113932. }
  113933. this._lastAppendLocation = insertIdx;
  113934. this._list.splice(insertIdx, 0, msi);
  113935. };
  113936. MediaSegmentInfoList2.prototype.getLastSegmentBefore = function(originalBeginDts) {
  113937. var idx = this._searchNearestSegmentBefore(originalBeginDts);
  113938. if (idx >= 0) {
  113939. return this._list[idx];
  113940. } else {
  113941. return null;
  113942. }
  113943. };
  113944. MediaSegmentInfoList2.prototype.getLastSampleBefore = function(originalBeginDts) {
  113945. var segment = this.getLastSegmentBefore(originalBeginDts);
  113946. if (segment != null) {
  113947. return segment.lastSample;
  113948. } else {
  113949. return null;
  113950. }
  113951. };
  113952. MediaSegmentInfoList2.prototype.getLastSyncPointBefore = function(originalBeginDts) {
  113953. var segmentIdx = this._searchNearestSegmentBefore(originalBeginDts);
  113954. var syncPoints = this._list[segmentIdx].syncPoints;
  113955. while (syncPoints.length === 0 && segmentIdx > 0) {
  113956. segmentIdx--;
  113957. syncPoints = this._list[segmentIdx].syncPoints;
  113958. }
  113959. if (syncPoints.length > 0) {
  113960. return syncPoints[syncPoints.length - 1];
  113961. } else {
  113962. return null;
  113963. }
  113964. };
  113965. return MediaSegmentInfoList2;
  113966. }();
  113967. },
  113968. "./src/core/mse-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113969. __webpack_require__2.r(__webpack_exports__2);
  113970. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  113971. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  113972. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  113973. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  113974. var _mse_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/mse-events.js");
  113975. var _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  113976. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  113977. var MSEController = function() {
  113978. function MSEController2(config) {
  113979. this.TAG = "MSEController";
  113980. this._config = config;
  113981. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  113982. if (this._config.isLive && this._config.autoCleanupSourceBuffer == void 0) {
  113983. this._config.autoCleanupSourceBuffer = true;
  113984. }
  113985. this.e = {
  113986. onSourceOpen: this._onSourceOpen.bind(this),
  113987. onSourceEnded: this._onSourceEnded.bind(this),
  113988. onSourceClose: this._onSourceClose.bind(this),
  113989. onSourceBufferError: this._onSourceBufferError.bind(this),
  113990. onSourceBufferUpdateEnd: this._onSourceBufferUpdateEnd.bind(this)
  113991. };
  113992. this._mediaSource = null;
  113993. this._mediaSourceObjectURL = null;
  113994. this._mediaElement = null;
  113995. this._isBufferFull = false;
  113996. this._hasPendingEos = false;
  113997. this._requireSetMediaDuration = false;
  113998. this._pendingMediaDuration = 0;
  113999. this._pendingSourceBufferInit = [];
  114000. this._mimeTypes = {
  114001. video: null,
  114002. audio: null
  114003. };
  114004. this._sourceBuffers = {
  114005. video: null,
  114006. audio: null
  114007. };
  114008. this._lastInitSegments = {
  114009. video: null,
  114010. audio: null
  114011. };
  114012. this._pendingSegments = {
  114013. video: [],
  114014. audio: []
  114015. };
  114016. this._pendingRemoveRanges = {
  114017. video: [],
  114018. audio: []
  114019. };
  114020. this._idrList = new _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.IDRSampleList();
  114021. }
  114022. MSEController2.prototype.destroy = function() {
  114023. if (this._mediaElement || this._mediaSource) {
  114024. this.detachMediaElement();
  114025. }
  114026. this.e = null;
  114027. this._emitter.removeAllListeners();
  114028. this._emitter = null;
  114029. };
  114030. MSEController2.prototype.on = function(event2, listener) {
  114031. this._emitter.addListener(event2, listener);
  114032. };
  114033. MSEController2.prototype.off = function(event2, listener) {
  114034. this._emitter.removeListener(event2, listener);
  114035. };
  114036. MSEController2.prototype.attachMediaElement = function(mediaElement) {
  114037. if (this._mediaSource) {
  114038. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");
  114039. }
  114040. var ms = this._mediaSource = new window.MediaSource();
  114041. ms.addEventListener("sourceopen", this.e.onSourceOpen);
  114042. ms.addEventListener("sourceended", this.e.onSourceEnded);
  114043. ms.addEventListener("sourceclose", this.e.onSourceClose);
  114044. this._mediaElement = mediaElement;
  114045. this._mediaSourceObjectURL = window.URL.createObjectURL(this._mediaSource);
  114046. mediaElement.src = this._mediaSourceObjectURL;
  114047. };
  114048. MSEController2.prototype.detachMediaElement = function() {
  114049. if (this._mediaSource) {
  114050. var ms = this._mediaSource;
  114051. for (var type2 in this._sourceBuffers) {
  114052. var ps = this._pendingSegments[type2];
  114053. ps.splice(0, ps.length);
  114054. this._pendingSegments[type2] = null;
  114055. this._pendingRemoveRanges[type2] = null;
  114056. this._lastInitSegments[type2] = null;
  114057. var sb = this._sourceBuffers[type2];
  114058. if (sb) {
  114059. if (ms.readyState !== "closed") {
  114060. try {
  114061. ms.removeSourceBuffer(sb);
  114062. } catch (error) {
  114063. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114064. }
  114065. sb.removeEventListener("error", this.e.onSourceBufferError);
  114066. sb.removeEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114067. }
  114068. this._mimeTypes[type2] = null;
  114069. this._sourceBuffers[type2] = null;
  114070. }
  114071. }
  114072. if (ms.readyState === "open") {
  114073. try {
  114074. ms.endOfStream();
  114075. } catch (error) {
  114076. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114077. }
  114078. }
  114079. ms.removeEventListener("sourceopen", this.e.onSourceOpen);
  114080. ms.removeEventListener("sourceended", this.e.onSourceEnded);
  114081. ms.removeEventListener("sourceclose", this.e.onSourceClose);
  114082. this._pendingSourceBufferInit = [];
  114083. this._isBufferFull = false;
  114084. this._idrList.clear();
  114085. this._mediaSource = null;
  114086. }
  114087. if (this._mediaElement) {
  114088. this._mediaElement.src = "";
  114089. this._mediaElement.removeAttribute("src");
  114090. this._mediaElement = null;
  114091. }
  114092. if (this._mediaSourceObjectURL) {
  114093. window.URL.revokeObjectURL(this._mediaSourceObjectURL);
  114094. this._mediaSourceObjectURL = null;
  114095. }
  114096. };
  114097. MSEController2.prototype.appendInitSegment = function(initSegment, deferred) {
  114098. if (!this._mediaSource || this._mediaSource.readyState !== "open") {
  114099. this._pendingSourceBufferInit.push(initSegment);
  114100. this._pendingSegments[initSegment.type].push(initSegment);
  114101. return;
  114102. }
  114103. var is = initSegment;
  114104. var mimeType = "" + is.container;
  114105. if (is.codec && is.codec.length > 0) {
  114106. mimeType += ";codecs=" + is.codec;
  114107. }
  114108. var firstInitSegment = false;
  114109. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Received Initialization Segment, mimeType: " + mimeType);
  114110. this._lastInitSegments[is.type] = is;
  114111. if (mimeType !== this._mimeTypes[is.type]) {
  114112. if (!this._mimeTypes[is.type]) {
  114113. firstInitSegment = true;
  114114. try {
  114115. var sb = this._sourceBuffers[is.type] = this._mediaSource.addSourceBuffer(mimeType);
  114116. sb.addEventListener("error", this.e.onSourceBufferError);
  114117. sb.addEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114118. } catch (error) {
  114119. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114120. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114121. return;
  114122. }
  114123. } else {
  114124. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Notice: " + is.type + " mimeType changed, origin: " + this._mimeTypes[is.type] + ", target: " + mimeType);
  114125. }
  114126. this._mimeTypes[is.type] = mimeType;
  114127. }
  114128. if (!deferred) {
  114129. this._pendingSegments[is.type].push(is);
  114130. }
  114131. if (!firstInitSegment) {
  114132. if (this._sourceBuffers[is.type] && !this._sourceBuffers[is.type].updating) {
  114133. this._doAppendSegments();
  114134. }
  114135. }
  114136. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && is.container === "audio/mpeg" && is.mediaDuration > 0) {
  114137. this._requireSetMediaDuration = true;
  114138. this._pendingMediaDuration = is.mediaDuration / 1e3;
  114139. this._updateMediaSourceDuration();
  114140. }
  114141. };
  114142. MSEController2.prototype.appendMediaSegment = function(mediaSegment) {
  114143. var ms = mediaSegment;
  114144. this._pendingSegments[ms.type].push(ms);
  114145. if (this._config.autoCleanupSourceBuffer && this._needCleanupSourceBuffer()) {
  114146. this._doCleanupSourceBuffer();
  114147. }
  114148. var sb = this._sourceBuffers[ms.type];
  114149. if (sb && !sb.updating && !this._hasPendingRemoveRanges()) {
  114150. this._doAppendSegments();
  114151. }
  114152. };
  114153. MSEController2.prototype.seek = function(seconds) {
  114154. for (var type2 in this._sourceBuffers) {
  114155. if (!this._sourceBuffers[type2]) {
  114156. continue;
  114157. }
  114158. var sb = this._sourceBuffers[type2];
  114159. if (this._mediaSource.readyState === "open") {
  114160. try {
  114161. sb.abort();
  114162. } catch (error) {
  114163. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114164. }
  114165. }
  114166. this._idrList.clear();
  114167. var ps = this._pendingSegments[type2];
  114168. ps.splice(0, ps.length);
  114169. if (this._mediaSource.readyState === "closed") {
  114170. continue;
  114171. }
  114172. for (var i2 = 0; i2 < sb.buffered.length; i2++) {
  114173. var start2 = sb.buffered.start(i2);
  114174. var end = sb.buffered.end(i2);
  114175. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114176. }
  114177. if (!sb.updating) {
  114178. this._doRemoveRanges();
  114179. }
  114180. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  114181. var lastInitSegment = this._lastInitSegments[type2];
  114182. if (lastInitSegment) {
  114183. this._pendingSegments[type2].push(lastInitSegment);
  114184. if (!sb.updating) {
  114185. this._doAppendSegments();
  114186. }
  114187. }
  114188. }
  114189. }
  114190. };
  114191. MSEController2.prototype.endOfStream = function() {
  114192. var ms = this._mediaSource;
  114193. var sb = this._sourceBuffers;
  114194. if (!ms || ms.readyState !== "open") {
  114195. if (ms && ms.readyState === "closed" && this._hasPendingSegments()) {
  114196. this._hasPendingEos = true;
  114197. }
  114198. return;
  114199. }
  114200. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114201. this._hasPendingEos = true;
  114202. } else {
  114203. this._hasPendingEos = false;
  114204. ms.endOfStream();
  114205. }
  114206. };
  114207. MSEController2.prototype.getNearestKeyframe = function(dts) {
  114208. return this._idrList.getLastSyncPointBeforeDts(dts);
  114209. };
  114210. MSEController2.prototype._needCleanupSourceBuffer = function() {
  114211. if (!this._config.autoCleanupSourceBuffer) {
  114212. return false;
  114213. }
  114214. var currentTime = this._mediaElement.currentTime;
  114215. for (var type2 in this._sourceBuffers) {
  114216. var sb = this._sourceBuffers[type2];
  114217. if (sb) {
  114218. var buffered = sb.buffered;
  114219. if (buffered.length >= 1) {
  114220. if (currentTime - buffered.start(0) >= this._config.autoCleanupMaxBackwardDuration) {
  114221. return true;
  114222. }
  114223. }
  114224. }
  114225. }
  114226. return false;
  114227. };
  114228. MSEController2.prototype._doCleanupSourceBuffer = function() {
  114229. var currentTime = this._mediaElement.currentTime;
  114230. for (var type2 in this._sourceBuffers) {
  114231. var sb = this._sourceBuffers[type2];
  114232. if (sb) {
  114233. var buffered = sb.buffered;
  114234. var doRemove = false;
  114235. for (var i2 = 0; i2 < buffered.length; i2++) {
  114236. var start2 = buffered.start(i2);
  114237. var end = buffered.end(i2);
  114238. if (start2 <= currentTime && currentTime < end + 3) {
  114239. if (currentTime - start2 >= this._config.autoCleanupMaxBackwardDuration) {
  114240. doRemove = true;
  114241. var removeEnd = currentTime - this._config.autoCleanupMinBackwardDuration;
  114242. this._pendingRemoveRanges[type2].push({ start: start2, end: removeEnd });
  114243. }
  114244. } else if (end < currentTime) {
  114245. doRemove = true;
  114246. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114247. }
  114248. }
  114249. if (doRemove && !sb.updating) {
  114250. this._doRemoveRanges();
  114251. }
  114252. }
  114253. }
  114254. };
  114255. MSEController2.prototype._updateMediaSourceDuration = function() {
  114256. var sb = this._sourceBuffers;
  114257. if (this._mediaElement.readyState === 0 || this._mediaSource.readyState !== "open") {
  114258. return;
  114259. }
  114260. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114261. return;
  114262. }
  114263. var current = this._mediaSource.duration;
  114264. var target = this._pendingMediaDuration;
  114265. if (target > 0 && (isNaN(current) || target > current)) {
  114266. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MediaSource duration from " + current + " to " + target);
  114267. this._mediaSource.duration = target;
  114268. }
  114269. this._requireSetMediaDuration = false;
  114270. this._pendingMediaDuration = 0;
  114271. };
  114272. MSEController2.prototype._doRemoveRanges = function() {
  114273. for (var type2 in this._pendingRemoveRanges) {
  114274. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114275. continue;
  114276. }
  114277. var sb = this._sourceBuffers[type2];
  114278. var ranges = this._pendingRemoveRanges[type2];
  114279. while (ranges.length && !sb.updating) {
  114280. var range3 = ranges.shift();
  114281. sb.remove(range3.start, range3.end);
  114282. }
  114283. }
  114284. };
  114285. MSEController2.prototype._doAppendSegments = function() {
  114286. var pendingSegments = this._pendingSegments;
  114287. for (var type2 in pendingSegments) {
  114288. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114289. continue;
  114290. }
  114291. if (pendingSegments[type2].length > 0) {
  114292. var segment = pendingSegments[type2].shift();
  114293. if (segment.timestampOffset) {
  114294. var currentOffset = this._sourceBuffers[type2].timestampOffset;
  114295. var targetOffset = segment.timestampOffset / 1e3;
  114296. var delta = Math.abs(currentOffset - targetOffset);
  114297. if (delta > 0.1) {
  114298. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MPEG audio timestampOffset from " + currentOffset + " to " + targetOffset);
  114299. this._sourceBuffers[type2].timestampOffset = targetOffset;
  114300. }
  114301. delete segment.timestampOffset;
  114302. }
  114303. if (!segment.data || segment.data.byteLength === 0) {
  114304. continue;
  114305. }
  114306. try {
  114307. this._sourceBuffers[type2].appendBuffer(segment.data);
  114308. this._isBufferFull = false;
  114309. if (type2 === "video" && segment.hasOwnProperty("info")) {
  114310. this._idrList.appendArray(segment.info.syncPoints);
  114311. }
  114312. } catch (error) {
  114313. this._pendingSegments[type2].unshift(segment);
  114314. if (error.code === 22) {
  114315. if (!this._isBufferFull) {
  114316. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.BUFFER_FULL);
  114317. }
  114318. this._isBufferFull = true;
  114319. } else {
  114320. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114321. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114322. }
  114323. }
  114324. }
  114325. }
  114326. };
  114327. MSEController2.prototype._onSourceOpen = function() {
  114328. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceOpen");
  114329. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114330. if (this._pendingSourceBufferInit.length > 0) {
  114331. var pendings = this._pendingSourceBufferInit;
  114332. while (pendings.length) {
  114333. var segment = pendings.shift();
  114334. this.appendInitSegment(segment, true);
  114335. }
  114336. }
  114337. if (this._hasPendingSegments()) {
  114338. this._doAppendSegments();
  114339. }
  114340. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SOURCE_OPEN);
  114341. };
  114342. MSEController2.prototype._onSourceEnded = function() {
  114343. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceEnded");
  114344. };
  114345. MSEController2.prototype._onSourceClose = function() {
  114346. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceClose");
  114347. if (this._mediaSource && this.e != null) {
  114348. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114349. this._mediaSource.removeEventListener("sourceended", this.e.onSourceEnded);
  114350. this._mediaSource.removeEventListener("sourceclose", this.e.onSourceClose);
  114351. }
  114352. };
  114353. MSEController2.prototype._hasPendingSegments = function() {
  114354. var ps = this._pendingSegments;
  114355. return ps.video.length > 0 || ps.audio.length > 0;
  114356. };
  114357. MSEController2.prototype._hasPendingRemoveRanges = function() {
  114358. var prr = this._pendingRemoveRanges;
  114359. return prr.video.length > 0 || prr.audio.length > 0;
  114360. };
  114361. MSEController2.prototype._onSourceBufferUpdateEnd = function() {
  114362. if (this._requireSetMediaDuration) {
  114363. this._updateMediaSourceDuration();
  114364. } else if (this._hasPendingRemoveRanges()) {
  114365. this._doRemoveRanges();
  114366. } else if (this._hasPendingSegments()) {
  114367. this._doAppendSegments();
  114368. } else if (this._hasPendingEos) {
  114369. this.endOfStream();
  114370. }
  114371. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.UPDATE_END);
  114372. };
  114373. MSEController2.prototype._onSourceBufferError = function(e) {
  114374. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "SourceBuffer Error: " + e);
  114375. };
  114376. return MSEController2;
  114377. }();
  114378. __webpack_exports__2["default"] = MSEController;
  114379. },
  114380. "./src/core/mse-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114381. __webpack_require__2.r(__webpack_exports__2);
  114382. var MSEEvents = {
  114383. ERROR: "error",
  114384. SOURCE_OPEN: "source_open",
  114385. UPDATE_END: "update_end",
  114386. BUFFER_FULL: "buffer_full"
  114387. };
  114388. __webpack_exports__2["default"] = MSEEvents;
  114389. },
  114390. "./src/core/transmuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114391. __webpack_require__2.r(__webpack_exports__2);
  114392. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114393. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114394. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./node_modules/webworkify-webpack/index.js");
  114395. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default = /* @__PURE__ */ __webpack_require__2.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__);
  114396. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/logger.js");
  114397. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/logging-control.js");
  114398. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  114399. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114400. var _media_info_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/media-info.js");
  114401. var Transmuxer = function() {
  114402. function Transmuxer2(mediaDataSource, config) {
  114403. this.TAG = "Transmuxer";
  114404. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114405. if (config.enableWorker && typeof Worker !== "undefined") {
  114406. try {
  114407. this._worker = webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default()("./src/core/transmuxing-worker.js");
  114408. this._workerDestroying = false;
  114409. this._worker.addEventListener("message", this._onWorkerMessage.bind(this));
  114410. this._worker.postMessage({ cmd: "init", param: [mediaDataSource, config] });
  114411. this.e = {
  114412. onLoggingConfigChanged: this._onLoggingConfigChanged.bind(this)
  114413. };
  114414. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.registerListener(this.e.onLoggingConfigChanged);
  114415. this._worker.postMessage({ cmd: "logging_config", param: _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.getConfig() });
  114416. } catch (error) {
  114417. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing");
  114418. this._worker = null;
  114419. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114420. }
  114421. } else {
  114422. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114423. }
  114424. if (this._controller) {
  114425. var ctl = this._controller;
  114426. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, this._onIOError.bind(this));
  114427. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, this._onDemuxError.bind(this));
  114428. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, this._onInitSegment.bind(this));
  114429. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, this._onMediaSegment.bind(this));
  114430. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, this._onLoadingComplete.bind(this));
  114431. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, this._onRecoveredEarlyEof.bind(this));
  114432. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, this._onMediaInfo.bind(this));
  114433. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, this._onMetaDataArrived.bind(this));
  114434. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, this._onScriptDataArrived.bind(this));
  114435. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, this._onStatisticsInfo.bind(this));
  114436. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this));
  114437. }
  114438. }
  114439. Transmuxer2.prototype.destroy = function() {
  114440. if (this._worker) {
  114441. if (!this._workerDestroying) {
  114442. this._workerDestroying = true;
  114443. this._worker.postMessage({ cmd: "destroy" });
  114444. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.removeListener(this.e.onLoggingConfigChanged);
  114445. this.e = null;
  114446. }
  114447. } else {
  114448. this._controller.destroy();
  114449. this._controller = null;
  114450. }
  114451. this._emitter.removeAllListeners();
  114452. this._emitter = null;
  114453. };
  114454. Transmuxer2.prototype.on = function(event2, listener) {
  114455. this._emitter.addListener(event2, listener);
  114456. };
  114457. Transmuxer2.prototype.off = function(event2, listener) {
  114458. this._emitter.removeListener(event2, listener);
  114459. };
  114460. Transmuxer2.prototype.hasWorker = function() {
  114461. return this._worker != null;
  114462. };
  114463. Transmuxer2.prototype.open = function() {
  114464. if (this._worker) {
  114465. this._worker.postMessage({ cmd: "start" });
  114466. } else {
  114467. this._controller.start();
  114468. }
  114469. };
  114470. Transmuxer2.prototype.close = function() {
  114471. if (this._worker) {
  114472. this._worker.postMessage({ cmd: "stop" });
  114473. } else {
  114474. this._controller.stop();
  114475. }
  114476. };
  114477. Transmuxer2.prototype.seek = function(milliseconds) {
  114478. if (this._worker) {
  114479. this._worker.postMessage({ cmd: "seek", param: milliseconds });
  114480. } else {
  114481. this._controller.seek(milliseconds);
  114482. }
  114483. };
  114484. Transmuxer2.prototype.pause = function() {
  114485. if (this._worker) {
  114486. this._worker.postMessage({ cmd: "pause" });
  114487. } else {
  114488. this._controller.pause();
  114489. }
  114490. };
  114491. Transmuxer2.prototype.resume = function() {
  114492. if (this._worker) {
  114493. this._worker.postMessage({ cmd: "resume" });
  114494. } else {
  114495. this._controller.resume();
  114496. }
  114497. };
  114498. Transmuxer2.prototype._onInitSegment = function(type2, initSegment) {
  114499. var _this = this;
  114500. Promise.resolve().then(function() {
  114501. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, type2, initSegment);
  114502. });
  114503. };
  114504. Transmuxer2.prototype._onMediaSegment = function(type2, mediaSegment) {
  114505. var _this = this;
  114506. Promise.resolve().then(function() {
  114507. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114508. });
  114509. };
  114510. Transmuxer2.prototype._onLoadingComplete = function() {
  114511. var _this = this;
  114512. Promise.resolve().then(function() {
  114513. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE);
  114514. });
  114515. };
  114516. Transmuxer2.prototype._onRecoveredEarlyEof = function() {
  114517. var _this = this;
  114518. Promise.resolve().then(function() {
  114519. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF);
  114520. });
  114521. };
  114522. Transmuxer2.prototype._onMediaInfo = function(mediaInfo) {
  114523. var _this = this;
  114524. Promise.resolve().then(function() {
  114525. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, mediaInfo);
  114526. });
  114527. };
  114528. Transmuxer2.prototype._onMetaDataArrived = function(metadata) {
  114529. var _this = this;
  114530. Promise.resolve().then(function() {
  114531. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, metadata);
  114532. });
  114533. };
  114534. Transmuxer2.prototype._onScriptDataArrived = function(data) {
  114535. var _this = this;
  114536. Promise.resolve().then(function() {
  114537. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, data);
  114538. });
  114539. };
  114540. Transmuxer2.prototype._onStatisticsInfo = function(statisticsInfo) {
  114541. var _this = this;
  114542. Promise.resolve().then(function() {
  114543. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, statisticsInfo);
  114544. });
  114545. };
  114546. Transmuxer2.prototype._onIOError = function(type2, info) {
  114547. var _this = this;
  114548. Promise.resolve().then(function() {
  114549. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, type2, info);
  114550. });
  114551. };
  114552. Transmuxer2.prototype._onDemuxError = function(type2, info) {
  114553. var _this = this;
  114554. Promise.resolve().then(function() {
  114555. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, type2, info);
  114556. });
  114557. };
  114558. Transmuxer2.prototype._onRecommendSeekpoint = function(milliseconds) {
  114559. var _this = this;
  114560. Promise.resolve().then(function() {
  114561. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, milliseconds);
  114562. });
  114563. };
  114564. Transmuxer2.prototype._onLoggingConfigChanged = function(config) {
  114565. if (this._worker) {
  114566. this._worker.postMessage({ cmd: "logging_config", param: config });
  114567. }
  114568. };
  114569. Transmuxer2.prototype._onWorkerMessage = function(e) {
  114570. var message = e.data;
  114571. var data = message.data;
  114572. if (message.msg === "destroyed" || this._workerDestroying) {
  114573. this._workerDestroying = false;
  114574. this._worker.terminate();
  114575. this._worker = null;
  114576. return;
  114577. }
  114578. switch (message.msg) {
  114579. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT:
  114580. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT:
  114581. this._emitter.emit(message.msg, data.type, data.data);
  114582. break;
  114583. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE:
  114584. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF:
  114585. this._emitter.emit(message.msg);
  114586. break;
  114587. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO:
  114588. Object.setPrototypeOf(data, _media_info_js__WEBPACK_IMPORTED_MODULE_6__.default.prototype);
  114589. this._emitter.emit(message.msg, data);
  114590. break;
  114591. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED:
  114592. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED:
  114593. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO:
  114594. this._emitter.emit(message.msg, data);
  114595. break;
  114596. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR:
  114597. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR:
  114598. this._emitter.emit(message.msg, data.type, data.info);
  114599. break;
  114600. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT:
  114601. this._emitter.emit(message.msg, data);
  114602. break;
  114603. case "logcat_callback":
  114604. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.emitter.emit("log", data.type, data.logcat);
  114605. break;
  114606. }
  114607. };
  114608. return Transmuxer2;
  114609. }();
  114610. __webpack_exports__2["default"] = Transmuxer;
  114611. },
  114612. "./src/core/transmuxing-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114613. __webpack_require__2.r(__webpack_exports__2);
  114614. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114615. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114616. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  114617. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  114618. var _media_info_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/media-info.js");
  114619. var _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/demux/flv-demuxer.js");
  114620. var _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/remux/mp4-remuxer.js");
  114621. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/demux/demux-errors.js");
  114622. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/io-controller.js");
  114623. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114624. var TransmuxingController = function() {
  114625. function TransmuxingController2(mediaDataSource, config) {
  114626. this.TAG = "TransmuxingController";
  114627. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114628. this._config = config;
  114629. if (!mediaDataSource.segments) {
  114630. mediaDataSource.segments = [{
  114631. duration: mediaDataSource.duration,
  114632. filesize: mediaDataSource.filesize,
  114633. url: mediaDataSource.url
  114634. }];
  114635. }
  114636. if (typeof mediaDataSource.cors !== "boolean") {
  114637. mediaDataSource.cors = true;
  114638. }
  114639. if (typeof mediaDataSource.withCredentials !== "boolean") {
  114640. mediaDataSource.withCredentials = false;
  114641. }
  114642. this._mediaDataSource = mediaDataSource;
  114643. this._currentSegmentIndex = 0;
  114644. var totalDuration = 0;
  114645. this._mediaDataSource.segments.forEach(function(segment) {
  114646. segment.timestampBase = totalDuration;
  114647. totalDuration += segment.duration;
  114648. segment.cors = mediaDataSource.cors;
  114649. segment.withCredentials = mediaDataSource.withCredentials;
  114650. if (config.referrerPolicy) {
  114651. segment.referrerPolicy = config.referrerPolicy;
  114652. }
  114653. });
  114654. if (!isNaN(totalDuration) && this._mediaDataSource.duration !== totalDuration) {
  114655. this._mediaDataSource.duration = totalDuration;
  114656. }
  114657. this._mediaInfo = null;
  114658. this._demuxer = null;
  114659. this._remuxer = null;
  114660. this._ioctl = null;
  114661. this._pendingSeekTime = null;
  114662. this._pendingResolveSeekPoint = null;
  114663. this._statisticsReporter = null;
  114664. }
  114665. TransmuxingController2.prototype.destroy = function() {
  114666. this._mediaInfo = null;
  114667. this._mediaDataSource = null;
  114668. if (this._statisticsReporter) {
  114669. this._disableStatisticsReporter();
  114670. }
  114671. if (this._ioctl) {
  114672. this._ioctl.destroy();
  114673. this._ioctl = null;
  114674. }
  114675. if (this._demuxer) {
  114676. this._demuxer.destroy();
  114677. this._demuxer = null;
  114678. }
  114679. if (this._remuxer) {
  114680. this._remuxer.destroy();
  114681. this._remuxer = null;
  114682. }
  114683. this._emitter.removeAllListeners();
  114684. this._emitter = null;
  114685. };
  114686. TransmuxingController2.prototype.on = function(event2, listener) {
  114687. this._emitter.addListener(event2, listener);
  114688. };
  114689. TransmuxingController2.prototype.off = function(event2, listener) {
  114690. this._emitter.removeListener(event2, listener);
  114691. };
  114692. TransmuxingController2.prototype.start = function() {
  114693. this._loadSegment(0);
  114694. this._enableStatisticsReporter();
  114695. };
  114696. TransmuxingController2.prototype._loadSegment = function(segmentIndex, optionalFrom) {
  114697. this._currentSegmentIndex = segmentIndex;
  114698. var dataSource = this._mediaDataSource.segments[segmentIndex];
  114699. var ioctl = this._ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__.default(dataSource, this._config, segmentIndex);
  114700. ioctl.onError = this._onIOException.bind(this);
  114701. ioctl.onSeeked = this._onIOSeeked.bind(this);
  114702. ioctl.onComplete = this._onIOComplete.bind(this);
  114703. ioctl.onRedirect = this._onIORedirect.bind(this);
  114704. ioctl.onRecoveredEarlyEof = this._onIORecoveredEarlyEof.bind(this);
  114705. if (optionalFrom) {
  114706. this._demuxer.bindDataSource(this._ioctl);
  114707. } else {
  114708. ioctl.onDataArrival = this._onInitChunkArrival.bind(this);
  114709. }
  114710. ioctl.open(optionalFrom);
  114711. };
  114712. TransmuxingController2.prototype.stop = function() {
  114713. this._internalAbort();
  114714. this._disableStatisticsReporter();
  114715. };
  114716. TransmuxingController2.prototype._internalAbort = function() {
  114717. if (this._ioctl) {
  114718. this._ioctl.destroy();
  114719. this._ioctl = null;
  114720. }
  114721. };
  114722. TransmuxingController2.prototype.pause = function() {
  114723. if (this._ioctl && this._ioctl.isWorking()) {
  114724. this._ioctl.pause();
  114725. this._disableStatisticsReporter();
  114726. }
  114727. };
  114728. TransmuxingController2.prototype.resume = function() {
  114729. if (this._ioctl && this._ioctl.isPaused()) {
  114730. this._ioctl.resume();
  114731. this._enableStatisticsReporter();
  114732. }
  114733. };
  114734. TransmuxingController2.prototype.seek = function(milliseconds) {
  114735. if (this._mediaInfo == null || !this._mediaInfo.isSeekable()) {
  114736. return;
  114737. }
  114738. var targetSegmentIndex = this._searchSegmentIndexContains(milliseconds);
  114739. if (targetSegmentIndex === this._currentSegmentIndex) {
  114740. var segmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114741. if (segmentInfo == void 0) {
  114742. this._pendingSeekTime = milliseconds;
  114743. } else {
  114744. var keyframe = segmentInfo.getNearestKeyframe(milliseconds);
  114745. this._remuxer.seek(keyframe.milliseconds);
  114746. this._ioctl.seek(keyframe.fileposition);
  114747. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114748. }
  114749. } else {
  114750. var targetSegmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114751. if (targetSegmentInfo == void 0) {
  114752. this._pendingSeekTime = milliseconds;
  114753. this._internalAbort();
  114754. this._remuxer.seek();
  114755. this._remuxer.insertDiscontinuity();
  114756. this._loadSegment(targetSegmentIndex);
  114757. } else {
  114758. var keyframe = targetSegmentInfo.getNearestKeyframe(milliseconds);
  114759. this._internalAbort();
  114760. this._remuxer.seek(milliseconds);
  114761. this._remuxer.insertDiscontinuity();
  114762. this._demuxer.resetMediaInfo();
  114763. this._demuxer.timestampBase = this._mediaDataSource.segments[targetSegmentIndex].timestampBase;
  114764. this._loadSegment(targetSegmentIndex, keyframe.fileposition);
  114765. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114766. this._reportSegmentMediaInfo(targetSegmentIndex);
  114767. }
  114768. }
  114769. this._enableStatisticsReporter();
  114770. };
  114771. TransmuxingController2.prototype._searchSegmentIndexContains = function(milliseconds) {
  114772. var segments = this._mediaDataSource.segments;
  114773. var idx = segments.length - 1;
  114774. for (var i2 = 0; i2 < segments.length; i2++) {
  114775. if (milliseconds < segments[i2].timestampBase) {
  114776. idx = i2 - 1;
  114777. break;
  114778. }
  114779. }
  114780. return idx;
  114781. };
  114782. TransmuxingController2.prototype._onInitChunkArrival = function(data, byteStart) {
  114783. var _this = this;
  114784. var probeData = null;
  114785. var consumed = 0;
  114786. if (byteStart > 0) {
  114787. this._demuxer.bindDataSource(this._ioctl);
  114788. this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase;
  114789. consumed = this._demuxer.parseChunks(data, byteStart);
  114790. } else if ((probeData = _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default.probe(data)).match) {
  114791. this._demuxer = new _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(probeData, this._config);
  114792. if (!this._remuxer) {
  114793. this._remuxer = new _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__.default(this._config);
  114794. }
  114795. var mds = this._mediaDataSource;
  114796. if (mds.duration != void 0 && !isNaN(mds.duration)) {
  114797. this._demuxer.overridedDuration = mds.duration;
  114798. }
  114799. if (typeof mds.hasAudio === "boolean") {
  114800. this._demuxer.overridedHasAudio = mds.hasAudio;
  114801. }
  114802. if (typeof mds.hasVideo === "boolean") {
  114803. this._demuxer.overridedHasVideo = mds.hasVideo;
  114804. }
  114805. this._demuxer.timestampBase = mds.segments[this._currentSegmentIndex].timestampBase;
  114806. this._demuxer.onError = this._onDemuxException.bind(this);
  114807. this._demuxer.onMediaInfo = this._onMediaInfo.bind(this);
  114808. this._demuxer.onMetaDataArrived = this._onMetaDataArrived.bind(this);
  114809. this._demuxer.onScriptDataArrived = this._onScriptDataArrived.bind(this);
  114810. this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl));
  114811. this._remuxer.onInitSegment = this._onRemuxerInitSegmentArrival.bind(this);
  114812. this._remuxer.onMediaSegment = this._onRemuxerMediaSegmentArrival.bind(this);
  114813. consumed = this._demuxer.parseChunks(data, byteStart);
  114814. } else {
  114815. probeData = null;
  114816. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "Non-FLV, Unsupported media type!");
  114817. Promise.resolve().then(function() {
  114818. _this._internalAbort();
  114819. });
  114820. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__.default.FORMAT_UNSUPPORTED, "Non-FLV, Unsupported media type");
  114821. consumed = 0;
  114822. }
  114823. return consumed;
  114824. };
  114825. TransmuxingController2.prototype._onMediaInfo = function(mediaInfo) {
  114826. var _this = this;
  114827. if (this._mediaInfo == null) {
  114828. this._mediaInfo = Object.assign({}, mediaInfo);
  114829. this._mediaInfo.keyframesIndex = null;
  114830. this._mediaInfo.segments = [];
  114831. this._mediaInfo.segmentCount = this._mediaDataSource.segments.length;
  114832. Object.setPrototypeOf(this._mediaInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114833. }
  114834. var segmentInfo = Object.assign({}, mediaInfo);
  114835. Object.setPrototypeOf(segmentInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114836. this._mediaInfo.segments[this._currentSegmentIndex] = segmentInfo;
  114837. this._reportSegmentMediaInfo(this._currentSegmentIndex);
  114838. if (this._pendingSeekTime != null) {
  114839. Promise.resolve().then(function() {
  114840. var target = _this._pendingSeekTime;
  114841. _this._pendingSeekTime = null;
  114842. _this.seek(target);
  114843. });
  114844. }
  114845. };
  114846. TransmuxingController2.prototype._onMetaDataArrived = function(metadata) {
  114847. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.METADATA_ARRIVED, metadata);
  114848. };
  114849. TransmuxingController2.prototype._onScriptDataArrived = function(data) {
  114850. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.SCRIPTDATA_ARRIVED, data);
  114851. };
  114852. TransmuxingController2.prototype._onIOSeeked = function() {
  114853. this._remuxer.insertDiscontinuity();
  114854. };
  114855. TransmuxingController2.prototype._onIOComplete = function(extraData) {
  114856. var segmentIndex = extraData;
  114857. var nextSegmentIndex = segmentIndex + 1;
  114858. if (nextSegmentIndex < this._mediaDataSource.segments.length) {
  114859. this._internalAbort();
  114860. this._remuxer.flushStashedSamples();
  114861. this._loadSegment(nextSegmentIndex);
  114862. } else {
  114863. this._remuxer.flushStashedSamples();
  114864. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.LOADING_COMPLETE);
  114865. this._disableStatisticsReporter();
  114866. }
  114867. };
  114868. TransmuxingController2.prototype._onIORedirect = function(redirectedURL) {
  114869. var segmentIndex = this._ioctl.extraData;
  114870. this._mediaDataSource.segments[segmentIndex].redirectedURL = redirectedURL;
  114871. };
  114872. TransmuxingController2.prototype._onIORecoveredEarlyEof = function() {
  114873. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOVERED_EARLY_EOF);
  114874. };
  114875. TransmuxingController2.prototype._onIOException = function(type2, info) {
  114876. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "IOException: type = " + type2 + ", code = " + info.code + ", msg = " + info.msg);
  114877. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.IO_ERROR, type2, info);
  114878. this._disableStatisticsReporter();
  114879. };
  114880. TransmuxingController2.prototype._onDemuxException = function(type2, info) {
  114881. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "DemuxException: type = " + type2 + ", info = " + info);
  114882. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, type2, info);
  114883. };
  114884. TransmuxingController2.prototype._onRemuxerInitSegmentArrival = function(type2, initSegment) {
  114885. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.INIT_SEGMENT, type2, initSegment);
  114886. };
  114887. TransmuxingController2.prototype._onRemuxerMediaSegmentArrival = function(type2, mediaSegment) {
  114888. if (this._pendingSeekTime != null) {
  114889. return;
  114890. }
  114891. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114892. if (this._pendingResolveSeekPoint != null && type2 === "video") {
  114893. var syncPoints = mediaSegment.info.syncPoints;
  114894. var seekpoint = this._pendingResolveSeekPoint;
  114895. this._pendingResolveSeekPoint = null;
  114896. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && syncPoints.length > 0 && syncPoints[0].originalDts === seekpoint) {
  114897. seekpoint = syncPoints[0].pts;
  114898. }
  114899. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOMMEND_SEEKPOINT, seekpoint);
  114900. }
  114901. };
  114902. TransmuxingController2.prototype._enableStatisticsReporter = function() {
  114903. if (this._statisticsReporter == null) {
  114904. this._statisticsReporter = self.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  114905. }
  114906. };
  114907. TransmuxingController2.prototype._disableStatisticsReporter = function() {
  114908. if (this._statisticsReporter) {
  114909. self.clearInterval(this._statisticsReporter);
  114910. this._statisticsReporter = null;
  114911. }
  114912. };
  114913. TransmuxingController2.prototype._reportSegmentMediaInfo = function(segmentIndex) {
  114914. var segmentInfo = this._mediaInfo.segments[segmentIndex];
  114915. var exportInfo = Object.assign({}, segmentInfo);
  114916. exportInfo.duration = this._mediaInfo.duration;
  114917. exportInfo.segmentCount = this._mediaInfo.segmentCount;
  114918. delete exportInfo.segments;
  114919. delete exportInfo.keyframesIndex;
  114920. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_INFO, exportInfo);
  114921. };
  114922. TransmuxingController2.prototype._reportStatisticsInfo = function() {
  114923. var info = {};
  114924. info.url = this._ioctl.currentURL;
  114925. info.hasRedirect = this._ioctl.hasRedirect;
  114926. if (info.hasRedirect) {
  114927. info.redirectedURL = this._ioctl.currentRedirectedURL;
  114928. }
  114929. info.speed = this._ioctl.currentSpeed;
  114930. info.loaderType = this._ioctl.loaderType;
  114931. info.currentSegmentIndex = this._currentSegmentIndex;
  114932. info.totalSegmentCount = this._mediaDataSource.segments.length;
  114933. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.STATISTICS_INFO, info);
  114934. };
  114935. return TransmuxingController2;
  114936. }();
  114937. __webpack_exports__2["default"] = TransmuxingController;
  114938. },
  114939. "./src/core/transmuxing-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114940. __webpack_require__2.r(__webpack_exports__2);
  114941. var TransmuxingEvents = {
  114942. IO_ERROR: "io_error",
  114943. DEMUX_ERROR: "demux_error",
  114944. INIT_SEGMENT: "init_segment",
  114945. MEDIA_SEGMENT: "media_segment",
  114946. LOADING_COMPLETE: "loading_complete",
  114947. RECOVERED_EARLY_EOF: "recovered_early_eof",
  114948. MEDIA_INFO: "media_info",
  114949. METADATA_ARRIVED: "metadata_arrived",
  114950. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  114951. STATISTICS_INFO: "statistics_info",
  114952. RECOMMEND_SEEKPOINT: "recommend_seekpoint"
  114953. };
  114954. __webpack_exports__2["default"] = TransmuxingEvents;
  114955. },
  114956. "./src/core/transmuxing-worker.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114957. __webpack_require__2.r(__webpack_exports__2);
  114958. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logging-control.js");
  114959. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/polyfill.js");
  114960. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  114961. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114962. var TransmuxingWorker = function(self2) {
  114963. var controller = null;
  114964. var logcatListener = onLogcatCallback.bind(this);
  114965. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__.default.install();
  114966. self2.addEventListener("message", function(e) {
  114967. switch (e.data.cmd) {
  114968. case "init":
  114969. controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__.default(e.data.param[0], e.data.param[1]);
  114970. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR, onIOError.bind(this));
  114971. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR, onDemuxError.bind(this));
  114972. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT, onInitSegment.bind(this));
  114973. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT, onMediaSegment.bind(this));
  114974. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE, onLoadingComplete.bind(this));
  114975. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF, onRecoveredEarlyEof.bind(this));
  114976. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, onMediaInfo.bind(this));
  114977. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, onMetaDataArrived.bind(this));
  114978. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, onScriptDataArrived.bind(this));
  114979. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, onStatisticsInfo.bind(this));
  114980. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT, onRecommendSeekpoint.bind(this));
  114981. break;
  114982. case "destroy":
  114983. if (controller) {
  114984. controller.destroy();
  114985. controller = null;
  114986. }
  114987. self2.postMessage({ msg: "destroyed" });
  114988. break;
  114989. case "start":
  114990. controller.start();
  114991. break;
  114992. case "stop":
  114993. controller.stop();
  114994. break;
  114995. case "seek":
  114996. controller.seek(e.data.param);
  114997. break;
  114998. case "pause":
  114999. controller.pause();
  115000. break;
  115001. case "resume":
  115002. controller.resume();
  115003. break;
  115004. case "logging_config": {
  115005. var config = e.data.param;
  115006. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.applyConfig(config);
  115007. if (config.enableCallback === true) {
  115008. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.addLogListener(logcatListener);
  115009. } else {
  115010. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.removeLogListener(logcatListener);
  115011. }
  115012. break;
  115013. }
  115014. }
  115015. });
  115016. function onInitSegment(type2, initSegment) {
  115017. var obj = {
  115018. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT,
  115019. data: {
  115020. type: type2,
  115021. data: initSegment
  115022. }
  115023. };
  115024. self2.postMessage(obj, [initSegment.data]);
  115025. }
  115026. function onMediaSegment(type2, mediaSegment) {
  115027. var obj = {
  115028. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT,
  115029. data: {
  115030. type: type2,
  115031. data: mediaSegment
  115032. }
  115033. };
  115034. self2.postMessage(obj, [mediaSegment.data]);
  115035. }
  115036. function onLoadingComplete() {
  115037. var obj = {
  115038. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE
  115039. };
  115040. self2.postMessage(obj);
  115041. }
  115042. function onRecoveredEarlyEof() {
  115043. var obj = {
  115044. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF
  115045. };
  115046. self2.postMessage(obj);
  115047. }
  115048. function onMediaInfo(mediaInfo) {
  115049. var obj = {
  115050. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO,
  115051. data: mediaInfo
  115052. };
  115053. self2.postMessage(obj);
  115054. }
  115055. function onMetaDataArrived(metadata) {
  115056. var obj = {
  115057. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED,
  115058. data: metadata
  115059. };
  115060. self2.postMessage(obj);
  115061. }
  115062. function onScriptDataArrived(data) {
  115063. var obj = {
  115064. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED,
  115065. data
  115066. };
  115067. self2.postMessage(obj);
  115068. }
  115069. function onStatisticsInfo(statInfo) {
  115070. var obj = {
  115071. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO,
  115072. data: statInfo
  115073. };
  115074. self2.postMessage(obj);
  115075. }
  115076. function onIOError(type2, info) {
  115077. self2.postMessage({
  115078. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR,
  115079. data: {
  115080. type: type2,
  115081. info
  115082. }
  115083. });
  115084. }
  115085. function onDemuxError(type2, info) {
  115086. self2.postMessage({
  115087. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR,
  115088. data: {
  115089. type: type2,
  115090. info
  115091. }
  115092. });
  115093. }
  115094. function onRecommendSeekpoint(milliseconds) {
  115095. self2.postMessage({
  115096. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT,
  115097. data: milliseconds
  115098. });
  115099. }
  115100. function onLogcatCallback(type2, str) {
  115101. self2.postMessage({
  115102. msg: "logcat_callback",
  115103. data: {
  115104. type: type2,
  115105. logcat: str
  115106. }
  115107. });
  115108. }
  115109. };
  115110. __webpack_exports__2["default"] = TransmuxingWorker;
  115111. },
  115112. "./src/demux/amf-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115113. __webpack_require__2.r(__webpack_exports__2);
  115114. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115115. var _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/utf8-conv.js");
  115116. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  115117. var le = function() {
  115118. var buf = new ArrayBuffer(2);
  115119. new DataView(buf).setInt16(0, 256, true);
  115120. return new Int16Array(buf)[0] === 256;
  115121. }();
  115122. var AMF = function() {
  115123. function AMF2() {
  115124. }
  115125. AMF2.parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115126. var data = {};
  115127. try {
  115128. var name_1 = AMF2.parseValue(arrayBuffer, dataOffset, dataSize);
  115129. var value = AMF2.parseValue(arrayBuffer, dataOffset + name_1.size, dataSize - name_1.size);
  115130. data[name_1.data] = value.data;
  115131. } catch (e) {
  115132. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115133. }
  115134. return data;
  115135. };
  115136. AMF2.parseObject = function(arrayBuffer, dataOffset, dataSize) {
  115137. if (dataSize < 3) {
  115138. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse ScriptDataObject");
  115139. }
  115140. var name = AMF2.parseString(arrayBuffer, dataOffset, dataSize);
  115141. var value = AMF2.parseValue(arrayBuffer, dataOffset + name.size, dataSize - name.size);
  115142. var isObjectEnd = value.objectEnd;
  115143. return {
  115144. data: {
  115145. name: name.data,
  115146. value: value.data
  115147. },
  115148. size: name.size + value.size,
  115149. objectEnd: isObjectEnd
  115150. };
  115151. };
  115152. AMF2.parseVariable = function(arrayBuffer, dataOffset, dataSize) {
  115153. return AMF2.parseObject(arrayBuffer, dataOffset, dataSize);
  115154. };
  115155. AMF2.parseString = function(arrayBuffer, dataOffset, dataSize) {
  115156. if (dataSize < 2) {
  115157. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse String");
  115158. }
  115159. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115160. var length = v.getUint16(0, !le);
  115161. var str;
  115162. if (length > 0) {
  115163. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 2, length));
  115164. } else {
  115165. str = "";
  115166. }
  115167. return {
  115168. data: str,
  115169. size: 2 + length
  115170. };
  115171. };
  115172. AMF2.parseLongString = function(arrayBuffer, dataOffset, dataSize) {
  115173. if (dataSize < 4) {
  115174. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse LongString");
  115175. }
  115176. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115177. var length = v.getUint32(0, !le);
  115178. var str;
  115179. if (length > 0) {
  115180. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 4, length));
  115181. } else {
  115182. str = "";
  115183. }
  115184. return {
  115185. data: str,
  115186. size: 4 + length
  115187. };
  115188. };
  115189. AMF2.parseDate = function(arrayBuffer, dataOffset, dataSize) {
  115190. if (dataSize < 10) {
  115191. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data size invalid when parse Date");
  115192. }
  115193. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115194. var timestamp = v.getFloat64(0, !le);
  115195. var localTimeOffset = v.getInt16(8, !le);
  115196. timestamp += localTimeOffset * 60 * 1e3;
  115197. return {
  115198. data: new Date(timestamp),
  115199. size: 8 + 2
  115200. };
  115201. };
  115202. AMF2.parseValue = function(arrayBuffer, dataOffset, dataSize) {
  115203. if (dataSize < 1) {
  115204. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse Value");
  115205. }
  115206. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115207. var offset = 1;
  115208. var type2 = v.getUint8(0);
  115209. var value;
  115210. var objectEnd = false;
  115211. try {
  115212. switch (type2) {
  115213. case 0:
  115214. value = v.getFloat64(1, !le);
  115215. offset += 8;
  115216. break;
  115217. case 1: {
  115218. var b = v.getUint8(1);
  115219. value = b ? true : false;
  115220. offset += 1;
  115221. break;
  115222. }
  115223. case 2: {
  115224. var amfstr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115225. value = amfstr.data;
  115226. offset += amfstr.size;
  115227. break;
  115228. }
  115229. case 3: {
  115230. value = {};
  115231. var terminal = 0;
  115232. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115233. terminal = 3;
  115234. }
  115235. while (offset < dataSize - 4) {
  115236. var amfobj = AMF2.parseObject(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115237. if (amfobj.objectEnd)
  115238. break;
  115239. value[amfobj.data.name] = amfobj.data.value;
  115240. offset += amfobj.size;
  115241. }
  115242. if (offset <= dataSize - 3) {
  115243. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115244. if (marker === 9) {
  115245. offset += 3;
  115246. }
  115247. }
  115248. break;
  115249. }
  115250. case 8: {
  115251. value = {};
  115252. offset += 4;
  115253. var terminal = 0;
  115254. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115255. terminal = 3;
  115256. }
  115257. while (offset < dataSize - 8) {
  115258. var amfvar = AMF2.parseVariable(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115259. if (amfvar.objectEnd)
  115260. break;
  115261. value[amfvar.data.name] = amfvar.data.value;
  115262. offset += amfvar.size;
  115263. }
  115264. if (offset <= dataSize - 3) {
  115265. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115266. if (marker === 9) {
  115267. offset += 3;
  115268. }
  115269. }
  115270. break;
  115271. }
  115272. case 9:
  115273. value = void 0;
  115274. offset = 1;
  115275. objectEnd = true;
  115276. break;
  115277. case 10: {
  115278. value = [];
  115279. var strictArrayLength = v.getUint32(1, !le);
  115280. offset += 4;
  115281. for (var i2 = 0; i2 < strictArrayLength; i2++) {
  115282. var val = AMF2.parseValue(arrayBuffer, dataOffset + offset, dataSize - offset);
  115283. value.push(val.data);
  115284. offset += val.size;
  115285. }
  115286. break;
  115287. }
  115288. case 11: {
  115289. var date = AMF2.parseDate(arrayBuffer, dataOffset + 1, dataSize - 1);
  115290. value = date.data;
  115291. offset += date.size;
  115292. break;
  115293. }
  115294. case 12: {
  115295. var amfLongStr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115296. value = amfLongStr.data;
  115297. offset += amfLongStr.size;
  115298. break;
  115299. }
  115300. default:
  115301. offset = dataSize;
  115302. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("AMF", "Unsupported AMF value type " + type2);
  115303. }
  115304. } catch (e) {
  115305. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115306. }
  115307. return {
  115308. data: value,
  115309. size: offset,
  115310. objectEnd
  115311. };
  115312. };
  115313. return AMF2;
  115314. }();
  115315. __webpack_exports__2["default"] = AMF;
  115316. },
  115317. "./src/demux/demux-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115318. __webpack_require__2.r(__webpack_exports__2);
  115319. var DemuxErrors = {
  115320. OK: "OK",
  115321. FORMAT_ERROR: "FormatError",
  115322. FORMAT_UNSUPPORTED: "FormatUnsupported",
  115323. CODEC_UNSUPPORTED: "CodecUnsupported"
  115324. };
  115325. __webpack_exports__2["default"] = DemuxErrors;
  115326. },
  115327. "./src/demux/exp-golomb.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115328. __webpack_require__2.r(__webpack_exports__2);
  115329. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  115330. var ExpGolomb = function() {
  115331. function ExpGolomb2(uint8array) {
  115332. this.TAG = "ExpGolomb";
  115333. this._buffer = uint8array;
  115334. this._buffer_index = 0;
  115335. this._total_bytes = uint8array.byteLength;
  115336. this._total_bits = uint8array.byteLength * 8;
  115337. this._current_word = 0;
  115338. this._current_word_bits_left = 0;
  115339. }
  115340. ExpGolomb2.prototype.destroy = function() {
  115341. this._buffer = null;
  115342. };
  115343. ExpGolomb2.prototype._fillCurrentWord = function() {
  115344. var buffer_bytes_left = this._total_bytes - this._buffer_index;
  115345. if (buffer_bytes_left <= 0)
  115346. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");
  115347. var bytes_read = Math.min(4, buffer_bytes_left);
  115348. var word = new Uint8Array(4);
  115349. word.set(this._buffer.subarray(this._buffer_index, this._buffer_index + bytes_read));
  115350. this._current_word = new DataView(word.buffer).getUint32(0, false);
  115351. this._buffer_index += bytes_read;
  115352. this._current_word_bits_left = bytes_read * 8;
  115353. };
  115354. ExpGolomb2.prototype.readBits = function(bits) {
  115355. if (bits > 32)
  115356. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");
  115357. if (bits <= this._current_word_bits_left) {
  115358. var result_1 = this._current_word >>> 32 - bits;
  115359. this._current_word <<= bits;
  115360. this._current_word_bits_left -= bits;
  115361. return result_1;
  115362. }
  115363. var result = this._current_word_bits_left ? this._current_word : 0;
  115364. result = result >>> 32 - this._current_word_bits_left;
  115365. var bits_need_left = bits - this._current_word_bits_left;
  115366. this._fillCurrentWord();
  115367. var bits_read_next = Math.min(bits_need_left, this._current_word_bits_left);
  115368. var result2 = this._current_word >>> 32 - bits_read_next;
  115369. this._current_word <<= bits_read_next;
  115370. this._current_word_bits_left -= bits_read_next;
  115371. result = result << bits_read_next | result2;
  115372. return result;
  115373. };
  115374. ExpGolomb2.prototype.readBool = function() {
  115375. return this.readBits(1) === 1;
  115376. };
  115377. ExpGolomb2.prototype.readByte = function() {
  115378. return this.readBits(8);
  115379. };
  115380. ExpGolomb2.prototype._skipLeadingZero = function() {
  115381. var zero_count;
  115382. for (zero_count = 0; zero_count < this._current_word_bits_left; zero_count++) {
  115383. if (0 !== (this._current_word & 2147483648 >>> zero_count)) {
  115384. this._current_word <<= zero_count;
  115385. this._current_word_bits_left -= zero_count;
  115386. return zero_count;
  115387. }
  115388. }
  115389. this._fillCurrentWord();
  115390. return zero_count + this._skipLeadingZero();
  115391. };
  115392. ExpGolomb2.prototype.readUEG = function() {
  115393. var leading_zeros = this._skipLeadingZero();
  115394. return this.readBits(leading_zeros + 1) - 1;
  115395. };
  115396. ExpGolomb2.prototype.readSEG = function() {
  115397. var value = this.readUEG();
  115398. if (value & 1) {
  115399. return value + 1 >>> 1;
  115400. } else {
  115401. return -1 * (value >>> 1);
  115402. }
  115403. };
  115404. return ExpGolomb2;
  115405. }();
  115406. __webpack_exports__2["default"] = ExpGolomb;
  115407. },
  115408. "./src/demux/flv-demuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115409. __webpack_require__2.r(__webpack_exports__2);
  115410. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115411. var _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/amf-parser.js");
  115412. var _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/demux/sps-parser.js");
  115413. var _demux_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/demux/demux-errors.js");
  115414. var _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-info.js");
  115415. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  115416. function ReadBig32(array, index2) {
  115417. return array[index2] << 24 | array[index2 + 1] << 16 | array[index2 + 2] << 8 | array[index2 + 3];
  115418. }
  115419. var FLVDemuxer = function() {
  115420. function FLVDemuxer2(probeData, config) {
  115421. this.TAG = "FLVDemuxer";
  115422. this._config = config;
  115423. this._onError = null;
  115424. this._onMediaInfo = null;
  115425. this._onMetaDataArrived = null;
  115426. this._onScriptDataArrived = null;
  115427. this._onTrackMetadata = null;
  115428. this._onDataAvailable = null;
  115429. this._dataOffset = probeData.dataOffset;
  115430. this._firstParse = true;
  115431. this._dispatch = false;
  115432. this._hasAudio = probeData.hasAudioTrack;
  115433. this._hasVideo = probeData.hasVideoTrack;
  115434. this._hasAudioFlagOverrided = false;
  115435. this._hasVideoFlagOverrided = false;
  115436. this._audioInitialMetadataDispatched = false;
  115437. this._videoInitialMetadataDispatched = false;
  115438. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115439. this._mediaInfo.hasAudio = this._hasAudio;
  115440. this._mediaInfo.hasVideo = this._hasVideo;
  115441. this._metadata = null;
  115442. this._audioMetadata = null;
  115443. this._videoMetadata = null;
  115444. this._naluLengthSize = 4;
  115445. this._timestampBase = 0;
  115446. this._timescale = 1e3;
  115447. this._duration = 0;
  115448. this._durationOverrided = false;
  115449. this._referenceFrameRate = {
  115450. fixed: true,
  115451. fps: 23.976,
  115452. fps_num: 23976,
  115453. fps_den: 1e3
  115454. };
  115455. this._flvSoundRateTable = [5500, 11025, 22050, 44100, 48e3];
  115456. this._mpegSamplingRates = [
  115457. 96e3,
  115458. 88200,
  115459. 64e3,
  115460. 48e3,
  115461. 44100,
  115462. 32e3,
  115463. 24e3,
  115464. 22050,
  115465. 16e3,
  115466. 12e3,
  115467. 11025,
  115468. 8e3,
  115469. 7350
  115470. ];
  115471. this._mpegAudioV10SampleRateTable = [44100, 48e3, 32e3, 0];
  115472. this._mpegAudioV20SampleRateTable = [22050, 24e3, 16e3, 0];
  115473. this._mpegAudioV25SampleRateTable = [11025, 12e3, 8e3, 0];
  115474. this._mpegAudioL1BitRateTable = [0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1];
  115475. this._mpegAudioL2BitRateTable = [0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1];
  115476. this._mpegAudioL3BitRateTable = [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1];
  115477. this._videoTrack = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 };
  115478. this._audioTrack = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 };
  115479. this._littleEndian = function() {
  115480. var buf = new ArrayBuffer(2);
  115481. new DataView(buf).setInt16(0, 256, true);
  115482. return new Int16Array(buf)[0] === 256;
  115483. }();
  115484. }
  115485. FLVDemuxer2.prototype.destroy = function() {
  115486. this._mediaInfo = null;
  115487. this._metadata = null;
  115488. this._audioMetadata = null;
  115489. this._videoMetadata = null;
  115490. this._videoTrack = null;
  115491. this._audioTrack = null;
  115492. this._onError = null;
  115493. this._onMediaInfo = null;
  115494. this._onMetaDataArrived = null;
  115495. this._onScriptDataArrived = null;
  115496. this._onTrackMetadata = null;
  115497. this._onDataAvailable = null;
  115498. };
  115499. FLVDemuxer2.probe = function(buffer) {
  115500. var data = new Uint8Array(buffer);
  115501. var mismatch = { match: false };
  115502. if (data[0] !== 70 || data[1] !== 76 || data[2] !== 86 || data[3] !== 1) {
  115503. return mismatch;
  115504. }
  115505. var hasAudio = (data[4] & 4) >>> 2 !== 0;
  115506. var hasVideo = (data[4] & 1) !== 0;
  115507. var offset = ReadBig32(data, 5);
  115508. if (offset < 9) {
  115509. return mismatch;
  115510. }
  115511. return {
  115512. match: true,
  115513. consumed: offset,
  115514. dataOffset: offset,
  115515. hasAudioTrack: hasAudio,
  115516. hasVideoTrack: hasVideo
  115517. };
  115518. };
  115519. FLVDemuxer2.prototype.bindDataSource = function(loader) {
  115520. loader.onDataArrival = this.parseChunks.bind(this);
  115521. return this;
  115522. };
  115523. Object.defineProperty(FLVDemuxer2.prototype, "onTrackMetadata", {
  115524. get: function() {
  115525. return this._onTrackMetadata;
  115526. },
  115527. set: function(callback2) {
  115528. this._onTrackMetadata = callback2;
  115529. },
  115530. enumerable: false,
  115531. configurable: true
  115532. });
  115533. Object.defineProperty(FLVDemuxer2.prototype, "onMediaInfo", {
  115534. get: function() {
  115535. return this._onMediaInfo;
  115536. },
  115537. set: function(callback2) {
  115538. this._onMediaInfo = callback2;
  115539. },
  115540. enumerable: false,
  115541. configurable: true
  115542. });
  115543. Object.defineProperty(FLVDemuxer2.prototype, "onMetaDataArrived", {
  115544. get: function() {
  115545. return this._onMetaDataArrived;
  115546. },
  115547. set: function(callback2) {
  115548. this._onMetaDataArrived = callback2;
  115549. },
  115550. enumerable: false,
  115551. configurable: true
  115552. });
  115553. Object.defineProperty(FLVDemuxer2.prototype, "onScriptDataArrived", {
  115554. get: function() {
  115555. return this._onScriptDataArrived;
  115556. },
  115557. set: function(callback2) {
  115558. this._onScriptDataArrived = callback2;
  115559. },
  115560. enumerable: false,
  115561. configurable: true
  115562. });
  115563. Object.defineProperty(FLVDemuxer2.prototype, "onError", {
  115564. get: function() {
  115565. return this._onError;
  115566. },
  115567. set: function(callback2) {
  115568. this._onError = callback2;
  115569. },
  115570. enumerable: false,
  115571. configurable: true
  115572. });
  115573. Object.defineProperty(FLVDemuxer2.prototype, "onDataAvailable", {
  115574. get: function() {
  115575. return this._onDataAvailable;
  115576. },
  115577. set: function(callback2) {
  115578. this._onDataAvailable = callback2;
  115579. },
  115580. enumerable: false,
  115581. configurable: true
  115582. });
  115583. Object.defineProperty(FLVDemuxer2.prototype, "timestampBase", {
  115584. get: function() {
  115585. return this._timestampBase;
  115586. },
  115587. set: function(base2) {
  115588. this._timestampBase = base2;
  115589. },
  115590. enumerable: false,
  115591. configurable: true
  115592. });
  115593. Object.defineProperty(FLVDemuxer2.prototype, "overridedDuration", {
  115594. get: function() {
  115595. return this._duration;
  115596. },
  115597. set: function(duration5) {
  115598. this._durationOverrided = true;
  115599. this._duration = duration5;
  115600. this._mediaInfo.duration = duration5;
  115601. },
  115602. enumerable: false,
  115603. configurable: true
  115604. });
  115605. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasAudio", {
  115606. set: function(hasAudio) {
  115607. this._hasAudioFlagOverrided = true;
  115608. this._hasAudio = hasAudio;
  115609. this._mediaInfo.hasAudio = hasAudio;
  115610. },
  115611. enumerable: false,
  115612. configurable: true
  115613. });
  115614. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasVideo", {
  115615. set: function(hasVideo) {
  115616. this._hasVideoFlagOverrided = true;
  115617. this._hasVideo = hasVideo;
  115618. this._mediaInfo.hasVideo = hasVideo;
  115619. },
  115620. enumerable: false,
  115621. configurable: true
  115622. });
  115623. FLVDemuxer2.prototype.resetMediaInfo = function() {
  115624. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115625. };
  115626. FLVDemuxer2.prototype._isInitialMetadataDispatched = function() {
  115627. if (this._hasAudio && this._hasVideo) {
  115628. return this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched;
  115629. }
  115630. if (this._hasAudio && !this._hasVideo) {
  115631. return this._audioInitialMetadataDispatched;
  115632. }
  115633. if (!this._hasAudio && this._hasVideo) {
  115634. return this._videoInitialMetadataDispatched;
  115635. }
  115636. return false;
  115637. };
  115638. FLVDemuxer2.prototype.parseChunks = function(chunk, byteStart) {
  115639. if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {
  115640. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
  115641. }
  115642. var offset = 0;
  115643. var le = this._littleEndian;
  115644. if (byteStart === 0) {
  115645. if (chunk.byteLength > 13) {
  115646. var probeData = FLVDemuxer2.probe(chunk);
  115647. offset = probeData.dataOffset;
  115648. } else {
  115649. return 0;
  115650. }
  115651. }
  115652. if (this._firstParse) {
  115653. this._firstParse = false;
  115654. if (byteStart + offset !== this._dataOffset) {
  115655. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "First time parsing but chunk byteStart invalid!");
  115656. }
  115657. var v = new DataView(chunk, offset);
  115658. var prevTagSize0 = v.getUint32(0, !le);
  115659. if (prevTagSize0 !== 0) {
  115660. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "PrevTagSize0 !== 0 !!!");
  115661. }
  115662. offset += 4;
  115663. }
  115664. while (offset < chunk.byteLength) {
  115665. this._dispatch = true;
  115666. var v = new DataView(chunk, offset);
  115667. if (offset + 11 + 4 > chunk.byteLength) {
  115668. break;
  115669. }
  115670. var tagType = v.getUint8(0);
  115671. var dataSize = v.getUint32(0, !le) & 16777215;
  115672. if (offset + 11 + dataSize + 4 > chunk.byteLength) {
  115673. break;
  115674. }
  115675. if (tagType !== 8 && tagType !== 9 && tagType !== 18) {
  115676. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unsupported tag type " + tagType + ", skipped");
  115677. offset += 11 + dataSize + 4;
  115678. continue;
  115679. }
  115680. var ts22 = v.getUint8(4);
  115681. var ts1 = v.getUint8(5);
  115682. var ts0 = v.getUint8(6);
  115683. var ts3 = v.getUint8(7);
  115684. var timestamp = ts0 | ts1 << 8 | ts22 << 16 | ts3 << 24;
  115685. var streamId = v.getUint32(7, !le) & 16777215;
  115686. if (streamId !== 0) {
  115687. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Meet tag which has StreamID != 0!");
  115688. }
  115689. var dataOffset = offset + 11;
  115690. switch (tagType) {
  115691. case 8:
  115692. this._parseAudioData(chunk, dataOffset, dataSize, timestamp);
  115693. break;
  115694. case 9:
  115695. this._parseVideoData(chunk, dataOffset, dataSize, timestamp, byteStart + offset);
  115696. break;
  115697. case 18:
  115698. this._parseScriptData(chunk, dataOffset, dataSize);
  115699. break;
  115700. }
  115701. var prevTagSize = v.getUint32(11 + dataSize, !le);
  115702. if (prevTagSize !== 11 + dataSize) {
  115703. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid PrevTagSize " + prevTagSize);
  115704. }
  115705. offset += 11 + dataSize + 4;
  115706. }
  115707. if (this._isInitialMetadataDispatched()) {
  115708. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115709. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115710. }
  115711. }
  115712. return offset;
  115713. };
  115714. FLVDemuxer2.prototype._parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115715. var scriptData = _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__.default.parseScriptData(arrayBuffer, dataOffset, dataSize);
  115716. if (scriptData.hasOwnProperty("onMetaData")) {
  115717. if (scriptData.onMetaData == null || typeof scriptData.onMetaData !== "object") {
  115718. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid onMetaData structure!");
  115719. return;
  115720. }
  115721. if (this._metadata) {
  115722. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another onMetaData tag!");
  115723. }
  115724. this._metadata = scriptData;
  115725. var onMetaData = this._metadata.onMetaData;
  115726. if (this._onMetaDataArrived) {
  115727. this._onMetaDataArrived(Object.assign({}, onMetaData));
  115728. }
  115729. if (typeof onMetaData.hasAudio === "boolean") {
  115730. if (this._hasAudioFlagOverrided === false) {
  115731. this._hasAudio = onMetaData.hasAudio;
  115732. this._mediaInfo.hasAudio = this._hasAudio;
  115733. }
  115734. }
  115735. if (typeof onMetaData.hasVideo === "boolean") {
  115736. if (this._hasVideoFlagOverrided === false) {
  115737. this._hasVideo = onMetaData.hasVideo;
  115738. this._mediaInfo.hasVideo = this._hasVideo;
  115739. }
  115740. }
  115741. if (typeof onMetaData.audiodatarate === "number") {
  115742. this._mediaInfo.audioDataRate = onMetaData.audiodatarate;
  115743. }
  115744. if (typeof onMetaData.videodatarate === "number") {
  115745. this._mediaInfo.videoDataRate = onMetaData.videodatarate;
  115746. }
  115747. if (typeof onMetaData.width === "number") {
  115748. this._mediaInfo.width = onMetaData.width;
  115749. }
  115750. if (typeof onMetaData.height === "number") {
  115751. this._mediaInfo.height = onMetaData.height;
  115752. }
  115753. if (typeof onMetaData.duration === "number") {
  115754. if (!this._durationOverrided) {
  115755. var duration5 = Math.floor(onMetaData.duration * this._timescale);
  115756. this._duration = duration5;
  115757. this._mediaInfo.duration = duration5;
  115758. }
  115759. } else {
  115760. this._mediaInfo.duration = 0;
  115761. }
  115762. if (typeof onMetaData.framerate === "number") {
  115763. var fps_num = Math.floor(onMetaData.framerate * 1e3);
  115764. if (fps_num > 0) {
  115765. var fps = fps_num / 1e3;
  115766. this._referenceFrameRate.fixed = true;
  115767. this._referenceFrameRate.fps = fps;
  115768. this._referenceFrameRate.fps_num = fps_num;
  115769. this._referenceFrameRate.fps_den = 1e3;
  115770. this._mediaInfo.fps = fps;
  115771. }
  115772. }
  115773. if (typeof onMetaData.keyframes === "object") {
  115774. this._mediaInfo.hasKeyframesIndex = true;
  115775. var keyframes = onMetaData.keyframes;
  115776. this._mediaInfo.keyframesIndex = this._parseKeyframesIndex(keyframes);
  115777. onMetaData.keyframes = null;
  115778. } else {
  115779. this._mediaInfo.hasKeyframesIndex = false;
  115780. }
  115781. this._dispatch = false;
  115782. this._mediaInfo.metadata = onMetaData;
  115783. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed onMetaData");
  115784. if (this._mediaInfo.isComplete()) {
  115785. this._onMediaInfo(this._mediaInfo);
  115786. }
  115787. }
  115788. if (Object.keys(scriptData).length > 0) {
  115789. if (this._onScriptDataArrived) {
  115790. this._onScriptDataArrived(Object.assign({}, scriptData));
  115791. }
  115792. }
  115793. };
  115794. FLVDemuxer2.prototype._parseKeyframesIndex = function(keyframes) {
  115795. var times = [];
  115796. var filepositions = [];
  115797. for (var i2 = 1; i2 < keyframes.times.length; i2++) {
  115798. var time = this._timestampBase + Math.floor(keyframes.times[i2] * 1e3);
  115799. times.push(time);
  115800. filepositions.push(keyframes.filepositions[i2]);
  115801. }
  115802. return {
  115803. times,
  115804. filepositions
  115805. };
  115806. };
  115807. FLVDemuxer2.prototype._parseAudioData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp) {
  115808. if (dataSize <= 1) {
  115809. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid audio packet, missing SoundData payload!");
  115810. return;
  115811. }
  115812. if (this._hasAudioFlagOverrided === true && this._hasAudio === false) {
  115813. return;
  115814. }
  115815. this._littleEndian;
  115816. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115817. var soundSpec = v.getUint8(0);
  115818. var soundFormat = soundSpec >>> 4;
  115819. if (soundFormat !== 2 && soundFormat !== 10) {
  115820. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " + soundFormat);
  115821. return;
  115822. }
  115823. var soundRate = 0;
  115824. var soundRateIndex = (soundSpec & 12) >>> 2;
  115825. if (soundRateIndex >= 0 && soundRateIndex <= 4) {
  115826. soundRate = this._flvSoundRateTable[soundRateIndex];
  115827. } else {
  115828. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid audio sample rate idx: " + soundRateIndex);
  115829. return;
  115830. }
  115831. var soundType = soundSpec & 1;
  115832. var meta2 = this._audioMetadata;
  115833. var track = this._audioTrack;
  115834. if (!meta2) {
  115835. if (this._hasAudio === false && this._hasAudioFlagOverrided === false) {
  115836. this._hasAudio = true;
  115837. this._mediaInfo.hasAudio = true;
  115838. }
  115839. meta2 = this._audioMetadata = {};
  115840. meta2.type = "audio";
  115841. meta2.id = track.id;
  115842. meta2.timescale = this._timescale;
  115843. meta2.duration = this._duration;
  115844. meta2.audioSampleRate = soundRate;
  115845. meta2.channelCount = soundType === 0 ? 1 : 2;
  115846. }
  115847. if (soundFormat === 10) {
  115848. var aacData = this._parseAACAudioData(arrayBuffer, dataOffset + 1, dataSize - 1);
  115849. if (aacData == void 0) {
  115850. return;
  115851. }
  115852. if (aacData.packetType === 0) {
  115853. if (meta2.config) {
  115854. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AudioSpecificConfig!");
  115855. }
  115856. var misc = aacData.data;
  115857. meta2.audioSampleRate = misc.samplingRate;
  115858. meta2.channelCount = misc.channelCount;
  115859. meta2.codec = misc.codec;
  115860. meta2.originalCodec = misc.originalCodec;
  115861. meta2.config = misc.config;
  115862. meta2.refSampleDuration = 1024 / meta2.audioSampleRate * meta2.timescale;
  115863. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AudioSpecificConfig");
  115864. if (this._isInitialMetadataDispatched()) {
  115865. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115866. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115867. }
  115868. } else {
  115869. this._audioInitialMetadataDispatched = true;
  115870. }
  115871. this._dispatch = false;
  115872. this._onTrackMetadata("audio", meta2);
  115873. var mi = this._mediaInfo;
  115874. mi.audioCodec = meta2.originalCodec;
  115875. mi.audioSampleRate = meta2.audioSampleRate;
  115876. mi.audioChannelCount = meta2.channelCount;
  115877. if (mi.hasVideo) {
  115878. if (mi.videoCodec != null) {
  115879. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115880. }
  115881. } else {
  115882. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115883. }
  115884. if (mi.isComplete()) {
  115885. this._onMediaInfo(mi);
  115886. }
  115887. } else if (aacData.packetType === 1) {
  115888. var dts = this._timestampBase + tagTimestamp;
  115889. var aacSample = { unit: aacData.data, length: aacData.data.byteLength, dts, pts: dts };
  115890. track.samples.push(aacSample);
  115891. track.length += aacData.data.length;
  115892. } else {
  115893. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Flv: Unsupported AAC data type " + aacData.packetType);
  115894. }
  115895. } else if (soundFormat === 2) {
  115896. if (!meta2.codec) {
  115897. var misc = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, true);
  115898. if (misc == void 0) {
  115899. return;
  115900. }
  115901. meta2.audioSampleRate = misc.samplingRate;
  115902. meta2.channelCount = misc.channelCount;
  115903. meta2.codec = misc.codec;
  115904. meta2.originalCodec = misc.originalCodec;
  115905. meta2.refSampleDuration = 1152 / meta2.audioSampleRate * meta2.timescale;
  115906. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed MPEG Audio Frame Header");
  115907. this._audioInitialMetadataDispatched = true;
  115908. this._onTrackMetadata("audio", meta2);
  115909. var mi = this._mediaInfo;
  115910. mi.audioCodec = meta2.codec;
  115911. mi.audioSampleRate = meta2.audioSampleRate;
  115912. mi.audioChannelCount = meta2.channelCount;
  115913. mi.audioDataRate = misc.bitRate;
  115914. if (mi.hasVideo) {
  115915. if (mi.videoCodec != null) {
  115916. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115917. }
  115918. } else {
  115919. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115920. }
  115921. if (mi.isComplete()) {
  115922. this._onMediaInfo(mi);
  115923. }
  115924. }
  115925. var data = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, false);
  115926. if (data == void 0) {
  115927. return;
  115928. }
  115929. var dts = this._timestampBase + tagTimestamp;
  115930. var mp3Sample = { unit: data, length: data.byteLength, dts, pts: dts };
  115931. track.samples.push(mp3Sample);
  115932. track.length += data.length;
  115933. }
  115934. };
  115935. FLVDemuxer2.prototype._parseAACAudioData = function(arrayBuffer, dataOffset, dataSize) {
  115936. if (dataSize <= 1) {
  115937. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AAC packet, missing AACPacketType or/and Data!");
  115938. return;
  115939. }
  115940. var result = {};
  115941. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  115942. result.packetType = array[0];
  115943. if (array[0] === 0) {
  115944. result.data = this._parseAACAudioSpecificConfig(arrayBuffer, dataOffset + 1, dataSize - 1);
  115945. } else {
  115946. result.data = array.subarray(1);
  115947. }
  115948. return result;
  115949. };
  115950. FLVDemuxer2.prototype._parseAACAudioSpecificConfig = function(arrayBuffer, dataOffset, dataSize) {
  115951. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  115952. var config = null;
  115953. var audioObjectType = 0;
  115954. var originalAudioObjectType = 0;
  115955. var samplingIndex = 0;
  115956. var extensionSamplingIndex = null;
  115957. audioObjectType = originalAudioObjectType = array[0] >>> 3;
  115958. samplingIndex = (array[0] & 7) << 1 | array[1] >>> 7;
  115959. if (samplingIndex < 0 || samplingIndex >= this._mpegSamplingRates.length) {
  115960. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid sampling frequency index!");
  115961. return;
  115962. }
  115963. var samplingFrequence = this._mpegSamplingRates[samplingIndex];
  115964. var channelConfig = (array[1] & 120) >>> 3;
  115965. if (channelConfig < 0 || channelConfig >= 8) {
  115966. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid channel configuration");
  115967. return;
  115968. }
  115969. if (audioObjectType === 5) {
  115970. extensionSamplingIndex = (array[1] & 7) << 1 | array[2] >>> 7;
  115971. (array[2] & 124) >>> 2;
  115972. }
  115973. var userAgent = self.navigator.userAgent.toLowerCase();
  115974. if (userAgent.indexOf("firefox") !== -1) {
  115975. if (samplingIndex >= 6) {
  115976. audioObjectType = 5;
  115977. config = new Array(4);
  115978. extensionSamplingIndex = samplingIndex - 3;
  115979. } else {
  115980. audioObjectType = 2;
  115981. config = new Array(2);
  115982. extensionSamplingIndex = samplingIndex;
  115983. }
  115984. } else if (userAgent.indexOf("android") !== -1) {
  115985. audioObjectType = 2;
  115986. config = new Array(2);
  115987. extensionSamplingIndex = samplingIndex;
  115988. } else {
  115989. audioObjectType = 5;
  115990. extensionSamplingIndex = samplingIndex;
  115991. config = new Array(4);
  115992. if (samplingIndex >= 6) {
  115993. extensionSamplingIndex = samplingIndex - 3;
  115994. } else if (channelConfig === 1) {
  115995. audioObjectType = 2;
  115996. config = new Array(2);
  115997. extensionSamplingIndex = samplingIndex;
  115998. }
  115999. }
  116000. config[0] = audioObjectType << 3;
  116001. config[0] |= (samplingIndex & 15) >>> 1;
  116002. config[1] = (samplingIndex & 15) << 7;
  116003. config[1] |= (channelConfig & 15) << 3;
  116004. if (audioObjectType === 5) {
  116005. config[1] |= (extensionSamplingIndex & 15) >>> 1;
  116006. config[2] = (extensionSamplingIndex & 1) << 7;
  116007. config[2] |= 2 << 2;
  116008. config[3] = 0;
  116009. }
  116010. return {
  116011. config,
  116012. samplingRate: samplingFrequence,
  116013. channelCount: channelConfig,
  116014. codec: "mp4a.40." + audioObjectType,
  116015. originalCodec: "mp4a.40." + originalAudioObjectType
  116016. };
  116017. };
  116018. FLVDemuxer2.prototype._parseMP3AudioData = function(arrayBuffer, dataOffset, dataSize, requestHeader) {
  116019. if (dataSize < 4) {
  116020. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid MP3 packet, header missing!");
  116021. return;
  116022. }
  116023. this._littleEndian;
  116024. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  116025. var result = null;
  116026. if (requestHeader) {
  116027. if (array[0] !== 255) {
  116028. return;
  116029. }
  116030. var ver = array[1] >>> 3 & 3;
  116031. var layer = (array[1] & 6) >> 1;
  116032. var bitrate_index = (array[2] & 240) >>> 4;
  116033. var sampling_freq_index = (array[2] & 12) >>> 2;
  116034. var channel_mode = array[3] >>> 6 & 3;
  116035. var channel_count = channel_mode !== 3 ? 2 : 1;
  116036. var sample_rate = 0;
  116037. var bit_rate = 0;
  116038. var codec = "mp3";
  116039. switch (ver) {
  116040. case 0:
  116041. sample_rate = this._mpegAudioV25SampleRateTable[sampling_freq_index];
  116042. break;
  116043. case 2:
  116044. sample_rate = this._mpegAudioV20SampleRateTable[sampling_freq_index];
  116045. break;
  116046. case 3:
  116047. sample_rate = this._mpegAudioV10SampleRateTable[sampling_freq_index];
  116048. break;
  116049. }
  116050. switch (layer) {
  116051. case 1:
  116052. if (bitrate_index < this._mpegAudioL3BitRateTable.length) {
  116053. bit_rate = this._mpegAudioL3BitRateTable[bitrate_index];
  116054. }
  116055. break;
  116056. case 2:
  116057. if (bitrate_index < this._mpegAudioL2BitRateTable.length) {
  116058. bit_rate = this._mpegAudioL2BitRateTable[bitrate_index];
  116059. }
  116060. break;
  116061. case 3:
  116062. if (bitrate_index < this._mpegAudioL1BitRateTable.length) {
  116063. bit_rate = this._mpegAudioL1BitRateTable[bitrate_index];
  116064. }
  116065. break;
  116066. }
  116067. result = {
  116068. bitRate: bit_rate,
  116069. samplingRate: sample_rate,
  116070. channelCount: channel_count,
  116071. codec,
  116072. originalCodec: codec
  116073. };
  116074. } else {
  116075. result = array;
  116076. }
  116077. return result;
  116078. };
  116079. FLVDemuxer2.prototype._parseVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition) {
  116080. if (dataSize <= 1) {
  116081. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid video packet, missing VideoData payload!");
  116082. return;
  116083. }
  116084. if (this._hasVideoFlagOverrided === true && this._hasVideo === false) {
  116085. return;
  116086. }
  116087. var spec = new Uint8Array(arrayBuffer, dataOffset, dataSize)[0];
  116088. var frameType = (spec & 240) >>> 4;
  116089. var codecId = spec & 15;
  116090. if (codecId !== 7) {
  116091. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + codecId);
  116092. return;
  116093. }
  116094. this._parseAVCVideoPacket(arrayBuffer, dataOffset + 1, dataSize - 1, tagTimestamp, tagPosition, frameType);
  116095. };
  116096. FLVDemuxer2.prototype._parseAVCVideoPacket = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType) {
  116097. if (dataSize < 4) {
  116098. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");
  116099. return;
  116100. }
  116101. var le = this._littleEndian;
  116102. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116103. var packetType = v.getUint8(0);
  116104. var cts_unsigned = v.getUint32(0, !le) & 16777215;
  116105. var cts = cts_unsigned << 8 >> 8;
  116106. if (packetType === 0) {
  116107. this._parseAVCDecoderConfigurationRecord(arrayBuffer, dataOffset + 4, dataSize - 4);
  116108. } else if (packetType === 1) {
  116109. this._parseAVCVideoData(arrayBuffer, dataOffset + 4, dataSize - 4, tagTimestamp, tagPosition, frameType, cts);
  116110. } else if (packetType === 2)
  116111. ;
  116112. else {
  116113. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid video packet type " + packetType);
  116114. return;
  116115. }
  116116. };
  116117. FLVDemuxer2.prototype._parseAVCDecoderConfigurationRecord = function(arrayBuffer, dataOffset, dataSize) {
  116118. if (dataSize < 7) {
  116119. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");
  116120. return;
  116121. }
  116122. var meta2 = this._videoMetadata;
  116123. var track = this._videoTrack;
  116124. var le = this._littleEndian;
  116125. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116126. if (!meta2) {
  116127. if (this._hasVideo === false && this._hasVideoFlagOverrided === false) {
  116128. this._hasVideo = true;
  116129. this._mediaInfo.hasVideo = true;
  116130. }
  116131. meta2 = this._videoMetadata = {};
  116132. meta2.type = "video";
  116133. meta2.id = track.id;
  116134. meta2.timescale = this._timescale;
  116135. meta2.duration = this._duration;
  116136. } else {
  116137. if (typeof meta2.avcc !== "undefined") {
  116138. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AVCDecoderConfigurationRecord!");
  116139. }
  116140. }
  116141. var version2 = v.getUint8(0);
  116142. var avcProfile = v.getUint8(1);
  116143. v.getUint8(2);
  116144. v.getUint8(3);
  116145. if (version2 !== 1 || avcProfile === 0) {
  116146. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord");
  116147. return;
  116148. }
  116149. this._naluLengthSize = (v.getUint8(4) & 3) + 1;
  116150. if (this._naluLengthSize !== 3 && this._naluLengthSize !== 4) {
  116151. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
  116152. return;
  116153. }
  116154. var spsCount = v.getUint8(5) & 31;
  116155. if (spsCount === 0) {
  116156. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No SPS");
  116157. return;
  116158. } else if (spsCount > 1) {
  116159. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: SPS Count = " + spsCount);
  116160. }
  116161. var offset = 6;
  116162. for (var i2 = 0; i2 < spsCount; i2++) {
  116163. var len = v.getUint16(offset, !le);
  116164. offset += 2;
  116165. if (len === 0) {
  116166. continue;
  116167. }
  116168. var sps = new Uint8Array(arrayBuffer, dataOffset + offset, len);
  116169. offset += len;
  116170. var config = _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__.default.parseSPS(sps);
  116171. if (i2 !== 0) {
  116172. continue;
  116173. }
  116174. meta2.codecWidth = config.codec_size.width;
  116175. meta2.codecHeight = config.codec_size.height;
  116176. meta2.presentWidth = config.present_size.width;
  116177. meta2.presentHeight = config.present_size.height;
  116178. meta2.profile = config.profile_string;
  116179. meta2.level = config.level_string;
  116180. meta2.bitDepth = config.bit_depth;
  116181. meta2.chromaFormat = config.chroma_format;
  116182. meta2.sarRatio = config.sar_ratio;
  116183. meta2.frameRate = config.frame_rate;
  116184. if (config.frame_rate.fixed === false || config.frame_rate.fps_num === 0 || config.frame_rate.fps_den === 0) {
  116185. meta2.frameRate = this._referenceFrameRate;
  116186. }
  116187. var fps_den = meta2.frameRate.fps_den;
  116188. var fps_num = meta2.frameRate.fps_num;
  116189. meta2.refSampleDuration = meta2.timescale * (fps_den / fps_num);
  116190. var codecArray = sps.subarray(1, 4);
  116191. var codecString = "avc1.";
  116192. for (var j = 0; j < 3; j++) {
  116193. var h2 = codecArray[j].toString(16);
  116194. if (h2.length < 2) {
  116195. h2 = "0" + h2;
  116196. }
  116197. codecString += h2;
  116198. }
  116199. meta2.codec = codecString;
  116200. var mi = this._mediaInfo;
  116201. mi.width = meta2.codecWidth;
  116202. mi.height = meta2.codecHeight;
  116203. mi.fps = meta2.frameRate.fps;
  116204. mi.profile = meta2.profile;
  116205. mi.level = meta2.level;
  116206. mi.refFrames = config.ref_frames;
  116207. mi.chromaFormat = config.chroma_format_string;
  116208. mi.sarNum = meta2.sarRatio.width;
  116209. mi.sarDen = meta2.sarRatio.height;
  116210. mi.videoCodec = codecString;
  116211. if (mi.hasAudio) {
  116212. if (mi.audioCodec != null) {
  116213. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  116214. }
  116215. } else {
  116216. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + '"';
  116217. }
  116218. if (mi.isComplete()) {
  116219. this._onMediaInfo(mi);
  116220. }
  116221. }
  116222. var ppsCount = v.getUint8(offset);
  116223. if (ppsCount === 0) {
  116224. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No PPS");
  116225. return;
  116226. } else if (ppsCount > 1) {
  116227. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: PPS Count = " + ppsCount);
  116228. }
  116229. offset++;
  116230. for (var i2 = 0; i2 < ppsCount; i2++) {
  116231. var len = v.getUint16(offset, !le);
  116232. offset += 2;
  116233. if (len === 0) {
  116234. continue;
  116235. }
  116236. offset += len;
  116237. }
  116238. meta2.avcc = new Uint8Array(dataSize);
  116239. meta2.avcc.set(new Uint8Array(arrayBuffer, dataOffset, dataSize), 0);
  116240. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AVCDecoderConfigurationRecord");
  116241. if (this._isInitialMetadataDispatched()) {
  116242. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  116243. this._onDataAvailable(this._audioTrack, this._videoTrack);
  116244. }
  116245. } else {
  116246. this._videoInitialMetadataDispatched = true;
  116247. }
  116248. this._dispatch = false;
  116249. this._onTrackMetadata("video", meta2);
  116250. };
  116251. FLVDemuxer2.prototype._parseAVCVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType, cts) {
  116252. var le = this._littleEndian;
  116253. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116254. var units = [], length = 0;
  116255. var offset = 0;
  116256. var lengthSize = this._naluLengthSize;
  116257. var dts = this._timestampBase + tagTimestamp;
  116258. var keyframe = frameType === 1;
  116259. while (offset < dataSize) {
  116260. if (offset + 4 >= dataSize) {
  116261. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalu near timestamp " + dts + ", offset = " + offset + ", dataSize = " + dataSize);
  116262. break;
  116263. }
  116264. var naluSize = v.getUint32(offset, !le);
  116265. if (lengthSize === 3) {
  116266. naluSize >>>= 8;
  116267. }
  116268. if (naluSize > dataSize - lengthSize) {
  116269. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalus near timestamp " + dts + ", NaluSize > DataSize!");
  116270. return;
  116271. }
  116272. var unitType = v.getUint8(offset + lengthSize) & 31;
  116273. if (unitType === 5) {
  116274. keyframe = true;
  116275. }
  116276. var data = new Uint8Array(arrayBuffer, dataOffset + offset, lengthSize + naluSize);
  116277. var unit = { type: unitType, data };
  116278. units.push(unit);
  116279. length += data.byteLength;
  116280. offset += lengthSize + naluSize;
  116281. }
  116282. if (units.length) {
  116283. var track = this._videoTrack;
  116284. var avcSample = {
  116285. units,
  116286. length,
  116287. isKeyframe: keyframe,
  116288. dts,
  116289. cts,
  116290. pts: dts + cts
  116291. };
  116292. if (keyframe) {
  116293. avcSample.fileposition = tagPosition;
  116294. }
  116295. track.samples.push(avcSample);
  116296. track.length += length;
  116297. }
  116298. };
  116299. return FLVDemuxer2;
  116300. }();
  116301. __webpack_exports__2["default"] = FLVDemuxer;
  116302. },
  116303. "./src/demux/sps-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116304. __webpack_require__2.r(__webpack_exports__2);
  116305. var _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/demux/exp-golomb.js");
  116306. var SPSParser = function() {
  116307. function SPSParser2() {
  116308. }
  116309. SPSParser2._ebsp2rbsp = function(uint8array) {
  116310. var src = uint8array;
  116311. var src_length = src.byteLength;
  116312. var dst = new Uint8Array(src_length);
  116313. var dst_idx = 0;
  116314. for (var i2 = 0; i2 < src_length; i2++) {
  116315. if (i2 >= 2) {
  116316. if (src[i2] === 3 && src[i2 - 1] === 0 && src[i2 - 2] === 0) {
  116317. continue;
  116318. }
  116319. }
  116320. dst[dst_idx] = src[i2];
  116321. dst_idx++;
  116322. }
  116323. return new Uint8Array(dst.buffer, 0, dst_idx);
  116324. };
  116325. SPSParser2.parseSPS = function(uint8array) {
  116326. var rbsp = SPSParser2._ebsp2rbsp(uint8array);
  116327. var gb = new _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__.default(rbsp);
  116328. gb.readByte();
  116329. var profile_idc = gb.readByte();
  116330. gb.readByte();
  116331. var level_idc = gb.readByte();
  116332. gb.readUEG();
  116333. var profile_string = SPSParser2.getProfileString(profile_idc);
  116334. var level_string = SPSParser2.getLevelString(level_idc);
  116335. var chroma_format_idc = 1;
  116336. var chroma_format = 420;
  116337. var chroma_format_table = [0, 420, 422, 444];
  116338. var bit_depth = 8;
  116339. if (profile_idc === 100 || profile_idc === 110 || profile_idc === 122 || profile_idc === 244 || profile_idc === 44 || profile_idc === 83 || profile_idc === 86 || profile_idc === 118 || profile_idc === 128 || profile_idc === 138 || profile_idc === 144) {
  116340. chroma_format_idc = gb.readUEG();
  116341. if (chroma_format_idc === 3) {
  116342. gb.readBits(1);
  116343. }
  116344. if (chroma_format_idc <= 3) {
  116345. chroma_format = chroma_format_table[chroma_format_idc];
  116346. }
  116347. bit_depth = gb.readUEG() + 8;
  116348. gb.readUEG();
  116349. gb.readBits(1);
  116350. if (gb.readBool()) {
  116351. var scaling_list_count = chroma_format_idc !== 3 ? 8 : 12;
  116352. for (var i2 = 0; i2 < scaling_list_count; i2++) {
  116353. if (gb.readBool()) {
  116354. if (i2 < 6) {
  116355. SPSParser2._skipScalingList(gb, 16);
  116356. } else {
  116357. SPSParser2._skipScalingList(gb, 64);
  116358. }
  116359. }
  116360. }
  116361. }
  116362. }
  116363. gb.readUEG();
  116364. var pic_order_cnt_type = gb.readUEG();
  116365. if (pic_order_cnt_type === 0) {
  116366. gb.readUEG();
  116367. } else if (pic_order_cnt_type === 1) {
  116368. gb.readBits(1);
  116369. gb.readSEG();
  116370. gb.readSEG();
  116371. var num_ref_frames_in_pic_order_cnt_cycle = gb.readUEG();
  116372. for (var i2 = 0; i2 < num_ref_frames_in_pic_order_cnt_cycle; i2++) {
  116373. gb.readSEG();
  116374. }
  116375. }
  116376. var ref_frames = gb.readUEG();
  116377. gb.readBits(1);
  116378. var pic_width_in_mbs_minus1 = gb.readUEG();
  116379. var pic_height_in_map_units_minus1 = gb.readUEG();
  116380. var frame_mbs_only_flag = gb.readBits(1);
  116381. if (frame_mbs_only_flag === 0) {
  116382. gb.readBits(1);
  116383. }
  116384. gb.readBits(1);
  116385. var frame_crop_left_offset = 0;
  116386. var frame_crop_right_offset = 0;
  116387. var frame_crop_top_offset = 0;
  116388. var frame_crop_bottom_offset = 0;
  116389. var frame_cropping_flag = gb.readBool();
  116390. if (frame_cropping_flag) {
  116391. frame_crop_left_offset = gb.readUEG();
  116392. frame_crop_right_offset = gb.readUEG();
  116393. frame_crop_top_offset = gb.readUEG();
  116394. frame_crop_bottom_offset = gb.readUEG();
  116395. }
  116396. var sar_width = 1, sar_height = 1;
  116397. var fps = 0, fps_fixed = true, fps_num = 0, fps_den = 0;
  116398. var vui_parameters_present_flag = gb.readBool();
  116399. if (vui_parameters_present_flag) {
  116400. if (gb.readBool()) {
  116401. var aspect_ratio_idc = gb.readByte();
  116402. var sar_w_table = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2];
  116403. var sar_h_table = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
  116404. if (aspect_ratio_idc > 0 && aspect_ratio_idc < 16) {
  116405. sar_width = sar_w_table[aspect_ratio_idc - 1];
  116406. sar_height = sar_h_table[aspect_ratio_idc - 1];
  116407. } else if (aspect_ratio_idc === 255) {
  116408. sar_width = gb.readByte() << 8 | gb.readByte();
  116409. sar_height = gb.readByte() << 8 | gb.readByte();
  116410. }
  116411. }
  116412. if (gb.readBool()) {
  116413. gb.readBool();
  116414. }
  116415. if (gb.readBool()) {
  116416. gb.readBits(4);
  116417. if (gb.readBool()) {
  116418. gb.readBits(24);
  116419. }
  116420. }
  116421. if (gb.readBool()) {
  116422. gb.readUEG();
  116423. gb.readUEG();
  116424. }
  116425. if (gb.readBool()) {
  116426. var num_units_in_tick = gb.readBits(32);
  116427. var time_scale = gb.readBits(32);
  116428. fps_fixed = gb.readBool();
  116429. fps_num = time_scale;
  116430. fps_den = num_units_in_tick * 2;
  116431. fps = fps_num / fps_den;
  116432. }
  116433. }
  116434. var sarScale = 1;
  116435. if (sar_width !== 1 || sar_height !== 1) {
  116436. sarScale = sar_width / sar_height;
  116437. }
  116438. var crop_unit_x = 0, crop_unit_y = 0;
  116439. if (chroma_format_idc === 0) {
  116440. crop_unit_x = 1;
  116441. crop_unit_y = 2 - frame_mbs_only_flag;
  116442. } else {
  116443. var sub_wc = chroma_format_idc === 3 ? 1 : 2;
  116444. var sub_hc = chroma_format_idc === 1 ? 2 : 1;
  116445. crop_unit_x = sub_wc;
  116446. crop_unit_y = sub_hc * (2 - frame_mbs_only_flag);
  116447. }
  116448. var codec_width = (pic_width_in_mbs_minus1 + 1) * 16;
  116449. var codec_height = (2 - frame_mbs_only_flag) * ((pic_height_in_map_units_minus1 + 1) * 16);
  116450. codec_width -= (frame_crop_left_offset + frame_crop_right_offset) * crop_unit_x;
  116451. codec_height -= (frame_crop_top_offset + frame_crop_bottom_offset) * crop_unit_y;
  116452. var present_width = Math.ceil(codec_width * sarScale);
  116453. gb.destroy();
  116454. gb = null;
  116455. return {
  116456. profile_string,
  116457. level_string,
  116458. bit_depth,
  116459. ref_frames,
  116460. chroma_format,
  116461. chroma_format_string: SPSParser2.getChromaFormatString(chroma_format),
  116462. frame_rate: {
  116463. fixed: fps_fixed,
  116464. fps,
  116465. fps_den,
  116466. fps_num
  116467. },
  116468. sar_ratio: {
  116469. width: sar_width,
  116470. height: sar_height
  116471. },
  116472. codec_size: {
  116473. width: codec_width,
  116474. height: codec_height
  116475. },
  116476. present_size: {
  116477. width: present_width,
  116478. height: codec_height
  116479. }
  116480. };
  116481. };
  116482. SPSParser2._skipScalingList = function(gb, count) {
  116483. var last_scale = 8, next_scale = 8;
  116484. var delta_scale = 0;
  116485. for (var i2 = 0; i2 < count; i2++) {
  116486. if (next_scale !== 0) {
  116487. delta_scale = gb.readSEG();
  116488. next_scale = (last_scale + delta_scale + 256) % 256;
  116489. }
  116490. last_scale = next_scale === 0 ? last_scale : next_scale;
  116491. }
  116492. };
  116493. SPSParser2.getProfileString = function(profile_idc) {
  116494. switch (profile_idc) {
  116495. case 66:
  116496. return "Baseline";
  116497. case 77:
  116498. return "Main";
  116499. case 88:
  116500. return "Extended";
  116501. case 100:
  116502. return "High";
  116503. case 110:
  116504. return "High10";
  116505. case 122:
  116506. return "High422";
  116507. case 244:
  116508. return "High444";
  116509. default:
  116510. return "Unknown";
  116511. }
  116512. };
  116513. SPSParser2.getLevelString = function(level_idc) {
  116514. return (level_idc / 10).toFixed(1);
  116515. };
  116516. SPSParser2.getChromaFormatString = function(chroma) {
  116517. switch (chroma) {
  116518. case 420:
  116519. return "4:2:0";
  116520. case 422:
  116521. return "4:2:2";
  116522. case 444:
  116523. return "4:4:4";
  116524. default:
  116525. return "Unknown";
  116526. }
  116527. };
  116528. return SPSParser2;
  116529. }();
  116530. __webpack_exports__2["default"] = SPSParser;
  116531. },
  116532. "./src/flv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116533. __webpack_require__2.r(__webpack_exports__2);
  116534. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/polyfill.js");
  116535. var _core_features_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/core/features.js");
  116536. var _io_loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116537. var _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/flv-player.js");
  116538. var _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/player/native-player.js");
  116539. var _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/player/player-events.js");
  116540. var _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/player/player-errors.js");
  116541. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/utils/logging-control.js");
  116542. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/utils/exception.js");
  116543. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__.default.install();
  116544. function createPlayer(mediaDataSource, optionalConfig) {
  116545. var mds = mediaDataSource;
  116546. if (mds == null || typeof mds !== "object") {
  116547. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must be an javascript object!");
  116548. }
  116549. if (!mds.hasOwnProperty("type")) {
  116550. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");
  116551. }
  116552. switch (mds.type) {
  116553. case "flv":
  116554. return new _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default(mds, optionalConfig);
  116555. default:
  116556. return new _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default(mds, optionalConfig);
  116557. }
  116558. }
  116559. function isSupported() {
  116560. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.supportMSEH264Playback();
  116561. }
  116562. function getFeatureList() {
  116563. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.getFeatureList();
  116564. }
  116565. var flvjs2 = {};
  116566. flvjs2.createPlayer = createPlayer;
  116567. flvjs2.isSupported = isSupported;
  116568. flvjs2.getFeatureList = getFeatureList;
  116569. flvjs2.BaseLoader = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader;
  116570. flvjs2.LoaderStatus = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus;
  116571. flvjs2.LoaderErrors = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors;
  116572. flvjs2.Events = _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__.default;
  116573. flvjs2.ErrorTypes = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorTypes;
  116574. flvjs2.ErrorDetails = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorDetails;
  116575. flvjs2.FlvPlayer = _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default;
  116576. flvjs2.NativePlayer = _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default;
  116577. flvjs2.LoggingControl = _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__.default;
  116578. Object.defineProperty(flvjs2, "version", {
  116579. enumerable: true,
  116580. get: function() {
  116581. return "1.6.2";
  116582. }
  116583. });
  116584. __webpack_exports__2["default"] = flvjs2;
  116585. },
  116586. "./src/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  116587. module3.exports = __webpack_require__2("./src/flv.js").default;
  116588. },
  116589. "./src/io/fetch-stream-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116590. __webpack_require__2.r(__webpack_exports__2);
  116591. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/browser.js");
  116592. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  116593. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  116594. var __extends = function() {
  116595. var extendStatics = function(d2, b) {
  116596. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  116597. d3.__proto__ = b2;
  116598. } || function(d3, b2) {
  116599. for (var p in b2)
  116600. if (Object.prototype.hasOwnProperty.call(b2, p))
  116601. d3[p] = b2[p];
  116602. };
  116603. return extendStatics(d2, b);
  116604. };
  116605. return function(d2, b) {
  116606. if (typeof b !== "function" && b !== null)
  116607. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  116608. extendStatics(d2, b);
  116609. function __() {
  116610. this.constructor = d2;
  116611. }
  116612. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116613. };
  116614. }();
  116615. var FetchStreamLoader = function(_super) {
  116616. __extends(FetchStreamLoader2, _super);
  116617. function FetchStreamLoader2(seekHandler, config) {
  116618. var _this = _super.call(this, "fetch-stream-loader") || this;
  116619. _this.TAG = "FetchStreamLoader";
  116620. _this._seekHandler = seekHandler;
  116621. _this._config = config;
  116622. _this._needStash = true;
  116623. _this._requestAbort = false;
  116624. _this._contentLength = null;
  116625. _this._receivedLength = 0;
  116626. return _this;
  116627. }
  116628. FetchStreamLoader2.isSupported = function() {
  116629. try {
  116630. var isWorkWellEdge = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.version.minor >= 15048;
  116631. var browserNotBlacklisted = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge ? isWorkWellEdge : true;
  116632. return self.fetch && self.ReadableStream && browserNotBlacklisted;
  116633. } catch (e) {
  116634. return false;
  116635. }
  116636. };
  116637. FetchStreamLoader2.prototype.destroy = function() {
  116638. if (this.isWorking()) {
  116639. this.abort();
  116640. }
  116641. _super.prototype.destroy.call(this);
  116642. };
  116643. FetchStreamLoader2.prototype.open = function(dataSource, range3) {
  116644. var _this = this;
  116645. this._dataSource = dataSource;
  116646. this._range = range3;
  116647. var sourceURL = dataSource.url;
  116648. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  116649. sourceURL = dataSource.redirectedURL;
  116650. }
  116651. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  116652. var headers = new self.Headers();
  116653. if (typeof seekConfig.headers === "object") {
  116654. var configHeaders = seekConfig.headers;
  116655. for (var key in configHeaders) {
  116656. if (configHeaders.hasOwnProperty(key)) {
  116657. headers.append(key, configHeaders[key]);
  116658. }
  116659. }
  116660. }
  116661. var params = {
  116662. method: "GET",
  116663. headers,
  116664. mode: "cors",
  116665. cache: "default",
  116666. referrerPolicy: "no-referrer-when-downgrade"
  116667. };
  116668. if (typeof this._config.headers === "object") {
  116669. for (var key in this._config.headers) {
  116670. headers.append(key, this._config.headers[key]);
  116671. }
  116672. }
  116673. if (dataSource.cors === false) {
  116674. params.mode = "same-origin";
  116675. }
  116676. if (dataSource.withCredentials) {
  116677. params.credentials = "include";
  116678. }
  116679. if (dataSource.referrerPolicy) {
  116680. params.referrerPolicy = dataSource.referrerPolicy;
  116681. }
  116682. if (self.AbortController) {
  116683. this._abortController = new self.AbortController();
  116684. params.signal = this._abortController.signal;
  116685. }
  116686. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  116687. self.fetch(seekConfig.url, params).then(function(res) {
  116688. if (_this._requestAbort) {
  116689. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kIdle;
  116690. res.body.cancel();
  116691. return;
  116692. }
  116693. if (res.ok && (res.status >= 200 && res.status <= 299)) {
  116694. if (res.url !== seekConfig.url) {
  116695. if (_this._onURLRedirect) {
  116696. var redirectedURL = _this._seekHandler.removeURLParameters(res.url);
  116697. _this._onURLRedirect(redirectedURL);
  116698. }
  116699. }
  116700. var lengthHeader = res.headers.get("Content-Length");
  116701. if (lengthHeader != null) {
  116702. _this._contentLength = parseInt(lengthHeader);
  116703. if (_this._contentLength !== 0) {
  116704. if (_this._onContentLengthKnown) {
  116705. _this._onContentLengthKnown(_this._contentLength);
  116706. }
  116707. }
  116708. }
  116709. return _this._pump.call(_this, res.body.getReader());
  116710. } else {
  116711. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116712. if (_this._onError) {
  116713. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: res.status, msg: res.statusText });
  116714. } else {
  116715. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("FetchStreamLoader: Http code invalid, " + res.status + " " + res.statusText);
  116716. }
  116717. }
  116718. }).catch(function(e) {
  116719. if (_this._abortController && _this._abortController.signal.aborted) {
  116720. return;
  116721. }
  116722. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116723. if (_this._onError) {
  116724. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION, { code: -1, msg: e.message });
  116725. } else {
  116726. throw e;
  116727. }
  116728. });
  116729. };
  116730. FetchStreamLoader2.prototype.abort = function() {
  116731. this._requestAbort = true;
  116732. if (this._status !== _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering || !_utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.chrome) {
  116733. if (this._abortController) {
  116734. try {
  116735. this._abortController.abort();
  116736. } catch (e) {
  116737. }
  116738. }
  116739. }
  116740. };
  116741. FetchStreamLoader2.prototype._pump = function(reader) {
  116742. var _this = this;
  116743. return reader.read().then(function(result) {
  116744. if (result.done) {
  116745. if (_this._contentLength !== null && _this._receivedLength < _this._contentLength) {
  116746. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116747. var type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116748. var info = { code: -1, msg: "Fetch stream meet Early-EOF" };
  116749. if (_this._onError) {
  116750. _this._onError(type2, info);
  116751. } else {
  116752. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116753. }
  116754. } else {
  116755. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116756. if (_this._onComplete) {
  116757. _this._onComplete(_this._range.from, _this._range.from + _this._receivedLength - 1);
  116758. }
  116759. }
  116760. } else {
  116761. if (_this._abortController && _this._abortController.signal.aborted) {
  116762. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116763. return;
  116764. } else if (_this._requestAbort === true) {
  116765. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116766. return reader.cancel();
  116767. }
  116768. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  116769. var chunk = result.value.buffer;
  116770. var byteStart = _this._range.from + _this._receivedLength;
  116771. _this._receivedLength += chunk.byteLength;
  116772. if (_this._onDataArrival) {
  116773. _this._onDataArrival(chunk, byteStart, _this._receivedLength);
  116774. }
  116775. _this._pump(reader);
  116776. }
  116777. }).catch(function(e) {
  116778. if (_this._abortController && _this._abortController.signal.aborted) {
  116779. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116780. return;
  116781. }
  116782. if (e.code === 11 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge) {
  116783. return;
  116784. }
  116785. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116786. var type2 = 0;
  116787. var info = null;
  116788. if ((e.code === 19 || e.message === "network error") && (_this._contentLength === null || _this._contentLength !== null && _this._receivedLength < _this._contentLength)) {
  116789. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116790. info = { code: e.code, msg: "Fetch stream meet Early-EOF" };
  116791. } else {
  116792. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  116793. info = { code: e.code, msg: e.message };
  116794. }
  116795. if (_this._onError) {
  116796. _this._onError(type2, info);
  116797. } else {
  116798. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116799. }
  116800. });
  116801. };
  116802. return FetchStreamLoader2;
  116803. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  116804. __webpack_exports__2["default"] = FetchStreamLoader;
  116805. },
  116806. "./src/io/io-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116807. __webpack_require__2.r(__webpack_exports__2);
  116808. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  116809. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  116810. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116811. var _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/io/fetch-stream-loader.js");
  116812. var _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/io/xhr-moz-chunked-loader.js");
  116813. var _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/io/xhr-range-loader.js");
  116814. var _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/io/websocket-loader.js");
  116815. var _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/range-seek-handler.js");
  116816. var _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/io/param-seek-handler.js");
  116817. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/utils/exception.js");
  116818. var IOController = function() {
  116819. function IOController2(dataSource, config, extraData) {
  116820. this.TAG = "IOController";
  116821. this._config = config;
  116822. this._extraData = extraData;
  116823. this._stashInitialSize = 1024 * 384;
  116824. if (config.stashInitialSize != void 0 && config.stashInitialSize > 0) {
  116825. this._stashInitialSize = config.stashInitialSize;
  116826. }
  116827. this._stashUsed = 0;
  116828. this._stashSize = this._stashInitialSize;
  116829. this._bufferSize = 1024 * 1024 * 3;
  116830. this._stashBuffer = new ArrayBuffer(this._bufferSize);
  116831. this._stashByteStart = 0;
  116832. this._enableStash = true;
  116833. if (config.enableStashBuffer === false) {
  116834. this._enableStash = false;
  116835. }
  116836. this._loader = null;
  116837. this._loaderClass = null;
  116838. this._seekHandler = null;
  116839. this._dataSource = dataSource;
  116840. this._isWebSocketURL = /wss?:\/\/(.+?)/.test(dataSource.url);
  116841. this._refTotalLength = dataSource.filesize ? dataSource.filesize : null;
  116842. this._totalLength = this._refTotalLength;
  116843. this._fullRequestFlag = false;
  116844. this._currentRange = null;
  116845. this._redirectedURL = null;
  116846. this._speedNormalized = 0;
  116847. this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  116848. this._speedNormalizeList = [64, 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096];
  116849. this._isEarlyEofReconnecting = false;
  116850. this._paused = false;
  116851. this._resumeFrom = 0;
  116852. this._onDataArrival = null;
  116853. this._onSeeked = null;
  116854. this._onError = null;
  116855. this._onComplete = null;
  116856. this._onRedirect = null;
  116857. this._onRecoveredEarlyEof = null;
  116858. this._selectSeekHandler();
  116859. this._selectLoader();
  116860. this._createLoader();
  116861. }
  116862. IOController2.prototype.destroy = function() {
  116863. if (this._loader.isWorking()) {
  116864. this._loader.abort();
  116865. }
  116866. this._loader.destroy();
  116867. this._loader = null;
  116868. this._loaderClass = null;
  116869. this._dataSource = null;
  116870. this._stashBuffer = null;
  116871. this._stashUsed = this._stashSize = this._bufferSize = this._stashByteStart = 0;
  116872. this._currentRange = null;
  116873. this._speedSampler = null;
  116874. this._isEarlyEofReconnecting = false;
  116875. this._onDataArrival = null;
  116876. this._onSeeked = null;
  116877. this._onError = null;
  116878. this._onComplete = null;
  116879. this._onRedirect = null;
  116880. this._onRecoveredEarlyEof = null;
  116881. this._extraData = null;
  116882. };
  116883. IOController2.prototype.isWorking = function() {
  116884. return this._loader && this._loader.isWorking() && !this._paused;
  116885. };
  116886. IOController2.prototype.isPaused = function() {
  116887. return this._paused;
  116888. };
  116889. Object.defineProperty(IOController2.prototype, "status", {
  116890. get: function() {
  116891. return this._loader.status;
  116892. },
  116893. enumerable: false,
  116894. configurable: true
  116895. });
  116896. Object.defineProperty(IOController2.prototype, "extraData", {
  116897. get: function() {
  116898. return this._extraData;
  116899. },
  116900. set: function(data) {
  116901. this._extraData = data;
  116902. },
  116903. enumerable: false,
  116904. configurable: true
  116905. });
  116906. Object.defineProperty(IOController2.prototype, "onDataArrival", {
  116907. get: function() {
  116908. return this._onDataArrival;
  116909. },
  116910. set: function(callback2) {
  116911. this._onDataArrival = callback2;
  116912. },
  116913. enumerable: false,
  116914. configurable: true
  116915. });
  116916. Object.defineProperty(IOController2.prototype, "onSeeked", {
  116917. get: function() {
  116918. return this._onSeeked;
  116919. },
  116920. set: function(callback2) {
  116921. this._onSeeked = callback2;
  116922. },
  116923. enumerable: false,
  116924. configurable: true
  116925. });
  116926. Object.defineProperty(IOController2.prototype, "onError", {
  116927. get: function() {
  116928. return this._onError;
  116929. },
  116930. set: function(callback2) {
  116931. this._onError = callback2;
  116932. },
  116933. enumerable: false,
  116934. configurable: true
  116935. });
  116936. Object.defineProperty(IOController2.prototype, "onComplete", {
  116937. get: function() {
  116938. return this._onComplete;
  116939. },
  116940. set: function(callback2) {
  116941. this._onComplete = callback2;
  116942. },
  116943. enumerable: false,
  116944. configurable: true
  116945. });
  116946. Object.defineProperty(IOController2.prototype, "onRedirect", {
  116947. get: function() {
  116948. return this._onRedirect;
  116949. },
  116950. set: function(callback2) {
  116951. this._onRedirect = callback2;
  116952. },
  116953. enumerable: false,
  116954. configurable: true
  116955. });
  116956. Object.defineProperty(IOController2.prototype, "onRecoveredEarlyEof", {
  116957. get: function() {
  116958. return this._onRecoveredEarlyEof;
  116959. },
  116960. set: function(callback2) {
  116961. this._onRecoveredEarlyEof = callback2;
  116962. },
  116963. enumerable: false,
  116964. configurable: true
  116965. });
  116966. Object.defineProperty(IOController2.prototype, "currentURL", {
  116967. get: function() {
  116968. return this._dataSource.url;
  116969. },
  116970. enumerable: false,
  116971. configurable: true
  116972. });
  116973. Object.defineProperty(IOController2.prototype, "hasRedirect", {
  116974. get: function() {
  116975. return this._redirectedURL != null || this._dataSource.redirectedURL != void 0;
  116976. },
  116977. enumerable: false,
  116978. configurable: true
  116979. });
  116980. Object.defineProperty(IOController2.prototype, "currentRedirectedURL", {
  116981. get: function() {
  116982. return this._redirectedURL || this._dataSource.redirectedURL;
  116983. },
  116984. enumerable: false,
  116985. configurable: true
  116986. });
  116987. Object.defineProperty(IOController2.prototype, "currentSpeed", {
  116988. get: function() {
  116989. if (this._loaderClass === _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default) {
  116990. return this._loader.currentSpeed;
  116991. }
  116992. return this._speedSampler.lastSecondKBps;
  116993. },
  116994. enumerable: false,
  116995. configurable: true
  116996. });
  116997. Object.defineProperty(IOController2.prototype, "loaderType", {
  116998. get: function() {
  116999. return this._loader.type;
  117000. },
  117001. enumerable: false,
  117002. configurable: true
  117003. });
  117004. IOController2.prototype._selectSeekHandler = function() {
  117005. var config = this._config;
  117006. if (config.seekType === "range") {
  117007. this._seekHandler = new _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__.default(this._config.rangeLoadZeroStart);
  117008. } else if (config.seekType === "param") {
  117009. var paramStart = config.seekParamStart || "bstart";
  117010. var paramEnd = config.seekParamEnd || "bend";
  117011. this._seekHandler = new _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__.default(paramStart, paramEnd);
  117012. } else if (config.seekType === "custom") {
  117013. if (typeof config.customSeekHandler !== "function") {
  117014. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");
  117015. }
  117016. this._seekHandler = new config.customSeekHandler();
  117017. } else {
  117018. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Invalid seekType in config: " + config.seekType);
  117019. }
  117020. };
  117021. IOController2.prototype._selectLoader = function() {
  117022. if (this._config.customLoader != null) {
  117023. this._loaderClass = this._config.customLoader;
  117024. } else if (this._isWebSocketURL) {
  117025. this._loaderClass = _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__.default;
  117026. } else if (_fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default.isSupported()) {
  117027. this._loaderClass = _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default;
  117028. } else if (_xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default.isSupported()) {
  117029. this._loaderClass = _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default;
  117030. } else if (_xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default.isSupported()) {
  117031. this._loaderClass = _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default;
  117032. } else {
  117033. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");
  117034. }
  117035. };
  117036. IOController2.prototype._createLoader = function() {
  117037. this._loader = new this._loaderClass(this._seekHandler, this._config);
  117038. if (this._loader.needStashBuffer === false) {
  117039. this._enableStash = false;
  117040. }
  117041. this._loader.onContentLengthKnown = this._onContentLengthKnown.bind(this);
  117042. this._loader.onURLRedirect = this._onURLRedirect.bind(this);
  117043. this._loader.onDataArrival = this._onLoaderChunkArrival.bind(this);
  117044. this._loader.onComplete = this._onLoaderComplete.bind(this);
  117045. this._loader.onError = this._onLoaderError.bind(this);
  117046. };
  117047. IOController2.prototype.open = function(optionalFrom) {
  117048. this._currentRange = { from: 0, to: -1 };
  117049. if (optionalFrom) {
  117050. this._currentRange.from = optionalFrom;
  117051. }
  117052. this._speedSampler.reset();
  117053. if (!optionalFrom) {
  117054. this._fullRequestFlag = true;
  117055. }
  117056. this._loader.open(this._dataSource, Object.assign({}, this._currentRange));
  117057. };
  117058. IOController2.prototype.abort = function() {
  117059. this._loader.abort();
  117060. if (this._paused) {
  117061. this._paused = false;
  117062. this._resumeFrom = 0;
  117063. }
  117064. };
  117065. IOController2.prototype.pause = function() {
  117066. if (this.isWorking()) {
  117067. this._loader.abort();
  117068. if (this._stashUsed !== 0) {
  117069. this._resumeFrom = this._stashByteStart;
  117070. this._currentRange.to = this._stashByteStart - 1;
  117071. } else {
  117072. this._resumeFrom = this._currentRange.to + 1;
  117073. }
  117074. this._stashUsed = 0;
  117075. this._stashByteStart = 0;
  117076. this._paused = true;
  117077. }
  117078. };
  117079. IOController2.prototype.resume = function() {
  117080. if (this._paused) {
  117081. this._paused = false;
  117082. var bytes = this._resumeFrom;
  117083. this._resumeFrom = 0;
  117084. this._internalSeek(bytes, true);
  117085. }
  117086. };
  117087. IOController2.prototype.seek = function(bytes) {
  117088. this._paused = false;
  117089. this._stashUsed = 0;
  117090. this._stashByteStart = 0;
  117091. this._internalSeek(bytes, true);
  117092. };
  117093. IOController2.prototype._internalSeek = function(bytes, dropUnconsumed) {
  117094. if (this._loader.isWorking()) {
  117095. this._loader.abort();
  117096. }
  117097. this._flushStashBuffer(dropUnconsumed);
  117098. this._loader.destroy();
  117099. this._loader = null;
  117100. var requestRange = { from: bytes, to: -1 };
  117101. this._currentRange = { from: requestRange.from, to: -1 };
  117102. this._speedSampler.reset();
  117103. this._stashSize = this._stashInitialSize;
  117104. this._createLoader();
  117105. this._loader.open(this._dataSource, requestRange);
  117106. if (this._onSeeked) {
  117107. this._onSeeked();
  117108. }
  117109. };
  117110. IOController2.prototype.updateUrl = function(url) {
  117111. if (!url || typeof url !== "string" || url.length === 0) {
  117112. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Url must be a non-empty string!");
  117113. }
  117114. this._dataSource.url = url;
  117115. };
  117116. IOController2.prototype._expandBuffer = function(expectedBytes) {
  117117. var bufferNewSize = this._stashSize;
  117118. while (bufferNewSize + 1024 * 1024 * 1 < expectedBytes) {
  117119. bufferNewSize *= 2;
  117120. }
  117121. bufferNewSize += 1024 * 1024 * 1;
  117122. if (bufferNewSize === this._bufferSize) {
  117123. return;
  117124. }
  117125. var newBuffer = new ArrayBuffer(bufferNewSize);
  117126. if (this._stashUsed > 0) {
  117127. var stashOldArray = new Uint8Array(this._stashBuffer, 0, this._stashUsed);
  117128. var stashNewArray = new Uint8Array(newBuffer, 0, bufferNewSize);
  117129. stashNewArray.set(stashOldArray, 0);
  117130. }
  117131. this._stashBuffer = newBuffer;
  117132. this._bufferSize = bufferNewSize;
  117133. };
  117134. IOController2.prototype._normalizeSpeed = function(input) {
  117135. var list = this._speedNormalizeList;
  117136. var last = list.length - 1;
  117137. var mid = 0;
  117138. var lbound = 0;
  117139. var ubound = last;
  117140. if (input < list[0]) {
  117141. return list[0];
  117142. }
  117143. while (lbound <= ubound) {
  117144. mid = lbound + Math.floor((ubound - lbound) / 2);
  117145. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  117146. return list[mid];
  117147. } else if (list[mid] < input) {
  117148. lbound = mid + 1;
  117149. } else {
  117150. ubound = mid - 1;
  117151. }
  117152. }
  117153. };
  117154. IOController2.prototype._adjustStashSize = function(normalized) {
  117155. var stashSizeKB = 0;
  117156. if (this._config.isLive) {
  117157. stashSizeKB = normalized;
  117158. } else {
  117159. if (normalized < 512) {
  117160. stashSizeKB = normalized;
  117161. } else if (normalized >= 512 && normalized <= 1024) {
  117162. stashSizeKB = Math.floor(normalized * 1.5);
  117163. } else {
  117164. stashSizeKB = normalized * 2;
  117165. }
  117166. }
  117167. if (stashSizeKB > 8192) {
  117168. stashSizeKB = 8192;
  117169. }
  117170. var bufferSize = stashSizeKB * 1024 + 1024 * 1024 * 1;
  117171. if (this._bufferSize < bufferSize) {
  117172. this._expandBuffer(bufferSize);
  117173. }
  117174. this._stashSize = stashSizeKB * 1024;
  117175. };
  117176. IOController2.prototype._dispatchChunks = function(chunks, byteStart) {
  117177. this._currentRange.to = byteStart + chunks.byteLength - 1;
  117178. return this._onDataArrival(chunks, byteStart);
  117179. };
  117180. IOController2.prototype._onURLRedirect = function(redirectedURL) {
  117181. this._redirectedURL = redirectedURL;
  117182. if (this._onRedirect) {
  117183. this._onRedirect(redirectedURL);
  117184. }
  117185. };
  117186. IOController2.prototype._onContentLengthKnown = function(contentLength) {
  117187. if (contentLength && this._fullRequestFlag) {
  117188. this._totalLength = contentLength;
  117189. this._fullRequestFlag = false;
  117190. }
  117191. };
  117192. IOController2.prototype._onLoaderChunkArrival = function(chunk, byteStart, receivedLength) {
  117193. if (!this._onDataArrival) {
  117194. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");
  117195. }
  117196. if (this._paused) {
  117197. return;
  117198. }
  117199. if (this._isEarlyEofReconnecting) {
  117200. this._isEarlyEofReconnecting = false;
  117201. if (this._onRecoveredEarlyEof) {
  117202. this._onRecoveredEarlyEof();
  117203. }
  117204. }
  117205. this._speedSampler.addBytes(chunk.byteLength);
  117206. var KBps = this._speedSampler.lastSecondKBps;
  117207. if (KBps !== 0) {
  117208. var normalized = this._normalizeSpeed(KBps);
  117209. if (this._speedNormalized !== normalized) {
  117210. this._speedNormalized = normalized;
  117211. this._adjustStashSize(normalized);
  117212. }
  117213. }
  117214. if (!this._enableStash) {
  117215. if (this._stashUsed === 0) {
  117216. var consumed = this._dispatchChunks(chunk, byteStart);
  117217. if (consumed < chunk.byteLength) {
  117218. var remain = chunk.byteLength - consumed;
  117219. if (remain > this._bufferSize) {
  117220. this._expandBuffer(remain);
  117221. }
  117222. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117223. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117224. this._stashUsed += remain;
  117225. this._stashByteStart = byteStart + consumed;
  117226. }
  117227. } else {
  117228. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117229. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117230. }
  117231. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117232. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117233. this._stashUsed += chunk.byteLength;
  117234. var consumed = this._dispatchChunks(this._stashBuffer.slice(0, this._stashUsed), this._stashByteStart);
  117235. if (consumed < this._stashUsed && consumed > 0) {
  117236. var remainArray = new Uint8Array(this._stashBuffer, consumed);
  117237. stashArray.set(remainArray, 0);
  117238. }
  117239. this._stashUsed -= consumed;
  117240. this._stashByteStart += consumed;
  117241. }
  117242. } else {
  117243. if (this._stashUsed === 0 && this._stashByteStart === 0) {
  117244. this._stashByteStart = byteStart;
  117245. }
  117246. if (this._stashUsed + chunk.byteLength <= this._stashSize) {
  117247. var stashArray = new Uint8Array(this._stashBuffer, 0, this._stashSize);
  117248. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117249. this._stashUsed += chunk.byteLength;
  117250. } else {
  117251. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117252. if (this._stashUsed > 0) {
  117253. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117254. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117255. if (consumed < buffer.byteLength) {
  117256. if (consumed > 0) {
  117257. var remainArray = new Uint8Array(buffer, consumed);
  117258. stashArray.set(remainArray, 0);
  117259. this._stashUsed = remainArray.byteLength;
  117260. this._stashByteStart += consumed;
  117261. }
  117262. } else {
  117263. this._stashUsed = 0;
  117264. this._stashByteStart += consumed;
  117265. }
  117266. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117267. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117268. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117269. }
  117270. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117271. this._stashUsed += chunk.byteLength;
  117272. } else {
  117273. var consumed = this._dispatchChunks(chunk, byteStart);
  117274. if (consumed < chunk.byteLength) {
  117275. var remain = chunk.byteLength - consumed;
  117276. if (remain > this._bufferSize) {
  117277. this._expandBuffer(remain);
  117278. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117279. }
  117280. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117281. this._stashUsed += remain;
  117282. this._stashByteStart = byteStart + consumed;
  117283. }
  117284. }
  117285. }
  117286. }
  117287. };
  117288. IOController2.prototype._flushStashBuffer = function(dropUnconsumed) {
  117289. if (this._stashUsed > 0) {
  117290. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117291. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117292. var remain = buffer.byteLength - consumed;
  117293. if (consumed < buffer.byteLength) {
  117294. if (dropUnconsumed) {
  117295. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, remain + " bytes unconsumed data remain when flush buffer, dropped");
  117296. } else {
  117297. if (consumed > 0) {
  117298. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117299. var remainArray = new Uint8Array(buffer, consumed);
  117300. stashArray.set(remainArray, 0);
  117301. this._stashUsed = remainArray.byteLength;
  117302. this._stashByteStart += consumed;
  117303. }
  117304. return 0;
  117305. }
  117306. }
  117307. this._stashUsed = 0;
  117308. this._stashByteStart = 0;
  117309. return remain;
  117310. }
  117311. return 0;
  117312. };
  117313. IOController2.prototype._onLoaderComplete = function(from3, to) {
  117314. this._flushStashBuffer(true);
  117315. if (this._onComplete) {
  117316. this._onComplete(this._extraData);
  117317. }
  117318. };
  117319. IOController2.prototype._onLoaderError = function(type2, data) {
  117320. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Loader error, code = " + data.code + ", msg = " + data.msg);
  117321. this._flushStashBuffer(false);
  117322. if (this._isEarlyEofReconnecting) {
  117323. this._isEarlyEofReconnecting = false;
  117324. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117325. }
  117326. switch (type2) {
  117327. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF: {
  117328. if (!this._config.isLive) {
  117329. if (this._totalLength) {
  117330. var nextFrom = this._currentRange.to + 1;
  117331. if (nextFrom < this._totalLength) {
  117332. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Connection lost, trying reconnect...");
  117333. this._isEarlyEofReconnecting = true;
  117334. this._internalSeek(nextFrom, false);
  117335. }
  117336. return;
  117337. }
  117338. }
  117339. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117340. break;
  117341. }
  117342. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF:
  117343. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.CONNECTING_TIMEOUT:
  117344. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID:
  117345. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION:
  117346. break;
  117347. }
  117348. if (this._onError) {
  117349. this._onError(type2, data);
  117350. } else {
  117351. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("IOException: " + data.msg);
  117352. }
  117353. };
  117354. return IOController2;
  117355. }();
  117356. __webpack_exports__2["default"] = IOController;
  117357. },
  117358. "./src/io/loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117359. __webpack_require__2.r(__webpack_exports__2);
  117360. __webpack_require__2.d(__webpack_exports__2, {
  117361. "LoaderStatus": function() {
  117362. return LoaderStatus;
  117363. },
  117364. "LoaderErrors": function() {
  117365. return LoaderErrors;
  117366. },
  117367. "BaseLoader": function() {
  117368. return BaseLoader;
  117369. }
  117370. });
  117371. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  117372. var LoaderStatus = {
  117373. kIdle: 0,
  117374. kConnecting: 1,
  117375. kBuffering: 2,
  117376. kError: 3,
  117377. kComplete: 4
  117378. };
  117379. var LoaderErrors = {
  117380. OK: "OK",
  117381. EXCEPTION: "Exception",
  117382. HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid",
  117383. CONNECTING_TIMEOUT: "ConnectingTimeout",
  117384. EARLY_EOF: "EarlyEof",
  117385. UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof"
  117386. };
  117387. var BaseLoader = function() {
  117388. function BaseLoader2(typeName) {
  117389. this._type = typeName || "undefined";
  117390. this._status = LoaderStatus.kIdle;
  117391. this._needStash = false;
  117392. this._onContentLengthKnown = null;
  117393. this._onURLRedirect = null;
  117394. this._onDataArrival = null;
  117395. this._onError = null;
  117396. this._onComplete = null;
  117397. }
  117398. BaseLoader2.prototype.destroy = function() {
  117399. this._status = LoaderStatus.kIdle;
  117400. this._onContentLengthKnown = null;
  117401. this._onURLRedirect = null;
  117402. this._onDataArrival = null;
  117403. this._onError = null;
  117404. this._onComplete = null;
  117405. };
  117406. BaseLoader2.prototype.isWorking = function() {
  117407. return this._status === LoaderStatus.kConnecting || this._status === LoaderStatus.kBuffering;
  117408. };
  117409. Object.defineProperty(BaseLoader2.prototype, "type", {
  117410. get: function() {
  117411. return this._type;
  117412. },
  117413. enumerable: false,
  117414. configurable: true
  117415. });
  117416. Object.defineProperty(BaseLoader2.prototype, "status", {
  117417. get: function() {
  117418. return this._status;
  117419. },
  117420. enumerable: false,
  117421. configurable: true
  117422. });
  117423. Object.defineProperty(BaseLoader2.prototype, "needStashBuffer", {
  117424. get: function() {
  117425. return this._needStash;
  117426. },
  117427. enumerable: false,
  117428. configurable: true
  117429. });
  117430. Object.defineProperty(BaseLoader2.prototype, "onContentLengthKnown", {
  117431. get: function() {
  117432. return this._onContentLengthKnown;
  117433. },
  117434. set: function(callback2) {
  117435. this._onContentLengthKnown = callback2;
  117436. },
  117437. enumerable: false,
  117438. configurable: true
  117439. });
  117440. Object.defineProperty(BaseLoader2.prototype, "onURLRedirect", {
  117441. get: function() {
  117442. return this._onURLRedirect;
  117443. },
  117444. set: function(callback2) {
  117445. this._onURLRedirect = callback2;
  117446. },
  117447. enumerable: false,
  117448. configurable: true
  117449. });
  117450. Object.defineProperty(BaseLoader2.prototype, "onDataArrival", {
  117451. get: function() {
  117452. return this._onDataArrival;
  117453. },
  117454. set: function(callback2) {
  117455. this._onDataArrival = callback2;
  117456. },
  117457. enumerable: false,
  117458. configurable: true
  117459. });
  117460. Object.defineProperty(BaseLoader2.prototype, "onError", {
  117461. get: function() {
  117462. return this._onError;
  117463. },
  117464. set: function(callback2) {
  117465. this._onError = callback2;
  117466. },
  117467. enumerable: false,
  117468. configurable: true
  117469. });
  117470. Object.defineProperty(BaseLoader2.prototype, "onComplete", {
  117471. get: function() {
  117472. return this._onComplete;
  117473. },
  117474. set: function(callback2) {
  117475. this._onComplete = callback2;
  117476. },
  117477. enumerable: false,
  117478. configurable: true
  117479. });
  117480. BaseLoader2.prototype.open = function(dataSource, range3) {
  117481. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117482. };
  117483. BaseLoader2.prototype.abort = function() {
  117484. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117485. };
  117486. return BaseLoader2;
  117487. }();
  117488. },
  117489. "./src/io/param-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117490. __webpack_require__2.r(__webpack_exports__2);
  117491. var ParamSeekHandler = function() {
  117492. function ParamSeekHandler2(paramStart, paramEnd) {
  117493. this._startName = paramStart;
  117494. this._endName = paramEnd;
  117495. }
  117496. ParamSeekHandler2.prototype.getConfig = function(baseUrl, range3) {
  117497. var url = baseUrl;
  117498. if (range3.from !== 0 || range3.to !== -1) {
  117499. var needAnd = true;
  117500. if (url.indexOf("?") === -1) {
  117501. url += "?";
  117502. needAnd = false;
  117503. }
  117504. if (needAnd) {
  117505. url += "&";
  117506. }
  117507. url += this._startName + "=" + range3.from.toString();
  117508. if (range3.to !== -1) {
  117509. url += "&" + this._endName + "=" + range3.to.toString();
  117510. }
  117511. }
  117512. return {
  117513. url,
  117514. headers: {}
  117515. };
  117516. };
  117517. ParamSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117518. var baseURL = seekedURL.split("?")[0];
  117519. var params = void 0;
  117520. var queryIndex = seekedURL.indexOf("?");
  117521. if (queryIndex !== -1) {
  117522. params = seekedURL.substring(queryIndex + 1);
  117523. }
  117524. var resultParams = "";
  117525. if (params != void 0 && params.length > 0) {
  117526. var pairs = params.split("&");
  117527. for (var i2 = 0; i2 < pairs.length; i2++) {
  117528. var pair = pairs[i2].split("=");
  117529. var requireAnd = i2 > 0;
  117530. if (pair[0] !== this._startName && pair[0] !== this._endName) {
  117531. if (requireAnd) {
  117532. resultParams += "&";
  117533. }
  117534. resultParams += pairs[i2];
  117535. }
  117536. }
  117537. }
  117538. return resultParams.length === 0 ? baseURL : baseURL + "?" + resultParams;
  117539. };
  117540. return ParamSeekHandler2;
  117541. }();
  117542. __webpack_exports__2["default"] = ParamSeekHandler;
  117543. },
  117544. "./src/io/range-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117545. __webpack_require__2.r(__webpack_exports__2);
  117546. var RangeSeekHandler = function() {
  117547. function RangeSeekHandler2(zeroStart) {
  117548. this._zeroStart = zeroStart || false;
  117549. }
  117550. RangeSeekHandler2.prototype.getConfig = function(url, range3) {
  117551. var headers = {};
  117552. if (range3.from !== 0 || range3.to !== -1) {
  117553. var param = void 0;
  117554. if (range3.to !== -1) {
  117555. param = "bytes=" + range3.from.toString() + "-" + range3.to.toString();
  117556. } else {
  117557. param = "bytes=" + range3.from.toString() + "-";
  117558. }
  117559. headers["Range"] = param;
  117560. } else if (this._zeroStart) {
  117561. headers["Range"] = "bytes=0-";
  117562. }
  117563. return {
  117564. url,
  117565. headers
  117566. };
  117567. };
  117568. RangeSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117569. return seekedURL;
  117570. };
  117571. return RangeSeekHandler2;
  117572. }();
  117573. __webpack_exports__2["default"] = RangeSeekHandler;
  117574. },
  117575. "./src/io/speed-sampler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117576. __webpack_require__2.r(__webpack_exports__2);
  117577. var SpeedSampler = function() {
  117578. function SpeedSampler2() {
  117579. this._firstCheckpoint = 0;
  117580. this._lastCheckpoint = 0;
  117581. this._intervalBytes = 0;
  117582. this._totalBytes = 0;
  117583. this._lastSecondBytes = 0;
  117584. if (self.performance && self.performance.now) {
  117585. this._now = self.performance.now.bind(self.performance);
  117586. } else {
  117587. this._now = Date.now;
  117588. }
  117589. }
  117590. SpeedSampler2.prototype.reset = function() {
  117591. this._firstCheckpoint = this._lastCheckpoint = 0;
  117592. this._totalBytes = this._intervalBytes = 0;
  117593. this._lastSecondBytes = 0;
  117594. };
  117595. SpeedSampler2.prototype.addBytes = function(bytes) {
  117596. if (this._firstCheckpoint === 0) {
  117597. this._firstCheckpoint = this._now();
  117598. this._lastCheckpoint = this._firstCheckpoint;
  117599. this._intervalBytes += bytes;
  117600. this._totalBytes += bytes;
  117601. } else if (this._now() - this._lastCheckpoint < 1e3) {
  117602. this._intervalBytes += bytes;
  117603. this._totalBytes += bytes;
  117604. } else {
  117605. this._lastSecondBytes = this._intervalBytes;
  117606. this._intervalBytes = bytes;
  117607. this._totalBytes += bytes;
  117608. this._lastCheckpoint = this._now();
  117609. }
  117610. };
  117611. Object.defineProperty(SpeedSampler2.prototype, "currentKBps", {
  117612. get: function() {
  117613. this.addBytes(0);
  117614. var durationSeconds = (this._now() - this._lastCheckpoint) / 1e3;
  117615. if (durationSeconds == 0)
  117616. durationSeconds = 1;
  117617. return this._intervalBytes / durationSeconds / 1024;
  117618. },
  117619. enumerable: false,
  117620. configurable: true
  117621. });
  117622. Object.defineProperty(SpeedSampler2.prototype, "lastSecondKBps", {
  117623. get: function() {
  117624. this.addBytes(0);
  117625. if (this._lastSecondBytes !== 0) {
  117626. return this._lastSecondBytes / 1024;
  117627. } else {
  117628. if (this._now() - this._lastCheckpoint >= 500) {
  117629. return this.currentKBps;
  117630. } else {
  117631. return 0;
  117632. }
  117633. }
  117634. },
  117635. enumerable: false,
  117636. configurable: true
  117637. });
  117638. Object.defineProperty(SpeedSampler2.prototype, "averageKBps", {
  117639. get: function() {
  117640. var durationSeconds = (this._now() - this._firstCheckpoint) / 1e3;
  117641. return this._totalBytes / durationSeconds / 1024;
  117642. },
  117643. enumerable: false,
  117644. configurable: true
  117645. });
  117646. return SpeedSampler2;
  117647. }();
  117648. __webpack_exports__2["default"] = SpeedSampler;
  117649. },
  117650. "./src/io/websocket-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117651. __webpack_require__2.r(__webpack_exports__2);
  117652. var _loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  117653. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/exception.js");
  117654. var __extends = function() {
  117655. var extendStatics = function(d2, b) {
  117656. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117657. d3.__proto__ = b2;
  117658. } || function(d3, b2) {
  117659. for (var p in b2)
  117660. if (Object.prototype.hasOwnProperty.call(b2, p))
  117661. d3[p] = b2[p];
  117662. };
  117663. return extendStatics(d2, b);
  117664. };
  117665. return function(d2, b) {
  117666. if (typeof b !== "function" && b !== null)
  117667. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117668. extendStatics(d2, b);
  117669. function __() {
  117670. this.constructor = d2;
  117671. }
  117672. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117673. };
  117674. }();
  117675. var WebSocketLoader = function(_super) {
  117676. __extends(WebSocketLoader2, _super);
  117677. function WebSocketLoader2() {
  117678. var _this = _super.call(this, "websocket-loader") || this;
  117679. _this.TAG = "WebSocketLoader";
  117680. _this._needStash = true;
  117681. _this._ws = null;
  117682. _this._requestAbort = false;
  117683. _this._receivedLength = 0;
  117684. return _this;
  117685. }
  117686. WebSocketLoader2.isSupported = function() {
  117687. try {
  117688. return typeof self.WebSocket !== "undefined";
  117689. } catch (e) {
  117690. return false;
  117691. }
  117692. };
  117693. WebSocketLoader2.prototype.destroy = function() {
  117694. if (this._ws) {
  117695. this.abort();
  117696. }
  117697. _super.prototype.destroy.call(this);
  117698. };
  117699. WebSocketLoader2.prototype.open = function(dataSource) {
  117700. try {
  117701. var ws = this._ws = new self.WebSocket(dataSource.url);
  117702. ws.binaryType = "arraybuffer";
  117703. ws.onopen = this._onWebSocketOpen.bind(this);
  117704. ws.onclose = this._onWebSocketClose.bind(this);
  117705. ws.onmessage = this._onWebSocketMessage.bind(this);
  117706. ws.onerror = this._onWebSocketError.bind(this);
  117707. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kConnecting;
  117708. } catch (e) {
  117709. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117710. var info = { code: e.code, msg: e.message };
  117711. if (this._onError) {
  117712. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117713. } else {
  117714. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117715. }
  117716. }
  117717. };
  117718. WebSocketLoader2.prototype.abort = function() {
  117719. var ws = this._ws;
  117720. if (ws && (ws.readyState === 0 || ws.readyState === 1)) {
  117721. this._requestAbort = true;
  117722. ws.close();
  117723. }
  117724. this._ws = null;
  117725. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117726. };
  117727. WebSocketLoader2.prototype._onWebSocketOpen = function(e) {
  117728. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kBuffering;
  117729. };
  117730. WebSocketLoader2.prototype._onWebSocketClose = function(e) {
  117731. if (this._requestAbort === true) {
  117732. this._requestAbort = false;
  117733. return;
  117734. }
  117735. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117736. if (this._onComplete) {
  117737. this._onComplete(0, this._receivedLength - 1);
  117738. }
  117739. };
  117740. WebSocketLoader2.prototype._onWebSocketMessage = function(e) {
  117741. var _this = this;
  117742. if (e.data instanceof ArrayBuffer) {
  117743. this._dispatchArrayBuffer(e.data);
  117744. } else if (e.data instanceof Blob) {
  117745. var reader_1 = new FileReader();
  117746. reader_1.onload = function() {
  117747. _this._dispatchArrayBuffer(reader_1.result);
  117748. };
  117749. reader_1.readAsArrayBuffer(e.data);
  117750. } else {
  117751. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117752. var info = { code: -1, msg: "Unsupported WebSocket message type: " + e.data.constructor.name };
  117753. if (this._onError) {
  117754. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117755. } else {
  117756. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117757. }
  117758. }
  117759. };
  117760. WebSocketLoader2.prototype._dispatchArrayBuffer = function(arraybuffer) {
  117761. var chunk = arraybuffer;
  117762. var byteStart = this._receivedLength;
  117763. this._receivedLength += chunk.byteLength;
  117764. if (this._onDataArrival) {
  117765. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117766. }
  117767. };
  117768. WebSocketLoader2.prototype._onWebSocketError = function(e) {
  117769. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117770. var info = {
  117771. code: e.code,
  117772. msg: e.message
  117773. };
  117774. if (this._onError) {
  117775. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117776. } else {
  117777. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117778. }
  117779. };
  117780. return WebSocketLoader2;
  117781. }(_loader_js__WEBPACK_IMPORTED_MODULE_0__.BaseLoader);
  117782. __webpack_exports__2["default"] = WebSocketLoader;
  117783. },
  117784. "./src/io/xhr-moz-chunked-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117785. __webpack_require__2.r(__webpack_exports__2);
  117786. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  117787. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  117788. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  117789. var __extends = function() {
  117790. var extendStatics = function(d2, b) {
  117791. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117792. d3.__proto__ = b2;
  117793. } || function(d3, b2) {
  117794. for (var p in b2)
  117795. if (Object.prototype.hasOwnProperty.call(b2, p))
  117796. d3[p] = b2[p];
  117797. };
  117798. return extendStatics(d2, b);
  117799. };
  117800. return function(d2, b) {
  117801. if (typeof b !== "function" && b !== null)
  117802. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117803. extendStatics(d2, b);
  117804. function __() {
  117805. this.constructor = d2;
  117806. }
  117807. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117808. };
  117809. }();
  117810. var MozChunkedLoader = function(_super) {
  117811. __extends(MozChunkedLoader2, _super);
  117812. function MozChunkedLoader2(seekHandler, config) {
  117813. var _this = _super.call(this, "xhr-moz-chunked-loader") || this;
  117814. _this.TAG = "MozChunkedLoader";
  117815. _this._seekHandler = seekHandler;
  117816. _this._config = config;
  117817. _this._needStash = true;
  117818. _this._xhr = null;
  117819. _this._requestAbort = false;
  117820. _this._contentLength = null;
  117821. _this._receivedLength = 0;
  117822. return _this;
  117823. }
  117824. MozChunkedLoader2.isSupported = function() {
  117825. try {
  117826. var xhr = new XMLHttpRequest();
  117827. xhr.open("GET", "https://example.com", true);
  117828. xhr.responseType = "moz-chunked-arraybuffer";
  117829. return xhr.responseType === "moz-chunked-arraybuffer";
  117830. } catch (e) {
  117831. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("MozChunkedLoader", e.message);
  117832. return false;
  117833. }
  117834. };
  117835. MozChunkedLoader2.prototype.destroy = function() {
  117836. if (this.isWorking()) {
  117837. this.abort();
  117838. }
  117839. if (this._xhr) {
  117840. this._xhr.onreadystatechange = null;
  117841. this._xhr.onprogress = null;
  117842. this._xhr.onloadend = null;
  117843. this._xhr.onerror = null;
  117844. this._xhr = null;
  117845. }
  117846. _super.prototype.destroy.call(this);
  117847. };
  117848. MozChunkedLoader2.prototype.open = function(dataSource, range3) {
  117849. this._dataSource = dataSource;
  117850. this._range = range3;
  117851. var sourceURL = dataSource.url;
  117852. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  117853. sourceURL = dataSource.redirectedURL;
  117854. }
  117855. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  117856. this._requestURL = seekConfig.url;
  117857. var xhr = this._xhr = new XMLHttpRequest();
  117858. xhr.open("GET", seekConfig.url, true);
  117859. xhr.responseType = "moz-chunked-arraybuffer";
  117860. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  117861. xhr.onprogress = this._onProgress.bind(this);
  117862. xhr.onloadend = this._onLoadEnd.bind(this);
  117863. xhr.onerror = this._onXhrError.bind(this);
  117864. if (dataSource.withCredentials) {
  117865. xhr.withCredentials = true;
  117866. }
  117867. if (typeof seekConfig.headers === "object") {
  117868. var headers = seekConfig.headers;
  117869. for (var key in headers) {
  117870. if (headers.hasOwnProperty(key)) {
  117871. xhr.setRequestHeader(key, headers[key]);
  117872. }
  117873. }
  117874. }
  117875. if (typeof this._config.headers === "object") {
  117876. var headers = this._config.headers;
  117877. for (var key in headers) {
  117878. if (headers.hasOwnProperty(key)) {
  117879. xhr.setRequestHeader(key, headers[key]);
  117880. }
  117881. }
  117882. }
  117883. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  117884. xhr.send();
  117885. };
  117886. MozChunkedLoader2.prototype.abort = function() {
  117887. this._requestAbort = true;
  117888. if (this._xhr) {
  117889. this._xhr.abort();
  117890. }
  117891. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117892. };
  117893. MozChunkedLoader2.prototype._onReadyStateChange = function(e) {
  117894. var xhr = e.target;
  117895. if (xhr.readyState === 2) {
  117896. if (xhr.responseURL != void 0 && xhr.responseURL !== this._requestURL) {
  117897. if (this._onURLRedirect) {
  117898. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  117899. this._onURLRedirect(redirectedURL);
  117900. }
  117901. }
  117902. if (xhr.status !== 0 && (xhr.status < 200 || xhr.status > 299)) {
  117903. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117904. if (this._onError) {
  117905. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  117906. } else {
  117907. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("MozChunkedLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  117908. }
  117909. } else {
  117910. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  117911. }
  117912. }
  117913. };
  117914. MozChunkedLoader2.prototype._onProgress = function(e) {
  117915. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117916. return;
  117917. }
  117918. if (this._contentLength === null) {
  117919. if (e.total !== null && e.total !== 0) {
  117920. this._contentLength = e.total;
  117921. if (this._onContentLengthKnown) {
  117922. this._onContentLengthKnown(this._contentLength);
  117923. }
  117924. }
  117925. }
  117926. var chunk = e.target.response;
  117927. var byteStart = this._range.from + this._receivedLength;
  117928. this._receivedLength += chunk.byteLength;
  117929. if (this._onDataArrival) {
  117930. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117931. }
  117932. };
  117933. MozChunkedLoader2.prototype._onLoadEnd = function(e) {
  117934. if (this._requestAbort === true) {
  117935. this._requestAbort = false;
  117936. return;
  117937. } else if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117938. return;
  117939. }
  117940. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117941. if (this._onComplete) {
  117942. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  117943. }
  117944. };
  117945. MozChunkedLoader2.prototype._onXhrError = function(e) {
  117946. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117947. var type2 = 0;
  117948. var info = null;
  117949. if (this._contentLength && e.loaded < this._contentLength) {
  117950. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  117951. info = { code: -1, msg: "Moz-Chunked stream meet Early-Eof" };
  117952. } else {
  117953. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  117954. info = { code: -1, msg: e.constructor.name + " " + e.type };
  117955. }
  117956. if (this._onError) {
  117957. this._onError(type2, info);
  117958. } else {
  117959. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  117960. }
  117961. };
  117962. return MozChunkedLoader2;
  117963. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  117964. __webpack_exports__2["default"] = MozChunkedLoader;
  117965. },
  117966. "./src/io/xhr-range-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117967. __webpack_require__2.r(__webpack_exports__2);
  117968. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  117969. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  117970. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  117971. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  117972. var __extends = function() {
  117973. var extendStatics = function(d2, b) {
  117974. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117975. d3.__proto__ = b2;
  117976. } || function(d3, b2) {
  117977. for (var p in b2)
  117978. if (Object.prototype.hasOwnProperty.call(b2, p))
  117979. d3[p] = b2[p];
  117980. };
  117981. return extendStatics(d2, b);
  117982. };
  117983. return function(d2, b) {
  117984. if (typeof b !== "function" && b !== null)
  117985. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117986. extendStatics(d2, b);
  117987. function __() {
  117988. this.constructor = d2;
  117989. }
  117990. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117991. };
  117992. }();
  117993. var RangeLoader = function(_super) {
  117994. __extends(RangeLoader2, _super);
  117995. function RangeLoader2(seekHandler, config) {
  117996. var _this = _super.call(this, "xhr-range-loader") || this;
  117997. _this.TAG = "RangeLoader";
  117998. _this._seekHandler = seekHandler;
  117999. _this._config = config;
  118000. _this._needStash = false;
  118001. _this._chunkSizeKBList = [
  118002. 128,
  118003. 256,
  118004. 384,
  118005. 512,
  118006. 768,
  118007. 1024,
  118008. 1536,
  118009. 2048,
  118010. 3072,
  118011. 4096,
  118012. 5120,
  118013. 6144,
  118014. 7168,
  118015. 8192
  118016. ];
  118017. _this._currentChunkSizeKB = 384;
  118018. _this._currentSpeedNormalized = 0;
  118019. _this._zeroSpeedChunkCount = 0;
  118020. _this._xhr = null;
  118021. _this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  118022. _this._requestAbort = false;
  118023. _this._waitForTotalLength = false;
  118024. _this._totalLengthReceived = false;
  118025. _this._currentRequestURL = null;
  118026. _this._currentRedirectedURL = null;
  118027. _this._currentRequestRange = null;
  118028. _this._totalLength = null;
  118029. _this._contentLength = null;
  118030. _this._receivedLength = 0;
  118031. _this._lastTimeLoaded = 0;
  118032. return _this;
  118033. }
  118034. RangeLoader2.isSupported = function() {
  118035. try {
  118036. var xhr = new XMLHttpRequest();
  118037. xhr.open("GET", "https://example.com", true);
  118038. xhr.responseType = "arraybuffer";
  118039. return xhr.responseType === "arraybuffer";
  118040. } catch (e) {
  118041. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("RangeLoader", e.message);
  118042. return false;
  118043. }
  118044. };
  118045. RangeLoader2.prototype.destroy = function() {
  118046. if (this.isWorking()) {
  118047. this.abort();
  118048. }
  118049. if (this._xhr) {
  118050. this._xhr.onreadystatechange = null;
  118051. this._xhr.onprogress = null;
  118052. this._xhr.onload = null;
  118053. this._xhr.onerror = null;
  118054. this._xhr = null;
  118055. }
  118056. _super.prototype.destroy.call(this);
  118057. };
  118058. Object.defineProperty(RangeLoader2.prototype, "currentSpeed", {
  118059. get: function() {
  118060. return this._speedSampler.lastSecondKBps;
  118061. },
  118062. enumerable: false,
  118063. configurable: true
  118064. });
  118065. RangeLoader2.prototype.open = function(dataSource, range3) {
  118066. this._dataSource = dataSource;
  118067. this._range = range3;
  118068. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kConnecting;
  118069. var useRefTotalLength = false;
  118070. if (this._dataSource.filesize != void 0 && this._dataSource.filesize !== 0) {
  118071. useRefTotalLength = true;
  118072. this._totalLength = this._dataSource.filesize;
  118073. }
  118074. if (!this._totalLengthReceived && !useRefTotalLength) {
  118075. this._waitForTotalLength = true;
  118076. this._internalOpen(this._dataSource, { from: 0, to: -1 });
  118077. } else {
  118078. this._openSubRange();
  118079. }
  118080. };
  118081. RangeLoader2.prototype._openSubRange = function() {
  118082. var chunkSize = this._currentChunkSizeKB * 1024;
  118083. var from3 = this._range.from + this._receivedLength;
  118084. var to = from3 + chunkSize;
  118085. if (this._contentLength != null) {
  118086. if (to - this._range.from >= this._contentLength) {
  118087. to = this._range.from + this._contentLength - 1;
  118088. }
  118089. }
  118090. this._currentRequestRange = { from: from3, to };
  118091. this._internalOpen(this._dataSource, this._currentRequestRange);
  118092. };
  118093. RangeLoader2.prototype._internalOpen = function(dataSource, range3) {
  118094. this._lastTimeLoaded = 0;
  118095. var sourceURL = dataSource.url;
  118096. if (this._config.reuseRedirectedURL) {
  118097. if (this._currentRedirectedURL != void 0) {
  118098. sourceURL = this._currentRedirectedURL;
  118099. } else if (dataSource.redirectedURL != void 0) {
  118100. sourceURL = dataSource.redirectedURL;
  118101. }
  118102. }
  118103. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  118104. this._currentRequestURL = seekConfig.url;
  118105. var xhr = this._xhr = new XMLHttpRequest();
  118106. xhr.open("GET", seekConfig.url, true);
  118107. xhr.responseType = "arraybuffer";
  118108. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  118109. xhr.onprogress = this._onProgress.bind(this);
  118110. xhr.onload = this._onLoad.bind(this);
  118111. xhr.onerror = this._onXhrError.bind(this);
  118112. if (dataSource.withCredentials) {
  118113. xhr.withCredentials = true;
  118114. }
  118115. if (typeof seekConfig.headers === "object") {
  118116. var headers = seekConfig.headers;
  118117. for (var key in headers) {
  118118. if (headers.hasOwnProperty(key)) {
  118119. xhr.setRequestHeader(key, headers[key]);
  118120. }
  118121. }
  118122. }
  118123. if (typeof this._config.headers === "object") {
  118124. var headers = this._config.headers;
  118125. for (var key in headers) {
  118126. if (headers.hasOwnProperty(key)) {
  118127. xhr.setRequestHeader(key, headers[key]);
  118128. }
  118129. }
  118130. }
  118131. xhr.send();
  118132. };
  118133. RangeLoader2.prototype.abort = function() {
  118134. this._requestAbort = true;
  118135. this._internalAbort();
  118136. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118137. };
  118138. RangeLoader2.prototype._internalAbort = function() {
  118139. if (this._xhr) {
  118140. this._xhr.onreadystatechange = null;
  118141. this._xhr.onprogress = null;
  118142. this._xhr.onload = null;
  118143. this._xhr.onerror = null;
  118144. this._xhr.abort();
  118145. this._xhr = null;
  118146. }
  118147. };
  118148. RangeLoader2.prototype._onReadyStateChange = function(e) {
  118149. var xhr = e.target;
  118150. if (xhr.readyState === 2) {
  118151. if (xhr.responseURL != void 0) {
  118152. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  118153. if (xhr.responseURL !== this._currentRequestURL && redirectedURL !== this._currentRedirectedURL) {
  118154. this._currentRedirectedURL = redirectedURL;
  118155. if (this._onURLRedirect) {
  118156. this._onURLRedirect(redirectedURL);
  118157. }
  118158. }
  118159. }
  118160. if (xhr.status >= 200 && xhr.status <= 299) {
  118161. if (this._waitForTotalLength) {
  118162. return;
  118163. }
  118164. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kBuffering;
  118165. } else {
  118166. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118167. if (this._onError) {
  118168. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  118169. } else {
  118170. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException("RangeLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  118171. }
  118172. }
  118173. }
  118174. };
  118175. RangeLoader2.prototype._onProgress = function(e) {
  118176. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118177. return;
  118178. }
  118179. if (this._contentLength === null) {
  118180. var openNextRange = false;
  118181. if (this._waitForTotalLength) {
  118182. this._waitForTotalLength = false;
  118183. this._totalLengthReceived = true;
  118184. openNextRange = true;
  118185. var total = e.total;
  118186. this._internalAbort();
  118187. if (total != null & total !== 0) {
  118188. this._totalLength = total;
  118189. }
  118190. }
  118191. if (this._range.to === -1) {
  118192. this._contentLength = this._totalLength - this._range.from;
  118193. } else {
  118194. this._contentLength = this._range.to - this._range.from + 1;
  118195. }
  118196. if (openNextRange) {
  118197. this._openSubRange();
  118198. return;
  118199. }
  118200. if (this._onContentLengthKnown) {
  118201. this._onContentLengthKnown(this._contentLength);
  118202. }
  118203. }
  118204. var delta = e.loaded - this._lastTimeLoaded;
  118205. this._lastTimeLoaded = e.loaded;
  118206. this._speedSampler.addBytes(delta);
  118207. };
  118208. RangeLoader2.prototype._normalizeSpeed = function(input) {
  118209. var list = this._chunkSizeKBList;
  118210. var last = list.length - 1;
  118211. var mid = 0;
  118212. var lbound = 0;
  118213. var ubound = last;
  118214. if (input < list[0]) {
  118215. return list[0];
  118216. }
  118217. while (lbound <= ubound) {
  118218. mid = lbound + Math.floor((ubound - lbound) / 2);
  118219. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  118220. return list[mid];
  118221. } else if (list[mid] < input) {
  118222. lbound = mid + 1;
  118223. } else {
  118224. ubound = mid - 1;
  118225. }
  118226. }
  118227. };
  118228. RangeLoader2.prototype._onLoad = function(e) {
  118229. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118230. return;
  118231. }
  118232. if (this._waitForTotalLength) {
  118233. this._waitForTotalLength = false;
  118234. return;
  118235. }
  118236. this._lastTimeLoaded = 0;
  118237. var KBps = this._speedSampler.lastSecondKBps;
  118238. if (KBps === 0) {
  118239. this._zeroSpeedChunkCount++;
  118240. if (this._zeroSpeedChunkCount >= 3) {
  118241. KBps = this._speedSampler.currentKBps;
  118242. }
  118243. }
  118244. if (KBps !== 0) {
  118245. var normalized = this._normalizeSpeed(KBps);
  118246. if (this._currentSpeedNormalized !== normalized) {
  118247. this._currentSpeedNormalized = normalized;
  118248. this._currentChunkSizeKB = normalized;
  118249. }
  118250. }
  118251. var chunk = e.target.response;
  118252. var byteStart = this._range.from + this._receivedLength;
  118253. this._receivedLength += chunk.byteLength;
  118254. var reportComplete = false;
  118255. if (this._contentLength != null && this._receivedLength < this._contentLength) {
  118256. this._openSubRange();
  118257. } else {
  118258. reportComplete = true;
  118259. }
  118260. if (this._onDataArrival) {
  118261. this._onDataArrival(chunk, byteStart, this._receivedLength);
  118262. }
  118263. if (reportComplete) {
  118264. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118265. if (this._onComplete) {
  118266. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  118267. }
  118268. }
  118269. };
  118270. RangeLoader2.prototype._onXhrError = function(e) {
  118271. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118272. var type2 = 0;
  118273. var info = null;
  118274. if (this._contentLength && this._receivedLength > 0 && this._receivedLength < this._contentLength) {
  118275. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF;
  118276. info = { code: -1, msg: "RangeLoader meet Early-Eof" };
  118277. } else {
  118278. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION;
  118279. info = { code: -1, msg: e.constructor.name + " " + e.type };
  118280. }
  118281. if (this._onError) {
  118282. this._onError(type2, info);
  118283. } else {
  118284. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException(info.msg);
  118285. }
  118286. };
  118287. return RangeLoader2;
  118288. }(_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader);
  118289. __webpack_exports__2["default"] = RangeLoader;
  118290. },
  118291. "./src/player/flv-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118292. __webpack_require__2.r(__webpack_exports__2);
  118293. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118294. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118295. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  118296. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  118297. var _player_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/player-events.js");
  118298. var _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxer.js");
  118299. var _core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  118300. var _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/mse-controller.js");
  118301. var _core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/core/mse-events.js");
  118302. var _player_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/player/player-errors.js");
  118303. var _config_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/config.js");
  118304. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__2("./src/utils/exception.js");
  118305. var FlvPlayer = function() {
  118306. function FlvPlayer2(mediaDataSource, config) {
  118307. this.TAG = "FlvPlayer";
  118308. this._type = "FlvPlayer";
  118309. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118310. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_9__.createDefaultConfig)();
  118311. if (typeof config === "object") {
  118312. Object.assign(this._config, config);
  118313. }
  118314. if (mediaDataSource.type.toLowerCase() !== "flv") {
  118315. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");
  118316. }
  118317. if (mediaDataSource.isLive === true) {
  118318. this._config.isLive = true;
  118319. }
  118320. this.e = {
  118321. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  118322. onvSeeking: this._onvSeeking.bind(this),
  118323. onvCanPlay: this._onvCanPlay.bind(this),
  118324. onvStalled: this._onvStalled.bind(this),
  118325. onvProgress: this._onvProgress.bind(this)
  118326. };
  118327. if (self.performance && self.performance.now) {
  118328. this._now = self.performance.now.bind(self.performance);
  118329. } else {
  118330. this._now = Date.now;
  118331. }
  118332. this._pendingSeekTime = null;
  118333. this._requestSetTime = false;
  118334. this._seekpointRecord = null;
  118335. this._progressChecker = null;
  118336. this._mediaDataSource = mediaDataSource;
  118337. this._mediaElement = null;
  118338. this._msectl = null;
  118339. this._transmuxer = null;
  118340. this._mseSourceOpened = false;
  118341. this._hasPendingLoad = false;
  118342. this._receivedCanPlay = false;
  118343. this._mediaInfo = null;
  118344. this._statisticsInfo = null;
  118345. var chromeNeedIDRFix = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.build < 2661);
  118346. this._alwaysSeekKeyframe = chromeNeedIDRFix || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msie ? true : false;
  118347. if (this._alwaysSeekKeyframe) {
  118348. this._config.accurateSeek = false;
  118349. }
  118350. }
  118351. FlvPlayer2.prototype.destroy = function() {
  118352. if (this._progressChecker != null) {
  118353. window.clearInterval(this._progressChecker);
  118354. this._progressChecker = null;
  118355. }
  118356. if (this._transmuxer) {
  118357. this.unload();
  118358. }
  118359. if (this._mediaElement) {
  118360. this.detachMediaElement();
  118361. }
  118362. this.e = null;
  118363. this._mediaDataSource = null;
  118364. this._emitter.removeAllListeners();
  118365. this._emitter = null;
  118366. };
  118367. FlvPlayer2.prototype.on = function(event2, listener) {
  118368. var _this = this;
  118369. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO) {
  118370. if (this._mediaInfo != null) {
  118371. Promise.resolve().then(function() {
  118372. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, _this.mediaInfo);
  118373. });
  118374. }
  118375. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO) {
  118376. if (this._statisticsInfo != null) {
  118377. Promise.resolve().then(function() {
  118378. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, _this.statisticsInfo);
  118379. });
  118380. }
  118381. }
  118382. this._emitter.addListener(event2, listener);
  118383. };
  118384. FlvPlayer2.prototype.off = function(event2, listener) {
  118385. this._emitter.removeListener(event2, listener);
  118386. };
  118387. FlvPlayer2.prototype.attachMediaElement = function(mediaElement) {
  118388. var _this = this;
  118389. this._mediaElement = mediaElement;
  118390. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118391. mediaElement.addEventListener("seeking", this.e.onvSeeking);
  118392. mediaElement.addEventListener("canplay", this.e.onvCanPlay);
  118393. mediaElement.addEventListener("stalled", this.e.onvStalled);
  118394. mediaElement.addEventListener("progress", this.e.onvProgress);
  118395. this._msectl = new _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__.default(this._config);
  118396. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.UPDATE_END, this._onmseUpdateEnd.bind(this));
  118397. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.BUFFER_FULL, this._onmseBufferFull.bind(this));
  118398. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.SOURCE_OPEN, function() {
  118399. _this._mseSourceOpened = true;
  118400. if (_this._hasPendingLoad) {
  118401. _this._hasPendingLoad = false;
  118402. _this.load();
  118403. }
  118404. });
  118405. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.ERROR, function(info) {
  118406. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorDetails.MEDIA_MSE_ERROR, info);
  118407. });
  118408. this._msectl.attachMediaElement(mediaElement);
  118409. if (this._pendingSeekTime != null) {
  118410. try {
  118411. mediaElement.currentTime = this._pendingSeekTime;
  118412. this._pendingSeekTime = null;
  118413. } catch (e) {
  118414. }
  118415. }
  118416. };
  118417. FlvPlayer2.prototype.detachMediaElement = function() {
  118418. if (this._mediaElement) {
  118419. this._msectl.detachMediaElement();
  118420. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118421. this._mediaElement.removeEventListener("seeking", this.e.onvSeeking);
  118422. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118423. this._mediaElement.removeEventListener("stalled", this.e.onvStalled);
  118424. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118425. this._mediaElement = null;
  118426. }
  118427. if (this._msectl) {
  118428. this._msectl.destroy();
  118429. this._msectl = null;
  118430. }
  118431. };
  118432. FlvPlayer2.prototype.load = function() {
  118433. var _this = this;
  118434. if (!this._mediaElement) {
  118435. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118436. }
  118437. if (this._transmuxer) {
  118438. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");
  118439. }
  118440. if (this._hasPendingLoad) {
  118441. return;
  118442. }
  118443. if (this._config.deferLoadAfterSourceOpen && this._mseSourceOpened === false) {
  118444. this._hasPendingLoad = true;
  118445. return;
  118446. }
  118447. if (this._mediaElement.readyState > 0) {
  118448. this._requestSetTime = true;
  118449. this._mediaElement.currentTime = 0;
  118450. }
  118451. this._transmuxer = new _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(this._mediaDataSource, this._config);
  118452. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, function(type2, is) {
  118453. _this._msectl.appendInitSegment(is);
  118454. });
  118455. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, function(type2, ms) {
  118456. _this._msectl.appendMediaSegment(ms);
  118457. if (_this._config.lazyLoad && !_this._config.isLive) {
  118458. var currentTime = _this._mediaElement.currentTime;
  118459. if (ms.info.endDts >= (currentTime + _this._config.lazyLoadMaxDuration) * 1e3) {
  118460. if (_this._progressChecker == null) {
  118461. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(_this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118462. _this._suspendTransmuxer();
  118463. }
  118464. }
  118465. }
  118466. });
  118467. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, function() {
  118468. _this._msectl.endOfStream();
  118469. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE);
  118470. });
  118471. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, function() {
  118472. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF);
  118473. });
  118474. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, function(detail, info) {
  118475. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.NETWORK_ERROR, detail, info);
  118476. });
  118477. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, function(detail, info) {
  118478. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, detail, { code: -1, msg: info });
  118479. });
  118480. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, function(mediaInfo) {
  118481. _this._mediaInfo = mediaInfo;
  118482. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, Object.assign({}, mediaInfo));
  118483. });
  118484. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, function(metadata) {
  118485. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, metadata);
  118486. });
  118487. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, function(data) {
  118488. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, data);
  118489. });
  118490. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, function(statInfo) {
  118491. _this._statisticsInfo = _this._fillStatisticsInfo(statInfo);
  118492. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, Object.assign({}, _this._statisticsInfo));
  118493. });
  118494. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, function(milliseconds) {
  118495. if (_this._mediaElement && !_this._config.accurateSeek) {
  118496. _this._requestSetTime = true;
  118497. _this._mediaElement.currentTime = milliseconds / 1e3;
  118498. }
  118499. });
  118500. this._transmuxer.open();
  118501. };
  118502. FlvPlayer2.prototype.unload = function() {
  118503. if (this._mediaElement) {
  118504. this._mediaElement.pause();
  118505. }
  118506. if (this._msectl) {
  118507. this._msectl.seek(0);
  118508. }
  118509. if (this._transmuxer) {
  118510. this._transmuxer.close();
  118511. this._transmuxer.destroy();
  118512. this._transmuxer = null;
  118513. }
  118514. };
  118515. FlvPlayer2.prototype.play = function() {
  118516. return this._mediaElement.play();
  118517. };
  118518. FlvPlayer2.prototype.pause = function() {
  118519. this._mediaElement.pause();
  118520. };
  118521. Object.defineProperty(FlvPlayer2.prototype, "type", {
  118522. get: function() {
  118523. return this._type;
  118524. },
  118525. enumerable: false,
  118526. configurable: true
  118527. });
  118528. Object.defineProperty(FlvPlayer2.prototype, "buffered", {
  118529. get: function() {
  118530. return this._mediaElement.buffered;
  118531. },
  118532. enumerable: false,
  118533. configurable: true
  118534. });
  118535. Object.defineProperty(FlvPlayer2.prototype, "duration", {
  118536. get: function() {
  118537. return this._mediaElement.duration;
  118538. },
  118539. enumerable: false,
  118540. configurable: true
  118541. });
  118542. Object.defineProperty(FlvPlayer2.prototype, "volume", {
  118543. get: function() {
  118544. return this._mediaElement.volume;
  118545. },
  118546. set: function(value) {
  118547. this._mediaElement.volume = value;
  118548. },
  118549. enumerable: false,
  118550. configurable: true
  118551. });
  118552. Object.defineProperty(FlvPlayer2.prototype, "muted", {
  118553. get: function() {
  118554. return this._mediaElement.muted;
  118555. },
  118556. set: function(muted) {
  118557. this._mediaElement.muted = muted;
  118558. },
  118559. enumerable: false,
  118560. configurable: true
  118561. });
  118562. Object.defineProperty(FlvPlayer2.prototype, "currentTime", {
  118563. get: function() {
  118564. if (this._mediaElement) {
  118565. return this._mediaElement.currentTime;
  118566. }
  118567. return 0;
  118568. },
  118569. set: function(seconds) {
  118570. if (this._mediaElement) {
  118571. this._internalSeek(seconds);
  118572. } else {
  118573. this._pendingSeekTime = seconds;
  118574. }
  118575. },
  118576. enumerable: false,
  118577. configurable: true
  118578. });
  118579. Object.defineProperty(FlvPlayer2.prototype, "mediaInfo", {
  118580. get: function() {
  118581. return Object.assign({}, this._mediaInfo);
  118582. },
  118583. enumerable: false,
  118584. configurable: true
  118585. });
  118586. Object.defineProperty(FlvPlayer2.prototype, "statisticsInfo", {
  118587. get: function() {
  118588. if (this._statisticsInfo == null) {
  118589. this._statisticsInfo = {};
  118590. }
  118591. this._statisticsInfo = this._fillStatisticsInfo(this._statisticsInfo);
  118592. return Object.assign({}, this._statisticsInfo);
  118593. },
  118594. enumerable: false,
  118595. configurable: true
  118596. });
  118597. FlvPlayer2.prototype._fillStatisticsInfo = function(statInfo) {
  118598. statInfo.playerType = this._type;
  118599. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  118600. return statInfo;
  118601. }
  118602. var hasQualityInfo = true;
  118603. var decoded = 0;
  118604. var dropped = 0;
  118605. if (this._mediaElement.getVideoPlaybackQuality) {
  118606. var quality = this._mediaElement.getVideoPlaybackQuality();
  118607. decoded = quality.totalVideoFrames;
  118608. dropped = quality.droppedVideoFrames;
  118609. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  118610. decoded = this._mediaElement.webkitDecodedFrameCount;
  118611. dropped = this._mediaElement.webkitDroppedFrameCount;
  118612. } else {
  118613. hasQualityInfo = false;
  118614. }
  118615. if (hasQualityInfo) {
  118616. statInfo.decodedFrames = decoded;
  118617. statInfo.droppedFrames = dropped;
  118618. }
  118619. return statInfo;
  118620. };
  118621. FlvPlayer2.prototype._onmseUpdateEnd = function() {
  118622. if (!this._config.lazyLoad || this._config.isLive) {
  118623. return;
  118624. }
  118625. var buffered = this._mediaElement.buffered;
  118626. var currentTime = this._mediaElement.currentTime;
  118627. var currentRangeEnd = 0;
  118628. for (var i2 = 0; i2 < buffered.length; i2++) {
  118629. var start2 = buffered.start(i2);
  118630. var end = buffered.end(i2);
  118631. if (start2 <= currentTime && currentTime < end) {
  118632. currentRangeEnd = end;
  118633. break;
  118634. }
  118635. }
  118636. if (currentRangeEnd >= currentTime + this._config.lazyLoadMaxDuration && this._progressChecker == null) {
  118637. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118638. this._suspendTransmuxer();
  118639. }
  118640. };
  118641. FlvPlayer2.prototype._onmseBufferFull = function() {
  118642. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MSE SourceBuffer is full, suspend transmuxing task");
  118643. if (this._progressChecker == null) {
  118644. this._suspendTransmuxer();
  118645. }
  118646. };
  118647. FlvPlayer2.prototype._suspendTransmuxer = function() {
  118648. if (this._transmuxer) {
  118649. this._transmuxer.pause();
  118650. if (this._progressChecker == null) {
  118651. this._progressChecker = window.setInterval(this._checkProgressAndResume.bind(this), 1e3);
  118652. }
  118653. }
  118654. };
  118655. FlvPlayer2.prototype._checkProgressAndResume = function() {
  118656. var currentTime = this._mediaElement.currentTime;
  118657. var buffered = this._mediaElement.buffered;
  118658. var needResume = false;
  118659. for (var i2 = 0; i2 < buffered.length; i2++) {
  118660. var from3 = buffered.start(i2);
  118661. var to = buffered.end(i2);
  118662. if (currentTime >= from3 && currentTime < to) {
  118663. if (currentTime >= to - this._config.lazyLoadRecoverDuration) {
  118664. needResume = true;
  118665. }
  118666. break;
  118667. }
  118668. }
  118669. if (needResume) {
  118670. window.clearInterval(this._progressChecker);
  118671. this._progressChecker = null;
  118672. if (needResume) {
  118673. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Continue loading from paused position");
  118674. this._transmuxer.resume();
  118675. }
  118676. }
  118677. };
  118678. FlvPlayer2.prototype._isTimepointBuffered = function(seconds) {
  118679. var buffered = this._mediaElement.buffered;
  118680. for (var i2 = 0; i2 < buffered.length; i2++) {
  118681. var from3 = buffered.start(i2);
  118682. var to = buffered.end(i2);
  118683. if (seconds >= from3 && seconds < to) {
  118684. return true;
  118685. }
  118686. }
  118687. return false;
  118688. };
  118689. FlvPlayer2.prototype._internalSeek = function(seconds) {
  118690. var directSeek = this._isTimepointBuffered(seconds);
  118691. var directSeekBegin = false;
  118692. var directSeekBeginTime = 0;
  118693. if (seconds < 1 && this._mediaElement.buffered.length > 0) {
  118694. var videoBeginTime = this._mediaElement.buffered.start(0);
  118695. if (videoBeginTime < 1 && seconds < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118696. directSeekBegin = true;
  118697. directSeekBeginTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118698. }
  118699. }
  118700. if (directSeekBegin) {
  118701. this._requestSetTime = true;
  118702. this._mediaElement.currentTime = directSeekBeginTime;
  118703. } else if (directSeek) {
  118704. if (!this._alwaysSeekKeyframe) {
  118705. this._requestSetTime = true;
  118706. this._mediaElement.currentTime = seconds;
  118707. } else {
  118708. var idr = this._msectl.getNearestKeyframe(Math.floor(seconds * 1e3));
  118709. this._requestSetTime = true;
  118710. if (idr != null) {
  118711. this._mediaElement.currentTime = idr.dts / 1e3;
  118712. } else {
  118713. this._mediaElement.currentTime = seconds;
  118714. }
  118715. }
  118716. if (this._progressChecker != null) {
  118717. this._checkProgressAndResume();
  118718. }
  118719. } else {
  118720. if (this._progressChecker != null) {
  118721. window.clearInterval(this._progressChecker);
  118722. this._progressChecker = null;
  118723. }
  118724. this._msectl.seek(seconds);
  118725. this._transmuxer.seek(Math.floor(seconds * 1e3));
  118726. if (this._config.accurateSeek) {
  118727. this._requestSetTime = true;
  118728. this._mediaElement.currentTime = seconds;
  118729. }
  118730. }
  118731. };
  118732. FlvPlayer2.prototype._checkAndApplyUnbufferedSeekpoint = function() {
  118733. if (this._seekpointRecord) {
  118734. if (this._seekpointRecord.recordTime <= this._now() - 100) {
  118735. var target = this._mediaElement.currentTime;
  118736. this._seekpointRecord = null;
  118737. if (!this._isTimepointBuffered(target)) {
  118738. if (this._progressChecker != null) {
  118739. window.clearTimeout(this._progressChecker);
  118740. this._progressChecker = null;
  118741. }
  118742. this._msectl.seek(target);
  118743. this._transmuxer.seek(Math.floor(target * 1e3));
  118744. if (this._config.accurateSeek) {
  118745. this._requestSetTime = true;
  118746. this._mediaElement.currentTime = target;
  118747. }
  118748. }
  118749. } else {
  118750. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118751. }
  118752. }
  118753. };
  118754. FlvPlayer2.prototype._checkAndResumeStuckPlayback = function(stalled) {
  118755. var media = this._mediaElement;
  118756. if (stalled || !this._receivedCanPlay || media.readyState < 2) {
  118757. var buffered = media.buffered;
  118758. if (buffered.length > 0 && media.currentTime < buffered.start(0)) {
  118759. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.w(this.TAG, "Playback seems stuck at " + media.currentTime + ", seek to " + buffered.start(0));
  118760. this._requestSetTime = true;
  118761. this._mediaElement.currentTime = buffered.start(0);
  118762. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118763. }
  118764. } else {
  118765. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118766. }
  118767. };
  118768. FlvPlayer2.prototype._onvLoadedMetadata = function(e) {
  118769. if (this._pendingSeekTime != null) {
  118770. this._mediaElement.currentTime = this._pendingSeekTime;
  118771. this._pendingSeekTime = null;
  118772. }
  118773. };
  118774. FlvPlayer2.prototype._onvSeeking = function(e) {
  118775. var target = this._mediaElement.currentTime;
  118776. var buffered = this._mediaElement.buffered;
  118777. if (this._requestSetTime) {
  118778. this._requestSetTime = false;
  118779. return;
  118780. }
  118781. if (target < 1 && buffered.length > 0) {
  118782. var videoBeginTime = buffered.start(0);
  118783. if (videoBeginTime < 1 && target < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118784. this._requestSetTime = true;
  118785. this._mediaElement.currentTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118786. return;
  118787. }
  118788. }
  118789. if (this._isTimepointBuffered(target)) {
  118790. if (this._alwaysSeekKeyframe) {
  118791. var idr = this._msectl.getNearestKeyframe(Math.floor(target * 1e3));
  118792. if (idr != null) {
  118793. this._requestSetTime = true;
  118794. this._mediaElement.currentTime = idr.dts / 1e3;
  118795. }
  118796. }
  118797. if (this._progressChecker != null) {
  118798. this._checkProgressAndResume();
  118799. }
  118800. return;
  118801. }
  118802. this._seekpointRecord = {
  118803. seekPoint: target,
  118804. recordTime: this._now()
  118805. };
  118806. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118807. };
  118808. FlvPlayer2.prototype._onvCanPlay = function(e) {
  118809. this._receivedCanPlay = true;
  118810. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118811. };
  118812. FlvPlayer2.prototype._onvStalled = function(e) {
  118813. this._checkAndResumeStuckPlayback(true);
  118814. };
  118815. FlvPlayer2.prototype._onvProgress = function(e) {
  118816. this._checkAndResumeStuckPlayback();
  118817. };
  118818. return FlvPlayer2;
  118819. }();
  118820. __webpack_exports__2["default"] = FlvPlayer;
  118821. },
  118822. "./src/player/native-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118823. __webpack_require__2.r(__webpack_exports__2);
  118824. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118825. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118826. var _player_events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/player/player-events.js");
  118827. var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/config.js");
  118828. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  118829. var NativePlayer = function() {
  118830. function NativePlayer2(mediaDataSource, config) {
  118831. this.TAG = "NativePlayer";
  118832. this._type = "NativePlayer";
  118833. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118834. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_2__.createDefaultConfig)();
  118835. if (typeof config === "object") {
  118836. Object.assign(this._config, config);
  118837. }
  118838. if (mediaDataSource.type.toLowerCase() === "flv") {
  118839. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");
  118840. }
  118841. if (mediaDataSource.hasOwnProperty("segments")) {
  118842. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer(" + mediaDataSource.type + ") doesn't support multipart playback!");
  118843. }
  118844. this.e = {
  118845. onvLoadedMetadata: this._onvLoadedMetadata.bind(this)
  118846. };
  118847. this._pendingSeekTime = null;
  118848. this._statisticsReporter = null;
  118849. this._mediaDataSource = mediaDataSource;
  118850. this._mediaElement = null;
  118851. }
  118852. NativePlayer2.prototype.destroy = function() {
  118853. if (this._mediaElement) {
  118854. this.unload();
  118855. this.detachMediaElement();
  118856. }
  118857. this.e = null;
  118858. this._mediaDataSource = null;
  118859. this._emitter.removeAllListeners();
  118860. this._emitter = null;
  118861. };
  118862. NativePlayer2.prototype.on = function(event2, listener) {
  118863. var _this = this;
  118864. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO) {
  118865. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118866. Promise.resolve().then(function() {
  118867. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, _this.mediaInfo);
  118868. });
  118869. }
  118870. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO) {
  118871. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118872. Promise.resolve().then(function() {
  118873. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, _this.statisticsInfo);
  118874. });
  118875. }
  118876. }
  118877. this._emitter.addListener(event2, listener);
  118878. };
  118879. NativePlayer2.prototype.off = function(event2, listener) {
  118880. this._emitter.removeListener(event2, listener);
  118881. };
  118882. NativePlayer2.prototype.attachMediaElement = function(mediaElement) {
  118883. this._mediaElement = mediaElement;
  118884. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118885. if (this._pendingSeekTime != null) {
  118886. try {
  118887. mediaElement.currentTime = this._pendingSeekTime;
  118888. this._pendingSeekTime = null;
  118889. } catch (e) {
  118890. }
  118891. }
  118892. };
  118893. NativePlayer2.prototype.detachMediaElement = function() {
  118894. if (this._mediaElement) {
  118895. this._mediaElement.src = "";
  118896. this._mediaElement.removeAttribute("src");
  118897. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118898. this._mediaElement = null;
  118899. }
  118900. if (this._statisticsReporter != null) {
  118901. window.clearInterval(this._statisticsReporter);
  118902. this._statisticsReporter = null;
  118903. }
  118904. };
  118905. NativePlayer2.prototype.load = function() {
  118906. if (!this._mediaElement) {
  118907. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118908. }
  118909. this._mediaElement.src = this._mediaDataSource.url;
  118910. if (this._mediaElement.readyState > 0) {
  118911. this._mediaElement.currentTime = 0;
  118912. }
  118913. this._mediaElement.preload = "auto";
  118914. this._mediaElement.load();
  118915. this._statisticsReporter = window.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  118916. };
  118917. NativePlayer2.prototype.unload = function() {
  118918. if (this._mediaElement) {
  118919. this._mediaElement.src = "";
  118920. this._mediaElement.removeAttribute("src");
  118921. }
  118922. if (this._statisticsReporter != null) {
  118923. window.clearInterval(this._statisticsReporter);
  118924. this._statisticsReporter = null;
  118925. }
  118926. };
  118927. NativePlayer2.prototype.play = function() {
  118928. return this._mediaElement.play();
  118929. };
  118930. NativePlayer2.prototype.pause = function() {
  118931. this._mediaElement.pause();
  118932. };
  118933. Object.defineProperty(NativePlayer2.prototype, "type", {
  118934. get: function() {
  118935. return this._type;
  118936. },
  118937. enumerable: false,
  118938. configurable: true
  118939. });
  118940. Object.defineProperty(NativePlayer2.prototype, "buffered", {
  118941. get: function() {
  118942. return this._mediaElement.buffered;
  118943. },
  118944. enumerable: false,
  118945. configurable: true
  118946. });
  118947. Object.defineProperty(NativePlayer2.prototype, "duration", {
  118948. get: function() {
  118949. return this._mediaElement.duration;
  118950. },
  118951. enumerable: false,
  118952. configurable: true
  118953. });
  118954. Object.defineProperty(NativePlayer2.prototype, "volume", {
  118955. get: function() {
  118956. return this._mediaElement.volume;
  118957. },
  118958. set: function(value) {
  118959. this._mediaElement.volume = value;
  118960. },
  118961. enumerable: false,
  118962. configurable: true
  118963. });
  118964. Object.defineProperty(NativePlayer2.prototype, "muted", {
  118965. get: function() {
  118966. return this._mediaElement.muted;
  118967. },
  118968. set: function(muted) {
  118969. this._mediaElement.muted = muted;
  118970. },
  118971. enumerable: false,
  118972. configurable: true
  118973. });
  118974. Object.defineProperty(NativePlayer2.prototype, "currentTime", {
  118975. get: function() {
  118976. if (this._mediaElement) {
  118977. return this._mediaElement.currentTime;
  118978. }
  118979. return 0;
  118980. },
  118981. set: function(seconds) {
  118982. if (this._mediaElement) {
  118983. this._mediaElement.currentTime = seconds;
  118984. } else {
  118985. this._pendingSeekTime = seconds;
  118986. }
  118987. },
  118988. enumerable: false,
  118989. configurable: true
  118990. });
  118991. Object.defineProperty(NativePlayer2.prototype, "mediaInfo", {
  118992. get: function() {
  118993. var mediaPrefix = this._mediaElement instanceof HTMLAudioElement ? "audio/" : "video/";
  118994. var info = {
  118995. mimeType: mediaPrefix + this._mediaDataSource.type
  118996. };
  118997. if (this._mediaElement) {
  118998. info.duration = Math.floor(this._mediaElement.duration * 1e3);
  118999. if (this._mediaElement instanceof HTMLVideoElement) {
  119000. info.width = this._mediaElement.videoWidth;
  119001. info.height = this._mediaElement.videoHeight;
  119002. }
  119003. }
  119004. return info;
  119005. },
  119006. enumerable: false,
  119007. configurable: true
  119008. });
  119009. Object.defineProperty(NativePlayer2.prototype, "statisticsInfo", {
  119010. get: function() {
  119011. var info = {
  119012. playerType: this._type,
  119013. url: this._mediaDataSource.url
  119014. };
  119015. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  119016. return info;
  119017. }
  119018. var hasQualityInfo = true;
  119019. var decoded = 0;
  119020. var dropped = 0;
  119021. if (this._mediaElement.getVideoPlaybackQuality) {
  119022. var quality = this._mediaElement.getVideoPlaybackQuality();
  119023. decoded = quality.totalVideoFrames;
  119024. dropped = quality.droppedVideoFrames;
  119025. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  119026. decoded = this._mediaElement.webkitDecodedFrameCount;
  119027. dropped = this._mediaElement.webkitDroppedFrameCount;
  119028. } else {
  119029. hasQualityInfo = false;
  119030. }
  119031. if (hasQualityInfo) {
  119032. info.decodedFrames = decoded;
  119033. info.droppedFrames = dropped;
  119034. }
  119035. return info;
  119036. },
  119037. enumerable: false,
  119038. configurable: true
  119039. });
  119040. NativePlayer2.prototype._onvLoadedMetadata = function(e) {
  119041. if (this._pendingSeekTime != null) {
  119042. this._mediaElement.currentTime = this._pendingSeekTime;
  119043. this._pendingSeekTime = null;
  119044. }
  119045. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, this.mediaInfo);
  119046. };
  119047. NativePlayer2.prototype._reportStatisticsInfo = function() {
  119048. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, this.statisticsInfo);
  119049. };
  119050. return NativePlayer2;
  119051. }();
  119052. __webpack_exports__2["default"] = NativePlayer;
  119053. },
  119054. "./src/player/player-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119055. __webpack_require__2.r(__webpack_exports__2);
  119056. __webpack_require__2.d(__webpack_exports__2, {
  119057. "ErrorTypes": function() {
  119058. return ErrorTypes;
  119059. },
  119060. "ErrorDetails": function() {
  119061. return ErrorDetails;
  119062. }
  119063. });
  119064. var _io_loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  119065. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/demux-errors.js");
  119066. var ErrorTypes = {
  119067. NETWORK_ERROR: "NetworkError",
  119068. MEDIA_ERROR: "MediaError",
  119069. OTHER_ERROR: "OtherError"
  119070. };
  119071. var ErrorDetails = {
  119072. NETWORK_EXCEPTION: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION,
  119073. NETWORK_STATUS_CODE_INVALID: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.HTTP_STATUS_CODE_INVALID,
  119074. NETWORK_TIMEOUT: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.CONNECTING_TIMEOUT,
  119075. NETWORK_UNRECOVERABLE_EARLY_EOF: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.UNRECOVERABLE_EARLY_EOF,
  119076. MEDIA_MSE_ERROR: "MediaMSEError",
  119077. MEDIA_FORMAT_ERROR: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_ERROR,
  119078. MEDIA_FORMAT_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_UNSUPPORTED,
  119079. MEDIA_CODEC_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.CODEC_UNSUPPORTED
  119080. };
  119081. },
  119082. "./src/player/player-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119083. __webpack_require__2.r(__webpack_exports__2);
  119084. var PlayerEvents = {
  119085. ERROR: "error",
  119086. LOADING_COMPLETE: "loading_complete",
  119087. RECOVERED_EARLY_EOF: "recovered_early_eof",
  119088. MEDIA_INFO: "media_info",
  119089. METADATA_ARRIVED: "metadata_arrived",
  119090. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  119091. STATISTICS_INFO: "statistics_info"
  119092. };
  119093. __webpack_exports__2["default"] = PlayerEvents;
  119094. },
  119095. "./src/remux/aac-silent.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119096. __webpack_require__2.r(__webpack_exports__2);
  119097. var AAC = function() {
  119098. function AAC2() {
  119099. }
  119100. AAC2.getSilentFrame = function(codec, channelCount) {
  119101. if (codec === "mp4a.40.2") {
  119102. if (channelCount === 1) {
  119103. return new Uint8Array([0, 200, 0, 128, 35, 128]);
  119104. } else if (channelCount === 2) {
  119105. return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
  119106. } else if (channelCount === 3) {
  119107. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
  119108. } else if (channelCount === 4) {
  119109. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
  119110. } else if (channelCount === 5) {
  119111. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
  119112. } else if (channelCount === 6) {
  119113. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 0, 178, 0, 32, 8, 224]);
  119114. }
  119115. } else {
  119116. if (channelCount === 1) {
  119117. return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119118. } else if (channelCount === 2) {
  119119. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119120. } else if (channelCount === 3) {
  119121. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119122. }
  119123. }
  119124. return null;
  119125. };
  119126. return AAC2;
  119127. }();
  119128. __webpack_exports__2["default"] = AAC;
  119129. },
  119130. "./src/remux/mp4-generator.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119131. __webpack_require__2.r(__webpack_exports__2);
  119132. var MP4 = function() {
  119133. function MP42() {
  119134. }
  119135. MP42.init = function() {
  119136. MP42.types = {
  119137. avc1: [],
  119138. avcC: [],
  119139. btrt: [],
  119140. dinf: [],
  119141. dref: [],
  119142. esds: [],
  119143. ftyp: [],
  119144. hdlr: [],
  119145. mdat: [],
  119146. mdhd: [],
  119147. mdia: [],
  119148. mfhd: [],
  119149. minf: [],
  119150. moof: [],
  119151. moov: [],
  119152. mp4a: [],
  119153. mvex: [],
  119154. mvhd: [],
  119155. sdtp: [],
  119156. stbl: [],
  119157. stco: [],
  119158. stsc: [],
  119159. stsd: [],
  119160. stsz: [],
  119161. stts: [],
  119162. tfdt: [],
  119163. tfhd: [],
  119164. traf: [],
  119165. trak: [],
  119166. trun: [],
  119167. trex: [],
  119168. tkhd: [],
  119169. vmhd: [],
  119170. smhd: [],
  119171. ".mp3": []
  119172. };
  119173. for (var name_1 in MP42.types) {
  119174. if (MP42.types.hasOwnProperty(name_1)) {
  119175. MP42.types[name_1] = [
  119176. name_1.charCodeAt(0),
  119177. name_1.charCodeAt(1),
  119178. name_1.charCodeAt(2),
  119179. name_1.charCodeAt(3)
  119180. ];
  119181. }
  119182. }
  119183. var constants = MP42.constants = {};
  119184. constants.FTYP = new Uint8Array([
  119185. 105,
  119186. 115,
  119187. 111,
  119188. 109,
  119189. 0,
  119190. 0,
  119191. 0,
  119192. 1,
  119193. 105,
  119194. 115,
  119195. 111,
  119196. 109,
  119197. 97,
  119198. 118,
  119199. 99,
  119200. 49
  119201. ]);
  119202. constants.STSD_PREFIX = new Uint8Array([
  119203. 0,
  119204. 0,
  119205. 0,
  119206. 0,
  119207. 0,
  119208. 0,
  119209. 0,
  119210. 1
  119211. ]);
  119212. constants.STTS = new Uint8Array([
  119213. 0,
  119214. 0,
  119215. 0,
  119216. 0,
  119217. 0,
  119218. 0,
  119219. 0,
  119220. 0
  119221. ]);
  119222. constants.STSC = constants.STCO = constants.STTS;
  119223. constants.STSZ = new Uint8Array([
  119224. 0,
  119225. 0,
  119226. 0,
  119227. 0,
  119228. 0,
  119229. 0,
  119230. 0,
  119231. 0,
  119232. 0,
  119233. 0,
  119234. 0,
  119235. 0
  119236. ]);
  119237. constants.HDLR_VIDEO = new Uint8Array([
  119238. 0,
  119239. 0,
  119240. 0,
  119241. 0,
  119242. 0,
  119243. 0,
  119244. 0,
  119245. 0,
  119246. 118,
  119247. 105,
  119248. 100,
  119249. 101,
  119250. 0,
  119251. 0,
  119252. 0,
  119253. 0,
  119254. 0,
  119255. 0,
  119256. 0,
  119257. 0,
  119258. 0,
  119259. 0,
  119260. 0,
  119261. 0,
  119262. 86,
  119263. 105,
  119264. 100,
  119265. 101,
  119266. 111,
  119267. 72,
  119268. 97,
  119269. 110,
  119270. 100,
  119271. 108,
  119272. 101,
  119273. 114,
  119274. 0
  119275. ]);
  119276. constants.HDLR_AUDIO = new Uint8Array([
  119277. 0,
  119278. 0,
  119279. 0,
  119280. 0,
  119281. 0,
  119282. 0,
  119283. 0,
  119284. 0,
  119285. 115,
  119286. 111,
  119287. 117,
  119288. 110,
  119289. 0,
  119290. 0,
  119291. 0,
  119292. 0,
  119293. 0,
  119294. 0,
  119295. 0,
  119296. 0,
  119297. 0,
  119298. 0,
  119299. 0,
  119300. 0,
  119301. 83,
  119302. 111,
  119303. 117,
  119304. 110,
  119305. 100,
  119306. 72,
  119307. 97,
  119308. 110,
  119309. 100,
  119310. 108,
  119311. 101,
  119312. 114,
  119313. 0
  119314. ]);
  119315. constants.DREF = new Uint8Array([
  119316. 0,
  119317. 0,
  119318. 0,
  119319. 0,
  119320. 0,
  119321. 0,
  119322. 0,
  119323. 1,
  119324. 0,
  119325. 0,
  119326. 0,
  119327. 12,
  119328. 117,
  119329. 114,
  119330. 108,
  119331. 32,
  119332. 0,
  119333. 0,
  119334. 0,
  119335. 1
  119336. ]);
  119337. constants.SMHD = new Uint8Array([
  119338. 0,
  119339. 0,
  119340. 0,
  119341. 0,
  119342. 0,
  119343. 0,
  119344. 0,
  119345. 0
  119346. ]);
  119347. constants.VMHD = new Uint8Array([
  119348. 0,
  119349. 0,
  119350. 0,
  119351. 1,
  119352. 0,
  119353. 0,
  119354. 0,
  119355. 0,
  119356. 0,
  119357. 0,
  119358. 0,
  119359. 0
  119360. ]);
  119361. };
  119362. MP42.box = function(type2) {
  119363. var size = 8;
  119364. var result = null;
  119365. var datas = Array.prototype.slice.call(arguments, 1);
  119366. var arrayCount = datas.length;
  119367. for (var i2 = 0; i2 < arrayCount; i2++) {
  119368. size += datas[i2].byteLength;
  119369. }
  119370. result = new Uint8Array(size);
  119371. result[0] = size >>> 24 & 255;
  119372. result[1] = size >>> 16 & 255;
  119373. result[2] = size >>> 8 & 255;
  119374. result[3] = size & 255;
  119375. result.set(type2, 4);
  119376. var offset = 8;
  119377. for (var i2 = 0; i2 < arrayCount; i2++) {
  119378. result.set(datas[i2], offset);
  119379. offset += datas[i2].byteLength;
  119380. }
  119381. return result;
  119382. };
  119383. MP42.generateInitSegment = function(meta2) {
  119384. var ftyp = MP42.box(MP42.types.ftyp, MP42.constants.FTYP);
  119385. var moov = MP42.moov(meta2);
  119386. var result = new Uint8Array(ftyp.byteLength + moov.byteLength);
  119387. result.set(ftyp, 0);
  119388. result.set(moov, ftyp.byteLength);
  119389. return result;
  119390. };
  119391. MP42.moov = function(meta2) {
  119392. var mvhd = MP42.mvhd(meta2.timescale, meta2.duration);
  119393. var trak = MP42.trak(meta2);
  119394. var mvex = MP42.mvex(meta2);
  119395. return MP42.box(MP42.types.moov, mvhd, trak, mvex);
  119396. };
  119397. MP42.mvhd = function(timescale2, duration5) {
  119398. return MP42.box(MP42.types.mvhd, new Uint8Array([
  119399. 0,
  119400. 0,
  119401. 0,
  119402. 0,
  119403. 0,
  119404. 0,
  119405. 0,
  119406. 0,
  119407. 0,
  119408. 0,
  119409. 0,
  119410. 0,
  119411. timescale2 >>> 24 & 255,
  119412. timescale2 >>> 16 & 255,
  119413. timescale2 >>> 8 & 255,
  119414. timescale2 & 255,
  119415. duration5 >>> 24 & 255,
  119416. duration5 >>> 16 & 255,
  119417. duration5 >>> 8 & 255,
  119418. duration5 & 255,
  119419. 0,
  119420. 1,
  119421. 0,
  119422. 0,
  119423. 1,
  119424. 0,
  119425. 0,
  119426. 0,
  119427. 0,
  119428. 0,
  119429. 0,
  119430. 0,
  119431. 0,
  119432. 0,
  119433. 0,
  119434. 0,
  119435. 0,
  119436. 1,
  119437. 0,
  119438. 0,
  119439. 0,
  119440. 0,
  119441. 0,
  119442. 0,
  119443. 0,
  119444. 0,
  119445. 0,
  119446. 0,
  119447. 0,
  119448. 0,
  119449. 0,
  119450. 0,
  119451. 0,
  119452. 1,
  119453. 0,
  119454. 0,
  119455. 0,
  119456. 0,
  119457. 0,
  119458. 0,
  119459. 0,
  119460. 0,
  119461. 0,
  119462. 0,
  119463. 0,
  119464. 0,
  119465. 0,
  119466. 0,
  119467. 64,
  119468. 0,
  119469. 0,
  119470. 0,
  119471. 0,
  119472. 0,
  119473. 0,
  119474. 0,
  119475. 0,
  119476. 0,
  119477. 0,
  119478. 0,
  119479. 0,
  119480. 0,
  119481. 0,
  119482. 0,
  119483. 0,
  119484. 0,
  119485. 0,
  119486. 0,
  119487. 0,
  119488. 0,
  119489. 0,
  119490. 0,
  119491. 0,
  119492. 0,
  119493. 0,
  119494. 0,
  119495. 255,
  119496. 255,
  119497. 255,
  119498. 255
  119499. ]));
  119500. };
  119501. MP42.trak = function(meta2) {
  119502. return MP42.box(MP42.types.trak, MP42.tkhd(meta2), MP42.mdia(meta2));
  119503. };
  119504. MP42.tkhd = function(meta2) {
  119505. var trackId = meta2.id, duration5 = meta2.duration;
  119506. var width2 = meta2.presentWidth, height2 = meta2.presentHeight;
  119507. return MP42.box(MP42.types.tkhd, new Uint8Array([
  119508. 0,
  119509. 0,
  119510. 0,
  119511. 7,
  119512. 0,
  119513. 0,
  119514. 0,
  119515. 0,
  119516. 0,
  119517. 0,
  119518. 0,
  119519. 0,
  119520. trackId >>> 24 & 255,
  119521. trackId >>> 16 & 255,
  119522. trackId >>> 8 & 255,
  119523. trackId & 255,
  119524. 0,
  119525. 0,
  119526. 0,
  119527. 0,
  119528. duration5 >>> 24 & 255,
  119529. duration5 >>> 16 & 255,
  119530. duration5 >>> 8 & 255,
  119531. duration5 & 255,
  119532. 0,
  119533. 0,
  119534. 0,
  119535. 0,
  119536. 0,
  119537. 0,
  119538. 0,
  119539. 0,
  119540. 0,
  119541. 0,
  119542. 0,
  119543. 0,
  119544. 0,
  119545. 0,
  119546. 0,
  119547. 0,
  119548. 0,
  119549. 1,
  119550. 0,
  119551. 0,
  119552. 0,
  119553. 0,
  119554. 0,
  119555. 0,
  119556. 0,
  119557. 0,
  119558. 0,
  119559. 0,
  119560. 0,
  119561. 0,
  119562. 0,
  119563. 0,
  119564. 0,
  119565. 1,
  119566. 0,
  119567. 0,
  119568. 0,
  119569. 0,
  119570. 0,
  119571. 0,
  119572. 0,
  119573. 0,
  119574. 0,
  119575. 0,
  119576. 0,
  119577. 0,
  119578. 0,
  119579. 0,
  119580. 64,
  119581. 0,
  119582. 0,
  119583. 0,
  119584. width2 >>> 8 & 255,
  119585. width2 & 255,
  119586. 0,
  119587. 0,
  119588. height2 >>> 8 & 255,
  119589. height2 & 255,
  119590. 0,
  119591. 0
  119592. ]));
  119593. };
  119594. MP42.mdia = function(meta2) {
  119595. return MP42.box(MP42.types.mdia, MP42.mdhd(meta2), MP42.hdlr(meta2), MP42.minf(meta2));
  119596. };
  119597. MP42.mdhd = function(meta2) {
  119598. var timescale2 = meta2.timescale;
  119599. var duration5 = meta2.duration;
  119600. return MP42.box(MP42.types.mdhd, new Uint8Array([
  119601. 0,
  119602. 0,
  119603. 0,
  119604. 0,
  119605. 0,
  119606. 0,
  119607. 0,
  119608. 0,
  119609. 0,
  119610. 0,
  119611. 0,
  119612. 0,
  119613. timescale2 >>> 24 & 255,
  119614. timescale2 >>> 16 & 255,
  119615. timescale2 >>> 8 & 255,
  119616. timescale2 & 255,
  119617. duration5 >>> 24 & 255,
  119618. duration5 >>> 16 & 255,
  119619. duration5 >>> 8 & 255,
  119620. duration5 & 255,
  119621. 85,
  119622. 196,
  119623. 0,
  119624. 0
  119625. ]));
  119626. };
  119627. MP42.hdlr = function(meta2) {
  119628. var data = null;
  119629. if (meta2.type === "audio") {
  119630. data = MP42.constants.HDLR_AUDIO;
  119631. } else {
  119632. data = MP42.constants.HDLR_VIDEO;
  119633. }
  119634. return MP42.box(MP42.types.hdlr, data);
  119635. };
  119636. MP42.minf = function(meta2) {
  119637. var xmhd = null;
  119638. if (meta2.type === "audio") {
  119639. xmhd = MP42.box(MP42.types.smhd, MP42.constants.SMHD);
  119640. } else {
  119641. xmhd = MP42.box(MP42.types.vmhd, MP42.constants.VMHD);
  119642. }
  119643. return MP42.box(MP42.types.minf, xmhd, MP42.dinf(), MP42.stbl(meta2));
  119644. };
  119645. MP42.dinf = function() {
  119646. var result = MP42.box(MP42.types.dinf, MP42.box(MP42.types.dref, MP42.constants.DREF));
  119647. return result;
  119648. };
  119649. MP42.stbl = function(meta2) {
  119650. var result = MP42.box(
  119651. MP42.types.stbl,
  119652. MP42.stsd(meta2),
  119653. MP42.box(MP42.types.stts, MP42.constants.STTS),
  119654. MP42.box(MP42.types.stsc, MP42.constants.STSC),
  119655. MP42.box(MP42.types.stsz, MP42.constants.STSZ),
  119656. MP42.box(MP42.types.stco, MP42.constants.STCO)
  119657. );
  119658. return result;
  119659. };
  119660. MP42.stsd = function(meta2) {
  119661. if (meta2.type === "audio") {
  119662. if (meta2.codec === "mp3") {
  119663. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp3(meta2));
  119664. }
  119665. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp4a(meta2));
  119666. } else {
  119667. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.avc1(meta2));
  119668. }
  119669. };
  119670. MP42.mp3 = function(meta2) {
  119671. var channelCount = meta2.channelCount;
  119672. var sampleRate = meta2.audioSampleRate;
  119673. var data = new Uint8Array([
  119674. 0,
  119675. 0,
  119676. 0,
  119677. 0,
  119678. 0,
  119679. 0,
  119680. 0,
  119681. 1,
  119682. 0,
  119683. 0,
  119684. 0,
  119685. 0,
  119686. 0,
  119687. 0,
  119688. 0,
  119689. 0,
  119690. 0,
  119691. channelCount,
  119692. 0,
  119693. 16,
  119694. 0,
  119695. 0,
  119696. 0,
  119697. 0,
  119698. sampleRate >>> 8 & 255,
  119699. sampleRate & 255,
  119700. 0,
  119701. 0
  119702. ]);
  119703. return MP42.box(MP42.types[".mp3"], data);
  119704. };
  119705. MP42.mp4a = function(meta2) {
  119706. var channelCount = meta2.channelCount;
  119707. var sampleRate = meta2.audioSampleRate;
  119708. var data = new Uint8Array([
  119709. 0,
  119710. 0,
  119711. 0,
  119712. 0,
  119713. 0,
  119714. 0,
  119715. 0,
  119716. 1,
  119717. 0,
  119718. 0,
  119719. 0,
  119720. 0,
  119721. 0,
  119722. 0,
  119723. 0,
  119724. 0,
  119725. 0,
  119726. channelCount,
  119727. 0,
  119728. 16,
  119729. 0,
  119730. 0,
  119731. 0,
  119732. 0,
  119733. sampleRate >>> 8 & 255,
  119734. sampleRate & 255,
  119735. 0,
  119736. 0
  119737. ]);
  119738. return MP42.box(MP42.types.mp4a, data, MP42.esds(meta2));
  119739. };
  119740. MP42.esds = function(meta2) {
  119741. var config = meta2.config || [];
  119742. var configSize = config.length;
  119743. var data = new Uint8Array([
  119744. 0,
  119745. 0,
  119746. 0,
  119747. 0,
  119748. 3,
  119749. 23 + configSize,
  119750. 0,
  119751. 1,
  119752. 0,
  119753. 4,
  119754. 15 + configSize,
  119755. 64,
  119756. 21,
  119757. 0,
  119758. 0,
  119759. 0,
  119760. 0,
  119761. 0,
  119762. 0,
  119763. 0,
  119764. 0,
  119765. 0,
  119766. 0,
  119767. 0,
  119768. 5
  119769. ].concat([
  119770. configSize
  119771. ]).concat(config).concat([
  119772. 6,
  119773. 1,
  119774. 2
  119775. ]));
  119776. return MP42.box(MP42.types.esds, data);
  119777. };
  119778. MP42.avc1 = function(meta2) {
  119779. var avcc = meta2.avcc;
  119780. var width2 = meta2.codecWidth, height2 = meta2.codecHeight;
  119781. var data = new Uint8Array([
  119782. 0,
  119783. 0,
  119784. 0,
  119785. 0,
  119786. 0,
  119787. 0,
  119788. 0,
  119789. 1,
  119790. 0,
  119791. 0,
  119792. 0,
  119793. 0,
  119794. 0,
  119795. 0,
  119796. 0,
  119797. 0,
  119798. 0,
  119799. 0,
  119800. 0,
  119801. 0,
  119802. 0,
  119803. 0,
  119804. 0,
  119805. 0,
  119806. width2 >>> 8 & 255,
  119807. width2 & 255,
  119808. height2 >>> 8 & 255,
  119809. height2 & 255,
  119810. 0,
  119811. 72,
  119812. 0,
  119813. 0,
  119814. 0,
  119815. 72,
  119816. 0,
  119817. 0,
  119818. 0,
  119819. 0,
  119820. 0,
  119821. 0,
  119822. 0,
  119823. 1,
  119824. 10,
  119825. 120,
  119826. 113,
  119827. 113,
  119828. 47,
  119829. 102,
  119830. 108,
  119831. 118,
  119832. 46,
  119833. 106,
  119834. 115,
  119835. 0,
  119836. 0,
  119837. 0,
  119838. 0,
  119839. 0,
  119840. 0,
  119841. 0,
  119842. 0,
  119843. 0,
  119844. 0,
  119845. 0,
  119846. 0,
  119847. 0,
  119848. 0,
  119849. 0,
  119850. 0,
  119851. 0,
  119852. 0,
  119853. 0,
  119854. 0,
  119855. 0,
  119856. 0,
  119857. 24,
  119858. 255,
  119859. 255
  119860. ]);
  119861. return MP42.box(MP42.types.avc1, data, MP42.box(MP42.types.avcC, avcc));
  119862. };
  119863. MP42.mvex = function(meta2) {
  119864. return MP42.box(MP42.types.mvex, MP42.trex(meta2));
  119865. };
  119866. MP42.trex = function(meta2) {
  119867. var trackId = meta2.id;
  119868. var data = new Uint8Array([
  119869. 0,
  119870. 0,
  119871. 0,
  119872. 0,
  119873. trackId >>> 24 & 255,
  119874. trackId >>> 16 & 255,
  119875. trackId >>> 8 & 255,
  119876. trackId & 255,
  119877. 0,
  119878. 0,
  119879. 0,
  119880. 1,
  119881. 0,
  119882. 0,
  119883. 0,
  119884. 0,
  119885. 0,
  119886. 0,
  119887. 0,
  119888. 0,
  119889. 0,
  119890. 1,
  119891. 0,
  119892. 1
  119893. ]);
  119894. return MP42.box(MP42.types.trex, data);
  119895. };
  119896. MP42.moof = function(track, baseMediaDecodeTime) {
  119897. return MP42.box(MP42.types.moof, MP42.mfhd(track.sequenceNumber), MP42.traf(track, baseMediaDecodeTime));
  119898. };
  119899. MP42.mfhd = function(sequenceNumber) {
  119900. var data = new Uint8Array([
  119901. 0,
  119902. 0,
  119903. 0,
  119904. 0,
  119905. sequenceNumber >>> 24 & 255,
  119906. sequenceNumber >>> 16 & 255,
  119907. sequenceNumber >>> 8 & 255,
  119908. sequenceNumber & 255
  119909. ]);
  119910. return MP42.box(MP42.types.mfhd, data);
  119911. };
  119912. MP42.traf = function(track, baseMediaDecodeTime) {
  119913. var trackId = track.id;
  119914. var tfhd = MP42.box(MP42.types.tfhd, new Uint8Array([
  119915. 0,
  119916. 0,
  119917. 0,
  119918. 0,
  119919. trackId >>> 24 & 255,
  119920. trackId >>> 16 & 255,
  119921. trackId >>> 8 & 255,
  119922. trackId & 255
  119923. ]));
  119924. var tfdt = MP42.box(MP42.types.tfdt, new Uint8Array([
  119925. 0,
  119926. 0,
  119927. 0,
  119928. 0,
  119929. baseMediaDecodeTime >>> 24 & 255,
  119930. baseMediaDecodeTime >>> 16 & 255,
  119931. baseMediaDecodeTime >>> 8 & 255,
  119932. baseMediaDecodeTime & 255
  119933. ]));
  119934. var sdtp = MP42.sdtp(track);
  119935. var trun = MP42.trun(track, sdtp.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
  119936. return MP42.box(MP42.types.traf, tfhd, tfdt, trun, sdtp);
  119937. };
  119938. MP42.sdtp = function(track) {
  119939. var samples = track.samples || [];
  119940. var sampleCount = samples.length;
  119941. var data = new Uint8Array(4 + sampleCount);
  119942. for (var i2 = 0; i2 < sampleCount; i2++) {
  119943. var flags = samples[i2].flags;
  119944. data[i2 + 4] = flags.isLeading << 6 | flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  119945. }
  119946. return MP42.box(MP42.types.sdtp, data);
  119947. };
  119948. MP42.trun = function(track, offset) {
  119949. var samples = track.samples || [];
  119950. var sampleCount = samples.length;
  119951. var dataSize = 12 + 16 * sampleCount;
  119952. var data = new Uint8Array(dataSize);
  119953. offset += 8 + dataSize;
  119954. data.set([
  119955. 0,
  119956. 0,
  119957. 15,
  119958. 1,
  119959. sampleCount >>> 24 & 255,
  119960. sampleCount >>> 16 & 255,
  119961. sampleCount >>> 8 & 255,
  119962. sampleCount & 255,
  119963. offset >>> 24 & 255,
  119964. offset >>> 16 & 255,
  119965. offset >>> 8 & 255,
  119966. offset & 255
  119967. ], 0);
  119968. for (var i2 = 0; i2 < sampleCount; i2++) {
  119969. var duration5 = samples[i2].duration;
  119970. var size = samples[i2].size;
  119971. var flags = samples[i2].flags;
  119972. var cts = samples[i2].cts;
  119973. data.set([
  119974. duration5 >>> 24 & 255,
  119975. duration5 >>> 16 & 255,
  119976. duration5 >>> 8 & 255,
  119977. duration5 & 255,
  119978. size >>> 24 & 255,
  119979. size >>> 16 & 255,
  119980. size >>> 8 & 255,
  119981. size & 255,
  119982. flags.isLeading << 2 | flags.dependsOn,
  119983. flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.isNonSync,
  119984. 0,
  119985. 0,
  119986. cts >>> 24 & 255,
  119987. cts >>> 16 & 255,
  119988. cts >>> 8 & 255,
  119989. cts & 255
  119990. ], 12 + 16 * i2);
  119991. }
  119992. return MP42.box(MP42.types.trun, data);
  119993. };
  119994. MP42.mdat = function(data) {
  119995. return MP42.box(MP42.types.mdat, data);
  119996. };
  119997. return MP42;
  119998. }();
  119999. MP4.init();
  120000. __webpack_exports__2["default"] = MP4;
  120001. },
  120002. "./src/remux/mp4-remuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120003. __webpack_require__2.r(__webpack_exports__2);
  120004. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  120005. var _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/remux/mp4-generator.js");
  120006. var _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/remux/aac-silent.js");
  120007. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/browser.js");
  120008. var _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  120009. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  120010. var MP4Remuxer = function() {
  120011. function MP4Remuxer2(config) {
  120012. this.TAG = "MP4Remuxer";
  120013. this._config = config;
  120014. this._isLive = config.isLive === true ? true : false;
  120015. this._dtsBase = -1;
  120016. this._dtsBaseInited = false;
  120017. this._audioDtsBase = Infinity;
  120018. this._videoDtsBase = Infinity;
  120019. this._audioNextDts = void 0;
  120020. this._videoNextDts = void 0;
  120021. this._audioStashedLastSample = null;
  120022. this._videoStashedLastSample = null;
  120023. this._audioMeta = null;
  120024. this._videoMeta = null;
  120025. this._audioSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("audio");
  120026. this._videoSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("video");
  120027. this._onInitSegment = null;
  120028. this._onMediaSegment = null;
  120029. this._forceFirstIDR = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.build < 2661) ? true : false;
  120030. this._fillSilentAfterSeek = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msie;
  120031. this._mp3UseMpegAudio = !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.firefox;
  120032. this._fillAudioTimestampGap = this._config.fixAudioTimestampGap;
  120033. }
  120034. MP4Remuxer2.prototype.destroy = function() {
  120035. this._dtsBase = -1;
  120036. this._dtsBaseInited = false;
  120037. this._audioMeta = null;
  120038. this._videoMeta = null;
  120039. this._audioSegmentInfoList.clear();
  120040. this._audioSegmentInfoList = null;
  120041. this._videoSegmentInfoList.clear();
  120042. this._videoSegmentInfoList = null;
  120043. this._onInitSegment = null;
  120044. this._onMediaSegment = null;
  120045. };
  120046. MP4Remuxer2.prototype.bindDataSource = function(producer) {
  120047. producer.onDataAvailable = this.remux.bind(this);
  120048. producer.onTrackMetadata = this._onTrackMetadataReceived.bind(this);
  120049. return this;
  120050. };
  120051. Object.defineProperty(MP4Remuxer2.prototype, "onInitSegment", {
  120052. get: function() {
  120053. return this._onInitSegment;
  120054. },
  120055. set: function(callback2) {
  120056. this._onInitSegment = callback2;
  120057. },
  120058. enumerable: false,
  120059. configurable: true
  120060. });
  120061. Object.defineProperty(MP4Remuxer2.prototype, "onMediaSegment", {
  120062. get: function() {
  120063. return this._onMediaSegment;
  120064. },
  120065. set: function(callback2) {
  120066. this._onMediaSegment = callback2;
  120067. },
  120068. enumerable: false,
  120069. configurable: true
  120070. });
  120071. MP4Remuxer2.prototype.insertDiscontinuity = function() {
  120072. this._audioNextDts = this._videoNextDts = void 0;
  120073. };
  120074. MP4Remuxer2.prototype.seek = function(originalDts) {
  120075. this._audioStashedLastSample = null;
  120076. this._videoStashedLastSample = null;
  120077. this._videoSegmentInfoList.clear();
  120078. this._audioSegmentInfoList.clear();
  120079. };
  120080. MP4Remuxer2.prototype.remux = function(audioTrack, videoTrack) {
  120081. if (!this._onMediaSegment) {
  120082. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");
  120083. }
  120084. if (!this._dtsBaseInited) {
  120085. this._calculateDtsBase(audioTrack, videoTrack);
  120086. }
  120087. this._remuxVideo(videoTrack);
  120088. this._remuxAudio(audioTrack);
  120089. };
  120090. MP4Remuxer2.prototype._onTrackMetadataReceived = function(type2, metadata) {
  120091. var metabox = null;
  120092. var container = "mp4";
  120093. var codec = metadata.codec;
  120094. if (type2 === "audio") {
  120095. this._audioMeta = metadata;
  120096. if (metadata.codec === "mp3" && this._mp3UseMpegAudio) {
  120097. container = "mpeg";
  120098. codec = "";
  120099. metabox = new Uint8Array();
  120100. } else {
  120101. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120102. }
  120103. } else if (type2 === "video") {
  120104. this._videoMeta = metadata;
  120105. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120106. } else {
  120107. return;
  120108. }
  120109. if (!this._onInitSegment) {
  120110. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");
  120111. }
  120112. this._onInitSegment(type2, {
  120113. type: type2,
  120114. data: metabox.buffer,
  120115. codec,
  120116. container: type2 + "/" + container,
  120117. mediaDuration: metadata.duration
  120118. });
  120119. };
  120120. MP4Remuxer2.prototype._calculateDtsBase = function(audioTrack, videoTrack) {
  120121. if (this._dtsBaseInited) {
  120122. return;
  120123. }
  120124. if (audioTrack.samples && audioTrack.samples.length) {
  120125. this._audioDtsBase = audioTrack.samples[0].dts;
  120126. }
  120127. if (videoTrack.samples && videoTrack.samples.length) {
  120128. this._videoDtsBase = videoTrack.samples[0].dts;
  120129. }
  120130. this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase);
  120131. this._dtsBaseInited = true;
  120132. };
  120133. MP4Remuxer2.prototype.flushStashedSamples = function() {
  120134. var videoSample = this._videoStashedLastSample;
  120135. var audioSample = this._audioStashedLastSample;
  120136. var videoTrack = {
  120137. type: "video",
  120138. id: 1,
  120139. sequenceNumber: 0,
  120140. samples: [],
  120141. length: 0
  120142. };
  120143. if (videoSample != null) {
  120144. videoTrack.samples.push(videoSample);
  120145. videoTrack.length = videoSample.length;
  120146. }
  120147. var audioTrack = {
  120148. type: "audio",
  120149. id: 2,
  120150. sequenceNumber: 0,
  120151. samples: [],
  120152. length: 0
  120153. };
  120154. if (audioSample != null) {
  120155. audioTrack.samples.push(audioSample);
  120156. audioTrack.length = audioSample.length;
  120157. }
  120158. this._videoStashedLastSample = null;
  120159. this._audioStashedLastSample = null;
  120160. this._remuxVideo(videoTrack, true);
  120161. this._remuxAudio(audioTrack, true);
  120162. };
  120163. MP4Remuxer2.prototype._remuxAudio = function(audioTrack, force) {
  120164. if (this._audioMeta == null) {
  120165. return;
  120166. }
  120167. var track = audioTrack;
  120168. var samples = track.samples;
  120169. var dtsCorrection = void 0;
  120170. var firstDts = -1, lastDts = -1;
  120171. var refSampleDuration = this._audioMeta.refSampleDuration;
  120172. var mpegRawTrack = this._audioMeta.codec === "mp3" && this._mp3UseMpegAudio;
  120173. var firstSegmentAfterSeek = this._dtsBaseInited && this._audioNextDts === void 0;
  120174. var insertPrefixSilentFrame = false;
  120175. if (!samples || samples.length === 0) {
  120176. return;
  120177. }
  120178. if (samples.length === 1 && !force) {
  120179. return;
  120180. }
  120181. var offset = 0;
  120182. var mdatbox = null;
  120183. var mdatBytes = 0;
  120184. if (mpegRawTrack) {
  120185. offset = 0;
  120186. mdatBytes = track.length;
  120187. } else {
  120188. offset = 8;
  120189. mdatBytes = 8 + track.length;
  120190. }
  120191. var lastSample = null;
  120192. if (samples.length > 1) {
  120193. lastSample = samples.pop();
  120194. mdatBytes -= lastSample.length;
  120195. }
  120196. if (this._audioStashedLastSample != null) {
  120197. var sample = this._audioStashedLastSample;
  120198. this._audioStashedLastSample = null;
  120199. samples.unshift(sample);
  120200. mdatBytes += sample.length;
  120201. }
  120202. if (lastSample != null) {
  120203. this._audioStashedLastSample = lastSample;
  120204. }
  120205. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120206. if (this._audioNextDts) {
  120207. dtsCorrection = firstSampleOriginalDts - this._audioNextDts;
  120208. } else {
  120209. if (this._audioSegmentInfoList.isEmpty()) {
  120210. dtsCorrection = 0;
  120211. if (this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty()) {
  120212. if (this._audioMeta.originalCodec !== "mp3") {
  120213. insertPrefixSilentFrame = true;
  120214. }
  120215. }
  120216. } else {
  120217. var lastSample_1 = this._audioSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120218. if (lastSample_1 != null) {
  120219. var distance2 = firstSampleOriginalDts - (lastSample_1.originalDts + lastSample_1.duration);
  120220. if (distance2 <= 3) {
  120221. distance2 = 0;
  120222. }
  120223. var expectedDts = lastSample_1.dts + lastSample_1.duration + distance2;
  120224. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120225. } else {
  120226. dtsCorrection = 0;
  120227. }
  120228. }
  120229. }
  120230. if (insertPrefixSilentFrame) {
  120231. var firstSampleDts = firstSampleOriginalDts - dtsCorrection;
  120232. var videoSegment = this._videoSegmentInfoList.getLastSegmentBefore(firstSampleOriginalDts);
  120233. if (videoSegment != null && videoSegment.beginDts < firstSampleDts) {
  120234. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120235. if (silentUnit) {
  120236. var dts = videoSegment.beginDts;
  120237. var silentFrameDuration = firstSampleDts - videoSegment.beginDts;
  120238. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "InsertPrefixSilentAudio: dts: " + dts + ", duration: " + silentFrameDuration);
  120239. samples.unshift({ unit: silentUnit, dts, pts: dts });
  120240. mdatBytes += silentUnit.byteLength;
  120241. }
  120242. } else {
  120243. insertPrefixSilentFrame = false;
  120244. }
  120245. }
  120246. var mp4Samples = [];
  120247. for (var i2 = 0; i2 < samples.length; i2++) {
  120248. var sample = samples[i2];
  120249. var unit = sample.unit;
  120250. var originalDts = sample.dts - this._dtsBase;
  120251. var dts = originalDts;
  120252. var needFillSilentFrames = false;
  120253. var silentFrames = null;
  120254. var sampleDuration = 0;
  120255. if (originalDts < -1e-3) {
  120256. continue;
  120257. }
  120258. if (this._audioMeta.codec !== "mp3") {
  120259. var curRefDts = originalDts;
  120260. var maxAudioFramesDrift = 3;
  120261. if (this._audioNextDts) {
  120262. curRefDts = this._audioNextDts;
  120263. }
  120264. dtsCorrection = originalDts - curRefDts;
  120265. if (dtsCorrection <= -maxAudioFramesDrift * refSampleDuration) {
  120266. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Dropping 1 audio frame (originalDts: " + originalDts + " ms ,curRefDts: " + curRefDts + " ms) due to dtsCorrection: " + dtsCorrection + " ms overlap.");
  120267. continue;
  120268. } else if (dtsCorrection >= maxAudioFramesDrift * refSampleDuration && this._fillAudioTimestampGap && !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.safari) {
  120269. needFillSilentFrames = true;
  120270. var frameCount = Math.floor(dtsCorrection / refSampleDuration);
  120271. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n" + ("originalDts: " + originalDts + " ms, curRefDts: " + curRefDts + " ms, ") + ("dtsCorrection: " + Math.round(dtsCorrection) + " ms, generate: " + frameCount + " frames"));
  120272. dts = Math.floor(curRefDts);
  120273. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120274. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120275. if (silentUnit == null) {
  120276. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unable to generate silent frame for " + (this._audioMeta.originalCodec + " with " + this._audioMeta.channelCount + " channels, repeat last frame"));
  120277. silentUnit = unit;
  120278. }
  120279. silentFrames = [];
  120280. for (var j = 0; j < frameCount; j++) {
  120281. curRefDts = curRefDts + refSampleDuration;
  120282. var intDts = Math.floor(curRefDts);
  120283. var intDuration = Math.floor(curRefDts + refSampleDuration) - intDts;
  120284. var frame = {
  120285. dts: intDts,
  120286. pts: intDts,
  120287. cts: 0,
  120288. unit: silentUnit,
  120289. size: silentUnit.byteLength,
  120290. duration: intDuration,
  120291. originalDts,
  120292. flags: {
  120293. isLeading: 0,
  120294. dependsOn: 1,
  120295. isDependedOn: 0,
  120296. hasRedundancy: 0
  120297. }
  120298. };
  120299. silentFrames.push(frame);
  120300. mdatBytes += frame.size;
  120301. }
  120302. this._audioNextDts = curRefDts + refSampleDuration;
  120303. } else {
  120304. dts = Math.floor(curRefDts);
  120305. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120306. this._audioNextDts = curRefDts + refSampleDuration;
  120307. }
  120308. } else {
  120309. dts = originalDts - dtsCorrection;
  120310. if (i2 !== samples.length - 1) {
  120311. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120312. sampleDuration = nextDts - dts;
  120313. } else {
  120314. if (lastSample != null) {
  120315. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120316. sampleDuration = nextDts - dts;
  120317. } else if (mp4Samples.length >= 1) {
  120318. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120319. } else {
  120320. sampleDuration = Math.floor(refSampleDuration);
  120321. }
  120322. }
  120323. this._audioNextDts = dts + sampleDuration;
  120324. }
  120325. if (firstDts === -1) {
  120326. firstDts = dts;
  120327. }
  120328. mp4Samples.push({
  120329. dts,
  120330. pts: dts,
  120331. cts: 0,
  120332. unit: sample.unit,
  120333. size: sample.unit.byteLength,
  120334. duration: sampleDuration,
  120335. originalDts,
  120336. flags: {
  120337. isLeading: 0,
  120338. dependsOn: 1,
  120339. isDependedOn: 0,
  120340. hasRedundancy: 0
  120341. }
  120342. });
  120343. if (needFillSilentFrames) {
  120344. mp4Samples.push.apply(mp4Samples, silentFrames);
  120345. }
  120346. }
  120347. if (mp4Samples.length === 0) {
  120348. track.samples = [];
  120349. track.length = 0;
  120350. return;
  120351. }
  120352. if (mpegRawTrack) {
  120353. mdatbox = new Uint8Array(mdatBytes);
  120354. } else {
  120355. mdatbox = new Uint8Array(mdatBytes);
  120356. mdatbox[0] = mdatBytes >>> 24 & 255;
  120357. mdatbox[1] = mdatBytes >>> 16 & 255;
  120358. mdatbox[2] = mdatBytes >>> 8 & 255;
  120359. mdatbox[3] = mdatBytes & 255;
  120360. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120361. }
  120362. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120363. var unit = mp4Samples[i2].unit;
  120364. mdatbox.set(unit, offset);
  120365. offset += unit.byteLength;
  120366. }
  120367. var latest = mp4Samples[mp4Samples.length - 1];
  120368. lastDts = latest.dts + latest.duration;
  120369. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120370. info.beginDts = firstDts;
  120371. info.endDts = lastDts;
  120372. info.beginPts = firstDts;
  120373. info.endPts = lastDts;
  120374. info.originalBeginDts = mp4Samples[0].originalDts;
  120375. info.originalEndDts = latest.originalDts + latest.duration;
  120376. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, false);
  120377. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, false);
  120378. if (!this._isLive) {
  120379. this._audioSegmentInfoList.append(info);
  120380. }
  120381. track.samples = mp4Samples;
  120382. track.sequenceNumber++;
  120383. var moofbox = null;
  120384. if (mpegRawTrack) {
  120385. moofbox = new Uint8Array();
  120386. } else {
  120387. moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120388. }
  120389. track.samples = [];
  120390. track.length = 0;
  120391. var segment = {
  120392. type: "audio",
  120393. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120394. sampleCount: mp4Samples.length,
  120395. info
  120396. };
  120397. if (mpegRawTrack && firstSegmentAfterSeek) {
  120398. segment.timestampOffset = firstDts;
  120399. }
  120400. this._onMediaSegment("audio", segment);
  120401. };
  120402. MP4Remuxer2.prototype._remuxVideo = function(videoTrack, force) {
  120403. if (this._videoMeta == null) {
  120404. return;
  120405. }
  120406. var track = videoTrack;
  120407. var samples = track.samples;
  120408. var dtsCorrection = void 0;
  120409. var firstDts = -1, lastDts = -1;
  120410. var firstPts = -1, lastPts = -1;
  120411. if (!samples || samples.length === 0) {
  120412. return;
  120413. }
  120414. if (samples.length === 1 && !force) {
  120415. return;
  120416. }
  120417. var offset = 8;
  120418. var mdatbox = null;
  120419. var mdatBytes = 8 + videoTrack.length;
  120420. var lastSample = null;
  120421. if (samples.length > 1) {
  120422. lastSample = samples.pop();
  120423. mdatBytes -= lastSample.length;
  120424. }
  120425. if (this._videoStashedLastSample != null) {
  120426. var sample = this._videoStashedLastSample;
  120427. this._videoStashedLastSample = null;
  120428. samples.unshift(sample);
  120429. mdatBytes += sample.length;
  120430. }
  120431. if (lastSample != null) {
  120432. this._videoStashedLastSample = lastSample;
  120433. }
  120434. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120435. if (this._videoNextDts) {
  120436. dtsCorrection = firstSampleOriginalDts - this._videoNextDts;
  120437. } else {
  120438. if (this._videoSegmentInfoList.isEmpty()) {
  120439. dtsCorrection = 0;
  120440. } else {
  120441. var lastSample_2 = this._videoSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120442. if (lastSample_2 != null) {
  120443. var distance2 = firstSampleOriginalDts - (lastSample_2.originalDts + lastSample_2.duration);
  120444. if (distance2 <= 3) {
  120445. distance2 = 0;
  120446. }
  120447. var expectedDts = lastSample_2.dts + lastSample_2.duration + distance2;
  120448. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120449. } else {
  120450. dtsCorrection = 0;
  120451. }
  120452. }
  120453. }
  120454. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120455. var mp4Samples = [];
  120456. for (var i2 = 0; i2 < samples.length; i2++) {
  120457. var sample = samples[i2];
  120458. var originalDts = sample.dts - this._dtsBase;
  120459. var isKeyframe = sample.isKeyframe;
  120460. var dts = originalDts - dtsCorrection;
  120461. var cts = sample.cts;
  120462. var pts = dts + cts;
  120463. if (firstDts === -1) {
  120464. firstDts = dts;
  120465. firstPts = pts;
  120466. }
  120467. var sampleDuration = 0;
  120468. if (i2 !== samples.length - 1) {
  120469. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120470. sampleDuration = nextDts - dts;
  120471. } else {
  120472. if (lastSample != null) {
  120473. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120474. sampleDuration = nextDts - dts;
  120475. } else if (mp4Samples.length >= 1) {
  120476. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120477. } else {
  120478. sampleDuration = Math.floor(this._videoMeta.refSampleDuration);
  120479. }
  120480. }
  120481. if (isKeyframe) {
  120482. var syncPoint = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(dts, pts, sampleDuration, sample.dts, true);
  120483. syncPoint.fileposition = sample.fileposition;
  120484. info.appendSyncPoint(syncPoint);
  120485. }
  120486. mp4Samples.push({
  120487. dts,
  120488. pts,
  120489. cts,
  120490. units: sample.units,
  120491. size: sample.length,
  120492. isKeyframe,
  120493. duration: sampleDuration,
  120494. originalDts,
  120495. flags: {
  120496. isLeading: 0,
  120497. dependsOn: isKeyframe ? 2 : 1,
  120498. isDependedOn: isKeyframe ? 1 : 0,
  120499. hasRedundancy: 0,
  120500. isNonSync: isKeyframe ? 0 : 1
  120501. }
  120502. });
  120503. }
  120504. mdatbox = new Uint8Array(mdatBytes);
  120505. mdatbox[0] = mdatBytes >>> 24 & 255;
  120506. mdatbox[1] = mdatBytes >>> 16 & 255;
  120507. mdatbox[2] = mdatBytes >>> 8 & 255;
  120508. mdatbox[3] = mdatBytes & 255;
  120509. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120510. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120511. var units = mp4Samples[i2].units;
  120512. while (units.length) {
  120513. var unit = units.shift();
  120514. var data = unit.data;
  120515. mdatbox.set(data, offset);
  120516. offset += data.byteLength;
  120517. }
  120518. }
  120519. var latest = mp4Samples[mp4Samples.length - 1];
  120520. lastDts = latest.dts + latest.duration;
  120521. lastPts = latest.pts + latest.duration;
  120522. this._videoNextDts = lastDts;
  120523. info.beginDts = firstDts;
  120524. info.endDts = lastDts;
  120525. info.beginPts = firstPts;
  120526. info.endPts = lastPts;
  120527. info.originalBeginDts = mp4Samples[0].originalDts;
  120528. info.originalEndDts = latest.originalDts + latest.duration;
  120529. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, mp4Samples[0].isKeyframe);
  120530. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, latest.isKeyframe);
  120531. if (!this._isLive) {
  120532. this._videoSegmentInfoList.append(info);
  120533. }
  120534. track.samples = mp4Samples;
  120535. track.sequenceNumber++;
  120536. if (this._forceFirstIDR) {
  120537. var flags = mp4Samples[0].flags;
  120538. flags.dependsOn = 2;
  120539. flags.isNonSync = 0;
  120540. }
  120541. var moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120542. track.samples = [];
  120543. track.length = 0;
  120544. this._onMediaSegment("video", {
  120545. type: "video",
  120546. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120547. sampleCount: mp4Samples.length,
  120548. info
  120549. });
  120550. };
  120551. MP4Remuxer2.prototype._mergeBoxes = function(moof, mdat) {
  120552. var result = new Uint8Array(moof.byteLength + mdat.byteLength);
  120553. result.set(moof, 0);
  120554. result.set(mdat, moof.byteLength);
  120555. return result;
  120556. };
  120557. return MP4Remuxer2;
  120558. }();
  120559. __webpack_exports__2["default"] = MP4Remuxer;
  120560. },
  120561. "./src/utils/browser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120562. __webpack_require__2.r(__webpack_exports__2);
  120563. var Browser = {};
  120564. function detect() {
  120565. var ua = self.navigator.userAgent.toLowerCase();
  120566. var match = /(edge)\/([\w.]+)/.exec(ua) || /(opr)[\/]([\w.]+)/.exec(ua) || /(chrome)[ \/]([\w.]+)/.exec(ua) || /(iemobile)[\/]([\w.]+)/.exec(ua) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(ua) || [];
  120567. var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua) || /(windows phone)/.exec(ua) || /(iphone)/.exec(ua) || /(kindle)/.exec(ua) || /(android)/.exec(ua) || /(windows)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua) || /(cros)/.exec(ua) || [];
  120568. var matched = {
  120569. browser: match[5] || match[3] || match[1] || "",
  120570. version: match[2] || match[4] || "0",
  120571. majorVersion: match[4] || match[2] || "0",
  120572. platform: platform_match[0] || ""
  120573. };
  120574. var browser2 = {};
  120575. if (matched.browser) {
  120576. browser2[matched.browser] = true;
  120577. var versionArray = matched.majorVersion.split(".");
  120578. browser2.version = {
  120579. major: parseInt(matched.majorVersion, 10),
  120580. string: matched.version
  120581. };
  120582. if (versionArray.length > 1) {
  120583. browser2.version.minor = parseInt(versionArray[1], 10);
  120584. }
  120585. if (versionArray.length > 2) {
  120586. browser2.version.build = parseInt(versionArray[2], 10);
  120587. }
  120588. }
  120589. if (matched.platform) {
  120590. browser2[matched.platform] = true;
  120591. }
  120592. if (browser2.chrome || browser2.opr || browser2.safari) {
  120593. browser2.webkit = true;
  120594. }
  120595. if (browser2.rv || browser2.iemobile) {
  120596. if (browser2.rv) {
  120597. delete browser2.rv;
  120598. }
  120599. var msie = "msie";
  120600. matched.browser = msie;
  120601. browser2[msie] = true;
  120602. }
  120603. if (browser2.edge) {
  120604. delete browser2.edge;
  120605. var msedge = "msedge";
  120606. matched.browser = msedge;
  120607. browser2[msedge] = true;
  120608. }
  120609. if (browser2.opr) {
  120610. var opera = "opera";
  120611. matched.browser = opera;
  120612. browser2[opera] = true;
  120613. }
  120614. if (browser2.safari && browser2.android) {
  120615. var android = "android";
  120616. matched.browser = android;
  120617. browser2[android] = true;
  120618. }
  120619. browser2.name = matched.browser;
  120620. browser2.platform = matched.platform;
  120621. for (var key in Browser) {
  120622. if (Browser.hasOwnProperty(key)) {
  120623. delete Browser[key];
  120624. }
  120625. }
  120626. Object.assign(Browser, browser2);
  120627. }
  120628. detect();
  120629. __webpack_exports__2["default"] = Browser;
  120630. },
  120631. "./src/utils/exception.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120632. __webpack_require__2.r(__webpack_exports__2);
  120633. __webpack_require__2.d(__webpack_exports__2, {
  120634. "RuntimeException": function() {
  120635. return RuntimeException;
  120636. },
  120637. "IllegalStateException": function() {
  120638. return IllegalStateException;
  120639. },
  120640. "InvalidArgumentException": function() {
  120641. return InvalidArgumentException;
  120642. },
  120643. "NotImplementedException": function() {
  120644. return NotImplementedException;
  120645. }
  120646. });
  120647. var __extends = function() {
  120648. var extendStatics = function(d2, b) {
  120649. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  120650. d3.__proto__ = b2;
  120651. } || function(d3, b2) {
  120652. for (var p in b2)
  120653. if (Object.prototype.hasOwnProperty.call(b2, p))
  120654. d3[p] = b2[p];
  120655. };
  120656. return extendStatics(d2, b);
  120657. };
  120658. return function(d2, b) {
  120659. if (typeof b !== "function" && b !== null)
  120660. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  120661. extendStatics(d2, b);
  120662. function __() {
  120663. this.constructor = d2;
  120664. }
  120665. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120666. };
  120667. }();
  120668. var RuntimeException = function() {
  120669. function RuntimeException2(message) {
  120670. this._message = message;
  120671. }
  120672. Object.defineProperty(RuntimeException2.prototype, "name", {
  120673. get: function() {
  120674. return "RuntimeException";
  120675. },
  120676. enumerable: false,
  120677. configurable: true
  120678. });
  120679. Object.defineProperty(RuntimeException2.prototype, "message", {
  120680. get: function() {
  120681. return this._message;
  120682. },
  120683. enumerable: false,
  120684. configurable: true
  120685. });
  120686. RuntimeException2.prototype.toString = function() {
  120687. return this.name + ": " + this.message;
  120688. };
  120689. return RuntimeException2;
  120690. }();
  120691. var IllegalStateException = function(_super) {
  120692. __extends(IllegalStateException2, _super);
  120693. function IllegalStateException2(message) {
  120694. return _super.call(this, message) || this;
  120695. }
  120696. Object.defineProperty(IllegalStateException2.prototype, "name", {
  120697. get: function() {
  120698. return "IllegalStateException";
  120699. },
  120700. enumerable: false,
  120701. configurable: true
  120702. });
  120703. return IllegalStateException2;
  120704. }(RuntimeException);
  120705. var InvalidArgumentException = function(_super) {
  120706. __extends(InvalidArgumentException2, _super);
  120707. function InvalidArgumentException2(message) {
  120708. return _super.call(this, message) || this;
  120709. }
  120710. Object.defineProperty(InvalidArgumentException2.prototype, "name", {
  120711. get: function() {
  120712. return "InvalidArgumentException";
  120713. },
  120714. enumerable: false,
  120715. configurable: true
  120716. });
  120717. return InvalidArgumentException2;
  120718. }(RuntimeException);
  120719. var NotImplementedException = function(_super) {
  120720. __extends(NotImplementedException2, _super);
  120721. function NotImplementedException2(message) {
  120722. return _super.call(this, message) || this;
  120723. }
  120724. Object.defineProperty(NotImplementedException2.prototype, "name", {
  120725. get: function() {
  120726. return "NotImplementedException";
  120727. },
  120728. enumerable: false,
  120729. configurable: true
  120730. });
  120731. return NotImplementedException2;
  120732. }(RuntimeException);
  120733. },
  120734. "./src/utils/logger.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120735. __webpack_require__2.r(__webpack_exports__2);
  120736. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120737. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120738. var Log = function() {
  120739. function Log2() {
  120740. }
  120741. Log2.e = function(tag, msg) {
  120742. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120743. tag = Log2.GLOBAL_TAG;
  120744. var str = "[" + tag + "] > " + msg;
  120745. if (Log2.ENABLE_CALLBACK) {
  120746. Log2.emitter.emit("log", "error", str);
  120747. }
  120748. if (!Log2.ENABLE_ERROR) {
  120749. return;
  120750. }
  120751. if (console.error) {
  120752. console.error(str);
  120753. } else if (console.warn) {
  120754. console.warn(str);
  120755. } else {
  120756. console.log(str);
  120757. }
  120758. };
  120759. Log2.i = function(tag, msg) {
  120760. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120761. tag = Log2.GLOBAL_TAG;
  120762. var str = "[" + tag + "] > " + msg;
  120763. if (Log2.ENABLE_CALLBACK) {
  120764. Log2.emitter.emit("log", "info", str);
  120765. }
  120766. if (!Log2.ENABLE_INFO) {
  120767. return;
  120768. }
  120769. if (console.info) {
  120770. console.info(str);
  120771. } else {
  120772. console.log(str);
  120773. }
  120774. };
  120775. Log2.w = function(tag, msg) {
  120776. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120777. tag = Log2.GLOBAL_TAG;
  120778. var str = "[" + tag + "] > " + msg;
  120779. if (Log2.ENABLE_CALLBACK) {
  120780. Log2.emitter.emit("log", "warn", str);
  120781. }
  120782. if (!Log2.ENABLE_WARN) {
  120783. return;
  120784. }
  120785. if (console.warn) {
  120786. console.warn(str);
  120787. } else {
  120788. console.log(str);
  120789. }
  120790. };
  120791. Log2.d = function(tag, msg) {
  120792. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120793. tag = Log2.GLOBAL_TAG;
  120794. var str = "[" + tag + "] > " + msg;
  120795. if (Log2.ENABLE_CALLBACK) {
  120796. Log2.emitter.emit("log", "debug", str);
  120797. }
  120798. if (!Log2.ENABLE_DEBUG) {
  120799. return;
  120800. }
  120801. if (console.debug) {
  120802. console.debug(str);
  120803. } else {
  120804. console.log(str);
  120805. }
  120806. };
  120807. Log2.v = function(tag, msg) {
  120808. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120809. tag = Log2.GLOBAL_TAG;
  120810. var str = "[" + tag + "] > " + msg;
  120811. if (Log2.ENABLE_CALLBACK) {
  120812. Log2.emitter.emit("log", "verbose", str);
  120813. }
  120814. if (!Log2.ENABLE_VERBOSE) {
  120815. return;
  120816. }
  120817. console.log(str);
  120818. };
  120819. return Log2;
  120820. }();
  120821. Log.GLOBAL_TAG = "flv.js";
  120822. Log.FORCE_GLOBAL_TAG = false;
  120823. Log.ENABLE_ERROR = true;
  120824. Log.ENABLE_INFO = true;
  120825. Log.ENABLE_WARN = true;
  120826. Log.ENABLE_DEBUG = true;
  120827. Log.ENABLE_VERBOSE = true;
  120828. Log.ENABLE_CALLBACK = false;
  120829. Log.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  120830. __webpack_exports__2["default"] = Log;
  120831. },
  120832. "./src/utils/logging-control.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120833. __webpack_require__2.r(__webpack_exports__2);
  120834. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120835. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120836. var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  120837. var LoggingControl = function() {
  120838. function LoggingControl2() {
  120839. }
  120840. Object.defineProperty(LoggingControl2, "forceGlobalTag", {
  120841. get: function() {
  120842. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG;
  120843. },
  120844. set: function(enable) {
  120845. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = enable;
  120846. LoggingControl2._notifyChange();
  120847. },
  120848. enumerable: false,
  120849. configurable: true
  120850. });
  120851. Object.defineProperty(LoggingControl2, "globalTag", {
  120852. get: function() {
  120853. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG;
  120854. },
  120855. set: function(tag) {
  120856. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = tag;
  120857. LoggingControl2._notifyChange();
  120858. },
  120859. enumerable: false,
  120860. configurable: true
  120861. });
  120862. Object.defineProperty(LoggingControl2, "enableAll", {
  120863. get: function() {
  120864. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120865. },
  120866. set: function(enable) {
  120867. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120868. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120869. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120870. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120871. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120872. LoggingControl2._notifyChange();
  120873. },
  120874. enumerable: false,
  120875. configurable: true
  120876. });
  120877. Object.defineProperty(LoggingControl2, "enableDebug", {
  120878. get: function() {
  120879. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG;
  120880. },
  120881. set: function(enable) {
  120882. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120883. LoggingControl2._notifyChange();
  120884. },
  120885. enumerable: false,
  120886. configurable: true
  120887. });
  120888. Object.defineProperty(LoggingControl2, "enableVerbose", {
  120889. get: function() {
  120890. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE;
  120891. },
  120892. set: function(enable) {
  120893. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120894. LoggingControl2._notifyChange();
  120895. },
  120896. enumerable: false,
  120897. configurable: true
  120898. });
  120899. Object.defineProperty(LoggingControl2, "enableInfo", {
  120900. get: function() {
  120901. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO;
  120902. },
  120903. set: function(enable) {
  120904. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120905. LoggingControl2._notifyChange();
  120906. },
  120907. enumerable: false,
  120908. configurable: true
  120909. });
  120910. Object.defineProperty(LoggingControl2, "enableWarn", {
  120911. get: function() {
  120912. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN;
  120913. },
  120914. set: function(enable) {
  120915. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120916. LoggingControl2._notifyChange();
  120917. },
  120918. enumerable: false,
  120919. configurable: true
  120920. });
  120921. Object.defineProperty(LoggingControl2, "enableError", {
  120922. get: function() {
  120923. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120924. },
  120925. set: function(enable) {
  120926. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120927. LoggingControl2._notifyChange();
  120928. },
  120929. enumerable: false,
  120930. configurable: true
  120931. });
  120932. LoggingControl2.getConfig = function() {
  120933. return {
  120934. globalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG,
  120935. forceGlobalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG,
  120936. enableVerbose: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE,
  120937. enableDebug: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG,
  120938. enableInfo: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO,
  120939. enableWarn: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN,
  120940. enableError: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR,
  120941. enableCallback: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK
  120942. };
  120943. };
  120944. LoggingControl2.applyConfig = function(config) {
  120945. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = config.globalTag;
  120946. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = config.forceGlobalTag;
  120947. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = config.enableVerbose;
  120948. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = config.enableDebug;
  120949. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = config.enableInfo;
  120950. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = config.enableWarn;
  120951. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = config.enableError;
  120952. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = config.enableCallback;
  120953. };
  120954. LoggingControl2._notifyChange = function() {
  120955. var emitter = LoggingControl2.emitter;
  120956. if (emitter.listenerCount("change") > 0) {
  120957. var config = LoggingControl2.getConfig();
  120958. emitter.emit("change", config);
  120959. }
  120960. };
  120961. LoggingControl2.registerListener = function(listener) {
  120962. LoggingControl2.emitter.addListener("change", listener);
  120963. };
  120964. LoggingControl2.removeListener = function(listener) {
  120965. LoggingControl2.emitter.removeListener("change", listener);
  120966. };
  120967. LoggingControl2.addLogListener = function(listener) {
  120968. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.addListener("log", listener);
  120969. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") > 0) {
  120970. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = true;
  120971. LoggingControl2._notifyChange();
  120972. }
  120973. };
  120974. LoggingControl2.removeLogListener = function(listener) {
  120975. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.removeListener("log", listener);
  120976. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") === 0) {
  120977. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = false;
  120978. LoggingControl2._notifyChange();
  120979. }
  120980. };
  120981. return LoggingControl2;
  120982. }();
  120983. LoggingControl.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  120984. __webpack_exports__2["default"] = LoggingControl;
  120985. },
  120986. "./src/utils/polyfill.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120987. __webpack_require__2.r(__webpack_exports__2);
  120988. var Polyfill = function() {
  120989. function Polyfill2() {
  120990. }
  120991. Polyfill2.install = function() {
  120992. Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) {
  120993. obj.__proto__ = proto;
  120994. return obj;
  120995. };
  120996. Object.assign = Object.assign || function(target) {
  120997. if (target === void 0 || target === null) {
  120998. throw new TypeError("Cannot convert undefined or null to object");
  120999. }
  121000. var output = Object(target);
  121001. for (var i2 = 1; i2 < arguments.length; i2++) {
  121002. var source = arguments[i2];
  121003. if (source !== void 0 && source !== null) {
  121004. for (var key in source) {
  121005. if (source.hasOwnProperty(key)) {
  121006. output[key] = source[key];
  121007. }
  121008. }
  121009. }
  121010. }
  121011. return output;
  121012. };
  121013. if (typeof self.Promise !== "function") {
  121014. __webpack_require__2("./node_modules/es6-promise/dist/es6-promise.js").polyfill();
  121015. }
  121016. };
  121017. return Polyfill2;
  121018. }();
  121019. Polyfill.install();
  121020. __webpack_exports__2["default"] = Polyfill;
  121021. },
  121022. "./src/utils/utf8-conv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  121023. __webpack_require__2.r(__webpack_exports__2);
  121024. function checkContinuation(uint8array, start2, checkLength) {
  121025. var array = uint8array;
  121026. if (start2 + checkLength < array.length) {
  121027. while (checkLength--) {
  121028. if ((array[++start2] & 192) !== 128)
  121029. return false;
  121030. }
  121031. return true;
  121032. } else {
  121033. return false;
  121034. }
  121035. }
  121036. function decodeUTF8(uint8array) {
  121037. var out = [];
  121038. var input = uint8array;
  121039. var i2 = 0;
  121040. var length = uint8array.length;
  121041. while (i2 < length) {
  121042. if (input[i2] < 128) {
  121043. out.push(String.fromCharCode(input[i2]));
  121044. ++i2;
  121045. continue;
  121046. } else if (input[i2] < 192)
  121047. ;
  121048. else if (input[i2] < 224) {
  121049. if (checkContinuation(input, i2, 1)) {
  121050. var ucs4 = (input[i2] & 31) << 6 | input[i2 + 1] & 63;
  121051. if (ucs4 >= 128) {
  121052. out.push(String.fromCharCode(ucs4 & 65535));
  121053. i2 += 2;
  121054. continue;
  121055. }
  121056. }
  121057. } else if (input[i2] < 240) {
  121058. if (checkContinuation(input, i2, 2)) {
  121059. var ucs4 = (input[i2] & 15) << 12 | (input[i2 + 1] & 63) << 6 | input[i2 + 2] & 63;
  121060. if (ucs4 >= 2048 && (ucs4 & 63488) !== 55296) {
  121061. out.push(String.fromCharCode(ucs4 & 65535));
  121062. i2 += 3;
  121063. continue;
  121064. }
  121065. }
  121066. } else if (input[i2] < 248) {
  121067. if (checkContinuation(input, i2, 3)) {
  121068. var ucs4 = (input[i2] & 7) << 18 | (input[i2 + 1] & 63) << 12 | (input[i2 + 2] & 63) << 6 | input[i2 + 3] & 63;
  121069. if (ucs4 > 65536 && ucs4 < 1114112) {
  121070. ucs4 -= 65536;
  121071. out.push(String.fromCharCode(ucs4 >>> 10 | 55296));
  121072. out.push(String.fromCharCode(ucs4 & 1023 | 56320));
  121073. i2 += 4;
  121074. continue;
  121075. }
  121076. }
  121077. }
  121078. out.push(String.fromCharCode(65533));
  121079. ++i2;
  121080. }
  121081. return out.join("");
  121082. }
  121083. __webpack_exports__2["default"] = decodeUTF8;
  121084. }
  121085. };
  121086. var __webpack_module_cache__ = {};
  121087. function __webpack_require__(moduleId) {
  121088. var cachedModule = __webpack_module_cache__[moduleId];
  121089. if (cachedModule !== void 0) {
  121090. return cachedModule.exports;
  121091. }
  121092. var module3 = __webpack_module_cache__[moduleId] = {
  121093. exports: {}
  121094. };
  121095. __webpack_modules__[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
  121096. return module3.exports;
  121097. }
  121098. __webpack_require__.m = __webpack_modules__;
  121099. !function() {
  121100. __webpack_require__.n = function(module3) {
  121101. var getter = module3 && module3.__esModule ? function() {
  121102. return module3["default"];
  121103. } : function() {
  121104. return module3;
  121105. };
  121106. __webpack_require__.d(getter, { a: getter });
  121107. return getter;
  121108. };
  121109. }();
  121110. !function() {
  121111. __webpack_require__.d = function(exports3, definition) {
  121112. for (var key in definition) {
  121113. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports3, key)) {
  121114. Object.defineProperty(exports3, key, { enumerable: true, get: definition[key] });
  121115. }
  121116. }
  121117. };
  121118. }();
  121119. !function() {
  121120. __webpack_require__.g = function() {
  121121. if (typeof globalThis === "object")
  121122. return globalThis;
  121123. try {
  121124. return this || new Function("return this")();
  121125. } catch (e) {
  121126. if (typeof window === "object")
  121127. return window;
  121128. }
  121129. }();
  121130. }();
  121131. !function() {
  121132. __webpack_require__.o = function(obj, prop) {
  121133. return Object.prototype.hasOwnProperty.call(obj, prop);
  121134. };
  121135. }();
  121136. !function() {
  121137. __webpack_require__.r = function(exports3) {
  121138. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  121139. Object.defineProperty(exports3, Symbol.toStringTag, { value: "Module" });
  121140. }
  121141. Object.defineProperty(exports3, "__esModule", { value: true });
  121142. };
  121143. }();
  121144. var __webpack_exports__ = __webpack_require__("./src/index.js");
  121145. return __webpack_exports__;
  121146. }();
  121147. });
  121148. })(flv);
  121149. var flvjs = /* @__PURE__ */ getDefaultExportFromCjs(flv.exports);
  121150. const Html5 = videojs$2.getTech("Html5");
  121151. const mergeOptions = videojs$2.mergeOptions || videojs$2.util.mergeOptions;
  121152. const defaults = {
  121153. mediaDataSource: {},
  121154. config: {}
  121155. };
  121156. class Flvjs extends Html5 {
  121157. constructor(options2, ready) {
  121158. options2 = mergeOptions(defaults, options2);
  121159. super(options2, ready);
  121160. }
  121161. setSrc(src) {
  121162. if (this.flvPlayer) {
  121163. this.flvPlayer.detachMediaElement();
  121164. this.flvPlayer.destroy();
  121165. }
  121166. const mediaDataSource = this.options_.mediaDataSource;
  121167. const config = this.options_.config;
  121168. mediaDataSource.type = mediaDataSource.type === void 0 ? "flv" : mediaDataSource.type;
  121169. mediaDataSource.url = src;
  121170. this.flvPlayer = flvjs.createPlayer(mediaDataSource, config);
  121171. this.flvPlayer.attachMediaElement(this.el_);
  121172. this.flvPlayer.load();
  121173. }
  121174. dispose() {
  121175. if (this.flvPlayer) {
  121176. this.flvPlayer.detachMediaElement();
  121177. this.flvPlayer.destroy();
  121178. }
  121179. super.dispose();
  121180. }
  121181. }
  121182. Flvjs.isSupported = function() {
  121183. return flvjs && flvjs.isSupported();
  121184. };
  121185. Flvjs.formats = {
  121186. "video/flv": "FLV",
  121187. "video/x-flv": "FLV"
  121188. };
  121189. Flvjs.canPlayType = function(type2) {
  121190. if (Flvjs.isSupported() && type2 in Flvjs.formats) {
  121191. return "maybe";
  121192. }
  121193. return "";
  121194. };
  121195. Flvjs.canPlaySource = function(srcObj, options2) {
  121196. return Flvjs.canPlayType(srcObj.type);
  121197. };
  121198. Flvjs.VERSION = "__VERSION__";
  121199. videojs$2.registerTech("Flvjs", Flvjs);
  121200. var VideoWindow$1 = "";
  121201. class VideoWindow {
  121202. constructor(viewer2, position2, videoInfo, offsetHeight) {
  121203. if (!viewer2)
  121204. throw new Cesium.DeveloperError("no viewer object!");
  121205. if (!position2)
  121206. throw new Cesium.DeveloperError("no position object!");
  121207. this.viewer = viewer2;
  121208. this.position = position2;
  121209. this.offsetHeight = offsetHeight;
  121210. if (position2 instanceof Cesium.Cartesian3) {
  121211. this.position = position2;
  121212. } else {
  121213. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121214. }
  121215. if (document.getElementsByClassName("popup-video").length > 0) {
  121216. document.getElementsByClassName("popup-video")[0].remove();
  121217. viewer2.entities.remove(viewer2.entities.getById("videoPopupPoint"));
  121218. }
  121219. this.id = "popup_video_" + getGuid();
  121220. this.popupDiv = document.createElement("div");
  121221. this.popupDiv.classList.add("popup-video");
  121222. this.popupDiv.id = this.id;
  121223. this.viewer.container.append(this.popupDiv);
  121224. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121225. switch (videoInfo.type) {
  121226. case "hls":
  121227. this.videotype = "application/x-mpegURL";
  121228. break;
  121229. case "rtmp":
  121230. this.videotype = "rtmp/flv";
  121231. break;
  121232. case "flv":
  121233. this.videotype = "video/x-flv";
  121234. break;
  121235. case "mp4":
  121236. this.videotype = "video/mp4";
  121237. break;
  121238. }
  121239. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121240. controls: true,
  121241. autoplay: "muted",
  121242. loop: true,
  121243. muted: false,
  121244. fluid: true,
  121245. aspectRatio: "16:9",
  121246. reload: "auto",
  121247. fullscreen: {
  121248. options: {
  121249. navigationUI: "hide"
  121250. }
  121251. },
  121252. sources: [{
  121253. src: videoInfo.url,
  121254. type: this.videotype
  121255. }]
  121256. }, function onPlayerReady() {
  121257. console.log("onPlayerReady", this);
  121258. });
  121259. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121260. this.initPoint();
  121261. document.getElementsByClassName("popup-video1-close-button")[0].onclick = () => {
  121262. this.close();
  121263. };
  121264. }
  121265. postRender() {
  121266. this.viewer.scene.canvas.height;
  121267. const windowPosition = new Cesium.Cartesian2();
  121268. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121269. this.viewer.scene,
  121270. this.position,
  121271. windowPosition
  121272. );
  121273. let elWidth = this.popupDiv.offsetWidth;
  121274. let elHeight = this.popupDiv.offsetHeight;
  121275. if (!!this.offsetHeight) {
  121276. elHeight += this.offsetHeight;
  121277. }
  121278. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121279. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121280. const camerPosition = this.viewer.camera.position;
  121281. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121282. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121283. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121284. this.popupDiv.style.display = "block";
  121285. } else {
  121286. this.popupDiv.style.display = "none";
  121287. }
  121288. }
  121289. _createHtml(videoInfo) {
  121290. let html = `
  121291. <div class="popup-video-header">
  121292. ${videoInfo.name}
  121293. <span class="popup-video1-close-button">\xD7</span>
  121294. </div>
  121295. <div class="popup-video-content">
  121296. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121297. </div>
  121298. <div class="popup-video-tip">
  121299. </div>
  121300. `;
  121301. return html;
  121302. }
  121303. initPoint() {
  121304. this.billboard = new Cesium.Entity({
  121305. id: "videoPopupPoint",
  121306. name: "popupPoint",
  121307. position: this.position,
  121308. billboard: {
  121309. image: "jt3dSDK/imgs/point/point.png",
  121310. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121311. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121312. scale: 1,
  121313. pixelOffset: new Cesium.Cartesian2(0, 0),
  121314. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121315. }
  121316. });
  121317. this.viewer.entities.add(this.billboard);
  121318. }
  121319. }
  121320. Object.assign(VideoWindow.prototype, {
  121321. close() {
  121322. this.popupDiv.remove();
  121323. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121324. this.viewer.entities.remove(this.billboard);
  121325. videojs$2("myvideo").dispose();
  121326. this.videoPlayer.dispose();
  121327. }
  121328. });
  121329. var VideoWindow2$1 = "";
  121330. class VideoWindow2 {
  121331. constructor(viewer2, position2, videoInfo) {
  121332. if (!viewer2)
  121333. throw new Cesium.DeveloperError("no viewer object!");
  121334. if (!position2)
  121335. throw new Cesium.DeveloperError("no position object!");
  121336. this.viewer = viewer2;
  121337. this.position = position2;
  121338. if (position2 instanceof Cesium.Cartesian3) {
  121339. this.position = position2;
  121340. } else {
  121341. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121342. }
  121343. if (document.getElementsByClassName("popup-video2").length > 0) {
  121344. document.getElementsByClassName("popup-video2")[0].remove();
  121345. }
  121346. this.id = "popup_video_" + getGuid();
  121347. this.popupDiv = document.createElement("div");
  121348. this.popupDiv.classList.add("popup-video2");
  121349. this.popupDiv.id = this.id;
  121350. this.viewer.container.append(this.popupDiv);
  121351. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121352. switch (videoInfo.type) {
  121353. case "hls":
  121354. this.videotype = "application/x-mpegURL";
  121355. break;
  121356. case "rtmp":
  121357. this.videotype = "rtmp/flv";
  121358. break;
  121359. case "flv":
  121360. this.videotype = "video/x-flv";
  121361. break;
  121362. case "mp4":
  121363. this.videotype = "video/mp4";
  121364. break;
  121365. }
  121366. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121367. controls: true,
  121368. autoplay: "muted",
  121369. loop: true,
  121370. muted: false,
  121371. fluid: true,
  121372. aspectRatio: "16:9",
  121373. reload: "auto",
  121374. fullscreen: {
  121375. options: {
  121376. navigationUI: "hide"
  121377. }
  121378. },
  121379. sources: [{
  121380. src: videoInfo.url,
  121381. type: this.videotype
  121382. }]
  121383. }, function onPlayerReady() {
  121384. console.log("onPlayerReady", this);
  121385. });
  121386. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121387. document.getElementsByClassName("popup-video2-close-button")[0].onclick = () => {
  121388. this.close();
  121389. };
  121390. }
  121391. postRender() {
  121392. this.viewer.scene.canvas.height;
  121393. const windowPosition = new Cesium.Cartesian2();
  121394. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121395. this.viewer.scene,
  121396. this.position,
  121397. windowPosition
  121398. );
  121399. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121400. this.popupDiv.style.top = windowPosition.y + "px";
  121401. const camerPosition = this.viewer.camera.position;
  121402. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121403. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121404. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121405. this.popupDiv.style.display = "block";
  121406. } else {
  121407. this.popupDiv.style.display = "none";
  121408. }
  121409. }
  121410. _createHtml(videoInfo) {
  121411. let html = `
  121412. <div class="rightLine-1"></div>
  121413. <div class="rightLine-2"></div>
  121414. <div class="rightLine-3"></div>
  121415. <div class="popup-header">
  121416. <span class="popup-title" >${videoInfo.name}</span>
  121417. <span class="popup-video2-close-button" title="\u5173\u95ED" >\xD7</span>
  121418. </div>
  121419. <div class="popup-content">
  121420. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121421. </div>
  121422. `;
  121423. return html;
  121424. }
  121425. }
  121426. Object.assign(VideoWindow2.prototype, {
  121427. close() {
  121428. this.popupDiv.remove();
  121429. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121430. }
  121431. });
  121432. var VideoWindow3$1 = "";
  121433. class VideoWindow3 {
  121434. constructor(viewer2, position2, videoInfo) {
  121435. if (!viewer2)
  121436. throw new Cesium.DeveloperError("no viewer object!");
  121437. if (!position2)
  121438. throw new Cesium.DeveloperError("no position object!");
  121439. this.viewer = viewer2;
  121440. this.position = position2;
  121441. if (position2 instanceof Cesium.Cartesian3) {
  121442. this.position = position2;
  121443. } else {
  121444. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121445. }
  121446. if (document.getElementsByClassName("popup-video3").length > 0) {
  121447. document.getElementsByClassName("popup-video3")[0].remove();
  121448. }
  121449. this.id = "popup_video_" + getGuid();
  121450. this.popupDiv = document.createElement("div");
  121451. this.popupDiv.classList.add("popup-video3");
  121452. this.popupDiv.id = this.id;
  121453. this.viewer.container.append(this.popupDiv);
  121454. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121455. switch (videoInfo.type) {
  121456. case "hls":
  121457. this.videotype = "application/x-mpegURL";
  121458. break;
  121459. case "rtmp":
  121460. this.videotype = "rtmp/flv";
  121461. break;
  121462. case "flv":
  121463. this.videotype = "video/x-flv";
  121464. break;
  121465. case "mp4":
  121466. this.videotype = "video/mp4";
  121467. break;
  121468. }
  121469. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121470. controls: true,
  121471. autoplay: "muted",
  121472. loop: true,
  121473. muted: false,
  121474. fluid: true,
  121475. aspectRatio: "16:9",
  121476. reload: "auto",
  121477. fullscreen: {
  121478. options: {
  121479. navigationUI: "hide"
  121480. }
  121481. },
  121482. sources: [{
  121483. src: videoInfo.url,
  121484. type: this.videotype
  121485. }]
  121486. }, function onPlayerReady() {
  121487. console.log("onPlayerReady", this);
  121488. });
  121489. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121490. document.getElementsByClassName("popup-video3-close-button")[0].onclick = () => {
  121491. this.close();
  121492. };
  121493. }
  121494. postRender() {
  121495. this.viewer.scene.canvas.height;
  121496. const windowPosition = new Cesium.Cartesian2();
  121497. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121498. this.viewer.scene,
  121499. this.position,
  121500. windowPosition
  121501. );
  121502. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121503. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121504. const camerPosition = this.viewer.camera.position;
  121505. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121506. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121507. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121508. this.popupDiv.style.display = "block";
  121509. } else {
  121510. this.popupDiv.style.display = "none";
  121511. }
  121512. }
  121513. _createHtml(videoInfo) {
  121514. let html = `
  121515. <div class="leftLine-1"></div>
  121516. <div class="leftLine-2"></div>
  121517. <div class="popup-header">
  121518. <span class="popup-title" >${videoInfo.name}</span>
  121519. <span class="popup-video3-close-button" title="\u5173\u95ED" >\xD7</span>
  121520. </div>
  121521. <div class="popup-content">
  121522. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121523. </div>
  121524. `;
  121525. return html;
  121526. }
  121527. }
  121528. Object.assign(VideoWindow3.prototype, {
  121529. close() {
  121530. this.popupDiv.remove();
  121531. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121532. }
  121533. });
  121534. var HtmlWindow1 = "";
  121535. class HtmlWindow {
  121536. constructor(viewer2, position2, title, html, offsetHeight) {
  121537. if (!viewer2)
  121538. throw new Cesium.DeveloperError("no viewer object!");
  121539. if (!position2)
  121540. throw new Cesium.DeveloperError("no position object!");
  121541. this.viewer = viewer2;
  121542. this.offsetHeight = offsetHeight;
  121543. if (position2 instanceof Cesium.Cartesian3) {
  121544. this.position = position2;
  121545. } else {
  121546. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121547. }
  121548. if (document.getElementsByClassName("popup1").length > 0) {
  121549. document.getElementsByClassName("popup1")[0].remove();
  121550. viewer2.entities.remove(viewer2.entities.getById("popupPoint"));
  121551. }
  121552. this.id = "popup_" + getGuid();
  121553. this.popupDiv = document.createElement("div");
  121554. this.popupDiv.classList.add("popup1");
  121555. this.popupDiv.id = this.id;
  121556. this.viewer.container.append(this.popupDiv);
  121557. this.popupDiv.innerHTML = this._createHtml(title, html);
  121558. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121559. this.initPoint();
  121560. document.getElementsByClassName("popup1-close-button")[0].onclick = () => {
  121561. this.close();
  121562. };
  121563. }
  121564. postRender() {
  121565. this.viewer.scene.canvas.height;
  121566. const windowPosition = new Cesium.Cartesian2();
  121567. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121568. this.viewer.scene,
  121569. this.position,
  121570. windowPosition
  121571. );
  121572. let elWidth = this.popupDiv.offsetWidth;
  121573. let elHeight = this.popupDiv.offsetHeight;
  121574. if (!!this.offsetHeight) {
  121575. elHeight += this.offsetHeight;
  121576. }
  121577. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121578. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121579. const camerPosition = this.viewer.camera.position;
  121580. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121581. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121582. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121583. this.popupDiv.style.display = "block";
  121584. } else {
  121585. this.popupDiv.style.display = "none";
  121586. }
  121587. }
  121588. _createHtml(header, content) {
  121589. let html = `
  121590. <div class="popup-header">
  121591. ${header}
  121592. <span class="popup1-close-button">\xD7</span>
  121593. </div>
  121594. <div class="popup-content">
  121595. ${content}
  121596. </div>
  121597. <div class="popup-tip">
  121598. </div>
  121599. `;
  121600. return html;
  121601. }
  121602. initPoint() {
  121603. this.billboard = this.viewer.entities.add({
  121604. id: "popupPoint",
  121605. name: "popupPoint",
  121606. position: this.position,
  121607. billboard: {
  121608. image: "jt3dSDK/imgs/point/point.png",
  121609. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121610. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121611. scale: 1,
  121612. pixelOffset: new Cesium.Cartesian2(0, 0),
  121613. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121614. }
  121615. });
  121616. }
  121617. }
  121618. Object.assign(HtmlWindow.prototype, {
  121619. close() {
  121620. this.popupDiv.remove();
  121621. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121622. this.viewer.entities.remove(this.billboard);
  121623. }
  121624. });
  121625. var HtmlWindow2$1 = "";
  121626. class HtmlWindow2 {
  121627. constructor(viewer2, position2, title, html) {
  121628. if (!viewer2)
  121629. throw new Cesium.DeveloperError("no viewer object!");
  121630. if (!position2)
  121631. throw new Cesium.DeveloperError("no position object!");
  121632. this.viewer = viewer2;
  121633. this.position = position2;
  121634. if (position2 instanceof Cesium.Cartesian3) {
  121635. this.position = position2;
  121636. } else {
  121637. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121638. }
  121639. if (document.getElementsByClassName("popup2").length > 0) {
  121640. document.getElementsByClassName("popup2")[0].remove();
  121641. }
  121642. this.id = "popup_" + getGuid();
  121643. this.popupDiv = document.createElement("div");
  121644. this.popupDiv.classList.add("popup2");
  121645. this.popupDiv.id = this.id;
  121646. this.viewer.container.append(this.popupDiv);
  121647. this.popupDiv.innerHTML = this._createHtml(title, html);
  121648. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121649. document.getElementsByClassName("popup2-close-button")[0].onclick = () => {
  121650. this.close();
  121651. };
  121652. }
  121653. postRender() {
  121654. this.viewer.scene.canvas.height;
  121655. const windowPosition = new Cesium.Cartesian2();
  121656. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121657. this.viewer.scene,
  121658. this.position,
  121659. windowPosition
  121660. );
  121661. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121662. this.popupDiv.style.top = windowPosition.y + "px";
  121663. const camerPosition = this.viewer.camera.position;
  121664. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121665. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121666. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121667. this.popupDiv.style.display = "block";
  121668. } else {
  121669. this.popupDiv.style.display = "none";
  121670. }
  121671. }
  121672. _createHtml(title, content) {
  121673. let html = `
  121674. <div class="rightLine-1"></div>
  121675. <div class="rightLine-2"></div>
  121676. <div class="rightLine-3"></div>
  121677. <div class="popup-header">
  121678. <span class="popup-title" >${title}</span>
  121679. <span class="popup2-close-button" title="\u5173\u95ED" >\xD7</span>
  121680. </div>
  121681. <div class="popup-content">
  121682. ${content}
  121683. </div>
  121684. `;
  121685. return html;
  121686. }
  121687. }
  121688. Object.assign(HtmlWindow2.prototype, {
  121689. close() {
  121690. this.popupDiv.remove();
  121691. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121692. }
  121693. });
  121694. var HtmlWindow3$1 = "";
  121695. class HtmlWindow3 {
  121696. constructor(viewer2, position2, title, html) {
  121697. if (!viewer2)
  121698. throw new Cesium.DeveloperError("no viewer object!");
  121699. if (!position2)
  121700. throw new Cesium.DeveloperError("no position object!");
  121701. this.viewer = viewer2;
  121702. this.position = position2;
  121703. if (position2 instanceof Cesium.Cartesian3) {
  121704. this.position = position2;
  121705. } else {
  121706. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121707. }
  121708. if (document.getElementsByClassName("popup3").length > 0) {
  121709. document.getElementsByClassName("popup3")[0].remove();
  121710. }
  121711. this.id = "popup_" + getGuid();
  121712. this.popupDiv = document.createElement("div");
  121713. this.popupDiv.classList.add("popup3");
  121714. this.popupDiv.id = this.id;
  121715. this.viewer.container.append(this.popupDiv);
  121716. this.popupDiv.innerHTML = this._createHtml(title, html);
  121717. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121718. document.getElementsByClassName("popup3-close-button")[0].onclick = () => {
  121719. this.close();
  121720. };
  121721. }
  121722. postRender() {
  121723. this.viewer.scene.canvas.height;
  121724. const windowPosition = new Cesium.Cartesian2();
  121725. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121726. this.viewer.scene,
  121727. this.position,
  121728. windowPosition
  121729. );
  121730. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121731. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121732. const camerPosition = this.viewer.camera.position;
  121733. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121734. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121735. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121736. this.popupDiv.style.display = "block";
  121737. } else {
  121738. this.popupDiv.style.display = "none";
  121739. }
  121740. }
  121741. _createHtml(title, content) {
  121742. let html = `
  121743. <div class="leftLine-1"></div>
  121744. <div class="leftLine-2"></div>
  121745. <div class="popup-header">
  121746. <span class="popup-title" >${title}</span>
  121747. <span class="popup3-close-button" title="\u5173\u95ED" >\xD7</span>
  121748. </div>
  121749. <div class="popup-content">
  121750. ${content}
  121751. </div>
  121752. `;
  121753. return html;
  121754. }
  121755. }
  121756. Object.assign(HtmlWindow3.prototype, {
  121757. close() {
  121758. this.popupDiv.remove();
  121759. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121760. }
  121761. });
  121762. let PopupWindow = {
  121763. MultiFieldAdaptWindow,
  121764. VideoWindow,
  121765. VideoWindow2,
  121766. VideoWindow3,
  121767. HtmlWindow,
  121768. HtmlWindow2,
  121769. HtmlWindow3
  121770. };
  121771. class AroundPoint {
  121772. constructor(viewer2, amount, position2) {
  121773. this._viewer = viewer2;
  121774. this._amount = amount;
  121775. this._position = position2;
  121776. this._range = this._viewer.camera.positionCartographic.height;
  121777. }
  121778. _bindEvent() {
  121779. let _self = this;
  121780. this._viewer.clock.onTick.addEventListener(this._aroundPoint, this);
  121781. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121782. handler.setInputAction(function(click) {
  121783. _self.stop();
  121784. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121785. }
  121786. _unbindEvent() {
  121787. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121788. this._viewer.clock.onTick.removeEventListener(this._aroundPoint, this);
  121789. }
  121790. start() {
  121791. this._viewer.clock.shouldAnimate = true;
  121792. this._unbindEvent();
  121793. this._bindEvent();
  121794. return this;
  121795. }
  121796. stop() {
  121797. this._unbindEvent();
  121798. return this;
  121799. }
  121800. _aroundPoint() {
  121801. let heading = this._viewer.camera.heading;
  121802. let pitch = this._viewer.camera.pitch;
  121803. let range3 = this._range;
  121804. heading += Cesium.Math.toRadians(this._amount);
  121805. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121806. heading = 0;
  121807. }
  121808. this._viewer.camera.lookAt(
  121809. this._position,
  121810. new Cesium.HeadingPitchRange(
  121811. heading,
  121812. pitch,
  121813. range3
  121814. )
  121815. );
  121816. }
  121817. }
  121818. class AroundView {
  121819. constructor(viewer2, amount) {
  121820. this._viewer = viewer2;
  121821. this._amount = amount;
  121822. }
  121823. _bindEvent() {
  121824. let _self = this;
  121825. this._viewer.clock.onTick.addEventListener(this._aroundView, this);
  121826. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121827. handler.setInputAction(function(click) {
  121828. _self.stop();
  121829. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121830. }
  121831. _unbindEvent() {
  121832. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121833. this._viewer.clock.onTick.removeEventListener(this._aroundView, this);
  121834. }
  121835. start() {
  121836. this._viewer.clock.shouldAnimate = true;
  121837. this._unbindEvent();
  121838. this._bindEvent();
  121839. return this;
  121840. }
  121841. stop() {
  121842. this._unbindEvent();
  121843. return this;
  121844. }
  121845. _aroundView() {
  121846. let heading = this._viewer.camera.heading;
  121847. let pitch = this._viewer.camera.pitch;
  121848. let roll = this._viewer.camera.roll;
  121849. heading += Cesium.Math.toRadians(this._amount);
  121850. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121851. heading = 0;
  121852. }
  121853. this._viewer.camera.setView({
  121854. orientation: {
  121855. heading,
  121856. pitch,
  121857. roll
  121858. }
  121859. });
  121860. }
  121861. }
  121862. export { AroundPoint, AroundView, CircleObject, CommonTools, CoordTransform, CrImageServerLayer, DrawMilitaryPlot, DrawPoint, DrawTools, LocateUtil, PointObject, PolygonObject, PolylineObject, PopupWindow, CreateRemindertip as ReminderTip, Roaming, RuntimeEnvironment, SceneControl, SceneEffects, SketchViewModel, SpatialAnalysis, StatusBar, TerrainAnalysis, TrackRoam, WallObject, common, jtMap3d, LoadMapData as layer };