vue.runtime.global.js 390 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693
  1. /**
  2. * vue v3.5.26
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. var Vue = (function (exports) {
  7. 'use strict';
  8. // @__NO_SIDE_EFFECTS__
  9. function makeMap(str) {
  10. const map = /* @__PURE__ */ Object.create(null);
  11. for (const key of str.split(",")) map[key] = 1;
  12. return (val) => val in map;
  13. }
  14. const EMPTY_OBJ = Object.freeze({}) ;
  15. const EMPTY_ARR = Object.freeze([]) ;
  16. const NOOP = () => {
  17. };
  18. const NO = () => false;
  19. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  20. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  21. const isModelListener = (key) => key.startsWith("onUpdate:");
  22. const extend = Object.assign;
  23. const remove = (arr, el) => {
  24. const i = arr.indexOf(el);
  25. if (i > -1) {
  26. arr.splice(i, 1);
  27. }
  28. };
  29. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  30. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  31. const isArray = Array.isArray;
  32. const isMap = (val) => toTypeString(val) === "[object Map]";
  33. const isSet = (val) => toTypeString(val) === "[object Set]";
  34. const isDate = (val) => toTypeString(val) === "[object Date]";
  35. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  36. const isFunction = (val) => typeof val === "function";
  37. const isString = (val) => typeof val === "string";
  38. const isSymbol = (val) => typeof val === "symbol";
  39. const isObject = (val) => val !== null && typeof val === "object";
  40. const isPromise = (val) => {
  41. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  42. };
  43. const objectToString = Object.prototype.toString;
  44. const toTypeString = (value) => objectToString.call(value);
  45. const toRawType = (value) => {
  46. return toTypeString(value).slice(8, -1);
  47. };
  48. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  49. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  50. const isReservedProp = /* @__PURE__ */ makeMap(
  51. // the leading comma is intentional so empty string "" is also included
  52. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  53. );
  54. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  55. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  56. );
  57. const cacheStringFunction = (fn) => {
  58. const cache = /* @__PURE__ */ Object.create(null);
  59. return ((str) => {
  60. const hit = cache[str];
  61. return hit || (cache[str] = fn(str));
  62. });
  63. };
  64. const camelizeRE = /-\w/g;
  65. const camelize = cacheStringFunction(
  66. (str) => {
  67. return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
  68. }
  69. );
  70. const hyphenateRE = /\B([A-Z])/g;
  71. const hyphenate = cacheStringFunction(
  72. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  73. );
  74. const capitalize = cacheStringFunction((str) => {
  75. return str.charAt(0).toUpperCase() + str.slice(1);
  76. });
  77. const toHandlerKey = cacheStringFunction(
  78. (str) => {
  79. const s = str ? `on${capitalize(str)}` : ``;
  80. return s;
  81. }
  82. );
  83. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  84. const invokeArrayFns = (fns, ...arg) => {
  85. for (let i = 0; i < fns.length; i++) {
  86. fns[i](...arg);
  87. }
  88. };
  89. const def = (obj, key, value, writable = false) => {
  90. Object.defineProperty(obj, key, {
  91. configurable: true,
  92. enumerable: false,
  93. writable,
  94. value
  95. });
  96. };
  97. const looseToNumber = (val) => {
  98. const n = parseFloat(val);
  99. return isNaN(n) ? val : n;
  100. };
  101. const toNumber = (val) => {
  102. const n = isString(val) ? Number(val) : NaN;
  103. return isNaN(n) ? val : n;
  104. };
  105. let _globalThis;
  106. const getGlobalThis = () => {
  107. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  108. };
  109. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
  110. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  111. function normalizeStyle(value) {
  112. if (isArray(value)) {
  113. const res = {};
  114. for (let i = 0; i < value.length; i++) {
  115. const item = value[i];
  116. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  117. if (normalized) {
  118. for (const key in normalized) {
  119. res[key] = normalized[key];
  120. }
  121. }
  122. }
  123. return res;
  124. } else if (isString(value) || isObject(value)) {
  125. return value;
  126. }
  127. }
  128. const listDelimiterRE = /;(?![^(]*\))/g;
  129. const propertyDelimiterRE = /:([^]+)/;
  130. const styleCommentRE = /\/\*[^]*?\*\//g;
  131. function parseStringStyle(cssText) {
  132. const ret = {};
  133. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  134. if (item) {
  135. const tmp = item.split(propertyDelimiterRE);
  136. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  137. }
  138. });
  139. return ret;
  140. }
  141. function stringifyStyle(styles) {
  142. if (!styles) return "";
  143. if (isString(styles)) return styles;
  144. let ret = "";
  145. for (const key in styles) {
  146. const value = styles[key];
  147. if (isString(value) || typeof value === "number") {
  148. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  149. ret += `${normalizedKey}:${value};`;
  150. }
  151. }
  152. return ret;
  153. }
  154. function normalizeClass(value) {
  155. let res = "";
  156. if (isString(value)) {
  157. res = value;
  158. } else if (isArray(value)) {
  159. for (let i = 0; i < value.length; i++) {
  160. const normalized = normalizeClass(value[i]);
  161. if (normalized) {
  162. res += normalized + " ";
  163. }
  164. }
  165. } else if (isObject(value)) {
  166. for (const name in value) {
  167. if (value[name]) {
  168. res += name + " ";
  169. }
  170. }
  171. }
  172. return res.trim();
  173. }
  174. function normalizeProps(props) {
  175. if (!props) return null;
  176. let { class: klass, style } = props;
  177. if (klass && !isString(klass)) {
  178. props.class = normalizeClass(klass);
  179. }
  180. if (style) {
  181. props.style = normalizeStyle(style);
  182. }
  183. return props;
  184. }
  185. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  186. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  187. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  188. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  189. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  190. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  191. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  192. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  193. const isBooleanAttr = /* @__PURE__ */ makeMap(
  194. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  195. );
  196. function includeBooleanAttr(value) {
  197. return !!value || value === "";
  198. }
  199. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  200. `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
  201. );
  202. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  203. `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  204. );
  205. function isRenderableAttrValue(value) {
  206. if (value == null) {
  207. return false;
  208. }
  209. const type = typeof value;
  210. return type === "string" || type === "number" || type === "boolean";
  211. }
  212. const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
  213. function getEscapedCssVarName(key, doubleEscape) {
  214. return key.replace(
  215. cssVarNameEscapeSymbolsRE,
  216. (s) => `\\${s}`
  217. );
  218. }
  219. function looseCompareArrays(a, b) {
  220. if (a.length !== b.length) return false;
  221. let equal = true;
  222. for (let i = 0; equal && i < a.length; i++) {
  223. equal = looseEqual(a[i], b[i]);
  224. }
  225. return equal;
  226. }
  227. function looseEqual(a, b) {
  228. if (a === b) return true;
  229. let aValidType = isDate(a);
  230. let bValidType = isDate(b);
  231. if (aValidType || bValidType) {
  232. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  233. }
  234. aValidType = isSymbol(a);
  235. bValidType = isSymbol(b);
  236. if (aValidType || bValidType) {
  237. return a === b;
  238. }
  239. aValidType = isArray(a);
  240. bValidType = isArray(b);
  241. if (aValidType || bValidType) {
  242. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  243. }
  244. aValidType = isObject(a);
  245. bValidType = isObject(b);
  246. if (aValidType || bValidType) {
  247. if (!aValidType || !bValidType) {
  248. return false;
  249. }
  250. const aKeysCount = Object.keys(a).length;
  251. const bKeysCount = Object.keys(b).length;
  252. if (aKeysCount !== bKeysCount) {
  253. return false;
  254. }
  255. for (const key in a) {
  256. const aHasKey = a.hasOwnProperty(key);
  257. const bHasKey = b.hasOwnProperty(key);
  258. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  259. return false;
  260. }
  261. }
  262. }
  263. return String(a) === String(b);
  264. }
  265. function looseIndexOf(arr, val) {
  266. return arr.findIndex((item) => looseEqual(item, val));
  267. }
  268. const isRef$1 = (val) => {
  269. return !!(val && val["__v_isRef"] === true);
  270. };
  271. const toDisplayString = (val) => {
  272. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  273. };
  274. const replacer = (_key, val) => {
  275. if (isRef$1(val)) {
  276. return replacer(_key, val.value);
  277. } else if (isMap(val)) {
  278. return {
  279. [`Map(${val.size})`]: [...val.entries()].reduce(
  280. (entries, [key, val2], i) => {
  281. entries[stringifySymbol(key, i) + " =>"] = val2;
  282. return entries;
  283. },
  284. {}
  285. )
  286. };
  287. } else if (isSet(val)) {
  288. return {
  289. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  290. };
  291. } else if (isSymbol(val)) {
  292. return stringifySymbol(val);
  293. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  294. return String(val);
  295. }
  296. return val;
  297. };
  298. const stringifySymbol = (v, i = "") => {
  299. var _a;
  300. return (
  301. // Symbol.description in es2019+ so we need to cast here to pass
  302. // the lib: es2016 check
  303. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  304. );
  305. };
  306. function normalizeCssVarValue(value) {
  307. if (value == null) {
  308. return "initial";
  309. }
  310. if (typeof value === "string") {
  311. return value === "" ? " " : value;
  312. }
  313. if (typeof value !== "number" || !Number.isFinite(value)) {
  314. {
  315. console.warn(
  316. "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
  317. value
  318. );
  319. }
  320. }
  321. return String(value);
  322. }
  323. function warn$2(msg, ...args) {
  324. console.warn(`[Vue warn] ${msg}`, ...args);
  325. }
  326. let activeEffectScope;
  327. class EffectScope {
  328. constructor(detached = false) {
  329. this.detached = detached;
  330. /**
  331. * @internal
  332. */
  333. this._active = true;
  334. /**
  335. * @internal track `on` calls, allow `on` call multiple times
  336. */
  337. this._on = 0;
  338. /**
  339. * @internal
  340. */
  341. this.effects = [];
  342. /**
  343. * @internal
  344. */
  345. this.cleanups = [];
  346. this._isPaused = false;
  347. this.parent = activeEffectScope;
  348. if (!detached && activeEffectScope) {
  349. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  350. this
  351. ) - 1;
  352. }
  353. }
  354. get active() {
  355. return this._active;
  356. }
  357. pause() {
  358. if (this._active) {
  359. this._isPaused = true;
  360. let i, l;
  361. if (this.scopes) {
  362. for (i = 0, l = this.scopes.length; i < l; i++) {
  363. this.scopes[i].pause();
  364. }
  365. }
  366. for (i = 0, l = this.effects.length; i < l; i++) {
  367. this.effects[i].pause();
  368. }
  369. }
  370. }
  371. /**
  372. * Resumes the effect scope, including all child scopes and effects.
  373. */
  374. resume() {
  375. if (this._active) {
  376. if (this._isPaused) {
  377. this._isPaused = false;
  378. let i, l;
  379. if (this.scopes) {
  380. for (i = 0, l = this.scopes.length; i < l; i++) {
  381. this.scopes[i].resume();
  382. }
  383. }
  384. for (i = 0, l = this.effects.length; i < l; i++) {
  385. this.effects[i].resume();
  386. }
  387. }
  388. }
  389. }
  390. run(fn) {
  391. if (this._active) {
  392. const currentEffectScope = activeEffectScope;
  393. try {
  394. activeEffectScope = this;
  395. return fn();
  396. } finally {
  397. activeEffectScope = currentEffectScope;
  398. }
  399. } else {
  400. warn$2(`cannot run an inactive effect scope.`);
  401. }
  402. }
  403. /**
  404. * This should only be called on non-detached scopes
  405. * @internal
  406. */
  407. on() {
  408. if (++this._on === 1) {
  409. this.prevScope = activeEffectScope;
  410. activeEffectScope = this;
  411. }
  412. }
  413. /**
  414. * This should only be called on non-detached scopes
  415. * @internal
  416. */
  417. off() {
  418. if (this._on > 0 && --this._on === 0) {
  419. activeEffectScope = this.prevScope;
  420. this.prevScope = void 0;
  421. }
  422. }
  423. stop(fromParent) {
  424. if (this._active) {
  425. this._active = false;
  426. let i, l;
  427. for (i = 0, l = this.effects.length; i < l; i++) {
  428. this.effects[i].stop();
  429. }
  430. this.effects.length = 0;
  431. for (i = 0, l = this.cleanups.length; i < l; i++) {
  432. this.cleanups[i]();
  433. }
  434. this.cleanups.length = 0;
  435. if (this.scopes) {
  436. for (i = 0, l = this.scopes.length; i < l; i++) {
  437. this.scopes[i].stop(true);
  438. }
  439. this.scopes.length = 0;
  440. }
  441. if (!this.detached && this.parent && !fromParent) {
  442. const last = this.parent.scopes.pop();
  443. if (last && last !== this) {
  444. this.parent.scopes[this.index] = last;
  445. last.index = this.index;
  446. }
  447. }
  448. this.parent = void 0;
  449. }
  450. }
  451. }
  452. function effectScope(detached) {
  453. return new EffectScope(detached);
  454. }
  455. function getCurrentScope() {
  456. return activeEffectScope;
  457. }
  458. function onScopeDispose(fn, failSilently = false) {
  459. if (activeEffectScope) {
  460. activeEffectScope.cleanups.push(fn);
  461. } else if (!failSilently) {
  462. warn$2(
  463. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  464. );
  465. }
  466. }
  467. let activeSub;
  468. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  469. class ReactiveEffect {
  470. constructor(fn) {
  471. this.fn = fn;
  472. /**
  473. * @internal
  474. */
  475. this.deps = void 0;
  476. /**
  477. * @internal
  478. */
  479. this.depsTail = void 0;
  480. /**
  481. * @internal
  482. */
  483. this.flags = 1 | 4;
  484. /**
  485. * @internal
  486. */
  487. this.next = void 0;
  488. /**
  489. * @internal
  490. */
  491. this.cleanup = void 0;
  492. this.scheduler = void 0;
  493. if (activeEffectScope && activeEffectScope.active) {
  494. activeEffectScope.effects.push(this);
  495. }
  496. }
  497. pause() {
  498. this.flags |= 64;
  499. }
  500. resume() {
  501. if (this.flags & 64) {
  502. this.flags &= -65;
  503. if (pausedQueueEffects.has(this)) {
  504. pausedQueueEffects.delete(this);
  505. this.trigger();
  506. }
  507. }
  508. }
  509. /**
  510. * @internal
  511. */
  512. notify() {
  513. if (this.flags & 2 && !(this.flags & 32)) {
  514. return;
  515. }
  516. if (!(this.flags & 8)) {
  517. batch(this);
  518. }
  519. }
  520. run() {
  521. if (!(this.flags & 1)) {
  522. return this.fn();
  523. }
  524. this.flags |= 2;
  525. cleanupEffect(this);
  526. prepareDeps(this);
  527. const prevEffect = activeSub;
  528. const prevShouldTrack = shouldTrack;
  529. activeSub = this;
  530. shouldTrack = true;
  531. try {
  532. return this.fn();
  533. } finally {
  534. if (activeSub !== this) {
  535. warn$2(
  536. "Active effect was not restored correctly - this is likely a Vue internal bug."
  537. );
  538. }
  539. cleanupDeps(this);
  540. activeSub = prevEffect;
  541. shouldTrack = prevShouldTrack;
  542. this.flags &= -3;
  543. }
  544. }
  545. stop() {
  546. if (this.flags & 1) {
  547. for (let link = this.deps; link; link = link.nextDep) {
  548. removeSub(link);
  549. }
  550. this.deps = this.depsTail = void 0;
  551. cleanupEffect(this);
  552. this.onStop && this.onStop();
  553. this.flags &= -2;
  554. }
  555. }
  556. trigger() {
  557. if (this.flags & 64) {
  558. pausedQueueEffects.add(this);
  559. } else if (this.scheduler) {
  560. this.scheduler();
  561. } else {
  562. this.runIfDirty();
  563. }
  564. }
  565. /**
  566. * @internal
  567. */
  568. runIfDirty() {
  569. if (isDirty(this)) {
  570. this.run();
  571. }
  572. }
  573. get dirty() {
  574. return isDirty(this);
  575. }
  576. }
  577. let batchDepth = 0;
  578. let batchedSub;
  579. let batchedComputed;
  580. function batch(sub, isComputed = false) {
  581. sub.flags |= 8;
  582. if (isComputed) {
  583. sub.next = batchedComputed;
  584. batchedComputed = sub;
  585. return;
  586. }
  587. sub.next = batchedSub;
  588. batchedSub = sub;
  589. }
  590. function startBatch() {
  591. batchDepth++;
  592. }
  593. function endBatch() {
  594. if (--batchDepth > 0) {
  595. return;
  596. }
  597. if (batchedComputed) {
  598. let e = batchedComputed;
  599. batchedComputed = void 0;
  600. while (e) {
  601. const next = e.next;
  602. e.next = void 0;
  603. e.flags &= -9;
  604. e = next;
  605. }
  606. }
  607. let error;
  608. while (batchedSub) {
  609. let e = batchedSub;
  610. batchedSub = void 0;
  611. while (e) {
  612. const next = e.next;
  613. e.next = void 0;
  614. e.flags &= -9;
  615. if (e.flags & 1) {
  616. try {
  617. ;
  618. e.trigger();
  619. } catch (err) {
  620. if (!error) error = err;
  621. }
  622. }
  623. e = next;
  624. }
  625. }
  626. if (error) throw error;
  627. }
  628. function prepareDeps(sub) {
  629. for (let link = sub.deps; link; link = link.nextDep) {
  630. link.version = -1;
  631. link.prevActiveLink = link.dep.activeLink;
  632. link.dep.activeLink = link;
  633. }
  634. }
  635. function cleanupDeps(sub) {
  636. let head;
  637. let tail = sub.depsTail;
  638. let link = tail;
  639. while (link) {
  640. const prev = link.prevDep;
  641. if (link.version === -1) {
  642. if (link === tail) tail = prev;
  643. removeSub(link);
  644. removeDep(link);
  645. } else {
  646. head = link;
  647. }
  648. link.dep.activeLink = link.prevActiveLink;
  649. link.prevActiveLink = void 0;
  650. link = prev;
  651. }
  652. sub.deps = head;
  653. sub.depsTail = tail;
  654. }
  655. function isDirty(sub) {
  656. for (let link = sub.deps; link; link = link.nextDep) {
  657. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  658. return true;
  659. }
  660. }
  661. if (sub._dirty) {
  662. return true;
  663. }
  664. return false;
  665. }
  666. function refreshComputed(computed) {
  667. if (computed.flags & 4 && !(computed.flags & 16)) {
  668. return;
  669. }
  670. computed.flags &= -17;
  671. if (computed.globalVersion === globalVersion) {
  672. return;
  673. }
  674. computed.globalVersion = globalVersion;
  675. if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
  676. return;
  677. }
  678. computed.flags |= 2;
  679. const dep = computed.dep;
  680. const prevSub = activeSub;
  681. const prevShouldTrack = shouldTrack;
  682. activeSub = computed;
  683. shouldTrack = true;
  684. try {
  685. prepareDeps(computed);
  686. const value = computed.fn(computed._value);
  687. if (dep.version === 0 || hasChanged(value, computed._value)) {
  688. computed.flags |= 128;
  689. computed._value = value;
  690. dep.version++;
  691. }
  692. } catch (err) {
  693. dep.version++;
  694. throw err;
  695. } finally {
  696. activeSub = prevSub;
  697. shouldTrack = prevShouldTrack;
  698. cleanupDeps(computed);
  699. computed.flags &= -3;
  700. }
  701. }
  702. function removeSub(link, soft = false) {
  703. const { dep, prevSub, nextSub } = link;
  704. if (prevSub) {
  705. prevSub.nextSub = nextSub;
  706. link.prevSub = void 0;
  707. }
  708. if (nextSub) {
  709. nextSub.prevSub = prevSub;
  710. link.nextSub = void 0;
  711. }
  712. if (dep.subsHead === link) {
  713. dep.subsHead = nextSub;
  714. }
  715. if (dep.subs === link) {
  716. dep.subs = prevSub;
  717. if (!prevSub && dep.computed) {
  718. dep.computed.flags &= -5;
  719. for (let l = dep.computed.deps; l; l = l.nextDep) {
  720. removeSub(l, true);
  721. }
  722. }
  723. }
  724. if (!soft && !--dep.sc && dep.map) {
  725. dep.map.delete(dep.key);
  726. }
  727. }
  728. function removeDep(link) {
  729. const { prevDep, nextDep } = link;
  730. if (prevDep) {
  731. prevDep.nextDep = nextDep;
  732. link.prevDep = void 0;
  733. }
  734. if (nextDep) {
  735. nextDep.prevDep = prevDep;
  736. link.nextDep = void 0;
  737. }
  738. }
  739. function effect(fn, options) {
  740. if (fn.effect instanceof ReactiveEffect) {
  741. fn = fn.effect.fn;
  742. }
  743. const e = new ReactiveEffect(fn);
  744. if (options) {
  745. extend(e, options);
  746. }
  747. try {
  748. e.run();
  749. } catch (err) {
  750. e.stop();
  751. throw err;
  752. }
  753. const runner = e.run.bind(e);
  754. runner.effect = e;
  755. return runner;
  756. }
  757. function stop(runner) {
  758. runner.effect.stop();
  759. }
  760. let shouldTrack = true;
  761. const trackStack = [];
  762. function pauseTracking() {
  763. trackStack.push(shouldTrack);
  764. shouldTrack = false;
  765. }
  766. function resetTracking() {
  767. const last = trackStack.pop();
  768. shouldTrack = last === void 0 ? true : last;
  769. }
  770. function cleanupEffect(e) {
  771. const { cleanup } = e;
  772. e.cleanup = void 0;
  773. if (cleanup) {
  774. const prevSub = activeSub;
  775. activeSub = void 0;
  776. try {
  777. cleanup();
  778. } finally {
  779. activeSub = prevSub;
  780. }
  781. }
  782. }
  783. let globalVersion = 0;
  784. class Link {
  785. constructor(sub, dep) {
  786. this.sub = sub;
  787. this.dep = dep;
  788. this.version = dep.version;
  789. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  790. }
  791. }
  792. class Dep {
  793. // TODO isolatedDeclarations "__v_skip"
  794. constructor(computed) {
  795. this.computed = computed;
  796. this.version = 0;
  797. /**
  798. * Link between this dep and the current active effect
  799. */
  800. this.activeLink = void 0;
  801. /**
  802. * Doubly linked list representing the subscribing effects (tail)
  803. */
  804. this.subs = void 0;
  805. /**
  806. * For object property deps cleanup
  807. */
  808. this.map = void 0;
  809. this.key = void 0;
  810. /**
  811. * Subscriber counter
  812. */
  813. this.sc = 0;
  814. /**
  815. * @internal
  816. */
  817. this.__v_skip = true;
  818. {
  819. this.subsHead = void 0;
  820. }
  821. }
  822. track(debugInfo) {
  823. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  824. return;
  825. }
  826. let link = this.activeLink;
  827. if (link === void 0 || link.sub !== activeSub) {
  828. link = this.activeLink = new Link(activeSub, this);
  829. if (!activeSub.deps) {
  830. activeSub.deps = activeSub.depsTail = link;
  831. } else {
  832. link.prevDep = activeSub.depsTail;
  833. activeSub.depsTail.nextDep = link;
  834. activeSub.depsTail = link;
  835. }
  836. addSub(link);
  837. } else if (link.version === -1) {
  838. link.version = this.version;
  839. if (link.nextDep) {
  840. const next = link.nextDep;
  841. next.prevDep = link.prevDep;
  842. if (link.prevDep) {
  843. link.prevDep.nextDep = next;
  844. }
  845. link.prevDep = activeSub.depsTail;
  846. link.nextDep = void 0;
  847. activeSub.depsTail.nextDep = link;
  848. activeSub.depsTail = link;
  849. if (activeSub.deps === link) {
  850. activeSub.deps = next;
  851. }
  852. }
  853. }
  854. if (activeSub.onTrack) {
  855. activeSub.onTrack(
  856. extend(
  857. {
  858. effect: activeSub
  859. },
  860. debugInfo
  861. )
  862. );
  863. }
  864. return link;
  865. }
  866. trigger(debugInfo) {
  867. this.version++;
  868. globalVersion++;
  869. this.notify(debugInfo);
  870. }
  871. notify(debugInfo) {
  872. startBatch();
  873. try {
  874. if (true) {
  875. for (let head = this.subsHead; head; head = head.nextSub) {
  876. if (head.sub.onTrigger && !(head.sub.flags & 8)) {
  877. head.sub.onTrigger(
  878. extend(
  879. {
  880. effect: head.sub
  881. },
  882. debugInfo
  883. )
  884. );
  885. }
  886. }
  887. }
  888. for (let link = this.subs; link; link = link.prevSub) {
  889. if (link.sub.notify()) {
  890. ;
  891. link.sub.dep.notify();
  892. }
  893. }
  894. } finally {
  895. endBatch();
  896. }
  897. }
  898. }
  899. function addSub(link) {
  900. link.dep.sc++;
  901. if (link.sub.flags & 4) {
  902. const computed = link.dep.computed;
  903. if (computed && !link.dep.subs) {
  904. computed.flags |= 4 | 16;
  905. for (let l = computed.deps; l; l = l.nextDep) {
  906. addSub(l);
  907. }
  908. }
  909. const currentTail = link.dep.subs;
  910. if (currentTail !== link) {
  911. link.prevSub = currentTail;
  912. if (currentTail) currentTail.nextSub = link;
  913. }
  914. if (link.dep.subsHead === void 0) {
  915. link.dep.subsHead = link;
  916. }
  917. link.dep.subs = link;
  918. }
  919. }
  920. const targetMap = /* @__PURE__ */ new WeakMap();
  921. const ITERATE_KEY = /* @__PURE__ */ Symbol(
  922. "Object iterate"
  923. );
  924. const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  925. "Map keys iterate"
  926. );
  927. const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  928. "Array iterate"
  929. );
  930. function track(target, type, key) {
  931. if (shouldTrack && activeSub) {
  932. let depsMap = targetMap.get(target);
  933. if (!depsMap) {
  934. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  935. }
  936. let dep = depsMap.get(key);
  937. if (!dep) {
  938. depsMap.set(key, dep = new Dep());
  939. dep.map = depsMap;
  940. dep.key = key;
  941. }
  942. {
  943. dep.track({
  944. target,
  945. type,
  946. key
  947. });
  948. }
  949. }
  950. }
  951. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  952. const depsMap = targetMap.get(target);
  953. if (!depsMap) {
  954. globalVersion++;
  955. return;
  956. }
  957. const run = (dep) => {
  958. if (dep) {
  959. {
  960. dep.trigger({
  961. target,
  962. type,
  963. key,
  964. newValue,
  965. oldValue,
  966. oldTarget
  967. });
  968. }
  969. }
  970. };
  971. startBatch();
  972. if (type === "clear") {
  973. depsMap.forEach(run);
  974. } else {
  975. const targetIsArray = isArray(target);
  976. const isArrayIndex = targetIsArray && isIntegerKey(key);
  977. if (targetIsArray && key === "length") {
  978. const newLength = Number(newValue);
  979. depsMap.forEach((dep, key2) => {
  980. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
  981. run(dep);
  982. }
  983. });
  984. } else {
  985. if (key !== void 0 || depsMap.has(void 0)) {
  986. run(depsMap.get(key));
  987. }
  988. if (isArrayIndex) {
  989. run(depsMap.get(ARRAY_ITERATE_KEY));
  990. }
  991. switch (type) {
  992. case "add":
  993. if (!targetIsArray) {
  994. run(depsMap.get(ITERATE_KEY));
  995. if (isMap(target)) {
  996. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  997. }
  998. } else if (isArrayIndex) {
  999. run(depsMap.get("length"));
  1000. }
  1001. break;
  1002. case "delete":
  1003. if (!targetIsArray) {
  1004. run(depsMap.get(ITERATE_KEY));
  1005. if (isMap(target)) {
  1006. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  1007. }
  1008. }
  1009. break;
  1010. case "set":
  1011. if (isMap(target)) {
  1012. run(depsMap.get(ITERATE_KEY));
  1013. }
  1014. break;
  1015. }
  1016. }
  1017. }
  1018. endBatch();
  1019. }
  1020. function getDepFromReactive(object, key) {
  1021. const depMap = targetMap.get(object);
  1022. return depMap && depMap.get(key);
  1023. }
  1024. function reactiveReadArray(array) {
  1025. const raw = toRaw(array);
  1026. if (raw === array) return raw;
  1027. track(raw, "iterate", ARRAY_ITERATE_KEY);
  1028. return isShallow(array) ? raw : raw.map(toReactive);
  1029. }
  1030. function shallowReadArray(arr) {
  1031. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  1032. return arr;
  1033. }
  1034. function toWrapped(target, item) {
  1035. if (isReadonly(target)) {
  1036. return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
  1037. }
  1038. return toReactive(item);
  1039. }
  1040. const arrayInstrumentations = {
  1041. __proto__: null,
  1042. [Symbol.iterator]() {
  1043. return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
  1044. },
  1045. concat(...args) {
  1046. return reactiveReadArray(this).concat(
  1047. ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
  1048. );
  1049. },
  1050. entries() {
  1051. return iterator(this, "entries", (value) => {
  1052. value[1] = toWrapped(this, value[1]);
  1053. return value;
  1054. });
  1055. },
  1056. every(fn, thisArg) {
  1057. return apply(this, "every", fn, thisArg, void 0, arguments);
  1058. },
  1059. filter(fn, thisArg) {
  1060. return apply(
  1061. this,
  1062. "filter",
  1063. fn,
  1064. thisArg,
  1065. (v) => v.map((item) => toWrapped(this, item)),
  1066. arguments
  1067. );
  1068. },
  1069. find(fn, thisArg) {
  1070. return apply(
  1071. this,
  1072. "find",
  1073. fn,
  1074. thisArg,
  1075. (item) => toWrapped(this, item),
  1076. arguments
  1077. );
  1078. },
  1079. findIndex(fn, thisArg) {
  1080. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  1081. },
  1082. findLast(fn, thisArg) {
  1083. return apply(
  1084. this,
  1085. "findLast",
  1086. fn,
  1087. thisArg,
  1088. (item) => toWrapped(this, item),
  1089. arguments
  1090. );
  1091. },
  1092. findLastIndex(fn, thisArg) {
  1093. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  1094. },
  1095. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  1096. forEach(fn, thisArg) {
  1097. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  1098. },
  1099. includes(...args) {
  1100. return searchProxy(this, "includes", args);
  1101. },
  1102. indexOf(...args) {
  1103. return searchProxy(this, "indexOf", args);
  1104. },
  1105. join(separator) {
  1106. return reactiveReadArray(this).join(separator);
  1107. },
  1108. // keys() iterator only reads `length`, no optimization required
  1109. lastIndexOf(...args) {
  1110. return searchProxy(this, "lastIndexOf", args);
  1111. },
  1112. map(fn, thisArg) {
  1113. return apply(this, "map", fn, thisArg, void 0, arguments);
  1114. },
  1115. pop() {
  1116. return noTracking(this, "pop");
  1117. },
  1118. push(...args) {
  1119. return noTracking(this, "push", args);
  1120. },
  1121. reduce(fn, ...args) {
  1122. return reduce(this, "reduce", fn, args);
  1123. },
  1124. reduceRight(fn, ...args) {
  1125. return reduce(this, "reduceRight", fn, args);
  1126. },
  1127. shift() {
  1128. return noTracking(this, "shift");
  1129. },
  1130. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  1131. some(fn, thisArg) {
  1132. return apply(this, "some", fn, thisArg, void 0, arguments);
  1133. },
  1134. splice(...args) {
  1135. return noTracking(this, "splice", args);
  1136. },
  1137. toReversed() {
  1138. return reactiveReadArray(this).toReversed();
  1139. },
  1140. toSorted(comparer) {
  1141. return reactiveReadArray(this).toSorted(comparer);
  1142. },
  1143. toSpliced(...args) {
  1144. return reactiveReadArray(this).toSpliced(...args);
  1145. },
  1146. unshift(...args) {
  1147. return noTracking(this, "unshift", args);
  1148. },
  1149. values() {
  1150. return iterator(this, "values", (item) => toWrapped(this, item));
  1151. }
  1152. };
  1153. function iterator(self, method, wrapValue) {
  1154. const arr = shallowReadArray(self);
  1155. const iter = arr[method]();
  1156. if (arr !== self && !isShallow(self)) {
  1157. iter._next = iter.next;
  1158. iter.next = () => {
  1159. const result = iter._next();
  1160. if (!result.done) {
  1161. result.value = wrapValue(result.value);
  1162. }
  1163. return result;
  1164. };
  1165. }
  1166. return iter;
  1167. }
  1168. const arrayProto = Array.prototype;
  1169. function apply(self, method, fn, thisArg, wrappedRetFn, args) {
  1170. const arr = shallowReadArray(self);
  1171. const needsWrap = arr !== self && !isShallow(self);
  1172. const methodFn = arr[method];
  1173. if (methodFn !== arrayProto[method]) {
  1174. const result2 = methodFn.apply(self, args);
  1175. return needsWrap ? toReactive(result2) : result2;
  1176. }
  1177. let wrappedFn = fn;
  1178. if (arr !== self) {
  1179. if (needsWrap) {
  1180. wrappedFn = function(item, index) {
  1181. return fn.call(this, toWrapped(self, item), index, self);
  1182. };
  1183. } else if (fn.length > 2) {
  1184. wrappedFn = function(item, index) {
  1185. return fn.call(this, item, index, self);
  1186. };
  1187. }
  1188. }
  1189. const result = methodFn.call(arr, wrappedFn, thisArg);
  1190. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  1191. }
  1192. function reduce(self, method, fn, args) {
  1193. const arr = shallowReadArray(self);
  1194. let wrappedFn = fn;
  1195. if (arr !== self) {
  1196. if (!isShallow(self)) {
  1197. wrappedFn = function(acc, item, index) {
  1198. return fn.call(this, acc, toWrapped(self, item), index, self);
  1199. };
  1200. } else if (fn.length > 3) {
  1201. wrappedFn = function(acc, item, index) {
  1202. return fn.call(this, acc, item, index, self);
  1203. };
  1204. }
  1205. }
  1206. return arr[method](wrappedFn, ...args);
  1207. }
  1208. function searchProxy(self, method, args) {
  1209. const arr = toRaw(self);
  1210. track(arr, "iterate", ARRAY_ITERATE_KEY);
  1211. const res = arr[method](...args);
  1212. if ((res === -1 || res === false) && isProxy(args[0])) {
  1213. args[0] = toRaw(args[0]);
  1214. return arr[method](...args);
  1215. }
  1216. return res;
  1217. }
  1218. function noTracking(self, method, args = []) {
  1219. pauseTracking();
  1220. startBatch();
  1221. const res = toRaw(self)[method].apply(self, args);
  1222. endBatch();
  1223. resetTracking();
  1224. return res;
  1225. }
  1226. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1227. const builtInSymbols = new Set(
  1228. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1229. );
  1230. function hasOwnProperty(key) {
  1231. if (!isSymbol(key)) key = String(key);
  1232. const obj = toRaw(this);
  1233. track(obj, "has", key);
  1234. return obj.hasOwnProperty(key);
  1235. }
  1236. class BaseReactiveHandler {
  1237. constructor(_isReadonly = false, _isShallow = false) {
  1238. this._isReadonly = _isReadonly;
  1239. this._isShallow = _isShallow;
  1240. }
  1241. get(target, key, receiver) {
  1242. if (key === "__v_skip") return target["__v_skip"];
  1243. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1244. if (key === "__v_isReactive") {
  1245. return !isReadonly2;
  1246. } else if (key === "__v_isReadonly") {
  1247. return isReadonly2;
  1248. } else if (key === "__v_isShallow") {
  1249. return isShallow2;
  1250. } else if (key === "__v_raw") {
  1251. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1252. // this means the receiver is a user proxy of the reactive proxy
  1253. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1254. return target;
  1255. }
  1256. return;
  1257. }
  1258. const targetIsArray = isArray(target);
  1259. if (!isReadonly2) {
  1260. let fn;
  1261. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1262. return fn;
  1263. }
  1264. if (key === "hasOwnProperty") {
  1265. return hasOwnProperty;
  1266. }
  1267. }
  1268. const res = Reflect.get(
  1269. target,
  1270. key,
  1271. // if this is a proxy wrapping a ref, return methods using the raw ref
  1272. // as receiver so that we don't have to call `toRaw` on the ref in all
  1273. // its class methods
  1274. isRef(target) ? target : receiver
  1275. );
  1276. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1277. return res;
  1278. }
  1279. if (!isReadonly2) {
  1280. track(target, "get", key);
  1281. }
  1282. if (isShallow2) {
  1283. return res;
  1284. }
  1285. if (isRef(res)) {
  1286. const value = targetIsArray && isIntegerKey(key) ? res : res.value;
  1287. return isReadonly2 && isObject(value) ? readonly(value) : value;
  1288. }
  1289. if (isObject(res)) {
  1290. return isReadonly2 ? readonly(res) : reactive(res);
  1291. }
  1292. return res;
  1293. }
  1294. }
  1295. class MutableReactiveHandler extends BaseReactiveHandler {
  1296. constructor(isShallow2 = false) {
  1297. super(false, isShallow2);
  1298. }
  1299. set(target, key, value, receiver) {
  1300. let oldValue = target[key];
  1301. const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
  1302. if (!this._isShallow) {
  1303. const isOldValueReadonly = isReadonly(oldValue);
  1304. if (!isShallow(value) && !isReadonly(value)) {
  1305. oldValue = toRaw(oldValue);
  1306. value = toRaw(value);
  1307. }
  1308. if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
  1309. if (isOldValueReadonly) {
  1310. {
  1311. warn$2(
  1312. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1313. target[key]
  1314. );
  1315. }
  1316. return true;
  1317. } else {
  1318. oldValue.value = value;
  1319. return true;
  1320. }
  1321. }
  1322. }
  1323. const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
  1324. const result = Reflect.set(
  1325. target,
  1326. key,
  1327. value,
  1328. isRef(target) ? target : receiver
  1329. );
  1330. if (target === toRaw(receiver)) {
  1331. if (!hadKey) {
  1332. trigger(target, "add", key, value);
  1333. } else if (hasChanged(value, oldValue)) {
  1334. trigger(target, "set", key, value, oldValue);
  1335. }
  1336. }
  1337. return result;
  1338. }
  1339. deleteProperty(target, key) {
  1340. const hadKey = hasOwn(target, key);
  1341. const oldValue = target[key];
  1342. const result = Reflect.deleteProperty(target, key);
  1343. if (result && hadKey) {
  1344. trigger(target, "delete", key, void 0, oldValue);
  1345. }
  1346. return result;
  1347. }
  1348. has(target, key) {
  1349. const result = Reflect.has(target, key);
  1350. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1351. track(target, "has", key);
  1352. }
  1353. return result;
  1354. }
  1355. ownKeys(target) {
  1356. track(
  1357. target,
  1358. "iterate",
  1359. isArray(target) ? "length" : ITERATE_KEY
  1360. );
  1361. return Reflect.ownKeys(target);
  1362. }
  1363. }
  1364. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1365. constructor(isShallow2 = false) {
  1366. super(true, isShallow2);
  1367. }
  1368. set(target, key) {
  1369. {
  1370. warn$2(
  1371. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1372. target
  1373. );
  1374. }
  1375. return true;
  1376. }
  1377. deleteProperty(target, key) {
  1378. {
  1379. warn$2(
  1380. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1381. target
  1382. );
  1383. }
  1384. return true;
  1385. }
  1386. }
  1387. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1388. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1389. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1390. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1391. const toShallow = (value) => value;
  1392. const getProto = (v) => Reflect.getPrototypeOf(v);
  1393. function createIterableMethod(method, isReadonly2, isShallow2) {
  1394. return function(...args) {
  1395. const target = this["__v_raw"];
  1396. const rawTarget = toRaw(target);
  1397. const targetIsMap = isMap(rawTarget);
  1398. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1399. const isKeyOnly = method === "keys" && targetIsMap;
  1400. const innerIterator = target[method](...args);
  1401. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1402. !isReadonly2 && track(
  1403. rawTarget,
  1404. "iterate",
  1405. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1406. );
  1407. return {
  1408. // iterator protocol
  1409. next() {
  1410. const { value, done } = innerIterator.next();
  1411. return done ? { value, done } : {
  1412. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1413. done
  1414. };
  1415. },
  1416. // iterable protocol
  1417. [Symbol.iterator]() {
  1418. return this;
  1419. }
  1420. };
  1421. };
  1422. }
  1423. function createReadonlyMethod(type) {
  1424. return function(...args) {
  1425. {
  1426. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1427. warn$2(
  1428. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1429. toRaw(this)
  1430. );
  1431. }
  1432. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1433. };
  1434. }
  1435. function createInstrumentations(readonly, shallow) {
  1436. const instrumentations = {
  1437. get(key) {
  1438. const target = this["__v_raw"];
  1439. const rawTarget = toRaw(target);
  1440. const rawKey = toRaw(key);
  1441. if (!readonly) {
  1442. if (hasChanged(key, rawKey)) {
  1443. track(rawTarget, "get", key);
  1444. }
  1445. track(rawTarget, "get", rawKey);
  1446. }
  1447. const { has } = getProto(rawTarget);
  1448. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1449. if (has.call(rawTarget, key)) {
  1450. return wrap(target.get(key));
  1451. } else if (has.call(rawTarget, rawKey)) {
  1452. return wrap(target.get(rawKey));
  1453. } else if (target !== rawTarget) {
  1454. target.get(key);
  1455. }
  1456. },
  1457. get size() {
  1458. const target = this["__v_raw"];
  1459. !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
  1460. return target.size;
  1461. },
  1462. has(key) {
  1463. const target = this["__v_raw"];
  1464. const rawTarget = toRaw(target);
  1465. const rawKey = toRaw(key);
  1466. if (!readonly) {
  1467. if (hasChanged(key, rawKey)) {
  1468. track(rawTarget, "has", key);
  1469. }
  1470. track(rawTarget, "has", rawKey);
  1471. }
  1472. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1473. },
  1474. forEach(callback, thisArg) {
  1475. const observed = this;
  1476. const target = observed["__v_raw"];
  1477. const rawTarget = toRaw(target);
  1478. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1479. !readonly && track(rawTarget, "iterate", ITERATE_KEY);
  1480. return target.forEach((value, key) => {
  1481. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1482. });
  1483. }
  1484. };
  1485. extend(
  1486. instrumentations,
  1487. readonly ? {
  1488. add: createReadonlyMethod("add"),
  1489. set: createReadonlyMethod("set"),
  1490. delete: createReadonlyMethod("delete"),
  1491. clear: createReadonlyMethod("clear")
  1492. } : {
  1493. add(value) {
  1494. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1495. value = toRaw(value);
  1496. }
  1497. const target = toRaw(this);
  1498. const proto = getProto(target);
  1499. const hadKey = proto.has.call(target, value);
  1500. if (!hadKey) {
  1501. target.add(value);
  1502. trigger(target, "add", value, value);
  1503. }
  1504. return this;
  1505. },
  1506. set(key, value) {
  1507. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1508. value = toRaw(value);
  1509. }
  1510. const target = toRaw(this);
  1511. const { has, get } = getProto(target);
  1512. let hadKey = has.call(target, key);
  1513. if (!hadKey) {
  1514. key = toRaw(key);
  1515. hadKey = has.call(target, key);
  1516. } else {
  1517. checkIdentityKeys(target, has, key);
  1518. }
  1519. const oldValue = get.call(target, key);
  1520. target.set(key, value);
  1521. if (!hadKey) {
  1522. trigger(target, "add", key, value);
  1523. } else if (hasChanged(value, oldValue)) {
  1524. trigger(target, "set", key, value, oldValue);
  1525. }
  1526. return this;
  1527. },
  1528. delete(key) {
  1529. const target = toRaw(this);
  1530. const { has, get } = getProto(target);
  1531. let hadKey = has.call(target, key);
  1532. if (!hadKey) {
  1533. key = toRaw(key);
  1534. hadKey = has.call(target, key);
  1535. } else {
  1536. checkIdentityKeys(target, has, key);
  1537. }
  1538. const oldValue = get ? get.call(target, key) : void 0;
  1539. const result = target.delete(key);
  1540. if (hadKey) {
  1541. trigger(target, "delete", key, void 0, oldValue);
  1542. }
  1543. return result;
  1544. },
  1545. clear() {
  1546. const target = toRaw(this);
  1547. const hadItems = target.size !== 0;
  1548. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  1549. const result = target.clear();
  1550. if (hadItems) {
  1551. trigger(
  1552. target,
  1553. "clear",
  1554. void 0,
  1555. void 0,
  1556. oldTarget
  1557. );
  1558. }
  1559. return result;
  1560. }
  1561. }
  1562. );
  1563. const iteratorMethods = [
  1564. "keys",
  1565. "values",
  1566. "entries",
  1567. Symbol.iterator
  1568. ];
  1569. iteratorMethods.forEach((method) => {
  1570. instrumentations[method] = createIterableMethod(method, readonly, shallow);
  1571. });
  1572. return instrumentations;
  1573. }
  1574. function createInstrumentationGetter(isReadonly2, shallow) {
  1575. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1576. return (target, key, receiver) => {
  1577. if (key === "__v_isReactive") {
  1578. return !isReadonly2;
  1579. } else if (key === "__v_isReadonly") {
  1580. return isReadonly2;
  1581. } else if (key === "__v_raw") {
  1582. return target;
  1583. }
  1584. return Reflect.get(
  1585. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1586. key,
  1587. receiver
  1588. );
  1589. };
  1590. }
  1591. const mutableCollectionHandlers = {
  1592. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1593. };
  1594. const shallowCollectionHandlers = {
  1595. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1596. };
  1597. const readonlyCollectionHandlers = {
  1598. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1599. };
  1600. const shallowReadonlyCollectionHandlers = {
  1601. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1602. };
  1603. function checkIdentityKeys(target, has, key) {
  1604. const rawKey = toRaw(key);
  1605. if (rawKey !== key && has.call(target, rawKey)) {
  1606. const type = toRawType(target);
  1607. warn$2(
  1608. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1609. );
  1610. }
  1611. }
  1612. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1613. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1614. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1615. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1616. function targetTypeMap(rawType) {
  1617. switch (rawType) {
  1618. case "Object":
  1619. case "Array":
  1620. return 1 /* COMMON */;
  1621. case "Map":
  1622. case "Set":
  1623. case "WeakMap":
  1624. case "WeakSet":
  1625. return 2 /* COLLECTION */;
  1626. default:
  1627. return 0 /* INVALID */;
  1628. }
  1629. }
  1630. function getTargetType(value) {
  1631. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1632. }
  1633. function reactive(target) {
  1634. if (isReadonly(target)) {
  1635. return target;
  1636. }
  1637. return createReactiveObject(
  1638. target,
  1639. false,
  1640. mutableHandlers,
  1641. mutableCollectionHandlers,
  1642. reactiveMap
  1643. );
  1644. }
  1645. function shallowReactive(target) {
  1646. return createReactiveObject(
  1647. target,
  1648. false,
  1649. shallowReactiveHandlers,
  1650. shallowCollectionHandlers,
  1651. shallowReactiveMap
  1652. );
  1653. }
  1654. function readonly(target) {
  1655. return createReactiveObject(
  1656. target,
  1657. true,
  1658. readonlyHandlers,
  1659. readonlyCollectionHandlers,
  1660. readonlyMap
  1661. );
  1662. }
  1663. function shallowReadonly(target) {
  1664. return createReactiveObject(
  1665. target,
  1666. true,
  1667. shallowReadonlyHandlers,
  1668. shallowReadonlyCollectionHandlers,
  1669. shallowReadonlyMap
  1670. );
  1671. }
  1672. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1673. if (!isObject(target)) {
  1674. {
  1675. warn$2(
  1676. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1677. target
  1678. )}`
  1679. );
  1680. }
  1681. return target;
  1682. }
  1683. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1684. return target;
  1685. }
  1686. const targetType = getTargetType(target);
  1687. if (targetType === 0 /* INVALID */) {
  1688. return target;
  1689. }
  1690. const existingProxy = proxyMap.get(target);
  1691. if (existingProxy) {
  1692. return existingProxy;
  1693. }
  1694. const proxy = new Proxy(
  1695. target,
  1696. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1697. );
  1698. proxyMap.set(target, proxy);
  1699. return proxy;
  1700. }
  1701. function isReactive(value) {
  1702. if (isReadonly(value)) {
  1703. return isReactive(value["__v_raw"]);
  1704. }
  1705. return !!(value && value["__v_isReactive"]);
  1706. }
  1707. function isReadonly(value) {
  1708. return !!(value && value["__v_isReadonly"]);
  1709. }
  1710. function isShallow(value) {
  1711. return !!(value && value["__v_isShallow"]);
  1712. }
  1713. function isProxy(value) {
  1714. return value ? !!value["__v_raw"] : false;
  1715. }
  1716. function toRaw(observed) {
  1717. const raw = observed && observed["__v_raw"];
  1718. return raw ? toRaw(raw) : observed;
  1719. }
  1720. function markRaw(value) {
  1721. if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1722. def(value, "__v_skip", true);
  1723. }
  1724. return value;
  1725. }
  1726. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1727. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1728. function isRef(r) {
  1729. return r ? r["__v_isRef"] === true : false;
  1730. }
  1731. function ref(value) {
  1732. return createRef(value, false);
  1733. }
  1734. function shallowRef(value) {
  1735. return createRef(value, true);
  1736. }
  1737. function createRef(rawValue, shallow) {
  1738. if (isRef(rawValue)) {
  1739. return rawValue;
  1740. }
  1741. return new RefImpl(rawValue, shallow);
  1742. }
  1743. class RefImpl {
  1744. constructor(value, isShallow2) {
  1745. this.dep = new Dep();
  1746. this["__v_isRef"] = true;
  1747. this["__v_isShallow"] = false;
  1748. this._rawValue = isShallow2 ? value : toRaw(value);
  1749. this._value = isShallow2 ? value : toReactive(value);
  1750. this["__v_isShallow"] = isShallow2;
  1751. }
  1752. get value() {
  1753. {
  1754. this.dep.track({
  1755. target: this,
  1756. type: "get",
  1757. key: "value"
  1758. });
  1759. }
  1760. return this._value;
  1761. }
  1762. set value(newValue) {
  1763. const oldValue = this._rawValue;
  1764. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1765. newValue = useDirectValue ? newValue : toRaw(newValue);
  1766. if (hasChanged(newValue, oldValue)) {
  1767. this._rawValue = newValue;
  1768. this._value = useDirectValue ? newValue : toReactive(newValue);
  1769. {
  1770. this.dep.trigger({
  1771. target: this,
  1772. type: "set",
  1773. key: "value",
  1774. newValue,
  1775. oldValue
  1776. });
  1777. }
  1778. }
  1779. }
  1780. }
  1781. function triggerRef(ref2) {
  1782. if (ref2.dep) {
  1783. {
  1784. ref2.dep.trigger({
  1785. target: ref2,
  1786. type: "set",
  1787. key: "value",
  1788. newValue: ref2._value
  1789. });
  1790. }
  1791. }
  1792. }
  1793. function unref(ref2) {
  1794. return isRef(ref2) ? ref2.value : ref2;
  1795. }
  1796. function toValue(source) {
  1797. return isFunction(source) ? source() : unref(source);
  1798. }
  1799. const shallowUnwrapHandlers = {
  1800. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1801. set: (target, key, value, receiver) => {
  1802. const oldValue = target[key];
  1803. if (isRef(oldValue) && !isRef(value)) {
  1804. oldValue.value = value;
  1805. return true;
  1806. } else {
  1807. return Reflect.set(target, key, value, receiver);
  1808. }
  1809. }
  1810. };
  1811. function proxyRefs(objectWithRefs) {
  1812. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1813. }
  1814. class CustomRefImpl {
  1815. constructor(factory) {
  1816. this["__v_isRef"] = true;
  1817. this._value = void 0;
  1818. const dep = this.dep = new Dep();
  1819. const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
  1820. this._get = get;
  1821. this._set = set;
  1822. }
  1823. get value() {
  1824. return this._value = this._get();
  1825. }
  1826. set value(newVal) {
  1827. this._set(newVal);
  1828. }
  1829. }
  1830. function customRef(factory) {
  1831. return new CustomRefImpl(factory);
  1832. }
  1833. function toRefs(object) {
  1834. if (!isProxy(object)) {
  1835. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1836. }
  1837. const ret = isArray(object) ? new Array(object.length) : {};
  1838. for (const key in object) {
  1839. ret[key] = propertyToRef(object, key);
  1840. }
  1841. return ret;
  1842. }
  1843. class ObjectRefImpl {
  1844. constructor(_object, _key, _defaultValue) {
  1845. this._object = _object;
  1846. this._key = _key;
  1847. this._defaultValue = _defaultValue;
  1848. this["__v_isRef"] = true;
  1849. this._value = void 0;
  1850. this._raw = toRaw(_object);
  1851. let shallow = true;
  1852. let obj = _object;
  1853. if (!isArray(_object) || !isIntegerKey(String(_key))) {
  1854. do {
  1855. shallow = !isProxy(obj) || isShallow(obj);
  1856. } while (shallow && (obj = obj["__v_raw"]));
  1857. }
  1858. this._shallow = shallow;
  1859. }
  1860. get value() {
  1861. let val = this._object[this._key];
  1862. if (this._shallow) {
  1863. val = unref(val);
  1864. }
  1865. return this._value = val === void 0 ? this._defaultValue : val;
  1866. }
  1867. set value(newVal) {
  1868. if (this._shallow && isRef(this._raw[this._key])) {
  1869. const nestedRef = this._object[this._key];
  1870. if (isRef(nestedRef)) {
  1871. nestedRef.value = newVal;
  1872. return;
  1873. }
  1874. }
  1875. this._object[this._key] = newVal;
  1876. }
  1877. get dep() {
  1878. return getDepFromReactive(this._raw, this._key);
  1879. }
  1880. }
  1881. class GetterRefImpl {
  1882. constructor(_getter) {
  1883. this._getter = _getter;
  1884. this["__v_isRef"] = true;
  1885. this["__v_isReadonly"] = true;
  1886. this._value = void 0;
  1887. }
  1888. get value() {
  1889. return this._value = this._getter();
  1890. }
  1891. }
  1892. function toRef(source, key, defaultValue) {
  1893. if (isRef(source)) {
  1894. return source;
  1895. } else if (isFunction(source)) {
  1896. return new GetterRefImpl(source);
  1897. } else if (isObject(source) && arguments.length > 1) {
  1898. return propertyToRef(source, key, defaultValue);
  1899. } else {
  1900. return ref(source);
  1901. }
  1902. }
  1903. function propertyToRef(source, key, defaultValue) {
  1904. return new ObjectRefImpl(source, key, defaultValue);
  1905. }
  1906. class ComputedRefImpl {
  1907. constructor(fn, setter, isSSR) {
  1908. this.fn = fn;
  1909. this.setter = setter;
  1910. /**
  1911. * @internal
  1912. */
  1913. this._value = void 0;
  1914. /**
  1915. * @internal
  1916. */
  1917. this.dep = new Dep(this);
  1918. /**
  1919. * @internal
  1920. */
  1921. this.__v_isRef = true;
  1922. // TODO isolatedDeclarations "__v_isReadonly"
  1923. // A computed is also a subscriber that tracks other deps
  1924. /**
  1925. * @internal
  1926. */
  1927. this.deps = void 0;
  1928. /**
  1929. * @internal
  1930. */
  1931. this.depsTail = void 0;
  1932. /**
  1933. * @internal
  1934. */
  1935. this.flags = 16;
  1936. /**
  1937. * @internal
  1938. */
  1939. this.globalVersion = globalVersion - 1;
  1940. /**
  1941. * @internal
  1942. */
  1943. this.next = void 0;
  1944. // for backwards compat
  1945. this.effect = this;
  1946. this["__v_isReadonly"] = !setter;
  1947. this.isSSR = isSSR;
  1948. }
  1949. /**
  1950. * @internal
  1951. */
  1952. notify() {
  1953. this.flags |= 16;
  1954. if (!(this.flags & 8) && // avoid infinite self recursion
  1955. activeSub !== this) {
  1956. batch(this, true);
  1957. return true;
  1958. }
  1959. }
  1960. get value() {
  1961. const link = this.dep.track({
  1962. target: this,
  1963. type: "get",
  1964. key: "value"
  1965. }) ;
  1966. refreshComputed(this);
  1967. if (link) {
  1968. link.version = this.dep.version;
  1969. }
  1970. return this._value;
  1971. }
  1972. set value(newValue) {
  1973. if (this.setter) {
  1974. this.setter(newValue);
  1975. } else {
  1976. warn$2("Write operation failed: computed value is readonly");
  1977. }
  1978. }
  1979. }
  1980. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1981. let getter;
  1982. let setter;
  1983. if (isFunction(getterOrOptions)) {
  1984. getter = getterOrOptions;
  1985. } else {
  1986. getter = getterOrOptions.get;
  1987. setter = getterOrOptions.set;
  1988. }
  1989. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1990. if (debugOptions && !isSSR) {
  1991. cRef.onTrack = debugOptions.onTrack;
  1992. cRef.onTrigger = debugOptions.onTrigger;
  1993. }
  1994. return cRef;
  1995. }
  1996. const TrackOpTypes = {
  1997. "GET": "get",
  1998. "HAS": "has",
  1999. "ITERATE": "iterate"
  2000. };
  2001. const TriggerOpTypes = {
  2002. "SET": "set",
  2003. "ADD": "add",
  2004. "DELETE": "delete",
  2005. "CLEAR": "clear"
  2006. };
  2007. const INITIAL_WATCHER_VALUE = {};
  2008. const cleanupMap = /* @__PURE__ */ new WeakMap();
  2009. let activeWatcher = void 0;
  2010. function getCurrentWatcher() {
  2011. return activeWatcher;
  2012. }
  2013. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  2014. if (owner) {
  2015. let cleanups = cleanupMap.get(owner);
  2016. if (!cleanups) cleanupMap.set(owner, cleanups = []);
  2017. cleanups.push(cleanupFn);
  2018. } else if (!failSilently) {
  2019. warn$2(
  2020. `onWatcherCleanup() was called when there was no active watcher to associate with.`
  2021. );
  2022. }
  2023. }
  2024. function watch$1(source, cb, options = EMPTY_OBJ) {
  2025. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  2026. const warnInvalidSource = (s) => {
  2027. (options.onWarn || warn$2)(
  2028. `Invalid watch source: `,
  2029. s,
  2030. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  2031. );
  2032. };
  2033. const reactiveGetter = (source2) => {
  2034. if (deep) return source2;
  2035. if (isShallow(source2) || deep === false || deep === 0)
  2036. return traverse(source2, 1);
  2037. return traverse(source2);
  2038. };
  2039. let effect;
  2040. let getter;
  2041. let cleanup;
  2042. let boundCleanup;
  2043. let forceTrigger = false;
  2044. let isMultiSource = false;
  2045. if (isRef(source)) {
  2046. getter = () => source.value;
  2047. forceTrigger = isShallow(source);
  2048. } else if (isReactive(source)) {
  2049. getter = () => reactiveGetter(source);
  2050. forceTrigger = true;
  2051. } else if (isArray(source)) {
  2052. isMultiSource = true;
  2053. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  2054. getter = () => source.map((s) => {
  2055. if (isRef(s)) {
  2056. return s.value;
  2057. } else if (isReactive(s)) {
  2058. return reactiveGetter(s);
  2059. } else if (isFunction(s)) {
  2060. return call ? call(s, 2) : s();
  2061. } else {
  2062. warnInvalidSource(s);
  2063. }
  2064. });
  2065. } else if (isFunction(source)) {
  2066. if (cb) {
  2067. getter = call ? () => call(source, 2) : source;
  2068. } else {
  2069. getter = () => {
  2070. if (cleanup) {
  2071. pauseTracking();
  2072. try {
  2073. cleanup();
  2074. } finally {
  2075. resetTracking();
  2076. }
  2077. }
  2078. const currentEffect = activeWatcher;
  2079. activeWatcher = effect;
  2080. try {
  2081. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  2082. } finally {
  2083. activeWatcher = currentEffect;
  2084. }
  2085. };
  2086. }
  2087. } else {
  2088. getter = NOOP;
  2089. warnInvalidSource(source);
  2090. }
  2091. if (cb && deep) {
  2092. const baseGetter = getter;
  2093. const depth = deep === true ? Infinity : deep;
  2094. getter = () => traverse(baseGetter(), depth);
  2095. }
  2096. const scope = getCurrentScope();
  2097. const watchHandle = () => {
  2098. effect.stop();
  2099. if (scope && scope.active) {
  2100. remove(scope.effects, effect);
  2101. }
  2102. };
  2103. if (once && cb) {
  2104. const _cb = cb;
  2105. cb = (...args) => {
  2106. _cb(...args);
  2107. watchHandle();
  2108. };
  2109. }
  2110. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2111. const job = (immediateFirstRun) => {
  2112. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  2113. return;
  2114. }
  2115. if (cb) {
  2116. const newValue = effect.run();
  2117. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
  2118. if (cleanup) {
  2119. cleanup();
  2120. }
  2121. const currentWatcher = activeWatcher;
  2122. activeWatcher = effect;
  2123. try {
  2124. const args = [
  2125. newValue,
  2126. // pass undefined as the old value when it's changed for the first time
  2127. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2128. boundCleanup
  2129. ];
  2130. oldValue = newValue;
  2131. call ? call(cb, 3, args) : (
  2132. // @ts-expect-error
  2133. cb(...args)
  2134. );
  2135. } finally {
  2136. activeWatcher = currentWatcher;
  2137. }
  2138. }
  2139. } else {
  2140. effect.run();
  2141. }
  2142. };
  2143. if (augmentJob) {
  2144. augmentJob(job);
  2145. }
  2146. effect = new ReactiveEffect(getter);
  2147. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  2148. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  2149. cleanup = effect.onStop = () => {
  2150. const cleanups = cleanupMap.get(effect);
  2151. if (cleanups) {
  2152. if (call) {
  2153. call(cleanups, 4);
  2154. } else {
  2155. for (const cleanup2 of cleanups) cleanup2();
  2156. }
  2157. cleanupMap.delete(effect);
  2158. }
  2159. };
  2160. {
  2161. effect.onTrack = options.onTrack;
  2162. effect.onTrigger = options.onTrigger;
  2163. }
  2164. if (cb) {
  2165. if (immediate) {
  2166. job(true);
  2167. } else {
  2168. oldValue = effect.run();
  2169. }
  2170. } else if (scheduler) {
  2171. scheduler(job.bind(null, true), true);
  2172. } else {
  2173. effect.run();
  2174. }
  2175. watchHandle.pause = effect.pause.bind(effect);
  2176. watchHandle.resume = effect.resume.bind(effect);
  2177. watchHandle.stop = watchHandle;
  2178. return watchHandle;
  2179. }
  2180. function traverse(value, depth = Infinity, seen) {
  2181. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  2182. return value;
  2183. }
  2184. seen = seen || /* @__PURE__ */ new Map();
  2185. if ((seen.get(value) || 0) >= depth) {
  2186. return value;
  2187. }
  2188. seen.set(value, depth);
  2189. depth--;
  2190. if (isRef(value)) {
  2191. traverse(value.value, depth, seen);
  2192. } else if (isArray(value)) {
  2193. for (let i = 0; i < value.length; i++) {
  2194. traverse(value[i], depth, seen);
  2195. }
  2196. } else if (isSet(value) || isMap(value)) {
  2197. value.forEach((v) => {
  2198. traverse(v, depth, seen);
  2199. });
  2200. } else if (isPlainObject(value)) {
  2201. for (const key in value) {
  2202. traverse(value[key], depth, seen);
  2203. }
  2204. for (const key of Object.getOwnPropertySymbols(value)) {
  2205. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  2206. traverse(value[key], depth, seen);
  2207. }
  2208. }
  2209. }
  2210. return value;
  2211. }
  2212. const stack = [];
  2213. function pushWarningContext(vnode) {
  2214. stack.push(vnode);
  2215. }
  2216. function popWarningContext() {
  2217. stack.pop();
  2218. }
  2219. let isWarning = false;
  2220. function warn$1(msg, ...args) {
  2221. if (isWarning) return;
  2222. isWarning = true;
  2223. pauseTracking();
  2224. const instance = stack.length ? stack[stack.length - 1].component : null;
  2225. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2226. const trace = getComponentTrace();
  2227. if (appWarnHandler) {
  2228. callWithErrorHandling(
  2229. appWarnHandler,
  2230. instance,
  2231. 11,
  2232. [
  2233. // eslint-disable-next-line no-restricted-syntax
  2234. msg + args.map((a) => {
  2235. var _a, _b;
  2236. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  2237. }).join(""),
  2238. instance && instance.proxy,
  2239. trace.map(
  2240. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  2241. ).join("\n"),
  2242. trace
  2243. ]
  2244. );
  2245. } else {
  2246. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2247. if (trace.length && // avoid spamming console during tests
  2248. true) {
  2249. warnArgs.push(`
  2250. `, ...formatTrace(trace));
  2251. }
  2252. console.warn(...warnArgs);
  2253. }
  2254. resetTracking();
  2255. isWarning = false;
  2256. }
  2257. function getComponentTrace() {
  2258. let currentVNode = stack[stack.length - 1];
  2259. if (!currentVNode) {
  2260. return [];
  2261. }
  2262. const normalizedStack = [];
  2263. while (currentVNode) {
  2264. const last = normalizedStack[0];
  2265. if (last && last.vnode === currentVNode) {
  2266. last.recurseCount++;
  2267. } else {
  2268. normalizedStack.push({
  2269. vnode: currentVNode,
  2270. recurseCount: 0
  2271. });
  2272. }
  2273. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2274. currentVNode = parentInstance && parentInstance.vnode;
  2275. }
  2276. return normalizedStack;
  2277. }
  2278. function formatTrace(trace) {
  2279. const logs = [];
  2280. trace.forEach((entry, i) => {
  2281. logs.push(...i === 0 ? [] : [`
  2282. `], ...formatTraceEntry(entry));
  2283. });
  2284. return logs;
  2285. }
  2286. function formatTraceEntry({ vnode, recurseCount }) {
  2287. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2288. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2289. const open = ` at <${formatComponentName(
  2290. vnode.component,
  2291. vnode.type,
  2292. isRoot
  2293. )}`;
  2294. const close = `>` + postfix;
  2295. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2296. }
  2297. function formatProps(props) {
  2298. const res = [];
  2299. const keys = Object.keys(props);
  2300. keys.slice(0, 3).forEach((key) => {
  2301. res.push(...formatProp(key, props[key]));
  2302. });
  2303. if (keys.length > 3) {
  2304. res.push(` ...`);
  2305. }
  2306. return res;
  2307. }
  2308. function formatProp(key, value, raw) {
  2309. if (isString(value)) {
  2310. value = JSON.stringify(value);
  2311. return raw ? value : [`${key}=${value}`];
  2312. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2313. return raw ? value : [`${key}=${value}`];
  2314. } else if (isRef(value)) {
  2315. value = formatProp(key, toRaw(value.value), true);
  2316. return raw ? value : [`${key}=Ref<`, value, `>`];
  2317. } else if (isFunction(value)) {
  2318. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2319. } else {
  2320. value = toRaw(value);
  2321. return raw ? value : [`${key}=`, value];
  2322. }
  2323. }
  2324. function assertNumber(val, type) {
  2325. if (val === void 0) {
  2326. return;
  2327. } else if (typeof val !== "number") {
  2328. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  2329. } else if (isNaN(val)) {
  2330. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  2331. }
  2332. }
  2333. const ErrorCodes = {
  2334. "SETUP_FUNCTION": 0,
  2335. "0": "SETUP_FUNCTION",
  2336. "RENDER_FUNCTION": 1,
  2337. "1": "RENDER_FUNCTION",
  2338. "NATIVE_EVENT_HANDLER": 5,
  2339. "5": "NATIVE_EVENT_HANDLER",
  2340. "COMPONENT_EVENT_HANDLER": 6,
  2341. "6": "COMPONENT_EVENT_HANDLER",
  2342. "VNODE_HOOK": 7,
  2343. "7": "VNODE_HOOK",
  2344. "DIRECTIVE_HOOK": 8,
  2345. "8": "DIRECTIVE_HOOK",
  2346. "TRANSITION_HOOK": 9,
  2347. "9": "TRANSITION_HOOK",
  2348. "APP_ERROR_HANDLER": 10,
  2349. "10": "APP_ERROR_HANDLER",
  2350. "APP_WARN_HANDLER": 11,
  2351. "11": "APP_WARN_HANDLER",
  2352. "FUNCTION_REF": 12,
  2353. "12": "FUNCTION_REF",
  2354. "ASYNC_COMPONENT_LOADER": 13,
  2355. "13": "ASYNC_COMPONENT_LOADER",
  2356. "SCHEDULER": 14,
  2357. "14": "SCHEDULER",
  2358. "COMPONENT_UPDATE": 15,
  2359. "15": "COMPONENT_UPDATE",
  2360. "APP_UNMOUNT_CLEANUP": 16,
  2361. "16": "APP_UNMOUNT_CLEANUP"
  2362. };
  2363. const ErrorTypeStrings$1 = {
  2364. ["sp"]: "serverPrefetch hook",
  2365. ["bc"]: "beforeCreate hook",
  2366. ["c"]: "created hook",
  2367. ["bm"]: "beforeMount hook",
  2368. ["m"]: "mounted hook",
  2369. ["bu"]: "beforeUpdate hook",
  2370. ["u"]: "updated",
  2371. ["bum"]: "beforeUnmount hook",
  2372. ["um"]: "unmounted hook",
  2373. ["a"]: "activated hook",
  2374. ["da"]: "deactivated hook",
  2375. ["ec"]: "errorCaptured hook",
  2376. ["rtc"]: "renderTracked hook",
  2377. ["rtg"]: "renderTriggered hook",
  2378. [0]: "setup function",
  2379. [1]: "render function",
  2380. [2]: "watcher getter",
  2381. [3]: "watcher callback",
  2382. [4]: "watcher cleanup function",
  2383. [5]: "native event handler",
  2384. [6]: "component event handler",
  2385. [7]: "vnode hook",
  2386. [8]: "directive hook",
  2387. [9]: "transition hook",
  2388. [10]: "app errorHandler",
  2389. [11]: "app warnHandler",
  2390. [12]: "ref function",
  2391. [13]: "async component loader",
  2392. [14]: "scheduler flush",
  2393. [15]: "component update",
  2394. [16]: "app unmount cleanup function"
  2395. };
  2396. function callWithErrorHandling(fn, instance, type, args) {
  2397. try {
  2398. return args ? fn(...args) : fn();
  2399. } catch (err) {
  2400. handleError(err, instance, type);
  2401. }
  2402. }
  2403. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2404. if (isFunction(fn)) {
  2405. const res = callWithErrorHandling(fn, instance, type, args);
  2406. if (res && isPromise(res)) {
  2407. res.catch((err) => {
  2408. handleError(err, instance, type);
  2409. });
  2410. }
  2411. return res;
  2412. }
  2413. if (isArray(fn)) {
  2414. const values = [];
  2415. for (let i = 0; i < fn.length; i++) {
  2416. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2417. }
  2418. return values;
  2419. } else {
  2420. warn$1(
  2421. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  2422. );
  2423. }
  2424. }
  2425. function handleError(err, instance, type, throwInDev = true) {
  2426. const contextVNode = instance ? instance.vnode : null;
  2427. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  2428. if (instance) {
  2429. let cur = instance.parent;
  2430. const exposedInstance = instance.proxy;
  2431. const errorInfo = ErrorTypeStrings$1[type] ;
  2432. while (cur) {
  2433. const errorCapturedHooks = cur.ec;
  2434. if (errorCapturedHooks) {
  2435. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2436. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2437. return;
  2438. }
  2439. }
  2440. }
  2441. cur = cur.parent;
  2442. }
  2443. if (errorHandler) {
  2444. pauseTracking();
  2445. callWithErrorHandling(errorHandler, null, 10, [
  2446. err,
  2447. exposedInstance,
  2448. errorInfo
  2449. ]);
  2450. resetTracking();
  2451. return;
  2452. }
  2453. }
  2454. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  2455. }
  2456. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  2457. {
  2458. const info = ErrorTypeStrings$1[type];
  2459. if (contextVNode) {
  2460. pushWarningContext(contextVNode);
  2461. }
  2462. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2463. if (contextVNode) {
  2464. popWarningContext();
  2465. }
  2466. if (throwInDev) {
  2467. throw err;
  2468. } else {
  2469. console.error(err);
  2470. }
  2471. }
  2472. }
  2473. const queue = [];
  2474. let flushIndex = -1;
  2475. const pendingPostFlushCbs = [];
  2476. let activePostFlushCbs = null;
  2477. let postFlushIndex = 0;
  2478. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2479. let currentFlushPromise = null;
  2480. const RECURSION_LIMIT = 100;
  2481. function nextTick(fn) {
  2482. const p = currentFlushPromise || resolvedPromise;
  2483. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  2484. }
  2485. function findInsertionIndex(id) {
  2486. let start = flushIndex + 1;
  2487. let end = queue.length;
  2488. while (start < end) {
  2489. const middle = start + end >>> 1;
  2490. const middleJob = queue[middle];
  2491. const middleJobId = getId(middleJob);
  2492. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  2493. start = middle + 1;
  2494. } else {
  2495. end = middle;
  2496. }
  2497. }
  2498. return start;
  2499. }
  2500. function queueJob(job) {
  2501. if (!(job.flags & 1)) {
  2502. const jobId = getId(job);
  2503. const lastJob = queue[queue.length - 1];
  2504. if (!lastJob || // fast path when the job id is larger than the tail
  2505. !(job.flags & 2) && jobId >= getId(lastJob)) {
  2506. queue.push(job);
  2507. } else {
  2508. queue.splice(findInsertionIndex(jobId), 0, job);
  2509. }
  2510. job.flags |= 1;
  2511. queueFlush();
  2512. }
  2513. }
  2514. function queueFlush() {
  2515. if (!currentFlushPromise) {
  2516. currentFlushPromise = resolvedPromise.then(flushJobs);
  2517. }
  2518. }
  2519. function queuePostFlushCb(cb) {
  2520. if (!isArray(cb)) {
  2521. if (activePostFlushCbs && cb.id === -1) {
  2522. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  2523. } else if (!(cb.flags & 1)) {
  2524. pendingPostFlushCbs.push(cb);
  2525. cb.flags |= 1;
  2526. }
  2527. } else {
  2528. pendingPostFlushCbs.push(...cb);
  2529. }
  2530. queueFlush();
  2531. }
  2532. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  2533. {
  2534. seen = seen || /* @__PURE__ */ new Map();
  2535. }
  2536. for (; i < queue.length; i++) {
  2537. const cb = queue[i];
  2538. if (cb && cb.flags & 2) {
  2539. if (instance && cb.id !== instance.uid) {
  2540. continue;
  2541. }
  2542. if (checkRecursiveUpdates(seen, cb)) {
  2543. continue;
  2544. }
  2545. queue.splice(i, 1);
  2546. i--;
  2547. if (cb.flags & 4) {
  2548. cb.flags &= -2;
  2549. }
  2550. cb();
  2551. if (!(cb.flags & 4)) {
  2552. cb.flags &= -2;
  2553. }
  2554. }
  2555. }
  2556. }
  2557. function flushPostFlushCbs(seen) {
  2558. if (pendingPostFlushCbs.length) {
  2559. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2560. (a, b) => getId(a) - getId(b)
  2561. );
  2562. pendingPostFlushCbs.length = 0;
  2563. if (activePostFlushCbs) {
  2564. activePostFlushCbs.push(...deduped);
  2565. return;
  2566. }
  2567. activePostFlushCbs = deduped;
  2568. {
  2569. seen = seen || /* @__PURE__ */ new Map();
  2570. }
  2571. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2572. const cb = activePostFlushCbs[postFlushIndex];
  2573. if (checkRecursiveUpdates(seen, cb)) {
  2574. continue;
  2575. }
  2576. if (cb.flags & 4) {
  2577. cb.flags &= -2;
  2578. }
  2579. if (!(cb.flags & 8)) cb();
  2580. cb.flags &= -2;
  2581. }
  2582. activePostFlushCbs = null;
  2583. postFlushIndex = 0;
  2584. }
  2585. }
  2586. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  2587. function flushJobs(seen) {
  2588. {
  2589. seen = seen || /* @__PURE__ */ new Map();
  2590. }
  2591. const check = (job) => checkRecursiveUpdates(seen, job) ;
  2592. try {
  2593. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2594. const job = queue[flushIndex];
  2595. if (job && !(job.flags & 8)) {
  2596. if (check(job)) {
  2597. continue;
  2598. }
  2599. if (job.flags & 4) {
  2600. job.flags &= ~1;
  2601. }
  2602. callWithErrorHandling(
  2603. job,
  2604. job.i,
  2605. job.i ? 15 : 14
  2606. );
  2607. if (!(job.flags & 4)) {
  2608. job.flags &= ~1;
  2609. }
  2610. }
  2611. }
  2612. } finally {
  2613. for (; flushIndex < queue.length; flushIndex++) {
  2614. const job = queue[flushIndex];
  2615. if (job) {
  2616. job.flags &= -2;
  2617. }
  2618. }
  2619. flushIndex = -1;
  2620. queue.length = 0;
  2621. flushPostFlushCbs(seen);
  2622. currentFlushPromise = null;
  2623. if (queue.length || pendingPostFlushCbs.length) {
  2624. flushJobs(seen);
  2625. }
  2626. }
  2627. }
  2628. function checkRecursiveUpdates(seen, fn) {
  2629. const count = seen.get(fn) || 0;
  2630. if (count > RECURSION_LIMIT) {
  2631. const instance = fn.i;
  2632. const componentName = instance && getComponentName(instance.type);
  2633. handleError(
  2634. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  2635. null,
  2636. 10
  2637. );
  2638. return true;
  2639. }
  2640. seen.set(fn, count + 1);
  2641. return false;
  2642. }
  2643. let isHmrUpdating = false;
  2644. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  2645. {
  2646. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  2647. createRecord: tryWrap(createRecord),
  2648. rerender: tryWrap(rerender),
  2649. reload: tryWrap(reload)
  2650. };
  2651. }
  2652. const map = /* @__PURE__ */ new Map();
  2653. function registerHMR(instance) {
  2654. const id = instance.type.__hmrId;
  2655. let record = map.get(id);
  2656. if (!record) {
  2657. createRecord(id, instance.type);
  2658. record = map.get(id);
  2659. }
  2660. record.instances.add(instance);
  2661. }
  2662. function unregisterHMR(instance) {
  2663. map.get(instance.type.__hmrId).instances.delete(instance);
  2664. }
  2665. function createRecord(id, initialDef) {
  2666. if (map.has(id)) {
  2667. return false;
  2668. }
  2669. map.set(id, {
  2670. initialDef: normalizeClassComponent(initialDef),
  2671. instances: /* @__PURE__ */ new Set()
  2672. });
  2673. return true;
  2674. }
  2675. function normalizeClassComponent(component) {
  2676. return isClassComponent(component) ? component.__vccOpts : component;
  2677. }
  2678. function rerender(id, newRender) {
  2679. const record = map.get(id);
  2680. if (!record) {
  2681. return;
  2682. }
  2683. record.initialDef.render = newRender;
  2684. [...record.instances].forEach((instance) => {
  2685. if (newRender) {
  2686. instance.render = newRender;
  2687. normalizeClassComponent(instance.type).render = newRender;
  2688. }
  2689. instance.renderCache = [];
  2690. isHmrUpdating = true;
  2691. if (!(instance.job.flags & 8)) {
  2692. instance.update();
  2693. }
  2694. isHmrUpdating = false;
  2695. });
  2696. }
  2697. function reload(id, newComp) {
  2698. const record = map.get(id);
  2699. if (!record) return;
  2700. newComp = normalizeClassComponent(newComp);
  2701. updateComponentDef(record.initialDef, newComp);
  2702. const instances = [...record.instances];
  2703. for (let i = 0; i < instances.length; i++) {
  2704. const instance = instances[i];
  2705. const oldComp = normalizeClassComponent(instance.type);
  2706. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2707. if (!dirtyInstances) {
  2708. if (oldComp !== record.initialDef) {
  2709. updateComponentDef(oldComp, newComp);
  2710. }
  2711. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2712. }
  2713. dirtyInstances.add(instance);
  2714. instance.appContext.propsCache.delete(instance.type);
  2715. instance.appContext.emitsCache.delete(instance.type);
  2716. instance.appContext.optionsCache.delete(instance.type);
  2717. if (instance.ceReload) {
  2718. dirtyInstances.add(instance);
  2719. instance.ceReload(newComp.styles);
  2720. dirtyInstances.delete(instance);
  2721. } else if (instance.parent) {
  2722. queueJob(() => {
  2723. if (!(instance.job.flags & 8)) {
  2724. isHmrUpdating = true;
  2725. instance.parent.update();
  2726. isHmrUpdating = false;
  2727. dirtyInstances.delete(instance);
  2728. }
  2729. });
  2730. } else if (instance.appContext.reload) {
  2731. instance.appContext.reload();
  2732. } else if (typeof window !== "undefined") {
  2733. window.location.reload();
  2734. } else {
  2735. console.warn(
  2736. "[HMR] Root or manually mounted instance modified. Full reload required."
  2737. );
  2738. }
  2739. if (instance.root.ce && instance !== instance.root) {
  2740. instance.root.ce._removeChildStyle(oldComp);
  2741. }
  2742. }
  2743. queuePostFlushCb(() => {
  2744. hmrDirtyComponents.clear();
  2745. });
  2746. }
  2747. function updateComponentDef(oldComp, newComp) {
  2748. extend(oldComp, newComp);
  2749. for (const key in oldComp) {
  2750. if (key !== "__file" && !(key in newComp)) {
  2751. delete oldComp[key];
  2752. }
  2753. }
  2754. }
  2755. function tryWrap(fn) {
  2756. return (id, arg) => {
  2757. try {
  2758. return fn(id, arg);
  2759. } catch (e) {
  2760. console.error(e);
  2761. console.warn(
  2762. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2763. );
  2764. }
  2765. };
  2766. }
  2767. let devtools$1;
  2768. let buffer = [];
  2769. let devtoolsNotInstalled = false;
  2770. function emit$1(event, ...args) {
  2771. if (devtools$1) {
  2772. devtools$1.emit(event, ...args);
  2773. } else if (!devtoolsNotInstalled) {
  2774. buffer.push({ event, args });
  2775. }
  2776. }
  2777. function setDevtoolsHook$1(hook, target) {
  2778. var _a, _b;
  2779. devtools$1 = hook;
  2780. if (devtools$1) {
  2781. devtools$1.enabled = true;
  2782. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2783. buffer = [];
  2784. } else if (
  2785. // handle late devtools injection - only do this if we are in an actual
  2786. // browser environment to avoid the timer handle stalling test runner exit
  2787. // (#4815)
  2788. typeof window !== "undefined" && // some envs mock window but not fully
  2789. window.HTMLElement && // also exclude jsdom
  2790. // eslint-disable-next-line no-restricted-syntax
  2791. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2792. ) {
  2793. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2794. replay.push((newHook) => {
  2795. setDevtoolsHook$1(newHook, target);
  2796. });
  2797. setTimeout(() => {
  2798. if (!devtools$1) {
  2799. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2800. devtoolsNotInstalled = true;
  2801. buffer = [];
  2802. }
  2803. }, 3e3);
  2804. } else {
  2805. devtoolsNotInstalled = true;
  2806. buffer = [];
  2807. }
  2808. }
  2809. function devtoolsInitApp(app, version) {
  2810. emit$1("app:init" /* APP_INIT */, app, version, {
  2811. Fragment,
  2812. Text,
  2813. Comment,
  2814. Static
  2815. });
  2816. }
  2817. function devtoolsUnmountApp(app) {
  2818. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2819. }
  2820. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  2821. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2822. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2823. "component:removed" /* COMPONENT_REMOVED */
  2824. );
  2825. const devtoolsComponentRemoved = (component) => {
  2826. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2827. !devtools$1.cleanupBuffer(component)) {
  2828. _devtoolsComponentRemoved(component);
  2829. }
  2830. };
  2831. // @__NO_SIDE_EFFECTS__
  2832. function createDevtoolsComponentHook(hook) {
  2833. return (component) => {
  2834. emit$1(
  2835. hook,
  2836. component.appContext.app,
  2837. component.uid,
  2838. component.parent ? component.parent.uid : void 0,
  2839. component
  2840. );
  2841. };
  2842. }
  2843. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  2844. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  2845. function createDevtoolsPerformanceHook(hook) {
  2846. return (component, type, time) => {
  2847. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2848. };
  2849. }
  2850. function devtoolsComponentEmit(component, event, params) {
  2851. emit$1(
  2852. "component:emit" /* COMPONENT_EMIT */,
  2853. component.appContext.app,
  2854. component,
  2855. event,
  2856. params
  2857. );
  2858. }
  2859. let currentRenderingInstance = null;
  2860. let currentScopeId = null;
  2861. function setCurrentRenderingInstance(instance) {
  2862. const prev = currentRenderingInstance;
  2863. currentRenderingInstance = instance;
  2864. currentScopeId = instance && instance.type.__scopeId || null;
  2865. return prev;
  2866. }
  2867. function pushScopeId(id) {
  2868. currentScopeId = id;
  2869. }
  2870. function popScopeId() {
  2871. currentScopeId = null;
  2872. }
  2873. const withScopeId = (_id) => withCtx;
  2874. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2875. if (!ctx) return fn;
  2876. if (fn._n) {
  2877. return fn;
  2878. }
  2879. const renderFnWithContext = (...args) => {
  2880. if (renderFnWithContext._d) {
  2881. setBlockTracking(-1);
  2882. }
  2883. const prevInstance = setCurrentRenderingInstance(ctx);
  2884. let res;
  2885. try {
  2886. res = fn(...args);
  2887. } finally {
  2888. setCurrentRenderingInstance(prevInstance);
  2889. if (renderFnWithContext._d) {
  2890. setBlockTracking(1);
  2891. }
  2892. }
  2893. {
  2894. devtoolsComponentUpdated(ctx);
  2895. }
  2896. return res;
  2897. };
  2898. renderFnWithContext._n = true;
  2899. renderFnWithContext._c = true;
  2900. renderFnWithContext._d = true;
  2901. return renderFnWithContext;
  2902. }
  2903. function validateDirectiveName(name) {
  2904. if (isBuiltInDirective(name)) {
  2905. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2906. }
  2907. }
  2908. function withDirectives(vnode, directives) {
  2909. if (currentRenderingInstance === null) {
  2910. warn$1(`withDirectives can only be used inside render functions.`);
  2911. return vnode;
  2912. }
  2913. const instance = getComponentPublicInstance(currentRenderingInstance);
  2914. const bindings = vnode.dirs || (vnode.dirs = []);
  2915. for (let i = 0; i < directives.length; i++) {
  2916. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2917. if (dir) {
  2918. if (isFunction(dir)) {
  2919. dir = {
  2920. mounted: dir,
  2921. updated: dir
  2922. };
  2923. }
  2924. if (dir.deep) {
  2925. traverse(value);
  2926. }
  2927. bindings.push({
  2928. dir,
  2929. instance,
  2930. value,
  2931. oldValue: void 0,
  2932. arg,
  2933. modifiers
  2934. });
  2935. }
  2936. }
  2937. return vnode;
  2938. }
  2939. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2940. const bindings = vnode.dirs;
  2941. const oldBindings = prevVNode && prevVNode.dirs;
  2942. for (let i = 0; i < bindings.length; i++) {
  2943. const binding = bindings[i];
  2944. if (oldBindings) {
  2945. binding.oldValue = oldBindings[i].value;
  2946. }
  2947. let hook = binding.dir[name];
  2948. if (hook) {
  2949. pauseTracking();
  2950. callWithAsyncErrorHandling(hook, instance, 8, [
  2951. vnode.el,
  2952. binding,
  2953. vnode,
  2954. prevVNode
  2955. ]);
  2956. resetTracking();
  2957. }
  2958. }
  2959. }
  2960. function provide(key, value) {
  2961. {
  2962. if (!currentInstance || currentInstance.isMounted) {
  2963. warn$1(`provide() can only be used inside setup().`);
  2964. }
  2965. }
  2966. if (currentInstance) {
  2967. let provides = currentInstance.provides;
  2968. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2969. if (parentProvides === provides) {
  2970. provides = currentInstance.provides = Object.create(parentProvides);
  2971. }
  2972. provides[key] = value;
  2973. }
  2974. }
  2975. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2976. const instance = getCurrentInstance();
  2977. if (instance || currentApp) {
  2978. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  2979. if (provides && key in provides) {
  2980. return provides[key];
  2981. } else if (arguments.length > 1) {
  2982. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  2983. } else {
  2984. warn$1(`injection "${String(key)}" not found.`);
  2985. }
  2986. } else {
  2987. warn$1(`inject() can only be used inside setup() or functional components.`);
  2988. }
  2989. }
  2990. function hasInjectionContext() {
  2991. return !!(getCurrentInstance() || currentApp);
  2992. }
  2993. const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
  2994. const useSSRContext = () => {
  2995. {
  2996. warn$1(`useSSRContext() is not supported in the global build.`);
  2997. }
  2998. };
  2999. function watchEffect(effect, options) {
  3000. return doWatch(effect, null, options);
  3001. }
  3002. function watchPostEffect(effect, options) {
  3003. return doWatch(
  3004. effect,
  3005. null,
  3006. extend({}, options, { flush: "post" })
  3007. );
  3008. }
  3009. function watchSyncEffect(effect, options) {
  3010. return doWatch(
  3011. effect,
  3012. null,
  3013. extend({}, options, { flush: "sync" })
  3014. );
  3015. }
  3016. function watch(source, cb, options) {
  3017. if (!isFunction(cb)) {
  3018. warn$1(
  3019. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  3020. );
  3021. }
  3022. return doWatch(source, cb, options);
  3023. }
  3024. function doWatch(source, cb, options = EMPTY_OBJ) {
  3025. const { immediate, deep, flush, once } = options;
  3026. if (!cb) {
  3027. if (immediate !== void 0) {
  3028. warn$1(
  3029. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  3030. );
  3031. }
  3032. if (deep !== void 0) {
  3033. warn$1(
  3034. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  3035. );
  3036. }
  3037. if (once !== void 0) {
  3038. warn$1(
  3039. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  3040. );
  3041. }
  3042. }
  3043. const baseWatchOptions = extend({}, options);
  3044. baseWatchOptions.onWarn = warn$1;
  3045. const instance = currentInstance;
  3046. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  3047. let isPre = false;
  3048. if (flush === "post") {
  3049. baseWatchOptions.scheduler = (job) => {
  3050. queuePostRenderEffect(job, instance && instance.suspense);
  3051. };
  3052. } else if (flush !== "sync") {
  3053. isPre = true;
  3054. baseWatchOptions.scheduler = (job, isFirstRun) => {
  3055. if (isFirstRun) {
  3056. job();
  3057. } else {
  3058. queueJob(job);
  3059. }
  3060. };
  3061. }
  3062. baseWatchOptions.augmentJob = (job) => {
  3063. if (cb) {
  3064. job.flags |= 4;
  3065. }
  3066. if (isPre) {
  3067. job.flags |= 2;
  3068. if (instance) {
  3069. job.id = instance.uid;
  3070. job.i = instance;
  3071. }
  3072. }
  3073. };
  3074. const watchHandle = watch$1(source, cb, baseWatchOptions);
  3075. return watchHandle;
  3076. }
  3077. function instanceWatch(source, value, options) {
  3078. const publicThis = this.proxy;
  3079. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3080. let cb;
  3081. if (isFunction(value)) {
  3082. cb = value;
  3083. } else {
  3084. cb = value.handler;
  3085. options = value;
  3086. }
  3087. const reset = setCurrentInstance(this);
  3088. const res = doWatch(getter, cb.bind(publicThis), options);
  3089. reset();
  3090. return res;
  3091. }
  3092. function createPathGetter(ctx, path) {
  3093. const segments = path.split(".");
  3094. return () => {
  3095. let cur = ctx;
  3096. for (let i = 0; i < segments.length && cur; i++) {
  3097. cur = cur[segments[i]];
  3098. }
  3099. return cur;
  3100. };
  3101. }
  3102. const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
  3103. const isTeleport = (type) => type.__isTeleport;
  3104. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  3105. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  3106. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  3107. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  3108. const resolveTarget = (props, select) => {
  3109. const targetSelector = props && props.to;
  3110. if (isString(targetSelector)) {
  3111. if (!select) {
  3112. warn$1(
  3113. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  3114. );
  3115. return null;
  3116. } else {
  3117. const target = select(targetSelector);
  3118. if (!target && !isTeleportDisabled(props)) {
  3119. warn$1(
  3120. `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
  3121. );
  3122. }
  3123. return target;
  3124. }
  3125. } else {
  3126. if (!targetSelector && !isTeleportDisabled(props)) {
  3127. warn$1(`Invalid Teleport target: ${targetSelector}`);
  3128. }
  3129. return targetSelector;
  3130. }
  3131. };
  3132. const TeleportImpl = {
  3133. name: "Teleport",
  3134. __isTeleport: true,
  3135. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  3136. const {
  3137. mc: mountChildren,
  3138. pc: patchChildren,
  3139. pbc: patchBlockChildren,
  3140. o: { insert, querySelector, createText, createComment }
  3141. } = internals;
  3142. const disabled = isTeleportDisabled(n2.props);
  3143. let { shapeFlag, children, dynamicChildren } = n2;
  3144. if (isHmrUpdating) {
  3145. optimized = false;
  3146. dynamicChildren = null;
  3147. }
  3148. if (n1 == null) {
  3149. const placeholder = n2.el = createComment("teleport start") ;
  3150. const mainAnchor = n2.anchor = createComment("teleport end") ;
  3151. insert(placeholder, container, anchor);
  3152. insert(mainAnchor, container, anchor);
  3153. const mount = (container2, anchor2) => {
  3154. if (shapeFlag & 16) {
  3155. mountChildren(
  3156. children,
  3157. container2,
  3158. anchor2,
  3159. parentComponent,
  3160. parentSuspense,
  3161. namespace,
  3162. slotScopeIds,
  3163. optimized
  3164. );
  3165. }
  3166. };
  3167. const mountToTarget = () => {
  3168. const target = n2.target = resolveTarget(n2.props, querySelector);
  3169. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  3170. if (target) {
  3171. if (namespace !== "svg" && isTargetSVG(target)) {
  3172. namespace = "svg";
  3173. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  3174. namespace = "mathml";
  3175. }
  3176. if (parentComponent && parentComponent.isCE) {
  3177. (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
  3178. }
  3179. if (!disabled) {
  3180. mount(target, targetAnchor);
  3181. updateCssVars(n2, false);
  3182. }
  3183. } else if (!disabled) {
  3184. warn$1(
  3185. "Invalid Teleport target on mount:",
  3186. target,
  3187. `(${typeof target})`
  3188. );
  3189. }
  3190. };
  3191. if (disabled) {
  3192. mount(container, mainAnchor);
  3193. updateCssVars(n2, true);
  3194. }
  3195. if (isTeleportDeferred(n2.props)) {
  3196. n2.el.__isMounted = false;
  3197. queuePostRenderEffect(() => {
  3198. mountToTarget();
  3199. delete n2.el.__isMounted;
  3200. }, parentSuspense);
  3201. } else {
  3202. mountToTarget();
  3203. }
  3204. } else {
  3205. if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
  3206. queuePostRenderEffect(() => {
  3207. TeleportImpl.process(
  3208. n1,
  3209. n2,
  3210. container,
  3211. anchor,
  3212. parentComponent,
  3213. parentSuspense,
  3214. namespace,
  3215. slotScopeIds,
  3216. optimized,
  3217. internals
  3218. );
  3219. }, parentSuspense);
  3220. return;
  3221. }
  3222. n2.el = n1.el;
  3223. n2.targetStart = n1.targetStart;
  3224. const mainAnchor = n2.anchor = n1.anchor;
  3225. const target = n2.target = n1.target;
  3226. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  3227. const wasDisabled = isTeleportDisabled(n1.props);
  3228. const currentContainer = wasDisabled ? container : target;
  3229. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  3230. if (namespace === "svg" || isTargetSVG(target)) {
  3231. namespace = "svg";
  3232. } else if (namespace === "mathml" || isTargetMathML(target)) {
  3233. namespace = "mathml";
  3234. }
  3235. if (dynamicChildren) {
  3236. patchBlockChildren(
  3237. n1.dynamicChildren,
  3238. dynamicChildren,
  3239. currentContainer,
  3240. parentComponent,
  3241. parentSuspense,
  3242. namespace,
  3243. slotScopeIds
  3244. );
  3245. traverseStaticChildren(n1, n2, false);
  3246. } else if (!optimized) {
  3247. patchChildren(
  3248. n1,
  3249. n2,
  3250. currentContainer,
  3251. currentAnchor,
  3252. parentComponent,
  3253. parentSuspense,
  3254. namespace,
  3255. slotScopeIds,
  3256. false
  3257. );
  3258. }
  3259. if (disabled) {
  3260. if (!wasDisabled) {
  3261. moveTeleport(
  3262. n2,
  3263. container,
  3264. mainAnchor,
  3265. internals,
  3266. 1
  3267. );
  3268. } else {
  3269. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  3270. n2.props.to = n1.props.to;
  3271. }
  3272. }
  3273. } else {
  3274. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  3275. const nextTarget = n2.target = resolveTarget(
  3276. n2.props,
  3277. querySelector
  3278. );
  3279. if (nextTarget) {
  3280. moveTeleport(
  3281. n2,
  3282. nextTarget,
  3283. null,
  3284. internals,
  3285. 0
  3286. );
  3287. } else {
  3288. warn$1(
  3289. "Invalid Teleport target on update:",
  3290. target,
  3291. `(${typeof target})`
  3292. );
  3293. }
  3294. } else if (wasDisabled) {
  3295. moveTeleport(
  3296. n2,
  3297. target,
  3298. targetAnchor,
  3299. internals,
  3300. 1
  3301. );
  3302. }
  3303. }
  3304. updateCssVars(n2, disabled);
  3305. }
  3306. },
  3307. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  3308. const {
  3309. shapeFlag,
  3310. children,
  3311. anchor,
  3312. targetStart,
  3313. targetAnchor,
  3314. target,
  3315. props
  3316. } = vnode;
  3317. if (target) {
  3318. hostRemove(targetStart);
  3319. hostRemove(targetAnchor);
  3320. }
  3321. doRemove && hostRemove(anchor);
  3322. if (shapeFlag & 16) {
  3323. const shouldRemove = doRemove || !isTeleportDisabled(props);
  3324. for (let i = 0; i < children.length; i++) {
  3325. const child = children[i];
  3326. unmount(
  3327. child,
  3328. parentComponent,
  3329. parentSuspense,
  3330. shouldRemove,
  3331. !!child.dynamicChildren
  3332. );
  3333. }
  3334. }
  3335. },
  3336. move: moveTeleport,
  3337. hydrate: hydrateTeleport
  3338. };
  3339. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  3340. if (moveType === 0) {
  3341. insert(vnode.targetAnchor, container, parentAnchor);
  3342. }
  3343. const { el, anchor, shapeFlag, children, props } = vnode;
  3344. const isReorder = moveType === 2;
  3345. if (isReorder) {
  3346. insert(el, container, parentAnchor);
  3347. }
  3348. if (!isReorder || isTeleportDisabled(props)) {
  3349. if (shapeFlag & 16) {
  3350. for (let i = 0; i < children.length; i++) {
  3351. move(
  3352. children[i],
  3353. container,
  3354. parentAnchor,
  3355. 2
  3356. );
  3357. }
  3358. }
  3359. }
  3360. if (isReorder) {
  3361. insert(anchor, container, parentAnchor);
  3362. }
  3363. }
  3364. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  3365. o: { nextSibling, parentNode, querySelector, insert, createText }
  3366. }, hydrateChildren) {
  3367. function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
  3368. vnode2.anchor = hydrateChildren(
  3369. nextSibling(node2),
  3370. vnode2,
  3371. parentNode(node2),
  3372. parentComponent,
  3373. parentSuspense,
  3374. slotScopeIds,
  3375. optimized
  3376. );
  3377. vnode2.targetStart = targetStart;
  3378. vnode2.targetAnchor = targetAnchor;
  3379. }
  3380. const target = vnode.target = resolveTarget(
  3381. vnode.props,
  3382. querySelector
  3383. );
  3384. const disabled = isTeleportDisabled(vnode.props);
  3385. if (target) {
  3386. const targetNode = target._lpa || target.firstChild;
  3387. if (vnode.shapeFlag & 16) {
  3388. if (disabled) {
  3389. hydrateDisabledTeleport(
  3390. node,
  3391. vnode,
  3392. targetNode,
  3393. targetNode && nextSibling(targetNode)
  3394. );
  3395. } else {
  3396. vnode.anchor = nextSibling(node);
  3397. let targetAnchor = targetNode;
  3398. while (targetAnchor) {
  3399. if (targetAnchor && targetAnchor.nodeType === 8) {
  3400. if (targetAnchor.data === "teleport start anchor") {
  3401. vnode.targetStart = targetAnchor;
  3402. } else if (targetAnchor.data === "teleport anchor") {
  3403. vnode.targetAnchor = targetAnchor;
  3404. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  3405. break;
  3406. }
  3407. }
  3408. targetAnchor = nextSibling(targetAnchor);
  3409. }
  3410. if (!vnode.targetAnchor) {
  3411. prepareAnchor(target, vnode, createText, insert);
  3412. }
  3413. hydrateChildren(
  3414. targetNode && nextSibling(targetNode),
  3415. vnode,
  3416. target,
  3417. parentComponent,
  3418. parentSuspense,
  3419. slotScopeIds,
  3420. optimized
  3421. );
  3422. }
  3423. }
  3424. updateCssVars(vnode, disabled);
  3425. } else if (disabled) {
  3426. if (vnode.shapeFlag & 16) {
  3427. hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
  3428. }
  3429. }
  3430. return vnode.anchor && nextSibling(vnode.anchor);
  3431. }
  3432. const Teleport = TeleportImpl;
  3433. function updateCssVars(vnode, isDisabled) {
  3434. const ctx = vnode.ctx;
  3435. if (ctx && ctx.ut) {
  3436. let node, anchor;
  3437. if (isDisabled) {
  3438. node = vnode.el;
  3439. anchor = vnode.anchor;
  3440. } else {
  3441. node = vnode.targetStart;
  3442. anchor = vnode.targetAnchor;
  3443. }
  3444. while (node && node !== anchor) {
  3445. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  3446. node = node.nextSibling;
  3447. }
  3448. ctx.ut();
  3449. }
  3450. }
  3451. function prepareAnchor(target, vnode, createText, insert) {
  3452. const targetStart = vnode.targetStart = createText("");
  3453. const targetAnchor = vnode.targetAnchor = createText("");
  3454. targetStart[TeleportEndKey] = targetAnchor;
  3455. if (target) {
  3456. insert(targetStart, target);
  3457. insert(targetAnchor, target);
  3458. }
  3459. return targetAnchor;
  3460. }
  3461. const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
  3462. const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
  3463. function useTransitionState() {
  3464. const state = {
  3465. isMounted: false,
  3466. isLeaving: false,
  3467. isUnmounting: false,
  3468. leavingVNodes: /* @__PURE__ */ new Map()
  3469. };
  3470. onMounted(() => {
  3471. state.isMounted = true;
  3472. });
  3473. onBeforeUnmount(() => {
  3474. state.isUnmounting = true;
  3475. });
  3476. return state;
  3477. }
  3478. const TransitionHookValidator = [Function, Array];
  3479. const BaseTransitionPropsValidators = {
  3480. mode: String,
  3481. appear: Boolean,
  3482. persisted: Boolean,
  3483. // enter
  3484. onBeforeEnter: TransitionHookValidator,
  3485. onEnter: TransitionHookValidator,
  3486. onAfterEnter: TransitionHookValidator,
  3487. onEnterCancelled: TransitionHookValidator,
  3488. // leave
  3489. onBeforeLeave: TransitionHookValidator,
  3490. onLeave: TransitionHookValidator,
  3491. onAfterLeave: TransitionHookValidator,
  3492. onLeaveCancelled: TransitionHookValidator,
  3493. // appear
  3494. onBeforeAppear: TransitionHookValidator,
  3495. onAppear: TransitionHookValidator,
  3496. onAfterAppear: TransitionHookValidator,
  3497. onAppearCancelled: TransitionHookValidator
  3498. };
  3499. const recursiveGetSubtree = (instance) => {
  3500. const subTree = instance.subTree;
  3501. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  3502. };
  3503. const BaseTransitionImpl = {
  3504. name: `BaseTransition`,
  3505. props: BaseTransitionPropsValidators,
  3506. setup(props, { slots }) {
  3507. const instance = getCurrentInstance();
  3508. const state = useTransitionState();
  3509. return () => {
  3510. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  3511. if (!children || !children.length) {
  3512. return;
  3513. }
  3514. const child = findNonCommentChild(children);
  3515. const rawProps = toRaw(props);
  3516. const { mode } = rawProps;
  3517. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  3518. warn$1(`invalid <transition> mode: ${mode}`);
  3519. }
  3520. if (state.isLeaving) {
  3521. return emptyPlaceholder(child);
  3522. }
  3523. const innerChild = getInnerChild$1(child);
  3524. if (!innerChild) {
  3525. return emptyPlaceholder(child);
  3526. }
  3527. let enterHooks = resolveTransitionHooks(
  3528. innerChild,
  3529. rawProps,
  3530. state,
  3531. instance,
  3532. // #11061, ensure enterHooks is fresh after clone
  3533. (hooks) => enterHooks = hooks
  3534. );
  3535. if (innerChild.type !== Comment) {
  3536. setTransitionHooks(innerChild, enterHooks);
  3537. }
  3538. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  3539. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
  3540. let leavingHooks = resolveTransitionHooks(
  3541. oldInnerChild,
  3542. rawProps,
  3543. state,
  3544. instance
  3545. );
  3546. setTransitionHooks(oldInnerChild, leavingHooks);
  3547. if (mode === "out-in" && innerChild.type !== Comment) {
  3548. state.isLeaving = true;
  3549. leavingHooks.afterLeave = () => {
  3550. state.isLeaving = false;
  3551. if (!(instance.job.flags & 8)) {
  3552. instance.update();
  3553. }
  3554. delete leavingHooks.afterLeave;
  3555. oldInnerChild = void 0;
  3556. };
  3557. return emptyPlaceholder(child);
  3558. } else if (mode === "in-out" && innerChild.type !== Comment) {
  3559. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  3560. const leavingVNodesCache = getLeavingNodesForType(
  3561. state,
  3562. oldInnerChild
  3563. );
  3564. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  3565. el[leaveCbKey] = () => {
  3566. earlyRemove();
  3567. el[leaveCbKey] = void 0;
  3568. delete enterHooks.delayedLeave;
  3569. oldInnerChild = void 0;
  3570. };
  3571. enterHooks.delayedLeave = () => {
  3572. delayedLeave();
  3573. delete enterHooks.delayedLeave;
  3574. oldInnerChild = void 0;
  3575. };
  3576. };
  3577. } else {
  3578. oldInnerChild = void 0;
  3579. }
  3580. } else if (oldInnerChild) {
  3581. oldInnerChild = void 0;
  3582. }
  3583. return child;
  3584. };
  3585. }
  3586. };
  3587. function findNonCommentChild(children) {
  3588. let child = children[0];
  3589. if (children.length > 1) {
  3590. let hasFound = false;
  3591. for (const c of children) {
  3592. if (c.type !== Comment) {
  3593. if (hasFound) {
  3594. warn$1(
  3595. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  3596. );
  3597. break;
  3598. }
  3599. child = c;
  3600. hasFound = true;
  3601. }
  3602. }
  3603. }
  3604. return child;
  3605. }
  3606. const BaseTransition = BaseTransitionImpl;
  3607. function getLeavingNodesForType(state, vnode) {
  3608. const { leavingVNodes } = state;
  3609. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  3610. if (!leavingVNodesCache) {
  3611. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  3612. leavingVNodes.set(vnode.type, leavingVNodesCache);
  3613. }
  3614. return leavingVNodesCache;
  3615. }
  3616. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  3617. const {
  3618. appear,
  3619. mode,
  3620. persisted = false,
  3621. onBeforeEnter,
  3622. onEnter,
  3623. onAfterEnter,
  3624. onEnterCancelled,
  3625. onBeforeLeave,
  3626. onLeave,
  3627. onAfterLeave,
  3628. onLeaveCancelled,
  3629. onBeforeAppear,
  3630. onAppear,
  3631. onAfterAppear,
  3632. onAppearCancelled
  3633. } = props;
  3634. const key = String(vnode.key);
  3635. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  3636. const callHook = (hook, args) => {
  3637. hook && callWithAsyncErrorHandling(
  3638. hook,
  3639. instance,
  3640. 9,
  3641. args
  3642. );
  3643. };
  3644. const callAsyncHook = (hook, args) => {
  3645. const done = args[1];
  3646. callHook(hook, args);
  3647. if (isArray(hook)) {
  3648. if (hook.every((hook2) => hook2.length <= 1)) done();
  3649. } else if (hook.length <= 1) {
  3650. done();
  3651. }
  3652. };
  3653. const hooks = {
  3654. mode,
  3655. persisted,
  3656. beforeEnter(el) {
  3657. let hook = onBeforeEnter;
  3658. if (!state.isMounted) {
  3659. if (appear) {
  3660. hook = onBeforeAppear || onBeforeEnter;
  3661. } else {
  3662. return;
  3663. }
  3664. }
  3665. if (el[leaveCbKey]) {
  3666. el[leaveCbKey](
  3667. true
  3668. /* cancelled */
  3669. );
  3670. }
  3671. const leavingVNode = leavingVNodesCache[key];
  3672. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  3673. leavingVNode.el[leaveCbKey]();
  3674. }
  3675. callHook(hook, [el]);
  3676. },
  3677. enter(el) {
  3678. let hook = onEnter;
  3679. let afterHook = onAfterEnter;
  3680. let cancelHook = onEnterCancelled;
  3681. if (!state.isMounted) {
  3682. if (appear) {
  3683. hook = onAppear || onEnter;
  3684. afterHook = onAfterAppear || onAfterEnter;
  3685. cancelHook = onAppearCancelled || onEnterCancelled;
  3686. } else {
  3687. return;
  3688. }
  3689. }
  3690. let called = false;
  3691. const done = el[enterCbKey$1] = (cancelled) => {
  3692. if (called) return;
  3693. called = true;
  3694. if (cancelled) {
  3695. callHook(cancelHook, [el]);
  3696. } else {
  3697. callHook(afterHook, [el]);
  3698. }
  3699. if (hooks.delayedLeave) {
  3700. hooks.delayedLeave();
  3701. }
  3702. el[enterCbKey$1] = void 0;
  3703. };
  3704. if (hook) {
  3705. callAsyncHook(hook, [el, done]);
  3706. } else {
  3707. done();
  3708. }
  3709. },
  3710. leave(el, remove) {
  3711. const key2 = String(vnode.key);
  3712. if (el[enterCbKey$1]) {
  3713. el[enterCbKey$1](
  3714. true
  3715. /* cancelled */
  3716. );
  3717. }
  3718. if (state.isUnmounting) {
  3719. return remove();
  3720. }
  3721. callHook(onBeforeLeave, [el]);
  3722. let called = false;
  3723. const done = el[leaveCbKey] = (cancelled) => {
  3724. if (called) return;
  3725. called = true;
  3726. remove();
  3727. if (cancelled) {
  3728. callHook(onLeaveCancelled, [el]);
  3729. } else {
  3730. callHook(onAfterLeave, [el]);
  3731. }
  3732. el[leaveCbKey] = void 0;
  3733. if (leavingVNodesCache[key2] === vnode) {
  3734. delete leavingVNodesCache[key2];
  3735. }
  3736. };
  3737. leavingVNodesCache[key2] = vnode;
  3738. if (onLeave) {
  3739. callAsyncHook(onLeave, [el, done]);
  3740. } else {
  3741. done();
  3742. }
  3743. },
  3744. clone(vnode2) {
  3745. const hooks2 = resolveTransitionHooks(
  3746. vnode2,
  3747. props,
  3748. state,
  3749. instance,
  3750. postClone
  3751. );
  3752. if (postClone) postClone(hooks2);
  3753. return hooks2;
  3754. }
  3755. };
  3756. return hooks;
  3757. }
  3758. function emptyPlaceholder(vnode) {
  3759. if (isKeepAlive(vnode)) {
  3760. vnode = cloneVNode(vnode);
  3761. vnode.children = null;
  3762. return vnode;
  3763. }
  3764. }
  3765. function getInnerChild$1(vnode) {
  3766. if (!isKeepAlive(vnode)) {
  3767. if (isTeleport(vnode.type) && vnode.children) {
  3768. return findNonCommentChild(vnode.children);
  3769. }
  3770. return vnode;
  3771. }
  3772. if (vnode.component) {
  3773. return vnode.component.subTree;
  3774. }
  3775. const { shapeFlag, children } = vnode;
  3776. if (children) {
  3777. if (shapeFlag & 16) {
  3778. return children[0];
  3779. }
  3780. if (shapeFlag & 32 && isFunction(children.default)) {
  3781. return children.default();
  3782. }
  3783. }
  3784. }
  3785. function setTransitionHooks(vnode, hooks) {
  3786. if (vnode.shapeFlag & 6 && vnode.component) {
  3787. vnode.transition = hooks;
  3788. setTransitionHooks(vnode.component.subTree, hooks);
  3789. } else if (vnode.shapeFlag & 128) {
  3790. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3791. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3792. } else {
  3793. vnode.transition = hooks;
  3794. }
  3795. }
  3796. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3797. let ret = [];
  3798. let keyedFragmentCount = 0;
  3799. for (let i = 0; i < children.length; i++) {
  3800. let child = children[i];
  3801. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3802. if (child.type === Fragment) {
  3803. if (child.patchFlag & 128) keyedFragmentCount++;
  3804. ret = ret.concat(
  3805. getTransitionRawChildren(child.children, keepComment, key)
  3806. );
  3807. } else if (keepComment || child.type !== Comment) {
  3808. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3809. }
  3810. }
  3811. if (keyedFragmentCount > 1) {
  3812. for (let i = 0; i < ret.length; i++) {
  3813. ret[i].patchFlag = -2;
  3814. }
  3815. }
  3816. return ret;
  3817. }
  3818. // @__NO_SIDE_EFFECTS__
  3819. function defineComponent(options, extraOptions) {
  3820. return isFunction(options) ? (
  3821. // #8236: extend call and options.name access are considered side-effects
  3822. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3823. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3824. ) : options;
  3825. }
  3826. function useId() {
  3827. const i = getCurrentInstance();
  3828. if (i) {
  3829. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  3830. } else {
  3831. warn$1(
  3832. `useId() is called when there is no active component instance to be associated with.`
  3833. );
  3834. }
  3835. return "";
  3836. }
  3837. function markAsyncBoundary(instance) {
  3838. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  3839. }
  3840. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  3841. function useTemplateRef(key) {
  3842. const i = getCurrentInstance();
  3843. const r = shallowRef(null);
  3844. if (i) {
  3845. const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
  3846. let desc;
  3847. if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
  3848. warn$1(`useTemplateRef('${key}') already exists.`);
  3849. } else {
  3850. Object.defineProperty(refs, key, {
  3851. enumerable: true,
  3852. get: () => r.value,
  3853. set: (val) => r.value = val
  3854. });
  3855. }
  3856. } else {
  3857. warn$1(
  3858. `useTemplateRef() is called when there is no active component instance to be associated with.`
  3859. );
  3860. }
  3861. const ret = readonly(r) ;
  3862. {
  3863. knownTemplateRefs.add(ret);
  3864. }
  3865. return ret;
  3866. }
  3867. const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
  3868. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3869. if (isArray(rawRef)) {
  3870. rawRef.forEach(
  3871. (r, i) => setRef(
  3872. r,
  3873. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3874. parentSuspense,
  3875. vnode,
  3876. isUnmount
  3877. )
  3878. );
  3879. return;
  3880. }
  3881. if (isAsyncWrapper(vnode) && !isUnmount) {
  3882. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  3883. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  3884. }
  3885. return;
  3886. }
  3887. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3888. const value = isUnmount ? null : refValue;
  3889. const { i: owner, r: ref } = rawRef;
  3890. if (!owner) {
  3891. warn$1(
  3892. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  3893. );
  3894. return;
  3895. }
  3896. const oldRef = oldRawRef && oldRawRef.r;
  3897. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3898. const setupState = owner.setupState;
  3899. const rawSetupState = toRaw(setupState);
  3900. const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
  3901. {
  3902. if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
  3903. warn$1(
  3904. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  3905. );
  3906. }
  3907. if (knownTemplateRefs.has(rawSetupState[key])) {
  3908. return false;
  3909. }
  3910. }
  3911. return hasOwn(rawSetupState, key);
  3912. };
  3913. const canSetRef = (ref2) => {
  3914. return !knownTemplateRefs.has(ref2);
  3915. };
  3916. if (oldRef != null && oldRef !== ref) {
  3917. invalidatePendingSetRef(oldRawRef);
  3918. if (isString(oldRef)) {
  3919. refs[oldRef] = null;
  3920. if (canSetSetupRef(oldRef)) {
  3921. setupState[oldRef] = null;
  3922. }
  3923. } else if (isRef(oldRef)) {
  3924. if (canSetRef(oldRef)) {
  3925. oldRef.value = null;
  3926. }
  3927. const oldRawRefAtom = oldRawRef;
  3928. if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
  3929. }
  3930. }
  3931. if (isFunction(ref)) {
  3932. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3933. } else {
  3934. const _isString = isString(ref);
  3935. const _isRef = isRef(ref);
  3936. if (_isString || _isRef) {
  3937. const doSet = () => {
  3938. if (rawRef.f) {
  3939. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
  3940. if (isUnmount) {
  3941. isArray(existing) && remove(existing, refValue);
  3942. } else {
  3943. if (!isArray(existing)) {
  3944. if (_isString) {
  3945. refs[ref] = [refValue];
  3946. if (canSetSetupRef(ref)) {
  3947. setupState[ref] = refs[ref];
  3948. }
  3949. } else {
  3950. const newVal = [refValue];
  3951. if (canSetRef(ref)) {
  3952. ref.value = newVal;
  3953. }
  3954. if (rawRef.k) refs[rawRef.k] = newVal;
  3955. }
  3956. } else if (!existing.includes(refValue)) {
  3957. existing.push(refValue);
  3958. }
  3959. }
  3960. } else if (_isString) {
  3961. refs[ref] = value;
  3962. if (canSetSetupRef(ref)) {
  3963. setupState[ref] = value;
  3964. }
  3965. } else if (_isRef) {
  3966. if (canSetRef(ref)) {
  3967. ref.value = value;
  3968. }
  3969. if (rawRef.k) refs[rawRef.k] = value;
  3970. } else {
  3971. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3972. }
  3973. };
  3974. if (value) {
  3975. const job = () => {
  3976. doSet();
  3977. pendingSetRefMap.delete(rawRef);
  3978. };
  3979. job.id = -1;
  3980. pendingSetRefMap.set(rawRef, job);
  3981. queuePostRenderEffect(job, parentSuspense);
  3982. } else {
  3983. invalidatePendingSetRef(rawRef);
  3984. doSet();
  3985. }
  3986. } else {
  3987. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3988. }
  3989. }
  3990. }
  3991. function invalidatePendingSetRef(rawRef) {
  3992. const pendingSetRef = pendingSetRefMap.get(rawRef);
  3993. if (pendingSetRef) {
  3994. pendingSetRef.flags |= 8;
  3995. pendingSetRefMap.delete(rawRef);
  3996. }
  3997. }
  3998. let hasLoggedMismatchError = false;
  3999. const logMismatchError = () => {
  4000. if (hasLoggedMismatchError) {
  4001. return;
  4002. }
  4003. console.error("Hydration completed but contains mismatches.");
  4004. hasLoggedMismatchError = true;
  4005. };
  4006. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  4007. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  4008. const getContainerType = (container) => {
  4009. if (container.nodeType !== 1) return void 0;
  4010. if (isSVGContainer(container)) return "svg";
  4011. if (isMathMLContainer(container)) return "mathml";
  4012. return void 0;
  4013. };
  4014. const isComment = (node) => node.nodeType === 8;
  4015. function createHydrationFunctions(rendererInternals) {
  4016. const {
  4017. mt: mountComponent,
  4018. p: patch,
  4019. o: {
  4020. patchProp,
  4021. createText,
  4022. nextSibling,
  4023. parentNode,
  4024. remove,
  4025. insert,
  4026. createComment
  4027. }
  4028. } = rendererInternals;
  4029. const hydrate = (vnode, container) => {
  4030. if (!container.hasChildNodes()) {
  4031. warn$1(
  4032. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  4033. );
  4034. patch(null, vnode, container);
  4035. flushPostFlushCbs();
  4036. container._vnode = vnode;
  4037. return;
  4038. }
  4039. hydrateNode(container.firstChild, vnode, null, null, null);
  4040. flushPostFlushCbs();
  4041. container._vnode = vnode;
  4042. };
  4043. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  4044. optimized = optimized || !!vnode.dynamicChildren;
  4045. const isFragmentStart = isComment(node) && node.data === "[";
  4046. const onMismatch = () => handleMismatch(
  4047. node,
  4048. vnode,
  4049. parentComponent,
  4050. parentSuspense,
  4051. slotScopeIds,
  4052. isFragmentStart
  4053. );
  4054. const { type, ref, shapeFlag, patchFlag } = vnode;
  4055. let domType = node.nodeType;
  4056. vnode.el = node;
  4057. {
  4058. def(node, "__vnode", vnode, true);
  4059. def(node, "__vueParentComponent", parentComponent, true);
  4060. }
  4061. if (patchFlag === -2) {
  4062. optimized = false;
  4063. vnode.dynamicChildren = null;
  4064. }
  4065. let nextNode = null;
  4066. switch (type) {
  4067. case Text:
  4068. if (domType !== 3) {
  4069. if (vnode.children === "") {
  4070. insert(vnode.el = createText(""), parentNode(node), node);
  4071. nextNode = node;
  4072. } else {
  4073. nextNode = onMismatch();
  4074. }
  4075. } else {
  4076. if (node.data !== vnode.children) {
  4077. warn$1(
  4078. `Hydration text mismatch in`,
  4079. node.parentNode,
  4080. `
  4081. - rendered on server: ${JSON.stringify(
  4082. node.data
  4083. )}
  4084. - expected on client: ${JSON.stringify(vnode.children)}`
  4085. );
  4086. logMismatchError();
  4087. node.data = vnode.children;
  4088. }
  4089. nextNode = nextSibling(node);
  4090. }
  4091. break;
  4092. case Comment:
  4093. if (isTemplateNode(node)) {
  4094. nextNode = nextSibling(node);
  4095. replaceNode(
  4096. vnode.el = node.content.firstChild,
  4097. node,
  4098. parentComponent
  4099. );
  4100. } else if (domType !== 8 || isFragmentStart) {
  4101. nextNode = onMismatch();
  4102. } else {
  4103. nextNode = nextSibling(node);
  4104. }
  4105. break;
  4106. case Static:
  4107. if (isFragmentStart) {
  4108. node = nextSibling(node);
  4109. domType = node.nodeType;
  4110. }
  4111. if (domType === 1 || domType === 3) {
  4112. nextNode = node;
  4113. const needToAdoptContent = !vnode.children.length;
  4114. for (let i = 0; i < vnode.staticCount; i++) {
  4115. if (needToAdoptContent)
  4116. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  4117. if (i === vnode.staticCount - 1) {
  4118. vnode.anchor = nextNode;
  4119. }
  4120. nextNode = nextSibling(nextNode);
  4121. }
  4122. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  4123. } else {
  4124. onMismatch();
  4125. }
  4126. break;
  4127. case Fragment:
  4128. if (!isFragmentStart) {
  4129. nextNode = onMismatch();
  4130. } else {
  4131. nextNode = hydrateFragment(
  4132. node,
  4133. vnode,
  4134. parentComponent,
  4135. parentSuspense,
  4136. slotScopeIds,
  4137. optimized
  4138. );
  4139. }
  4140. break;
  4141. default:
  4142. if (shapeFlag & 1) {
  4143. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  4144. nextNode = onMismatch();
  4145. } else {
  4146. nextNode = hydrateElement(
  4147. node,
  4148. vnode,
  4149. parentComponent,
  4150. parentSuspense,
  4151. slotScopeIds,
  4152. optimized
  4153. );
  4154. }
  4155. } else if (shapeFlag & 6) {
  4156. vnode.slotScopeIds = slotScopeIds;
  4157. const container = parentNode(node);
  4158. if (isFragmentStart) {
  4159. nextNode = locateClosingAnchor(node);
  4160. } else if (isComment(node) && node.data === "teleport start") {
  4161. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  4162. } else {
  4163. nextNode = nextSibling(node);
  4164. }
  4165. mountComponent(
  4166. vnode,
  4167. container,
  4168. null,
  4169. parentComponent,
  4170. parentSuspense,
  4171. getContainerType(container),
  4172. optimized
  4173. );
  4174. if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
  4175. let subTree;
  4176. if (isFragmentStart) {
  4177. subTree = createVNode(Fragment);
  4178. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  4179. } else {
  4180. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  4181. }
  4182. subTree.el = node;
  4183. vnode.component.subTree = subTree;
  4184. }
  4185. } else if (shapeFlag & 64) {
  4186. if (domType !== 8) {
  4187. nextNode = onMismatch();
  4188. } else {
  4189. nextNode = vnode.type.hydrate(
  4190. node,
  4191. vnode,
  4192. parentComponent,
  4193. parentSuspense,
  4194. slotScopeIds,
  4195. optimized,
  4196. rendererInternals,
  4197. hydrateChildren
  4198. );
  4199. }
  4200. } else if (shapeFlag & 128) {
  4201. nextNode = vnode.type.hydrate(
  4202. node,
  4203. vnode,
  4204. parentComponent,
  4205. parentSuspense,
  4206. getContainerType(parentNode(node)),
  4207. slotScopeIds,
  4208. optimized,
  4209. rendererInternals,
  4210. hydrateNode
  4211. );
  4212. } else {
  4213. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  4214. }
  4215. }
  4216. if (ref != null) {
  4217. setRef(ref, null, parentSuspense, vnode);
  4218. }
  4219. return nextNode;
  4220. };
  4221. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4222. optimized = optimized || !!vnode.dynamicChildren;
  4223. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  4224. const forcePatch = type === "input" || type === "option";
  4225. {
  4226. if (dirs) {
  4227. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4228. }
  4229. let needCallTransitionHooks = false;
  4230. if (isTemplateNode(el)) {
  4231. needCallTransitionHooks = needTransition(
  4232. null,
  4233. // no need check parentSuspense in hydration
  4234. transition
  4235. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  4236. const content = el.content.firstChild;
  4237. if (needCallTransitionHooks) {
  4238. const cls = content.getAttribute("class");
  4239. if (cls) content.$cls = cls;
  4240. transition.beforeEnter(content);
  4241. }
  4242. replaceNode(content, el, parentComponent);
  4243. vnode.el = el = content;
  4244. }
  4245. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  4246. !(props && (props.innerHTML || props.textContent))) {
  4247. let next = hydrateChildren(
  4248. el.firstChild,
  4249. vnode,
  4250. el,
  4251. parentComponent,
  4252. parentSuspense,
  4253. slotScopeIds,
  4254. optimized
  4255. );
  4256. let hasWarned = false;
  4257. while (next) {
  4258. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  4259. if (!hasWarned) {
  4260. warn$1(
  4261. `Hydration children mismatch on`,
  4262. el,
  4263. `
  4264. Server rendered element contains more child nodes than client vdom.`
  4265. );
  4266. hasWarned = true;
  4267. }
  4268. logMismatchError();
  4269. }
  4270. const cur = next;
  4271. next = next.nextSibling;
  4272. remove(cur);
  4273. }
  4274. } else if (shapeFlag & 8) {
  4275. let clientText = vnode.children;
  4276. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  4277. clientText = clientText.slice(1);
  4278. }
  4279. const { textContent } = el;
  4280. if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
  4281. textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
  4282. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  4283. warn$1(
  4284. `Hydration text content mismatch on`,
  4285. el,
  4286. `
  4287. - rendered on server: ${textContent}
  4288. - expected on client: ${clientText}`
  4289. );
  4290. logMismatchError();
  4291. }
  4292. el.textContent = vnode.children;
  4293. }
  4294. }
  4295. if (props) {
  4296. {
  4297. const isCustomElement = el.tagName.includes("-");
  4298. for (const key in props) {
  4299. if (// #11189 skip if this node has directives that have created hooks
  4300. // as it could have mutated the DOM in any possible way
  4301. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  4302. logMismatchError();
  4303. }
  4304. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  4305. key[0] === "." || isCustomElement) {
  4306. patchProp(el, key, null, props[key], void 0, parentComponent);
  4307. }
  4308. }
  4309. }
  4310. }
  4311. let vnodeHooks;
  4312. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  4313. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4314. }
  4315. if (dirs) {
  4316. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4317. }
  4318. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  4319. queueEffectWithSuspense(() => {
  4320. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4321. needCallTransitionHooks && transition.enter(el);
  4322. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4323. }, parentSuspense);
  4324. }
  4325. }
  4326. return el.nextSibling;
  4327. };
  4328. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4329. optimized = optimized || !!parentVNode.dynamicChildren;
  4330. const children = parentVNode.children;
  4331. const l = children.length;
  4332. let hasWarned = false;
  4333. for (let i = 0; i < l; i++) {
  4334. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  4335. const isText = vnode.type === Text;
  4336. if (node) {
  4337. if (isText && !optimized) {
  4338. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  4339. insert(
  4340. createText(
  4341. node.data.slice(vnode.children.length)
  4342. ),
  4343. container,
  4344. nextSibling(node)
  4345. );
  4346. node.data = vnode.children;
  4347. }
  4348. }
  4349. node = hydrateNode(
  4350. node,
  4351. vnode,
  4352. parentComponent,
  4353. parentSuspense,
  4354. slotScopeIds,
  4355. optimized
  4356. );
  4357. } else if (isText && !vnode.children) {
  4358. insert(vnode.el = createText(""), container);
  4359. } else {
  4360. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  4361. if (!hasWarned) {
  4362. warn$1(
  4363. `Hydration children mismatch on`,
  4364. container,
  4365. `
  4366. Server rendered element contains fewer child nodes than client vdom.`
  4367. );
  4368. hasWarned = true;
  4369. }
  4370. logMismatchError();
  4371. }
  4372. patch(
  4373. null,
  4374. vnode,
  4375. container,
  4376. null,
  4377. parentComponent,
  4378. parentSuspense,
  4379. getContainerType(container),
  4380. slotScopeIds
  4381. );
  4382. }
  4383. }
  4384. return node;
  4385. };
  4386. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4387. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  4388. if (fragmentSlotScopeIds) {
  4389. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4390. }
  4391. const container = parentNode(node);
  4392. const next = hydrateChildren(
  4393. nextSibling(node),
  4394. vnode,
  4395. container,
  4396. parentComponent,
  4397. parentSuspense,
  4398. slotScopeIds,
  4399. optimized
  4400. );
  4401. if (next && isComment(next) && next.data === "]") {
  4402. return nextSibling(vnode.anchor = next);
  4403. } else {
  4404. logMismatchError();
  4405. insert(vnode.anchor = createComment(`]`), container, next);
  4406. return next;
  4407. }
  4408. };
  4409. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  4410. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  4411. warn$1(
  4412. `Hydration node mismatch:
  4413. - rendered on server:`,
  4414. node,
  4415. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  4416. `
  4417. - expected on client:`,
  4418. vnode.type
  4419. );
  4420. logMismatchError();
  4421. }
  4422. vnode.el = null;
  4423. if (isFragment) {
  4424. const end = locateClosingAnchor(node);
  4425. while (true) {
  4426. const next2 = nextSibling(node);
  4427. if (next2 && next2 !== end) {
  4428. remove(next2);
  4429. } else {
  4430. break;
  4431. }
  4432. }
  4433. }
  4434. const next = nextSibling(node);
  4435. const container = parentNode(node);
  4436. remove(node);
  4437. patch(
  4438. null,
  4439. vnode,
  4440. container,
  4441. next,
  4442. parentComponent,
  4443. parentSuspense,
  4444. getContainerType(container),
  4445. slotScopeIds
  4446. );
  4447. if (parentComponent) {
  4448. parentComponent.vnode.el = vnode.el;
  4449. updateHOCHostEl(parentComponent, vnode.el);
  4450. }
  4451. return next;
  4452. };
  4453. const locateClosingAnchor = (node, open = "[", close = "]") => {
  4454. let match = 0;
  4455. while (node) {
  4456. node = nextSibling(node);
  4457. if (node && isComment(node)) {
  4458. if (node.data === open) match++;
  4459. if (node.data === close) {
  4460. if (match === 0) {
  4461. return nextSibling(node);
  4462. } else {
  4463. match--;
  4464. }
  4465. }
  4466. }
  4467. }
  4468. return node;
  4469. };
  4470. const replaceNode = (newNode, oldNode, parentComponent) => {
  4471. const parentNode2 = oldNode.parentNode;
  4472. if (parentNode2) {
  4473. parentNode2.replaceChild(newNode, oldNode);
  4474. }
  4475. let parent = parentComponent;
  4476. while (parent) {
  4477. if (parent.vnode.el === oldNode) {
  4478. parent.vnode.el = parent.subTree.el = newNode;
  4479. }
  4480. parent = parent.parent;
  4481. }
  4482. };
  4483. const isTemplateNode = (node) => {
  4484. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  4485. };
  4486. return [hydrate, hydrateNode];
  4487. }
  4488. function propHasMismatch(el, key, clientValue, vnode, instance) {
  4489. let mismatchType;
  4490. let mismatchKey;
  4491. let actual;
  4492. let expected;
  4493. if (key === "class") {
  4494. if (el.$cls) {
  4495. actual = el.$cls;
  4496. delete el.$cls;
  4497. } else {
  4498. actual = el.getAttribute("class");
  4499. }
  4500. expected = normalizeClass(clientValue);
  4501. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  4502. mismatchType = 2 /* CLASS */;
  4503. mismatchKey = `class`;
  4504. }
  4505. } else if (key === "style") {
  4506. actual = el.getAttribute("style") || "";
  4507. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  4508. const actualMap = toStyleMap(actual);
  4509. const expectedMap = toStyleMap(expected);
  4510. if (vnode.dirs) {
  4511. for (const { dir, value } of vnode.dirs) {
  4512. if (dir.name === "show" && !value) {
  4513. expectedMap.set("display", "none");
  4514. }
  4515. }
  4516. }
  4517. if (instance) {
  4518. resolveCssVars(instance, vnode, expectedMap);
  4519. }
  4520. if (!isMapEqual(actualMap, expectedMap)) {
  4521. mismatchType = 3 /* STYLE */;
  4522. mismatchKey = "style";
  4523. }
  4524. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  4525. if (isBooleanAttr(key)) {
  4526. actual = el.hasAttribute(key);
  4527. expected = includeBooleanAttr(clientValue);
  4528. } else if (clientValue == null) {
  4529. actual = el.hasAttribute(key);
  4530. expected = false;
  4531. } else {
  4532. if (el.hasAttribute(key)) {
  4533. actual = el.getAttribute(key);
  4534. } else if (key === "value" && el.tagName === "TEXTAREA") {
  4535. actual = el.value;
  4536. } else {
  4537. actual = false;
  4538. }
  4539. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  4540. }
  4541. if (actual !== expected) {
  4542. mismatchType = 4 /* ATTRIBUTE */;
  4543. mismatchKey = key;
  4544. }
  4545. }
  4546. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  4547. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  4548. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  4549. const postSegment = `
  4550. - rendered on server: ${format(actual)}
  4551. - expected on client: ${format(expected)}
  4552. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  4553. You should fix the source of the mismatch.`;
  4554. {
  4555. warn$1(preSegment, el, postSegment);
  4556. }
  4557. return true;
  4558. }
  4559. return false;
  4560. }
  4561. function toClassSet(str) {
  4562. return new Set(str.trim().split(/\s+/));
  4563. }
  4564. function isSetEqual(a, b) {
  4565. if (a.size !== b.size) {
  4566. return false;
  4567. }
  4568. for (const s of a) {
  4569. if (!b.has(s)) {
  4570. return false;
  4571. }
  4572. }
  4573. return true;
  4574. }
  4575. function toStyleMap(str) {
  4576. const styleMap = /* @__PURE__ */ new Map();
  4577. for (const item of str.split(";")) {
  4578. let [key, value] = item.split(":");
  4579. key = key.trim();
  4580. value = value && value.trim();
  4581. if (key && value) {
  4582. styleMap.set(key, value);
  4583. }
  4584. }
  4585. return styleMap;
  4586. }
  4587. function isMapEqual(a, b) {
  4588. if (a.size !== b.size) {
  4589. return false;
  4590. }
  4591. for (const [key, value] of a) {
  4592. if (value !== b.get(key)) {
  4593. return false;
  4594. }
  4595. }
  4596. return true;
  4597. }
  4598. function resolveCssVars(instance, vnode, expectedMap) {
  4599. const root = instance.subTree;
  4600. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  4601. const cssVars = instance.getCssVars();
  4602. for (const key in cssVars) {
  4603. const value = normalizeCssVarValue(cssVars[key]);
  4604. expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
  4605. }
  4606. }
  4607. if (vnode === root && instance.parent) {
  4608. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  4609. }
  4610. }
  4611. const allowMismatchAttr = "data-allow-mismatch";
  4612. const MismatchTypeString = {
  4613. [0 /* TEXT */]: "text",
  4614. [1 /* CHILDREN */]: "children",
  4615. [2 /* CLASS */]: "class",
  4616. [3 /* STYLE */]: "style",
  4617. [4 /* ATTRIBUTE */]: "attribute"
  4618. };
  4619. function isMismatchAllowed(el, allowedType) {
  4620. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  4621. while (el && !el.hasAttribute(allowMismatchAttr)) {
  4622. el = el.parentElement;
  4623. }
  4624. }
  4625. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  4626. if (allowedAttr == null) {
  4627. return false;
  4628. } else if (allowedAttr === "") {
  4629. return true;
  4630. } else {
  4631. const list = allowedAttr.split(",");
  4632. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  4633. return true;
  4634. }
  4635. return list.includes(MismatchTypeString[allowedType]);
  4636. }
  4637. }
  4638. const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  4639. const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  4640. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  4641. const id = requestIdleCallback(hydrate, { timeout });
  4642. return () => cancelIdleCallback(id);
  4643. };
  4644. function elementIsVisibleInViewport(el) {
  4645. const { top, left, bottom, right } = el.getBoundingClientRect();
  4646. const { innerHeight, innerWidth } = window;
  4647. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  4648. }
  4649. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  4650. const ob = new IntersectionObserver((entries) => {
  4651. for (const e of entries) {
  4652. if (!e.isIntersecting) continue;
  4653. ob.disconnect();
  4654. hydrate();
  4655. break;
  4656. }
  4657. }, opts);
  4658. forEach((el) => {
  4659. if (!(el instanceof Element)) return;
  4660. if (elementIsVisibleInViewport(el)) {
  4661. hydrate();
  4662. ob.disconnect();
  4663. return false;
  4664. }
  4665. ob.observe(el);
  4666. });
  4667. return () => ob.disconnect();
  4668. };
  4669. const hydrateOnMediaQuery = (query) => (hydrate) => {
  4670. if (query) {
  4671. const mql = matchMedia(query);
  4672. if (mql.matches) {
  4673. hydrate();
  4674. } else {
  4675. mql.addEventListener("change", hydrate, { once: true });
  4676. return () => mql.removeEventListener("change", hydrate);
  4677. }
  4678. }
  4679. };
  4680. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  4681. if (isString(interactions)) interactions = [interactions];
  4682. let hasHydrated = false;
  4683. const doHydrate = (e) => {
  4684. if (!hasHydrated) {
  4685. hasHydrated = true;
  4686. teardown();
  4687. hydrate();
  4688. e.target.dispatchEvent(new e.constructor(e.type, e));
  4689. }
  4690. };
  4691. const teardown = () => {
  4692. forEach((el) => {
  4693. for (const i of interactions) {
  4694. el.removeEventListener(i, doHydrate);
  4695. }
  4696. });
  4697. };
  4698. forEach((el) => {
  4699. for (const i of interactions) {
  4700. el.addEventListener(i, doHydrate, { once: true });
  4701. }
  4702. });
  4703. return teardown;
  4704. };
  4705. function forEachElement(node, cb) {
  4706. if (isComment(node) && node.data === "[") {
  4707. let depth = 1;
  4708. let next = node.nextSibling;
  4709. while (next) {
  4710. if (next.nodeType === 1) {
  4711. const result = cb(next);
  4712. if (result === false) {
  4713. break;
  4714. }
  4715. } else if (isComment(next)) {
  4716. if (next.data === "]") {
  4717. if (--depth === 0) break;
  4718. } else if (next.data === "[") {
  4719. depth++;
  4720. }
  4721. }
  4722. next = next.nextSibling;
  4723. }
  4724. } else {
  4725. cb(node);
  4726. }
  4727. }
  4728. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  4729. // @__NO_SIDE_EFFECTS__
  4730. function defineAsyncComponent(source) {
  4731. if (isFunction(source)) {
  4732. source = { loader: source };
  4733. }
  4734. const {
  4735. loader,
  4736. loadingComponent,
  4737. errorComponent,
  4738. delay = 200,
  4739. hydrate: hydrateStrategy,
  4740. timeout,
  4741. // undefined = never times out
  4742. suspensible = true,
  4743. onError: userOnError
  4744. } = source;
  4745. let pendingRequest = null;
  4746. let resolvedComp;
  4747. let retries = 0;
  4748. const retry = () => {
  4749. retries++;
  4750. pendingRequest = null;
  4751. return load();
  4752. };
  4753. const load = () => {
  4754. let thisRequest;
  4755. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  4756. err = err instanceof Error ? err : new Error(String(err));
  4757. if (userOnError) {
  4758. return new Promise((resolve, reject) => {
  4759. const userRetry = () => resolve(retry());
  4760. const userFail = () => reject(err);
  4761. userOnError(err, userRetry, userFail, retries + 1);
  4762. });
  4763. } else {
  4764. throw err;
  4765. }
  4766. }).then((comp) => {
  4767. if (thisRequest !== pendingRequest && pendingRequest) {
  4768. return pendingRequest;
  4769. }
  4770. if (!comp) {
  4771. warn$1(
  4772. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  4773. );
  4774. }
  4775. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  4776. comp = comp.default;
  4777. }
  4778. if (comp && !isObject(comp) && !isFunction(comp)) {
  4779. throw new Error(`Invalid async component load result: ${comp}`);
  4780. }
  4781. resolvedComp = comp;
  4782. return comp;
  4783. }));
  4784. };
  4785. return defineComponent({
  4786. name: "AsyncComponentWrapper",
  4787. __asyncLoader: load,
  4788. __asyncHydrate(el, instance, hydrate) {
  4789. let patched = false;
  4790. (instance.bu || (instance.bu = [])).push(() => patched = true);
  4791. const performHydrate = () => {
  4792. if (patched) {
  4793. {
  4794. warn$1(
  4795. `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
  4796. );
  4797. }
  4798. return;
  4799. }
  4800. hydrate();
  4801. };
  4802. const doHydrate = hydrateStrategy ? () => {
  4803. const teardown = hydrateStrategy(
  4804. performHydrate,
  4805. (cb) => forEachElement(el, cb)
  4806. );
  4807. if (teardown) {
  4808. (instance.bum || (instance.bum = [])).push(teardown);
  4809. }
  4810. } : performHydrate;
  4811. if (resolvedComp) {
  4812. doHydrate();
  4813. } else {
  4814. load().then(() => !instance.isUnmounted && doHydrate());
  4815. }
  4816. },
  4817. get __asyncResolved() {
  4818. return resolvedComp;
  4819. },
  4820. setup() {
  4821. const instance = currentInstance;
  4822. markAsyncBoundary(instance);
  4823. if (resolvedComp) {
  4824. return () => createInnerComp(resolvedComp, instance);
  4825. }
  4826. const onError = (err) => {
  4827. pendingRequest = null;
  4828. handleError(
  4829. err,
  4830. instance,
  4831. 13,
  4832. !errorComponent
  4833. );
  4834. };
  4835. if (suspensible && instance.suspense || false) {
  4836. return load().then((comp) => {
  4837. return () => createInnerComp(comp, instance);
  4838. }).catch((err) => {
  4839. onError(err);
  4840. return () => errorComponent ? createVNode(errorComponent, {
  4841. error: err
  4842. }) : null;
  4843. });
  4844. }
  4845. const loaded = ref(false);
  4846. const error = ref();
  4847. const delayed = ref(!!delay);
  4848. if (delay) {
  4849. setTimeout(() => {
  4850. delayed.value = false;
  4851. }, delay);
  4852. }
  4853. if (timeout != null) {
  4854. setTimeout(() => {
  4855. if (!loaded.value && !error.value) {
  4856. const err = new Error(
  4857. `Async component timed out after ${timeout}ms.`
  4858. );
  4859. onError(err);
  4860. error.value = err;
  4861. }
  4862. }, timeout);
  4863. }
  4864. load().then(() => {
  4865. loaded.value = true;
  4866. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  4867. instance.parent.update();
  4868. }
  4869. }).catch((err) => {
  4870. onError(err);
  4871. error.value = err;
  4872. });
  4873. return () => {
  4874. if (loaded.value && resolvedComp) {
  4875. return createInnerComp(resolvedComp, instance);
  4876. } else if (error.value && errorComponent) {
  4877. return createVNode(errorComponent, {
  4878. error: error.value
  4879. });
  4880. } else if (loadingComponent && !delayed.value) {
  4881. return createInnerComp(
  4882. loadingComponent,
  4883. instance
  4884. );
  4885. }
  4886. };
  4887. }
  4888. });
  4889. }
  4890. function createInnerComp(comp, parent) {
  4891. const { ref: ref2, props, children, ce } = parent.vnode;
  4892. const vnode = createVNode(comp, props, children);
  4893. vnode.ref = ref2;
  4894. vnode.ce = ce;
  4895. delete parent.vnode.ce;
  4896. return vnode;
  4897. }
  4898. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  4899. const KeepAliveImpl = {
  4900. name: `KeepAlive`,
  4901. // Marker for special handling inside the renderer. We are not using a ===
  4902. // check directly on KeepAlive in the renderer, because importing it directly
  4903. // would prevent it from being tree-shaken.
  4904. __isKeepAlive: true,
  4905. props: {
  4906. include: [String, RegExp, Array],
  4907. exclude: [String, RegExp, Array],
  4908. max: [String, Number]
  4909. },
  4910. setup(props, { slots }) {
  4911. const instance = getCurrentInstance();
  4912. const sharedContext = instance.ctx;
  4913. const cache = /* @__PURE__ */ new Map();
  4914. const keys = /* @__PURE__ */ new Set();
  4915. let current = null;
  4916. {
  4917. instance.__v_cache = cache;
  4918. }
  4919. const parentSuspense = instance.suspense;
  4920. const {
  4921. renderer: {
  4922. p: patch,
  4923. m: move,
  4924. um: _unmount,
  4925. o: { createElement }
  4926. }
  4927. } = sharedContext;
  4928. const storageContainer = createElement("div");
  4929. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  4930. const instance2 = vnode.component;
  4931. move(vnode, container, anchor, 0, parentSuspense);
  4932. patch(
  4933. instance2.vnode,
  4934. vnode,
  4935. container,
  4936. anchor,
  4937. instance2,
  4938. parentSuspense,
  4939. namespace,
  4940. vnode.slotScopeIds,
  4941. optimized
  4942. );
  4943. queuePostRenderEffect(() => {
  4944. instance2.isDeactivated = false;
  4945. if (instance2.a) {
  4946. invokeArrayFns(instance2.a);
  4947. }
  4948. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  4949. if (vnodeHook) {
  4950. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4951. }
  4952. }, parentSuspense);
  4953. {
  4954. devtoolsComponentAdded(instance2);
  4955. }
  4956. };
  4957. sharedContext.deactivate = (vnode) => {
  4958. const instance2 = vnode.component;
  4959. invalidateMount(instance2.m);
  4960. invalidateMount(instance2.a);
  4961. move(vnode, storageContainer, null, 1, parentSuspense);
  4962. queuePostRenderEffect(() => {
  4963. if (instance2.da) {
  4964. invokeArrayFns(instance2.da);
  4965. }
  4966. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  4967. if (vnodeHook) {
  4968. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4969. }
  4970. instance2.isDeactivated = true;
  4971. }, parentSuspense);
  4972. {
  4973. devtoolsComponentAdded(instance2);
  4974. }
  4975. {
  4976. instance2.__keepAliveStorageContainer = storageContainer;
  4977. }
  4978. };
  4979. function unmount(vnode) {
  4980. resetShapeFlag(vnode);
  4981. _unmount(vnode, instance, parentSuspense, true);
  4982. }
  4983. function pruneCache(filter) {
  4984. cache.forEach((vnode, key) => {
  4985. const name = getComponentName(
  4986. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
  4987. );
  4988. if (name && !filter(name)) {
  4989. pruneCacheEntry(key);
  4990. }
  4991. });
  4992. }
  4993. function pruneCacheEntry(key) {
  4994. const cached = cache.get(key);
  4995. if (cached && (!current || !isSameVNodeType(cached, current))) {
  4996. unmount(cached);
  4997. } else if (current) {
  4998. resetShapeFlag(current);
  4999. }
  5000. cache.delete(key);
  5001. keys.delete(key);
  5002. }
  5003. watch(
  5004. () => [props.include, props.exclude],
  5005. ([include, exclude]) => {
  5006. include && pruneCache((name) => matches(include, name));
  5007. exclude && pruneCache((name) => !matches(exclude, name));
  5008. },
  5009. // prune post-render after `current` has been updated
  5010. { flush: "post", deep: true }
  5011. );
  5012. let pendingCacheKey = null;
  5013. const cacheSubtree = () => {
  5014. if (pendingCacheKey != null) {
  5015. if (isSuspense(instance.subTree.type)) {
  5016. queuePostRenderEffect(() => {
  5017. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  5018. }, instance.subTree.suspense);
  5019. } else {
  5020. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  5021. }
  5022. }
  5023. };
  5024. onMounted(cacheSubtree);
  5025. onUpdated(cacheSubtree);
  5026. onBeforeUnmount(() => {
  5027. cache.forEach((cached) => {
  5028. const { subTree, suspense } = instance;
  5029. const vnode = getInnerChild(subTree);
  5030. if (cached.type === vnode.type && cached.key === vnode.key) {
  5031. resetShapeFlag(vnode);
  5032. const da = vnode.component.da;
  5033. da && queuePostRenderEffect(da, suspense);
  5034. return;
  5035. }
  5036. unmount(cached);
  5037. });
  5038. });
  5039. return () => {
  5040. pendingCacheKey = null;
  5041. if (!slots.default) {
  5042. return current = null;
  5043. }
  5044. const children = slots.default();
  5045. const rawVNode = children[0];
  5046. if (children.length > 1) {
  5047. {
  5048. warn$1(`KeepAlive should contain exactly one component child.`);
  5049. }
  5050. current = null;
  5051. return children;
  5052. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  5053. current = null;
  5054. return rawVNode;
  5055. }
  5056. let vnode = getInnerChild(rawVNode);
  5057. if (vnode.type === Comment) {
  5058. current = null;
  5059. return vnode;
  5060. }
  5061. const comp = vnode.type;
  5062. const name = getComponentName(
  5063. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  5064. );
  5065. const { include, exclude, max } = props;
  5066. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  5067. vnode.shapeFlag &= -257;
  5068. current = vnode;
  5069. return rawVNode;
  5070. }
  5071. const key = vnode.key == null ? comp : vnode.key;
  5072. const cachedVNode = cache.get(key);
  5073. if (vnode.el) {
  5074. vnode = cloneVNode(vnode);
  5075. if (rawVNode.shapeFlag & 128) {
  5076. rawVNode.ssContent = vnode;
  5077. }
  5078. }
  5079. pendingCacheKey = key;
  5080. if (cachedVNode) {
  5081. vnode.el = cachedVNode.el;
  5082. vnode.component = cachedVNode.component;
  5083. if (vnode.transition) {
  5084. setTransitionHooks(vnode, vnode.transition);
  5085. }
  5086. vnode.shapeFlag |= 512;
  5087. keys.delete(key);
  5088. keys.add(key);
  5089. } else {
  5090. keys.add(key);
  5091. if (max && keys.size > parseInt(max, 10)) {
  5092. pruneCacheEntry(keys.values().next().value);
  5093. }
  5094. }
  5095. vnode.shapeFlag |= 256;
  5096. current = vnode;
  5097. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  5098. };
  5099. }
  5100. };
  5101. const KeepAlive = KeepAliveImpl;
  5102. function matches(pattern, name) {
  5103. if (isArray(pattern)) {
  5104. return pattern.some((p) => matches(p, name));
  5105. } else if (isString(pattern)) {
  5106. return pattern.split(",").includes(name);
  5107. } else if (isRegExp(pattern)) {
  5108. pattern.lastIndex = 0;
  5109. return pattern.test(name);
  5110. }
  5111. return false;
  5112. }
  5113. function onActivated(hook, target) {
  5114. registerKeepAliveHook(hook, "a", target);
  5115. }
  5116. function onDeactivated(hook, target) {
  5117. registerKeepAliveHook(hook, "da", target);
  5118. }
  5119. function registerKeepAliveHook(hook, type, target = currentInstance) {
  5120. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  5121. let current = target;
  5122. while (current) {
  5123. if (current.isDeactivated) {
  5124. return;
  5125. }
  5126. current = current.parent;
  5127. }
  5128. return hook();
  5129. });
  5130. injectHook(type, wrappedHook, target);
  5131. if (target) {
  5132. let current = target.parent;
  5133. while (current && current.parent) {
  5134. if (isKeepAlive(current.parent.vnode)) {
  5135. injectToKeepAliveRoot(wrappedHook, type, target, current);
  5136. }
  5137. current = current.parent;
  5138. }
  5139. }
  5140. }
  5141. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  5142. const injected = injectHook(
  5143. type,
  5144. hook,
  5145. keepAliveRoot,
  5146. true
  5147. /* prepend */
  5148. );
  5149. onUnmounted(() => {
  5150. remove(keepAliveRoot[type], injected);
  5151. }, target);
  5152. }
  5153. function resetShapeFlag(vnode) {
  5154. vnode.shapeFlag &= -257;
  5155. vnode.shapeFlag &= -513;
  5156. }
  5157. function getInnerChild(vnode) {
  5158. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  5159. }
  5160. function injectHook(type, hook, target = currentInstance, prepend = false) {
  5161. if (target) {
  5162. const hooks = target[type] || (target[type] = []);
  5163. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  5164. pauseTracking();
  5165. const reset = setCurrentInstance(target);
  5166. const res = callWithAsyncErrorHandling(hook, target, type, args);
  5167. reset();
  5168. resetTracking();
  5169. return res;
  5170. });
  5171. if (prepend) {
  5172. hooks.unshift(wrappedHook);
  5173. } else {
  5174. hooks.push(wrappedHook);
  5175. }
  5176. return wrappedHook;
  5177. } else {
  5178. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  5179. warn$1(
  5180. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
  5181. );
  5182. }
  5183. }
  5184. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  5185. if (!isInSSRComponentSetup || lifecycle === "sp") {
  5186. injectHook(lifecycle, (...args) => hook(...args), target);
  5187. }
  5188. };
  5189. const onBeforeMount = createHook("bm");
  5190. const onMounted = createHook("m");
  5191. const onBeforeUpdate = createHook(
  5192. "bu"
  5193. );
  5194. const onUpdated = createHook("u");
  5195. const onBeforeUnmount = createHook(
  5196. "bum"
  5197. );
  5198. const onUnmounted = createHook("um");
  5199. const onServerPrefetch = createHook(
  5200. "sp"
  5201. );
  5202. const onRenderTriggered = createHook("rtg");
  5203. const onRenderTracked = createHook("rtc");
  5204. function onErrorCaptured(hook, target = currentInstance) {
  5205. injectHook("ec", hook, target);
  5206. }
  5207. const COMPONENTS = "components";
  5208. const DIRECTIVES = "directives";
  5209. function resolveComponent(name, maybeSelfReference) {
  5210. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  5211. }
  5212. const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
  5213. function resolveDynamicComponent(component) {
  5214. if (isString(component)) {
  5215. return resolveAsset(COMPONENTS, component, false) || component;
  5216. } else {
  5217. return component || NULL_DYNAMIC_COMPONENT;
  5218. }
  5219. }
  5220. function resolveDirective(name) {
  5221. return resolveAsset(DIRECTIVES, name);
  5222. }
  5223. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  5224. const instance = currentRenderingInstance || currentInstance;
  5225. if (instance) {
  5226. const Component = instance.type;
  5227. if (type === COMPONENTS) {
  5228. const selfName = getComponentName(
  5229. Component,
  5230. false
  5231. );
  5232. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  5233. return Component;
  5234. }
  5235. }
  5236. const res = (
  5237. // local registration
  5238. // check instance[type] first which is resolved for options API
  5239. resolve(instance[type] || Component[type], name) || // global registration
  5240. resolve(instance.appContext[type], name)
  5241. );
  5242. if (!res && maybeSelfReference) {
  5243. return Component;
  5244. }
  5245. if (warnMissing && !res) {
  5246. const extra = type === COMPONENTS ? `
  5247. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  5248. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  5249. }
  5250. return res;
  5251. } else {
  5252. warn$1(
  5253. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  5254. );
  5255. }
  5256. }
  5257. function resolve(registry, name) {
  5258. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  5259. }
  5260. function renderList(source, renderItem, cache, index) {
  5261. let ret;
  5262. const cached = cache && cache[index];
  5263. const sourceIsArray = isArray(source);
  5264. if (sourceIsArray || isString(source)) {
  5265. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  5266. let needsWrap = false;
  5267. let isReadonlySource = false;
  5268. if (sourceIsReactiveArray) {
  5269. needsWrap = !isShallow(source);
  5270. isReadonlySource = isReadonly(source);
  5271. source = shallowReadArray(source);
  5272. }
  5273. ret = new Array(source.length);
  5274. for (let i = 0, l = source.length; i < l; i++) {
  5275. ret[i] = renderItem(
  5276. needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
  5277. i,
  5278. void 0,
  5279. cached && cached[i]
  5280. );
  5281. }
  5282. } else if (typeof source === "number") {
  5283. if (!Number.isInteger(source)) {
  5284. warn$1(`The v-for range expect an integer value but got ${source}.`);
  5285. }
  5286. ret = new Array(source);
  5287. for (let i = 0; i < source; i++) {
  5288. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  5289. }
  5290. } else if (isObject(source)) {
  5291. if (source[Symbol.iterator]) {
  5292. ret = Array.from(
  5293. source,
  5294. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  5295. );
  5296. } else {
  5297. const keys = Object.keys(source);
  5298. ret = new Array(keys.length);
  5299. for (let i = 0, l = keys.length; i < l; i++) {
  5300. const key = keys[i];
  5301. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  5302. }
  5303. }
  5304. } else {
  5305. ret = [];
  5306. }
  5307. if (cache) {
  5308. cache[index] = ret;
  5309. }
  5310. return ret;
  5311. }
  5312. function createSlots(slots, dynamicSlots) {
  5313. for (let i = 0; i < dynamicSlots.length; i++) {
  5314. const slot = dynamicSlots[i];
  5315. if (isArray(slot)) {
  5316. for (let j = 0; j < slot.length; j++) {
  5317. slots[slot[j].name] = slot[j].fn;
  5318. }
  5319. } else if (slot) {
  5320. slots[slot.name] = slot.key ? (...args) => {
  5321. const res = slot.fn(...args);
  5322. if (res) res.key = slot.key;
  5323. return res;
  5324. } : slot.fn;
  5325. }
  5326. }
  5327. return slots;
  5328. }
  5329. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  5330. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  5331. const hasProps = Object.keys(props).length > 0;
  5332. if (name !== "default") props.name = name;
  5333. return openBlock(), createBlock(
  5334. Fragment,
  5335. null,
  5336. [createVNode("slot", props, fallback && fallback())],
  5337. hasProps ? -2 : 64
  5338. );
  5339. }
  5340. let slot = slots[name];
  5341. if (slot && slot.length > 1) {
  5342. warn$1(
  5343. `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
  5344. );
  5345. slot = () => [];
  5346. }
  5347. if (slot && slot._c) {
  5348. slot._d = false;
  5349. }
  5350. openBlock();
  5351. const validSlotContent = slot && ensureValidVNode(slot(props));
  5352. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  5353. // key attached in the `createSlots` helper, respect that
  5354. validSlotContent && validSlotContent.key;
  5355. const rendered = createBlock(
  5356. Fragment,
  5357. {
  5358. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  5359. (!validSlotContent && fallback ? "_fb" : "")
  5360. },
  5361. validSlotContent || (fallback ? fallback() : []),
  5362. validSlotContent && slots._ === 1 ? 64 : -2
  5363. );
  5364. if (!noSlotted && rendered.scopeId) {
  5365. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  5366. }
  5367. if (slot && slot._c) {
  5368. slot._d = true;
  5369. }
  5370. return rendered;
  5371. }
  5372. function ensureValidVNode(vnodes) {
  5373. return vnodes.some((child) => {
  5374. if (!isVNode(child)) return true;
  5375. if (child.type === Comment) return false;
  5376. if (child.type === Fragment && !ensureValidVNode(child.children))
  5377. return false;
  5378. return true;
  5379. }) ? vnodes : null;
  5380. }
  5381. function toHandlers(obj, preserveCaseIfNecessary) {
  5382. const ret = {};
  5383. if (!isObject(obj)) {
  5384. warn$1(`v-on with no argument expects an object value.`);
  5385. return ret;
  5386. }
  5387. for (const key in obj) {
  5388. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  5389. }
  5390. return ret;
  5391. }
  5392. const getPublicInstance = (i) => {
  5393. if (!i) return null;
  5394. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  5395. return getPublicInstance(i.parent);
  5396. };
  5397. const publicPropertiesMap = (
  5398. // Move PURE marker to new line to workaround compiler discarding it
  5399. // due to type annotation
  5400. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  5401. $: (i) => i,
  5402. $el: (i) => i.vnode.el,
  5403. $data: (i) => i.data,
  5404. $props: (i) => shallowReadonly(i.props) ,
  5405. $attrs: (i) => shallowReadonly(i.attrs) ,
  5406. $slots: (i) => shallowReadonly(i.slots) ,
  5407. $refs: (i) => shallowReadonly(i.refs) ,
  5408. $parent: (i) => getPublicInstance(i.parent),
  5409. $root: (i) => getPublicInstance(i.root),
  5410. $host: (i) => i.ce,
  5411. $emit: (i) => i.emit,
  5412. $options: (i) => resolveMergedOptions(i) ,
  5413. $forceUpdate: (i) => i.f || (i.f = () => {
  5414. queueJob(i.update);
  5415. }),
  5416. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  5417. $watch: (i) => instanceWatch.bind(i)
  5418. })
  5419. );
  5420. const isReservedPrefix = (key) => key === "_" || key === "$";
  5421. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  5422. const PublicInstanceProxyHandlers = {
  5423. get({ _: instance }, key) {
  5424. if (key === "__v_skip") {
  5425. return true;
  5426. }
  5427. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  5428. if (key === "__isVue") {
  5429. return true;
  5430. }
  5431. if (key[0] !== "$") {
  5432. const n = accessCache[key];
  5433. if (n !== void 0) {
  5434. switch (n) {
  5435. case 1 /* SETUP */:
  5436. return setupState[key];
  5437. case 2 /* DATA */:
  5438. return data[key];
  5439. case 4 /* CONTEXT */:
  5440. return ctx[key];
  5441. case 3 /* PROPS */:
  5442. return props[key];
  5443. }
  5444. } else if (hasSetupBinding(setupState, key)) {
  5445. accessCache[key] = 1 /* SETUP */;
  5446. return setupState[key];
  5447. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5448. accessCache[key] = 2 /* DATA */;
  5449. return data[key];
  5450. } else if (hasOwn(props, key)) {
  5451. accessCache[key] = 3 /* PROPS */;
  5452. return props[key];
  5453. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5454. accessCache[key] = 4 /* CONTEXT */;
  5455. return ctx[key];
  5456. } else if (shouldCacheAccess) {
  5457. accessCache[key] = 0 /* OTHER */;
  5458. }
  5459. }
  5460. const publicGetter = publicPropertiesMap[key];
  5461. let cssModule, globalProperties;
  5462. if (publicGetter) {
  5463. if (key === "$attrs") {
  5464. track(instance.attrs, "get", "");
  5465. markAttrsAccessed();
  5466. } else if (key === "$slots") {
  5467. track(instance, "get", key);
  5468. }
  5469. return publicGetter(instance);
  5470. } else if (
  5471. // css module (injected by vue-loader)
  5472. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  5473. ) {
  5474. return cssModule;
  5475. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5476. accessCache[key] = 4 /* CONTEXT */;
  5477. return ctx[key];
  5478. } else if (
  5479. // global properties
  5480. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  5481. ) {
  5482. {
  5483. return globalProperties[key];
  5484. }
  5485. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  5486. // to infinite warning loop
  5487. key.indexOf("__v") !== 0)) {
  5488. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  5489. warn$1(
  5490. `Property ${JSON.stringify(
  5491. key
  5492. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  5493. );
  5494. } else if (instance === currentRenderingInstance) {
  5495. warn$1(
  5496. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  5497. );
  5498. }
  5499. }
  5500. },
  5501. set({ _: instance }, key, value) {
  5502. const { data, setupState, ctx } = instance;
  5503. if (hasSetupBinding(setupState, key)) {
  5504. setupState[key] = value;
  5505. return true;
  5506. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  5507. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  5508. return false;
  5509. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5510. data[key] = value;
  5511. return true;
  5512. } else if (hasOwn(instance.props, key)) {
  5513. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  5514. return false;
  5515. }
  5516. if (key[0] === "$" && key.slice(1) in instance) {
  5517. warn$1(
  5518. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  5519. );
  5520. return false;
  5521. } else {
  5522. if (key in instance.appContext.config.globalProperties) {
  5523. Object.defineProperty(ctx, key, {
  5524. enumerable: true,
  5525. configurable: true,
  5526. value
  5527. });
  5528. } else {
  5529. ctx[key] = value;
  5530. }
  5531. }
  5532. return true;
  5533. },
  5534. has({
  5535. _: { data, setupState, accessCache, ctx, appContext, props, type }
  5536. }, key) {
  5537. let cssModules;
  5538. return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  5539. },
  5540. defineProperty(target, key, descriptor) {
  5541. if (descriptor.get != null) {
  5542. target._.accessCache[key] = 0;
  5543. } else if (hasOwn(descriptor, "value")) {
  5544. this.set(target, key, descriptor.value, null);
  5545. }
  5546. return Reflect.defineProperty(target, key, descriptor);
  5547. }
  5548. };
  5549. {
  5550. PublicInstanceProxyHandlers.ownKeys = (target) => {
  5551. warn$1(
  5552. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  5553. );
  5554. return Reflect.ownKeys(target);
  5555. };
  5556. }
  5557. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
  5558. get(target, key) {
  5559. if (key === Symbol.unscopables) {
  5560. return;
  5561. }
  5562. return PublicInstanceProxyHandlers.get(target, key, target);
  5563. },
  5564. has(_, key) {
  5565. const has = key[0] !== "_" && !isGloballyAllowed(key);
  5566. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  5567. warn$1(
  5568. `Property ${JSON.stringify(
  5569. key
  5570. )} should not start with _ which is a reserved prefix for Vue internals.`
  5571. );
  5572. }
  5573. return has;
  5574. }
  5575. });
  5576. function createDevRenderContext(instance) {
  5577. const target = {};
  5578. Object.defineProperty(target, `_`, {
  5579. configurable: true,
  5580. enumerable: false,
  5581. get: () => instance
  5582. });
  5583. Object.keys(publicPropertiesMap).forEach((key) => {
  5584. Object.defineProperty(target, key, {
  5585. configurable: true,
  5586. enumerable: false,
  5587. get: () => publicPropertiesMap[key](instance),
  5588. // intercepted by the proxy so no need for implementation,
  5589. // but needed to prevent set errors
  5590. set: NOOP
  5591. });
  5592. });
  5593. return target;
  5594. }
  5595. function exposePropsOnRenderContext(instance) {
  5596. const {
  5597. ctx,
  5598. propsOptions: [propsOptions]
  5599. } = instance;
  5600. if (propsOptions) {
  5601. Object.keys(propsOptions).forEach((key) => {
  5602. Object.defineProperty(ctx, key, {
  5603. enumerable: true,
  5604. configurable: true,
  5605. get: () => instance.props[key],
  5606. set: NOOP
  5607. });
  5608. });
  5609. }
  5610. }
  5611. function exposeSetupStateOnRenderContext(instance) {
  5612. const { ctx, setupState } = instance;
  5613. Object.keys(toRaw(setupState)).forEach((key) => {
  5614. if (!setupState.__isScriptSetup) {
  5615. if (isReservedPrefix(key[0])) {
  5616. warn$1(
  5617. `setup() return property ${JSON.stringify(
  5618. key
  5619. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  5620. );
  5621. return;
  5622. }
  5623. Object.defineProperty(ctx, key, {
  5624. enumerable: true,
  5625. configurable: true,
  5626. get: () => setupState[key],
  5627. set: NOOP
  5628. });
  5629. }
  5630. });
  5631. }
  5632. const warnRuntimeUsage = (method) => warn$1(
  5633. `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
  5634. );
  5635. function defineProps() {
  5636. {
  5637. warnRuntimeUsage(`defineProps`);
  5638. }
  5639. return null;
  5640. }
  5641. function defineEmits() {
  5642. {
  5643. warnRuntimeUsage(`defineEmits`);
  5644. }
  5645. return null;
  5646. }
  5647. function defineExpose(exposed) {
  5648. {
  5649. warnRuntimeUsage(`defineExpose`);
  5650. }
  5651. }
  5652. function defineOptions(options) {
  5653. {
  5654. warnRuntimeUsage(`defineOptions`);
  5655. }
  5656. }
  5657. function defineSlots() {
  5658. {
  5659. warnRuntimeUsage(`defineSlots`);
  5660. }
  5661. return null;
  5662. }
  5663. function defineModel() {
  5664. {
  5665. warnRuntimeUsage("defineModel");
  5666. }
  5667. }
  5668. function withDefaults(props, defaults) {
  5669. {
  5670. warnRuntimeUsage(`withDefaults`);
  5671. }
  5672. return null;
  5673. }
  5674. function useSlots() {
  5675. return getContext("useSlots").slots;
  5676. }
  5677. function useAttrs() {
  5678. return getContext("useAttrs").attrs;
  5679. }
  5680. function getContext(calledFunctionName) {
  5681. const i = getCurrentInstance();
  5682. if (!i) {
  5683. warn$1(`${calledFunctionName}() called without active instance.`);
  5684. }
  5685. return i.setupContext || (i.setupContext = createSetupContext(i));
  5686. }
  5687. function normalizePropsOrEmits(props) {
  5688. return isArray(props) ? props.reduce(
  5689. (normalized, p) => (normalized[p] = null, normalized),
  5690. {}
  5691. ) : props;
  5692. }
  5693. function mergeDefaults(raw, defaults) {
  5694. const props = normalizePropsOrEmits(raw);
  5695. for (const key in defaults) {
  5696. if (key.startsWith("__skip")) continue;
  5697. let opt = props[key];
  5698. if (opt) {
  5699. if (isArray(opt) || isFunction(opt)) {
  5700. opt = props[key] = { type: opt, default: defaults[key] };
  5701. } else {
  5702. opt.default = defaults[key];
  5703. }
  5704. } else if (opt === null) {
  5705. opt = props[key] = { default: defaults[key] };
  5706. } else {
  5707. warn$1(`props default key "${key}" has no corresponding declaration.`);
  5708. }
  5709. if (opt && defaults[`__skip_${key}`]) {
  5710. opt.skipFactory = true;
  5711. }
  5712. }
  5713. return props;
  5714. }
  5715. function mergeModels(a, b) {
  5716. if (!a || !b) return a || b;
  5717. if (isArray(a) && isArray(b)) return a.concat(b);
  5718. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  5719. }
  5720. function createPropsRestProxy(props, excludedKeys) {
  5721. const ret = {};
  5722. for (const key in props) {
  5723. if (!excludedKeys.includes(key)) {
  5724. Object.defineProperty(ret, key, {
  5725. enumerable: true,
  5726. get: () => props[key]
  5727. });
  5728. }
  5729. }
  5730. return ret;
  5731. }
  5732. function withAsyncContext(getAwaitable) {
  5733. const ctx = getCurrentInstance();
  5734. if (!ctx) {
  5735. warn$1(
  5736. `withAsyncContext called without active current instance. This is likely a bug.`
  5737. );
  5738. }
  5739. let awaitable = getAwaitable();
  5740. unsetCurrentInstance();
  5741. if (isPromise(awaitable)) {
  5742. awaitable = awaitable.catch((e) => {
  5743. setCurrentInstance(ctx);
  5744. throw e;
  5745. });
  5746. }
  5747. return [awaitable, () => setCurrentInstance(ctx)];
  5748. }
  5749. function createDuplicateChecker() {
  5750. const cache = /* @__PURE__ */ Object.create(null);
  5751. return (type, key) => {
  5752. if (cache[key]) {
  5753. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  5754. } else {
  5755. cache[key] = type;
  5756. }
  5757. };
  5758. }
  5759. let shouldCacheAccess = true;
  5760. function applyOptions(instance) {
  5761. const options = resolveMergedOptions(instance);
  5762. const publicThis = instance.proxy;
  5763. const ctx = instance.ctx;
  5764. shouldCacheAccess = false;
  5765. if (options.beforeCreate) {
  5766. callHook$1(options.beforeCreate, instance, "bc");
  5767. }
  5768. const {
  5769. // state
  5770. data: dataOptions,
  5771. computed: computedOptions,
  5772. methods,
  5773. watch: watchOptions,
  5774. provide: provideOptions,
  5775. inject: injectOptions,
  5776. // lifecycle
  5777. created,
  5778. beforeMount,
  5779. mounted,
  5780. beforeUpdate,
  5781. updated,
  5782. activated,
  5783. deactivated,
  5784. beforeDestroy,
  5785. beforeUnmount,
  5786. destroyed,
  5787. unmounted,
  5788. render,
  5789. renderTracked,
  5790. renderTriggered,
  5791. errorCaptured,
  5792. serverPrefetch,
  5793. // public API
  5794. expose,
  5795. inheritAttrs,
  5796. // assets
  5797. components,
  5798. directives,
  5799. filters
  5800. } = options;
  5801. const checkDuplicateProperties = createDuplicateChecker() ;
  5802. {
  5803. const [propsOptions] = instance.propsOptions;
  5804. if (propsOptions) {
  5805. for (const key in propsOptions) {
  5806. checkDuplicateProperties("Props" /* PROPS */, key);
  5807. }
  5808. }
  5809. }
  5810. if (injectOptions) {
  5811. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  5812. }
  5813. if (methods) {
  5814. for (const key in methods) {
  5815. const methodHandler = methods[key];
  5816. if (isFunction(methodHandler)) {
  5817. {
  5818. Object.defineProperty(ctx, key, {
  5819. value: methodHandler.bind(publicThis),
  5820. configurable: true,
  5821. enumerable: true,
  5822. writable: true
  5823. });
  5824. }
  5825. {
  5826. checkDuplicateProperties("Methods" /* METHODS */, key);
  5827. }
  5828. } else {
  5829. warn$1(
  5830. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  5831. );
  5832. }
  5833. }
  5834. }
  5835. if (dataOptions) {
  5836. if (!isFunction(dataOptions)) {
  5837. warn$1(
  5838. `The data option must be a function. Plain object usage is no longer supported.`
  5839. );
  5840. }
  5841. const data = dataOptions.call(publicThis, publicThis);
  5842. if (isPromise(data)) {
  5843. warn$1(
  5844. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  5845. );
  5846. }
  5847. if (!isObject(data)) {
  5848. warn$1(`data() should return an object.`);
  5849. } else {
  5850. instance.data = reactive(data);
  5851. {
  5852. for (const key in data) {
  5853. checkDuplicateProperties("Data" /* DATA */, key);
  5854. if (!isReservedPrefix(key[0])) {
  5855. Object.defineProperty(ctx, key, {
  5856. configurable: true,
  5857. enumerable: true,
  5858. get: () => data[key],
  5859. set: NOOP
  5860. });
  5861. }
  5862. }
  5863. }
  5864. }
  5865. }
  5866. shouldCacheAccess = true;
  5867. if (computedOptions) {
  5868. for (const key in computedOptions) {
  5869. const opt = computedOptions[key];
  5870. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  5871. if (get === NOOP) {
  5872. warn$1(`Computed property "${key}" has no getter.`);
  5873. }
  5874. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  5875. warn$1(
  5876. `Write operation failed: computed property "${key}" is readonly.`
  5877. );
  5878. } ;
  5879. const c = computed({
  5880. get,
  5881. set
  5882. });
  5883. Object.defineProperty(ctx, key, {
  5884. enumerable: true,
  5885. configurable: true,
  5886. get: () => c.value,
  5887. set: (v) => c.value = v
  5888. });
  5889. {
  5890. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  5891. }
  5892. }
  5893. }
  5894. if (watchOptions) {
  5895. for (const key in watchOptions) {
  5896. createWatcher(watchOptions[key], ctx, publicThis, key);
  5897. }
  5898. }
  5899. if (provideOptions) {
  5900. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  5901. Reflect.ownKeys(provides).forEach((key) => {
  5902. provide(key, provides[key]);
  5903. });
  5904. }
  5905. if (created) {
  5906. callHook$1(created, instance, "c");
  5907. }
  5908. function registerLifecycleHook(register, hook) {
  5909. if (isArray(hook)) {
  5910. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  5911. } else if (hook) {
  5912. register(hook.bind(publicThis));
  5913. }
  5914. }
  5915. registerLifecycleHook(onBeforeMount, beforeMount);
  5916. registerLifecycleHook(onMounted, mounted);
  5917. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  5918. registerLifecycleHook(onUpdated, updated);
  5919. registerLifecycleHook(onActivated, activated);
  5920. registerLifecycleHook(onDeactivated, deactivated);
  5921. registerLifecycleHook(onErrorCaptured, errorCaptured);
  5922. registerLifecycleHook(onRenderTracked, renderTracked);
  5923. registerLifecycleHook(onRenderTriggered, renderTriggered);
  5924. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  5925. registerLifecycleHook(onUnmounted, unmounted);
  5926. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  5927. if (isArray(expose)) {
  5928. if (expose.length) {
  5929. const exposed = instance.exposed || (instance.exposed = {});
  5930. expose.forEach((key) => {
  5931. Object.defineProperty(exposed, key, {
  5932. get: () => publicThis[key],
  5933. set: (val) => publicThis[key] = val,
  5934. enumerable: true
  5935. });
  5936. });
  5937. } else if (!instance.exposed) {
  5938. instance.exposed = {};
  5939. }
  5940. }
  5941. if (render && instance.render === NOOP) {
  5942. instance.render = render;
  5943. }
  5944. if (inheritAttrs != null) {
  5945. instance.inheritAttrs = inheritAttrs;
  5946. }
  5947. if (components) instance.components = components;
  5948. if (directives) instance.directives = directives;
  5949. }
  5950. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  5951. if (isArray(injectOptions)) {
  5952. injectOptions = normalizeInject(injectOptions);
  5953. }
  5954. for (const key in injectOptions) {
  5955. const opt = injectOptions[key];
  5956. let injected;
  5957. if (isObject(opt)) {
  5958. if ("default" in opt) {
  5959. injected = inject(
  5960. opt.from || key,
  5961. opt.default,
  5962. true
  5963. );
  5964. } else {
  5965. injected = inject(opt.from || key);
  5966. }
  5967. } else {
  5968. injected = inject(opt);
  5969. }
  5970. if (isRef(injected)) {
  5971. Object.defineProperty(ctx, key, {
  5972. enumerable: true,
  5973. configurable: true,
  5974. get: () => injected.value,
  5975. set: (v) => injected.value = v
  5976. });
  5977. } else {
  5978. ctx[key] = injected;
  5979. }
  5980. {
  5981. checkDuplicateProperties("Inject" /* INJECT */, key);
  5982. }
  5983. }
  5984. }
  5985. function callHook$1(hook, instance, type) {
  5986. callWithAsyncErrorHandling(
  5987. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  5988. instance,
  5989. type
  5990. );
  5991. }
  5992. function createWatcher(raw, ctx, publicThis, key) {
  5993. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  5994. if (isString(raw)) {
  5995. const handler = ctx[raw];
  5996. if (isFunction(handler)) {
  5997. {
  5998. watch(getter, handler);
  5999. }
  6000. } else {
  6001. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  6002. }
  6003. } else if (isFunction(raw)) {
  6004. {
  6005. watch(getter, raw.bind(publicThis));
  6006. }
  6007. } else if (isObject(raw)) {
  6008. if (isArray(raw)) {
  6009. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  6010. } else {
  6011. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  6012. if (isFunction(handler)) {
  6013. watch(getter, handler, raw);
  6014. } else {
  6015. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  6016. }
  6017. }
  6018. } else {
  6019. warn$1(`Invalid watch option: "${key}"`, raw);
  6020. }
  6021. }
  6022. function resolveMergedOptions(instance) {
  6023. const base = instance.type;
  6024. const { mixins, extends: extendsOptions } = base;
  6025. const {
  6026. mixins: globalMixins,
  6027. optionsCache: cache,
  6028. config: { optionMergeStrategies }
  6029. } = instance.appContext;
  6030. const cached = cache.get(base);
  6031. let resolved;
  6032. if (cached) {
  6033. resolved = cached;
  6034. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  6035. {
  6036. resolved = base;
  6037. }
  6038. } else {
  6039. resolved = {};
  6040. if (globalMixins.length) {
  6041. globalMixins.forEach(
  6042. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  6043. );
  6044. }
  6045. mergeOptions(resolved, base, optionMergeStrategies);
  6046. }
  6047. if (isObject(base)) {
  6048. cache.set(base, resolved);
  6049. }
  6050. return resolved;
  6051. }
  6052. function mergeOptions(to, from, strats, asMixin = false) {
  6053. const { mixins, extends: extendsOptions } = from;
  6054. if (extendsOptions) {
  6055. mergeOptions(to, extendsOptions, strats, true);
  6056. }
  6057. if (mixins) {
  6058. mixins.forEach(
  6059. (m) => mergeOptions(to, m, strats, true)
  6060. );
  6061. }
  6062. for (const key in from) {
  6063. if (asMixin && key === "expose") {
  6064. warn$1(
  6065. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  6066. );
  6067. } else {
  6068. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  6069. to[key] = strat ? strat(to[key], from[key]) : from[key];
  6070. }
  6071. }
  6072. return to;
  6073. }
  6074. const internalOptionMergeStrats = {
  6075. data: mergeDataFn,
  6076. props: mergeEmitsOrPropsOptions,
  6077. emits: mergeEmitsOrPropsOptions,
  6078. // objects
  6079. methods: mergeObjectOptions,
  6080. computed: mergeObjectOptions,
  6081. // lifecycle
  6082. beforeCreate: mergeAsArray,
  6083. created: mergeAsArray,
  6084. beforeMount: mergeAsArray,
  6085. mounted: mergeAsArray,
  6086. beforeUpdate: mergeAsArray,
  6087. updated: mergeAsArray,
  6088. beforeDestroy: mergeAsArray,
  6089. beforeUnmount: mergeAsArray,
  6090. destroyed: mergeAsArray,
  6091. unmounted: mergeAsArray,
  6092. activated: mergeAsArray,
  6093. deactivated: mergeAsArray,
  6094. errorCaptured: mergeAsArray,
  6095. serverPrefetch: mergeAsArray,
  6096. // assets
  6097. components: mergeObjectOptions,
  6098. directives: mergeObjectOptions,
  6099. // watch
  6100. watch: mergeWatchOptions,
  6101. // provide / inject
  6102. provide: mergeDataFn,
  6103. inject: mergeInject
  6104. };
  6105. function mergeDataFn(to, from) {
  6106. if (!from) {
  6107. return to;
  6108. }
  6109. if (!to) {
  6110. return from;
  6111. }
  6112. return function mergedDataFn() {
  6113. return (extend)(
  6114. isFunction(to) ? to.call(this, this) : to,
  6115. isFunction(from) ? from.call(this, this) : from
  6116. );
  6117. };
  6118. }
  6119. function mergeInject(to, from) {
  6120. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  6121. }
  6122. function normalizeInject(raw) {
  6123. if (isArray(raw)) {
  6124. const res = {};
  6125. for (let i = 0; i < raw.length; i++) {
  6126. res[raw[i]] = raw[i];
  6127. }
  6128. return res;
  6129. }
  6130. return raw;
  6131. }
  6132. function mergeAsArray(to, from) {
  6133. return to ? [...new Set([].concat(to, from))] : from;
  6134. }
  6135. function mergeObjectOptions(to, from) {
  6136. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  6137. }
  6138. function mergeEmitsOrPropsOptions(to, from) {
  6139. if (to) {
  6140. if (isArray(to) && isArray(from)) {
  6141. return [.../* @__PURE__ */ new Set([...to, ...from])];
  6142. }
  6143. return extend(
  6144. /* @__PURE__ */ Object.create(null),
  6145. normalizePropsOrEmits(to),
  6146. normalizePropsOrEmits(from != null ? from : {})
  6147. );
  6148. } else {
  6149. return from;
  6150. }
  6151. }
  6152. function mergeWatchOptions(to, from) {
  6153. if (!to) return from;
  6154. if (!from) return to;
  6155. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  6156. for (const key in from) {
  6157. merged[key] = mergeAsArray(to[key], from[key]);
  6158. }
  6159. return merged;
  6160. }
  6161. function createAppContext() {
  6162. return {
  6163. app: null,
  6164. config: {
  6165. isNativeTag: NO,
  6166. performance: false,
  6167. globalProperties: {},
  6168. optionMergeStrategies: {},
  6169. errorHandler: void 0,
  6170. warnHandler: void 0,
  6171. compilerOptions: {}
  6172. },
  6173. mixins: [],
  6174. components: {},
  6175. directives: {},
  6176. provides: /* @__PURE__ */ Object.create(null),
  6177. optionsCache: /* @__PURE__ */ new WeakMap(),
  6178. propsCache: /* @__PURE__ */ new WeakMap(),
  6179. emitsCache: /* @__PURE__ */ new WeakMap()
  6180. };
  6181. }
  6182. let uid$1 = 0;
  6183. function createAppAPI(render, hydrate) {
  6184. return function createApp(rootComponent, rootProps = null) {
  6185. if (!isFunction(rootComponent)) {
  6186. rootComponent = extend({}, rootComponent);
  6187. }
  6188. if (rootProps != null && !isObject(rootProps)) {
  6189. warn$1(`root props passed to app.mount() must be an object.`);
  6190. rootProps = null;
  6191. }
  6192. const context = createAppContext();
  6193. const installedPlugins = /* @__PURE__ */ new WeakSet();
  6194. const pluginCleanupFns = [];
  6195. let isMounted = false;
  6196. const app = context.app = {
  6197. _uid: uid$1++,
  6198. _component: rootComponent,
  6199. _props: rootProps,
  6200. _container: null,
  6201. _context: context,
  6202. _instance: null,
  6203. version,
  6204. get config() {
  6205. return context.config;
  6206. },
  6207. set config(v) {
  6208. {
  6209. warn$1(
  6210. `app.config cannot be replaced. Modify individual options instead.`
  6211. );
  6212. }
  6213. },
  6214. use(plugin, ...options) {
  6215. if (installedPlugins.has(plugin)) {
  6216. warn$1(`Plugin has already been applied to target app.`);
  6217. } else if (plugin && isFunction(plugin.install)) {
  6218. installedPlugins.add(plugin);
  6219. plugin.install(app, ...options);
  6220. } else if (isFunction(plugin)) {
  6221. installedPlugins.add(plugin);
  6222. plugin(app, ...options);
  6223. } else {
  6224. warn$1(
  6225. `A plugin must either be a function or an object with an "install" function.`
  6226. );
  6227. }
  6228. return app;
  6229. },
  6230. mixin(mixin) {
  6231. {
  6232. if (!context.mixins.includes(mixin)) {
  6233. context.mixins.push(mixin);
  6234. } else {
  6235. warn$1(
  6236. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  6237. );
  6238. }
  6239. }
  6240. return app;
  6241. },
  6242. component(name, component) {
  6243. {
  6244. validateComponentName(name, context.config);
  6245. }
  6246. if (!component) {
  6247. return context.components[name];
  6248. }
  6249. if (context.components[name]) {
  6250. warn$1(`Component "${name}" has already been registered in target app.`);
  6251. }
  6252. context.components[name] = component;
  6253. return app;
  6254. },
  6255. directive(name, directive) {
  6256. {
  6257. validateDirectiveName(name);
  6258. }
  6259. if (!directive) {
  6260. return context.directives[name];
  6261. }
  6262. if (context.directives[name]) {
  6263. warn$1(`Directive "${name}" has already been registered in target app.`);
  6264. }
  6265. context.directives[name] = directive;
  6266. return app;
  6267. },
  6268. mount(rootContainer, isHydrate, namespace) {
  6269. if (!isMounted) {
  6270. if (rootContainer.__vue_app__) {
  6271. warn$1(
  6272. `There is already an app instance mounted on the host container.
  6273. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  6274. );
  6275. }
  6276. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  6277. vnode.appContext = context;
  6278. if (namespace === true) {
  6279. namespace = "svg";
  6280. } else if (namespace === false) {
  6281. namespace = void 0;
  6282. }
  6283. {
  6284. context.reload = () => {
  6285. const cloned = cloneVNode(vnode);
  6286. cloned.el = null;
  6287. render(cloned, rootContainer, namespace);
  6288. };
  6289. }
  6290. if (isHydrate && hydrate) {
  6291. hydrate(vnode, rootContainer);
  6292. } else {
  6293. render(vnode, rootContainer, namespace);
  6294. }
  6295. isMounted = true;
  6296. app._container = rootContainer;
  6297. rootContainer.__vue_app__ = app;
  6298. {
  6299. app._instance = vnode.component;
  6300. devtoolsInitApp(app, version);
  6301. }
  6302. return getComponentPublicInstance(vnode.component);
  6303. } else {
  6304. warn$1(
  6305. `App has already been mounted.
  6306. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
  6307. );
  6308. }
  6309. },
  6310. onUnmount(cleanupFn) {
  6311. if (typeof cleanupFn !== "function") {
  6312. warn$1(
  6313. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  6314. );
  6315. }
  6316. pluginCleanupFns.push(cleanupFn);
  6317. },
  6318. unmount() {
  6319. if (isMounted) {
  6320. callWithAsyncErrorHandling(
  6321. pluginCleanupFns,
  6322. app._instance,
  6323. 16
  6324. );
  6325. render(null, app._container);
  6326. {
  6327. app._instance = null;
  6328. devtoolsUnmountApp(app);
  6329. }
  6330. delete app._container.__vue_app__;
  6331. } else {
  6332. warn$1(`Cannot unmount an app that is not mounted.`);
  6333. }
  6334. },
  6335. provide(key, value) {
  6336. if (key in context.provides) {
  6337. if (hasOwn(context.provides, key)) {
  6338. warn$1(
  6339. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  6340. );
  6341. } else {
  6342. warn$1(
  6343. `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
  6344. );
  6345. }
  6346. }
  6347. context.provides[key] = value;
  6348. return app;
  6349. },
  6350. runWithContext(fn) {
  6351. const lastApp = currentApp;
  6352. currentApp = app;
  6353. try {
  6354. return fn();
  6355. } finally {
  6356. currentApp = lastApp;
  6357. }
  6358. }
  6359. };
  6360. return app;
  6361. };
  6362. }
  6363. let currentApp = null;
  6364. function useModel(props, name, options = EMPTY_OBJ) {
  6365. const i = getCurrentInstance();
  6366. if (!i) {
  6367. warn$1(`useModel() called without active instance.`);
  6368. return ref();
  6369. }
  6370. const camelizedName = camelize(name);
  6371. if (!i.propsOptions[0][camelizedName]) {
  6372. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  6373. return ref();
  6374. }
  6375. const hyphenatedName = hyphenate(name);
  6376. const modifiers = getModelModifiers(props, camelizedName);
  6377. const res = customRef((track, trigger) => {
  6378. let localValue;
  6379. let prevSetValue = EMPTY_OBJ;
  6380. let prevEmittedValue;
  6381. watchSyncEffect(() => {
  6382. const propValue = props[camelizedName];
  6383. if (hasChanged(localValue, propValue)) {
  6384. localValue = propValue;
  6385. trigger();
  6386. }
  6387. });
  6388. return {
  6389. get() {
  6390. track();
  6391. return options.get ? options.get(localValue) : localValue;
  6392. },
  6393. set(value) {
  6394. const emittedValue = options.set ? options.set(value) : value;
  6395. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  6396. return;
  6397. }
  6398. const rawProps = i.vnode.props;
  6399. if (!(rawProps && // check if parent has passed v-model
  6400. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  6401. localValue = value;
  6402. trigger();
  6403. }
  6404. i.emit(`update:${name}`, emittedValue);
  6405. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  6406. trigger();
  6407. }
  6408. prevSetValue = value;
  6409. prevEmittedValue = emittedValue;
  6410. }
  6411. };
  6412. });
  6413. res[Symbol.iterator] = () => {
  6414. let i2 = 0;
  6415. return {
  6416. next() {
  6417. if (i2 < 2) {
  6418. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  6419. } else {
  6420. return { done: true };
  6421. }
  6422. }
  6423. };
  6424. };
  6425. return res;
  6426. }
  6427. const getModelModifiers = (props, modelName) => {
  6428. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  6429. };
  6430. function emit(instance, event, ...rawArgs) {
  6431. if (instance.isUnmounted) return;
  6432. const props = instance.vnode.props || EMPTY_OBJ;
  6433. {
  6434. const {
  6435. emitsOptions,
  6436. propsOptions: [propsOptions]
  6437. } = instance;
  6438. if (emitsOptions) {
  6439. if (!(event in emitsOptions) && true) {
  6440. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  6441. warn$1(
  6442. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  6443. );
  6444. }
  6445. } else {
  6446. const validator = emitsOptions[event];
  6447. if (isFunction(validator)) {
  6448. const isValid = validator(...rawArgs);
  6449. if (!isValid) {
  6450. warn$1(
  6451. `Invalid event arguments: event validation failed for event "${event}".`
  6452. );
  6453. }
  6454. }
  6455. }
  6456. }
  6457. }
  6458. let args = rawArgs;
  6459. const isModelListener = event.startsWith("update:");
  6460. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  6461. if (modifiers) {
  6462. if (modifiers.trim) {
  6463. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  6464. }
  6465. if (modifiers.number) {
  6466. args = rawArgs.map(looseToNumber);
  6467. }
  6468. }
  6469. {
  6470. devtoolsComponentEmit(instance, event, args);
  6471. }
  6472. {
  6473. const lowerCaseEvent = event.toLowerCase();
  6474. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  6475. warn$1(
  6476. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  6477. instance,
  6478. instance.type
  6479. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
  6480. event
  6481. )}" instead of "${event}".`
  6482. );
  6483. }
  6484. }
  6485. let handlerName;
  6486. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  6487. props[handlerName = toHandlerKey(camelize(event))];
  6488. if (!handler && isModelListener) {
  6489. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  6490. }
  6491. if (handler) {
  6492. callWithAsyncErrorHandling(
  6493. handler,
  6494. instance,
  6495. 6,
  6496. args
  6497. );
  6498. }
  6499. const onceHandler = props[handlerName + `Once`];
  6500. if (onceHandler) {
  6501. if (!instance.emitted) {
  6502. instance.emitted = {};
  6503. } else if (instance.emitted[handlerName]) {
  6504. return;
  6505. }
  6506. instance.emitted[handlerName] = true;
  6507. callWithAsyncErrorHandling(
  6508. onceHandler,
  6509. instance,
  6510. 6,
  6511. args
  6512. );
  6513. }
  6514. }
  6515. const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
  6516. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  6517. const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
  6518. const cached = cache.get(comp);
  6519. if (cached !== void 0) {
  6520. return cached;
  6521. }
  6522. const raw = comp.emits;
  6523. let normalized = {};
  6524. let hasExtends = false;
  6525. if (!isFunction(comp)) {
  6526. const extendEmits = (raw2) => {
  6527. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  6528. if (normalizedFromExtend) {
  6529. hasExtends = true;
  6530. extend(normalized, normalizedFromExtend);
  6531. }
  6532. };
  6533. if (!asMixin && appContext.mixins.length) {
  6534. appContext.mixins.forEach(extendEmits);
  6535. }
  6536. if (comp.extends) {
  6537. extendEmits(comp.extends);
  6538. }
  6539. if (comp.mixins) {
  6540. comp.mixins.forEach(extendEmits);
  6541. }
  6542. }
  6543. if (!raw && !hasExtends) {
  6544. if (isObject(comp)) {
  6545. cache.set(comp, null);
  6546. }
  6547. return null;
  6548. }
  6549. if (isArray(raw)) {
  6550. raw.forEach((key) => normalized[key] = null);
  6551. } else {
  6552. extend(normalized, raw);
  6553. }
  6554. if (isObject(comp)) {
  6555. cache.set(comp, normalized);
  6556. }
  6557. return normalized;
  6558. }
  6559. function isEmitListener(options, key) {
  6560. if (!options || !isOn(key)) {
  6561. return false;
  6562. }
  6563. key = key.slice(2).replace(/Once$/, "");
  6564. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  6565. }
  6566. let accessedAttrs = false;
  6567. function markAttrsAccessed() {
  6568. accessedAttrs = true;
  6569. }
  6570. function renderComponentRoot(instance) {
  6571. const {
  6572. type: Component,
  6573. vnode,
  6574. proxy,
  6575. withProxy,
  6576. propsOptions: [propsOptions],
  6577. slots,
  6578. attrs,
  6579. emit,
  6580. render,
  6581. renderCache,
  6582. props,
  6583. data,
  6584. setupState,
  6585. ctx,
  6586. inheritAttrs
  6587. } = instance;
  6588. const prev = setCurrentRenderingInstance(instance);
  6589. let result;
  6590. let fallthroughAttrs;
  6591. {
  6592. accessedAttrs = false;
  6593. }
  6594. try {
  6595. if (vnode.shapeFlag & 4) {
  6596. const proxyToUse = withProxy || proxy;
  6597. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  6598. get(target, key, receiver) {
  6599. warn$1(
  6600. `Property '${String(
  6601. key
  6602. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  6603. );
  6604. return Reflect.get(target, key, receiver);
  6605. }
  6606. }) : proxyToUse;
  6607. result = normalizeVNode(
  6608. render.call(
  6609. thisProxy,
  6610. proxyToUse,
  6611. renderCache,
  6612. true ? shallowReadonly(props) : props,
  6613. setupState,
  6614. data,
  6615. ctx
  6616. )
  6617. );
  6618. fallthroughAttrs = attrs;
  6619. } else {
  6620. const render2 = Component;
  6621. if (attrs === props) {
  6622. markAttrsAccessed();
  6623. }
  6624. result = normalizeVNode(
  6625. render2.length > 1 ? render2(
  6626. true ? shallowReadonly(props) : props,
  6627. true ? {
  6628. get attrs() {
  6629. markAttrsAccessed();
  6630. return shallowReadonly(attrs);
  6631. },
  6632. slots,
  6633. emit
  6634. } : { attrs, slots, emit }
  6635. ) : render2(
  6636. true ? shallowReadonly(props) : props,
  6637. null
  6638. )
  6639. );
  6640. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  6641. }
  6642. } catch (err) {
  6643. blockStack.length = 0;
  6644. handleError(err, instance, 1);
  6645. result = createVNode(Comment);
  6646. }
  6647. let root = result;
  6648. let setRoot = void 0;
  6649. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  6650. [root, setRoot] = getChildRoot(result);
  6651. }
  6652. if (fallthroughAttrs && inheritAttrs !== false) {
  6653. const keys = Object.keys(fallthroughAttrs);
  6654. const { shapeFlag } = root;
  6655. if (keys.length) {
  6656. if (shapeFlag & (1 | 6)) {
  6657. if (propsOptions && keys.some(isModelListener)) {
  6658. fallthroughAttrs = filterModelListeners(
  6659. fallthroughAttrs,
  6660. propsOptions
  6661. );
  6662. }
  6663. root = cloneVNode(root, fallthroughAttrs, false, true);
  6664. } else if (!accessedAttrs && root.type !== Comment) {
  6665. const allAttrs = Object.keys(attrs);
  6666. const eventAttrs = [];
  6667. const extraAttrs = [];
  6668. for (let i = 0, l = allAttrs.length; i < l; i++) {
  6669. const key = allAttrs[i];
  6670. if (isOn(key)) {
  6671. if (!isModelListener(key)) {
  6672. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  6673. }
  6674. } else {
  6675. extraAttrs.push(key);
  6676. }
  6677. }
  6678. if (extraAttrs.length) {
  6679. warn$1(
  6680. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
  6681. );
  6682. }
  6683. if (eventAttrs.length) {
  6684. warn$1(
  6685. `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
  6686. );
  6687. }
  6688. }
  6689. }
  6690. }
  6691. if (vnode.dirs) {
  6692. if (!isElementRoot(root)) {
  6693. warn$1(
  6694. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  6695. );
  6696. }
  6697. root = cloneVNode(root, null, false, true);
  6698. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  6699. }
  6700. if (vnode.transition) {
  6701. if (!isElementRoot(root)) {
  6702. warn$1(
  6703. `Component inside <Transition> renders non-element root node that cannot be animated.`
  6704. );
  6705. }
  6706. setTransitionHooks(root, vnode.transition);
  6707. }
  6708. if (setRoot) {
  6709. setRoot(root);
  6710. } else {
  6711. result = root;
  6712. }
  6713. setCurrentRenderingInstance(prev);
  6714. return result;
  6715. }
  6716. const getChildRoot = (vnode) => {
  6717. const rawChildren = vnode.children;
  6718. const dynamicChildren = vnode.dynamicChildren;
  6719. const childRoot = filterSingleRoot(rawChildren, false);
  6720. if (!childRoot) {
  6721. return [vnode, void 0];
  6722. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  6723. return getChildRoot(childRoot);
  6724. }
  6725. const index = rawChildren.indexOf(childRoot);
  6726. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  6727. const setRoot = (updatedRoot) => {
  6728. rawChildren[index] = updatedRoot;
  6729. if (dynamicChildren) {
  6730. if (dynamicIndex > -1) {
  6731. dynamicChildren[dynamicIndex] = updatedRoot;
  6732. } else if (updatedRoot.patchFlag > 0) {
  6733. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  6734. }
  6735. }
  6736. };
  6737. return [normalizeVNode(childRoot), setRoot];
  6738. };
  6739. function filterSingleRoot(children, recurse = true) {
  6740. let singleRoot;
  6741. for (let i = 0; i < children.length; i++) {
  6742. const child = children[i];
  6743. if (isVNode(child)) {
  6744. if (child.type !== Comment || child.children === "v-if") {
  6745. if (singleRoot) {
  6746. return;
  6747. } else {
  6748. singleRoot = child;
  6749. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  6750. return filterSingleRoot(singleRoot.children);
  6751. }
  6752. }
  6753. }
  6754. } else {
  6755. return;
  6756. }
  6757. }
  6758. return singleRoot;
  6759. }
  6760. const getFunctionalFallthrough = (attrs) => {
  6761. let res;
  6762. for (const key in attrs) {
  6763. if (key === "class" || key === "style" || isOn(key)) {
  6764. (res || (res = {}))[key] = attrs[key];
  6765. }
  6766. }
  6767. return res;
  6768. };
  6769. const filterModelListeners = (attrs, props) => {
  6770. const res = {};
  6771. for (const key in attrs) {
  6772. if (!isModelListener(key) || !(key.slice(9) in props)) {
  6773. res[key] = attrs[key];
  6774. }
  6775. }
  6776. return res;
  6777. };
  6778. const isElementRoot = (vnode) => {
  6779. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  6780. };
  6781. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  6782. const { props: prevProps, children: prevChildren, component } = prevVNode;
  6783. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  6784. const emits = component.emitsOptions;
  6785. if ((prevChildren || nextChildren) && isHmrUpdating) {
  6786. return true;
  6787. }
  6788. if (nextVNode.dirs || nextVNode.transition) {
  6789. return true;
  6790. }
  6791. if (optimized && patchFlag >= 0) {
  6792. if (patchFlag & 1024) {
  6793. return true;
  6794. }
  6795. if (patchFlag & 16) {
  6796. if (!prevProps) {
  6797. return !!nextProps;
  6798. }
  6799. return hasPropsChanged(prevProps, nextProps, emits);
  6800. } else if (patchFlag & 8) {
  6801. const dynamicProps = nextVNode.dynamicProps;
  6802. for (let i = 0; i < dynamicProps.length; i++) {
  6803. const key = dynamicProps[i];
  6804. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  6805. return true;
  6806. }
  6807. }
  6808. }
  6809. } else {
  6810. if (prevChildren || nextChildren) {
  6811. if (!nextChildren || !nextChildren.$stable) {
  6812. return true;
  6813. }
  6814. }
  6815. if (prevProps === nextProps) {
  6816. return false;
  6817. }
  6818. if (!prevProps) {
  6819. return !!nextProps;
  6820. }
  6821. if (!nextProps) {
  6822. return true;
  6823. }
  6824. return hasPropsChanged(prevProps, nextProps, emits);
  6825. }
  6826. return false;
  6827. }
  6828. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  6829. const nextKeys = Object.keys(nextProps);
  6830. if (nextKeys.length !== Object.keys(prevProps).length) {
  6831. return true;
  6832. }
  6833. for (let i = 0; i < nextKeys.length; i++) {
  6834. const key = nextKeys[i];
  6835. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  6836. return true;
  6837. }
  6838. }
  6839. return false;
  6840. }
  6841. function updateHOCHostEl({ vnode, parent }, el) {
  6842. while (parent) {
  6843. const root = parent.subTree;
  6844. if (root.suspense && root.suspense.activeBranch === vnode) {
  6845. root.el = vnode.el;
  6846. }
  6847. if (root === vnode) {
  6848. (vnode = parent.vnode).el = el;
  6849. parent = parent.parent;
  6850. } else {
  6851. break;
  6852. }
  6853. }
  6854. }
  6855. const internalObjectProto = {};
  6856. const createInternalObject = () => Object.create(internalObjectProto);
  6857. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  6858. function initProps(instance, rawProps, isStateful, isSSR = false) {
  6859. const props = {};
  6860. const attrs = createInternalObject();
  6861. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  6862. setFullProps(instance, rawProps, props, attrs);
  6863. for (const key in instance.propsOptions[0]) {
  6864. if (!(key in props)) {
  6865. props[key] = void 0;
  6866. }
  6867. }
  6868. {
  6869. validateProps(rawProps || {}, props, instance);
  6870. }
  6871. if (isStateful) {
  6872. instance.props = isSSR ? props : shallowReactive(props);
  6873. } else {
  6874. if (!instance.type.props) {
  6875. instance.props = attrs;
  6876. } else {
  6877. instance.props = props;
  6878. }
  6879. }
  6880. instance.attrs = attrs;
  6881. }
  6882. function isInHmrContext(instance) {
  6883. while (instance) {
  6884. if (instance.type.__hmrId) return true;
  6885. instance = instance.parent;
  6886. }
  6887. }
  6888. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  6889. const {
  6890. props,
  6891. attrs,
  6892. vnode: { patchFlag }
  6893. } = instance;
  6894. const rawCurrentProps = toRaw(props);
  6895. const [options] = instance.propsOptions;
  6896. let hasAttrsChanged = false;
  6897. if (
  6898. // always force full diff in dev
  6899. // - #1942 if hmr is enabled with sfc component
  6900. // - vite#872 non-sfc component used by sfc component
  6901. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  6902. ) {
  6903. if (patchFlag & 8) {
  6904. const propsToUpdate = instance.vnode.dynamicProps;
  6905. for (let i = 0; i < propsToUpdate.length; i++) {
  6906. let key = propsToUpdate[i];
  6907. if (isEmitListener(instance.emitsOptions, key)) {
  6908. continue;
  6909. }
  6910. const value = rawProps[key];
  6911. if (options) {
  6912. if (hasOwn(attrs, key)) {
  6913. if (value !== attrs[key]) {
  6914. attrs[key] = value;
  6915. hasAttrsChanged = true;
  6916. }
  6917. } else {
  6918. const camelizedKey = camelize(key);
  6919. props[camelizedKey] = resolvePropValue(
  6920. options,
  6921. rawCurrentProps,
  6922. camelizedKey,
  6923. value,
  6924. instance,
  6925. false
  6926. );
  6927. }
  6928. } else {
  6929. if (value !== attrs[key]) {
  6930. attrs[key] = value;
  6931. hasAttrsChanged = true;
  6932. }
  6933. }
  6934. }
  6935. }
  6936. } else {
  6937. if (setFullProps(instance, rawProps, props, attrs)) {
  6938. hasAttrsChanged = true;
  6939. }
  6940. let kebabKey;
  6941. for (const key in rawCurrentProps) {
  6942. if (!rawProps || // for camelCase
  6943. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  6944. // and converted to camelCase (#955)
  6945. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  6946. if (options) {
  6947. if (rawPrevProps && // for camelCase
  6948. (rawPrevProps[key] !== void 0 || // for kebab-case
  6949. rawPrevProps[kebabKey] !== void 0)) {
  6950. props[key] = resolvePropValue(
  6951. options,
  6952. rawCurrentProps,
  6953. key,
  6954. void 0,
  6955. instance,
  6956. true
  6957. );
  6958. }
  6959. } else {
  6960. delete props[key];
  6961. }
  6962. }
  6963. }
  6964. if (attrs !== rawCurrentProps) {
  6965. for (const key in attrs) {
  6966. if (!rawProps || !hasOwn(rawProps, key) && true) {
  6967. delete attrs[key];
  6968. hasAttrsChanged = true;
  6969. }
  6970. }
  6971. }
  6972. }
  6973. if (hasAttrsChanged) {
  6974. trigger(instance.attrs, "set", "");
  6975. }
  6976. {
  6977. validateProps(rawProps || {}, props, instance);
  6978. }
  6979. }
  6980. function setFullProps(instance, rawProps, props, attrs) {
  6981. const [options, needCastKeys] = instance.propsOptions;
  6982. let hasAttrsChanged = false;
  6983. let rawCastValues;
  6984. if (rawProps) {
  6985. for (let key in rawProps) {
  6986. if (isReservedProp(key)) {
  6987. continue;
  6988. }
  6989. const value = rawProps[key];
  6990. let camelKey;
  6991. if (options && hasOwn(options, camelKey = camelize(key))) {
  6992. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  6993. props[camelKey] = value;
  6994. } else {
  6995. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  6996. }
  6997. } else if (!isEmitListener(instance.emitsOptions, key)) {
  6998. if (!(key in attrs) || value !== attrs[key]) {
  6999. attrs[key] = value;
  7000. hasAttrsChanged = true;
  7001. }
  7002. }
  7003. }
  7004. }
  7005. if (needCastKeys) {
  7006. const rawCurrentProps = toRaw(props);
  7007. const castValues = rawCastValues || EMPTY_OBJ;
  7008. for (let i = 0; i < needCastKeys.length; i++) {
  7009. const key = needCastKeys[i];
  7010. props[key] = resolvePropValue(
  7011. options,
  7012. rawCurrentProps,
  7013. key,
  7014. castValues[key],
  7015. instance,
  7016. !hasOwn(castValues, key)
  7017. );
  7018. }
  7019. }
  7020. return hasAttrsChanged;
  7021. }
  7022. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  7023. const opt = options[key];
  7024. if (opt != null) {
  7025. const hasDefault = hasOwn(opt, "default");
  7026. if (hasDefault && value === void 0) {
  7027. const defaultValue = opt.default;
  7028. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  7029. const { propsDefaults } = instance;
  7030. if (key in propsDefaults) {
  7031. value = propsDefaults[key];
  7032. } else {
  7033. const reset = setCurrentInstance(instance);
  7034. value = propsDefaults[key] = defaultValue.call(
  7035. null,
  7036. props
  7037. );
  7038. reset();
  7039. }
  7040. } else {
  7041. value = defaultValue;
  7042. }
  7043. if (instance.ce) {
  7044. instance.ce._setProp(key, value);
  7045. }
  7046. }
  7047. if (opt[0 /* shouldCast */]) {
  7048. if (isAbsent && !hasDefault) {
  7049. value = false;
  7050. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  7051. value = true;
  7052. }
  7053. }
  7054. }
  7055. return value;
  7056. }
  7057. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  7058. function normalizePropsOptions(comp, appContext, asMixin = false) {
  7059. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  7060. const cached = cache.get(comp);
  7061. if (cached) {
  7062. return cached;
  7063. }
  7064. const raw = comp.props;
  7065. const normalized = {};
  7066. const needCastKeys = [];
  7067. let hasExtends = false;
  7068. if (!isFunction(comp)) {
  7069. const extendProps = (raw2) => {
  7070. hasExtends = true;
  7071. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  7072. extend(normalized, props);
  7073. if (keys) needCastKeys.push(...keys);
  7074. };
  7075. if (!asMixin && appContext.mixins.length) {
  7076. appContext.mixins.forEach(extendProps);
  7077. }
  7078. if (comp.extends) {
  7079. extendProps(comp.extends);
  7080. }
  7081. if (comp.mixins) {
  7082. comp.mixins.forEach(extendProps);
  7083. }
  7084. }
  7085. if (!raw && !hasExtends) {
  7086. if (isObject(comp)) {
  7087. cache.set(comp, EMPTY_ARR);
  7088. }
  7089. return EMPTY_ARR;
  7090. }
  7091. if (isArray(raw)) {
  7092. for (let i = 0; i < raw.length; i++) {
  7093. if (!isString(raw[i])) {
  7094. warn$1(`props must be strings when using array syntax.`, raw[i]);
  7095. }
  7096. const normalizedKey = camelize(raw[i]);
  7097. if (validatePropName(normalizedKey)) {
  7098. normalized[normalizedKey] = EMPTY_OBJ;
  7099. }
  7100. }
  7101. } else if (raw) {
  7102. if (!isObject(raw)) {
  7103. warn$1(`invalid props options`, raw);
  7104. }
  7105. for (const key in raw) {
  7106. const normalizedKey = camelize(key);
  7107. if (validatePropName(normalizedKey)) {
  7108. const opt = raw[key];
  7109. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  7110. const propType = prop.type;
  7111. let shouldCast = false;
  7112. let shouldCastTrue = true;
  7113. if (isArray(propType)) {
  7114. for (let index = 0; index < propType.length; ++index) {
  7115. const type = propType[index];
  7116. const typeName = isFunction(type) && type.name;
  7117. if (typeName === "Boolean") {
  7118. shouldCast = true;
  7119. break;
  7120. } else if (typeName === "String") {
  7121. shouldCastTrue = false;
  7122. }
  7123. }
  7124. } else {
  7125. shouldCast = isFunction(propType) && propType.name === "Boolean";
  7126. }
  7127. prop[0 /* shouldCast */] = shouldCast;
  7128. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  7129. if (shouldCast || hasOwn(prop, "default")) {
  7130. needCastKeys.push(normalizedKey);
  7131. }
  7132. }
  7133. }
  7134. }
  7135. const res = [normalized, needCastKeys];
  7136. if (isObject(comp)) {
  7137. cache.set(comp, res);
  7138. }
  7139. return res;
  7140. }
  7141. function validatePropName(key) {
  7142. if (key[0] !== "$" && !isReservedProp(key)) {
  7143. return true;
  7144. } else {
  7145. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  7146. }
  7147. return false;
  7148. }
  7149. function getType(ctor) {
  7150. if (ctor === null) {
  7151. return "null";
  7152. }
  7153. if (typeof ctor === "function") {
  7154. return ctor.name || "";
  7155. } else if (typeof ctor === "object") {
  7156. const name = ctor.constructor && ctor.constructor.name;
  7157. return name || "";
  7158. }
  7159. return "";
  7160. }
  7161. function validateProps(rawProps, props, instance) {
  7162. const resolvedValues = toRaw(props);
  7163. const options = instance.propsOptions[0];
  7164. const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
  7165. for (const key in options) {
  7166. let opt = options[key];
  7167. if (opt == null) continue;
  7168. validateProp(
  7169. key,
  7170. resolvedValues[key],
  7171. opt,
  7172. shallowReadonly(resolvedValues) ,
  7173. !camelizePropsKey.includes(key)
  7174. );
  7175. }
  7176. }
  7177. function validateProp(name, value, prop, props, isAbsent) {
  7178. const { type, required, validator, skipCheck } = prop;
  7179. if (required && isAbsent) {
  7180. warn$1('Missing required prop: "' + name + '"');
  7181. return;
  7182. }
  7183. if (value == null && !required) {
  7184. return;
  7185. }
  7186. if (type != null && type !== true && !skipCheck) {
  7187. let isValid = false;
  7188. const types = isArray(type) ? type : [type];
  7189. const expectedTypes = [];
  7190. for (let i = 0; i < types.length && !isValid; i++) {
  7191. const { valid, expectedType } = assertType(value, types[i]);
  7192. expectedTypes.push(expectedType || "");
  7193. isValid = valid;
  7194. }
  7195. if (!isValid) {
  7196. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  7197. return;
  7198. }
  7199. }
  7200. if (validator && !validator(value, props)) {
  7201. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  7202. }
  7203. }
  7204. const isSimpleType = /* @__PURE__ */ makeMap(
  7205. "String,Number,Boolean,Function,Symbol,BigInt"
  7206. );
  7207. function assertType(value, type) {
  7208. let valid;
  7209. const expectedType = getType(type);
  7210. if (expectedType === "null") {
  7211. valid = value === null;
  7212. } else if (isSimpleType(expectedType)) {
  7213. const t = typeof value;
  7214. valid = t === expectedType.toLowerCase();
  7215. if (!valid && t === "object") {
  7216. valid = value instanceof type;
  7217. }
  7218. } else if (expectedType === "Object") {
  7219. valid = isObject(value);
  7220. } else if (expectedType === "Array") {
  7221. valid = isArray(value);
  7222. } else {
  7223. valid = value instanceof type;
  7224. }
  7225. return {
  7226. valid,
  7227. expectedType
  7228. };
  7229. }
  7230. function getInvalidTypeMessage(name, value, expectedTypes) {
  7231. if (expectedTypes.length === 0) {
  7232. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  7233. }
  7234. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  7235. const expectedType = expectedTypes[0];
  7236. const receivedType = toRawType(value);
  7237. const expectedValue = styleValue(value, expectedType);
  7238. const receivedValue = styleValue(value, receivedType);
  7239. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  7240. message += ` with value ${expectedValue}`;
  7241. }
  7242. message += `, got ${receivedType} `;
  7243. if (isExplicable(receivedType)) {
  7244. message += `with value ${receivedValue}.`;
  7245. }
  7246. return message;
  7247. }
  7248. function styleValue(value, type) {
  7249. if (type === "String") {
  7250. return `"${value}"`;
  7251. } else if (type === "Number") {
  7252. return `${Number(value)}`;
  7253. } else {
  7254. return `${value}`;
  7255. }
  7256. }
  7257. function isExplicable(type) {
  7258. const explicitTypes = ["string", "number", "boolean"];
  7259. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  7260. }
  7261. function isBoolean(...args) {
  7262. return args.some((elem) => elem.toLowerCase() === "boolean");
  7263. }
  7264. const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
  7265. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  7266. const normalizeSlot = (key, rawSlot, ctx) => {
  7267. if (rawSlot._n) {
  7268. return rawSlot;
  7269. }
  7270. const normalized = withCtx((...args) => {
  7271. if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
  7272. warn$1(
  7273. `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  7274. );
  7275. }
  7276. return normalizeSlotValue(rawSlot(...args));
  7277. }, ctx);
  7278. normalized._c = false;
  7279. return normalized;
  7280. };
  7281. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  7282. const ctx = rawSlots._ctx;
  7283. for (const key in rawSlots) {
  7284. if (isInternalKey(key)) continue;
  7285. const value = rawSlots[key];
  7286. if (isFunction(value)) {
  7287. slots[key] = normalizeSlot(key, value, ctx);
  7288. } else if (value != null) {
  7289. {
  7290. warn$1(
  7291. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  7292. );
  7293. }
  7294. const normalized = normalizeSlotValue(value);
  7295. slots[key] = () => normalized;
  7296. }
  7297. }
  7298. };
  7299. const normalizeVNodeSlots = (instance, children) => {
  7300. if (!isKeepAlive(instance.vnode) && true) {
  7301. warn$1(
  7302. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  7303. );
  7304. }
  7305. const normalized = normalizeSlotValue(children);
  7306. instance.slots.default = () => normalized;
  7307. };
  7308. const assignSlots = (slots, children, optimized) => {
  7309. for (const key in children) {
  7310. if (optimized || !isInternalKey(key)) {
  7311. slots[key] = children[key];
  7312. }
  7313. }
  7314. };
  7315. const initSlots = (instance, children, optimized) => {
  7316. const slots = instance.slots = createInternalObject();
  7317. if (instance.vnode.shapeFlag & 32) {
  7318. const type = children._;
  7319. if (type) {
  7320. assignSlots(slots, children, optimized);
  7321. if (optimized) {
  7322. def(slots, "_", type, true);
  7323. }
  7324. } else {
  7325. normalizeObjectSlots(children, slots);
  7326. }
  7327. } else if (children) {
  7328. normalizeVNodeSlots(instance, children);
  7329. }
  7330. };
  7331. const updateSlots = (instance, children, optimized) => {
  7332. const { vnode, slots } = instance;
  7333. let needDeletionCheck = true;
  7334. let deletionComparisonTarget = EMPTY_OBJ;
  7335. if (vnode.shapeFlag & 32) {
  7336. const type = children._;
  7337. if (type) {
  7338. if (isHmrUpdating) {
  7339. assignSlots(slots, children, optimized);
  7340. trigger(instance, "set", "$slots");
  7341. } else if (optimized && type === 1) {
  7342. needDeletionCheck = false;
  7343. } else {
  7344. assignSlots(slots, children, optimized);
  7345. }
  7346. } else {
  7347. needDeletionCheck = !children.$stable;
  7348. normalizeObjectSlots(children, slots);
  7349. }
  7350. deletionComparisonTarget = children;
  7351. } else if (children) {
  7352. normalizeVNodeSlots(instance, children);
  7353. deletionComparisonTarget = { default: 1 };
  7354. }
  7355. if (needDeletionCheck) {
  7356. for (const key in slots) {
  7357. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  7358. delete slots[key];
  7359. }
  7360. }
  7361. }
  7362. };
  7363. let supported;
  7364. let perf;
  7365. function startMeasure(instance, type) {
  7366. if (instance.appContext.config.performance && isSupported()) {
  7367. perf.mark(`vue-${type}-${instance.uid}`);
  7368. }
  7369. {
  7370. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  7371. }
  7372. }
  7373. function endMeasure(instance, type) {
  7374. if (instance.appContext.config.performance && isSupported()) {
  7375. const startTag = `vue-${type}-${instance.uid}`;
  7376. const endTag = startTag + `:end`;
  7377. const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
  7378. perf.mark(endTag);
  7379. perf.measure(measureName, startTag, endTag);
  7380. perf.clearMeasures(measureName);
  7381. perf.clearMarks(startTag);
  7382. perf.clearMarks(endTag);
  7383. }
  7384. {
  7385. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  7386. }
  7387. }
  7388. function isSupported() {
  7389. if (supported !== void 0) {
  7390. return supported;
  7391. }
  7392. if (typeof window !== "undefined" && window.performance) {
  7393. supported = true;
  7394. perf = window.performance;
  7395. } else {
  7396. supported = false;
  7397. }
  7398. return supported;
  7399. }
  7400. const queuePostRenderEffect = queueEffectWithSuspense ;
  7401. function createRenderer(options) {
  7402. return baseCreateRenderer(options);
  7403. }
  7404. function createHydrationRenderer(options) {
  7405. return baseCreateRenderer(options, createHydrationFunctions);
  7406. }
  7407. function baseCreateRenderer(options, createHydrationFns) {
  7408. const target = getGlobalThis();
  7409. target.__VUE__ = true;
  7410. {
  7411. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  7412. }
  7413. const {
  7414. insert: hostInsert,
  7415. remove: hostRemove,
  7416. patchProp: hostPatchProp,
  7417. createElement: hostCreateElement,
  7418. createText: hostCreateText,
  7419. createComment: hostCreateComment,
  7420. setText: hostSetText,
  7421. setElementText: hostSetElementText,
  7422. parentNode: hostParentNode,
  7423. nextSibling: hostNextSibling,
  7424. setScopeId: hostSetScopeId = NOOP,
  7425. insertStaticContent: hostInsertStaticContent
  7426. } = options;
  7427. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  7428. if (n1 === n2) {
  7429. return;
  7430. }
  7431. if (n1 && !isSameVNodeType(n1, n2)) {
  7432. anchor = getNextHostNode(n1);
  7433. unmount(n1, parentComponent, parentSuspense, true);
  7434. n1 = null;
  7435. }
  7436. if (n2.patchFlag === -2) {
  7437. optimized = false;
  7438. n2.dynamicChildren = null;
  7439. }
  7440. const { type, ref, shapeFlag } = n2;
  7441. switch (type) {
  7442. case Text:
  7443. processText(n1, n2, container, anchor);
  7444. break;
  7445. case Comment:
  7446. processCommentNode(n1, n2, container, anchor);
  7447. break;
  7448. case Static:
  7449. if (n1 == null) {
  7450. mountStaticNode(n2, container, anchor, namespace);
  7451. } else {
  7452. patchStaticNode(n1, n2, container, namespace);
  7453. }
  7454. break;
  7455. case Fragment:
  7456. processFragment(
  7457. n1,
  7458. n2,
  7459. container,
  7460. anchor,
  7461. parentComponent,
  7462. parentSuspense,
  7463. namespace,
  7464. slotScopeIds,
  7465. optimized
  7466. );
  7467. break;
  7468. default:
  7469. if (shapeFlag & 1) {
  7470. processElement(
  7471. n1,
  7472. n2,
  7473. container,
  7474. anchor,
  7475. parentComponent,
  7476. parentSuspense,
  7477. namespace,
  7478. slotScopeIds,
  7479. optimized
  7480. );
  7481. } else if (shapeFlag & 6) {
  7482. processComponent(
  7483. n1,
  7484. n2,
  7485. container,
  7486. anchor,
  7487. parentComponent,
  7488. parentSuspense,
  7489. namespace,
  7490. slotScopeIds,
  7491. optimized
  7492. );
  7493. } else if (shapeFlag & 64) {
  7494. type.process(
  7495. n1,
  7496. n2,
  7497. container,
  7498. anchor,
  7499. parentComponent,
  7500. parentSuspense,
  7501. namespace,
  7502. slotScopeIds,
  7503. optimized,
  7504. internals
  7505. );
  7506. } else if (shapeFlag & 128) {
  7507. type.process(
  7508. n1,
  7509. n2,
  7510. container,
  7511. anchor,
  7512. parentComponent,
  7513. parentSuspense,
  7514. namespace,
  7515. slotScopeIds,
  7516. optimized,
  7517. internals
  7518. );
  7519. } else {
  7520. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  7521. }
  7522. }
  7523. if (ref != null && parentComponent) {
  7524. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  7525. } else if (ref == null && n1 && n1.ref != null) {
  7526. setRef(n1.ref, null, parentSuspense, n1, true);
  7527. }
  7528. };
  7529. const processText = (n1, n2, container, anchor) => {
  7530. if (n1 == null) {
  7531. hostInsert(
  7532. n2.el = hostCreateText(n2.children),
  7533. container,
  7534. anchor
  7535. );
  7536. } else {
  7537. const el = n2.el = n1.el;
  7538. if (n2.children !== n1.children) {
  7539. if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
  7540. const childNodes = container.childNodes;
  7541. const newChild = hostCreateText(n2.children);
  7542. const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
  7543. hostInsert(newChild, container, oldChild);
  7544. hostRemove(oldChild);
  7545. } else {
  7546. hostSetText(el, n2.children);
  7547. }
  7548. }
  7549. }
  7550. };
  7551. const processCommentNode = (n1, n2, container, anchor) => {
  7552. if (n1 == null) {
  7553. hostInsert(
  7554. n2.el = hostCreateComment(n2.children || ""),
  7555. container,
  7556. anchor
  7557. );
  7558. } else {
  7559. n2.el = n1.el;
  7560. }
  7561. };
  7562. const mountStaticNode = (n2, container, anchor, namespace) => {
  7563. [n2.el, n2.anchor] = hostInsertStaticContent(
  7564. n2.children,
  7565. container,
  7566. anchor,
  7567. namespace,
  7568. n2.el,
  7569. n2.anchor
  7570. );
  7571. };
  7572. const patchStaticNode = (n1, n2, container, namespace) => {
  7573. if (n2.children !== n1.children) {
  7574. const anchor = hostNextSibling(n1.anchor);
  7575. removeStaticNode(n1);
  7576. [n2.el, n2.anchor] = hostInsertStaticContent(
  7577. n2.children,
  7578. container,
  7579. anchor,
  7580. namespace
  7581. );
  7582. } else {
  7583. n2.el = n1.el;
  7584. n2.anchor = n1.anchor;
  7585. }
  7586. };
  7587. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  7588. let next;
  7589. while (el && el !== anchor) {
  7590. next = hostNextSibling(el);
  7591. hostInsert(el, container, nextSibling);
  7592. el = next;
  7593. }
  7594. hostInsert(anchor, container, nextSibling);
  7595. };
  7596. const removeStaticNode = ({ el, anchor }) => {
  7597. let next;
  7598. while (el && el !== anchor) {
  7599. next = hostNextSibling(el);
  7600. hostRemove(el);
  7601. el = next;
  7602. }
  7603. hostRemove(anchor);
  7604. };
  7605. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7606. if (n2.type === "svg") {
  7607. namespace = "svg";
  7608. } else if (n2.type === "math") {
  7609. namespace = "mathml";
  7610. }
  7611. if (n1 == null) {
  7612. mountElement(
  7613. n2,
  7614. container,
  7615. anchor,
  7616. parentComponent,
  7617. parentSuspense,
  7618. namespace,
  7619. slotScopeIds,
  7620. optimized
  7621. );
  7622. } else {
  7623. const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
  7624. try {
  7625. if (customElement) {
  7626. customElement._beginPatch();
  7627. }
  7628. patchElement(
  7629. n1,
  7630. n2,
  7631. parentComponent,
  7632. parentSuspense,
  7633. namespace,
  7634. slotScopeIds,
  7635. optimized
  7636. );
  7637. } finally {
  7638. if (customElement) {
  7639. customElement._endPatch();
  7640. }
  7641. }
  7642. }
  7643. };
  7644. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7645. let el;
  7646. let vnodeHook;
  7647. const { props, shapeFlag, transition, dirs } = vnode;
  7648. el = vnode.el = hostCreateElement(
  7649. vnode.type,
  7650. namespace,
  7651. props && props.is,
  7652. props
  7653. );
  7654. if (shapeFlag & 8) {
  7655. hostSetElementText(el, vnode.children);
  7656. } else if (shapeFlag & 16) {
  7657. mountChildren(
  7658. vnode.children,
  7659. el,
  7660. null,
  7661. parentComponent,
  7662. parentSuspense,
  7663. resolveChildrenNamespace(vnode, namespace),
  7664. slotScopeIds,
  7665. optimized
  7666. );
  7667. }
  7668. if (dirs) {
  7669. invokeDirectiveHook(vnode, null, parentComponent, "created");
  7670. }
  7671. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  7672. if (props) {
  7673. for (const key in props) {
  7674. if (key !== "value" && !isReservedProp(key)) {
  7675. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  7676. }
  7677. }
  7678. if ("value" in props) {
  7679. hostPatchProp(el, "value", null, props.value, namespace);
  7680. }
  7681. if (vnodeHook = props.onVnodeBeforeMount) {
  7682. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7683. }
  7684. }
  7685. {
  7686. def(el, "__vnode", vnode, true);
  7687. def(el, "__vueParentComponent", parentComponent, true);
  7688. }
  7689. if (dirs) {
  7690. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  7691. }
  7692. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  7693. if (needCallTransitionHooks) {
  7694. transition.beforeEnter(el);
  7695. }
  7696. hostInsert(el, container, anchor);
  7697. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  7698. queuePostRenderEffect(() => {
  7699. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7700. needCallTransitionHooks && transition.enter(el);
  7701. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  7702. }, parentSuspense);
  7703. }
  7704. };
  7705. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  7706. if (scopeId) {
  7707. hostSetScopeId(el, scopeId);
  7708. }
  7709. if (slotScopeIds) {
  7710. for (let i = 0; i < slotScopeIds.length; i++) {
  7711. hostSetScopeId(el, slotScopeIds[i]);
  7712. }
  7713. }
  7714. if (parentComponent) {
  7715. let subTree = parentComponent.subTree;
  7716. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  7717. subTree = filterSingleRoot(subTree.children) || subTree;
  7718. }
  7719. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  7720. const parentVNode = parentComponent.vnode;
  7721. setScopeId(
  7722. el,
  7723. parentVNode,
  7724. parentVNode.scopeId,
  7725. parentVNode.slotScopeIds,
  7726. parentComponent.parent
  7727. );
  7728. }
  7729. }
  7730. };
  7731. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  7732. for (let i = start; i < children.length; i++) {
  7733. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  7734. patch(
  7735. null,
  7736. child,
  7737. container,
  7738. anchor,
  7739. parentComponent,
  7740. parentSuspense,
  7741. namespace,
  7742. slotScopeIds,
  7743. optimized
  7744. );
  7745. }
  7746. };
  7747. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7748. const el = n2.el = n1.el;
  7749. {
  7750. el.__vnode = n2;
  7751. }
  7752. let { patchFlag, dynamicChildren, dirs } = n2;
  7753. patchFlag |= n1.patchFlag & 16;
  7754. const oldProps = n1.props || EMPTY_OBJ;
  7755. const newProps = n2.props || EMPTY_OBJ;
  7756. let vnodeHook;
  7757. parentComponent && toggleRecurse(parentComponent, false);
  7758. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  7759. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7760. }
  7761. if (dirs) {
  7762. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  7763. }
  7764. parentComponent && toggleRecurse(parentComponent, true);
  7765. if (isHmrUpdating) {
  7766. patchFlag = 0;
  7767. optimized = false;
  7768. dynamicChildren = null;
  7769. }
  7770. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  7771. hostSetElementText(el, "");
  7772. }
  7773. if (dynamicChildren) {
  7774. patchBlockChildren(
  7775. n1.dynamicChildren,
  7776. dynamicChildren,
  7777. el,
  7778. parentComponent,
  7779. parentSuspense,
  7780. resolveChildrenNamespace(n2, namespace),
  7781. slotScopeIds
  7782. );
  7783. {
  7784. traverseStaticChildren(n1, n2);
  7785. }
  7786. } else if (!optimized) {
  7787. patchChildren(
  7788. n1,
  7789. n2,
  7790. el,
  7791. null,
  7792. parentComponent,
  7793. parentSuspense,
  7794. resolveChildrenNamespace(n2, namespace),
  7795. slotScopeIds,
  7796. false
  7797. );
  7798. }
  7799. if (patchFlag > 0) {
  7800. if (patchFlag & 16) {
  7801. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7802. } else {
  7803. if (patchFlag & 2) {
  7804. if (oldProps.class !== newProps.class) {
  7805. hostPatchProp(el, "class", null, newProps.class, namespace);
  7806. }
  7807. }
  7808. if (patchFlag & 4) {
  7809. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  7810. }
  7811. if (patchFlag & 8) {
  7812. const propsToUpdate = n2.dynamicProps;
  7813. for (let i = 0; i < propsToUpdate.length; i++) {
  7814. const key = propsToUpdate[i];
  7815. const prev = oldProps[key];
  7816. const next = newProps[key];
  7817. if (next !== prev || key === "value") {
  7818. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7819. }
  7820. }
  7821. }
  7822. }
  7823. if (patchFlag & 1) {
  7824. if (n1.children !== n2.children) {
  7825. hostSetElementText(el, n2.children);
  7826. }
  7827. }
  7828. } else if (!optimized && dynamicChildren == null) {
  7829. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7830. }
  7831. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  7832. queuePostRenderEffect(() => {
  7833. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7834. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  7835. }, parentSuspense);
  7836. }
  7837. };
  7838. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  7839. for (let i = 0; i < newChildren.length; i++) {
  7840. const oldVNode = oldChildren[i];
  7841. const newVNode = newChildren[i];
  7842. const container = (
  7843. // oldVNode may be an errored async setup() component inside Suspense
  7844. // which will not have a mounted element
  7845. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  7846. // of the Fragment itself so it can move its children.
  7847. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  7848. // which also requires the correct parent container
  7849. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  7850. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  7851. // In other cases, the parent container is not actually used so we
  7852. // just pass the block element here to avoid a DOM parentNode call.
  7853. fallbackContainer
  7854. )
  7855. );
  7856. patch(
  7857. oldVNode,
  7858. newVNode,
  7859. container,
  7860. null,
  7861. parentComponent,
  7862. parentSuspense,
  7863. namespace,
  7864. slotScopeIds,
  7865. true
  7866. );
  7867. }
  7868. };
  7869. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  7870. if (oldProps !== newProps) {
  7871. if (oldProps !== EMPTY_OBJ) {
  7872. for (const key in oldProps) {
  7873. if (!isReservedProp(key) && !(key in newProps)) {
  7874. hostPatchProp(
  7875. el,
  7876. key,
  7877. oldProps[key],
  7878. null,
  7879. namespace,
  7880. parentComponent
  7881. );
  7882. }
  7883. }
  7884. }
  7885. for (const key in newProps) {
  7886. if (isReservedProp(key)) continue;
  7887. const next = newProps[key];
  7888. const prev = oldProps[key];
  7889. if (next !== prev && key !== "value") {
  7890. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7891. }
  7892. }
  7893. if ("value" in newProps) {
  7894. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  7895. }
  7896. }
  7897. };
  7898. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7899. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  7900. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  7901. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  7902. if (
  7903. // #5523 dev root fragment may inherit directives
  7904. isHmrUpdating || patchFlag & 2048
  7905. ) {
  7906. patchFlag = 0;
  7907. optimized = false;
  7908. dynamicChildren = null;
  7909. }
  7910. if (fragmentSlotScopeIds) {
  7911. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  7912. }
  7913. if (n1 == null) {
  7914. hostInsert(fragmentStartAnchor, container, anchor);
  7915. hostInsert(fragmentEndAnchor, container, anchor);
  7916. mountChildren(
  7917. // #10007
  7918. // such fragment like `<></>` will be compiled into
  7919. // a fragment which doesn't have a children.
  7920. // In this case fallback to an empty array
  7921. n2.children || [],
  7922. container,
  7923. fragmentEndAnchor,
  7924. parentComponent,
  7925. parentSuspense,
  7926. namespace,
  7927. slotScopeIds,
  7928. optimized
  7929. );
  7930. } else {
  7931. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  7932. // of renderSlot() with no valid children
  7933. n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
  7934. patchBlockChildren(
  7935. n1.dynamicChildren,
  7936. dynamicChildren,
  7937. container,
  7938. parentComponent,
  7939. parentSuspense,
  7940. namespace,
  7941. slotScopeIds
  7942. );
  7943. {
  7944. traverseStaticChildren(n1, n2);
  7945. }
  7946. } else {
  7947. patchChildren(
  7948. n1,
  7949. n2,
  7950. container,
  7951. fragmentEndAnchor,
  7952. parentComponent,
  7953. parentSuspense,
  7954. namespace,
  7955. slotScopeIds,
  7956. optimized
  7957. );
  7958. }
  7959. }
  7960. };
  7961. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7962. n2.slotScopeIds = slotScopeIds;
  7963. if (n1 == null) {
  7964. if (n2.shapeFlag & 512) {
  7965. parentComponent.ctx.activate(
  7966. n2,
  7967. container,
  7968. anchor,
  7969. namespace,
  7970. optimized
  7971. );
  7972. } else {
  7973. mountComponent(
  7974. n2,
  7975. container,
  7976. anchor,
  7977. parentComponent,
  7978. parentSuspense,
  7979. namespace,
  7980. optimized
  7981. );
  7982. }
  7983. } else {
  7984. updateComponent(n1, n2, optimized);
  7985. }
  7986. };
  7987. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  7988. const instance = (initialVNode.component = createComponentInstance(
  7989. initialVNode,
  7990. parentComponent,
  7991. parentSuspense
  7992. ));
  7993. if (instance.type.__hmrId) {
  7994. registerHMR(instance);
  7995. }
  7996. {
  7997. pushWarningContext(initialVNode);
  7998. startMeasure(instance, `mount`);
  7999. }
  8000. if (isKeepAlive(initialVNode)) {
  8001. instance.ctx.renderer = internals;
  8002. }
  8003. {
  8004. {
  8005. startMeasure(instance, `init`);
  8006. }
  8007. setupComponent(instance, false, optimized);
  8008. {
  8009. endMeasure(instance, `init`);
  8010. }
  8011. }
  8012. if (isHmrUpdating) initialVNode.el = null;
  8013. if (instance.asyncDep) {
  8014. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  8015. if (!initialVNode.el) {
  8016. const placeholder = instance.subTree = createVNode(Comment);
  8017. processCommentNode(null, placeholder, container, anchor);
  8018. initialVNode.placeholder = placeholder.el;
  8019. }
  8020. } else {
  8021. setupRenderEffect(
  8022. instance,
  8023. initialVNode,
  8024. container,
  8025. anchor,
  8026. parentSuspense,
  8027. namespace,
  8028. optimized
  8029. );
  8030. }
  8031. {
  8032. popWarningContext();
  8033. endMeasure(instance, `mount`);
  8034. }
  8035. };
  8036. const updateComponent = (n1, n2, optimized) => {
  8037. const instance = n2.component = n1.component;
  8038. if (shouldUpdateComponent(n1, n2, optimized)) {
  8039. if (instance.asyncDep && !instance.asyncResolved) {
  8040. {
  8041. pushWarningContext(n2);
  8042. }
  8043. updateComponentPreRender(instance, n2, optimized);
  8044. {
  8045. popWarningContext();
  8046. }
  8047. return;
  8048. } else {
  8049. instance.next = n2;
  8050. instance.update();
  8051. }
  8052. } else {
  8053. n2.el = n1.el;
  8054. instance.vnode = n2;
  8055. }
  8056. };
  8057. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  8058. const componentUpdateFn = () => {
  8059. if (!instance.isMounted) {
  8060. let vnodeHook;
  8061. const { el, props } = initialVNode;
  8062. const { bm, m, parent, root, type } = instance;
  8063. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  8064. toggleRecurse(instance, false);
  8065. if (bm) {
  8066. invokeArrayFns(bm);
  8067. }
  8068. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  8069. invokeVNodeHook(vnodeHook, parent, initialVNode);
  8070. }
  8071. toggleRecurse(instance, true);
  8072. if (el && hydrateNode) {
  8073. const hydrateSubTree = () => {
  8074. {
  8075. startMeasure(instance, `render`);
  8076. }
  8077. instance.subTree = renderComponentRoot(instance);
  8078. {
  8079. endMeasure(instance, `render`);
  8080. }
  8081. {
  8082. startMeasure(instance, `hydrate`);
  8083. }
  8084. hydrateNode(
  8085. el,
  8086. instance.subTree,
  8087. instance,
  8088. parentSuspense,
  8089. null
  8090. );
  8091. {
  8092. endMeasure(instance, `hydrate`);
  8093. }
  8094. };
  8095. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  8096. type.__asyncHydrate(
  8097. el,
  8098. instance,
  8099. hydrateSubTree
  8100. );
  8101. } else {
  8102. hydrateSubTree();
  8103. }
  8104. } else {
  8105. if (root.ce && // @ts-expect-error _def is private
  8106. root.ce._def.shadowRoot !== false) {
  8107. root.ce._injectChildStyle(type);
  8108. }
  8109. {
  8110. startMeasure(instance, `render`);
  8111. }
  8112. const subTree = instance.subTree = renderComponentRoot(instance);
  8113. {
  8114. endMeasure(instance, `render`);
  8115. }
  8116. {
  8117. startMeasure(instance, `patch`);
  8118. }
  8119. patch(
  8120. null,
  8121. subTree,
  8122. container,
  8123. anchor,
  8124. instance,
  8125. parentSuspense,
  8126. namespace
  8127. );
  8128. {
  8129. endMeasure(instance, `patch`);
  8130. }
  8131. initialVNode.el = subTree.el;
  8132. }
  8133. if (m) {
  8134. queuePostRenderEffect(m, parentSuspense);
  8135. }
  8136. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  8137. const scopedInitialVNode = initialVNode;
  8138. queuePostRenderEffect(
  8139. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  8140. parentSuspense
  8141. );
  8142. }
  8143. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  8144. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  8145. }
  8146. instance.isMounted = true;
  8147. {
  8148. devtoolsComponentAdded(instance);
  8149. }
  8150. initialVNode = container = anchor = null;
  8151. } else {
  8152. let { next, bu, u, parent, vnode } = instance;
  8153. {
  8154. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  8155. if (nonHydratedAsyncRoot) {
  8156. if (next) {
  8157. next.el = vnode.el;
  8158. updateComponentPreRender(instance, next, optimized);
  8159. }
  8160. nonHydratedAsyncRoot.asyncDep.then(() => {
  8161. if (!instance.isUnmounted) {
  8162. componentUpdateFn();
  8163. }
  8164. });
  8165. return;
  8166. }
  8167. }
  8168. let originNext = next;
  8169. let vnodeHook;
  8170. {
  8171. pushWarningContext(next || instance.vnode);
  8172. }
  8173. toggleRecurse(instance, false);
  8174. if (next) {
  8175. next.el = vnode.el;
  8176. updateComponentPreRender(instance, next, optimized);
  8177. } else {
  8178. next = vnode;
  8179. }
  8180. if (bu) {
  8181. invokeArrayFns(bu);
  8182. }
  8183. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  8184. invokeVNodeHook(vnodeHook, parent, next, vnode);
  8185. }
  8186. toggleRecurse(instance, true);
  8187. {
  8188. startMeasure(instance, `render`);
  8189. }
  8190. const nextTree = renderComponentRoot(instance);
  8191. {
  8192. endMeasure(instance, `render`);
  8193. }
  8194. const prevTree = instance.subTree;
  8195. instance.subTree = nextTree;
  8196. {
  8197. startMeasure(instance, `patch`);
  8198. }
  8199. patch(
  8200. prevTree,
  8201. nextTree,
  8202. // parent may have changed if it's in a teleport
  8203. hostParentNode(prevTree.el),
  8204. // anchor may have changed if it's in a fragment
  8205. getNextHostNode(prevTree),
  8206. instance,
  8207. parentSuspense,
  8208. namespace
  8209. );
  8210. {
  8211. endMeasure(instance, `patch`);
  8212. }
  8213. next.el = nextTree.el;
  8214. if (originNext === null) {
  8215. updateHOCHostEl(instance, nextTree.el);
  8216. }
  8217. if (u) {
  8218. queuePostRenderEffect(u, parentSuspense);
  8219. }
  8220. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  8221. queuePostRenderEffect(
  8222. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  8223. parentSuspense
  8224. );
  8225. }
  8226. {
  8227. devtoolsComponentUpdated(instance);
  8228. }
  8229. {
  8230. popWarningContext();
  8231. }
  8232. }
  8233. };
  8234. instance.scope.on();
  8235. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  8236. instance.scope.off();
  8237. const update = instance.update = effect.run.bind(effect);
  8238. const job = instance.job = effect.runIfDirty.bind(effect);
  8239. job.i = instance;
  8240. job.id = instance.uid;
  8241. effect.scheduler = () => queueJob(job);
  8242. toggleRecurse(instance, true);
  8243. {
  8244. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  8245. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  8246. }
  8247. update();
  8248. };
  8249. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  8250. nextVNode.component = instance;
  8251. const prevProps = instance.vnode.props;
  8252. instance.vnode = nextVNode;
  8253. instance.next = null;
  8254. updateProps(instance, nextVNode.props, prevProps, optimized);
  8255. updateSlots(instance, nextVNode.children, optimized);
  8256. pauseTracking();
  8257. flushPreFlushCbs(instance);
  8258. resetTracking();
  8259. };
  8260. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  8261. const c1 = n1 && n1.children;
  8262. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  8263. const c2 = n2.children;
  8264. const { patchFlag, shapeFlag } = n2;
  8265. if (patchFlag > 0) {
  8266. if (patchFlag & 128) {
  8267. patchKeyedChildren(
  8268. c1,
  8269. c2,
  8270. container,
  8271. anchor,
  8272. parentComponent,
  8273. parentSuspense,
  8274. namespace,
  8275. slotScopeIds,
  8276. optimized
  8277. );
  8278. return;
  8279. } else if (patchFlag & 256) {
  8280. patchUnkeyedChildren(
  8281. c1,
  8282. c2,
  8283. container,
  8284. anchor,
  8285. parentComponent,
  8286. parentSuspense,
  8287. namespace,
  8288. slotScopeIds,
  8289. optimized
  8290. );
  8291. return;
  8292. }
  8293. }
  8294. if (shapeFlag & 8) {
  8295. if (prevShapeFlag & 16) {
  8296. unmountChildren(c1, parentComponent, parentSuspense);
  8297. }
  8298. if (c2 !== c1) {
  8299. hostSetElementText(container, c2);
  8300. }
  8301. } else {
  8302. if (prevShapeFlag & 16) {
  8303. if (shapeFlag & 16) {
  8304. patchKeyedChildren(
  8305. c1,
  8306. c2,
  8307. container,
  8308. anchor,
  8309. parentComponent,
  8310. parentSuspense,
  8311. namespace,
  8312. slotScopeIds,
  8313. optimized
  8314. );
  8315. } else {
  8316. unmountChildren(c1, parentComponent, parentSuspense, true);
  8317. }
  8318. } else {
  8319. if (prevShapeFlag & 8) {
  8320. hostSetElementText(container, "");
  8321. }
  8322. if (shapeFlag & 16) {
  8323. mountChildren(
  8324. c2,
  8325. container,
  8326. anchor,
  8327. parentComponent,
  8328. parentSuspense,
  8329. namespace,
  8330. slotScopeIds,
  8331. optimized
  8332. );
  8333. }
  8334. }
  8335. }
  8336. };
  8337. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  8338. c1 = c1 || EMPTY_ARR;
  8339. c2 = c2 || EMPTY_ARR;
  8340. const oldLength = c1.length;
  8341. const newLength = c2.length;
  8342. const commonLength = Math.min(oldLength, newLength);
  8343. let i;
  8344. for (i = 0; i < commonLength; i++) {
  8345. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  8346. patch(
  8347. c1[i],
  8348. nextChild,
  8349. container,
  8350. null,
  8351. parentComponent,
  8352. parentSuspense,
  8353. namespace,
  8354. slotScopeIds,
  8355. optimized
  8356. );
  8357. }
  8358. if (oldLength > newLength) {
  8359. unmountChildren(
  8360. c1,
  8361. parentComponent,
  8362. parentSuspense,
  8363. true,
  8364. false,
  8365. commonLength
  8366. );
  8367. } else {
  8368. mountChildren(
  8369. c2,
  8370. container,
  8371. anchor,
  8372. parentComponent,
  8373. parentSuspense,
  8374. namespace,
  8375. slotScopeIds,
  8376. optimized,
  8377. commonLength
  8378. );
  8379. }
  8380. };
  8381. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  8382. let i = 0;
  8383. const l2 = c2.length;
  8384. let e1 = c1.length - 1;
  8385. let e2 = l2 - 1;
  8386. while (i <= e1 && i <= e2) {
  8387. const n1 = c1[i];
  8388. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  8389. if (isSameVNodeType(n1, n2)) {
  8390. patch(
  8391. n1,
  8392. n2,
  8393. container,
  8394. null,
  8395. parentComponent,
  8396. parentSuspense,
  8397. namespace,
  8398. slotScopeIds,
  8399. optimized
  8400. );
  8401. } else {
  8402. break;
  8403. }
  8404. i++;
  8405. }
  8406. while (i <= e1 && i <= e2) {
  8407. const n1 = c1[e1];
  8408. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  8409. if (isSameVNodeType(n1, n2)) {
  8410. patch(
  8411. n1,
  8412. n2,
  8413. container,
  8414. null,
  8415. parentComponent,
  8416. parentSuspense,
  8417. namespace,
  8418. slotScopeIds,
  8419. optimized
  8420. );
  8421. } else {
  8422. break;
  8423. }
  8424. e1--;
  8425. e2--;
  8426. }
  8427. if (i > e1) {
  8428. if (i <= e2) {
  8429. const nextPos = e2 + 1;
  8430. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  8431. while (i <= e2) {
  8432. patch(
  8433. null,
  8434. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  8435. container,
  8436. anchor,
  8437. parentComponent,
  8438. parentSuspense,
  8439. namespace,
  8440. slotScopeIds,
  8441. optimized
  8442. );
  8443. i++;
  8444. }
  8445. }
  8446. } else if (i > e2) {
  8447. while (i <= e1) {
  8448. unmount(c1[i], parentComponent, parentSuspense, true);
  8449. i++;
  8450. }
  8451. } else {
  8452. const s1 = i;
  8453. const s2 = i;
  8454. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  8455. for (i = s2; i <= e2; i++) {
  8456. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  8457. if (nextChild.key != null) {
  8458. if (keyToNewIndexMap.has(nextChild.key)) {
  8459. warn$1(
  8460. `Duplicate keys found during update:`,
  8461. JSON.stringify(nextChild.key),
  8462. `Make sure keys are unique.`
  8463. );
  8464. }
  8465. keyToNewIndexMap.set(nextChild.key, i);
  8466. }
  8467. }
  8468. let j;
  8469. let patched = 0;
  8470. const toBePatched = e2 - s2 + 1;
  8471. let moved = false;
  8472. let maxNewIndexSoFar = 0;
  8473. const newIndexToOldIndexMap = new Array(toBePatched);
  8474. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  8475. for (i = s1; i <= e1; i++) {
  8476. const prevChild = c1[i];
  8477. if (patched >= toBePatched) {
  8478. unmount(prevChild, parentComponent, parentSuspense, true);
  8479. continue;
  8480. }
  8481. let newIndex;
  8482. if (prevChild.key != null) {
  8483. newIndex = keyToNewIndexMap.get(prevChild.key);
  8484. } else {
  8485. for (j = s2; j <= e2; j++) {
  8486. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  8487. newIndex = j;
  8488. break;
  8489. }
  8490. }
  8491. }
  8492. if (newIndex === void 0) {
  8493. unmount(prevChild, parentComponent, parentSuspense, true);
  8494. } else {
  8495. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  8496. if (newIndex >= maxNewIndexSoFar) {
  8497. maxNewIndexSoFar = newIndex;
  8498. } else {
  8499. moved = true;
  8500. }
  8501. patch(
  8502. prevChild,
  8503. c2[newIndex],
  8504. container,
  8505. null,
  8506. parentComponent,
  8507. parentSuspense,
  8508. namespace,
  8509. slotScopeIds,
  8510. optimized
  8511. );
  8512. patched++;
  8513. }
  8514. }
  8515. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  8516. j = increasingNewIndexSequence.length - 1;
  8517. for (i = toBePatched - 1; i >= 0; i--) {
  8518. const nextIndex = s2 + i;
  8519. const nextChild = c2[nextIndex];
  8520. const anchorVNode = c2[nextIndex + 1];
  8521. const anchor = nextIndex + 1 < l2 ? (
  8522. // #13559, #14173 fallback to el placeholder for unresolved async component
  8523. anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
  8524. ) : parentAnchor;
  8525. if (newIndexToOldIndexMap[i] === 0) {
  8526. patch(
  8527. null,
  8528. nextChild,
  8529. container,
  8530. anchor,
  8531. parentComponent,
  8532. parentSuspense,
  8533. namespace,
  8534. slotScopeIds,
  8535. optimized
  8536. );
  8537. } else if (moved) {
  8538. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  8539. move(nextChild, container, anchor, 2);
  8540. } else {
  8541. j--;
  8542. }
  8543. }
  8544. }
  8545. }
  8546. };
  8547. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  8548. const { el, type, transition, children, shapeFlag } = vnode;
  8549. if (shapeFlag & 6) {
  8550. move(vnode.component.subTree, container, anchor, moveType);
  8551. return;
  8552. }
  8553. if (shapeFlag & 128) {
  8554. vnode.suspense.move(container, anchor, moveType);
  8555. return;
  8556. }
  8557. if (shapeFlag & 64) {
  8558. type.move(vnode, container, anchor, internals);
  8559. return;
  8560. }
  8561. if (type === Fragment) {
  8562. hostInsert(el, container, anchor);
  8563. for (let i = 0; i < children.length; i++) {
  8564. move(children[i], container, anchor, moveType);
  8565. }
  8566. hostInsert(vnode.anchor, container, anchor);
  8567. return;
  8568. }
  8569. if (type === Static) {
  8570. moveStaticNode(vnode, container, anchor);
  8571. return;
  8572. }
  8573. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  8574. if (needTransition2) {
  8575. if (moveType === 0) {
  8576. transition.beforeEnter(el);
  8577. hostInsert(el, container, anchor);
  8578. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  8579. } else {
  8580. const { leave, delayLeave, afterLeave } = transition;
  8581. const remove2 = () => {
  8582. if (vnode.ctx.isUnmounted) {
  8583. hostRemove(el);
  8584. } else {
  8585. hostInsert(el, container, anchor);
  8586. }
  8587. };
  8588. const performLeave = () => {
  8589. if (el._isLeaving) {
  8590. el[leaveCbKey](
  8591. true
  8592. /* cancelled */
  8593. );
  8594. }
  8595. leave(el, () => {
  8596. remove2();
  8597. afterLeave && afterLeave();
  8598. });
  8599. };
  8600. if (delayLeave) {
  8601. delayLeave(el, remove2, performLeave);
  8602. } else {
  8603. performLeave();
  8604. }
  8605. }
  8606. } else {
  8607. hostInsert(el, container, anchor);
  8608. }
  8609. };
  8610. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  8611. const {
  8612. type,
  8613. props,
  8614. ref,
  8615. children,
  8616. dynamicChildren,
  8617. shapeFlag,
  8618. patchFlag,
  8619. dirs,
  8620. cacheIndex
  8621. } = vnode;
  8622. if (patchFlag === -2) {
  8623. optimized = false;
  8624. }
  8625. if (ref != null) {
  8626. pauseTracking();
  8627. setRef(ref, null, parentSuspense, vnode, true);
  8628. resetTracking();
  8629. }
  8630. if (cacheIndex != null) {
  8631. parentComponent.renderCache[cacheIndex] = void 0;
  8632. }
  8633. if (shapeFlag & 256) {
  8634. parentComponent.ctx.deactivate(vnode);
  8635. return;
  8636. }
  8637. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  8638. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  8639. let vnodeHook;
  8640. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  8641. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  8642. }
  8643. if (shapeFlag & 6) {
  8644. unmountComponent(vnode.component, parentSuspense, doRemove);
  8645. } else {
  8646. if (shapeFlag & 128) {
  8647. vnode.suspense.unmount(parentSuspense, doRemove);
  8648. return;
  8649. }
  8650. if (shouldInvokeDirs) {
  8651. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  8652. }
  8653. if (shapeFlag & 64) {
  8654. vnode.type.remove(
  8655. vnode,
  8656. parentComponent,
  8657. parentSuspense,
  8658. internals,
  8659. doRemove
  8660. );
  8661. } else if (dynamicChildren && // #5154
  8662. // when v-once is used inside a block, setBlockTracking(-1) marks the
  8663. // parent block with hasOnce: true
  8664. // so that it doesn't take the fast path during unmount - otherwise
  8665. // components nested in v-once are never unmounted.
  8666. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  8667. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  8668. unmountChildren(
  8669. dynamicChildren,
  8670. parentComponent,
  8671. parentSuspense,
  8672. false,
  8673. true
  8674. );
  8675. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  8676. unmountChildren(children, parentComponent, parentSuspense);
  8677. }
  8678. if (doRemove) {
  8679. remove(vnode);
  8680. }
  8681. }
  8682. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  8683. queuePostRenderEffect(() => {
  8684. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  8685. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  8686. }, parentSuspense);
  8687. }
  8688. };
  8689. const remove = (vnode) => {
  8690. const { type, el, anchor, transition } = vnode;
  8691. if (type === Fragment) {
  8692. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  8693. vnode.children.forEach((child) => {
  8694. if (child.type === Comment) {
  8695. hostRemove(child.el);
  8696. } else {
  8697. remove(child);
  8698. }
  8699. });
  8700. } else {
  8701. removeFragment(el, anchor);
  8702. }
  8703. return;
  8704. }
  8705. if (type === Static) {
  8706. removeStaticNode(vnode);
  8707. return;
  8708. }
  8709. const performRemove = () => {
  8710. hostRemove(el);
  8711. if (transition && !transition.persisted && transition.afterLeave) {
  8712. transition.afterLeave();
  8713. }
  8714. };
  8715. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  8716. const { leave, delayLeave } = transition;
  8717. const performLeave = () => leave(el, performRemove);
  8718. if (delayLeave) {
  8719. delayLeave(vnode.el, performRemove, performLeave);
  8720. } else {
  8721. performLeave();
  8722. }
  8723. } else {
  8724. performRemove();
  8725. }
  8726. };
  8727. const removeFragment = (cur, end) => {
  8728. let next;
  8729. while (cur !== end) {
  8730. next = hostNextSibling(cur);
  8731. hostRemove(cur);
  8732. cur = next;
  8733. }
  8734. hostRemove(end);
  8735. };
  8736. const unmountComponent = (instance, parentSuspense, doRemove) => {
  8737. if (instance.type.__hmrId) {
  8738. unregisterHMR(instance);
  8739. }
  8740. const { bum, scope, job, subTree, um, m, a } = instance;
  8741. invalidateMount(m);
  8742. invalidateMount(a);
  8743. if (bum) {
  8744. invokeArrayFns(bum);
  8745. }
  8746. scope.stop();
  8747. if (job) {
  8748. job.flags |= 8;
  8749. unmount(subTree, instance, parentSuspense, doRemove);
  8750. }
  8751. if (um) {
  8752. queuePostRenderEffect(um, parentSuspense);
  8753. }
  8754. queuePostRenderEffect(() => {
  8755. instance.isUnmounted = true;
  8756. }, parentSuspense);
  8757. {
  8758. devtoolsComponentRemoved(instance);
  8759. }
  8760. };
  8761. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  8762. for (let i = start; i < children.length; i++) {
  8763. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  8764. }
  8765. };
  8766. const getNextHostNode = (vnode) => {
  8767. if (vnode.shapeFlag & 6) {
  8768. return getNextHostNode(vnode.component.subTree);
  8769. }
  8770. if (vnode.shapeFlag & 128) {
  8771. return vnode.suspense.next();
  8772. }
  8773. const el = hostNextSibling(vnode.anchor || vnode.el);
  8774. const teleportEnd = el && el[TeleportEndKey];
  8775. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  8776. };
  8777. let isFlushing = false;
  8778. const render = (vnode, container, namespace) => {
  8779. let instance;
  8780. if (vnode == null) {
  8781. if (container._vnode) {
  8782. unmount(container._vnode, null, null, true);
  8783. instance = container._vnode.component;
  8784. }
  8785. } else {
  8786. patch(
  8787. container._vnode || null,
  8788. vnode,
  8789. container,
  8790. null,
  8791. null,
  8792. null,
  8793. namespace
  8794. );
  8795. }
  8796. container._vnode = vnode;
  8797. if (!isFlushing) {
  8798. isFlushing = true;
  8799. flushPreFlushCbs(instance);
  8800. flushPostFlushCbs();
  8801. isFlushing = false;
  8802. }
  8803. };
  8804. const internals = {
  8805. p: patch,
  8806. um: unmount,
  8807. m: move,
  8808. r: remove,
  8809. mt: mountComponent,
  8810. mc: mountChildren,
  8811. pc: patchChildren,
  8812. pbc: patchBlockChildren,
  8813. n: getNextHostNode,
  8814. o: options
  8815. };
  8816. let hydrate;
  8817. let hydrateNode;
  8818. if (createHydrationFns) {
  8819. [hydrate, hydrateNode] = createHydrationFns(
  8820. internals
  8821. );
  8822. }
  8823. return {
  8824. render,
  8825. hydrate,
  8826. createApp: createAppAPI(render, hydrate)
  8827. };
  8828. }
  8829. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  8830. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  8831. }
  8832. function toggleRecurse({ effect, job }, allowed) {
  8833. if (allowed) {
  8834. effect.flags |= 32;
  8835. job.flags |= 4;
  8836. } else {
  8837. effect.flags &= -33;
  8838. job.flags &= -5;
  8839. }
  8840. }
  8841. function needTransition(parentSuspense, transition) {
  8842. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  8843. }
  8844. function traverseStaticChildren(n1, n2, shallow = false) {
  8845. const ch1 = n1.children;
  8846. const ch2 = n2.children;
  8847. if (isArray(ch1) && isArray(ch2)) {
  8848. for (let i = 0; i < ch1.length; i++) {
  8849. const c1 = ch1[i];
  8850. let c2 = ch2[i];
  8851. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  8852. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  8853. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  8854. c2.el = c1.el;
  8855. }
  8856. if (!shallow && c2.patchFlag !== -2)
  8857. traverseStaticChildren(c1, c2);
  8858. }
  8859. if (c2.type === Text) {
  8860. if (c2.patchFlag !== -1) {
  8861. c2.el = c1.el;
  8862. } else {
  8863. c2.__elIndex = i + // take fragment start anchor into account
  8864. (n1.type === Fragment ? 1 : 0);
  8865. }
  8866. }
  8867. if (c2.type === Comment && !c2.el) {
  8868. c2.el = c1.el;
  8869. }
  8870. {
  8871. c2.el && (c2.el.__vnode = c2);
  8872. }
  8873. }
  8874. }
  8875. }
  8876. function getSequence(arr) {
  8877. const p = arr.slice();
  8878. const result = [0];
  8879. let i, j, u, v, c;
  8880. const len = arr.length;
  8881. for (i = 0; i < len; i++) {
  8882. const arrI = arr[i];
  8883. if (arrI !== 0) {
  8884. j = result[result.length - 1];
  8885. if (arr[j] < arrI) {
  8886. p[i] = j;
  8887. result.push(i);
  8888. continue;
  8889. }
  8890. u = 0;
  8891. v = result.length - 1;
  8892. while (u < v) {
  8893. c = u + v >> 1;
  8894. if (arr[result[c]] < arrI) {
  8895. u = c + 1;
  8896. } else {
  8897. v = c;
  8898. }
  8899. }
  8900. if (arrI < arr[result[u]]) {
  8901. if (u > 0) {
  8902. p[i] = result[u - 1];
  8903. }
  8904. result[u] = i;
  8905. }
  8906. }
  8907. }
  8908. u = result.length;
  8909. v = result[u - 1];
  8910. while (u-- > 0) {
  8911. result[u] = v;
  8912. v = p[v];
  8913. }
  8914. return result;
  8915. }
  8916. function locateNonHydratedAsyncRoot(instance) {
  8917. const subComponent = instance.subTree.component;
  8918. if (subComponent) {
  8919. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  8920. return subComponent;
  8921. } else {
  8922. return locateNonHydratedAsyncRoot(subComponent);
  8923. }
  8924. }
  8925. }
  8926. function invalidateMount(hooks) {
  8927. if (hooks) {
  8928. for (let i = 0; i < hooks.length; i++)
  8929. hooks[i].flags |= 8;
  8930. }
  8931. }
  8932. function resolveAsyncComponentPlaceholder(anchorVnode) {
  8933. if (anchorVnode.placeholder) {
  8934. return anchorVnode.placeholder;
  8935. }
  8936. const instance = anchorVnode.component;
  8937. if (instance) {
  8938. return resolveAsyncComponentPlaceholder(instance.subTree);
  8939. }
  8940. return null;
  8941. }
  8942. const isSuspense = (type) => type.__isSuspense;
  8943. let suspenseId = 0;
  8944. const SuspenseImpl = {
  8945. name: "Suspense",
  8946. // In order to make Suspense tree-shakable, we need to avoid importing it
  8947. // directly in the renderer. The renderer checks for the __isSuspense flag
  8948. // on a vnode's type and calls the `process` method, passing in renderer
  8949. // internals.
  8950. __isSuspense: true,
  8951. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8952. if (n1 == null) {
  8953. mountSuspense(
  8954. n2,
  8955. container,
  8956. anchor,
  8957. parentComponent,
  8958. parentSuspense,
  8959. namespace,
  8960. slotScopeIds,
  8961. optimized,
  8962. rendererInternals
  8963. );
  8964. } else {
  8965. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  8966. n2.suspense = n1.suspense;
  8967. n2.suspense.vnode = n2;
  8968. n2.el = n1.el;
  8969. return;
  8970. }
  8971. patchSuspense(
  8972. n1,
  8973. n2,
  8974. container,
  8975. anchor,
  8976. parentComponent,
  8977. namespace,
  8978. slotScopeIds,
  8979. optimized,
  8980. rendererInternals
  8981. );
  8982. }
  8983. },
  8984. hydrate: hydrateSuspense,
  8985. normalize: normalizeSuspenseChildren
  8986. };
  8987. const Suspense = SuspenseImpl ;
  8988. function triggerEvent(vnode, name) {
  8989. const eventListener = vnode.props && vnode.props[name];
  8990. if (isFunction(eventListener)) {
  8991. eventListener();
  8992. }
  8993. }
  8994. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8995. const {
  8996. p: patch,
  8997. o: { createElement }
  8998. } = rendererInternals;
  8999. const hiddenContainer = createElement("div");
  9000. const suspense = vnode.suspense = createSuspenseBoundary(
  9001. vnode,
  9002. parentSuspense,
  9003. parentComponent,
  9004. container,
  9005. hiddenContainer,
  9006. anchor,
  9007. namespace,
  9008. slotScopeIds,
  9009. optimized,
  9010. rendererInternals
  9011. );
  9012. patch(
  9013. null,
  9014. suspense.pendingBranch = vnode.ssContent,
  9015. hiddenContainer,
  9016. null,
  9017. parentComponent,
  9018. suspense,
  9019. namespace,
  9020. slotScopeIds
  9021. );
  9022. if (suspense.deps > 0) {
  9023. triggerEvent(vnode, "onPending");
  9024. triggerEvent(vnode, "onFallback");
  9025. patch(
  9026. null,
  9027. vnode.ssFallback,
  9028. container,
  9029. anchor,
  9030. parentComponent,
  9031. null,
  9032. // fallback tree will not have suspense context
  9033. namespace,
  9034. slotScopeIds
  9035. );
  9036. setActiveBranch(suspense, vnode.ssFallback);
  9037. } else {
  9038. suspense.resolve(false, true);
  9039. }
  9040. }
  9041. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  9042. const suspense = n2.suspense = n1.suspense;
  9043. suspense.vnode = n2;
  9044. n2.el = n1.el;
  9045. const newBranch = n2.ssContent;
  9046. const newFallback = n2.ssFallback;
  9047. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  9048. if (pendingBranch) {
  9049. suspense.pendingBranch = newBranch;
  9050. if (isSameVNodeType(pendingBranch, newBranch)) {
  9051. patch(
  9052. pendingBranch,
  9053. newBranch,
  9054. suspense.hiddenContainer,
  9055. null,
  9056. parentComponent,
  9057. suspense,
  9058. namespace,
  9059. slotScopeIds,
  9060. optimized
  9061. );
  9062. if (suspense.deps <= 0) {
  9063. suspense.resolve();
  9064. } else if (isInFallback) {
  9065. if (!isHydrating) {
  9066. patch(
  9067. activeBranch,
  9068. newFallback,
  9069. container,
  9070. anchor,
  9071. parentComponent,
  9072. null,
  9073. // fallback tree will not have suspense context
  9074. namespace,
  9075. slotScopeIds,
  9076. optimized
  9077. );
  9078. setActiveBranch(suspense, newFallback);
  9079. }
  9080. }
  9081. } else {
  9082. suspense.pendingId = suspenseId++;
  9083. if (isHydrating) {
  9084. suspense.isHydrating = false;
  9085. suspense.activeBranch = pendingBranch;
  9086. } else {
  9087. unmount(pendingBranch, parentComponent, suspense);
  9088. }
  9089. suspense.deps = 0;
  9090. suspense.effects.length = 0;
  9091. suspense.hiddenContainer = createElement("div");
  9092. if (isInFallback) {
  9093. patch(
  9094. null,
  9095. newBranch,
  9096. suspense.hiddenContainer,
  9097. null,
  9098. parentComponent,
  9099. suspense,
  9100. namespace,
  9101. slotScopeIds,
  9102. optimized
  9103. );
  9104. if (suspense.deps <= 0) {
  9105. suspense.resolve();
  9106. } else {
  9107. patch(
  9108. activeBranch,
  9109. newFallback,
  9110. container,
  9111. anchor,
  9112. parentComponent,
  9113. null,
  9114. // fallback tree will not have suspense context
  9115. namespace,
  9116. slotScopeIds,
  9117. optimized
  9118. );
  9119. setActiveBranch(suspense, newFallback);
  9120. }
  9121. } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  9122. patch(
  9123. activeBranch,
  9124. newBranch,
  9125. container,
  9126. anchor,
  9127. parentComponent,
  9128. suspense,
  9129. namespace,
  9130. slotScopeIds,
  9131. optimized
  9132. );
  9133. suspense.resolve(true);
  9134. } else {
  9135. patch(
  9136. null,
  9137. newBranch,
  9138. suspense.hiddenContainer,
  9139. null,
  9140. parentComponent,
  9141. suspense,
  9142. namespace,
  9143. slotScopeIds,
  9144. optimized
  9145. );
  9146. if (suspense.deps <= 0) {
  9147. suspense.resolve();
  9148. }
  9149. }
  9150. }
  9151. } else {
  9152. if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  9153. patch(
  9154. activeBranch,
  9155. newBranch,
  9156. container,
  9157. anchor,
  9158. parentComponent,
  9159. suspense,
  9160. namespace,
  9161. slotScopeIds,
  9162. optimized
  9163. );
  9164. setActiveBranch(suspense, newBranch);
  9165. } else {
  9166. triggerEvent(n2, "onPending");
  9167. suspense.pendingBranch = newBranch;
  9168. if (newBranch.shapeFlag & 512) {
  9169. suspense.pendingId = newBranch.component.suspenseId;
  9170. } else {
  9171. suspense.pendingId = suspenseId++;
  9172. }
  9173. patch(
  9174. null,
  9175. newBranch,
  9176. suspense.hiddenContainer,
  9177. null,
  9178. parentComponent,
  9179. suspense,
  9180. namespace,
  9181. slotScopeIds,
  9182. optimized
  9183. );
  9184. if (suspense.deps <= 0) {
  9185. suspense.resolve();
  9186. } else {
  9187. const { timeout, pendingId } = suspense;
  9188. if (timeout > 0) {
  9189. setTimeout(() => {
  9190. if (suspense.pendingId === pendingId) {
  9191. suspense.fallback(newFallback);
  9192. }
  9193. }, timeout);
  9194. } else if (timeout === 0) {
  9195. suspense.fallback(newFallback);
  9196. }
  9197. }
  9198. }
  9199. }
  9200. }
  9201. let hasWarned = false;
  9202. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  9203. if (!hasWarned) {
  9204. hasWarned = true;
  9205. console[console.info ? "info" : "log"](
  9206. `<Suspense> is an experimental feature and its API will likely change.`
  9207. );
  9208. }
  9209. const {
  9210. p: patch,
  9211. m: move,
  9212. um: unmount,
  9213. n: next,
  9214. o: { parentNode, remove }
  9215. } = rendererInternals;
  9216. let parentSuspenseId;
  9217. const isSuspensible = isVNodeSuspensible(vnode);
  9218. if (isSuspensible) {
  9219. if (parentSuspense && parentSuspense.pendingBranch) {
  9220. parentSuspenseId = parentSuspense.pendingId;
  9221. parentSuspense.deps++;
  9222. }
  9223. }
  9224. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  9225. {
  9226. assertNumber(timeout, `Suspense timeout`);
  9227. }
  9228. const initialAnchor = anchor;
  9229. const suspense = {
  9230. vnode,
  9231. parent: parentSuspense,
  9232. parentComponent,
  9233. namespace,
  9234. container,
  9235. hiddenContainer,
  9236. deps: 0,
  9237. pendingId: suspenseId++,
  9238. timeout: typeof timeout === "number" ? timeout : -1,
  9239. activeBranch: null,
  9240. pendingBranch: null,
  9241. isInFallback: !isHydrating,
  9242. isHydrating,
  9243. isUnmounted: false,
  9244. effects: [],
  9245. resolve(resume = false, sync = false) {
  9246. {
  9247. if (!resume && !suspense.pendingBranch) {
  9248. throw new Error(
  9249. `suspense.resolve() is called without a pending branch.`
  9250. );
  9251. }
  9252. if (suspense.isUnmounted) {
  9253. throw new Error(
  9254. `suspense.resolve() is called on an already unmounted suspense boundary.`
  9255. );
  9256. }
  9257. }
  9258. const {
  9259. vnode: vnode2,
  9260. activeBranch,
  9261. pendingBranch,
  9262. pendingId,
  9263. effects,
  9264. parentComponent: parentComponent2,
  9265. container: container2,
  9266. isInFallback
  9267. } = suspense;
  9268. let delayEnter = false;
  9269. if (suspense.isHydrating) {
  9270. suspense.isHydrating = false;
  9271. } else if (!resume) {
  9272. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  9273. if (delayEnter) {
  9274. activeBranch.transition.afterLeave = () => {
  9275. if (pendingId === suspense.pendingId) {
  9276. move(
  9277. pendingBranch,
  9278. container2,
  9279. anchor === initialAnchor ? next(activeBranch) : anchor,
  9280. 0
  9281. );
  9282. queuePostFlushCb(effects);
  9283. if (isInFallback && vnode2.ssFallback) {
  9284. vnode2.ssFallback.el = null;
  9285. }
  9286. }
  9287. };
  9288. }
  9289. if (activeBranch) {
  9290. if (parentNode(activeBranch.el) === container2) {
  9291. anchor = next(activeBranch);
  9292. }
  9293. unmount(activeBranch, parentComponent2, suspense, true);
  9294. if (!delayEnter && isInFallback && vnode2.ssFallback) {
  9295. queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
  9296. }
  9297. }
  9298. if (!delayEnter) {
  9299. move(pendingBranch, container2, anchor, 0);
  9300. }
  9301. }
  9302. setActiveBranch(suspense, pendingBranch);
  9303. suspense.pendingBranch = null;
  9304. suspense.isInFallback = false;
  9305. let parent = suspense.parent;
  9306. let hasUnresolvedAncestor = false;
  9307. while (parent) {
  9308. if (parent.pendingBranch) {
  9309. parent.effects.push(...effects);
  9310. hasUnresolvedAncestor = true;
  9311. break;
  9312. }
  9313. parent = parent.parent;
  9314. }
  9315. if (!hasUnresolvedAncestor && !delayEnter) {
  9316. queuePostFlushCb(effects);
  9317. }
  9318. suspense.effects = [];
  9319. if (isSuspensible) {
  9320. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  9321. parentSuspense.deps--;
  9322. if (parentSuspense.deps === 0 && !sync) {
  9323. parentSuspense.resolve();
  9324. }
  9325. }
  9326. }
  9327. triggerEvent(vnode2, "onResolve");
  9328. },
  9329. fallback(fallbackVNode) {
  9330. if (!suspense.pendingBranch) {
  9331. return;
  9332. }
  9333. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  9334. triggerEvent(vnode2, "onFallback");
  9335. const anchor2 = next(activeBranch);
  9336. const mountFallback = () => {
  9337. if (!suspense.isInFallback) {
  9338. return;
  9339. }
  9340. patch(
  9341. null,
  9342. fallbackVNode,
  9343. container2,
  9344. anchor2,
  9345. parentComponent2,
  9346. null,
  9347. // fallback tree will not have suspense context
  9348. namespace2,
  9349. slotScopeIds,
  9350. optimized
  9351. );
  9352. setActiveBranch(suspense, fallbackVNode);
  9353. };
  9354. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  9355. if (delayEnter) {
  9356. activeBranch.transition.afterLeave = mountFallback;
  9357. }
  9358. suspense.isInFallback = true;
  9359. unmount(
  9360. activeBranch,
  9361. parentComponent2,
  9362. null,
  9363. // no suspense so unmount hooks fire now
  9364. true
  9365. // shouldRemove
  9366. );
  9367. if (!delayEnter) {
  9368. mountFallback();
  9369. }
  9370. },
  9371. move(container2, anchor2, type) {
  9372. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  9373. suspense.container = container2;
  9374. },
  9375. next() {
  9376. return suspense.activeBranch && next(suspense.activeBranch);
  9377. },
  9378. registerDep(instance, setupRenderEffect, optimized2) {
  9379. const isInPendingSuspense = !!suspense.pendingBranch;
  9380. if (isInPendingSuspense) {
  9381. suspense.deps++;
  9382. }
  9383. const hydratedEl = instance.vnode.el;
  9384. instance.asyncDep.catch((err) => {
  9385. handleError(err, instance, 0);
  9386. }).then((asyncSetupResult) => {
  9387. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  9388. return;
  9389. }
  9390. instance.asyncResolved = true;
  9391. const { vnode: vnode2 } = instance;
  9392. {
  9393. pushWarningContext(vnode2);
  9394. }
  9395. handleSetupResult(instance, asyncSetupResult, false);
  9396. if (hydratedEl) {
  9397. vnode2.el = hydratedEl;
  9398. }
  9399. const placeholder = !hydratedEl && instance.subTree.el;
  9400. setupRenderEffect(
  9401. instance,
  9402. vnode2,
  9403. // component may have been moved before resolve.
  9404. // if this is not a hydration, instance.subTree will be the comment
  9405. // placeholder.
  9406. parentNode(hydratedEl || instance.subTree.el),
  9407. // anchor will not be used if this is hydration, so only need to
  9408. // consider the comment placeholder case.
  9409. hydratedEl ? null : next(instance.subTree),
  9410. suspense,
  9411. namespace,
  9412. optimized2
  9413. );
  9414. if (placeholder) {
  9415. vnode2.placeholder = null;
  9416. remove(placeholder);
  9417. }
  9418. updateHOCHostEl(instance, vnode2.el);
  9419. {
  9420. popWarningContext();
  9421. }
  9422. if (isInPendingSuspense && --suspense.deps === 0) {
  9423. suspense.resolve();
  9424. }
  9425. });
  9426. },
  9427. unmount(parentSuspense2, doRemove) {
  9428. suspense.isUnmounted = true;
  9429. if (suspense.activeBranch) {
  9430. unmount(
  9431. suspense.activeBranch,
  9432. parentComponent,
  9433. parentSuspense2,
  9434. doRemove
  9435. );
  9436. }
  9437. if (suspense.pendingBranch) {
  9438. unmount(
  9439. suspense.pendingBranch,
  9440. parentComponent,
  9441. parentSuspense2,
  9442. doRemove
  9443. );
  9444. }
  9445. }
  9446. };
  9447. return suspense;
  9448. }
  9449. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  9450. const suspense = vnode.suspense = createSuspenseBoundary(
  9451. vnode,
  9452. parentSuspense,
  9453. parentComponent,
  9454. node.parentNode,
  9455. // eslint-disable-next-line no-restricted-globals
  9456. document.createElement("div"),
  9457. null,
  9458. namespace,
  9459. slotScopeIds,
  9460. optimized,
  9461. rendererInternals,
  9462. true
  9463. );
  9464. const result = hydrateNode(
  9465. node,
  9466. suspense.pendingBranch = vnode.ssContent,
  9467. parentComponent,
  9468. suspense,
  9469. slotScopeIds,
  9470. optimized
  9471. );
  9472. if (suspense.deps === 0) {
  9473. suspense.resolve(false, true);
  9474. }
  9475. return result;
  9476. }
  9477. function normalizeSuspenseChildren(vnode) {
  9478. const { shapeFlag, children } = vnode;
  9479. const isSlotChildren = shapeFlag & 32;
  9480. vnode.ssContent = normalizeSuspenseSlot(
  9481. isSlotChildren ? children.default : children
  9482. );
  9483. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  9484. }
  9485. function normalizeSuspenseSlot(s) {
  9486. let block;
  9487. if (isFunction(s)) {
  9488. const trackBlock = isBlockTreeEnabled && s._c;
  9489. if (trackBlock) {
  9490. s._d = false;
  9491. openBlock();
  9492. }
  9493. s = s();
  9494. if (trackBlock) {
  9495. s._d = true;
  9496. block = currentBlock;
  9497. closeBlock();
  9498. }
  9499. }
  9500. if (isArray(s)) {
  9501. const singleChild = filterSingleRoot(s);
  9502. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  9503. warn$1(`<Suspense> slots expect a single root node.`);
  9504. }
  9505. s = singleChild;
  9506. }
  9507. s = normalizeVNode(s);
  9508. if (block && !s.dynamicChildren) {
  9509. s.dynamicChildren = block.filter((c) => c !== s);
  9510. }
  9511. return s;
  9512. }
  9513. function queueEffectWithSuspense(fn, suspense) {
  9514. if (suspense && suspense.pendingBranch) {
  9515. if (isArray(fn)) {
  9516. suspense.effects.push(...fn);
  9517. } else {
  9518. suspense.effects.push(fn);
  9519. }
  9520. } else {
  9521. queuePostFlushCb(fn);
  9522. }
  9523. }
  9524. function setActiveBranch(suspense, branch) {
  9525. suspense.activeBranch = branch;
  9526. const { vnode, parentComponent } = suspense;
  9527. let el = branch.el;
  9528. while (!el && branch.component) {
  9529. branch = branch.component.subTree;
  9530. el = branch.el;
  9531. }
  9532. vnode.el = el;
  9533. if (parentComponent && parentComponent.subTree === vnode) {
  9534. parentComponent.vnode.el = el;
  9535. updateHOCHostEl(parentComponent, el);
  9536. }
  9537. }
  9538. function isVNodeSuspensible(vnode) {
  9539. const suspensible = vnode.props && vnode.props.suspensible;
  9540. return suspensible != null && suspensible !== false;
  9541. }
  9542. const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
  9543. const Text = /* @__PURE__ */ Symbol.for("v-txt");
  9544. const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
  9545. const Static = /* @__PURE__ */ Symbol.for("v-stc");
  9546. const blockStack = [];
  9547. let currentBlock = null;
  9548. function openBlock(disableTracking = false) {
  9549. blockStack.push(currentBlock = disableTracking ? null : []);
  9550. }
  9551. function closeBlock() {
  9552. blockStack.pop();
  9553. currentBlock = blockStack[blockStack.length - 1] || null;
  9554. }
  9555. let isBlockTreeEnabled = 1;
  9556. function setBlockTracking(value, inVOnce = false) {
  9557. isBlockTreeEnabled += value;
  9558. if (value < 0 && currentBlock && inVOnce) {
  9559. currentBlock.hasOnce = true;
  9560. }
  9561. }
  9562. function setupBlock(vnode) {
  9563. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  9564. closeBlock();
  9565. if (isBlockTreeEnabled > 0 && currentBlock) {
  9566. currentBlock.push(vnode);
  9567. }
  9568. return vnode;
  9569. }
  9570. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  9571. return setupBlock(
  9572. createBaseVNode(
  9573. type,
  9574. props,
  9575. children,
  9576. patchFlag,
  9577. dynamicProps,
  9578. shapeFlag,
  9579. true
  9580. )
  9581. );
  9582. }
  9583. function createBlock(type, props, children, patchFlag, dynamicProps) {
  9584. return setupBlock(
  9585. createVNode(
  9586. type,
  9587. props,
  9588. children,
  9589. patchFlag,
  9590. dynamicProps,
  9591. true
  9592. )
  9593. );
  9594. }
  9595. function isVNode(value) {
  9596. return value ? value.__v_isVNode === true : false;
  9597. }
  9598. function isSameVNodeType(n1, n2) {
  9599. if (n2.shapeFlag & 6 && n1.component) {
  9600. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  9601. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  9602. n1.shapeFlag &= -257;
  9603. n2.shapeFlag &= -513;
  9604. return false;
  9605. }
  9606. }
  9607. return n1.type === n2.type && n1.key === n2.key;
  9608. }
  9609. let vnodeArgsTransformer;
  9610. function transformVNodeArgs(transformer) {
  9611. vnodeArgsTransformer = transformer;
  9612. }
  9613. const createVNodeWithArgsTransform = (...args) => {
  9614. return _createVNode(
  9615. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  9616. );
  9617. };
  9618. const normalizeKey = ({ key }) => key != null ? key : null;
  9619. const normalizeRef = ({
  9620. ref,
  9621. ref_key,
  9622. ref_for
  9623. }) => {
  9624. if (typeof ref === "number") {
  9625. ref = "" + ref;
  9626. }
  9627. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  9628. };
  9629. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  9630. const vnode = {
  9631. __v_isVNode: true,
  9632. __v_skip: true,
  9633. type,
  9634. props,
  9635. key: props && normalizeKey(props),
  9636. ref: props && normalizeRef(props),
  9637. scopeId: currentScopeId,
  9638. slotScopeIds: null,
  9639. children,
  9640. component: null,
  9641. suspense: null,
  9642. ssContent: null,
  9643. ssFallback: null,
  9644. dirs: null,
  9645. transition: null,
  9646. el: null,
  9647. anchor: null,
  9648. target: null,
  9649. targetStart: null,
  9650. targetAnchor: null,
  9651. staticCount: 0,
  9652. shapeFlag,
  9653. patchFlag,
  9654. dynamicProps,
  9655. dynamicChildren: null,
  9656. appContext: null,
  9657. ctx: currentRenderingInstance
  9658. };
  9659. if (needFullChildrenNormalization) {
  9660. normalizeChildren(vnode, children);
  9661. if (shapeFlag & 128) {
  9662. type.normalize(vnode);
  9663. }
  9664. } else if (children) {
  9665. vnode.shapeFlag |= isString(children) ? 8 : 16;
  9666. }
  9667. if (vnode.key !== vnode.key) {
  9668. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  9669. }
  9670. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  9671. !isBlockNode && // has current parent block
  9672. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  9673. // component nodes also should always be patched, because even if the
  9674. // component doesn't need to update, it needs to persist the instance on to
  9675. // the next vnode so that it can be properly unmounted later.
  9676. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  9677. // vnode should not be considered dynamic due to handler caching.
  9678. vnode.patchFlag !== 32) {
  9679. currentBlock.push(vnode);
  9680. }
  9681. return vnode;
  9682. }
  9683. const createVNode = createVNodeWithArgsTransform ;
  9684. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  9685. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  9686. if (!type) {
  9687. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  9688. }
  9689. type = Comment;
  9690. }
  9691. if (isVNode(type)) {
  9692. const cloned = cloneVNode(
  9693. type,
  9694. props,
  9695. true
  9696. /* mergeRef: true */
  9697. );
  9698. if (children) {
  9699. normalizeChildren(cloned, children);
  9700. }
  9701. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  9702. if (cloned.shapeFlag & 6) {
  9703. currentBlock[currentBlock.indexOf(type)] = cloned;
  9704. } else {
  9705. currentBlock.push(cloned);
  9706. }
  9707. }
  9708. cloned.patchFlag = -2;
  9709. return cloned;
  9710. }
  9711. if (isClassComponent(type)) {
  9712. type = type.__vccOpts;
  9713. }
  9714. if (props) {
  9715. props = guardReactiveProps(props);
  9716. let { class: klass, style } = props;
  9717. if (klass && !isString(klass)) {
  9718. props.class = normalizeClass(klass);
  9719. }
  9720. if (isObject(style)) {
  9721. if (isProxy(style) && !isArray(style)) {
  9722. style = extend({}, style);
  9723. }
  9724. props.style = normalizeStyle(style);
  9725. }
  9726. }
  9727. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  9728. if (shapeFlag & 4 && isProxy(type)) {
  9729. type = toRaw(type);
  9730. warn$1(
  9731. `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
  9732. `
  9733. Component that was made reactive: `,
  9734. type
  9735. );
  9736. }
  9737. return createBaseVNode(
  9738. type,
  9739. props,
  9740. children,
  9741. patchFlag,
  9742. dynamicProps,
  9743. shapeFlag,
  9744. isBlockNode,
  9745. true
  9746. );
  9747. }
  9748. function guardReactiveProps(props) {
  9749. if (!props) return null;
  9750. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  9751. }
  9752. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  9753. const { props, ref, patchFlag, children, transition } = vnode;
  9754. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  9755. const cloned = {
  9756. __v_isVNode: true,
  9757. __v_skip: true,
  9758. type: vnode.type,
  9759. props: mergedProps,
  9760. key: mergedProps && normalizeKey(mergedProps),
  9761. ref: extraProps && extraProps.ref ? (
  9762. // #2078 in the case of <component :is="vnode" ref="extra"/>
  9763. // if the vnode itself already has a ref, cloneVNode will need to merge
  9764. // the refs so the single vnode can be set on multiple refs
  9765. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  9766. ) : ref,
  9767. scopeId: vnode.scopeId,
  9768. slotScopeIds: vnode.slotScopeIds,
  9769. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  9770. target: vnode.target,
  9771. targetStart: vnode.targetStart,
  9772. targetAnchor: vnode.targetAnchor,
  9773. staticCount: vnode.staticCount,
  9774. shapeFlag: vnode.shapeFlag,
  9775. // if the vnode is cloned with extra props, we can no longer assume its
  9776. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  9777. // note: preserve flag for fragments since they use the flag for children
  9778. // fast paths only.
  9779. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  9780. dynamicProps: vnode.dynamicProps,
  9781. dynamicChildren: vnode.dynamicChildren,
  9782. appContext: vnode.appContext,
  9783. dirs: vnode.dirs,
  9784. transition,
  9785. // These should technically only be non-null on mounted VNodes. However,
  9786. // they *should* be copied for kept-alive vnodes. So we just always copy
  9787. // them since them being non-null during a mount doesn't affect the logic as
  9788. // they will simply be overwritten.
  9789. component: vnode.component,
  9790. suspense: vnode.suspense,
  9791. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  9792. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  9793. placeholder: vnode.placeholder,
  9794. el: vnode.el,
  9795. anchor: vnode.anchor,
  9796. ctx: vnode.ctx,
  9797. ce: vnode.ce
  9798. };
  9799. if (transition && cloneTransition) {
  9800. setTransitionHooks(
  9801. cloned,
  9802. transition.clone(cloned)
  9803. );
  9804. }
  9805. return cloned;
  9806. }
  9807. function deepCloneVNode(vnode) {
  9808. const cloned = cloneVNode(vnode);
  9809. if (isArray(vnode.children)) {
  9810. cloned.children = vnode.children.map(deepCloneVNode);
  9811. }
  9812. return cloned;
  9813. }
  9814. function createTextVNode(text = " ", flag = 0) {
  9815. return createVNode(Text, null, text, flag);
  9816. }
  9817. function createStaticVNode(content, numberOfNodes) {
  9818. const vnode = createVNode(Static, null, content);
  9819. vnode.staticCount = numberOfNodes;
  9820. return vnode;
  9821. }
  9822. function createCommentVNode(text = "", asBlock = false) {
  9823. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  9824. }
  9825. function normalizeVNode(child) {
  9826. if (child == null || typeof child === "boolean") {
  9827. return createVNode(Comment);
  9828. } else if (isArray(child)) {
  9829. return createVNode(
  9830. Fragment,
  9831. null,
  9832. // #3666, avoid reference pollution when reusing vnode
  9833. child.slice()
  9834. );
  9835. } else if (isVNode(child)) {
  9836. return cloneIfMounted(child);
  9837. } else {
  9838. return createVNode(Text, null, String(child));
  9839. }
  9840. }
  9841. function cloneIfMounted(child) {
  9842. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  9843. }
  9844. function normalizeChildren(vnode, children) {
  9845. let type = 0;
  9846. const { shapeFlag } = vnode;
  9847. if (children == null) {
  9848. children = null;
  9849. } else if (isArray(children)) {
  9850. type = 16;
  9851. } else if (typeof children === "object") {
  9852. if (shapeFlag & (1 | 64)) {
  9853. const slot = children.default;
  9854. if (slot) {
  9855. slot._c && (slot._d = false);
  9856. normalizeChildren(vnode, slot());
  9857. slot._c && (slot._d = true);
  9858. }
  9859. return;
  9860. } else {
  9861. type = 32;
  9862. const slotFlag = children._;
  9863. if (!slotFlag && !isInternalObject(children)) {
  9864. children._ctx = currentRenderingInstance;
  9865. } else if (slotFlag === 3 && currentRenderingInstance) {
  9866. if (currentRenderingInstance.slots._ === 1) {
  9867. children._ = 1;
  9868. } else {
  9869. children._ = 2;
  9870. vnode.patchFlag |= 1024;
  9871. }
  9872. }
  9873. }
  9874. } else if (isFunction(children)) {
  9875. children = { default: children, _ctx: currentRenderingInstance };
  9876. type = 32;
  9877. } else {
  9878. children = String(children);
  9879. if (shapeFlag & 64) {
  9880. type = 16;
  9881. children = [createTextVNode(children)];
  9882. } else {
  9883. type = 8;
  9884. }
  9885. }
  9886. vnode.children = children;
  9887. vnode.shapeFlag |= type;
  9888. }
  9889. function mergeProps(...args) {
  9890. const ret = {};
  9891. for (let i = 0; i < args.length; i++) {
  9892. const toMerge = args[i];
  9893. for (const key in toMerge) {
  9894. if (key === "class") {
  9895. if (ret.class !== toMerge.class) {
  9896. ret.class = normalizeClass([ret.class, toMerge.class]);
  9897. }
  9898. } else if (key === "style") {
  9899. ret.style = normalizeStyle([ret.style, toMerge.style]);
  9900. } else if (isOn(key)) {
  9901. const existing = ret[key];
  9902. const incoming = toMerge[key];
  9903. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  9904. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  9905. }
  9906. } else if (key !== "") {
  9907. ret[key] = toMerge[key];
  9908. }
  9909. }
  9910. }
  9911. return ret;
  9912. }
  9913. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  9914. callWithAsyncErrorHandling(hook, instance, 7, [
  9915. vnode,
  9916. prevVNode
  9917. ]);
  9918. }
  9919. const emptyAppContext = createAppContext();
  9920. let uid = 0;
  9921. function createComponentInstance(vnode, parent, suspense) {
  9922. const type = vnode.type;
  9923. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  9924. const instance = {
  9925. uid: uid++,
  9926. vnode,
  9927. type,
  9928. parent,
  9929. appContext,
  9930. root: null,
  9931. // to be immediately set
  9932. next: null,
  9933. subTree: null,
  9934. // will be set synchronously right after creation
  9935. effect: null,
  9936. update: null,
  9937. // will be set synchronously right after creation
  9938. job: null,
  9939. scope: new EffectScope(
  9940. true
  9941. /* detached */
  9942. ),
  9943. render: null,
  9944. proxy: null,
  9945. exposed: null,
  9946. exposeProxy: null,
  9947. withProxy: null,
  9948. provides: parent ? parent.provides : Object.create(appContext.provides),
  9949. ids: parent ? parent.ids : ["", 0, 0],
  9950. accessCache: null,
  9951. renderCache: [],
  9952. // local resolved assets
  9953. components: null,
  9954. directives: null,
  9955. // resolved props and emits options
  9956. propsOptions: normalizePropsOptions(type, appContext),
  9957. emitsOptions: normalizeEmitsOptions(type, appContext),
  9958. // emit
  9959. emit: null,
  9960. // to be set immediately
  9961. emitted: null,
  9962. // props default value
  9963. propsDefaults: EMPTY_OBJ,
  9964. // inheritAttrs
  9965. inheritAttrs: type.inheritAttrs,
  9966. // state
  9967. ctx: EMPTY_OBJ,
  9968. data: EMPTY_OBJ,
  9969. props: EMPTY_OBJ,
  9970. attrs: EMPTY_OBJ,
  9971. slots: EMPTY_OBJ,
  9972. refs: EMPTY_OBJ,
  9973. setupState: EMPTY_OBJ,
  9974. setupContext: null,
  9975. // suspense related
  9976. suspense,
  9977. suspenseId: suspense ? suspense.pendingId : 0,
  9978. asyncDep: null,
  9979. asyncResolved: false,
  9980. // lifecycle hooks
  9981. // not using enums here because it results in computed properties
  9982. isMounted: false,
  9983. isUnmounted: false,
  9984. isDeactivated: false,
  9985. bc: null,
  9986. c: null,
  9987. bm: null,
  9988. m: null,
  9989. bu: null,
  9990. u: null,
  9991. um: null,
  9992. bum: null,
  9993. da: null,
  9994. a: null,
  9995. rtg: null,
  9996. rtc: null,
  9997. ec: null,
  9998. sp: null
  9999. };
  10000. {
  10001. instance.ctx = createDevRenderContext(instance);
  10002. }
  10003. instance.root = parent ? parent.root : instance;
  10004. instance.emit = emit.bind(null, instance);
  10005. if (vnode.ce) {
  10006. vnode.ce(instance);
  10007. }
  10008. return instance;
  10009. }
  10010. let currentInstance = null;
  10011. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  10012. let internalSetCurrentInstance;
  10013. let setInSSRSetupState;
  10014. {
  10015. internalSetCurrentInstance = (i) => {
  10016. currentInstance = i;
  10017. };
  10018. setInSSRSetupState = (v) => {
  10019. isInSSRComponentSetup = v;
  10020. };
  10021. }
  10022. const setCurrentInstance = (instance) => {
  10023. const prev = currentInstance;
  10024. internalSetCurrentInstance(instance);
  10025. instance.scope.on();
  10026. return () => {
  10027. instance.scope.off();
  10028. internalSetCurrentInstance(prev);
  10029. };
  10030. };
  10031. const unsetCurrentInstance = () => {
  10032. currentInstance && currentInstance.scope.off();
  10033. internalSetCurrentInstance(null);
  10034. };
  10035. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  10036. function validateComponentName(name, { isNativeTag }) {
  10037. if (isBuiltInTag(name) || isNativeTag(name)) {
  10038. warn$1(
  10039. "Do not use built-in or reserved HTML elements as component id: " + name
  10040. );
  10041. }
  10042. }
  10043. function isStatefulComponent(instance) {
  10044. return instance.vnode.shapeFlag & 4;
  10045. }
  10046. let isInSSRComponentSetup = false;
  10047. function setupComponent(instance, isSSR = false, optimized = false) {
  10048. isSSR && setInSSRSetupState(isSSR);
  10049. const { props, children } = instance.vnode;
  10050. const isStateful = isStatefulComponent(instance);
  10051. initProps(instance, props, isStateful, isSSR);
  10052. initSlots(instance, children, optimized || isSSR);
  10053. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  10054. isSSR && setInSSRSetupState(false);
  10055. return setupResult;
  10056. }
  10057. function setupStatefulComponent(instance, isSSR) {
  10058. const Component = instance.type;
  10059. {
  10060. if (Component.name) {
  10061. validateComponentName(Component.name, instance.appContext.config);
  10062. }
  10063. if (Component.components) {
  10064. const names = Object.keys(Component.components);
  10065. for (let i = 0; i < names.length; i++) {
  10066. validateComponentName(names[i], instance.appContext.config);
  10067. }
  10068. }
  10069. if (Component.directives) {
  10070. const names = Object.keys(Component.directives);
  10071. for (let i = 0; i < names.length; i++) {
  10072. validateDirectiveName(names[i]);
  10073. }
  10074. }
  10075. if (Component.compilerOptions && isRuntimeOnly()) {
  10076. warn$1(
  10077. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  10078. );
  10079. }
  10080. }
  10081. instance.accessCache = /* @__PURE__ */ Object.create(null);
  10082. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  10083. {
  10084. exposePropsOnRenderContext(instance);
  10085. }
  10086. const { setup } = Component;
  10087. if (setup) {
  10088. pauseTracking();
  10089. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  10090. const reset = setCurrentInstance(instance);
  10091. const setupResult = callWithErrorHandling(
  10092. setup,
  10093. instance,
  10094. 0,
  10095. [
  10096. shallowReadonly(instance.props) ,
  10097. setupContext
  10098. ]
  10099. );
  10100. const isAsyncSetup = isPromise(setupResult);
  10101. resetTracking();
  10102. reset();
  10103. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  10104. markAsyncBoundary(instance);
  10105. }
  10106. if (isAsyncSetup) {
  10107. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  10108. if (isSSR) {
  10109. return setupResult.then((resolvedResult) => {
  10110. handleSetupResult(instance, resolvedResult, isSSR);
  10111. }).catch((e) => {
  10112. handleError(e, instance, 0);
  10113. });
  10114. } else {
  10115. instance.asyncDep = setupResult;
  10116. if (!instance.suspense) {
  10117. const name = formatComponentName(instance, Component);
  10118. warn$1(
  10119. `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
  10120. );
  10121. }
  10122. }
  10123. } else {
  10124. handleSetupResult(instance, setupResult, isSSR);
  10125. }
  10126. } else {
  10127. finishComponentSetup(instance, isSSR);
  10128. }
  10129. }
  10130. function handleSetupResult(instance, setupResult, isSSR) {
  10131. if (isFunction(setupResult)) {
  10132. {
  10133. instance.render = setupResult;
  10134. }
  10135. } else if (isObject(setupResult)) {
  10136. if (isVNode(setupResult)) {
  10137. warn$1(
  10138. `setup() should not return VNodes directly - return a render function instead.`
  10139. );
  10140. }
  10141. {
  10142. instance.devtoolsRawSetupState = setupResult;
  10143. }
  10144. instance.setupState = proxyRefs(setupResult);
  10145. {
  10146. exposeSetupStateOnRenderContext(instance);
  10147. }
  10148. } else if (setupResult !== void 0) {
  10149. warn$1(
  10150. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  10151. );
  10152. }
  10153. finishComponentSetup(instance, isSSR);
  10154. }
  10155. let compile$1;
  10156. let installWithProxy;
  10157. function registerRuntimeCompiler(_compile) {
  10158. compile$1 = _compile;
  10159. installWithProxy = (i) => {
  10160. if (i.render._rc) {
  10161. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  10162. }
  10163. };
  10164. }
  10165. const isRuntimeOnly = () => !compile$1;
  10166. function finishComponentSetup(instance, isSSR, skipOptions) {
  10167. const Component = instance.type;
  10168. if (!instance.render) {
  10169. if (!isSSR && compile$1 && !Component.render) {
  10170. const template = Component.template || resolveMergedOptions(instance).template;
  10171. if (template) {
  10172. {
  10173. startMeasure(instance, `compile`);
  10174. }
  10175. const { isCustomElement, compilerOptions } = instance.appContext.config;
  10176. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  10177. const finalCompilerOptions = extend(
  10178. extend(
  10179. {
  10180. isCustomElement,
  10181. delimiters
  10182. },
  10183. compilerOptions
  10184. ),
  10185. componentCompilerOptions
  10186. );
  10187. Component.render = compile$1(template, finalCompilerOptions);
  10188. {
  10189. endMeasure(instance, `compile`);
  10190. }
  10191. }
  10192. }
  10193. instance.render = Component.render || NOOP;
  10194. if (installWithProxy) {
  10195. installWithProxy(instance);
  10196. }
  10197. }
  10198. {
  10199. const reset = setCurrentInstance(instance);
  10200. pauseTracking();
  10201. try {
  10202. applyOptions(instance);
  10203. } finally {
  10204. resetTracking();
  10205. reset();
  10206. }
  10207. }
  10208. if (!Component.render && instance.render === NOOP && !isSSR) {
  10209. if (!compile$1 && Component.template) {
  10210. warn$1(
  10211. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  10212. );
  10213. } else {
  10214. warn$1(`Component is missing template or render function: `, Component);
  10215. }
  10216. }
  10217. }
  10218. const attrsProxyHandlers = {
  10219. get(target, key) {
  10220. markAttrsAccessed();
  10221. track(target, "get", "");
  10222. return target[key];
  10223. },
  10224. set() {
  10225. warn$1(`setupContext.attrs is readonly.`);
  10226. return false;
  10227. },
  10228. deleteProperty() {
  10229. warn$1(`setupContext.attrs is readonly.`);
  10230. return false;
  10231. }
  10232. } ;
  10233. function getSlotsProxy(instance) {
  10234. return new Proxy(instance.slots, {
  10235. get(target, key) {
  10236. track(instance, "get", "$slots");
  10237. return target[key];
  10238. }
  10239. });
  10240. }
  10241. function createSetupContext(instance) {
  10242. const expose = (exposed) => {
  10243. {
  10244. if (instance.exposed) {
  10245. warn$1(`expose() should be called only once per setup().`);
  10246. }
  10247. if (exposed != null) {
  10248. let exposedType = typeof exposed;
  10249. if (exposedType === "object") {
  10250. if (isArray(exposed)) {
  10251. exposedType = "array";
  10252. } else if (isRef(exposed)) {
  10253. exposedType = "ref";
  10254. }
  10255. }
  10256. if (exposedType !== "object") {
  10257. warn$1(
  10258. `expose() should be passed a plain object, received ${exposedType}.`
  10259. );
  10260. }
  10261. }
  10262. }
  10263. instance.exposed = exposed || {};
  10264. };
  10265. {
  10266. let attrsProxy;
  10267. let slotsProxy;
  10268. return Object.freeze({
  10269. get attrs() {
  10270. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  10271. },
  10272. get slots() {
  10273. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  10274. },
  10275. get emit() {
  10276. return (event, ...args) => instance.emit(event, ...args);
  10277. },
  10278. expose
  10279. });
  10280. }
  10281. }
  10282. function getComponentPublicInstance(instance) {
  10283. if (instance.exposed) {
  10284. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  10285. get(target, key) {
  10286. if (key in target) {
  10287. return target[key];
  10288. } else if (key in publicPropertiesMap) {
  10289. return publicPropertiesMap[key](instance);
  10290. }
  10291. },
  10292. has(target, key) {
  10293. return key in target || key in publicPropertiesMap;
  10294. }
  10295. }));
  10296. } else {
  10297. return instance.proxy;
  10298. }
  10299. }
  10300. const classifyRE = /(?:^|[-_])\w/g;
  10301. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  10302. function getComponentName(Component, includeInferred = true) {
  10303. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  10304. }
  10305. function formatComponentName(instance, Component, isRoot = false) {
  10306. let name = getComponentName(Component);
  10307. if (!name && Component.__file) {
  10308. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  10309. if (match) {
  10310. name = match[1];
  10311. }
  10312. }
  10313. if (!name && instance) {
  10314. const inferFromRegistry = (registry) => {
  10315. for (const key in registry) {
  10316. if (registry[key] === Component) {
  10317. return key;
  10318. }
  10319. }
  10320. };
  10321. name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
  10322. instance.parent.type.components
  10323. ) || inferFromRegistry(instance.appContext.components);
  10324. }
  10325. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  10326. }
  10327. function isClassComponent(value) {
  10328. return isFunction(value) && "__vccOpts" in value;
  10329. }
  10330. const computed = (getterOrOptions, debugOptions) => {
  10331. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  10332. {
  10333. const i = getCurrentInstance();
  10334. if (i && i.appContext.config.warnRecursiveComputed) {
  10335. c._warnRecursive = true;
  10336. }
  10337. }
  10338. return c;
  10339. };
  10340. function h(type, propsOrChildren, children) {
  10341. try {
  10342. setBlockTracking(-1);
  10343. const l = arguments.length;
  10344. if (l === 2) {
  10345. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  10346. if (isVNode(propsOrChildren)) {
  10347. return createVNode(type, null, [propsOrChildren]);
  10348. }
  10349. return createVNode(type, propsOrChildren);
  10350. } else {
  10351. return createVNode(type, null, propsOrChildren);
  10352. }
  10353. } else {
  10354. if (l > 3) {
  10355. children = Array.prototype.slice.call(arguments, 2);
  10356. } else if (l === 3 && isVNode(children)) {
  10357. children = [children];
  10358. }
  10359. return createVNode(type, propsOrChildren, children);
  10360. }
  10361. } finally {
  10362. setBlockTracking(1);
  10363. }
  10364. }
  10365. function initCustomFormatter() {
  10366. if (typeof window === "undefined") {
  10367. return;
  10368. }
  10369. const vueStyle = { style: "color:#3ba776" };
  10370. const numberStyle = { style: "color:#1677ff" };
  10371. const stringStyle = { style: "color:#f5222d" };
  10372. const keywordStyle = { style: "color:#eb2f96" };
  10373. const formatter = {
  10374. __vue_custom_formatter: true,
  10375. header(obj) {
  10376. if (!isObject(obj)) {
  10377. return null;
  10378. }
  10379. if (obj.__isVue) {
  10380. return ["div", vueStyle, `VueInstance`];
  10381. } else if (isRef(obj)) {
  10382. pauseTracking();
  10383. const value = obj.value;
  10384. resetTracking();
  10385. return [
  10386. "div",
  10387. {},
  10388. ["span", vueStyle, genRefFlag(obj)],
  10389. "<",
  10390. formatValue(value),
  10391. `>`
  10392. ];
  10393. } else if (isReactive(obj)) {
  10394. return [
  10395. "div",
  10396. {},
  10397. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  10398. "<",
  10399. formatValue(obj),
  10400. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  10401. ];
  10402. } else if (isReadonly(obj)) {
  10403. return [
  10404. "div",
  10405. {},
  10406. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  10407. "<",
  10408. formatValue(obj),
  10409. ">"
  10410. ];
  10411. }
  10412. return null;
  10413. },
  10414. hasBody(obj) {
  10415. return obj && obj.__isVue;
  10416. },
  10417. body(obj) {
  10418. if (obj && obj.__isVue) {
  10419. return [
  10420. "div",
  10421. {},
  10422. ...formatInstance(obj.$)
  10423. ];
  10424. }
  10425. }
  10426. };
  10427. function formatInstance(instance) {
  10428. const blocks = [];
  10429. if (instance.type.props && instance.props) {
  10430. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  10431. }
  10432. if (instance.setupState !== EMPTY_OBJ) {
  10433. blocks.push(createInstanceBlock("setup", instance.setupState));
  10434. }
  10435. if (instance.data !== EMPTY_OBJ) {
  10436. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  10437. }
  10438. const computed = extractKeys(instance, "computed");
  10439. if (computed) {
  10440. blocks.push(createInstanceBlock("computed", computed));
  10441. }
  10442. const injected = extractKeys(instance, "inject");
  10443. if (injected) {
  10444. blocks.push(createInstanceBlock("injected", injected));
  10445. }
  10446. blocks.push([
  10447. "div",
  10448. {},
  10449. [
  10450. "span",
  10451. {
  10452. style: keywordStyle.style + ";opacity:0.66"
  10453. },
  10454. "$ (internal): "
  10455. ],
  10456. ["object", { object: instance }]
  10457. ]);
  10458. return blocks;
  10459. }
  10460. function createInstanceBlock(type, target) {
  10461. target = extend({}, target);
  10462. if (!Object.keys(target).length) {
  10463. return ["span", {}];
  10464. }
  10465. return [
  10466. "div",
  10467. { style: "line-height:1.25em;margin-bottom:0.6em" },
  10468. [
  10469. "div",
  10470. {
  10471. style: "color:#476582"
  10472. },
  10473. type
  10474. ],
  10475. [
  10476. "div",
  10477. {
  10478. style: "padding-left:1.25em"
  10479. },
  10480. ...Object.keys(target).map((key) => {
  10481. return [
  10482. "div",
  10483. {},
  10484. ["span", keywordStyle, key + ": "],
  10485. formatValue(target[key], false)
  10486. ];
  10487. })
  10488. ]
  10489. ];
  10490. }
  10491. function formatValue(v, asRaw = true) {
  10492. if (typeof v === "number") {
  10493. return ["span", numberStyle, v];
  10494. } else if (typeof v === "string") {
  10495. return ["span", stringStyle, JSON.stringify(v)];
  10496. } else if (typeof v === "boolean") {
  10497. return ["span", keywordStyle, v];
  10498. } else if (isObject(v)) {
  10499. return ["object", { object: asRaw ? toRaw(v) : v }];
  10500. } else {
  10501. return ["span", stringStyle, String(v)];
  10502. }
  10503. }
  10504. function extractKeys(instance, type) {
  10505. const Comp = instance.type;
  10506. if (isFunction(Comp)) {
  10507. return;
  10508. }
  10509. const extracted = {};
  10510. for (const key in instance.ctx) {
  10511. if (isKeyOfType(Comp, key, type)) {
  10512. extracted[key] = instance.ctx[key];
  10513. }
  10514. }
  10515. return extracted;
  10516. }
  10517. function isKeyOfType(Comp, key, type) {
  10518. const opts = Comp[type];
  10519. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  10520. return true;
  10521. }
  10522. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  10523. return true;
  10524. }
  10525. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  10526. return true;
  10527. }
  10528. }
  10529. function genRefFlag(v) {
  10530. if (isShallow(v)) {
  10531. return `ShallowRef`;
  10532. }
  10533. if (v.effect) {
  10534. return `ComputedRef`;
  10535. }
  10536. return `Ref`;
  10537. }
  10538. if (window.devtoolsFormatters) {
  10539. window.devtoolsFormatters.push(formatter);
  10540. } else {
  10541. window.devtoolsFormatters = [formatter];
  10542. }
  10543. }
  10544. function withMemo(memo, render, cache, index) {
  10545. const cached = cache[index];
  10546. if (cached && isMemoSame(cached, memo)) {
  10547. return cached;
  10548. }
  10549. const ret = render();
  10550. ret.memo = memo.slice();
  10551. ret.cacheIndex = index;
  10552. return cache[index] = ret;
  10553. }
  10554. function isMemoSame(cached, memo) {
  10555. const prev = cached.memo;
  10556. if (prev.length != memo.length) {
  10557. return false;
  10558. }
  10559. for (let i = 0; i < prev.length; i++) {
  10560. if (hasChanged(prev[i], memo[i])) {
  10561. return false;
  10562. }
  10563. }
  10564. if (isBlockTreeEnabled > 0 && currentBlock) {
  10565. currentBlock.push(cached);
  10566. }
  10567. return true;
  10568. }
  10569. const version = "3.5.26";
  10570. const warn = warn$1 ;
  10571. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  10572. const devtools = devtools$1 ;
  10573. const setDevtoolsHook = setDevtoolsHook$1 ;
  10574. const ssrUtils = null;
  10575. const resolveFilter = null;
  10576. const compatUtils = null;
  10577. const DeprecationTypes = null;
  10578. let policy = void 0;
  10579. const tt = typeof window !== "undefined" && window.trustedTypes;
  10580. if (tt) {
  10581. try {
  10582. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  10583. createHTML: (val) => val
  10584. });
  10585. } catch (e) {
  10586. warn(`Error creating trusted types policy: ${e}`);
  10587. }
  10588. }
  10589. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  10590. const svgNS = "http://www.w3.org/2000/svg";
  10591. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  10592. const doc = typeof document !== "undefined" ? document : null;
  10593. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  10594. const nodeOps = {
  10595. insert: (child, parent, anchor) => {
  10596. parent.insertBefore(child, anchor || null);
  10597. },
  10598. remove: (child) => {
  10599. const parent = child.parentNode;
  10600. if (parent) {
  10601. parent.removeChild(child);
  10602. }
  10603. },
  10604. createElement: (tag, namespace, is, props) => {
  10605. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  10606. if (tag === "select" && props && props.multiple != null) {
  10607. el.setAttribute("multiple", props.multiple);
  10608. }
  10609. return el;
  10610. },
  10611. createText: (text) => doc.createTextNode(text),
  10612. createComment: (text) => doc.createComment(text),
  10613. setText: (node, text) => {
  10614. node.nodeValue = text;
  10615. },
  10616. setElementText: (el, text) => {
  10617. el.textContent = text;
  10618. },
  10619. parentNode: (node) => node.parentNode,
  10620. nextSibling: (node) => node.nextSibling,
  10621. querySelector: (selector) => doc.querySelector(selector),
  10622. setScopeId(el, id) {
  10623. el.setAttribute(id, "");
  10624. },
  10625. // __UNSAFE__
  10626. // Reason: innerHTML.
  10627. // Static content here can only come from compiled templates.
  10628. // As long as the user only uses trusted templates, this is safe.
  10629. insertStaticContent(content, parent, anchor, namespace, start, end) {
  10630. const before = anchor ? anchor.previousSibling : parent.lastChild;
  10631. if (start && (start === end || start.nextSibling)) {
  10632. while (true) {
  10633. parent.insertBefore(start.cloneNode(true), anchor);
  10634. if (start === end || !(start = start.nextSibling)) break;
  10635. }
  10636. } else {
  10637. templateContainer.innerHTML = unsafeToTrustedHTML(
  10638. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  10639. );
  10640. const template = templateContainer.content;
  10641. if (namespace === "svg" || namespace === "mathml") {
  10642. const wrapper = template.firstChild;
  10643. while (wrapper.firstChild) {
  10644. template.appendChild(wrapper.firstChild);
  10645. }
  10646. template.removeChild(wrapper);
  10647. }
  10648. parent.insertBefore(template, anchor);
  10649. }
  10650. return [
  10651. // first
  10652. before ? before.nextSibling : parent.firstChild,
  10653. // last
  10654. anchor ? anchor.previousSibling : parent.lastChild
  10655. ];
  10656. }
  10657. };
  10658. const TRANSITION = "transition";
  10659. const ANIMATION = "animation";
  10660. const vtcKey = /* @__PURE__ */ Symbol("_vtc");
  10661. const DOMTransitionPropsValidators = {
  10662. name: String,
  10663. type: String,
  10664. css: {
  10665. type: Boolean,
  10666. default: true
  10667. },
  10668. duration: [String, Number, Object],
  10669. enterFromClass: String,
  10670. enterActiveClass: String,
  10671. enterToClass: String,
  10672. appearFromClass: String,
  10673. appearActiveClass: String,
  10674. appearToClass: String,
  10675. leaveFromClass: String,
  10676. leaveActiveClass: String,
  10677. leaveToClass: String
  10678. };
  10679. const TransitionPropsValidators = /* @__PURE__ */ extend(
  10680. {},
  10681. BaseTransitionPropsValidators,
  10682. DOMTransitionPropsValidators
  10683. );
  10684. const decorate$1 = (t) => {
  10685. t.displayName = "Transition";
  10686. t.props = TransitionPropsValidators;
  10687. return t;
  10688. };
  10689. const Transition = /* @__PURE__ */ decorate$1(
  10690. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  10691. );
  10692. const callHook = (hook, args = []) => {
  10693. if (isArray(hook)) {
  10694. hook.forEach((h2) => h2(...args));
  10695. } else if (hook) {
  10696. hook(...args);
  10697. }
  10698. };
  10699. const hasExplicitCallback = (hook) => {
  10700. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  10701. };
  10702. function resolveTransitionProps(rawProps) {
  10703. const baseProps = {};
  10704. for (const key in rawProps) {
  10705. if (!(key in DOMTransitionPropsValidators)) {
  10706. baseProps[key] = rawProps[key];
  10707. }
  10708. }
  10709. if (rawProps.css === false) {
  10710. return baseProps;
  10711. }
  10712. const {
  10713. name = "v",
  10714. type,
  10715. duration,
  10716. enterFromClass = `${name}-enter-from`,
  10717. enterActiveClass = `${name}-enter-active`,
  10718. enterToClass = `${name}-enter-to`,
  10719. appearFromClass = enterFromClass,
  10720. appearActiveClass = enterActiveClass,
  10721. appearToClass = enterToClass,
  10722. leaveFromClass = `${name}-leave-from`,
  10723. leaveActiveClass = `${name}-leave-active`,
  10724. leaveToClass = `${name}-leave-to`
  10725. } = rawProps;
  10726. const durations = normalizeDuration(duration);
  10727. const enterDuration = durations && durations[0];
  10728. const leaveDuration = durations && durations[1];
  10729. const {
  10730. onBeforeEnter,
  10731. onEnter,
  10732. onEnterCancelled,
  10733. onLeave,
  10734. onLeaveCancelled,
  10735. onBeforeAppear = onBeforeEnter,
  10736. onAppear = onEnter,
  10737. onAppearCancelled = onEnterCancelled
  10738. } = baseProps;
  10739. const finishEnter = (el, isAppear, done, isCancelled) => {
  10740. el._enterCancelled = isCancelled;
  10741. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10742. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  10743. done && done();
  10744. };
  10745. const finishLeave = (el, done) => {
  10746. el._isLeaving = false;
  10747. removeTransitionClass(el, leaveFromClass);
  10748. removeTransitionClass(el, leaveToClass);
  10749. removeTransitionClass(el, leaveActiveClass);
  10750. done && done();
  10751. };
  10752. const makeEnterHook = (isAppear) => {
  10753. return (el, done) => {
  10754. const hook = isAppear ? onAppear : onEnter;
  10755. const resolve = () => finishEnter(el, isAppear, done);
  10756. callHook(hook, [el, resolve]);
  10757. nextFrame(() => {
  10758. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  10759. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10760. if (!hasExplicitCallback(hook)) {
  10761. whenTransitionEnds(el, type, enterDuration, resolve);
  10762. }
  10763. });
  10764. };
  10765. };
  10766. return extend(baseProps, {
  10767. onBeforeEnter(el) {
  10768. callHook(onBeforeEnter, [el]);
  10769. addTransitionClass(el, enterFromClass);
  10770. addTransitionClass(el, enterActiveClass);
  10771. },
  10772. onBeforeAppear(el) {
  10773. callHook(onBeforeAppear, [el]);
  10774. addTransitionClass(el, appearFromClass);
  10775. addTransitionClass(el, appearActiveClass);
  10776. },
  10777. onEnter: makeEnterHook(false),
  10778. onAppear: makeEnterHook(true),
  10779. onLeave(el, done) {
  10780. el._isLeaving = true;
  10781. const resolve = () => finishLeave(el, done);
  10782. addTransitionClass(el, leaveFromClass);
  10783. if (!el._enterCancelled) {
  10784. forceReflow(el);
  10785. addTransitionClass(el, leaveActiveClass);
  10786. } else {
  10787. addTransitionClass(el, leaveActiveClass);
  10788. forceReflow(el);
  10789. }
  10790. nextFrame(() => {
  10791. if (!el._isLeaving) {
  10792. return;
  10793. }
  10794. removeTransitionClass(el, leaveFromClass);
  10795. addTransitionClass(el, leaveToClass);
  10796. if (!hasExplicitCallback(onLeave)) {
  10797. whenTransitionEnds(el, type, leaveDuration, resolve);
  10798. }
  10799. });
  10800. callHook(onLeave, [el, resolve]);
  10801. },
  10802. onEnterCancelled(el) {
  10803. finishEnter(el, false, void 0, true);
  10804. callHook(onEnterCancelled, [el]);
  10805. },
  10806. onAppearCancelled(el) {
  10807. finishEnter(el, true, void 0, true);
  10808. callHook(onAppearCancelled, [el]);
  10809. },
  10810. onLeaveCancelled(el) {
  10811. finishLeave(el);
  10812. callHook(onLeaveCancelled, [el]);
  10813. }
  10814. });
  10815. }
  10816. function normalizeDuration(duration) {
  10817. if (duration == null) {
  10818. return null;
  10819. } else if (isObject(duration)) {
  10820. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  10821. } else {
  10822. const n = NumberOf(duration);
  10823. return [n, n];
  10824. }
  10825. }
  10826. function NumberOf(val) {
  10827. const res = toNumber(val);
  10828. {
  10829. assertNumber(res, "<transition> explicit duration");
  10830. }
  10831. return res;
  10832. }
  10833. function addTransitionClass(el, cls) {
  10834. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  10835. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  10836. }
  10837. function removeTransitionClass(el, cls) {
  10838. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  10839. const _vtc = el[vtcKey];
  10840. if (_vtc) {
  10841. _vtc.delete(cls);
  10842. if (!_vtc.size) {
  10843. el[vtcKey] = void 0;
  10844. }
  10845. }
  10846. }
  10847. function nextFrame(cb) {
  10848. requestAnimationFrame(() => {
  10849. requestAnimationFrame(cb);
  10850. });
  10851. }
  10852. let endId = 0;
  10853. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  10854. const id = el._endId = ++endId;
  10855. const resolveIfNotStale = () => {
  10856. if (id === el._endId) {
  10857. resolve();
  10858. }
  10859. };
  10860. if (explicitTimeout != null) {
  10861. return setTimeout(resolveIfNotStale, explicitTimeout);
  10862. }
  10863. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  10864. if (!type) {
  10865. return resolve();
  10866. }
  10867. const endEvent = type + "end";
  10868. let ended = 0;
  10869. const end = () => {
  10870. el.removeEventListener(endEvent, onEnd);
  10871. resolveIfNotStale();
  10872. };
  10873. const onEnd = (e) => {
  10874. if (e.target === el && ++ended >= propCount) {
  10875. end();
  10876. }
  10877. };
  10878. setTimeout(() => {
  10879. if (ended < propCount) {
  10880. end();
  10881. }
  10882. }, timeout + 1);
  10883. el.addEventListener(endEvent, onEnd);
  10884. }
  10885. function getTransitionInfo(el, expectedType) {
  10886. const styles = window.getComputedStyle(el);
  10887. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  10888. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  10889. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  10890. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  10891. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  10892. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  10893. const animationTimeout = getTimeout(animationDelays, animationDurations);
  10894. let type = null;
  10895. let timeout = 0;
  10896. let propCount = 0;
  10897. if (expectedType === TRANSITION) {
  10898. if (transitionTimeout > 0) {
  10899. type = TRANSITION;
  10900. timeout = transitionTimeout;
  10901. propCount = transitionDurations.length;
  10902. }
  10903. } else if (expectedType === ANIMATION) {
  10904. if (animationTimeout > 0) {
  10905. type = ANIMATION;
  10906. timeout = animationTimeout;
  10907. propCount = animationDurations.length;
  10908. }
  10909. } else {
  10910. timeout = Math.max(transitionTimeout, animationTimeout);
  10911. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  10912. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  10913. }
  10914. const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
  10915. getStyleProperties(`${TRANSITION}Property`).toString()
  10916. );
  10917. return {
  10918. type,
  10919. timeout,
  10920. propCount,
  10921. hasTransform
  10922. };
  10923. }
  10924. function getTimeout(delays, durations) {
  10925. while (delays.length < durations.length) {
  10926. delays = delays.concat(delays);
  10927. }
  10928. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  10929. }
  10930. function toMs(s) {
  10931. if (s === "auto") return 0;
  10932. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  10933. }
  10934. function forceReflow(el) {
  10935. const targetDocument = el ? el.ownerDocument : document;
  10936. return targetDocument.body.offsetHeight;
  10937. }
  10938. function patchClass(el, value, isSVG) {
  10939. const transitionClasses = el[vtcKey];
  10940. if (transitionClasses) {
  10941. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  10942. }
  10943. if (value == null) {
  10944. el.removeAttribute("class");
  10945. } else if (isSVG) {
  10946. el.setAttribute("class", value);
  10947. } else {
  10948. el.className = value;
  10949. }
  10950. }
  10951. const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
  10952. const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
  10953. const vShow = {
  10954. // used for prop mismatch check during hydration
  10955. name: "show",
  10956. beforeMount(el, { value }, { transition }) {
  10957. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  10958. if (transition && value) {
  10959. transition.beforeEnter(el);
  10960. } else {
  10961. setDisplay(el, value);
  10962. }
  10963. },
  10964. mounted(el, { value }, { transition }) {
  10965. if (transition && value) {
  10966. transition.enter(el);
  10967. }
  10968. },
  10969. updated(el, { value, oldValue }, { transition }) {
  10970. if (!value === !oldValue) return;
  10971. if (transition) {
  10972. if (value) {
  10973. transition.beforeEnter(el);
  10974. setDisplay(el, true);
  10975. transition.enter(el);
  10976. } else {
  10977. transition.leave(el, () => {
  10978. setDisplay(el, false);
  10979. });
  10980. }
  10981. } else {
  10982. setDisplay(el, value);
  10983. }
  10984. },
  10985. beforeUnmount(el, { value }) {
  10986. setDisplay(el, value);
  10987. }
  10988. };
  10989. function setDisplay(el, value) {
  10990. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  10991. el[vShowHidden] = !value;
  10992. }
  10993. const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("CSS_VAR_TEXT" );
  10994. function useCssVars(getter) {
  10995. const instance = getCurrentInstance();
  10996. if (!instance) {
  10997. warn(`useCssVars is called without current active component instance.`);
  10998. return;
  10999. }
  11000. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  11001. Array.from(
  11002. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  11003. ).forEach((node) => setVarsOnNode(node, vars));
  11004. };
  11005. {
  11006. instance.getCssVars = () => getter(instance.proxy);
  11007. }
  11008. const setVars = () => {
  11009. const vars = getter(instance.proxy);
  11010. if (instance.ce) {
  11011. setVarsOnNode(instance.ce, vars);
  11012. } else {
  11013. setVarsOnVNode(instance.subTree, vars);
  11014. }
  11015. updateTeleports(vars);
  11016. };
  11017. onBeforeUpdate(() => {
  11018. queuePostFlushCb(setVars);
  11019. });
  11020. onMounted(() => {
  11021. watch(setVars, NOOP, { flush: "post" });
  11022. const ob = new MutationObserver(setVars);
  11023. ob.observe(instance.subTree.el.parentNode, { childList: true });
  11024. onUnmounted(() => ob.disconnect());
  11025. });
  11026. }
  11027. function setVarsOnVNode(vnode, vars) {
  11028. if (vnode.shapeFlag & 128) {
  11029. const suspense = vnode.suspense;
  11030. vnode = suspense.activeBranch;
  11031. if (suspense.pendingBranch && !suspense.isHydrating) {
  11032. suspense.effects.push(() => {
  11033. setVarsOnVNode(suspense.activeBranch, vars);
  11034. });
  11035. }
  11036. }
  11037. while (vnode.component) {
  11038. vnode = vnode.component.subTree;
  11039. }
  11040. if (vnode.shapeFlag & 1 && vnode.el) {
  11041. setVarsOnNode(vnode.el, vars);
  11042. } else if (vnode.type === Fragment) {
  11043. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  11044. } else if (vnode.type === Static) {
  11045. let { el, anchor } = vnode;
  11046. while (el) {
  11047. setVarsOnNode(el, vars);
  11048. if (el === anchor) break;
  11049. el = el.nextSibling;
  11050. }
  11051. }
  11052. }
  11053. function setVarsOnNode(el, vars) {
  11054. if (el.nodeType === 1) {
  11055. const style = el.style;
  11056. let cssText = "";
  11057. for (const key in vars) {
  11058. const value = normalizeCssVarValue(vars[key]);
  11059. style.setProperty(`--${key}`, value);
  11060. cssText += `--${key}: ${value};`;
  11061. }
  11062. style[CSS_VAR_TEXT] = cssText;
  11063. }
  11064. }
  11065. const displayRE = /(?:^|;)\s*display\s*:/;
  11066. function patchStyle(el, prev, next) {
  11067. const style = el.style;
  11068. const isCssString = isString(next);
  11069. let hasControlledDisplay = false;
  11070. if (next && !isCssString) {
  11071. if (prev) {
  11072. if (!isString(prev)) {
  11073. for (const key in prev) {
  11074. if (next[key] == null) {
  11075. setStyle(style, key, "");
  11076. }
  11077. }
  11078. } else {
  11079. for (const prevStyle of prev.split(";")) {
  11080. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  11081. if (next[key] == null) {
  11082. setStyle(style, key, "");
  11083. }
  11084. }
  11085. }
  11086. }
  11087. for (const key in next) {
  11088. if (key === "display") {
  11089. hasControlledDisplay = true;
  11090. }
  11091. setStyle(style, key, next[key]);
  11092. }
  11093. } else {
  11094. if (isCssString) {
  11095. if (prev !== next) {
  11096. const cssVarText = style[CSS_VAR_TEXT];
  11097. if (cssVarText) {
  11098. next += ";" + cssVarText;
  11099. }
  11100. style.cssText = next;
  11101. hasControlledDisplay = displayRE.test(next);
  11102. }
  11103. } else if (prev) {
  11104. el.removeAttribute("style");
  11105. }
  11106. }
  11107. if (vShowOriginalDisplay in el) {
  11108. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  11109. if (el[vShowHidden]) {
  11110. style.display = "none";
  11111. }
  11112. }
  11113. }
  11114. const semicolonRE = /[^\\];\s*$/;
  11115. const importantRE = /\s*!important$/;
  11116. function setStyle(style, name, val) {
  11117. if (isArray(val)) {
  11118. val.forEach((v) => setStyle(style, name, v));
  11119. } else {
  11120. if (val == null) val = "";
  11121. {
  11122. if (semicolonRE.test(val)) {
  11123. warn(
  11124. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  11125. );
  11126. }
  11127. }
  11128. if (name.startsWith("--")) {
  11129. style.setProperty(name, val);
  11130. } else {
  11131. const prefixed = autoPrefix(style, name);
  11132. if (importantRE.test(val)) {
  11133. style.setProperty(
  11134. hyphenate(prefixed),
  11135. val.replace(importantRE, ""),
  11136. "important"
  11137. );
  11138. } else {
  11139. style[prefixed] = val;
  11140. }
  11141. }
  11142. }
  11143. }
  11144. const prefixes = ["Webkit", "Moz", "ms"];
  11145. const prefixCache = {};
  11146. function autoPrefix(style, rawName) {
  11147. const cached = prefixCache[rawName];
  11148. if (cached) {
  11149. return cached;
  11150. }
  11151. let name = camelize(rawName);
  11152. if (name !== "filter" && name in style) {
  11153. return prefixCache[rawName] = name;
  11154. }
  11155. name = capitalize(name);
  11156. for (let i = 0; i < prefixes.length; i++) {
  11157. const prefixed = prefixes[i] + name;
  11158. if (prefixed in style) {
  11159. return prefixCache[rawName] = prefixed;
  11160. }
  11161. }
  11162. return rawName;
  11163. }
  11164. const xlinkNS = "http://www.w3.org/1999/xlink";
  11165. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  11166. if (isSVG && key.startsWith("xlink:")) {
  11167. if (value == null) {
  11168. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  11169. } else {
  11170. el.setAttributeNS(xlinkNS, key, value);
  11171. }
  11172. } else {
  11173. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  11174. el.removeAttribute(key);
  11175. } else {
  11176. el.setAttribute(
  11177. key,
  11178. isBoolean ? "" : isSymbol(value) ? String(value) : value
  11179. );
  11180. }
  11181. }
  11182. }
  11183. function patchDOMProp(el, key, value, parentComponent, attrName) {
  11184. if (key === "innerHTML" || key === "textContent") {
  11185. if (value != null) {
  11186. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  11187. }
  11188. return;
  11189. }
  11190. const tag = el.tagName;
  11191. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  11192. !tag.includes("-")) {
  11193. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  11194. const newValue = value == null ? (
  11195. // #11647: value should be set as empty string for null and undefined,
  11196. // but <input type="checkbox"> should be set as 'on'.
  11197. el.type === "checkbox" ? "on" : ""
  11198. ) : String(value);
  11199. if (oldValue !== newValue || !("_value" in el)) {
  11200. el.value = newValue;
  11201. }
  11202. if (value == null) {
  11203. el.removeAttribute(key);
  11204. }
  11205. el._value = value;
  11206. return;
  11207. }
  11208. let needRemove = false;
  11209. if (value === "" || value == null) {
  11210. const type = typeof el[key];
  11211. if (type === "boolean") {
  11212. value = includeBooleanAttr(value);
  11213. } else if (value == null && type === "string") {
  11214. value = "";
  11215. needRemove = true;
  11216. } else if (type === "number") {
  11217. value = 0;
  11218. needRemove = true;
  11219. }
  11220. }
  11221. try {
  11222. el[key] = value;
  11223. } catch (e) {
  11224. if (!needRemove) {
  11225. warn(
  11226. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  11227. e
  11228. );
  11229. }
  11230. }
  11231. needRemove && el.removeAttribute(attrName || key);
  11232. }
  11233. function addEventListener(el, event, handler, options) {
  11234. el.addEventListener(event, handler, options);
  11235. }
  11236. function removeEventListener(el, event, handler, options) {
  11237. el.removeEventListener(event, handler, options);
  11238. }
  11239. const veiKey = /* @__PURE__ */ Symbol("_vei");
  11240. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  11241. const invokers = el[veiKey] || (el[veiKey] = {});
  11242. const existingInvoker = invokers[rawName];
  11243. if (nextValue && existingInvoker) {
  11244. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  11245. } else {
  11246. const [name, options] = parseName(rawName);
  11247. if (nextValue) {
  11248. const invoker = invokers[rawName] = createInvoker(
  11249. sanitizeEventValue(nextValue, rawName) ,
  11250. instance
  11251. );
  11252. addEventListener(el, name, invoker, options);
  11253. } else if (existingInvoker) {
  11254. removeEventListener(el, name, existingInvoker, options);
  11255. invokers[rawName] = void 0;
  11256. }
  11257. }
  11258. }
  11259. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  11260. function parseName(name) {
  11261. let options;
  11262. if (optionsModifierRE.test(name)) {
  11263. options = {};
  11264. let m;
  11265. while (m = name.match(optionsModifierRE)) {
  11266. name = name.slice(0, name.length - m[0].length);
  11267. options[m[0].toLowerCase()] = true;
  11268. }
  11269. }
  11270. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  11271. return [event, options];
  11272. }
  11273. let cachedNow = 0;
  11274. const p = /* @__PURE__ */ Promise.resolve();
  11275. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  11276. function createInvoker(initialValue, instance) {
  11277. const invoker = (e) => {
  11278. if (!e._vts) {
  11279. e._vts = Date.now();
  11280. } else if (e._vts <= invoker.attached) {
  11281. return;
  11282. }
  11283. callWithAsyncErrorHandling(
  11284. patchStopImmediatePropagation(e, invoker.value),
  11285. instance,
  11286. 5,
  11287. [e]
  11288. );
  11289. };
  11290. invoker.value = initialValue;
  11291. invoker.attached = getNow();
  11292. return invoker;
  11293. }
  11294. function sanitizeEventValue(value, propName) {
  11295. if (isFunction(value) || isArray(value)) {
  11296. return value;
  11297. }
  11298. warn(
  11299. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  11300. Expected function or array of functions, received type ${typeof value}.`
  11301. );
  11302. return NOOP;
  11303. }
  11304. function patchStopImmediatePropagation(e, value) {
  11305. if (isArray(value)) {
  11306. const originalStop = e.stopImmediatePropagation;
  11307. e.stopImmediatePropagation = () => {
  11308. originalStop.call(e);
  11309. e._stopped = true;
  11310. };
  11311. return value.map(
  11312. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  11313. );
  11314. } else {
  11315. return value;
  11316. }
  11317. }
  11318. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  11319. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  11320. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  11321. const isSVG = namespace === "svg";
  11322. if (key === "class") {
  11323. patchClass(el, nextValue, isSVG);
  11324. } else if (key === "style") {
  11325. patchStyle(el, prevValue, nextValue);
  11326. } else if (isOn(key)) {
  11327. if (!isModelListener(key)) {
  11328. patchEvent(el, key, prevValue, nextValue, parentComponent);
  11329. }
  11330. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  11331. patchDOMProp(el, key, nextValue);
  11332. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  11333. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  11334. }
  11335. } else if (
  11336. // #11081 force set props for possible async custom element
  11337. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  11338. ) {
  11339. patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  11340. } else {
  11341. if (key === "true-value") {
  11342. el._trueValue = nextValue;
  11343. } else if (key === "false-value") {
  11344. el._falseValue = nextValue;
  11345. }
  11346. patchAttr(el, key, nextValue, isSVG);
  11347. }
  11348. };
  11349. function shouldSetAsProp(el, key, value, isSVG) {
  11350. if (isSVG) {
  11351. if (key === "innerHTML" || key === "textContent") {
  11352. return true;
  11353. }
  11354. if (key in el && isNativeOn(key) && isFunction(value)) {
  11355. return true;
  11356. }
  11357. return false;
  11358. }
  11359. if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
  11360. return false;
  11361. }
  11362. if (key === "sandbox" && el.tagName === "IFRAME") {
  11363. return false;
  11364. }
  11365. if (key === "form") {
  11366. return false;
  11367. }
  11368. if (key === "list" && el.tagName === "INPUT") {
  11369. return false;
  11370. }
  11371. if (key === "type" && el.tagName === "TEXTAREA") {
  11372. return false;
  11373. }
  11374. if (key === "width" || key === "height") {
  11375. const tag = el.tagName;
  11376. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  11377. return false;
  11378. }
  11379. }
  11380. if (isNativeOn(key) && isString(value)) {
  11381. return false;
  11382. }
  11383. return key in el;
  11384. }
  11385. const REMOVAL = {};
  11386. // @__NO_SIDE_EFFECTS__
  11387. function defineCustomElement(options, extraOptions, _createApp) {
  11388. let Comp = defineComponent(options, extraOptions);
  11389. if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
  11390. class VueCustomElement extends VueElement {
  11391. constructor(initialProps) {
  11392. super(Comp, initialProps, _createApp);
  11393. }
  11394. }
  11395. VueCustomElement.def = Comp;
  11396. return VueCustomElement;
  11397. }
  11398. const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  11399. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  11400. });
  11401. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  11402. };
  11403. class VueElement extends BaseClass {
  11404. constructor(_def, _props = {}, _createApp = createApp) {
  11405. super();
  11406. this._def = _def;
  11407. this._props = _props;
  11408. this._createApp = _createApp;
  11409. this._isVueCE = true;
  11410. /**
  11411. * @internal
  11412. */
  11413. this._instance = null;
  11414. /**
  11415. * @internal
  11416. */
  11417. this._app = null;
  11418. /**
  11419. * @internal
  11420. */
  11421. this._nonce = this._def.nonce;
  11422. this._connected = false;
  11423. this._resolved = false;
  11424. this._patching = false;
  11425. this._dirty = false;
  11426. this._numberProps = null;
  11427. this._styleChildren = /* @__PURE__ */ new WeakSet();
  11428. this._ob = null;
  11429. if (this.shadowRoot && _createApp !== createApp) {
  11430. this._root = this.shadowRoot;
  11431. } else {
  11432. if (this.shadowRoot) {
  11433. warn(
  11434. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  11435. );
  11436. }
  11437. if (_def.shadowRoot !== false) {
  11438. this.attachShadow(
  11439. extend({}, _def.shadowRootOptions, {
  11440. mode: "open"
  11441. })
  11442. );
  11443. this._root = this.shadowRoot;
  11444. } else {
  11445. this._root = this;
  11446. }
  11447. }
  11448. }
  11449. connectedCallback() {
  11450. if (!this.isConnected) return;
  11451. if (!this.shadowRoot && !this._resolved) {
  11452. this._parseSlots();
  11453. }
  11454. this._connected = true;
  11455. let parent = this;
  11456. while (parent = parent && (parent.parentNode || parent.host)) {
  11457. if (parent instanceof VueElement) {
  11458. this._parent = parent;
  11459. break;
  11460. }
  11461. }
  11462. if (!this._instance) {
  11463. if (this._resolved) {
  11464. this._mount(this._def);
  11465. } else {
  11466. if (parent && parent._pendingResolve) {
  11467. this._pendingResolve = parent._pendingResolve.then(() => {
  11468. this._pendingResolve = void 0;
  11469. this._resolveDef();
  11470. });
  11471. } else {
  11472. this._resolveDef();
  11473. }
  11474. }
  11475. }
  11476. }
  11477. _setParent(parent = this._parent) {
  11478. if (parent) {
  11479. this._instance.parent = parent._instance;
  11480. this._inheritParentContext(parent);
  11481. }
  11482. }
  11483. _inheritParentContext(parent = this._parent) {
  11484. if (parent && this._app) {
  11485. Object.setPrototypeOf(
  11486. this._app._context.provides,
  11487. parent._instance.provides
  11488. );
  11489. }
  11490. }
  11491. disconnectedCallback() {
  11492. this._connected = false;
  11493. nextTick(() => {
  11494. if (!this._connected) {
  11495. if (this._ob) {
  11496. this._ob.disconnect();
  11497. this._ob = null;
  11498. }
  11499. this._app && this._app.unmount();
  11500. if (this._instance) this._instance.ce = void 0;
  11501. this._app = this._instance = null;
  11502. if (this._teleportTargets) {
  11503. this._teleportTargets.clear();
  11504. this._teleportTargets = void 0;
  11505. }
  11506. }
  11507. });
  11508. }
  11509. _processMutations(mutations) {
  11510. for (const m of mutations) {
  11511. this._setAttr(m.attributeName);
  11512. }
  11513. }
  11514. /**
  11515. * resolve inner component definition (handle possible async component)
  11516. */
  11517. _resolveDef() {
  11518. if (this._pendingResolve) {
  11519. return;
  11520. }
  11521. for (let i = 0; i < this.attributes.length; i++) {
  11522. this._setAttr(this.attributes[i].name);
  11523. }
  11524. this._ob = new MutationObserver(this._processMutations.bind(this));
  11525. this._ob.observe(this, { attributes: true });
  11526. const resolve = (def, isAsync = false) => {
  11527. this._resolved = true;
  11528. this._pendingResolve = void 0;
  11529. const { props, styles } = def;
  11530. let numberProps;
  11531. if (props && !isArray(props)) {
  11532. for (const key in props) {
  11533. const opt = props[key];
  11534. if (opt === Number || opt && opt.type === Number) {
  11535. if (key in this._props) {
  11536. this._props[key] = toNumber(this._props[key]);
  11537. }
  11538. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  11539. }
  11540. }
  11541. }
  11542. this._numberProps = numberProps;
  11543. this._resolveProps(def);
  11544. if (this.shadowRoot) {
  11545. this._applyStyles(styles);
  11546. } else if (styles) {
  11547. warn(
  11548. "Custom element style injection is not supported when using shadowRoot: false"
  11549. );
  11550. }
  11551. this._mount(def);
  11552. };
  11553. const asyncDef = this._def.__asyncLoader;
  11554. if (asyncDef) {
  11555. this._pendingResolve = asyncDef().then((def) => {
  11556. def.configureApp = this._def.configureApp;
  11557. resolve(this._def = def, true);
  11558. });
  11559. } else {
  11560. resolve(this._def);
  11561. }
  11562. }
  11563. _mount(def) {
  11564. if (!def.name) {
  11565. def.name = "VueElement";
  11566. }
  11567. this._app = this._createApp(def);
  11568. this._inheritParentContext();
  11569. if (def.configureApp) {
  11570. def.configureApp(this._app);
  11571. }
  11572. this._app._ceVNode = this._createVNode();
  11573. this._app.mount(this._root);
  11574. const exposed = this._instance && this._instance.exposed;
  11575. if (!exposed) return;
  11576. for (const key in exposed) {
  11577. if (!hasOwn(this, key)) {
  11578. Object.defineProperty(this, key, {
  11579. // unwrap ref to be consistent with public instance behavior
  11580. get: () => unref(exposed[key])
  11581. });
  11582. } else {
  11583. warn(`Exposed property "${key}" already exists on custom element.`);
  11584. }
  11585. }
  11586. }
  11587. _resolveProps(def) {
  11588. const { props } = def;
  11589. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  11590. for (const key of Object.keys(this)) {
  11591. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  11592. this._setProp(key, this[key]);
  11593. }
  11594. }
  11595. for (const key of declaredPropKeys.map(camelize)) {
  11596. Object.defineProperty(this, key, {
  11597. get() {
  11598. return this._getProp(key);
  11599. },
  11600. set(val) {
  11601. this._setProp(key, val, true, !this._patching);
  11602. }
  11603. });
  11604. }
  11605. }
  11606. _setAttr(key) {
  11607. if (key.startsWith("data-v-")) return;
  11608. const has = this.hasAttribute(key);
  11609. let value = has ? this.getAttribute(key) : REMOVAL;
  11610. const camelKey = camelize(key);
  11611. if (has && this._numberProps && this._numberProps[camelKey]) {
  11612. value = toNumber(value);
  11613. }
  11614. this._setProp(camelKey, value, false, true);
  11615. }
  11616. /**
  11617. * @internal
  11618. */
  11619. _getProp(key) {
  11620. return this._props[key];
  11621. }
  11622. /**
  11623. * @internal
  11624. */
  11625. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  11626. if (val !== this._props[key]) {
  11627. this._dirty = true;
  11628. if (val === REMOVAL) {
  11629. delete this._props[key];
  11630. } else {
  11631. this._props[key] = val;
  11632. if (key === "key" && this._app) {
  11633. this._app._ceVNode.key = val;
  11634. }
  11635. }
  11636. if (shouldUpdate && this._instance) {
  11637. this._update();
  11638. }
  11639. if (shouldReflect) {
  11640. const ob = this._ob;
  11641. if (ob) {
  11642. this._processMutations(ob.takeRecords());
  11643. ob.disconnect();
  11644. }
  11645. if (val === true) {
  11646. this.setAttribute(hyphenate(key), "");
  11647. } else if (typeof val === "string" || typeof val === "number") {
  11648. this.setAttribute(hyphenate(key), val + "");
  11649. } else if (!val) {
  11650. this.removeAttribute(hyphenate(key));
  11651. }
  11652. ob && ob.observe(this, { attributes: true });
  11653. }
  11654. }
  11655. }
  11656. _update() {
  11657. const vnode = this._createVNode();
  11658. if (this._app) vnode.appContext = this._app._context;
  11659. render(vnode, this._root);
  11660. }
  11661. _createVNode() {
  11662. const baseProps = {};
  11663. if (!this.shadowRoot) {
  11664. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  11665. }
  11666. const vnode = createVNode(this._def, extend(baseProps, this._props));
  11667. if (!this._instance) {
  11668. vnode.ce = (instance) => {
  11669. this._instance = instance;
  11670. instance.ce = this;
  11671. instance.isCE = true;
  11672. {
  11673. instance.ceReload = (newStyles) => {
  11674. if (this._styles) {
  11675. this._styles.forEach((s) => this._root.removeChild(s));
  11676. this._styles.length = 0;
  11677. }
  11678. this._applyStyles(newStyles);
  11679. this._instance = null;
  11680. this._update();
  11681. };
  11682. }
  11683. const dispatch = (event, args) => {
  11684. this.dispatchEvent(
  11685. new CustomEvent(
  11686. event,
  11687. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  11688. )
  11689. );
  11690. };
  11691. instance.emit = (event, ...args) => {
  11692. dispatch(event, args);
  11693. if (hyphenate(event) !== event) {
  11694. dispatch(hyphenate(event), args);
  11695. }
  11696. };
  11697. this._setParent();
  11698. };
  11699. }
  11700. return vnode;
  11701. }
  11702. _applyStyles(styles, owner) {
  11703. if (!styles) return;
  11704. if (owner) {
  11705. if (owner === this._def || this._styleChildren.has(owner)) {
  11706. return;
  11707. }
  11708. this._styleChildren.add(owner);
  11709. }
  11710. const nonce = this._nonce;
  11711. for (let i = styles.length - 1; i >= 0; i--) {
  11712. const s = document.createElement("style");
  11713. if (nonce) s.setAttribute("nonce", nonce);
  11714. s.textContent = styles[i];
  11715. this.shadowRoot.prepend(s);
  11716. {
  11717. if (owner) {
  11718. if (owner.__hmrId) {
  11719. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  11720. let entry = this._childStyles.get(owner.__hmrId);
  11721. if (!entry) {
  11722. this._childStyles.set(owner.__hmrId, entry = []);
  11723. }
  11724. entry.push(s);
  11725. }
  11726. } else {
  11727. (this._styles || (this._styles = [])).push(s);
  11728. }
  11729. }
  11730. }
  11731. }
  11732. /**
  11733. * Only called when shadowRoot is false
  11734. */
  11735. _parseSlots() {
  11736. const slots = this._slots = {};
  11737. let n;
  11738. while (n = this.firstChild) {
  11739. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  11740. (slots[slotName] || (slots[slotName] = [])).push(n);
  11741. this.removeChild(n);
  11742. }
  11743. }
  11744. /**
  11745. * Only called when shadowRoot is false
  11746. */
  11747. _renderSlots() {
  11748. const outlets = this._getSlots();
  11749. const scopeId = this._instance.type.__scopeId;
  11750. for (let i = 0; i < outlets.length; i++) {
  11751. const o = outlets[i];
  11752. const slotName = o.getAttribute("name") || "default";
  11753. const content = this._slots[slotName];
  11754. const parent = o.parentNode;
  11755. if (content) {
  11756. for (const n of content) {
  11757. if (scopeId && n.nodeType === 1) {
  11758. const id = scopeId + "-s";
  11759. const walker = document.createTreeWalker(n, 1);
  11760. n.setAttribute(id, "");
  11761. let child;
  11762. while (child = walker.nextNode()) {
  11763. child.setAttribute(id, "");
  11764. }
  11765. }
  11766. parent.insertBefore(n, o);
  11767. }
  11768. } else {
  11769. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  11770. }
  11771. parent.removeChild(o);
  11772. }
  11773. }
  11774. /**
  11775. * @internal
  11776. */
  11777. _getSlots() {
  11778. const roots = [this];
  11779. if (this._teleportTargets) {
  11780. roots.push(...this._teleportTargets);
  11781. }
  11782. const slots = /* @__PURE__ */ new Set();
  11783. for (const root of roots) {
  11784. const found = root.querySelectorAll("slot");
  11785. for (let i = 0; i < found.length; i++) {
  11786. slots.add(found[i]);
  11787. }
  11788. }
  11789. return Array.from(slots);
  11790. }
  11791. /**
  11792. * @internal
  11793. */
  11794. _injectChildStyle(comp) {
  11795. this._applyStyles(comp.styles, comp);
  11796. }
  11797. /**
  11798. * @internal
  11799. */
  11800. _beginPatch() {
  11801. this._patching = true;
  11802. this._dirty = false;
  11803. }
  11804. /**
  11805. * @internal
  11806. */
  11807. _endPatch() {
  11808. this._patching = false;
  11809. if (this._dirty && this._instance) {
  11810. this._update();
  11811. }
  11812. }
  11813. /**
  11814. * @internal
  11815. */
  11816. _removeChildStyle(comp) {
  11817. {
  11818. this._styleChildren.delete(comp);
  11819. if (this._childStyles && comp.__hmrId) {
  11820. const oldStyles = this._childStyles.get(comp.__hmrId);
  11821. if (oldStyles) {
  11822. oldStyles.forEach((s) => this._root.removeChild(s));
  11823. oldStyles.length = 0;
  11824. }
  11825. }
  11826. }
  11827. }
  11828. }
  11829. function useHost(caller) {
  11830. const instance = getCurrentInstance();
  11831. const el = instance && instance.ce;
  11832. if (el) {
  11833. return el;
  11834. } else {
  11835. if (!instance) {
  11836. warn(
  11837. `${caller || "useHost"} called without an active component instance.`
  11838. );
  11839. } else {
  11840. warn(
  11841. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  11842. );
  11843. }
  11844. }
  11845. return null;
  11846. }
  11847. function useShadowRoot() {
  11848. const el = useHost("useShadowRoot") ;
  11849. return el && el.shadowRoot;
  11850. }
  11851. function useCssModule(name = "$style") {
  11852. {
  11853. {
  11854. warn(`useCssModule() is not supported in the global build.`);
  11855. }
  11856. return EMPTY_OBJ;
  11857. }
  11858. }
  11859. const positionMap = /* @__PURE__ */ new WeakMap();
  11860. const newPositionMap = /* @__PURE__ */ new WeakMap();
  11861. const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
  11862. const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
  11863. const decorate = (t) => {
  11864. delete t.props.mode;
  11865. return t;
  11866. };
  11867. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  11868. name: "TransitionGroup",
  11869. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  11870. tag: String,
  11871. moveClass: String
  11872. }),
  11873. setup(props, { slots }) {
  11874. const instance = getCurrentInstance();
  11875. const state = useTransitionState();
  11876. let prevChildren;
  11877. let children;
  11878. onUpdated(() => {
  11879. if (!prevChildren.length) {
  11880. return;
  11881. }
  11882. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  11883. if (!hasCSSTransform(
  11884. prevChildren[0].el,
  11885. instance.vnode.el,
  11886. moveClass
  11887. )) {
  11888. prevChildren = [];
  11889. return;
  11890. }
  11891. prevChildren.forEach(callPendingCbs);
  11892. prevChildren.forEach(recordPosition);
  11893. const movedChildren = prevChildren.filter(applyTranslation);
  11894. forceReflow(instance.vnode.el);
  11895. movedChildren.forEach((c) => {
  11896. const el = c.el;
  11897. const style = el.style;
  11898. addTransitionClass(el, moveClass);
  11899. style.transform = style.webkitTransform = style.transitionDuration = "";
  11900. const cb = el[moveCbKey] = (e) => {
  11901. if (e && e.target !== el) {
  11902. return;
  11903. }
  11904. if (!e || e.propertyName.endsWith("transform")) {
  11905. el.removeEventListener("transitionend", cb);
  11906. el[moveCbKey] = null;
  11907. removeTransitionClass(el, moveClass);
  11908. }
  11909. };
  11910. el.addEventListener("transitionend", cb);
  11911. });
  11912. prevChildren = [];
  11913. });
  11914. return () => {
  11915. const rawProps = toRaw(props);
  11916. const cssTransitionProps = resolveTransitionProps(rawProps);
  11917. let tag = rawProps.tag || Fragment;
  11918. prevChildren = [];
  11919. if (children) {
  11920. for (let i = 0; i < children.length; i++) {
  11921. const child = children[i];
  11922. if (child.el && child.el instanceof Element) {
  11923. prevChildren.push(child);
  11924. setTransitionHooks(
  11925. child,
  11926. resolveTransitionHooks(
  11927. child,
  11928. cssTransitionProps,
  11929. state,
  11930. instance
  11931. )
  11932. );
  11933. positionMap.set(child, {
  11934. left: child.el.offsetLeft,
  11935. top: child.el.offsetTop
  11936. });
  11937. }
  11938. }
  11939. }
  11940. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  11941. for (let i = 0; i < children.length; i++) {
  11942. const child = children[i];
  11943. if (child.key != null) {
  11944. setTransitionHooks(
  11945. child,
  11946. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  11947. );
  11948. } else if (child.type !== Text) {
  11949. warn(`<TransitionGroup> children must be keyed.`);
  11950. }
  11951. }
  11952. return createVNode(tag, null, children);
  11953. };
  11954. }
  11955. });
  11956. const TransitionGroup = TransitionGroupImpl;
  11957. function callPendingCbs(c) {
  11958. const el = c.el;
  11959. if (el[moveCbKey]) {
  11960. el[moveCbKey]();
  11961. }
  11962. if (el[enterCbKey]) {
  11963. el[enterCbKey]();
  11964. }
  11965. }
  11966. function recordPosition(c) {
  11967. newPositionMap.set(c, {
  11968. left: c.el.offsetLeft,
  11969. top: c.el.offsetTop
  11970. });
  11971. }
  11972. function applyTranslation(c) {
  11973. const oldPos = positionMap.get(c);
  11974. const newPos = newPositionMap.get(c);
  11975. const dx = oldPos.left - newPos.left;
  11976. const dy = oldPos.top - newPos.top;
  11977. if (dx || dy) {
  11978. const s = c.el.style;
  11979. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  11980. s.transitionDuration = "0s";
  11981. return c;
  11982. }
  11983. }
  11984. function hasCSSTransform(el, root, moveClass) {
  11985. const clone = el.cloneNode();
  11986. const _vtc = el[vtcKey];
  11987. if (_vtc) {
  11988. _vtc.forEach((cls) => {
  11989. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  11990. });
  11991. }
  11992. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  11993. clone.style.display = "none";
  11994. const container = root.nodeType === 1 ? root : root.parentNode;
  11995. container.appendChild(clone);
  11996. const { hasTransform } = getTransitionInfo(clone);
  11997. container.removeChild(clone);
  11998. return hasTransform;
  11999. }
  12000. const getModelAssigner = (vnode) => {
  12001. const fn = vnode.props["onUpdate:modelValue"] || false;
  12002. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  12003. };
  12004. function onCompositionStart(e) {
  12005. e.target.composing = true;
  12006. }
  12007. function onCompositionEnd(e) {
  12008. const target = e.target;
  12009. if (target.composing) {
  12010. target.composing = false;
  12011. target.dispatchEvent(new Event("input"));
  12012. }
  12013. }
  12014. const assignKey = /* @__PURE__ */ Symbol("_assign");
  12015. function castValue(value, trim, number) {
  12016. if (trim) value = value.trim();
  12017. if (number) value = looseToNumber(value);
  12018. return value;
  12019. }
  12020. const vModelText = {
  12021. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  12022. el[assignKey] = getModelAssigner(vnode);
  12023. const castToNumber = number || vnode.props && vnode.props.type === "number";
  12024. addEventListener(el, lazy ? "change" : "input", (e) => {
  12025. if (e.target.composing) return;
  12026. el[assignKey](castValue(el.value, trim, castToNumber));
  12027. });
  12028. if (trim || castToNumber) {
  12029. addEventListener(el, "change", () => {
  12030. el.value = castValue(el.value, trim, castToNumber);
  12031. });
  12032. }
  12033. if (!lazy) {
  12034. addEventListener(el, "compositionstart", onCompositionStart);
  12035. addEventListener(el, "compositionend", onCompositionEnd);
  12036. addEventListener(el, "change", onCompositionEnd);
  12037. }
  12038. },
  12039. // set value on mounted so it's after min/max for type="range"
  12040. mounted(el, { value }) {
  12041. el.value = value == null ? "" : value;
  12042. },
  12043. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  12044. el[assignKey] = getModelAssigner(vnode);
  12045. if (el.composing) return;
  12046. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  12047. const newValue = value == null ? "" : value;
  12048. if (elValue === newValue) {
  12049. return;
  12050. }
  12051. if (document.activeElement === el && el.type !== "range") {
  12052. if (lazy && value === oldValue) {
  12053. return;
  12054. }
  12055. if (trim && el.value.trim() === newValue) {
  12056. return;
  12057. }
  12058. }
  12059. el.value = newValue;
  12060. }
  12061. };
  12062. const vModelCheckbox = {
  12063. // #4096 array checkboxes need to be deep traversed
  12064. deep: true,
  12065. created(el, _, vnode) {
  12066. el[assignKey] = getModelAssigner(vnode);
  12067. addEventListener(el, "change", () => {
  12068. const modelValue = el._modelValue;
  12069. const elementValue = getValue(el);
  12070. const checked = el.checked;
  12071. const assign = el[assignKey];
  12072. if (isArray(modelValue)) {
  12073. const index = looseIndexOf(modelValue, elementValue);
  12074. const found = index !== -1;
  12075. if (checked && !found) {
  12076. assign(modelValue.concat(elementValue));
  12077. } else if (!checked && found) {
  12078. const filtered = [...modelValue];
  12079. filtered.splice(index, 1);
  12080. assign(filtered);
  12081. }
  12082. } else if (isSet(modelValue)) {
  12083. const cloned = new Set(modelValue);
  12084. if (checked) {
  12085. cloned.add(elementValue);
  12086. } else {
  12087. cloned.delete(elementValue);
  12088. }
  12089. assign(cloned);
  12090. } else {
  12091. assign(getCheckboxValue(el, checked));
  12092. }
  12093. });
  12094. },
  12095. // set initial checked on mount to wait for true-value/false-value
  12096. mounted: setChecked,
  12097. beforeUpdate(el, binding, vnode) {
  12098. el[assignKey] = getModelAssigner(vnode);
  12099. setChecked(el, binding, vnode);
  12100. }
  12101. };
  12102. function setChecked(el, { value, oldValue }, vnode) {
  12103. el._modelValue = value;
  12104. let checked;
  12105. if (isArray(value)) {
  12106. checked = looseIndexOf(value, vnode.props.value) > -1;
  12107. } else if (isSet(value)) {
  12108. checked = value.has(vnode.props.value);
  12109. } else {
  12110. if (value === oldValue) return;
  12111. checked = looseEqual(value, getCheckboxValue(el, true));
  12112. }
  12113. if (el.checked !== checked) {
  12114. el.checked = checked;
  12115. }
  12116. }
  12117. const vModelRadio = {
  12118. created(el, { value }, vnode) {
  12119. el.checked = looseEqual(value, vnode.props.value);
  12120. el[assignKey] = getModelAssigner(vnode);
  12121. addEventListener(el, "change", () => {
  12122. el[assignKey](getValue(el));
  12123. });
  12124. },
  12125. beforeUpdate(el, { value, oldValue }, vnode) {
  12126. el[assignKey] = getModelAssigner(vnode);
  12127. if (value !== oldValue) {
  12128. el.checked = looseEqual(value, vnode.props.value);
  12129. }
  12130. }
  12131. };
  12132. const vModelSelect = {
  12133. // <select multiple> value need to be deep traversed
  12134. deep: true,
  12135. created(el, { value, modifiers: { number } }, vnode) {
  12136. const isSetModel = isSet(value);
  12137. addEventListener(el, "change", () => {
  12138. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  12139. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  12140. );
  12141. el[assignKey](
  12142. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  12143. );
  12144. el._assigning = true;
  12145. nextTick(() => {
  12146. el._assigning = false;
  12147. });
  12148. });
  12149. el[assignKey] = getModelAssigner(vnode);
  12150. },
  12151. // set value in mounted & updated because <select> relies on its children
  12152. // <option>s.
  12153. mounted(el, { value }) {
  12154. setSelected(el, value);
  12155. },
  12156. beforeUpdate(el, _binding, vnode) {
  12157. el[assignKey] = getModelAssigner(vnode);
  12158. },
  12159. updated(el, { value }) {
  12160. if (!el._assigning) {
  12161. setSelected(el, value);
  12162. }
  12163. }
  12164. };
  12165. function setSelected(el, value) {
  12166. const isMultiple = el.multiple;
  12167. const isArrayValue = isArray(value);
  12168. if (isMultiple && !isArrayValue && !isSet(value)) {
  12169. warn(
  12170. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  12171. );
  12172. return;
  12173. }
  12174. for (let i = 0, l = el.options.length; i < l; i++) {
  12175. const option = el.options[i];
  12176. const optionValue = getValue(option);
  12177. if (isMultiple) {
  12178. if (isArrayValue) {
  12179. const optionType = typeof optionValue;
  12180. if (optionType === "string" || optionType === "number") {
  12181. option.selected = value.some((v) => String(v) === String(optionValue));
  12182. } else {
  12183. option.selected = looseIndexOf(value, optionValue) > -1;
  12184. }
  12185. } else {
  12186. option.selected = value.has(optionValue);
  12187. }
  12188. } else if (looseEqual(getValue(option), value)) {
  12189. if (el.selectedIndex !== i) el.selectedIndex = i;
  12190. return;
  12191. }
  12192. }
  12193. if (!isMultiple && el.selectedIndex !== -1) {
  12194. el.selectedIndex = -1;
  12195. }
  12196. }
  12197. function getValue(el) {
  12198. return "_value" in el ? el._value : el.value;
  12199. }
  12200. function getCheckboxValue(el, checked) {
  12201. const key = checked ? "_trueValue" : "_falseValue";
  12202. return key in el ? el[key] : checked;
  12203. }
  12204. const vModelDynamic = {
  12205. created(el, binding, vnode) {
  12206. callModelHook(el, binding, vnode, null, "created");
  12207. },
  12208. mounted(el, binding, vnode) {
  12209. callModelHook(el, binding, vnode, null, "mounted");
  12210. },
  12211. beforeUpdate(el, binding, vnode, prevVNode) {
  12212. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  12213. },
  12214. updated(el, binding, vnode, prevVNode) {
  12215. callModelHook(el, binding, vnode, prevVNode, "updated");
  12216. }
  12217. };
  12218. function resolveDynamicModel(tagName, type) {
  12219. switch (tagName) {
  12220. case "SELECT":
  12221. return vModelSelect;
  12222. case "TEXTAREA":
  12223. return vModelText;
  12224. default:
  12225. switch (type) {
  12226. case "checkbox":
  12227. return vModelCheckbox;
  12228. case "radio":
  12229. return vModelRadio;
  12230. default:
  12231. return vModelText;
  12232. }
  12233. }
  12234. }
  12235. function callModelHook(el, binding, vnode, prevVNode, hook) {
  12236. const modelToUse = resolveDynamicModel(
  12237. el.tagName,
  12238. vnode.props && vnode.props.type
  12239. );
  12240. const fn = modelToUse[hook];
  12241. fn && fn(el, binding, vnode, prevVNode);
  12242. }
  12243. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  12244. const modifierGuards = {
  12245. stop: (e) => e.stopPropagation(),
  12246. prevent: (e) => e.preventDefault(),
  12247. self: (e) => e.target !== e.currentTarget,
  12248. ctrl: (e) => !e.ctrlKey,
  12249. shift: (e) => !e.shiftKey,
  12250. alt: (e) => !e.altKey,
  12251. meta: (e) => !e.metaKey,
  12252. left: (e) => "button" in e && e.button !== 0,
  12253. middle: (e) => "button" in e && e.button !== 1,
  12254. right: (e) => "button" in e && e.button !== 2,
  12255. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  12256. };
  12257. const withModifiers = (fn, modifiers) => {
  12258. const cache = fn._withMods || (fn._withMods = {});
  12259. const cacheKey = modifiers.join(".");
  12260. return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
  12261. for (let i = 0; i < modifiers.length; i++) {
  12262. const guard = modifierGuards[modifiers[i]];
  12263. if (guard && guard(event, modifiers)) return;
  12264. }
  12265. return fn(event, ...args);
  12266. }));
  12267. };
  12268. const keyNames = {
  12269. esc: "escape",
  12270. space: " ",
  12271. up: "arrow-up",
  12272. left: "arrow-left",
  12273. right: "arrow-right",
  12274. down: "arrow-down",
  12275. delete: "backspace"
  12276. };
  12277. const withKeys = (fn, modifiers) => {
  12278. const cache = fn._withKeys || (fn._withKeys = {});
  12279. const cacheKey = modifiers.join(".");
  12280. return cache[cacheKey] || (cache[cacheKey] = ((event) => {
  12281. if (!("key" in event)) {
  12282. return;
  12283. }
  12284. const eventKey = hyphenate(event.key);
  12285. if (modifiers.some(
  12286. (k) => k === eventKey || keyNames[k] === eventKey
  12287. )) {
  12288. return fn(event);
  12289. }
  12290. }));
  12291. };
  12292. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  12293. let renderer;
  12294. let enabledHydration = false;
  12295. function ensureRenderer() {
  12296. return renderer || (renderer = createRenderer(rendererOptions));
  12297. }
  12298. function ensureHydrationRenderer() {
  12299. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  12300. enabledHydration = true;
  12301. return renderer;
  12302. }
  12303. const render = ((...args) => {
  12304. ensureRenderer().render(...args);
  12305. });
  12306. const hydrate = ((...args) => {
  12307. ensureHydrationRenderer().hydrate(...args);
  12308. });
  12309. const createApp = ((...args) => {
  12310. const app = ensureRenderer().createApp(...args);
  12311. {
  12312. injectNativeTagCheck(app);
  12313. injectCompilerOptionsCheck(app);
  12314. }
  12315. const { mount } = app;
  12316. app.mount = (containerOrSelector) => {
  12317. const container = normalizeContainer(containerOrSelector);
  12318. if (!container) return;
  12319. const component = app._component;
  12320. if (!isFunction(component) && !component.render && !component.template) {
  12321. component.template = container.innerHTML;
  12322. }
  12323. if (container.nodeType === 1) {
  12324. container.textContent = "";
  12325. }
  12326. const proxy = mount(container, false, resolveRootNamespace(container));
  12327. if (container instanceof Element) {
  12328. container.removeAttribute("v-cloak");
  12329. container.setAttribute("data-v-app", "");
  12330. }
  12331. return proxy;
  12332. };
  12333. return app;
  12334. });
  12335. const createSSRApp = ((...args) => {
  12336. const app = ensureHydrationRenderer().createApp(...args);
  12337. {
  12338. injectNativeTagCheck(app);
  12339. injectCompilerOptionsCheck(app);
  12340. }
  12341. const { mount } = app;
  12342. app.mount = (containerOrSelector) => {
  12343. const container = normalizeContainer(containerOrSelector);
  12344. if (container) {
  12345. return mount(container, true, resolveRootNamespace(container));
  12346. }
  12347. };
  12348. return app;
  12349. });
  12350. function resolveRootNamespace(container) {
  12351. if (container instanceof SVGElement) {
  12352. return "svg";
  12353. }
  12354. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  12355. return "mathml";
  12356. }
  12357. }
  12358. function injectNativeTagCheck(app) {
  12359. Object.defineProperty(app.config, "isNativeTag", {
  12360. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  12361. writable: false
  12362. });
  12363. }
  12364. function injectCompilerOptionsCheck(app) {
  12365. if (isRuntimeOnly()) {
  12366. const isCustomElement = app.config.isCustomElement;
  12367. Object.defineProperty(app.config, "isCustomElement", {
  12368. get() {
  12369. return isCustomElement;
  12370. },
  12371. set() {
  12372. warn(
  12373. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  12374. );
  12375. }
  12376. });
  12377. const compilerOptions = app.config.compilerOptions;
  12378. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  12379. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  12380. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  12381. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  12382. Object.defineProperty(app.config, "compilerOptions", {
  12383. get() {
  12384. warn(msg);
  12385. return compilerOptions;
  12386. },
  12387. set() {
  12388. warn(msg);
  12389. }
  12390. });
  12391. }
  12392. }
  12393. function normalizeContainer(container) {
  12394. if (isString(container)) {
  12395. const res = document.querySelector(container);
  12396. if (!res) {
  12397. warn(
  12398. `Failed to mount app: mount target selector "${container}" returned null.`
  12399. );
  12400. }
  12401. return res;
  12402. }
  12403. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  12404. warn(
  12405. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  12406. );
  12407. }
  12408. return container;
  12409. }
  12410. const initDirectivesForSSR = NOOP;
  12411. function initDev() {
  12412. {
  12413. {
  12414. console.info(
  12415. `You are running a development build of Vue.
  12416. Make sure to use the production build (*.prod.js) when deploying for production.`
  12417. );
  12418. }
  12419. initCustomFormatter();
  12420. }
  12421. }
  12422. {
  12423. initDev();
  12424. }
  12425. const compile = () => {
  12426. {
  12427. warn(
  12428. `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  12429. );
  12430. }
  12431. };
  12432. exports.BaseTransition = BaseTransition;
  12433. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  12434. exports.Comment = Comment;
  12435. exports.DeprecationTypes = DeprecationTypes;
  12436. exports.EffectScope = EffectScope;
  12437. exports.ErrorCodes = ErrorCodes;
  12438. exports.ErrorTypeStrings = ErrorTypeStrings;
  12439. exports.Fragment = Fragment;
  12440. exports.KeepAlive = KeepAlive;
  12441. exports.ReactiveEffect = ReactiveEffect;
  12442. exports.Static = Static;
  12443. exports.Suspense = Suspense;
  12444. exports.Teleport = Teleport;
  12445. exports.Text = Text;
  12446. exports.TrackOpTypes = TrackOpTypes;
  12447. exports.Transition = Transition;
  12448. exports.TransitionGroup = TransitionGroup;
  12449. exports.TriggerOpTypes = TriggerOpTypes;
  12450. exports.VueElement = VueElement;
  12451. exports.assertNumber = assertNumber;
  12452. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  12453. exports.callWithErrorHandling = callWithErrorHandling;
  12454. exports.camelize = camelize;
  12455. exports.capitalize = capitalize;
  12456. exports.cloneVNode = cloneVNode;
  12457. exports.compatUtils = compatUtils;
  12458. exports.compile = compile;
  12459. exports.computed = computed;
  12460. exports.createApp = createApp;
  12461. exports.createBlock = createBlock;
  12462. exports.createCommentVNode = createCommentVNode;
  12463. exports.createElementBlock = createElementBlock;
  12464. exports.createElementVNode = createBaseVNode;
  12465. exports.createHydrationRenderer = createHydrationRenderer;
  12466. exports.createPropsRestProxy = createPropsRestProxy;
  12467. exports.createRenderer = createRenderer;
  12468. exports.createSSRApp = createSSRApp;
  12469. exports.createSlots = createSlots;
  12470. exports.createStaticVNode = createStaticVNode;
  12471. exports.createTextVNode = createTextVNode;
  12472. exports.createVNode = createVNode;
  12473. exports.customRef = customRef;
  12474. exports.defineAsyncComponent = defineAsyncComponent;
  12475. exports.defineComponent = defineComponent;
  12476. exports.defineCustomElement = defineCustomElement;
  12477. exports.defineEmits = defineEmits;
  12478. exports.defineExpose = defineExpose;
  12479. exports.defineModel = defineModel;
  12480. exports.defineOptions = defineOptions;
  12481. exports.defineProps = defineProps;
  12482. exports.defineSSRCustomElement = defineSSRCustomElement;
  12483. exports.defineSlots = defineSlots;
  12484. exports.devtools = devtools;
  12485. exports.effect = effect;
  12486. exports.effectScope = effectScope;
  12487. exports.getCurrentInstance = getCurrentInstance;
  12488. exports.getCurrentScope = getCurrentScope;
  12489. exports.getCurrentWatcher = getCurrentWatcher;
  12490. exports.getTransitionRawChildren = getTransitionRawChildren;
  12491. exports.guardReactiveProps = guardReactiveProps;
  12492. exports.h = h;
  12493. exports.handleError = handleError;
  12494. exports.hasInjectionContext = hasInjectionContext;
  12495. exports.hydrate = hydrate;
  12496. exports.hydrateOnIdle = hydrateOnIdle;
  12497. exports.hydrateOnInteraction = hydrateOnInteraction;
  12498. exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
  12499. exports.hydrateOnVisible = hydrateOnVisible;
  12500. exports.initCustomFormatter = initCustomFormatter;
  12501. exports.initDirectivesForSSR = initDirectivesForSSR;
  12502. exports.inject = inject;
  12503. exports.isMemoSame = isMemoSame;
  12504. exports.isProxy = isProxy;
  12505. exports.isReactive = isReactive;
  12506. exports.isReadonly = isReadonly;
  12507. exports.isRef = isRef;
  12508. exports.isRuntimeOnly = isRuntimeOnly;
  12509. exports.isShallow = isShallow;
  12510. exports.isVNode = isVNode;
  12511. exports.markRaw = markRaw;
  12512. exports.mergeDefaults = mergeDefaults;
  12513. exports.mergeModels = mergeModels;
  12514. exports.mergeProps = mergeProps;
  12515. exports.nextTick = nextTick;
  12516. exports.nodeOps = nodeOps;
  12517. exports.normalizeClass = normalizeClass;
  12518. exports.normalizeProps = normalizeProps;
  12519. exports.normalizeStyle = normalizeStyle;
  12520. exports.onActivated = onActivated;
  12521. exports.onBeforeMount = onBeforeMount;
  12522. exports.onBeforeUnmount = onBeforeUnmount;
  12523. exports.onBeforeUpdate = onBeforeUpdate;
  12524. exports.onDeactivated = onDeactivated;
  12525. exports.onErrorCaptured = onErrorCaptured;
  12526. exports.onMounted = onMounted;
  12527. exports.onRenderTracked = onRenderTracked;
  12528. exports.onRenderTriggered = onRenderTriggered;
  12529. exports.onScopeDispose = onScopeDispose;
  12530. exports.onServerPrefetch = onServerPrefetch;
  12531. exports.onUnmounted = onUnmounted;
  12532. exports.onUpdated = onUpdated;
  12533. exports.onWatcherCleanup = onWatcherCleanup;
  12534. exports.openBlock = openBlock;
  12535. exports.patchProp = patchProp;
  12536. exports.popScopeId = popScopeId;
  12537. exports.provide = provide;
  12538. exports.proxyRefs = proxyRefs;
  12539. exports.pushScopeId = pushScopeId;
  12540. exports.queuePostFlushCb = queuePostFlushCb;
  12541. exports.reactive = reactive;
  12542. exports.readonly = readonly;
  12543. exports.ref = ref;
  12544. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  12545. exports.render = render;
  12546. exports.renderList = renderList;
  12547. exports.renderSlot = renderSlot;
  12548. exports.resolveComponent = resolveComponent;
  12549. exports.resolveDirective = resolveDirective;
  12550. exports.resolveDynamicComponent = resolveDynamicComponent;
  12551. exports.resolveFilter = resolveFilter;
  12552. exports.resolveTransitionHooks = resolveTransitionHooks;
  12553. exports.setBlockTracking = setBlockTracking;
  12554. exports.setDevtoolsHook = setDevtoolsHook;
  12555. exports.setTransitionHooks = setTransitionHooks;
  12556. exports.shallowReactive = shallowReactive;
  12557. exports.shallowReadonly = shallowReadonly;
  12558. exports.shallowRef = shallowRef;
  12559. exports.ssrContextKey = ssrContextKey;
  12560. exports.ssrUtils = ssrUtils;
  12561. exports.stop = stop;
  12562. exports.toDisplayString = toDisplayString;
  12563. exports.toHandlerKey = toHandlerKey;
  12564. exports.toHandlers = toHandlers;
  12565. exports.toRaw = toRaw;
  12566. exports.toRef = toRef;
  12567. exports.toRefs = toRefs;
  12568. exports.toValue = toValue;
  12569. exports.transformVNodeArgs = transformVNodeArgs;
  12570. exports.triggerRef = triggerRef;
  12571. exports.unref = unref;
  12572. exports.useAttrs = useAttrs;
  12573. exports.useCssModule = useCssModule;
  12574. exports.useCssVars = useCssVars;
  12575. exports.useHost = useHost;
  12576. exports.useId = useId;
  12577. exports.useModel = useModel;
  12578. exports.useSSRContext = useSSRContext;
  12579. exports.useShadowRoot = useShadowRoot;
  12580. exports.useSlots = useSlots;
  12581. exports.useTemplateRef = useTemplateRef;
  12582. exports.useTransitionState = useTransitionState;
  12583. exports.vModelCheckbox = vModelCheckbox;
  12584. exports.vModelDynamic = vModelDynamic;
  12585. exports.vModelRadio = vModelRadio;
  12586. exports.vModelSelect = vModelSelect;
  12587. exports.vModelText = vModelText;
  12588. exports.vShow = vShow;
  12589. exports.version = version;
  12590. exports.warn = warn;
  12591. exports.watch = watch;
  12592. exports.watchEffect = watchEffect;
  12593. exports.watchPostEffect = watchPostEffect;
  12594. exports.watchSyncEffect = watchSyncEffect;
  12595. exports.withAsyncContext = withAsyncContext;
  12596. exports.withCtx = withCtx;
  12597. exports.withDefaults = withDefaults;
  12598. exports.withDirectives = withDirectives;
  12599. exports.withKeys = withKeys;
  12600. exports.withMemo = withMemo;
  12601. exports.withModifiers = withModifiers;
  12602. exports.withScopeId = withScopeId;
  12603. return exports;
  12604. })({});