347f94491971ce029410b7e8e270a77ff40d5246b97fe1ce4a1fe8f68438517e724acf4600e641ea9eda809dd5354c2eb76c2c8a07f1baec26c14d2efe6542 260 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520
  1. /**
  2. * @vue/runtime-core v3.5.21
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
  7. export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
  8. import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, NOOP, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, isGloballyAllowed, EMPTY_ARR, hyphenate, makeMap, toRawType, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
  9. export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
  10. const stack = [];
  11. function pushWarningContext(vnode) {
  12. stack.push(vnode);
  13. }
  14. function popWarningContext() {
  15. stack.pop();
  16. }
  17. let isWarning = false;
  18. function warn$1(msg, ...args) {
  19. if (isWarning) return;
  20. isWarning = true;
  21. pauseTracking();
  22. const instance = stack.length ? stack[stack.length - 1].component : null;
  23. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  24. const trace = getComponentTrace();
  25. if (appWarnHandler) {
  26. callWithErrorHandling(
  27. appWarnHandler,
  28. instance,
  29. 11,
  30. [
  31. // eslint-disable-next-line no-restricted-syntax
  32. msg + args.map((a) => {
  33. var _a, _b;
  34. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  35. }).join(""),
  36. instance && instance.proxy,
  37. trace.map(
  38. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  39. ).join("\n"),
  40. trace
  41. ]
  42. );
  43. } else {
  44. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  45. if (trace.length && // avoid spamming console during tests
  46. true) {
  47. warnArgs.push(`
  48. `, ...formatTrace(trace));
  49. }
  50. console.warn(...warnArgs);
  51. }
  52. resetTracking();
  53. isWarning = false;
  54. }
  55. function getComponentTrace() {
  56. let currentVNode = stack[stack.length - 1];
  57. if (!currentVNode) {
  58. return [];
  59. }
  60. const normalizedStack = [];
  61. while (currentVNode) {
  62. const last = normalizedStack[0];
  63. if (last && last.vnode === currentVNode) {
  64. last.recurseCount++;
  65. } else {
  66. normalizedStack.push({
  67. vnode: currentVNode,
  68. recurseCount: 0
  69. });
  70. }
  71. const parentInstance = currentVNode.component && currentVNode.component.parent;
  72. currentVNode = parentInstance && parentInstance.vnode;
  73. }
  74. return normalizedStack;
  75. }
  76. function formatTrace(trace) {
  77. const logs = [];
  78. trace.forEach((entry, i) => {
  79. logs.push(...i === 0 ? [] : [`
  80. `], ...formatTraceEntry(entry));
  81. });
  82. return logs;
  83. }
  84. function formatTraceEntry({ vnode, recurseCount }) {
  85. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  86. const isRoot = vnode.component ? vnode.component.parent == null : false;
  87. const open = ` at <${formatComponentName(
  88. vnode.component,
  89. vnode.type,
  90. isRoot
  91. )}`;
  92. const close = `>` + postfix;
  93. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  94. }
  95. function formatProps(props) {
  96. const res = [];
  97. const keys = Object.keys(props);
  98. keys.slice(0, 3).forEach((key) => {
  99. res.push(...formatProp(key, props[key]));
  100. });
  101. if (keys.length > 3) {
  102. res.push(` ...`);
  103. }
  104. return res;
  105. }
  106. function formatProp(key, value, raw) {
  107. if (isString(value)) {
  108. value = JSON.stringify(value);
  109. return raw ? value : [`${key}=${value}`];
  110. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  111. return raw ? value : [`${key}=${value}`];
  112. } else if (isRef(value)) {
  113. value = formatProp(key, toRaw(value.value), true);
  114. return raw ? value : [`${key}=Ref<`, value, `>`];
  115. } else if (isFunction(value)) {
  116. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  117. } else {
  118. value = toRaw(value);
  119. return raw ? value : [`${key}=`, value];
  120. }
  121. }
  122. function assertNumber(val, type) {
  123. if (!!!(process.env.NODE_ENV !== "production")) return;
  124. if (val === void 0) {
  125. return;
  126. } else if (typeof val !== "number") {
  127. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  128. } else if (isNaN(val)) {
  129. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  130. }
  131. }
  132. const ErrorCodes = {
  133. "SETUP_FUNCTION": 0,
  134. "0": "SETUP_FUNCTION",
  135. "RENDER_FUNCTION": 1,
  136. "1": "RENDER_FUNCTION",
  137. "NATIVE_EVENT_HANDLER": 5,
  138. "5": "NATIVE_EVENT_HANDLER",
  139. "COMPONENT_EVENT_HANDLER": 6,
  140. "6": "COMPONENT_EVENT_HANDLER",
  141. "VNODE_HOOK": 7,
  142. "7": "VNODE_HOOK",
  143. "DIRECTIVE_HOOK": 8,
  144. "8": "DIRECTIVE_HOOK",
  145. "TRANSITION_HOOK": 9,
  146. "9": "TRANSITION_HOOK",
  147. "APP_ERROR_HANDLER": 10,
  148. "10": "APP_ERROR_HANDLER",
  149. "APP_WARN_HANDLER": 11,
  150. "11": "APP_WARN_HANDLER",
  151. "FUNCTION_REF": 12,
  152. "12": "FUNCTION_REF",
  153. "ASYNC_COMPONENT_LOADER": 13,
  154. "13": "ASYNC_COMPONENT_LOADER",
  155. "SCHEDULER": 14,
  156. "14": "SCHEDULER",
  157. "COMPONENT_UPDATE": 15,
  158. "15": "COMPONENT_UPDATE",
  159. "APP_UNMOUNT_CLEANUP": 16,
  160. "16": "APP_UNMOUNT_CLEANUP"
  161. };
  162. const ErrorTypeStrings$1 = {
  163. ["sp"]: "serverPrefetch hook",
  164. ["bc"]: "beforeCreate hook",
  165. ["c"]: "created hook",
  166. ["bm"]: "beforeMount hook",
  167. ["m"]: "mounted hook",
  168. ["bu"]: "beforeUpdate hook",
  169. ["u"]: "updated",
  170. ["bum"]: "beforeUnmount hook",
  171. ["um"]: "unmounted hook",
  172. ["a"]: "activated hook",
  173. ["da"]: "deactivated hook",
  174. ["ec"]: "errorCaptured hook",
  175. ["rtc"]: "renderTracked hook",
  176. ["rtg"]: "renderTriggered hook",
  177. [0]: "setup function",
  178. [1]: "render function",
  179. [2]: "watcher getter",
  180. [3]: "watcher callback",
  181. [4]: "watcher cleanup function",
  182. [5]: "native event handler",
  183. [6]: "component event handler",
  184. [7]: "vnode hook",
  185. [8]: "directive hook",
  186. [9]: "transition hook",
  187. [10]: "app errorHandler",
  188. [11]: "app warnHandler",
  189. [12]: "ref function",
  190. [13]: "async component loader",
  191. [14]: "scheduler flush",
  192. [15]: "component update",
  193. [16]: "app unmount cleanup function"
  194. };
  195. function callWithErrorHandling(fn, instance, type, args) {
  196. try {
  197. return args ? fn(...args) : fn();
  198. } catch (err) {
  199. handleError(err, instance, type);
  200. }
  201. }
  202. function callWithAsyncErrorHandling(fn, instance, type, args) {
  203. if (isFunction(fn)) {
  204. const res = callWithErrorHandling(fn, instance, type, args);
  205. if (res && isPromise(res)) {
  206. res.catch((err) => {
  207. handleError(err, instance, type);
  208. });
  209. }
  210. return res;
  211. }
  212. if (isArray(fn)) {
  213. const values = [];
  214. for (let i = 0; i < fn.length; i++) {
  215. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  216. }
  217. return values;
  218. } else if (!!(process.env.NODE_ENV !== "production")) {
  219. warn$1(
  220. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  221. );
  222. }
  223. }
  224. function handleError(err, instance, type, throwInDev = true) {
  225. const contextVNode = instance ? instance.vnode : null;
  226. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  227. if (instance) {
  228. let cur = instance.parent;
  229. const exposedInstance = instance.proxy;
  230. const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
  231. while (cur) {
  232. const errorCapturedHooks = cur.ec;
  233. if (errorCapturedHooks) {
  234. for (let i = 0; i < errorCapturedHooks.length; i++) {
  235. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  236. return;
  237. }
  238. }
  239. }
  240. cur = cur.parent;
  241. }
  242. if (errorHandler) {
  243. pauseTracking();
  244. callWithErrorHandling(errorHandler, null, 10, [
  245. err,
  246. exposedInstance,
  247. errorInfo
  248. ]);
  249. resetTracking();
  250. return;
  251. }
  252. }
  253. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  254. }
  255. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  256. if (!!(process.env.NODE_ENV !== "production")) {
  257. const info = ErrorTypeStrings$1[type];
  258. if (contextVNode) {
  259. pushWarningContext(contextVNode);
  260. }
  261. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  262. if (contextVNode) {
  263. popWarningContext();
  264. }
  265. if (throwInDev) {
  266. throw err;
  267. } else {
  268. console.error(err);
  269. }
  270. } else if (throwInProd) {
  271. throw err;
  272. } else {
  273. console.error(err);
  274. }
  275. }
  276. const queue = [];
  277. let flushIndex = -1;
  278. const pendingPostFlushCbs = [];
  279. let activePostFlushCbs = null;
  280. let postFlushIndex = 0;
  281. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  282. let currentFlushPromise = null;
  283. const RECURSION_LIMIT = 100;
  284. function nextTick(fn) {
  285. const p = currentFlushPromise || resolvedPromise;
  286. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  287. }
  288. function findInsertionIndex(id) {
  289. let start = flushIndex + 1;
  290. let end = queue.length;
  291. while (start < end) {
  292. const middle = start + end >>> 1;
  293. const middleJob = queue[middle];
  294. const middleJobId = getId(middleJob);
  295. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  296. start = middle + 1;
  297. } else {
  298. end = middle;
  299. }
  300. }
  301. return start;
  302. }
  303. function queueJob(job) {
  304. if (!(job.flags & 1)) {
  305. const jobId = getId(job);
  306. const lastJob = queue[queue.length - 1];
  307. if (!lastJob || // fast path when the job id is larger than the tail
  308. !(job.flags & 2) && jobId >= getId(lastJob)) {
  309. queue.push(job);
  310. } else {
  311. queue.splice(findInsertionIndex(jobId), 0, job);
  312. }
  313. job.flags |= 1;
  314. queueFlush();
  315. }
  316. }
  317. function queueFlush() {
  318. if (!currentFlushPromise) {
  319. currentFlushPromise = resolvedPromise.then(flushJobs);
  320. }
  321. }
  322. function queuePostFlushCb(cb) {
  323. if (!isArray(cb)) {
  324. if (activePostFlushCbs && cb.id === -1) {
  325. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  326. } else if (!(cb.flags & 1)) {
  327. pendingPostFlushCbs.push(cb);
  328. cb.flags |= 1;
  329. }
  330. } else {
  331. pendingPostFlushCbs.push(...cb);
  332. }
  333. queueFlush();
  334. }
  335. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  336. if (!!(process.env.NODE_ENV !== "production")) {
  337. seen = seen || /* @__PURE__ */ new Map();
  338. }
  339. for (; i < queue.length; i++) {
  340. const cb = queue[i];
  341. if (cb && cb.flags & 2) {
  342. if (instance && cb.id !== instance.uid) {
  343. continue;
  344. }
  345. if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
  346. continue;
  347. }
  348. queue.splice(i, 1);
  349. i--;
  350. if (cb.flags & 4) {
  351. cb.flags &= -2;
  352. }
  353. cb();
  354. if (!(cb.flags & 4)) {
  355. cb.flags &= -2;
  356. }
  357. }
  358. }
  359. }
  360. function flushPostFlushCbs(seen) {
  361. if (pendingPostFlushCbs.length) {
  362. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  363. (a, b) => getId(a) - getId(b)
  364. );
  365. pendingPostFlushCbs.length = 0;
  366. if (activePostFlushCbs) {
  367. activePostFlushCbs.push(...deduped);
  368. return;
  369. }
  370. activePostFlushCbs = deduped;
  371. if (!!(process.env.NODE_ENV !== "production")) {
  372. seen = seen || /* @__PURE__ */ new Map();
  373. }
  374. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  375. const cb = activePostFlushCbs[postFlushIndex];
  376. if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
  377. continue;
  378. }
  379. if (cb.flags & 4) {
  380. cb.flags &= -2;
  381. }
  382. if (!(cb.flags & 8)) cb();
  383. cb.flags &= -2;
  384. }
  385. activePostFlushCbs = null;
  386. postFlushIndex = 0;
  387. }
  388. }
  389. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  390. function flushJobs(seen) {
  391. if (!!(process.env.NODE_ENV !== "production")) {
  392. seen = seen || /* @__PURE__ */ new Map();
  393. }
  394. const check = !!(process.env.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
  395. try {
  396. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  397. const job = queue[flushIndex];
  398. if (job && !(job.flags & 8)) {
  399. if (!!(process.env.NODE_ENV !== "production") && check(job)) {
  400. continue;
  401. }
  402. if (job.flags & 4) {
  403. job.flags &= ~1;
  404. }
  405. callWithErrorHandling(
  406. job,
  407. job.i,
  408. job.i ? 15 : 14
  409. );
  410. if (!(job.flags & 4)) {
  411. job.flags &= ~1;
  412. }
  413. }
  414. }
  415. } finally {
  416. for (; flushIndex < queue.length; flushIndex++) {
  417. const job = queue[flushIndex];
  418. if (job) {
  419. job.flags &= -2;
  420. }
  421. }
  422. flushIndex = -1;
  423. queue.length = 0;
  424. flushPostFlushCbs(seen);
  425. currentFlushPromise = null;
  426. if (queue.length || pendingPostFlushCbs.length) {
  427. flushJobs(seen);
  428. }
  429. }
  430. }
  431. function checkRecursiveUpdates(seen, fn) {
  432. const count = seen.get(fn) || 0;
  433. if (count > RECURSION_LIMIT) {
  434. const instance = fn.i;
  435. const componentName = instance && getComponentName(instance.type);
  436. handleError(
  437. `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.`,
  438. null,
  439. 10
  440. );
  441. return true;
  442. }
  443. seen.set(fn, count + 1);
  444. return false;
  445. }
  446. let isHmrUpdating = false;
  447. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  448. if (!!(process.env.NODE_ENV !== "production")) {
  449. const g = getGlobalThis();
  450. if (!g.__VUE_HMR_RUNTIME__) {
  451. g.__VUE_HMR_RUNTIME__ = {
  452. createRecord: tryWrap(createRecord),
  453. rerender: tryWrap(rerender),
  454. reload: tryWrap(reload)
  455. };
  456. }
  457. }
  458. const map = /* @__PURE__ */ new Map();
  459. function registerHMR(instance) {
  460. const id = instance.type.__hmrId;
  461. let record = map.get(id);
  462. if (!record) {
  463. createRecord(id, instance.type);
  464. record = map.get(id);
  465. }
  466. record.instances.add(instance);
  467. }
  468. function unregisterHMR(instance) {
  469. map.get(instance.type.__hmrId).instances.delete(instance);
  470. }
  471. function createRecord(id, initialDef) {
  472. if (map.has(id)) {
  473. return false;
  474. }
  475. map.set(id, {
  476. initialDef: normalizeClassComponent(initialDef),
  477. instances: /* @__PURE__ */ new Set()
  478. });
  479. return true;
  480. }
  481. function normalizeClassComponent(component) {
  482. return isClassComponent(component) ? component.__vccOpts : component;
  483. }
  484. function rerender(id, newRender) {
  485. const record = map.get(id);
  486. if (!record) {
  487. return;
  488. }
  489. record.initialDef.render = newRender;
  490. [...record.instances].forEach((instance) => {
  491. if (newRender) {
  492. instance.render = newRender;
  493. normalizeClassComponent(instance.type).render = newRender;
  494. }
  495. instance.renderCache = [];
  496. isHmrUpdating = true;
  497. if (!(instance.job.flags & 8)) {
  498. instance.update();
  499. }
  500. isHmrUpdating = false;
  501. });
  502. }
  503. function reload(id, newComp) {
  504. const record = map.get(id);
  505. if (!record) return;
  506. newComp = normalizeClassComponent(newComp);
  507. updateComponentDef(record.initialDef, newComp);
  508. const instances = [...record.instances];
  509. for (let i = 0; i < instances.length; i++) {
  510. const instance = instances[i];
  511. const oldComp = normalizeClassComponent(instance.type);
  512. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  513. if (!dirtyInstances) {
  514. if (oldComp !== record.initialDef) {
  515. updateComponentDef(oldComp, newComp);
  516. }
  517. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  518. }
  519. dirtyInstances.add(instance);
  520. instance.appContext.propsCache.delete(instance.type);
  521. instance.appContext.emitsCache.delete(instance.type);
  522. instance.appContext.optionsCache.delete(instance.type);
  523. if (instance.ceReload) {
  524. dirtyInstances.add(instance);
  525. instance.ceReload(newComp.styles);
  526. dirtyInstances.delete(instance);
  527. } else if (instance.parent) {
  528. queueJob(() => {
  529. if (!(instance.job.flags & 8)) {
  530. isHmrUpdating = true;
  531. instance.parent.update();
  532. isHmrUpdating = false;
  533. dirtyInstances.delete(instance);
  534. }
  535. });
  536. } else if (instance.appContext.reload) {
  537. instance.appContext.reload();
  538. } else if (typeof window !== "undefined") {
  539. window.location.reload();
  540. } else {
  541. console.warn(
  542. "[HMR] Root or manually mounted instance modified. Full reload required."
  543. );
  544. }
  545. if (instance.root.ce && instance !== instance.root) {
  546. instance.root.ce._removeChildStyle(oldComp);
  547. }
  548. }
  549. queuePostFlushCb(() => {
  550. hmrDirtyComponents.clear();
  551. });
  552. }
  553. function updateComponentDef(oldComp, newComp) {
  554. extend(oldComp, newComp);
  555. for (const key in oldComp) {
  556. if (key !== "__file" && !(key in newComp)) {
  557. delete oldComp[key];
  558. }
  559. }
  560. }
  561. function tryWrap(fn) {
  562. return (id, arg) => {
  563. try {
  564. return fn(id, arg);
  565. } catch (e) {
  566. console.error(e);
  567. console.warn(
  568. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  569. );
  570. }
  571. };
  572. }
  573. let devtools$1;
  574. let buffer = [];
  575. let devtoolsNotInstalled = false;
  576. function emit$1(event, ...args) {
  577. if (devtools$1) {
  578. devtools$1.emit(event, ...args);
  579. } else if (!devtoolsNotInstalled) {
  580. buffer.push({ event, args });
  581. }
  582. }
  583. function setDevtoolsHook$1(hook, target) {
  584. var _a, _b;
  585. devtools$1 = hook;
  586. if (devtools$1) {
  587. devtools$1.enabled = true;
  588. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  589. buffer = [];
  590. } else if (
  591. // handle late devtools injection - only do this if we are in an actual
  592. // browser environment to avoid the timer handle stalling test runner exit
  593. // (#4815)
  594. typeof window !== "undefined" && // some envs mock window but not fully
  595. window.HTMLElement && // also exclude jsdom
  596. // eslint-disable-next-line no-restricted-syntax
  597. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  598. ) {
  599. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  600. replay.push((newHook) => {
  601. setDevtoolsHook$1(newHook, target);
  602. });
  603. setTimeout(() => {
  604. if (!devtools$1) {
  605. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  606. devtoolsNotInstalled = true;
  607. buffer = [];
  608. }
  609. }, 3e3);
  610. } else {
  611. devtoolsNotInstalled = true;
  612. buffer = [];
  613. }
  614. }
  615. function devtoolsInitApp(app, version) {
  616. emit$1("app:init" /* APP_INIT */, app, version, {
  617. Fragment,
  618. Text,
  619. Comment,
  620. Static
  621. });
  622. }
  623. function devtoolsUnmountApp(app) {
  624. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  625. }
  626. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  627. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  628. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  629. "component:removed" /* COMPONENT_REMOVED */
  630. );
  631. const devtoolsComponentRemoved = (component) => {
  632. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  633. !devtools$1.cleanupBuffer(component)) {
  634. _devtoolsComponentRemoved(component);
  635. }
  636. };
  637. // @__NO_SIDE_EFFECTS__
  638. function createDevtoolsComponentHook(hook) {
  639. return (component) => {
  640. emit$1(
  641. hook,
  642. component.appContext.app,
  643. component.uid,
  644. component.parent ? component.parent.uid : void 0,
  645. component
  646. );
  647. };
  648. }
  649. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  650. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  651. function createDevtoolsPerformanceHook(hook) {
  652. return (component, type, time) => {
  653. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  654. };
  655. }
  656. function devtoolsComponentEmit(component, event, params) {
  657. emit$1(
  658. "component:emit" /* COMPONENT_EMIT */,
  659. component.appContext.app,
  660. component,
  661. event,
  662. params
  663. );
  664. }
  665. let currentRenderingInstance = null;
  666. let currentScopeId = null;
  667. function setCurrentRenderingInstance(instance) {
  668. const prev = currentRenderingInstance;
  669. currentRenderingInstance = instance;
  670. currentScopeId = instance && instance.type.__scopeId || null;
  671. return prev;
  672. }
  673. function pushScopeId(id) {
  674. currentScopeId = id;
  675. }
  676. function popScopeId() {
  677. currentScopeId = null;
  678. }
  679. const withScopeId = (_id) => withCtx;
  680. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  681. if (!ctx) return fn;
  682. if (fn._n) {
  683. return fn;
  684. }
  685. const renderFnWithContext = (...args) => {
  686. if (renderFnWithContext._d) {
  687. setBlockTracking(-1);
  688. }
  689. const prevInstance = setCurrentRenderingInstance(ctx);
  690. let res;
  691. try {
  692. res = fn(...args);
  693. } finally {
  694. setCurrentRenderingInstance(prevInstance);
  695. if (renderFnWithContext._d) {
  696. setBlockTracking(1);
  697. }
  698. }
  699. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  700. devtoolsComponentUpdated(ctx);
  701. }
  702. return res;
  703. };
  704. renderFnWithContext._n = true;
  705. renderFnWithContext._c = true;
  706. renderFnWithContext._d = true;
  707. return renderFnWithContext;
  708. }
  709. function validateDirectiveName(name) {
  710. if (isBuiltInDirective(name)) {
  711. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  712. }
  713. }
  714. function withDirectives(vnode, directives) {
  715. if (currentRenderingInstance === null) {
  716. !!(process.env.NODE_ENV !== "production") && warn$1(`withDirectives can only be used inside render functions.`);
  717. return vnode;
  718. }
  719. const instance = getComponentPublicInstance(currentRenderingInstance);
  720. const bindings = vnode.dirs || (vnode.dirs = []);
  721. for (let i = 0; i < directives.length; i++) {
  722. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  723. if (dir) {
  724. if (isFunction(dir)) {
  725. dir = {
  726. mounted: dir,
  727. updated: dir
  728. };
  729. }
  730. if (dir.deep) {
  731. traverse(value);
  732. }
  733. bindings.push({
  734. dir,
  735. instance,
  736. value,
  737. oldValue: void 0,
  738. arg,
  739. modifiers
  740. });
  741. }
  742. }
  743. return vnode;
  744. }
  745. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  746. const bindings = vnode.dirs;
  747. const oldBindings = prevVNode && prevVNode.dirs;
  748. for (let i = 0; i < bindings.length; i++) {
  749. const binding = bindings[i];
  750. if (oldBindings) {
  751. binding.oldValue = oldBindings[i].value;
  752. }
  753. let hook = binding.dir[name];
  754. if (hook) {
  755. pauseTracking();
  756. callWithAsyncErrorHandling(hook, instance, 8, [
  757. vnode.el,
  758. binding,
  759. vnode,
  760. prevVNode
  761. ]);
  762. resetTracking();
  763. }
  764. }
  765. }
  766. const TeleportEndKey = Symbol("_vte");
  767. const isTeleport = (type) => type.__isTeleport;
  768. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  769. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  770. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  771. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  772. const resolveTarget = (props, select) => {
  773. const targetSelector = props && props.to;
  774. if (isString(targetSelector)) {
  775. if (!select) {
  776. !!(process.env.NODE_ENV !== "production") && warn$1(
  777. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  778. );
  779. return null;
  780. } else {
  781. const target = select(targetSelector);
  782. if (!!(process.env.NODE_ENV !== "production") && !target && !isTeleportDisabled(props)) {
  783. warn$1(
  784. `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.`
  785. );
  786. }
  787. return target;
  788. }
  789. } else {
  790. if (!!(process.env.NODE_ENV !== "production") && !targetSelector && !isTeleportDisabled(props)) {
  791. warn$1(`Invalid Teleport target: ${targetSelector}`);
  792. }
  793. return targetSelector;
  794. }
  795. };
  796. const TeleportImpl = {
  797. name: "Teleport",
  798. __isTeleport: true,
  799. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  800. const {
  801. mc: mountChildren,
  802. pc: patchChildren,
  803. pbc: patchBlockChildren,
  804. o: { insert, querySelector, createText, createComment }
  805. } = internals;
  806. const disabled = isTeleportDisabled(n2.props);
  807. let { shapeFlag, children, dynamicChildren } = n2;
  808. if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
  809. optimized = false;
  810. dynamicChildren = null;
  811. }
  812. if (n1 == null) {
  813. const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
  814. const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
  815. insert(placeholder, container, anchor);
  816. insert(mainAnchor, container, anchor);
  817. const mount = (container2, anchor2) => {
  818. if (shapeFlag & 16) {
  819. if (parentComponent && parentComponent.isCE) {
  820. parentComponent.ce._teleportTarget = container2;
  821. }
  822. mountChildren(
  823. children,
  824. container2,
  825. anchor2,
  826. parentComponent,
  827. parentSuspense,
  828. namespace,
  829. slotScopeIds,
  830. optimized
  831. );
  832. }
  833. };
  834. const mountToTarget = () => {
  835. const target = n2.target = resolveTarget(n2.props, querySelector);
  836. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  837. if (target) {
  838. if (namespace !== "svg" && isTargetSVG(target)) {
  839. namespace = "svg";
  840. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  841. namespace = "mathml";
  842. }
  843. if (!disabled) {
  844. mount(target, targetAnchor);
  845. updateCssVars(n2, false);
  846. }
  847. } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
  848. warn$1(
  849. "Invalid Teleport target on mount:",
  850. target,
  851. `(${typeof target})`
  852. );
  853. }
  854. };
  855. if (disabled) {
  856. mount(container, mainAnchor);
  857. updateCssVars(n2, true);
  858. }
  859. if (isTeleportDeferred(n2.props)) {
  860. n2.el.__isMounted = false;
  861. queuePostRenderEffect(() => {
  862. mountToTarget();
  863. delete n2.el.__isMounted;
  864. }, parentSuspense);
  865. } else {
  866. mountToTarget();
  867. }
  868. } else {
  869. if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
  870. queuePostRenderEffect(() => {
  871. TeleportImpl.process(
  872. n1,
  873. n2,
  874. container,
  875. anchor,
  876. parentComponent,
  877. parentSuspense,
  878. namespace,
  879. slotScopeIds,
  880. optimized,
  881. internals
  882. );
  883. }, parentSuspense);
  884. return;
  885. }
  886. n2.el = n1.el;
  887. n2.targetStart = n1.targetStart;
  888. const mainAnchor = n2.anchor = n1.anchor;
  889. const target = n2.target = n1.target;
  890. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  891. const wasDisabled = isTeleportDisabled(n1.props);
  892. const currentContainer = wasDisabled ? container : target;
  893. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  894. if (namespace === "svg" || isTargetSVG(target)) {
  895. namespace = "svg";
  896. } else if (namespace === "mathml" || isTargetMathML(target)) {
  897. namespace = "mathml";
  898. }
  899. if (dynamicChildren) {
  900. patchBlockChildren(
  901. n1.dynamicChildren,
  902. dynamicChildren,
  903. currentContainer,
  904. parentComponent,
  905. parentSuspense,
  906. namespace,
  907. slotScopeIds
  908. );
  909. traverseStaticChildren(n1, n2, !!!(process.env.NODE_ENV !== "production"));
  910. } else if (!optimized) {
  911. patchChildren(
  912. n1,
  913. n2,
  914. currentContainer,
  915. currentAnchor,
  916. parentComponent,
  917. parentSuspense,
  918. namespace,
  919. slotScopeIds,
  920. false
  921. );
  922. }
  923. if (disabled) {
  924. if (!wasDisabled) {
  925. moveTeleport(
  926. n2,
  927. container,
  928. mainAnchor,
  929. internals,
  930. 1
  931. );
  932. } else {
  933. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  934. n2.props.to = n1.props.to;
  935. }
  936. }
  937. } else {
  938. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  939. const nextTarget = n2.target = resolveTarget(
  940. n2.props,
  941. querySelector
  942. );
  943. if (nextTarget) {
  944. moveTeleport(
  945. n2,
  946. nextTarget,
  947. null,
  948. internals,
  949. 0
  950. );
  951. } else if (!!(process.env.NODE_ENV !== "production")) {
  952. warn$1(
  953. "Invalid Teleport target on update:",
  954. target,
  955. `(${typeof target})`
  956. );
  957. }
  958. } else if (wasDisabled) {
  959. moveTeleport(
  960. n2,
  961. target,
  962. targetAnchor,
  963. internals,
  964. 1
  965. );
  966. }
  967. }
  968. updateCssVars(n2, disabled);
  969. }
  970. },
  971. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  972. const {
  973. shapeFlag,
  974. children,
  975. anchor,
  976. targetStart,
  977. targetAnchor,
  978. target,
  979. props
  980. } = vnode;
  981. if (target) {
  982. hostRemove(targetStart);
  983. hostRemove(targetAnchor);
  984. }
  985. doRemove && hostRemove(anchor);
  986. if (shapeFlag & 16) {
  987. const shouldRemove = doRemove || !isTeleportDisabled(props);
  988. for (let i = 0; i < children.length; i++) {
  989. const child = children[i];
  990. unmount(
  991. child,
  992. parentComponent,
  993. parentSuspense,
  994. shouldRemove,
  995. !!child.dynamicChildren
  996. );
  997. }
  998. }
  999. },
  1000. move: moveTeleport,
  1001. hydrate: hydrateTeleport
  1002. };
  1003. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  1004. if (moveType === 0) {
  1005. insert(vnode.targetAnchor, container, parentAnchor);
  1006. }
  1007. const { el, anchor, shapeFlag, children, props } = vnode;
  1008. const isReorder = moveType === 2;
  1009. if (isReorder) {
  1010. insert(el, container, parentAnchor);
  1011. }
  1012. if (!isReorder || isTeleportDisabled(props)) {
  1013. if (shapeFlag & 16) {
  1014. for (let i = 0; i < children.length; i++) {
  1015. move(
  1016. children[i],
  1017. container,
  1018. parentAnchor,
  1019. 2
  1020. );
  1021. }
  1022. }
  1023. }
  1024. if (isReorder) {
  1025. insert(anchor, container, parentAnchor);
  1026. }
  1027. }
  1028. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  1029. o: { nextSibling, parentNode, querySelector, insert, createText }
  1030. }, hydrateChildren) {
  1031. function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
  1032. vnode2.anchor = hydrateChildren(
  1033. nextSibling(node2),
  1034. vnode2,
  1035. parentNode(node2),
  1036. parentComponent,
  1037. parentSuspense,
  1038. slotScopeIds,
  1039. optimized
  1040. );
  1041. vnode2.targetStart = targetStart;
  1042. vnode2.targetAnchor = targetAnchor;
  1043. }
  1044. const target = vnode.target = resolveTarget(
  1045. vnode.props,
  1046. querySelector
  1047. );
  1048. const disabled = isTeleportDisabled(vnode.props);
  1049. if (target) {
  1050. const targetNode = target._lpa || target.firstChild;
  1051. if (vnode.shapeFlag & 16) {
  1052. if (disabled) {
  1053. hydrateDisabledTeleport(
  1054. node,
  1055. vnode,
  1056. targetNode,
  1057. targetNode && nextSibling(targetNode)
  1058. );
  1059. } else {
  1060. vnode.anchor = nextSibling(node);
  1061. let targetAnchor = targetNode;
  1062. while (targetAnchor) {
  1063. if (targetAnchor && targetAnchor.nodeType === 8) {
  1064. if (targetAnchor.data === "teleport start anchor") {
  1065. vnode.targetStart = targetAnchor;
  1066. } else if (targetAnchor.data === "teleport anchor") {
  1067. vnode.targetAnchor = targetAnchor;
  1068. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  1069. break;
  1070. }
  1071. }
  1072. targetAnchor = nextSibling(targetAnchor);
  1073. }
  1074. if (!vnode.targetAnchor) {
  1075. prepareAnchor(target, vnode, createText, insert);
  1076. }
  1077. hydrateChildren(
  1078. targetNode && nextSibling(targetNode),
  1079. vnode,
  1080. target,
  1081. parentComponent,
  1082. parentSuspense,
  1083. slotScopeIds,
  1084. optimized
  1085. );
  1086. }
  1087. }
  1088. updateCssVars(vnode, disabled);
  1089. } else if (disabled) {
  1090. if (vnode.shapeFlag & 16) {
  1091. hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
  1092. }
  1093. }
  1094. return vnode.anchor && nextSibling(vnode.anchor);
  1095. }
  1096. const Teleport = TeleportImpl;
  1097. function updateCssVars(vnode, isDisabled) {
  1098. const ctx = vnode.ctx;
  1099. if (ctx && ctx.ut) {
  1100. let node, anchor;
  1101. if (isDisabled) {
  1102. node = vnode.el;
  1103. anchor = vnode.anchor;
  1104. } else {
  1105. node = vnode.targetStart;
  1106. anchor = vnode.targetAnchor;
  1107. }
  1108. while (node && node !== anchor) {
  1109. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  1110. node = node.nextSibling;
  1111. }
  1112. ctx.ut();
  1113. }
  1114. }
  1115. function prepareAnchor(target, vnode, createText, insert) {
  1116. const targetStart = vnode.targetStart = createText("");
  1117. const targetAnchor = vnode.targetAnchor = createText("");
  1118. targetStart[TeleportEndKey] = targetAnchor;
  1119. if (target) {
  1120. insert(targetStart, target);
  1121. insert(targetAnchor, target);
  1122. }
  1123. return targetAnchor;
  1124. }
  1125. const leaveCbKey = Symbol("_leaveCb");
  1126. const enterCbKey = Symbol("_enterCb");
  1127. function useTransitionState() {
  1128. const state = {
  1129. isMounted: false,
  1130. isLeaving: false,
  1131. isUnmounting: false,
  1132. leavingVNodes: /* @__PURE__ */ new Map()
  1133. };
  1134. onMounted(() => {
  1135. state.isMounted = true;
  1136. });
  1137. onBeforeUnmount(() => {
  1138. state.isUnmounting = true;
  1139. });
  1140. return state;
  1141. }
  1142. const TransitionHookValidator = [Function, Array];
  1143. const BaseTransitionPropsValidators = {
  1144. mode: String,
  1145. appear: Boolean,
  1146. persisted: Boolean,
  1147. // enter
  1148. onBeforeEnter: TransitionHookValidator,
  1149. onEnter: TransitionHookValidator,
  1150. onAfterEnter: TransitionHookValidator,
  1151. onEnterCancelled: TransitionHookValidator,
  1152. // leave
  1153. onBeforeLeave: TransitionHookValidator,
  1154. onLeave: TransitionHookValidator,
  1155. onAfterLeave: TransitionHookValidator,
  1156. onLeaveCancelled: TransitionHookValidator,
  1157. // appear
  1158. onBeforeAppear: TransitionHookValidator,
  1159. onAppear: TransitionHookValidator,
  1160. onAfterAppear: TransitionHookValidator,
  1161. onAppearCancelled: TransitionHookValidator
  1162. };
  1163. const recursiveGetSubtree = (instance) => {
  1164. const subTree = instance.subTree;
  1165. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  1166. };
  1167. const BaseTransitionImpl = {
  1168. name: `BaseTransition`,
  1169. props: BaseTransitionPropsValidators,
  1170. setup(props, { slots }) {
  1171. const instance = getCurrentInstance();
  1172. const state = useTransitionState();
  1173. return () => {
  1174. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  1175. if (!children || !children.length) {
  1176. return;
  1177. }
  1178. const child = findNonCommentChild(children);
  1179. const rawProps = toRaw(props);
  1180. const { mode } = rawProps;
  1181. if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  1182. warn$1(`invalid <transition> mode: ${mode}`);
  1183. }
  1184. if (state.isLeaving) {
  1185. return emptyPlaceholder(child);
  1186. }
  1187. const innerChild = getInnerChild$1(child);
  1188. if (!innerChild) {
  1189. return emptyPlaceholder(child);
  1190. }
  1191. let enterHooks = resolveTransitionHooks(
  1192. innerChild,
  1193. rawProps,
  1194. state,
  1195. instance,
  1196. // #11061, ensure enterHooks is fresh after clone
  1197. (hooks) => enterHooks = hooks
  1198. );
  1199. if (innerChild.type !== Comment) {
  1200. setTransitionHooks(innerChild, enterHooks);
  1201. }
  1202. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  1203. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
  1204. let leavingHooks = resolveTransitionHooks(
  1205. oldInnerChild,
  1206. rawProps,
  1207. state,
  1208. instance
  1209. );
  1210. setTransitionHooks(oldInnerChild, leavingHooks);
  1211. if (mode === "out-in" && innerChild.type !== Comment) {
  1212. state.isLeaving = true;
  1213. leavingHooks.afterLeave = () => {
  1214. state.isLeaving = false;
  1215. if (!(instance.job.flags & 8)) {
  1216. instance.update();
  1217. }
  1218. delete leavingHooks.afterLeave;
  1219. oldInnerChild = void 0;
  1220. };
  1221. return emptyPlaceholder(child);
  1222. } else if (mode === "in-out" && innerChild.type !== Comment) {
  1223. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  1224. const leavingVNodesCache = getLeavingNodesForType(
  1225. state,
  1226. oldInnerChild
  1227. );
  1228. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  1229. el[leaveCbKey] = () => {
  1230. earlyRemove();
  1231. el[leaveCbKey] = void 0;
  1232. delete enterHooks.delayedLeave;
  1233. oldInnerChild = void 0;
  1234. };
  1235. enterHooks.delayedLeave = () => {
  1236. delayedLeave();
  1237. delete enterHooks.delayedLeave;
  1238. oldInnerChild = void 0;
  1239. };
  1240. };
  1241. } else {
  1242. oldInnerChild = void 0;
  1243. }
  1244. } else if (oldInnerChild) {
  1245. oldInnerChild = void 0;
  1246. }
  1247. return child;
  1248. };
  1249. }
  1250. };
  1251. function findNonCommentChild(children) {
  1252. let child = children[0];
  1253. if (children.length > 1) {
  1254. let hasFound = false;
  1255. for (const c of children) {
  1256. if (c.type !== Comment) {
  1257. if (!!(process.env.NODE_ENV !== "production") && hasFound) {
  1258. warn$1(
  1259. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  1260. );
  1261. break;
  1262. }
  1263. child = c;
  1264. hasFound = true;
  1265. if (!!!(process.env.NODE_ENV !== "production")) break;
  1266. }
  1267. }
  1268. }
  1269. return child;
  1270. }
  1271. const BaseTransition = BaseTransitionImpl;
  1272. function getLeavingNodesForType(state, vnode) {
  1273. const { leavingVNodes } = state;
  1274. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  1275. if (!leavingVNodesCache) {
  1276. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  1277. leavingVNodes.set(vnode.type, leavingVNodesCache);
  1278. }
  1279. return leavingVNodesCache;
  1280. }
  1281. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  1282. const {
  1283. appear,
  1284. mode,
  1285. persisted = false,
  1286. onBeforeEnter,
  1287. onEnter,
  1288. onAfterEnter,
  1289. onEnterCancelled,
  1290. onBeforeLeave,
  1291. onLeave,
  1292. onAfterLeave,
  1293. onLeaveCancelled,
  1294. onBeforeAppear,
  1295. onAppear,
  1296. onAfterAppear,
  1297. onAppearCancelled
  1298. } = props;
  1299. const key = String(vnode.key);
  1300. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  1301. const callHook = (hook, args) => {
  1302. hook && callWithAsyncErrorHandling(
  1303. hook,
  1304. instance,
  1305. 9,
  1306. args
  1307. );
  1308. };
  1309. const callAsyncHook = (hook, args) => {
  1310. const done = args[1];
  1311. callHook(hook, args);
  1312. if (isArray(hook)) {
  1313. if (hook.every((hook2) => hook2.length <= 1)) done();
  1314. } else if (hook.length <= 1) {
  1315. done();
  1316. }
  1317. };
  1318. const hooks = {
  1319. mode,
  1320. persisted,
  1321. beforeEnter(el) {
  1322. let hook = onBeforeEnter;
  1323. if (!state.isMounted) {
  1324. if (appear) {
  1325. hook = onBeforeAppear || onBeforeEnter;
  1326. } else {
  1327. return;
  1328. }
  1329. }
  1330. if (el[leaveCbKey]) {
  1331. el[leaveCbKey](
  1332. true
  1333. /* cancelled */
  1334. );
  1335. }
  1336. const leavingVNode = leavingVNodesCache[key];
  1337. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  1338. leavingVNode.el[leaveCbKey]();
  1339. }
  1340. callHook(hook, [el]);
  1341. },
  1342. enter(el) {
  1343. let hook = onEnter;
  1344. let afterHook = onAfterEnter;
  1345. let cancelHook = onEnterCancelled;
  1346. if (!state.isMounted) {
  1347. if (appear) {
  1348. hook = onAppear || onEnter;
  1349. afterHook = onAfterAppear || onAfterEnter;
  1350. cancelHook = onAppearCancelled || onEnterCancelled;
  1351. } else {
  1352. return;
  1353. }
  1354. }
  1355. let called = false;
  1356. const done = el[enterCbKey] = (cancelled) => {
  1357. if (called) return;
  1358. called = true;
  1359. if (cancelled) {
  1360. callHook(cancelHook, [el]);
  1361. } else {
  1362. callHook(afterHook, [el]);
  1363. }
  1364. if (hooks.delayedLeave) {
  1365. hooks.delayedLeave();
  1366. }
  1367. el[enterCbKey] = void 0;
  1368. };
  1369. if (hook) {
  1370. callAsyncHook(hook, [el, done]);
  1371. } else {
  1372. done();
  1373. }
  1374. },
  1375. leave(el, remove) {
  1376. const key2 = String(vnode.key);
  1377. if (el[enterCbKey]) {
  1378. el[enterCbKey](
  1379. true
  1380. /* cancelled */
  1381. );
  1382. }
  1383. if (state.isUnmounting) {
  1384. return remove();
  1385. }
  1386. callHook(onBeforeLeave, [el]);
  1387. let called = false;
  1388. const done = el[leaveCbKey] = (cancelled) => {
  1389. if (called) return;
  1390. called = true;
  1391. remove();
  1392. if (cancelled) {
  1393. callHook(onLeaveCancelled, [el]);
  1394. } else {
  1395. callHook(onAfterLeave, [el]);
  1396. }
  1397. el[leaveCbKey] = void 0;
  1398. if (leavingVNodesCache[key2] === vnode) {
  1399. delete leavingVNodesCache[key2];
  1400. }
  1401. };
  1402. leavingVNodesCache[key2] = vnode;
  1403. if (onLeave) {
  1404. callAsyncHook(onLeave, [el, done]);
  1405. } else {
  1406. done();
  1407. }
  1408. },
  1409. clone(vnode2) {
  1410. const hooks2 = resolveTransitionHooks(
  1411. vnode2,
  1412. props,
  1413. state,
  1414. instance,
  1415. postClone
  1416. );
  1417. if (postClone) postClone(hooks2);
  1418. return hooks2;
  1419. }
  1420. };
  1421. return hooks;
  1422. }
  1423. function emptyPlaceholder(vnode) {
  1424. if (isKeepAlive(vnode)) {
  1425. vnode = cloneVNode(vnode);
  1426. vnode.children = null;
  1427. return vnode;
  1428. }
  1429. }
  1430. function getInnerChild$1(vnode) {
  1431. if (!isKeepAlive(vnode)) {
  1432. if (isTeleport(vnode.type) && vnode.children) {
  1433. return findNonCommentChild(vnode.children);
  1434. }
  1435. return vnode;
  1436. }
  1437. if (vnode.component) {
  1438. return vnode.component.subTree;
  1439. }
  1440. const { shapeFlag, children } = vnode;
  1441. if (children) {
  1442. if (shapeFlag & 16) {
  1443. return children[0];
  1444. }
  1445. if (shapeFlag & 32 && isFunction(children.default)) {
  1446. return children.default();
  1447. }
  1448. }
  1449. }
  1450. function setTransitionHooks(vnode, hooks) {
  1451. if (vnode.shapeFlag & 6 && vnode.component) {
  1452. vnode.transition = hooks;
  1453. setTransitionHooks(vnode.component.subTree, hooks);
  1454. } else if (vnode.shapeFlag & 128) {
  1455. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  1456. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  1457. } else {
  1458. vnode.transition = hooks;
  1459. }
  1460. }
  1461. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  1462. let ret = [];
  1463. let keyedFragmentCount = 0;
  1464. for (let i = 0; i < children.length; i++) {
  1465. let child = children[i];
  1466. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  1467. if (child.type === Fragment) {
  1468. if (child.patchFlag & 128) keyedFragmentCount++;
  1469. ret = ret.concat(
  1470. getTransitionRawChildren(child.children, keepComment, key)
  1471. );
  1472. } else if (keepComment || child.type !== Comment) {
  1473. ret.push(key != null ? cloneVNode(child, { key }) : child);
  1474. }
  1475. }
  1476. if (keyedFragmentCount > 1) {
  1477. for (let i = 0; i < ret.length; i++) {
  1478. ret[i].patchFlag = -2;
  1479. }
  1480. }
  1481. return ret;
  1482. }
  1483. // @__NO_SIDE_EFFECTS__
  1484. function defineComponent(options, extraOptions) {
  1485. return isFunction(options) ? (
  1486. // #8236: extend call and options.name access are considered side-effects
  1487. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  1488. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  1489. ) : options;
  1490. }
  1491. function useId() {
  1492. const i = getCurrentInstance();
  1493. if (i) {
  1494. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  1495. } else if (!!(process.env.NODE_ENV !== "production")) {
  1496. warn$1(
  1497. `useId() is called when there is no active component instance to be associated with.`
  1498. );
  1499. }
  1500. return "";
  1501. }
  1502. function markAsyncBoundary(instance) {
  1503. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  1504. }
  1505. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  1506. function useTemplateRef(key) {
  1507. const i = getCurrentInstance();
  1508. const r = shallowRef(null);
  1509. if (i) {
  1510. const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
  1511. let desc;
  1512. if (!!(process.env.NODE_ENV !== "production") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
  1513. warn$1(`useTemplateRef('${key}') already exists.`);
  1514. } else {
  1515. Object.defineProperty(refs, key, {
  1516. enumerable: true,
  1517. get: () => r.value,
  1518. set: (val) => r.value = val
  1519. });
  1520. }
  1521. } else if (!!(process.env.NODE_ENV !== "production")) {
  1522. warn$1(
  1523. `useTemplateRef() is called when there is no active component instance to be associated with.`
  1524. );
  1525. }
  1526. const ret = !!(process.env.NODE_ENV !== "production") ? readonly(r) : r;
  1527. if (!!(process.env.NODE_ENV !== "production")) {
  1528. knownTemplateRefs.add(ret);
  1529. }
  1530. return ret;
  1531. }
  1532. const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
  1533. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  1534. if (isArray(rawRef)) {
  1535. rawRef.forEach(
  1536. (r, i) => setRef(
  1537. r,
  1538. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  1539. parentSuspense,
  1540. vnode,
  1541. isUnmount
  1542. )
  1543. );
  1544. return;
  1545. }
  1546. if (isAsyncWrapper(vnode) && !isUnmount) {
  1547. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  1548. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  1549. }
  1550. return;
  1551. }
  1552. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  1553. const value = isUnmount ? null : refValue;
  1554. const { i: owner, r: ref } = rawRef;
  1555. if (!!(process.env.NODE_ENV !== "production") && !owner) {
  1556. warn$1(
  1557. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  1558. );
  1559. return;
  1560. }
  1561. const oldRef = oldRawRef && oldRawRef.r;
  1562. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  1563. const setupState = owner.setupState;
  1564. const rawSetupState = toRaw(setupState);
  1565. const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
  1566. if (!!(process.env.NODE_ENV !== "production")) {
  1567. if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
  1568. warn$1(
  1569. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  1570. );
  1571. }
  1572. if (knownTemplateRefs.has(rawSetupState[key])) {
  1573. return false;
  1574. }
  1575. }
  1576. return hasOwn(rawSetupState, key);
  1577. };
  1578. const canSetRef = (ref2) => {
  1579. return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
  1580. };
  1581. if (oldRef != null && oldRef !== ref) {
  1582. invalidatePendingSetRef(oldRawRef);
  1583. if (isString(oldRef)) {
  1584. refs[oldRef] = null;
  1585. if (canSetSetupRef(oldRef)) {
  1586. setupState[oldRef] = null;
  1587. }
  1588. } else if (isRef(oldRef)) {
  1589. if (canSetRef(oldRef)) {
  1590. oldRef.value = null;
  1591. }
  1592. const oldRawRefAtom = oldRawRef;
  1593. if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
  1594. }
  1595. }
  1596. if (isFunction(ref)) {
  1597. callWithErrorHandling(ref, owner, 12, [value, refs]);
  1598. } else {
  1599. const _isString = isString(ref);
  1600. const _isRef = isRef(ref);
  1601. if (_isString || _isRef) {
  1602. const doSet = () => {
  1603. if (rawRef.f) {
  1604. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
  1605. if (isUnmount) {
  1606. isArray(existing) && remove(existing, refValue);
  1607. } else {
  1608. if (!isArray(existing)) {
  1609. if (_isString) {
  1610. refs[ref] = [refValue];
  1611. if (canSetSetupRef(ref)) {
  1612. setupState[ref] = refs[ref];
  1613. }
  1614. } else {
  1615. const newVal = [refValue];
  1616. if (canSetRef(ref)) {
  1617. ref.value = newVal;
  1618. }
  1619. if (rawRef.k) refs[rawRef.k] = newVal;
  1620. }
  1621. } else if (!existing.includes(refValue)) {
  1622. existing.push(refValue);
  1623. }
  1624. }
  1625. } else if (_isString) {
  1626. refs[ref] = value;
  1627. if (canSetSetupRef(ref)) {
  1628. setupState[ref] = value;
  1629. }
  1630. } else if (_isRef) {
  1631. if (canSetRef(ref)) {
  1632. ref.value = value;
  1633. }
  1634. if (rawRef.k) refs[rawRef.k] = value;
  1635. } else if (!!(process.env.NODE_ENV !== "production")) {
  1636. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  1637. }
  1638. };
  1639. if (value) {
  1640. const job = () => {
  1641. doSet();
  1642. pendingSetRefMap.delete(rawRef);
  1643. };
  1644. job.id = -1;
  1645. pendingSetRefMap.set(rawRef, job);
  1646. queuePostRenderEffect(job, parentSuspense);
  1647. } else {
  1648. invalidatePendingSetRef(rawRef);
  1649. doSet();
  1650. }
  1651. } else if (!!(process.env.NODE_ENV !== "production")) {
  1652. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  1653. }
  1654. }
  1655. }
  1656. function invalidatePendingSetRef(rawRef) {
  1657. const pendingSetRef = pendingSetRefMap.get(rawRef);
  1658. if (pendingSetRef) {
  1659. pendingSetRef.flags |= 8;
  1660. pendingSetRefMap.delete(rawRef);
  1661. }
  1662. }
  1663. let hasLoggedMismatchError = false;
  1664. const logMismatchError = () => {
  1665. if (hasLoggedMismatchError) {
  1666. return;
  1667. }
  1668. console.error("Hydration completed but contains mismatches.");
  1669. hasLoggedMismatchError = true;
  1670. };
  1671. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  1672. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  1673. const getContainerType = (container) => {
  1674. if (container.nodeType !== 1) return void 0;
  1675. if (isSVGContainer(container)) return "svg";
  1676. if (isMathMLContainer(container)) return "mathml";
  1677. return void 0;
  1678. };
  1679. const isComment = (node) => node.nodeType === 8;
  1680. function createHydrationFunctions(rendererInternals) {
  1681. const {
  1682. mt: mountComponent,
  1683. p: patch,
  1684. o: {
  1685. patchProp,
  1686. createText,
  1687. nextSibling,
  1688. parentNode,
  1689. remove,
  1690. insert,
  1691. createComment
  1692. }
  1693. } = rendererInternals;
  1694. const hydrate = (vnode, container) => {
  1695. if (!container.hasChildNodes()) {
  1696. (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
  1697. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  1698. );
  1699. patch(null, vnode, container);
  1700. flushPostFlushCbs();
  1701. container._vnode = vnode;
  1702. return;
  1703. }
  1704. hydrateNode(container.firstChild, vnode, null, null, null);
  1705. flushPostFlushCbs();
  1706. container._vnode = vnode;
  1707. };
  1708. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  1709. optimized = optimized || !!vnode.dynamicChildren;
  1710. const isFragmentStart = isComment(node) && node.data === "[";
  1711. const onMismatch = () => handleMismatch(
  1712. node,
  1713. vnode,
  1714. parentComponent,
  1715. parentSuspense,
  1716. slotScopeIds,
  1717. isFragmentStart
  1718. );
  1719. const { type, ref, shapeFlag, patchFlag } = vnode;
  1720. let domType = node.nodeType;
  1721. vnode.el = node;
  1722. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  1723. def(node, "__vnode", vnode, true);
  1724. def(node, "__vueParentComponent", parentComponent, true);
  1725. }
  1726. if (patchFlag === -2) {
  1727. optimized = false;
  1728. vnode.dynamicChildren = null;
  1729. }
  1730. let nextNode = null;
  1731. switch (type) {
  1732. case Text:
  1733. if (domType !== 3) {
  1734. if (vnode.children === "") {
  1735. insert(vnode.el = createText(""), parentNode(node), node);
  1736. nextNode = node;
  1737. } else {
  1738. nextNode = onMismatch();
  1739. }
  1740. } else {
  1741. if (node.data !== vnode.children) {
  1742. (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
  1743. `Hydration text mismatch in`,
  1744. node.parentNode,
  1745. `
  1746. - rendered on server: ${JSON.stringify(
  1747. node.data
  1748. )}
  1749. - expected on client: ${JSON.stringify(vnode.children)}`
  1750. );
  1751. logMismatchError();
  1752. node.data = vnode.children;
  1753. }
  1754. nextNode = nextSibling(node);
  1755. }
  1756. break;
  1757. case Comment:
  1758. if (isTemplateNode(node)) {
  1759. nextNode = nextSibling(node);
  1760. replaceNode(
  1761. vnode.el = node.content.firstChild,
  1762. node,
  1763. parentComponent
  1764. );
  1765. } else if (domType !== 8 || isFragmentStart) {
  1766. nextNode = onMismatch();
  1767. } else {
  1768. nextNode = nextSibling(node);
  1769. }
  1770. break;
  1771. case Static:
  1772. if (isFragmentStart) {
  1773. node = nextSibling(node);
  1774. domType = node.nodeType;
  1775. }
  1776. if (domType === 1 || domType === 3) {
  1777. nextNode = node;
  1778. const needToAdoptContent = !vnode.children.length;
  1779. for (let i = 0; i < vnode.staticCount; i++) {
  1780. if (needToAdoptContent)
  1781. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  1782. if (i === vnode.staticCount - 1) {
  1783. vnode.anchor = nextNode;
  1784. }
  1785. nextNode = nextSibling(nextNode);
  1786. }
  1787. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  1788. } else {
  1789. onMismatch();
  1790. }
  1791. break;
  1792. case Fragment:
  1793. if (!isFragmentStart) {
  1794. nextNode = onMismatch();
  1795. } else {
  1796. nextNode = hydrateFragment(
  1797. node,
  1798. vnode,
  1799. parentComponent,
  1800. parentSuspense,
  1801. slotScopeIds,
  1802. optimized
  1803. );
  1804. }
  1805. break;
  1806. default:
  1807. if (shapeFlag & 1) {
  1808. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  1809. nextNode = onMismatch();
  1810. } else {
  1811. nextNode = hydrateElement(
  1812. node,
  1813. vnode,
  1814. parentComponent,
  1815. parentSuspense,
  1816. slotScopeIds,
  1817. optimized
  1818. );
  1819. }
  1820. } else if (shapeFlag & 6) {
  1821. vnode.slotScopeIds = slotScopeIds;
  1822. const container = parentNode(node);
  1823. if (isFragmentStart) {
  1824. nextNode = locateClosingAnchor(node);
  1825. } else if (isComment(node) && node.data === "teleport start") {
  1826. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  1827. } else {
  1828. nextNode = nextSibling(node);
  1829. }
  1830. mountComponent(
  1831. vnode,
  1832. container,
  1833. null,
  1834. parentComponent,
  1835. parentSuspense,
  1836. getContainerType(container),
  1837. optimized
  1838. );
  1839. if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
  1840. let subTree;
  1841. if (isFragmentStart) {
  1842. subTree = createVNode(Fragment);
  1843. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  1844. } else {
  1845. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  1846. }
  1847. subTree.el = node;
  1848. vnode.component.subTree = subTree;
  1849. }
  1850. } else if (shapeFlag & 64) {
  1851. if (domType !== 8) {
  1852. nextNode = onMismatch();
  1853. } else {
  1854. nextNode = vnode.type.hydrate(
  1855. node,
  1856. vnode,
  1857. parentComponent,
  1858. parentSuspense,
  1859. slotScopeIds,
  1860. optimized,
  1861. rendererInternals,
  1862. hydrateChildren
  1863. );
  1864. }
  1865. } else if (shapeFlag & 128) {
  1866. nextNode = vnode.type.hydrate(
  1867. node,
  1868. vnode,
  1869. parentComponent,
  1870. parentSuspense,
  1871. getContainerType(parentNode(node)),
  1872. slotScopeIds,
  1873. optimized,
  1874. rendererInternals,
  1875. hydrateNode
  1876. );
  1877. } else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
  1878. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  1879. }
  1880. }
  1881. if (ref != null) {
  1882. setRef(ref, null, parentSuspense, vnode);
  1883. }
  1884. return nextNode;
  1885. };
  1886. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1887. optimized = optimized || !!vnode.dynamicChildren;
  1888. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  1889. const forcePatch = type === "input" || type === "option";
  1890. if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) {
  1891. if (dirs) {
  1892. invokeDirectiveHook(vnode, null, parentComponent, "created");
  1893. }
  1894. let needCallTransitionHooks = false;
  1895. if (isTemplateNode(el)) {
  1896. needCallTransitionHooks = needTransition(
  1897. null,
  1898. // no need check parentSuspense in hydration
  1899. transition
  1900. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  1901. const content = el.content.firstChild;
  1902. if (needCallTransitionHooks) {
  1903. const cls = content.getAttribute("class");
  1904. if (cls) content.$cls = cls;
  1905. transition.beforeEnter(content);
  1906. }
  1907. replaceNode(content, el, parentComponent);
  1908. vnode.el = el = content;
  1909. }
  1910. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  1911. !(props && (props.innerHTML || props.textContent))) {
  1912. let next = hydrateChildren(
  1913. el.firstChild,
  1914. vnode,
  1915. el,
  1916. parentComponent,
  1917. parentSuspense,
  1918. slotScopeIds,
  1919. optimized
  1920. );
  1921. let hasWarned = false;
  1922. while (next) {
  1923. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  1924. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
  1925. warn$1(
  1926. `Hydration children mismatch on`,
  1927. el,
  1928. `
  1929. Server rendered element contains more child nodes than client vdom.`
  1930. );
  1931. hasWarned = true;
  1932. }
  1933. logMismatchError();
  1934. }
  1935. const cur = next;
  1936. next = next.nextSibling;
  1937. remove(cur);
  1938. }
  1939. } else if (shapeFlag & 8) {
  1940. let clientText = vnode.children;
  1941. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  1942. clientText = clientText.slice(1);
  1943. }
  1944. if (el.textContent !== clientText) {
  1945. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  1946. (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
  1947. `Hydration text content mismatch on`,
  1948. el,
  1949. `
  1950. - rendered on server: ${el.textContent}
  1951. - expected on client: ${vnode.children}`
  1952. );
  1953. logMismatchError();
  1954. }
  1955. el.textContent = vnode.children;
  1956. }
  1957. }
  1958. if (props) {
  1959. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
  1960. const isCustomElement = el.tagName.includes("-");
  1961. for (const key in props) {
  1962. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
  1963. // as it could have mutated the DOM in any possible way
  1964. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  1965. logMismatchError();
  1966. }
  1967. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  1968. key[0] === "." || isCustomElement) {
  1969. patchProp(el, key, null, props[key], void 0, parentComponent);
  1970. }
  1971. }
  1972. } else if (props.onClick) {
  1973. patchProp(
  1974. el,
  1975. "onClick",
  1976. null,
  1977. props.onClick,
  1978. void 0,
  1979. parentComponent
  1980. );
  1981. } else if (patchFlag & 4 && isReactive(props.style)) {
  1982. for (const key in props.style) props.style[key];
  1983. }
  1984. }
  1985. let vnodeHooks;
  1986. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  1987. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1988. }
  1989. if (dirs) {
  1990. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  1991. }
  1992. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  1993. queueEffectWithSuspense(() => {
  1994. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1995. needCallTransitionHooks && transition.enter(el);
  1996. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  1997. }, parentSuspense);
  1998. }
  1999. }
  2000. return el.nextSibling;
  2001. };
  2002. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  2003. optimized = optimized || !!parentVNode.dynamicChildren;
  2004. const children = parentVNode.children;
  2005. const l = children.length;
  2006. let hasWarned = false;
  2007. for (let i = 0; i < l; i++) {
  2008. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  2009. const isText = vnode.type === Text;
  2010. if (node) {
  2011. if (isText && !optimized) {
  2012. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  2013. insert(
  2014. createText(
  2015. node.data.slice(vnode.children.length)
  2016. ),
  2017. container,
  2018. nextSibling(node)
  2019. );
  2020. node.data = vnode.children;
  2021. }
  2022. }
  2023. node = hydrateNode(
  2024. node,
  2025. vnode,
  2026. parentComponent,
  2027. parentSuspense,
  2028. slotScopeIds,
  2029. optimized
  2030. );
  2031. } else if (isText && !vnode.children) {
  2032. insert(vnode.el = createText(""), container);
  2033. } else {
  2034. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  2035. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
  2036. warn$1(
  2037. `Hydration children mismatch on`,
  2038. container,
  2039. `
  2040. Server rendered element contains fewer child nodes than client vdom.`
  2041. );
  2042. hasWarned = true;
  2043. }
  2044. logMismatchError();
  2045. }
  2046. patch(
  2047. null,
  2048. vnode,
  2049. container,
  2050. null,
  2051. parentComponent,
  2052. parentSuspense,
  2053. getContainerType(container),
  2054. slotScopeIds
  2055. );
  2056. }
  2057. }
  2058. return node;
  2059. };
  2060. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  2061. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  2062. if (fragmentSlotScopeIds) {
  2063. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  2064. }
  2065. const container = parentNode(node);
  2066. const next = hydrateChildren(
  2067. nextSibling(node),
  2068. vnode,
  2069. container,
  2070. parentComponent,
  2071. parentSuspense,
  2072. slotScopeIds,
  2073. optimized
  2074. );
  2075. if (next && isComment(next) && next.data === "]") {
  2076. return nextSibling(vnode.anchor = next);
  2077. } else {
  2078. logMismatchError();
  2079. insert(vnode.anchor = createComment(`]`), container, next);
  2080. return next;
  2081. }
  2082. };
  2083. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  2084. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  2085. (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
  2086. `Hydration node mismatch:
  2087. - rendered on server:`,
  2088. node,
  2089. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  2090. `
  2091. - expected on client:`,
  2092. vnode.type
  2093. );
  2094. logMismatchError();
  2095. }
  2096. vnode.el = null;
  2097. if (isFragment) {
  2098. const end = locateClosingAnchor(node);
  2099. while (true) {
  2100. const next2 = nextSibling(node);
  2101. if (next2 && next2 !== end) {
  2102. remove(next2);
  2103. } else {
  2104. break;
  2105. }
  2106. }
  2107. }
  2108. const next = nextSibling(node);
  2109. const container = parentNode(node);
  2110. remove(node);
  2111. patch(
  2112. null,
  2113. vnode,
  2114. container,
  2115. next,
  2116. parentComponent,
  2117. parentSuspense,
  2118. getContainerType(container),
  2119. slotScopeIds
  2120. );
  2121. if (parentComponent) {
  2122. parentComponent.vnode.el = vnode.el;
  2123. updateHOCHostEl(parentComponent, vnode.el);
  2124. }
  2125. return next;
  2126. };
  2127. const locateClosingAnchor = (node, open = "[", close = "]") => {
  2128. let match = 0;
  2129. while (node) {
  2130. node = nextSibling(node);
  2131. if (node && isComment(node)) {
  2132. if (node.data === open) match++;
  2133. if (node.data === close) {
  2134. if (match === 0) {
  2135. return nextSibling(node);
  2136. } else {
  2137. match--;
  2138. }
  2139. }
  2140. }
  2141. }
  2142. return node;
  2143. };
  2144. const replaceNode = (newNode, oldNode, parentComponent) => {
  2145. const parentNode2 = oldNode.parentNode;
  2146. if (parentNode2) {
  2147. parentNode2.replaceChild(newNode, oldNode);
  2148. }
  2149. let parent = parentComponent;
  2150. while (parent) {
  2151. if (parent.vnode.el === oldNode) {
  2152. parent.vnode.el = parent.subTree.el = newNode;
  2153. }
  2154. parent = parent.parent;
  2155. }
  2156. };
  2157. const isTemplateNode = (node) => {
  2158. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  2159. };
  2160. return [hydrate, hydrateNode];
  2161. }
  2162. function propHasMismatch(el, key, clientValue, vnode, instance) {
  2163. let mismatchType;
  2164. let mismatchKey;
  2165. let actual;
  2166. let expected;
  2167. if (key === "class") {
  2168. if (el.$cls) {
  2169. actual = el.$cls;
  2170. delete el.$cls;
  2171. } else {
  2172. actual = el.getAttribute("class");
  2173. }
  2174. expected = normalizeClass(clientValue);
  2175. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  2176. mismatchType = 2 /* CLASS */;
  2177. mismatchKey = `class`;
  2178. }
  2179. } else if (key === "style") {
  2180. actual = el.getAttribute("style") || "";
  2181. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  2182. const actualMap = toStyleMap(actual);
  2183. const expectedMap = toStyleMap(expected);
  2184. if (vnode.dirs) {
  2185. for (const { dir, value } of vnode.dirs) {
  2186. if (dir.name === "show" && !value) {
  2187. expectedMap.set("display", "none");
  2188. }
  2189. }
  2190. }
  2191. if (instance) {
  2192. resolveCssVars(instance, vnode, expectedMap);
  2193. }
  2194. if (!isMapEqual(actualMap, expectedMap)) {
  2195. mismatchType = 3 /* STYLE */;
  2196. mismatchKey = "style";
  2197. }
  2198. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  2199. if (isBooleanAttr(key)) {
  2200. actual = el.hasAttribute(key);
  2201. expected = includeBooleanAttr(clientValue);
  2202. } else if (clientValue == null) {
  2203. actual = el.hasAttribute(key);
  2204. expected = false;
  2205. } else {
  2206. if (el.hasAttribute(key)) {
  2207. actual = el.getAttribute(key);
  2208. } else if (key === "value" && el.tagName === "TEXTAREA") {
  2209. actual = el.value;
  2210. } else {
  2211. actual = false;
  2212. }
  2213. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  2214. }
  2215. if (actual !== expected) {
  2216. mismatchType = 4 /* ATTRIBUTE */;
  2217. mismatchKey = key;
  2218. }
  2219. }
  2220. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  2221. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  2222. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  2223. const postSegment = `
  2224. - rendered on server: ${format(actual)}
  2225. - expected on client: ${format(expected)}
  2226. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  2227. You should fix the source of the mismatch.`;
  2228. {
  2229. warn$1(preSegment, el, postSegment);
  2230. }
  2231. return true;
  2232. }
  2233. return false;
  2234. }
  2235. function toClassSet(str) {
  2236. return new Set(str.trim().split(/\s+/));
  2237. }
  2238. function isSetEqual(a, b) {
  2239. if (a.size !== b.size) {
  2240. return false;
  2241. }
  2242. for (const s of a) {
  2243. if (!b.has(s)) {
  2244. return false;
  2245. }
  2246. }
  2247. return true;
  2248. }
  2249. function toStyleMap(str) {
  2250. const styleMap = /* @__PURE__ */ new Map();
  2251. for (const item of str.split(";")) {
  2252. let [key, value] = item.split(":");
  2253. key = key.trim();
  2254. value = value && value.trim();
  2255. if (key && value) {
  2256. styleMap.set(key, value);
  2257. }
  2258. }
  2259. return styleMap;
  2260. }
  2261. function isMapEqual(a, b) {
  2262. if (a.size !== b.size) {
  2263. return false;
  2264. }
  2265. for (const [key, value] of a) {
  2266. if (value !== b.get(key)) {
  2267. return false;
  2268. }
  2269. }
  2270. return true;
  2271. }
  2272. function resolveCssVars(instance, vnode, expectedMap) {
  2273. const root = instance.subTree;
  2274. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  2275. const cssVars = instance.getCssVars();
  2276. for (const key in cssVars) {
  2277. const value = normalizeCssVarValue(cssVars[key]);
  2278. expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value);
  2279. }
  2280. }
  2281. if (vnode === root && instance.parent) {
  2282. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  2283. }
  2284. }
  2285. const allowMismatchAttr = "data-allow-mismatch";
  2286. const MismatchTypeString = {
  2287. [0 /* TEXT */]: "text",
  2288. [1 /* CHILDREN */]: "children",
  2289. [2 /* CLASS */]: "class",
  2290. [3 /* STYLE */]: "style",
  2291. [4 /* ATTRIBUTE */]: "attribute"
  2292. };
  2293. function isMismatchAllowed(el, allowedType) {
  2294. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  2295. while (el && !el.hasAttribute(allowMismatchAttr)) {
  2296. el = el.parentElement;
  2297. }
  2298. }
  2299. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  2300. if (allowedAttr == null) {
  2301. return false;
  2302. } else if (allowedAttr === "") {
  2303. return true;
  2304. } else {
  2305. const list = allowedAttr.split(",");
  2306. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  2307. return true;
  2308. }
  2309. return list.includes(MismatchTypeString[allowedType]);
  2310. }
  2311. }
  2312. const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  2313. const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  2314. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  2315. const id = requestIdleCallback(hydrate, { timeout });
  2316. return () => cancelIdleCallback(id);
  2317. };
  2318. function elementIsVisibleInViewport(el) {
  2319. const { top, left, bottom, right } = el.getBoundingClientRect();
  2320. const { innerHeight, innerWidth } = window;
  2321. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  2322. }
  2323. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  2324. const ob = new IntersectionObserver((entries) => {
  2325. for (const e of entries) {
  2326. if (!e.isIntersecting) continue;
  2327. ob.disconnect();
  2328. hydrate();
  2329. break;
  2330. }
  2331. }, opts);
  2332. forEach((el) => {
  2333. if (!(el instanceof Element)) return;
  2334. if (elementIsVisibleInViewport(el)) {
  2335. hydrate();
  2336. ob.disconnect();
  2337. return false;
  2338. }
  2339. ob.observe(el);
  2340. });
  2341. return () => ob.disconnect();
  2342. };
  2343. const hydrateOnMediaQuery = (query) => (hydrate) => {
  2344. if (query) {
  2345. const mql = matchMedia(query);
  2346. if (mql.matches) {
  2347. hydrate();
  2348. } else {
  2349. mql.addEventListener("change", hydrate, { once: true });
  2350. return () => mql.removeEventListener("change", hydrate);
  2351. }
  2352. }
  2353. };
  2354. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  2355. if (isString(interactions)) interactions = [interactions];
  2356. let hasHydrated = false;
  2357. const doHydrate = (e) => {
  2358. if (!hasHydrated) {
  2359. hasHydrated = true;
  2360. teardown();
  2361. hydrate();
  2362. e.target.dispatchEvent(new e.constructor(e.type, e));
  2363. }
  2364. };
  2365. const teardown = () => {
  2366. forEach((el) => {
  2367. for (const i of interactions) {
  2368. el.removeEventListener(i, doHydrate);
  2369. }
  2370. });
  2371. };
  2372. forEach((el) => {
  2373. for (const i of interactions) {
  2374. el.addEventListener(i, doHydrate, { once: true });
  2375. }
  2376. });
  2377. return teardown;
  2378. };
  2379. function forEachElement(node, cb) {
  2380. if (isComment(node) && node.data === "[") {
  2381. let depth = 1;
  2382. let next = node.nextSibling;
  2383. while (next) {
  2384. if (next.nodeType === 1) {
  2385. const result = cb(next);
  2386. if (result === false) {
  2387. break;
  2388. }
  2389. } else if (isComment(next)) {
  2390. if (next.data === "]") {
  2391. if (--depth === 0) break;
  2392. } else if (next.data === "[") {
  2393. depth++;
  2394. }
  2395. }
  2396. next = next.nextSibling;
  2397. }
  2398. } else {
  2399. cb(node);
  2400. }
  2401. }
  2402. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2403. // @__NO_SIDE_EFFECTS__
  2404. function defineAsyncComponent(source) {
  2405. if (isFunction(source)) {
  2406. source = { loader: source };
  2407. }
  2408. const {
  2409. loader,
  2410. loadingComponent,
  2411. errorComponent,
  2412. delay = 200,
  2413. hydrate: hydrateStrategy,
  2414. timeout,
  2415. // undefined = never times out
  2416. suspensible = true,
  2417. onError: userOnError
  2418. } = source;
  2419. let pendingRequest = null;
  2420. let resolvedComp;
  2421. let retries = 0;
  2422. const retry = () => {
  2423. retries++;
  2424. pendingRequest = null;
  2425. return load();
  2426. };
  2427. const load = () => {
  2428. let thisRequest;
  2429. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  2430. err = err instanceof Error ? err : new Error(String(err));
  2431. if (userOnError) {
  2432. return new Promise((resolve, reject) => {
  2433. const userRetry = () => resolve(retry());
  2434. const userFail = () => reject(err);
  2435. userOnError(err, userRetry, userFail, retries + 1);
  2436. });
  2437. } else {
  2438. throw err;
  2439. }
  2440. }).then((comp) => {
  2441. if (thisRequest !== pendingRequest && pendingRequest) {
  2442. return pendingRequest;
  2443. }
  2444. if (!!(process.env.NODE_ENV !== "production") && !comp) {
  2445. warn$1(
  2446. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  2447. );
  2448. }
  2449. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  2450. comp = comp.default;
  2451. }
  2452. if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
  2453. throw new Error(`Invalid async component load result: ${comp}`);
  2454. }
  2455. resolvedComp = comp;
  2456. return comp;
  2457. }));
  2458. };
  2459. return defineComponent({
  2460. name: "AsyncComponentWrapper",
  2461. __asyncLoader: load,
  2462. __asyncHydrate(el, instance, hydrate) {
  2463. let patched = false;
  2464. (instance.bu || (instance.bu = [])).push(() => patched = true);
  2465. const performHydrate = () => {
  2466. if (patched) {
  2467. if (!!(process.env.NODE_ENV !== "production")) {
  2468. warn$1(
  2469. `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
  2470. );
  2471. }
  2472. return;
  2473. }
  2474. hydrate();
  2475. };
  2476. const doHydrate = hydrateStrategy ? () => {
  2477. const teardown = hydrateStrategy(
  2478. performHydrate,
  2479. (cb) => forEachElement(el, cb)
  2480. );
  2481. if (teardown) {
  2482. (instance.bum || (instance.bum = [])).push(teardown);
  2483. }
  2484. } : performHydrate;
  2485. if (resolvedComp) {
  2486. doHydrate();
  2487. } else {
  2488. load().then(() => !instance.isUnmounted && doHydrate());
  2489. }
  2490. },
  2491. get __asyncResolved() {
  2492. return resolvedComp;
  2493. },
  2494. setup() {
  2495. const instance = currentInstance;
  2496. markAsyncBoundary(instance);
  2497. if (resolvedComp) {
  2498. return () => createInnerComp(resolvedComp, instance);
  2499. }
  2500. const onError = (err) => {
  2501. pendingRequest = null;
  2502. handleError(
  2503. err,
  2504. instance,
  2505. 13,
  2506. !errorComponent
  2507. );
  2508. };
  2509. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  2510. return load().then((comp) => {
  2511. return () => createInnerComp(comp, instance);
  2512. }).catch((err) => {
  2513. onError(err);
  2514. return () => errorComponent ? createVNode(errorComponent, {
  2515. error: err
  2516. }) : null;
  2517. });
  2518. }
  2519. const loaded = ref(false);
  2520. const error = ref();
  2521. const delayed = ref(!!delay);
  2522. if (delay) {
  2523. setTimeout(() => {
  2524. delayed.value = false;
  2525. }, delay);
  2526. }
  2527. if (timeout != null) {
  2528. setTimeout(() => {
  2529. if (!loaded.value && !error.value) {
  2530. const err = new Error(
  2531. `Async component timed out after ${timeout}ms.`
  2532. );
  2533. onError(err);
  2534. error.value = err;
  2535. }
  2536. }, timeout);
  2537. }
  2538. load().then(() => {
  2539. loaded.value = true;
  2540. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2541. instance.parent.update();
  2542. }
  2543. }).catch((err) => {
  2544. onError(err);
  2545. error.value = err;
  2546. });
  2547. return () => {
  2548. if (loaded.value && resolvedComp) {
  2549. return createInnerComp(resolvedComp, instance);
  2550. } else if (error.value && errorComponent) {
  2551. return createVNode(errorComponent, {
  2552. error: error.value
  2553. });
  2554. } else if (loadingComponent && !delayed.value) {
  2555. return createVNode(loadingComponent);
  2556. }
  2557. };
  2558. }
  2559. });
  2560. }
  2561. function createInnerComp(comp, parent) {
  2562. const { ref: ref2, props, children, ce } = parent.vnode;
  2563. const vnode = createVNode(comp, props, children);
  2564. vnode.ref = ref2;
  2565. vnode.ce = ce;
  2566. delete parent.vnode.ce;
  2567. return vnode;
  2568. }
  2569. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2570. const KeepAliveImpl = {
  2571. name: `KeepAlive`,
  2572. // Marker for special handling inside the renderer. We are not using a ===
  2573. // check directly on KeepAlive in the renderer, because importing it directly
  2574. // would prevent it from being tree-shaken.
  2575. __isKeepAlive: true,
  2576. props: {
  2577. include: [String, RegExp, Array],
  2578. exclude: [String, RegExp, Array],
  2579. max: [String, Number]
  2580. },
  2581. setup(props, { slots }) {
  2582. const instance = getCurrentInstance();
  2583. const sharedContext = instance.ctx;
  2584. if (!sharedContext.renderer) {
  2585. return () => {
  2586. const children = slots.default && slots.default();
  2587. return children && children.length === 1 ? children[0] : children;
  2588. };
  2589. }
  2590. const cache = /* @__PURE__ */ new Map();
  2591. const keys = /* @__PURE__ */ new Set();
  2592. let current = null;
  2593. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  2594. instance.__v_cache = cache;
  2595. }
  2596. const parentSuspense = instance.suspense;
  2597. const {
  2598. renderer: {
  2599. p: patch,
  2600. m: move,
  2601. um: _unmount,
  2602. o: { createElement }
  2603. }
  2604. } = sharedContext;
  2605. const storageContainer = createElement("div");
  2606. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2607. const instance2 = vnode.component;
  2608. move(vnode, container, anchor, 0, parentSuspense);
  2609. patch(
  2610. instance2.vnode,
  2611. vnode,
  2612. container,
  2613. anchor,
  2614. instance2,
  2615. parentSuspense,
  2616. namespace,
  2617. vnode.slotScopeIds,
  2618. optimized
  2619. );
  2620. queuePostRenderEffect(() => {
  2621. instance2.isDeactivated = false;
  2622. if (instance2.a) {
  2623. invokeArrayFns(instance2.a);
  2624. }
  2625. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2626. if (vnodeHook) {
  2627. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2628. }
  2629. }, parentSuspense);
  2630. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  2631. devtoolsComponentAdded(instance2);
  2632. }
  2633. };
  2634. sharedContext.deactivate = (vnode) => {
  2635. const instance2 = vnode.component;
  2636. invalidateMount(instance2.m);
  2637. invalidateMount(instance2.a);
  2638. move(vnode, storageContainer, null, 1, parentSuspense);
  2639. queuePostRenderEffect(() => {
  2640. if (instance2.da) {
  2641. invokeArrayFns(instance2.da);
  2642. }
  2643. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2644. if (vnodeHook) {
  2645. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2646. }
  2647. instance2.isDeactivated = true;
  2648. }, parentSuspense);
  2649. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  2650. devtoolsComponentAdded(instance2);
  2651. }
  2652. if (!!(process.env.NODE_ENV !== "production") && true) {
  2653. instance2.__keepAliveStorageContainer = storageContainer;
  2654. }
  2655. };
  2656. function unmount(vnode) {
  2657. resetShapeFlag(vnode);
  2658. _unmount(vnode, instance, parentSuspense, true);
  2659. }
  2660. function pruneCache(filter) {
  2661. cache.forEach((vnode, key) => {
  2662. const name = getComponentName(vnode.type);
  2663. if (name && !filter(name)) {
  2664. pruneCacheEntry(key);
  2665. }
  2666. });
  2667. }
  2668. function pruneCacheEntry(key) {
  2669. const cached = cache.get(key);
  2670. if (cached && (!current || !isSameVNodeType(cached, current))) {
  2671. unmount(cached);
  2672. } else if (current) {
  2673. resetShapeFlag(current);
  2674. }
  2675. cache.delete(key);
  2676. keys.delete(key);
  2677. }
  2678. watch(
  2679. () => [props.include, props.exclude],
  2680. ([include, exclude]) => {
  2681. include && pruneCache((name) => matches(include, name));
  2682. exclude && pruneCache((name) => !matches(exclude, name));
  2683. },
  2684. // prune post-render after `current` has been updated
  2685. { flush: "post", deep: true }
  2686. );
  2687. let pendingCacheKey = null;
  2688. const cacheSubtree = () => {
  2689. if (pendingCacheKey != null) {
  2690. if (isSuspense(instance.subTree.type)) {
  2691. queuePostRenderEffect(() => {
  2692. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2693. }, instance.subTree.suspense);
  2694. } else {
  2695. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2696. }
  2697. }
  2698. };
  2699. onMounted(cacheSubtree);
  2700. onUpdated(cacheSubtree);
  2701. onBeforeUnmount(() => {
  2702. cache.forEach((cached) => {
  2703. const { subTree, suspense } = instance;
  2704. const vnode = getInnerChild(subTree);
  2705. if (cached.type === vnode.type && cached.key === vnode.key) {
  2706. resetShapeFlag(vnode);
  2707. const da = vnode.component.da;
  2708. da && queuePostRenderEffect(da, suspense);
  2709. return;
  2710. }
  2711. unmount(cached);
  2712. });
  2713. });
  2714. return () => {
  2715. pendingCacheKey = null;
  2716. if (!slots.default) {
  2717. return current = null;
  2718. }
  2719. const children = slots.default();
  2720. const rawVNode = children[0];
  2721. if (children.length > 1) {
  2722. if (!!(process.env.NODE_ENV !== "production")) {
  2723. warn$1(`KeepAlive should contain exactly one component child.`);
  2724. }
  2725. current = null;
  2726. return children;
  2727. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2728. current = null;
  2729. return rawVNode;
  2730. }
  2731. let vnode = getInnerChild(rawVNode);
  2732. if (vnode.type === Comment) {
  2733. current = null;
  2734. return vnode;
  2735. }
  2736. const comp = vnode.type;
  2737. const name = getComponentName(
  2738. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2739. );
  2740. const { include, exclude, max } = props;
  2741. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2742. vnode.shapeFlag &= -257;
  2743. current = vnode;
  2744. return rawVNode;
  2745. }
  2746. const key = vnode.key == null ? comp : vnode.key;
  2747. const cachedVNode = cache.get(key);
  2748. if (vnode.el) {
  2749. vnode = cloneVNode(vnode);
  2750. if (rawVNode.shapeFlag & 128) {
  2751. rawVNode.ssContent = vnode;
  2752. }
  2753. }
  2754. pendingCacheKey = key;
  2755. if (cachedVNode) {
  2756. vnode.el = cachedVNode.el;
  2757. vnode.component = cachedVNode.component;
  2758. if (vnode.transition) {
  2759. setTransitionHooks(vnode, vnode.transition);
  2760. }
  2761. vnode.shapeFlag |= 512;
  2762. keys.delete(key);
  2763. keys.add(key);
  2764. } else {
  2765. keys.add(key);
  2766. if (max && keys.size > parseInt(max, 10)) {
  2767. pruneCacheEntry(keys.values().next().value);
  2768. }
  2769. }
  2770. vnode.shapeFlag |= 256;
  2771. current = vnode;
  2772. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2773. };
  2774. }
  2775. };
  2776. const KeepAlive = KeepAliveImpl;
  2777. function matches(pattern, name) {
  2778. if (isArray(pattern)) {
  2779. return pattern.some((p) => matches(p, name));
  2780. } else if (isString(pattern)) {
  2781. return pattern.split(",").includes(name);
  2782. } else if (isRegExp(pattern)) {
  2783. pattern.lastIndex = 0;
  2784. return pattern.test(name);
  2785. }
  2786. return false;
  2787. }
  2788. function onActivated(hook, target) {
  2789. registerKeepAliveHook(hook, "a", target);
  2790. }
  2791. function onDeactivated(hook, target) {
  2792. registerKeepAliveHook(hook, "da", target);
  2793. }
  2794. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2795. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2796. let current = target;
  2797. while (current) {
  2798. if (current.isDeactivated) {
  2799. return;
  2800. }
  2801. current = current.parent;
  2802. }
  2803. return hook();
  2804. });
  2805. injectHook(type, wrappedHook, target);
  2806. if (target) {
  2807. let current = target.parent;
  2808. while (current && current.parent) {
  2809. if (isKeepAlive(current.parent.vnode)) {
  2810. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2811. }
  2812. current = current.parent;
  2813. }
  2814. }
  2815. }
  2816. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2817. const injected = injectHook(
  2818. type,
  2819. hook,
  2820. keepAliveRoot,
  2821. true
  2822. /* prepend */
  2823. );
  2824. onUnmounted(() => {
  2825. remove(keepAliveRoot[type], injected);
  2826. }, target);
  2827. }
  2828. function resetShapeFlag(vnode) {
  2829. vnode.shapeFlag &= -257;
  2830. vnode.shapeFlag &= -513;
  2831. }
  2832. function getInnerChild(vnode) {
  2833. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  2834. }
  2835. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2836. if (target) {
  2837. const hooks = target[type] || (target[type] = []);
  2838. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2839. pauseTracking();
  2840. const reset = setCurrentInstance(target);
  2841. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2842. reset();
  2843. resetTracking();
  2844. return res;
  2845. });
  2846. if (prepend) {
  2847. hooks.unshift(wrappedHook);
  2848. } else {
  2849. hooks.push(wrappedHook);
  2850. }
  2851. return wrappedHook;
  2852. } else if (!!(process.env.NODE_ENV !== "production")) {
  2853. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  2854. warn$1(
  2855. `${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.` )
  2856. );
  2857. }
  2858. }
  2859. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  2860. if (!isInSSRComponentSetup || lifecycle === "sp") {
  2861. injectHook(lifecycle, (...args) => hook(...args), target);
  2862. }
  2863. };
  2864. const onBeforeMount = createHook("bm");
  2865. const onMounted = createHook("m");
  2866. const onBeforeUpdate = createHook(
  2867. "bu"
  2868. );
  2869. const onUpdated = createHook("u");
  2870. const onBeforeUnmount = createHook(
  2871. "bum"
  2872. );
  2873. const onUnmounted = createHook("um");
  2874. const onServerPrefetch = createHook(
  2875. "sp"
  2876. );
  2877. const onRenderTriggered = createHook("rtg");
  2878. const onRenderTracked = createHook("rtc");
  2879. function onErrorCaptured(hook, target = currentInstance) {
  2880. injectHook("ec", hook, target);
  2881. }
  2882. const COMPONENTS = "components";
  2883. const DIRECTIVES = "directives";
  2884. function resolveComponent(name, maybeSelfReference) {
  2885. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2886. }
  2887. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  2888. function resolveDynamicComponent(component) {
  2889. if (isString(component)) {
  2890. return resolveAsset(COMPONENTS, component, false) || component;
  2891. } else {
  2892. return component || NULL_DYNAMIC_COMPONENT;
  2893. }
  2894. }
  2895. function resolveDirective(name) {
  2896. return resolveAsset(DIRECTIVES, name);
  2897. }
  2898. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2899. const instance = currentRenderingInstance || currentInstance;
  2900. if (instance) {
  2901. const Component = instance.type;
  2902. if (type === COMPONENTS) {
  2903. const selfName = getComponentName(
  2904. Component,
  2905. false
  2906. );
  2907. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  2908. return Component;
  2909. }
  2910. }
  2911. const res = (
  2912. // local registration
  2913. // check instance[type] first which is resolved for options API
  2914. resolve(instance[type] || Component[type], name) || // global registration
  2915. resolve(instance.appContext[type], name)
  2916. );
  2917. if (!res && maybeSelfReference) {
  2918. return Component;
  2919. }
  2920. if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
  2921. const extra = type === COMPONENTS ? `
  2922. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  2923. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  2924. }
  2925. return res;
  2926. } else if (!!(process.env.NODE_ENV !== "production")) {
  2927. warn$1(
  2928. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  2929. );
  2930. }
  2931. }
  2932. function resolve(registry, name) {
  2933. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  2934. }
  2935. function renderList(source, renderItem, cache, index) {
  2936. let ret;
  2937. const cached = cache && cache[index];
  2938. const sourceIsArray = isArray(source);
  2939. if (sourceIsArray || isString(source)) {
  2940. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  2941. let needsWrap = false;
  2942. let isReadonlySource = false;
  2943. if (sourceIsReactiveArray) {
  2944. needsWrap = !isShallow(source);
  2945. isReadonlySource = isReadonly(source);
  2946. source = shallowReadArray(source);
  2947. }
  2948. ret = new Array(source.length);
  2949. for (let i = 0, l = source.length; i < l; i++) {
  2950. ret[i] = renderItem(
  2951. needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
  2952. i,
  2953. void 0,
  2954. cached && cached[i]
  2955. );
  2956. }
  2957. } else if (typeof source === "number") {
  2958. if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) {
  2959. warn$1(`The v-for range expect an integer value but got ${source}.`);
  2960. }
  2961. ret = new Array(source);
  2962. for (let i = 0; i < source; i++) {
  2963. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  2964. }
  2965. } else if (isObject(source)) {
  2966. if (source[Symbol.iterator]) {
  2967. ret = Array.from(
  2968. source,
  2969. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  2970. );
  2971. } else {
  2972. const keys = Object.keys(source);
  2973. ret = new Array(keys.length);
  2974. for (let i = 0, l = keys.length; i < l; i++) {
  2975. const key = keys[i];
  2976. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  2977. }
  2978. }
  2979. } else {
  2980. ret = [];
  2981. }
  2982. if (cache) {
  2983. cache[index] = ret;
  2984. }
  2985. return ret;
  2986. }
  2987. function createSlots(slots, dynamicSlots) {
  2988. for (let i = 0; i < dynamicSlots.length; i++) {
  2989. const slot = dynamicSlots[i];
  2990. if (isArray(slot)) {
  2991. for (let j = 0; j < slot.length; j++) {
  2992. slots[slot[j].name] = slot[j].fn;
  2993. }
  2994. } else if (slot) {
  2995. slots[slot.name] = slot.key ? (...args) => {
  2996. const res = slot.fn(...args);
  2997. if (res) res.key = slot.key;
  2998. return res;
  2999. } : slot.fn;
  3000. }
  3001. }
  3002. return slots;
  3003. }
  3004. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  3005. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  3006. if (name !== "default") props.name = name;
  3007. return openBlock(), createBlock(
  3008. Fragment,
  3009. null,
  3010. [createVNode("slot", props, fallback && fallback())],
  3011. 64
  3012. );
  3013. }
  3014. let slot = slots[name];
  3015. if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
  3016. warn$1(
  3017. `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.`
  3018. );
  3019. slot = () => [];
  3020. }
  3021. if (slot && slot._c) {
  3022. slot._d = false;
  3023. }
  3024. openBlock();
  3025. const validSlotContent = slot && ensureValidVNode(slot(props));
  3026. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  3027. // key attached in the `createSlots` helper, respect that
  3028. validSlotContent && validSlotContent.key;
  3029. const rendered = createBlock(
  3030. Fragment,
  3031. {
  3032. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  3033. (!validSlotContent && fallback ? "_fb" : "")
  3034. },
  3035. validSlotContent || (fallback ? fallback() : []),
  3036. validSlotContent && slots._ === 1 ? 64 : -2
  3037. );
  3038. if (!noSlotted && rendered.scopeId) {
  3039. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  3040. }
  3041. if (slot && slot._c) {
  3042. slot._d = true;
  3043. }
  3044. return rendered;
  3045. }
  3046. function ensureValidVNode(vnodes) {
  3047. return vnodes.some((child) => {
  3048. if (!isVNode(child)) return true;
  3049. if (child.type === Comment) return false;
  3050. if (child.type === Fragment && !ensureValidVNode(child.children))
  3051. return false;
  3052. return true;
  3053. }) ? vnodes : null;
  3054. }
  3055. function toHandlers(obj, preserveCaseIfNecessary) {
  3056. const ret = {};
  3057. if (!!(process.env.NODE_ENV !== "production") && !isObject(obj)) {
  3058. warn$1(`v-on with no argument expects an object value.`);
  3059. return ret;
  3060. }
  3061. for (const key in obj) {
  3062. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  3063. }
  3064. return ret;
  3065. }
  3066. const getPublicInstance = (i) => {
  3067. if (!i) return null;
  3068. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  3069. return getPublicInstance(i.parent);
  3070. };
  3071. const publicPropertiesMap = (
  3072. // Move PURE marker to new line to workaround compiler discarding it
  3073. // due to type annotation
  3074. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3075. $: (i) => i,
  3076. $el: (i) => i.vnode.el,
  3077. $data: (i) => i.data,
  3078. $props: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props,
  3079. $attrs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs,
  3080. $slots: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.slots) : i.slots,
  3081. $refs: (i) => !!(process.env.NODE_ENV !== "production") ? shallowReadonly(i.refs) : i.refs,
  3082. $parent: (i) => getPublicInstance(i.parent),
  3083. $root: (i) => getPublicInstance(i.root),
  3084. $host: (i) => i.ce,
  3085. $emit: (i) => i.emit,
  3086. $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,
  3087. $forceUpdate: (i) => i.f || (i.f = () => {
  3088. queueJob(i.update);
  3089. }),
  3090. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  3091. $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
  3092. })
  3093. );
  3094. const isReservedPrefix = (key) => key === "_" || key === "$";
  3095. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  3096. const PublicInstanceProxyHandlers = {
  3097. get({ _: instance }, key) {
  3098. if (key === "__v_skip") {
  3099. return true;
  3100. }
  3101. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3102. if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
  3103. return true;
  3104. }
  3105. let normalizedProps;
  3106. if (key[0] !== "$") {
  3107. const n = accessCache[key];
  3108. if (n !== void 0) {
  3109. switch (n) {
  3110. case 1 /* SETUP */:
  3111. return setupState[key];
  3112. case 2 /* DATA */:
  3113. return data[key];
  3114. case 4 /* CONTEXT */:
  3115. return ctx[key];
  3116. case 3 /* PROPS */:
  3117. return props[key];
  3118. }
  3119. } else if (hasSetupBinding(setupState, key)) {
  3120. accessCache[key] = 1 /* SETUP */;
  3121. return setupState[key];
  3122. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3123. accessCache[key] = 2 /* DATA */;
  3124. return data[key];
  3125. } else if (
  3126. // only cache other properties when instance has declared (thus stable)
  3127. // props
  3128. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  3129. ) {
  3130. accessCache[key] = 3 /* PROPS */;
  3131. return props[key];
  3132. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3133. accessCache[key] = 4 /* CONTEXT */;
  3134. return ctx[key];
  3135. } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {
  3136. accessCache[key] = 0 /* OTHER */;
  3137. }
  3138. }
  3139. const publicGetter = publicPropertiesMap[key];
  3140. let cssModule, globalProperties;
  3141. if (publicGetter) {
  3142. if (key === "$attrs") {
  3143. track(instance.attrs, "get", "");
  3144. !!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
  3145. } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
  3146. track(instance, "get", key);
  3147. }
  3148. return publicGetter(instance);
  3149. } else if (
  3150. // css module (injected by vue-loader)
  3151. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3152. ) {
  3153. return cssModule;
  3154. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3155. accessCache[key] = 4 /* CONTEXT */;
  3156. return ctx[key];
  3157. } else if (
  3158. // global properties
  3159. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  3160. ) {
  3161. {
  3162. return globalProperties[key];
  3163. }
  3164. } else if (!!(process.env.NODE_ENV !== "production") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3165. // to infinite warning loop
  3166. key.indexOf("__v") !== 0)) {
  3167. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  3168. warn$1(
  3169. `Property ${JSON.stringify(
  3170. key
  3171. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3172. );
  3173. } else if (instance === currentRenderingInstance) {
  3174. warn$1(
  3175. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3176. );
  3177. }
  3178. }
  3179. },
  3180. set({ _: instance }, key, value) {
  3181. const { data, setupState, ctx } = instance;
  3182. if (hasSetupBinding(setupState, key)) {
  3183. setupState[key] = value;
  3184. return true;
  3185. } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
  3186. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3187. return false;
  3188. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3189. data[key] = value;
  3190. return true;
  3191. } else if (hasOwn(instance.props, key)) {
  3192. !!(process.env.NODE_ENV !== "production") && warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3193. return false;
  3194. }
  3195. if (key[0] === "$" && key.slice(1) in instance) {
  3196. !!(process.env.NODE_ENV !== "production") && warn$1(
  3197. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3198. );
  3199. return false;
  3200. } else {
  3201. if (!!(process.env.NODE_ENV !== "production") && key in instance.appContext.config.globalProperties) {
  3202. Object.defineProperty(ctx, key, {
  3203. enumerable: true,
  3204. configurable: true,
  3205. value
  3206. });
  3207. } else {
  3208. ctx[key] = value;
  3209. }
  3210. }
  3211. return true;
  3212. },
  3213. has({
  3214. _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
  3215. }, key) {
  3216. let normalizedProps, cssModules;
  3217. return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  3218. },
  3219. defineProperty(target, key, descriptor) {
  3220. if (descriptor.get != null) {
  3221. target._.accessCache[key] = 0;
  3222. } else if (hasOwn(descriptor, "value")) {
  3223. this.set(target, key, descriptor.value, null);
  3224. }
  3225. return Reflect.defineProperty(target, key, descriptor);
  3226. }
  3227. };
  3228. if (!!(process.env.NODE_ENV !== "production") && true) {
  3229. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3230. warn$1(
  3231. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3232. );
  3233. return Reflect.ownKeys(target);
  3234. };
  3235. }
  3236. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
  3237. get(target, key) {
  3238. if (key === Symbol.unscopables) {
  3239. return;
  3240. }
  3241. return PublicInstanceProxyHandlers.get(target, key, target);
  3242. },
  3243. has(_, key) {
  3244. const has = key[0] !== "_" && !isGloballyAllowed(key);
  3245. if (!!(process.env.NODE_ENV !== "production") && !has && PublicInstanceProxyHandlers.has(_, key)) {
  3246. warn$1(
  3247. `Property ${JSON.stringify(
  3248. key
  3249. )} should not start with _ which is a reserved prefix for Vue internals.`
  3250. );
  3251. }
  3252. return has;
  3253. }
  3254. });
  3255. function createDevRenderContext(instance) {
  3256. const target = {};
  3257. Object.defineProperty(target, `_`, {
  3258. configurable: true,
  3259. enumerable: false,
  3260. get: () => instance
  3261. });
  3262. Object.keys(publicPropertiesMap).forEach((key) => {
  3263. Object.defineProperty(target, key, {
  3264. configurable: true,
  3265. enumerable: false,
  3266. get: () => publicPropertiesMap[key](instance),
  3267. // intercepted by the proxy so no need for implementation,
  3268. // but needed to prevent set errors
  3269. set: NOOP
  3270. });
  3271. });
  3272. return target;
  3273. }
  3274. function exposePropsOnRenderContext(instance) {
  3275. const {
  3276. ctx,
  3277. propsOptions: [propsOptions]
  3278. } = instance;
  3279. if (propsOptions) {
  3280. Object.keys(propsOptions).forEach((key) => {
  3281. Object.defineProperty(ctx, key, {
  3282. enumerable: true,
  3283. configurable: true,
  3284. get: () => instance.props[key],
  3285. set: NOOP
  3286. });
  3287. });
  3288. }
  3289. }
  3290. function exposeSetupStateOnRenderContext(instance) {
  3291. const { ctx, setupState } = instance;
  3292. Object.keys(toRaw(setupState)).forEach((key) => {
  3293. if (!setupState.__isScriptSetup) {
  3294. if (isReservedPrefix(key[0])) {
  3295. warn$1(
  3296. `setup() return property ${JSON.stringify(
  3297. key
  3298. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3299. );
  3300. return;
  3301. }
  3302. Object.defineProperty(ctx, key, {
  3303. enumerable: true,
  3304. configurable: true,
  3305. get: () => setupState[key],
  3306. set: NOOP
  3307. });
  3308. }
  3309. });
  3310. }
  3311. const warnRuntimeUsage = (method) => warn$1(
  3312. `${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.`
  3313. );
  3314. function defineProps() {
  3315. if (!!(process.env.NODE_ENV !== "production")) {
  3316. warnRuntimeUsage(`defineProps`);
  3317. }
  3318. return null;
  3319. }
  3320. function defineEmits() {
  3321. if (!!(process.env.NODE_ENV !== "production")) {
  3322. warnRuntimeUsage(`defineEmits`);
  3323. }
  3324. return null;
  3325. }
  3326. function defineExpose(exposed) {
  3327. if (!!(process.env.NODE_ENV !== "production")) {
  3328. warnRuntimeUsage(`defineExpose`);
  3329. }
  3330. }
  3331. function defineOptions(options) {
  3332. if (!!(process.env.NODE_ENV !== "production")) {
  3333. warnRuntimeUsage(`defineOptions`);
  3334. }
  3335. }
  3336. function defineSlots() {
  3337. if (!!(process.env.NODE_ENV !== "production")) {
  3338. warnRuntimeUsage(`defineSlots`);
  3339. }
  3340. return null;
  3341. }
  3342. function defineModel() {
  3343. if (!!(process.env.NODE_ENV !== "production")) {
  3344. warnRuntimeUsage("defineModel");
  3345. }
  3346. }
  3347. function withDefaults(props, defaults) {
  3348. if (!!(process.env.NODE_ENV !== "production")) {
  3349. warnRuntimeUsage(`withDefaults`);
  3350. }
  3351. return null;
  3352. }
  3353. function useSlots() {
  3354. return getContext("useSlots").slots;
  3355. }
  3356. function useAttrs() {
  3357. return getContext("useAttrs").attrs;
  3358. }
  3359. function getContext(calledFunctionName) {
  3360. const i = getCurrentInstance();
  3361. if (!!(process.env.NODE_ENV !== "production") && !i) {
  3362. warn$1(`${calledFunctionName}() called without active instance.`);
  3363. }
  3364. return i.setupContext || (i.setupContext = createSetupContext(i));
  3365. }
  3366. function normalizePropsOrEmits(props) {
  3367. return isArray(props) ? props.reduce(
  3368. (normalized, p) => (normalized[p] = null, normalized),
  3369. {}
  3370. ) : props;
  3371. }
  3372. function mergeDefaults(raw, defaults) {
  3373. const props = normalizePropsOrEmits(raw);
  3374. for (const key in defaults) {
  3375. if (key.startsWith("__skip")) continue;
  3376. let opt = props[key];
  3377. if (opt) {
  3378. if (isArray(opt) || isFunction(opt)) {
  3379. opt = props[key] = { type: opt, default: defaults[key] };
  3380. } else {
  3381. opt.default = defaults[key];
  3382. }
  3383. } else if (opt === null) {
  3384. opt = props[key] = { default: defaults[key] };
  3385. } else if (!!(process.env.NODE_ENV !== "production")) {
  3386. warn$1(`props default key "${key}" has no corresponding declaration.`);
  3387. }
  3388. if (opt && defaults[`__skip_${key}`]) {
  3389. opt.skipFactory = true;
  3390. }
  3391. }
  3392. return props;
  3393. }
  3394. function mergeModels(a, b) {
  3395. if (!a || !b) return a || b;
  3396. if (isArray(a) && isArray(b)) return a.concat(b);
  3397. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  3398. }
  3399. function createPropsRestProxy(props, excludedKeys) {
  3400. const ret = {};
  3401. for (const key in props) {
  3402. if (!excludedKeys.includes(key)) {
  3403. Object.defineProperty(ret, key, {
  3404. enumerable: true,
  3405. get: () => props[key]
  3406. });
  3407. }
  3408. }
  3409. return ret;
  3410. }
  3411. function withAsyncContext(getAwaitable) {
  3412. const ctx = getCurrentInstance();
  3413. if (!!(process.env.NODE_ENV !== "production") && !ctx) {
  3414. warn$1(
  3415. `withAsyncContext called without active current instance. This is likely a bug.`
  3416. );
  3417. }
  3418. let awaitable = getAwaitable();
  3419. unsetCurrentInstance();
  3420. if (isPromise(awaitable)) {
  3421. awaitable = awaitable.catch((e) => {
  3422. setCurrentInstance(ctx);
  3423. throw e;
  3424. });
  3425. }
  3426. return [awaitable, () => setCurrentInstance(ctx)];
  3427. }
  3428. function createDuplicateChecker() {
  3429. const cache = /* @__PURE__ */ Object.create(null);
  3430. return (type, key) => {
  3431. if (cache[key]) {
  3432. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3433. } else {
  3434. cache[key] = type;
  3435. }
  3436. };
  3437. }
  3438. let shouldCacheAccess = true;
  3439. function applyOptions(instance) {
  3440. const options = resolveMergedOptions(instance);
  3441. const publicThis = instance.proxy;
  3442. const ctx = instance.ctx;
  3443. shouldCacheAccess = false;
  3444. if (options.beforeCreate) {
  3445. callHook(options.beforeCreate, instance, "bc");
  3446. }
  3447. const {
  3448. // state
  3449. data: dataOptions,
  3450. computed: computedOptions,
  3451. methods,
  3452. watch: watchOptions,
  3453. provide: provideOptions,
  3454. inject: injectOptions,
  3455. // lifecycle
  3456. created,
  3457. beforeMount,
  3458. mounted,
  3459. beforeUpdate,
  3460. updated,
  3461. activated,
  3462. deactivated,
  3463. beforeDestroy,
  3464. beforeUnmount,
  3465. destroyed,
  3466. unmounted,
  3467. render,
  3468. renderTracked,
  3469. renderTriggered,
  3470. errorCaptured,
  3471. serverPrefetch,
  3472. // public API
  3473. expose,
  3474. inheritAttrs,
  3475. // assets
  3476. components,
  3477. directives,
  3478. filters
  3479. } = options;
  3480. const checkDuplicateProperties = !!(process.env.NODE_ENV !== "production") ? createDuplicateChecker() : null;
  3481. if (!!(process.env.NODE_ENV !== "production")) {
  3482. const [propsOptions] = instance.propsOptions;
  3483. if (propsOptions) {
  3484. for (const key in propsOptions) {
  3485. checkDuplicateProperties("Props" /* PROPS */, key);
  3486. }
  3487. }
  3488. }
  3489. if (injectOptions) {
  3490. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3491. }
  3492. if (methods) {
  3493. for (const key in methods) {
  3494. const methodHandler = methods[key];
  3495. if (isFunction(methodHandler)) {
  3496. if (!!(process.env.NODE_ENV !== "production")) {
  3497. Object.defineProperty(ctx, key, {
  3498. value: methodHandler.bind(publicThis),
  3499. configurable: true,
  3500. enumerable: true,
  3501. writable: true
  3502. });
  3503. } else {
  3504. ctx[key] = methodHandler.bind(publicThis);
  3505. }
  3506. if (!!(process.env.NODE_ENV !== "production")) {
  3507. checkDuplicateProperties("Methods" /* METHODS */, key);
  3508. }
  3509. } else if (!!(process.env.NODE_ENV !== "production")) {
  3510. warn$1(
  3511. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3512. );
  3513. }
  3514. }
  3515. }
  3516. if (dataOptions) {
  3517. if (!!(process.env.NODE_ENV !== "production") && !isFunction(dataOptions)) {
  3518. warn$1(
  3519. `The data option must be a function. Plain object usage is no longer supported.`
  3520. );
  3521. }
  3522. const data = dataOptions.call(publicThis, publicThis);
  3523. if (!!(process.env.NODE_ENV !== "production") && isPromise(data)) {
  3524. warn$1(
  3525. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3526. );
  3527. }
  3528. if (!isObject(data)) {
  3529. !!(process.env.NODE_ENV !== "production") && warn$1(`data() should return an object.`);
  3530. } else {
  3531. instance.data = reactive(data);
  3532. if (!!(process.env.NODE_ENV !== "production")) {
  3533. for (const key in data) {
  3534. checkDuplicateProperties("Data" /* DATA */, key);
  3535. if (!isReservedPrefix(key[0])) {
  3536. Object.defineProperty(ctx, key, {
  3537. configurable: true,
  3538. enumerable: true,
  3539. get: () => data[key],
  3540. set: NOOP
  3541. });
  3542. }
  3543. }
  3544. }
  3545. }
  3546. }
  3547. shouldCacheAccess = true;
  3548. if (computedOptions) {
  3549. for (const key in computedOptions) {
  3550. const opt = computedOptions[key];
  3551. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3552. if (!!(process.env.NODE_ENV !== "production") && get === NOOP) {
  3553. warn$1(`Computed property "${key}" has no getter.`);
  3554. }
  3555. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : !!(process.env.NODE_ENV !== "production") ? () => {
  3556. warn$1(
  3557. `Write operation failed: computed property "${key}" is readonly.`
  3558. );
  3559. } : NOOP;
  3560. const c = computed({
  3561. get,
  3562. set
  3563. });
  3564. Object.defineProperty(ctx, key, {
  3565. enumerable: true,
  3566. configurable: true,
  3567. get: () => c.value,
  3568. set: (v) => c.value = v
  3569. });
  3570. if (!!(process.env.NODE_ENV !== "production")) {
  3571. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  3572. }
  3573. }
  3574. }
  3575. if (watchOptions) {
  3576. for (const key in watchOptions) {
  3577. createWatcher(watchOptions[key], ctx, publicThis, key);
  3578. }
  3579. }
  3580. if (provideOptions) {
  3581. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3582. Reflect.ownKeys(provides).forEach((key) => {
  3583. provide(key, provides[key]);
  3584. });
  3585. }
  3586. if (created) {
  3587. callHook(created, instance, "c");
  3588. }
  3589. function registerLifecycleHook(register, hook) {
  3590. if (isArray(hook)) {
  3591. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3592. } else if (hook) {
  3593. register(hook.bind(publicThis));
  3594. }
  3595. }
  3596. registerLifecycleHook(onBeforeMount, beforeMount);
  3597. registerLifecycleHook(onMounted, mounted);
  3598. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3599. registerLifecycleHook(onUpdated, updated);
  3600. registerLifecycleHook(onActivated, activated);
  3601. registerLifecycleHook(onDeactivated, deactivated);
  3602. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3603. registerLifecycleHook(onRenderTracked, renderTracked);
  3604. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3605. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3606. registerLifecycleHook(onUnmounted, unmounted);
  3607. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3608. if (isArray(expose)) {
  3609. if (expose.length) {
  3610. const exposed = instance.exposed || (instance.exposed = {});
  3611. expose.forEach((key) => {
  3612. Object.defineProperty(exposed, key, {
  3613. get: () => publicThis[key],
  3614. set: (val) => publicThis[key] = val,
  3615. enumerable: true
  3616. });
  3617. });
  3618. } else if (!instance.exposed) {
  3619. instance.exposed = {};
  3620. }
  3621. }
  3622. if (render && instance.render === NOOP) {
  3623. instance.render = render;
  3624. }
  3625. if (inheritAttrs != null) {
  3626. instance.inheritAttrs = inheritAttrs;
  3627. }
  3628. if (components) instance.components = components;
  3629. if (directives) instance.directives = directives;
  3630. if (serverPrefetch) {
  3631. markAsyncBoundary(instance);
  3632. }
  3633. }
  3634. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3635. if (isArray(injectOptions)) {
  3636. injectOptions = normalizeInject(injectOptions);
  3637. }
  3638. for (const key in injectOptions) {
  3639. const opt = injectOptions[key];
  3640. let injected;
  3641. if (isObject(opt)) {
  3642. if ("default" in opt) {
  3643. injected = inject(
  3644. opt.from || key,
  3645. opt.default,
  3646. true
  3647. );
  3648. } else {
  3649. injected = inject(opt.from || key);
  3650. }
  3651. } else {
  3652. injected = inject(opt);
  3653. }
  3654. if (isRef(injected)) {
  3655. Object.defineProperty(ctx, key, {
  3656. enumerable: true,
  3657. configurable: true,
  3658. get: () => injected.value,
  3659. set: (v) => injected.value = v
  3660. });
  3661. } else {
  3662. ctx[key] = injected;
  3663. }
  3664. if (!!(process.env.NODE_ENV !== "production")) {
  3665. checkDuplicateProperties("Inject" /* INJECT */, key);
  3666. }
  3667. }
  3668. }
  3669. function callHook(hook, instance, type) {
  3670. callWithAsyncErrorHandling(
  3671. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  3672. instance,
  3673. type
  3674. );
  3675. }
  3676. function createWatcher(raw, ctx, publicThis, key) {
  3677. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3678. if (isString(raw)) {
  3679. const handler = ctx[raw];
  3680. if (isFunction(handler)) {
  3681. {
  3682. watch(getter, handler);
  3683. }
  3684. } else if (!!(process.env.NODE_ENV !== "production")) {
  3685. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3686. }
  3687. } else if (isFunction(raw)) {
  3688. {
  3689. watch(getter, raw.bind(publicThis));
  3690. }
  3691. } else if (isObject(raw)) {
  3692. if (isArray(raw)) {
  3693. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3694. } else {
  3695. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3696. if (isFunction(handler)) {
  3697. watch(getter, handler, raw);
  3698. } else if (!!(process.env.NODE_ENV !== "production")) {
  3699. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3700. }
  3701. }
  3702. } else if (!!(process.env.NODE_ENV !== "production")) {
  3703. warn$1(`Invalid watch option: "${key}"`, raw);
  3704. }
  3705. }
  3706. function resolveMergedOptions(instance) {
  3707. const base = instance.type;
  3708. const { mixins, extends: extendsOptions } = base;
  3709. const {
  3710. mixins: globalMixins,
  3711. optionsCache: cache,
  3712. config: { optionMergeStrategies }
  3713. } = instance.appContext;
  3714. const cached = cache.get(base);
  3715. let resolved;
  3716. if (cached) {
  3717. resolved = cached;
  3718. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3719. {
  3720. resolved = base;
  3721. }
  3722. } else {
  3723. resolved = {};
  3724. if (globalMixins.length) {
  3725. globalMixins.forEach(
  3726. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3727. );
  3728. }
  3729. mergeOptions(resolved, base, optionMergeStrategies);
  3730. }
  3731. if (isObject(base)) {
  3732. cache.set(base, resolved);
  3733. }
  3734. return resolved;
  3735. }
  3736. function mergeOptions(to, from, strats, asMixin = false) {
  3737. const { mixins, extends: extendsOptions } = from;
  3738. if (extendsOptions) {
  3739. mergeOptions(to, extendsOptions, strats, true);
  3740. }
  3741. if (mixins) {
  3742. mixins.forEach(
  3743. (m) => mergeOptions(to, m, strats, true)
  3744. );
  3745. }
  3746. for (const key in from) {
  3747. if (asMixin && key === "expose") {
  3748. !!(process.env.NODE_ENV !== "production") && warn$1(
  3749. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3750. );
  3751. } else {
  3752. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3753. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3754. }
  3755. }
  3756. return to;
  3757. }
  3758. const internalOptionMergeStrats = {
  3759. data: mergeDataFn,
  3760. props: mergeEmitsOrPropsOptions,
  3761. emits: mergeEmitsOrPropsOptions,
  3762. // objects
  3763. methods: mergeObjectOptions,
  3764. computed: mergeObjectOptions,
  3765. // lifecycle
  3766. beforeCreate: mergeAsArray,
  3767. created: mergeAsArray,
  3768. beforeMount: mergeAsArray,
  3769. mounted: mergeAsArray,
  3770. beforeUpdate: mergeAsArray,
  3771. updated: mergeAsArray,
  3772. beforeDestroy: mergeAsArray,
  3773. beforeUnmount: mergeAsArray,
  3774. destroyed: mergeAsArray,
  3775. unmounted: mergeAsArray,
  3776. activated: mergeAsArray,
  3777. deactivated: mergeAsArray,
  3778. errorCaptured: mergeAsArray,
  3779. serverPrefetch: mergeAsArray,
  3780. // assets
  3781. components: mergeObjectOptions,
  3782. directives: mergeObjectOptions,
  3783. // watch
  3784. watch: mergeWatchOptions,
  3785. // provide / inject
  3786. provide: mergeDataFn,
  3787. inject: mergeInject
  3788. };
  3789. function mergeDataFn(to, from) {
  3790. if (!from) {
  3791. return to;
  3792. }
  3793. if (!to) {
  3794. return from;
  3795. }
  3796. return function mergedDataFn() {
  3797. return (extend)(
  3798. isFunction(to) ? to.call(this, this) : to,
  3799. isFunction(from) ? from.call(this, this) : from
  3800. );
  3801. };
  3802. }
  3803. function mergeInject(to, from) {
  3804. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3805. }
  3806. function normalizeInject(raw) {
  3807. if (isArray(raw)) {
  3808. const res = {};
  3809. for (let i = 0; i < raw.length; i++) {
  3810. res[raw[i]] = raw[i];
  3811. }
  3812. return res;
  3813. }
  3814. return raw;
  3815. }
  3816. function mergeAsArray(to, from) {
  3817. return to ? [...new Set([].concat(to, from))] : from;
  3818. }
  3819. function mergeObjectOptions(to, from) {
  3820. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3821. }
  3822. function mergeEmitsOrPropsOptions(to, from) {
  3823. if (to) {
  3824. if (isArray(to) && isArray(from)) {
  3825. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3826. }
  3827. return extend(
  3828. /* @__PURE__ */ Object.create(null),
  3829. normalizePropsOrEmits(to),
  3830. normalizePropsOrEmits(from != null ? from : {})
  3831. );
  3832. } else {
  3833. return from;
  3834. }
  3835. }
  3836. function mergeWatchOptions(to, from) {
  3837. if (!to) return from;
  3838. if (!from) return to;
  3839. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3840. for (const key in from) {
  3841. merged[key] = mergeAsArray(to[key], from[key]);
  3842. }
  3843. return merged;
  3844. }
  3845. function createAppContext() {
  3846. return {
  3847. app: null,
  3848. config: {
  3849. isNativeTag: NO,
  3850. performance: false,
  3851. globalProperties: {},
  3852. optionMergeStrategies: {},
  3853. errorHandler: void 0,
  3854. warnHandler: void 0,
  3855. compilerOptions: {}
  3856. },
  3857. mixins: [],
  3858. components: {},
  3859. directives: {},
  3860. provides: /* @__PURE__ */ Object.create(null),
  3861. optionsCache: /* @__PURE__ */ new WeakMap(),
  3862. propsCache: /* @__PURE__ */ new WeakMap(),
  3863. emitsCache: /* @__PURE__ */ new WeakMap()
  3864. };
  3865. }
  3866. let uid$1 = 0;
  3867. function createAppAPI(render, hydrate) {
  3868. return function createApp(rootComponent, rootProps = null) {
  3869. if (!isFunction(rootComponent)) {
  3870. rootComponent = extend({}, rootComponent);
  3871. }
  3872. if (rootProps != null && !isObject(rootProps)) {
  3873. !!(process.env.NODE_ENV !== "production") && warn$1(`root props passed to app.mount() must be an object.`);
  3874. rootProps = null;
  3875. }
  3876. const context = createAppContext();
  3877. const installedPlugins = /* @__PURE__ */ new WeakSet();
  3878. const pluginCleanupFns = [];
  3879. let isMounted = false;
  3880. const app = context.app = {
  3881. _uid: uid$1++,
  3882. _component: rootComponent,
  3883. _props: rootProps,
  3884. _container: null,
  3885. _context: context,
  3886. _instance: null,
  3887. version,
  3888. get config() {
  3889. return context.config;
  3890. },
  3891. set config(v) {
  3892. if (!!(process.env.NODE_ENV !== "production")) {
  3893. warn$1(
  3894. `app.config cannot be replaced. Modify individual options instead.`
  3895. );
  3896. }
  3897. },
  3898. use(plugin, ...options) {
  3899. if (installedPlugins.has(plugin)) {
  3900. !!(process.env.NODE_ENV !== "production") && warn$1(`Plugin has already been applied to target app.`);
  3901. } else if (plugin && isFunction(plugin.install)) {
  3902. installedPlugins.add(plugin);
  3903. plugin.install(app, ...options);
  3904. } else if (isFunction(plugin)) {
  3905. installedPlugins.add(plugin);
  3906. plugin(app, ...options);
  3907. } else if (!!(process.env.NODE_ENV !== "production")) {
  3908. warn$1(
  3909. `A plugin must either be a function or an object with an "install" function.`
  3910. );
  3911. }
  3912. return app;
  3913. },
  3914. mixin(mixin) {
  3915. if (__VUE_OPTIONS_API__) {
  3916. if (!context.mixins.includes(mixin)) {
  3917. context.mixins.push(mixin);
  3918. } else if (!!(process.env.NODE_ENV !== "production")) {
  3919. warn$1(
  3920. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  3921. );
  3922. }
  3923. } else if (!!(process.env.NODE_ENV !== "production")) {
  3924. warn$1("Mixins are only available in builds supporting Options API");
  3925. }
  3926. return app;
  3927. },
  3928. component(name, component) {
  3929. if (!!(process.env.NODE_ENV !== "production")) {
  3930. validateComponentName(name, context.config);
  3931. }
  3932. if (!component) {
  3933. return context.components[name];
  3934. }
  3935. if (!!(process.env.NODE_ENV !== "production") && context.components[name]) {
  3936. warn$1(`Component "${name}" has already been registered in target app.`);
  3937. }
  3938. context.components[name] = component;
  3939. return app;
  3940. },
  3941. directive(name, directive) {
  3942. if (!!(process.env.NODE_ENV !== "production")) {
  3943. validateDirectiveName(name);
  3944. }
  3945. if (!directive) {
  3946. return context.directives[name];
  3947. }
  3948. if (!!(process.env.NODE_ENV !== "production") && context.directives[name]) {
  3949. warn$1(`Directive "${name}" has already been registered in target app.`);
  3950. }
  3951. context.directives[name] = directive;
  3952. return app;
  3953. },
  3954. mount(rootContainer, isHydrate, namespace) {
  3955. if (!isMounted) {
  3956. if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) {
  3957. warn$1(
  3958. `There is already an app instance mounted on the host container.
  3959. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  3960. );
  3961. }
  3962. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  3963. vnode.appContext = context;
  3964. if (namespace === true) {
  3965. namespace = "svg";
  3966. } else if (namespace === false) {
  3967. namespace = void 0;
  3968. }
  3969. if (!!(process.env.NODE_ENV !== "production")) {
  3970. context.reload = () => {
  3971. const cloned = cloneVNode(vnode);
  3972. cloned.el = null;
  3973. render(cloned, rootContainer, namespace);
  3974. };
  3975. }
  3976. if (isHydrate && hydrate) {
  3977. hydrate(vnode, rootContainer);
  3978. } else {
  3979. render(vnode, rootContainer, namespace);
  3980. }
  3981. isMounted = true;
  3982. app._container = rootContainer;
  3983. rootContainer.__vue_app__ = app;
  3984. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  3985. app._instance = vnode.component;
  3986. devtoolsInitApp(app, version);
  3987. }
  3988. return getComponentPublicInstance(vnode.component);
  3989. } else if (!!(process.env.NODE_ENV !== "production")) {
  3990. warn$1(
  3991. `App has already been mounted.
  3992. 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)\``
  3993. );
  3994. }
  3995. },
  3996. onUnmount(cleanupFn) {
  3997. if (!!(process.env.NODE_ENV !== "production") && typeof cleanupFn !== "function") {
  3998. warn$1(
  3999. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  4000. );
  4001. }
  4002. pluginCleanupFns.push(cleanupFn);
  4003. },
  4004. unmount() {
  4005. if (isMounted) {
  4006. callWithAsyncErrorHandling(
  4007. pluginCleanupFns,
  4008. app._instance,
  4009. 16
  4010. );
  4011. render(null, app._container);
  4012. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4013. app._instance = null;
  4014. devtoolsUnmountApp(app);
  4015. }
  4016. delete app._container.__vue_app__;
  4017. } else if (!!(process.env.NODE_ENV !== "production")) {
  4018. warn$1(`Cannot unmount an app that is not mounted.`);
  4019. }
  4020. },
  4021. provide(key, value) {
  4022. if (!!(process.env.NODE_ENV !== "production") && key in context.provides) {
  4023. if (hasOwn(context.provides, key)) {
  4024. warn$1(
  4025. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  4026. );
  4027. } else {
  4028. warn$1(
  4029. `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
  4030. );
  4031. }
  4032. }
  4033. context.provides[key] = value;
  4034. return app;
  4035. },
  4036. runWithContext(fn) {
  4037. const lastApp = currentApp;
  4038. currentApp = app;
  4039. try {
  4040. return fn();
  4041. } finally {
  4042. currentApp = lastApp;
  4043. }
  4044. }
  4045. };
  4046. return app;
  4047. };
  4048. }
  4049. let currentApp = null;
  4050. function provide(key, value) {
  4051. if (!currentInstance) {
  4052. if (!!(process.env.NODE_ENV !== "production")) {
  4053. warn$1(`provide() can only be used inside setup().`);
  4054. }
  4055. } else {
  4056. let provides = currentInstance.provides;
  4057. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  4058. if (parentProvides === provides) {
  4059. provides = currentInstance.provides = Object.create(parentProvides);
  4060. }
  4061. provides[key] = value;
  4062. }
  4063. }
  4064. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  4065. const instance = getCurrentInstance();
  4066. if (instance || currentApp) {
  4067. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  4068. if (provides && key in provides) {
  4069. return provides[key];
  4070. } else if (arguments.length > 1) {
  4071. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  4072. } else if (!!(process.env.NODE_ENV !== "production")) {
  4073. warn$1(`injection "${String(key)}" not found.`);
  4074. }
  4075. } else if (!!(process.env.NODE_ENV !== "production")) {
  4076. warn$1(`inject() can only be used inside setup() or functional components.`);
  4077. }
  4078. }
  4079. function hasInjectionContext() {
  4080. return !!(getCurrentInstance() || currentApp);
  4081. }
  4082. const internalObjectProto = {};
  4083. const createInternalObject = () => Object.create(internalObjectProto);
  4084. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  4085. function initProps(instance, rawProps, isStateful, isSSR = false) {
  4086. const props = {};
  4087. const attrs = createInternalObject();
  4088. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4089. setFullProps(instance, rawProps, props, attrs);
  4090. for (const key in instance.propsOptions[0]) {
  4091. if (!(key in props)) {
  4092. props[key] = void 0;
  4093. }
  4094. }
  4095. if (!!(process.env.NODE_ENV !== "production")) {
  4096. validateProps(rawProps || {}, props, instance);
  4097. }
  4098. if (isStateful) {
  4099. instance.props = isSSR ? props : shallowReactive(props);
  4100. } else {
  4101. if (!instance.type.props) {
  4102. instance.props = attrs;
  4103. } else {
  4104. instance.props = props;
  4105. }
  4106. }
  4107. instance.attrs = attrs;
  4108. }
  4109. function isInHmrContext(instance) {
  4110. while (instance) {
  4111. if (instance.type.__hmrId) return true;
  4112. instance = instance.parent;
  4113. }
  4114. }
  4115. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4116. const {
  4117. props,
  4118. attrs,
  4119. vnode: { patchFlag }
  4120. } = instance;
  4121. const rawCurrentProps = toRaw(props);
  4122. const [options] = instance.propsOptions;
  4123. let hasAttrsChanged = false;
  4124. if (
  4125. // always force full diff in dev
  4126. // - #1942 if hmr is enabled with sfc component
  4127. // - vite#872 non-sfc component used by sfc component
  4128. !(!!(process.env.NODE_ENV !== "production") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4129. ) {
  4130. if (patchFlag & 8) {
  4131. const propsToUpdate = instance.vnode.dynamicProps;
  4132. for (let i = 0; i < propsToUpdate.length; i++) {
  4133. let key = propsToUpdate[i];
  4134. if (isEmitListener(instance.emitsOptions, key)) {
  4135. continue;
  4136. }
  4137. const value = rawProps[key];
  4138. if (options) {
  4139. if (hasOwn(attrs, key)) {
  4140. if (value !== attrs[key]) {
  4141. attrs[key] = value;
  4142. hasAttrsChanged = true;
  4143. }
  4144. } else {
  4145. const camelizedKey = camelize(key);
  4146. props[camelizedKey] = resolvePropValue(
  4147. options,
  4148. rawCurrentProps,
  4149. camelizedKey,
  4150. value,
  4151. instance,
  4152. false
  4153. );
  4154. }
  4155. } else {
  4156. if (value !== attrs[key]) {
  4157. attrs[key] = value;
  4158. hasAttrsChanged = true;
  4159. }
  4160. }
  4161. }
  4162. }
  4163. } else {
  4164. if (setFullProps(instance, rawProps, props, attrs)) {
  4165. hasAttrsChanged = true;
  4166. }
  4167. let kebabKey;
  4168. for (const key in rawCurrentProps) {
  4169. if (!rawProps || // for camelCase
  4170. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4171. // and converted to camelCase (#955)
  4172. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  4173. if (options) {
  4174. if (rawPrevProps && // for camelCase
  4175. (rawPrevProps[key] !== void 0 || // for kebab-case
  4176. rawPrevProps[kebabKey] !== void 0)) {
  4177. props[key] = resolvePropValue(
  4178. options,
  4179. rawCurrentProps,
  4180. key,
  4181. void 0,
  4182. instance,
  4183. true
  4184. );
  4185. }
  4186. } else {
  4187. delete props[key];
  4188. }
  4189. }
  4190. }
  4191. if (attrs !== rawCurrentProps) {
  4192. for (const key in attrs) {
  4193. if (!rawProps || !hasOwn(rawProps, key) && true) {
  4194. delete attrs[key];
  4195. hasAttrsChanged = true;
  4196. }
  4197. }
  4198. }
  4199. }
  4200. if (hasAttrsChanged) {
  4201. trigger(instance.attrs, "set", "");
  4202. }
  4203. if (!!(process.env.NODE_ENV !== "production")) {
  4204. validateProps(rawProps || {}, props, instance);
  4205. }
  4206. }
  4207. function setFullProps(instance, rawProps, props, attrs) {
  4208. const [options, needCastKeys] = instance.propsOptions;
  4209. let hasAttrsChanged = false;
  4210. let rawCastValues;
  4211. if (rawProps) {
  4212. for (let key in rawProps) {
  4213. if (isReservedProp(key)) {
  4214. continue;
  4215. }
  4216. const value = rawProps[key];
  4217. let camelKey;
  4218. if (options && hasOwn(options, camelKey = camelize(key))) {
  4219. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4220. props[camelKey] = value;
  4221. } else {
  4222. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4223. }
  4224. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4225. if (!(key in attrs) || value !== attrs[key]) {
  4226. attrs[key] = value;
  4227. hasAttrsChanged = true;
  4228. }
  4229. }
  4230. }
  4231. }
  4232. if (needCastKeys) {
  4233. const rawCurrentProps = toRaw(props);
  4234. const castValues = rawCastValues || EMPTY_OBJ;
  4235. for (let i = 0; i < needCastKeys.length; i++) {
  4236. const key = needCastKeys[i];
  4237. props[key] = resolvePropValue(
  4238. options,
  4239. rawCurrentProps,
  4240. key,
  4241. castValues[key],
  4242. instance,
  4243. !hasOwn(castValues, key)
  4244. );
  4245. }
  4246. }
  4247. return hasAttrsChanged;
  4248. }
  4249. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4250. const opt = options[key];
  4251. if (opt != null) {
  4252. const hasDefault = hasOwn(opt, "default");
  4253. if (hasDefault && value === void 0) {
  4254. const defaultValue = opt.default;
  4255. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  4256. const { propsDefaults } = instance;
  4257. if (key in propsDefaults) {
  4258. value = propsDefaults[key];
  4259. } else {
  4260. const reset = setCurrentInstance(instance);
  4261. value = propsDefaults[key] = defaultValue.call(
  4262. null,
  4263. props
  4264. );
  4265. reset();
  4266. }
  4267. } else {
  4268. value = defaultValue;
  4269. }
  4270. if (instance.ce) {
  4271. instance.ce._setProp(key, value);
  4272. }
  4273. }
  4274. if (opt[0 /* shouldCast */]) {
  4275. if (isAbsent && !hasDefault) {
  4276. value = false;
  4277. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  4278. value = true;
  4279. }
  4280. }
  4281. }
  4282. return value;
  4283. }
  4284. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  4285. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4286. const cache = __VUE_OPTIONS_API__ && asMixin ? mixinPropsCache : appContext.propsCache;
  4287. const cached = cache.get(comp);
  4288. if (cached) {
  4289. return cached;
  4290. }
  4291. const raw = comp.props;
  4292. const normalized = {};
  4293. const needCastKeys = [];
  4294. let hasExtends = false;
  4295. if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
  4296. const extendProps = (raw2) => {
  4297. hasExtends = true;
  4298. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4299. extend(normalized, props);
  4300. if (keys) needCastKeys.push(...keys);
  4301. };
  4302. if (!asMixin && appContext.mixins.length) {
  4303. appContext.mixins.forEach(extendProps);
  4304. }
  4305. if (comp.extends) {
  4306. extendProps(comp.extends);
  4307. }
  4308. if (comp.mixins) {
  4309. comp.mixins.forEach(extendProps);
  4310. }
  4311. }
  4312. if (!raw && !hasExtends) {
  4313. if (isObject(comp)) {
  4314. cache.set(comp, EMPTY_ARR);
  4315. }
  4316. return EMPTY_ARR;
  4317. }
  4318. if (isArray(raw)) {
  4319. for (let i = 0; i < raw.length; i++) {
  4320. if (!!(process.env.NODE_ENV !== "production") && !isString(raw[i])) {
  4321. warn$1(`props must be strings when using array syntax.`, raw[i]);
  4322. }
  4323. const normalizedKey = camelize(raw[i]);
  4324. if (validatePropName(normalizedKey)) {
  4325. normalized[normalizedKey] = EMPTY_OBJ;
  4326. }
  4327. }
  4328. } else if (raw) {
  4329. if (!!(process.env.NODE_ENV !== "production") && !isObject(raw)) {
  4330. warn$1(`invalid props options`, raw);
  4331. }
  4332. for (const key in raw) {
  4333. const normalizedKey = camelize(key);
  4334. if (validatePropName(normalizedKey)) {
  4335. const opt = raw[key];
  4336. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  4337. const propType = prop.type;
  4338. let shouldCast = false;
  4339. let shouldCastTrue = true;
  4340. if (isArray(propType)) {
  4341. for (let index = 0; index < propType.length; ++index) {
  4342. const type = propType[index];
  4343. const typeName = isFunction(type) && type.name;
  4344. if (typeName === "Boolean") {
  4345. shouldCast = true;
  4346. break;
  4347. } else if (typeName === "String") {
  4348. shouldCastTrue = false;
  4349. }
  4350. }
  4351. } else {
  4352. shouldCast = isFunction(propType) && propType.name === "Boolean";
  4353. }
  4354. prop[0 /* shouldCast */] = shouldCast;
  4355. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  4356. if (shouldCast || hasOwn(prop, "default")) {
  4357. needCastKeys.push(normalizedKey);
  4358. }
  4359. }
  4360. }
  4361. }
  4362. const res = [normalized, needCastKeys];
  4363. if (isObject(comp)) {
  4364. cache.set(comp, res);
  4365. }
  4366. return res;
  4367. }
  4368. function validatePropName(key) {
  4369. if (key[0] !== "$" && !isReservedProp(key)) {
  4370. return true;
  4371. } else if (!!(process.env.NODE_ENV !== "production")) {
  4372. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  4373. }
  4374. return false;
  4375. }
  4376. function getType(ctor) {
  4377. if (ctor === null) {
  4378. return "null";
  4379. }
  4380. if (typeof ctor === "function") {
  4381. return ctor.name || "";
  4382. } else if (typeof ctor === "object") {
  4383. const name = ctor.constructor && ctor.constructor.name;
  4384. return name || "";
  4385. }
  4386. return "";
  4387. }
  4388. function validateProps(rawProps, props, instance) {
  4389. const resolvedValues = toRaw(props);
  4390. const options = instance.propsOptions[0];
  4391. const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
  4392. for (const key in options) {
  4393. let opt = options[key];
  4394. if (opt == null) continue;
  4395. validateProp(
  4396. key,
  4397. resolvedValues[key],
  4398. opt,
  4399. !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
  4400. !camelizePropsKey.includes(key)
  4401. );
  4402. }
  4403. }
  4404. function validateProp(name, value, prop, props, isAbsent) {
  4405. const { type, required, validator, skipCheck } = prop;
  4406. if (required && isAbsent) {
  4407. warn$1('Missing required prop: "' + name + '"');
  4408. return;
  4409. }
  4410. if (value == null && !required) {
  4411. return;
  4412. }
  4413. if (type != null && type !== true && !skipCheck) {
  4414. let isValid = false;
  4415. const types = isArray(type) ? type : [type];
  4416. const expectedTypes = [];
  4417. for (let i = 0; i < types.length && !isValid; i++) {
  4418. const { valid, expectedType } = assertType(value, types[i]);
  4419. expectedTypes.push(expectedType || "");
  4420. isValid = valid;
  4421. }
  4422. if (!isValid) {
  4423. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  4424. return;
  4425. }
  4426. }
  4427. if (validator && !validator(value, props)) {
  4428. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  4429. }
  4430. }
  4431. const isSimpleType = /* @__PURE__ */ makeMap(
  4432. "String,Number,Boolean,Function,Symbol,BigInt"
  4433. );
  4434. function assertType(value, type) {
  4435. let valid;
  4436. const expectedType = getType(type);
  4437. if (expectedType === "null") {
  4438. valid = value === null;
  4439. } else if (isSimpleType(expectedType)) {
  4440. const t = typeof value;
  4441. valid = t === expectedType.toLowerCase();
  4442. if (!valid && t === "object") {
  4443. valid = value instanceof type;
  4444. }
  4445. } else if (expectedType === "Object") {
  4446. valid = isObject(value);
  4447. } else if (expectedType === "Array") {
  4448. valid = isArray(value);
  4449. } else {
  4450. valid = value instanceof type;
  4451. }
  4452. return {
  4453. valid,
  4454. expectedType
  4455. };
  4456. }
  4457. function getInvalidTypeMessage(name, value, expectedTypes) {
  4458. if (expectedTypes.length === 0) {
  4459. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  4460. }
  4461. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4462. const expectedType = expectedTypes[0];
  4463. const receivedType = toRawType(value);
  4464. const expectedValue = styleValue(value, expectedType);
  4465. const receivedValue = styleValue(value, receivedType);
  4466. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4467. message += ` with value ${expectedValue}`;
  4468. }
  4469. message += `, got ${receivedType} `;
  4470. if (isExplicable(receivedType)) {
  4471. message += `with value ${receivedValue}.`;
  4472. }
  4473. return message;
  4474. }
  4475. function styleValue(value, type) {
  4476. if (type === "String") {
  4477. return `"${value}"`;
  4478. } else if (type === "Number") {
  4479. return `${Number(value)}`;
  4480. } else {
  4481. return `${value}`;
  4482. }
  4483. }
  4484. function isExplicable(type) {
  4485. const explicitTypes = ["string", "number", "boolean"];
  4486. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4487. }
  4488. function isBoolean(...args) {
  4489. return args.some((elem) => elem.toLowerCase() === "boolean");
  4490. }
  4491. const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
  4492. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  4493. const normalizeSlot = (key, rawSlot, ctx) => {
  4494. if (rawSlot._n) {
  4495. return rawSlot;
  4496. }
  4497. const normalized = withCtx((...args) => {
  4498. if (!!(process.env.NODE_ENV !== "production") && currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
  4499. warn$1(
  4500. `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.`
  4501. );
  4502. }
  4503. return normalizeSlotValue(rawSlot(...args));
  4504. }, ctx);
  4505. normalized._c = false;
  4506. return normalized;
  4507. };
  4508. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  4509. const ctx = rawSlots._ctx;
  4510. for (const key in rawSlots) {
  4511. if (isInternalKey(key)) continue;
  4512. const value = rawSlots[key];
  4513. if (isFunction(value)) {
  4514. slots[key] = normalizeSlot(key, value, ctx);
  4515. } else if (value != null) {
  4516. if (!!(process.env.NODE_ENV !== "production") && true) {
  4517. warn$1(
  4518. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  4519. );
  4520. }
  4521. const normalized = normalizeSlotValue(value);
  4522. slots[key] = () => normalized;
  4523. }
  4524. }
  4525. };
  4526. const normalizeVNodeSlots = (instance, children) => {
  4527. if (!!(process.env.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) {
  4528. warn$1(
  4529. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  4530. );
  4531. }
  4532. const normalized = normalizeSlotValue(children);
  4533. instance.slots.default = () => normalized;
  4534. };
  4535. const assignSlots = (slots, children, optimized) => {
  4536. for (const key in children) {
  4537. if (optimized || !isInternalKey(key)) {
  4538. slots[key] = children[key];
  4539. }
  4540. }
  4541. };
  4542. const initSlots = (instance, children, optimized) => {
  4543. const slots = instance.slots = createInternalObject();
  4544. if (instance.vnode.shapeFlag & 32) {
  4545. const type = children._;
  4546. if (type) {
  4547. assignSlots(slots, children, optimized);
  4548. if (optimized) {
  4549. def(slots, "_", type, true);
  4550. }
  4551. } else {
  4552. normalizeObjectSlots(children, slots);
  4553. }
  4554. } else if (children) {
  4555. normalizeVNodeSlots(instance, children);
  4556. }
  4557. };
  4558. const updateSlots = (instance, children, optimized) => {
  4559. const { vnode, slots } = instance;
  4560. let needDeletionCheck = true;
  4561. let deletionComparisonTarget = EMPTY_OBJ;
  4562. if (vnode.shapeFlag & 32) {
  4563. const type = children._;
  4564. if (type) {
  4565. if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
  4566. assignSlots(slots, children, optimized);
  4567. trigger(instance, "set", "$slots");
  4568. } else if (optimized && type === 1) {
  4569. needDeletionCheck = false;
  4570. } else {
  4571. assignSlots(slots, children, optimized);
  4572. }
  4573. } else {
  4574. needDeletionCheck = !children.$stable;
  4575. normalizeObjectSlots(children, slots);
  4576. }
  4577. deletionComparisonTarget = children;
  4578. } else if (children) {
  4579. normalizeVNodeSlots(instance, children);
  4580. deletionComparisonTarget = { default: 1 };
  4581. }
  4582. if (needDeletionCheck) {
  4583. for (const key in slots) {
  4584. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  4585. delete slots[key];
  4586. }
  4587. }
  4588. }
  4589. };
  4590. let supported;
  4591. let perf;
  4592. function startMeasure(instance, type) {
  4593. if (instance.appContext.config.performance && isSupported()) {
  4594. perf.mark(`vue-${type}-${instance.uid}`);
  4595. }
  4596. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4597. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  4598. }
  4599. }
  4600. function endMeasure(instance, type) {
  4601. if (instance.appContext.config.performance && isSupported()) {
  4602. const startTag = `vue-${type}-${instance.uid}`;
  4603. const endTag = startTag + `:end`;
  4604. const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
  4605. perf.mark(endTag);
  4606. perf.measure(measureName, startTag, endTag);
  4607. perf.clearMeasures(measureName);
  4608. perf.clearMarks(startTag);
  4609. perf.clearMarks(endTag);
  4610. }
  4611. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4612. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  4613. }
  4614. }
  4615. function isSupported() {
  4616. if (supported !== void 0) {
  4617. return supported;
  4618. }
  4619. if (typeof window !== "undefined" && window.performance) {
  4620. supported = true;
  4621. perf = window.performance;
  4622. } else {
  4623. supported = false;
  4624. }
  4625. return supported;
  4626. }
  4627. function initFeatureFlags() {
  4628. const needWarn = [];
  4629. if (typeof __VUE_OPTIONS_API__ !== "boolean") {
  4630. !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_OPTIONS_API__`);
  4631. getGlobalThis().__VUE_OPTIONS_API__ = true;
  4632. }
  4633. if (typeof __VUE_PROD_DEVTOOLS__ !== "boolean") {
  4634. !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
  4635. getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
  4636. }
  4637. if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
  4638. !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
  4639. getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
  4640. }
  4641. if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
  4642. const multi = needWarn.length > 1;
  4643. console.warn(
  4644. `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.
  4645. For more details, see https://link.vuejs.org/feature-flags.`
  4646. );
  4647. }
  4648. }
  4649. const queuePostRenderEffect = queueEffectWithSuspense ;
  4650. function createRenderer(options) {
  4651. return baseCreateRenderer(options);
  4652. }
  4653. function createHydrationRenderer(options) {
  4654. return baseCreateRenderer(options, createHydrationFunctions);
  4655. }
  4656. function baseCreateRenderer(options, createHydrationFns) {
  4657. {
  4658. initFeatureFlags();
  4659. }
  4660. const target = getGlobalThis();
  4661. target.__VUE__ = true;
  4662. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4663. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  4664. }
  4665. const {
  4666. insert: hostInsert,
  4667. remove: hostRemove,
  4668. patchProp: hostPatchProp,
  4669. createElement: hostCreateElement,
  4670. createText: hostCreateText,
  4671. createComment: hostCreateComment,
  4672. setText: hostSetText,
  4673. setElementText: hostSetElementText,
  4674. parentNode: hostParentNode,
  4675. nextSibling: hostNextSibling,
  4676. setScopeId: hostSetScopeId = NOOP,
  4677. insertStaticContent: hostInsertStaticContent
  4678. } = options;
  4679. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
  4680. if (n1 === n2) {
  4681. return;
  4682. }
  4683. if (n1 && !isSameVNodeType(n1, n2)) {
  4684. anchor = getNextHostNode(n1);
  4685. unmount(n1, parentComponent, parentSuspense, true);
  4686. n1 = null;
  4687. }
  4688. if (n2.patchFlag === -2) {
  4689. optimized = false;
  4690. n2.dynamicChildren = null;
  4691. }
  4692. const { type, ref, shapeFlag } = n2;
  4693. switch (type) {
  4694. case Text:
  4695. processText(n1, n2, container, anchor);
  4696. break;
  4697. case Comment:
  4698. processCommentNode(n1, n2, container, anchor);
  4699. break;
  4700. case Static:
  4701. if (n1 == null) {
  4702. mountStaticNode(n2, container, anchor, namespace);
  4703. } else if (!!(process.env.NODE_ENV !== "production")) {
  4704. patchStaticNode(n1, n2, container, namespace);
  4705. }
  4706. break;
  4707. case Fragment:
  4708. processFragment(
  4709. n1,
  4710. n2,
  4711. container,
  4712. anchor,
  4713. parentComponent,
  4714. parentSuspense,
  4715. namespace,
  4716. slotScopeIds,
  4717. optimized
  4718. );
  4719. break;
  4720. default:
  4721. if (shapeFlag & 1) {
  4722. processElement(
  4723. n1,
  4724. n2,
  4725. container,
  4726. anchor,
  4727. parentComponent,
  4728. parentSuspense,
  4729. namespace,
  4730. slotScopeIds,
  4731. optimized
  4732. );
  4733. } else if (shapeFlag & 6) {
  4734. processComponent(
  4735. n1,
  4736. n2,
  4737. container,
  4738. anchor,
  4739. parentComponent,
  4740. parentSuspense,
  4741. namespace,
  4742. slotScopeIds,
  4743. optimized
  4744. );
  4745. } else if (shapeFlag & 64) {
  4746. type.process(
  4747. n1,
  4748. n2,
  4749. container,
  4750. anchor,
  4751. parentComponent,
  4752. parentSuspense,
  4753. namespace,
  4754. slotScopeIds,
  4755. optimized,
  4756. internals
  4757. );
  4758. } else if (shapeFlag & 128) {
  4759. type.process(
  4760. n1,
  4761. n2,
  4762. container,
  4763. anchor,
  4764. parentComponent,
  4765. parentSuspense,
  4766. namespace,
  4767. slotScopeIds,
  4768. optimized,
  4769. internals
  4770. );
  4771. } else if (!!(process.env.NODE_ENV !== "production")) {
  4772. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  4773. }
  4774. }
  4775. if (ref != null && parentComponent) {
  4776. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  4777. } else if (ref == null && n1 && n1.ref != null) {
  4778. setRef(n1.ref, null, parentSuspense, n1, true);
  4779. }
  4780. };
  4781. const processText = (n1, n2, container, anchor) => {
  4782. if (n1 == null) {
  4783. hostInsert(
  4784. n2.el = hostCreateText(n2.children),
  4785. container,
  4786. anchor
  4787. );
  4788. } else {
  4789. const el = n2.el = n1.el;
  4790. if (n2.children !== n1.children) {
  4791. hostSetText(el, n2.children);
  4792. }
  4793. }
  4794. };
  4795. const processCommentNode = (n1, n2, container, anchor) => {
  4796. if (n1 == null) {
  4797. hostInsert(
  4798. n2.el = hostCreateComment(n2.children || ""),
  4799. container,
  4800. anchor
  4801. );
  4802. } else {
  4803. n2.el = n1.el;
  4804. }
  4805. };
  4806. const mountStaticNode = (n2, container, anchor, namespace) => {
  4807. [n2.el, n2.anchor] = hostInsertStaticContent(
  4808. n2.children,
  4809. container,
  4810. anchor,
  4811. namespace,
  4812. n2.el,
  4813. n2.anchor
  4814. );
  4815. };
  4816. const patchStaticNode = (n1, n2, container, namespace) => {
  4817. if (n2.children !== n1.children) {
  4818. const anchor = hostNextSibling(n1.anchor);
  4819. removeStaticNode(n1);
  4820. [n2.el, n2.anchor] = hostInsertStaticContent(
  4821. n2.children,
  4822. container,
  4823. anchor,
  4824. namespace
  4825. );
  4826. } else {
  4827. n2.el = n1.el;
  4828. n2.anchor = n1.anchor;
  4829. }
  4830. };
  4831. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  4832. let next;
  4833. while (el && el !== anchor) {
  4834. next = hostNextSibling(el);
  4835. hostInsert(el, container, nextSibling);
  4836. el = next;
  4837. }
  4838. hostInsert(anchor, container, nextSibling);
  4839. };
  4840. const removeStaticNode = ({ el, anchor }) => {
  4841. let next;
  4842. while (el && el !== anchor) {
  4843. next = hostNextSibling(el);
  4844. hostRemove(el);
  4845. el = next;
  4846. }
  4847. hostRemove(anchor);
  4848. };
  4849. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4850. if (n2.type === "svg") {
  4851. namespace = "svg";
  4852. } else if (n2.type === "math") {
  4853. namespace = "mathml";
  4854. }
  4855. if (n1 == null) {
  4856. mountElement(
  4857. n2,
  4858. container,
  4859. anchor,
  4860. parentComponent,
  4861. parentSuspense,
  4862. namespace,
  4863. slotScopeIds,
  4864. optimized
  4865. );
  4866. } else {
  4867. patchElement(
  4868. n1,
  4869. n2,
  4870. parentComponent,
  4871. parentSuspense,
  4872. namespace,
  4873. slotScopeIds,
  4874. optimized
  4875. );
  4876. }
  4877. };
  4878. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4879. let el;
  4880. let vnodeHook;
  4881. const { props, shapeFlag, transition, dirs } = vnode;
  4882. el = vnode.el = hostCreateElement(
  4883. vnode.type,
  4884. namespace,
  4885. props && props.is,
  4886. props
  4887. );
  4888. if (shapeFlag & 8) {
  4889. hostSetElementText(el, vnode.children);
  4890. } else if (shapeFlag & 16) {
  4891. mountChildren(
  4892. vnode.children,
  4893. el,
  4894. null,
  4895. parentComponent,
  4896. parentSuspense,
  4897. resolveChildrenNamespace(vnode, namespace),
  4898. slotScopeIds,
  4899. optimized
  4900. );
  4901. }
  4902. if (dirs) {
  4903. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4904. }
  4905. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  4906. if (props) {
  4907. for (const key in props) {
  4908. if (key !== "value" && !isReservedProp(key)) {
  4909. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  4910. }
  4911. }
  4912. if ("value" in props) {
  4913. hostPatchProp(el, "value", null, props.value, namespace);
  4914. }
  4915. if (vnodeHook = props.onVnodeBeforeMount) {
  4916. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4917. }
  4918. }
  4919. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4920. def(el, "__vnode", vnode, true);
  4921. def(el, "__vueParentComponent", parentComponent, true);
  4922. }
  4923. if (dirs) {
  4924. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4925. }
  4926. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  4927. if (needCallTransitionHooks) {
  4928. transition.beforeEnter(el);
  4929. }
  4930. hostInsert(el, container, anchor);
  4931. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  4932. queuePostRenderEffect(() => {
  4933. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4934. needCallTransitionHooks && transition.enter(el);
  4935. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4936. }, parentSuspense);
  4937. }
  4938. };
  4939. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  4940. if (scopeId) {
  4941. hostSetScopeId(el, scopeId);
  4942. }
  4943. if (slotScopeIds) {
  4944. for (let i = 0; i < slotScopeIds.length; i++) {
  4945. hostSetScopeId(el, slotScopeIds[i]);
  4946. }
  4947. }
  4948. if (parentComponent) {
  4949. let subTree = parentComponent.subTree;
  4950. if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  4951. subTree = filterSingleRoot(subTree.children) || subTree;
  4952. }
  4953. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  4954. const parentVNode = parentComponent.vnode;
  4955. setScopeId(
  4956. el,
  4957. parentVNode,
  4958. parentVNode.scopeId,
  4959. parentVNode.slotScopeIds,
  4960. parentComponent.parent
  4961. );
  4962. }
  4963. }
  4964. };
  4965. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  4966. for (let i = start; i < children.length; i++) {
  4967. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  4968. patch(
  4969. null,
  4970. child,
  4971. container,
  4972. anchor,
  4973. parentComponent,
  4974. parentSuspense,
  4975. namespace,
  4976. slotScopeIds,
  4977. optimized
  4978. );
  4979. }
  4980. };
  4981. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4982. const el = n2.el = n1.el;
  4983. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  4984. el.__vnode = n2;
  4985. }
  4986. let { patchFlag, dynamicChildren, dirs } = n2;
  4987. patchFlag |= n1.patchFlag & 16;
  4988. const oldProps = n1.props || EMPTY_OBJ;
  4989. const newProps = n2.props || EMPTY_OBJ;
  4990. let vnodeHook;
  4991. parentComponent && toggleRecurse(parentComponent, false);
  4992. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  4993. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4994. }
  4995. if (dirs) {
  4996. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  4997. }
  4998. parentComponent && toggleRecurse(parentComponent, true);
  4999. if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
  5000. patchFlag = 0;
  5001. optimized = false;
  5002. dynamicChildren = null;
  5003. }
  5004. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  5005. hostSetElementText(el, "");
  5006. }
  5007. if (dynamicChildren) {
  5008. patchBlockChildren(
  5009. n1.dynamicChildren,
  5010. dynamicChildren,
  5011. el,
  5012. parentComponent,
  5013. parentSuspense,
  5014. resolveChildrenNamespace(n2, namespace),
  5015. slotScopeIds
  5016. );
  5017. if (!!(process.env.NODE_ENV !== "production")) {
  5018. traverseStaticChildren(n1, n2);
  5019. }
  5020. } else if (!optimized) {
  5021. patchChildren(
  5022. n1,
  5023. n2,
  5024. el,
  5025. null,
  5026. parentComponent,
  5027. parentSuspense,
  5028. resolveChildrenNamespace(n2, namespace),
  5029. slotScopeIds,
  5030. false
  5031. );
  5032. }
  5033. if (patchFlag > 0) {
  5034. if (patchFlag & 16) {
  5035. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5036. } else {
  5037. if (patchFlag & 2) {
  5038. if (oldProps.class !== newProps.class) {
  5039. hostPatchProp(el, "class", null, newProps.class, namespace);
  5040. }
  5041. }
  5042. if (patchFlag & 4) {
  5043. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  5044. }
  5045. if (patchFlag & 8) {
  5046. const propsToUpdate = n2.dynamicProps;
  5047. for (let i = 0; i < propsToUpdate.length; i++) {
  5048. const key = propsToUpdate[i];
  5049. const prev = oldProps[key];
  5050. const next = newProps[key];
  5051. if (next !== prev || key === "value") {
  5052. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5053. }
  5054. }
  5055. }
  5056. }
  5057. if (patchFlag & 1) {
  5058. if (n1.children !== n2.children) {
  5059. hostSetElementText(el, n2.children);
  5060. }
  5061. }
  5062. } else if (!optimized && dynamicChildren == null) {
  5063. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5064. }
  5065. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  5066. queuePostRenderEffect(() => {
  5067. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  5068. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  5069. }, parentSuspense);
  5070. }
  5071. };
  5072. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  5073. for (let i = 0; i < newChildren.length; i++) {
  5074. const oldVNode = oldChildren[i];
  5075. const newVNode = newChildren[i];
  5076. const container = (
  5077. // oldVNode may be an errored async setup() component inside Suspense
  5078. // which will not have a mounted element
  5079. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  5080. // of the Fragment itself so it can move its children.
  5081. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  5082. // which also requires the correct parent container
  5083. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  5084. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  5085. // In other cases, the parent container is not actually used so we
  5086. // just pass the block element here to avoid a DOM parentNode call.
  5087. fallbackContainer
  5088. )
  5089. );
  5090. patch(
  5091. oldVNode,
  5092. newVNode,
  5093. container,
  5094. null,
  5095. parentComponent,
  5096. parentSuspense,
  5097. namespace,
  5098. slotScopeIds,
  5099. true
  5100. );
  5101. }
  5102. };
  5103. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  5104. if (oldProps !== newProps) {
  5105. if (oldProps !== EMPTY_OBJ) {
  5106. for (const key in oldProps) {
  5107. if (!isReservedProp(key) && !(key in newProps)) {
  5108. hostPatchProp(
  5109. el,
  5110. key,
  5111. oldProps[key],
  5112. null,
  5113. namespace,
  5114. parentComponent
  5115. );
  5116. }
  5117. }
  5118. }
  5119. for (const key in newProps) {
  5120. if (isReservedProp(key)) continue;
  5121. const next = newProps[key];
  5122. const prev = oldProps[key];
  5123. if (next !== prev && key !== "value") {
  5124. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5125. }
  5126. }
  5127. if ("value" in newProps) {
  5128. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  5129. }
  5130. }
  5131. };
  5132. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5133. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  5134. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  5135. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  5136. if (!!(process.env.NODE_ENV !== "production") && // #5523 dev root fragment may inherit directives
  5137. (isHmrUpdating || patchFlag & 2048)) {
  5138. patchFlag = 0;
  5139. optimized = false;
  5140. dynamicChildren = null;
  5141. }
  5142. if (fragmentSlotScopeIds) {
  5143. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  5144. }
  5145. if (n1 == null) {
  5146. hostInsert(fragmentStartAnchor, container, anchor);
  5147. hostInsert(fragmentEndAnchor, container, anchor);
  5148. mountChildren(
  5149. // #10007
  5150. // such fragment like `<></>` will be compiled into
  5151. // a fragment which doesn't have a children.
  5152. // In this case fallback to an empty array
  5153. n2.children || [],
  5154. container,
  5155. fragmentEndAnchor,
  5156. parentComponent,
  5157. parentSuspense,
  5158. namespace,
  5159. slotScopeIds,
  5160. optimized
  5161. );
  5162. } else {
  5163. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  5164. // of renderSlot() with no valid children
  5165. n1.dynamicChildren) {
  5166. patchBlockChildren(
  5167. n1.dynamicChildren,
  5168. dynamicChildren,
  5169. container,
  5170. parentComponent,
  5171. parentSuspense,
  5172. namespace,
  5173. slotScopeIds
  5174. );
  5175. if (!!(process.env.NODE_ENV !== "production")) {
  5176. traverseStaticChildren(n1, n2);
  5177. } else if (
  5178. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  5179. // get moved around. Make sure all root level vnodes inherit el.
  5180. // #2134 or if it's a component root, it may also get moved around
  5181. // as the component is being moved.
  5182. n2.key != null || parentComponent && n2 === parentComponent.subTree
  5183. ) {
  5184. traverseStaticChildren(
  5185. n1,
  5186. n2,
  5187. true
  5188. /* shallow */
  5189. );
  5190. }
  5191. } else {
  5192. patchChildren(
  5193. n1,
  5194. n2,
  5195. container,
  5196. fragmentEndAnchor,
  5197. parentComponent,
  5198. parentSuspense,
  5199. namespace,
  5200. slotScopeIds,
  5201. optimized
  5202. );
  5203. }
  5204. }
  5205. };
  5206. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5207. n2.slotScopeIds = slotScopeIds;
  5208. if (n1 == null) {
  5209. if (n2.shapeFlag & 512) {
  5210. parentComponent.ctx.activate(
  5211. n2,
  5212. container,
  5213. anchor,
  5214. namespace,
  5215. optimized
  5216. );
  5217. } else {
  5218. mountComponent(
  5219. n2,
  5220. container,
  5221. anchor,
  5222. parentComponent,
  5223. parentSuspense,
  5224. namespace,
  5225. optimized
  5226. );
  5227. }
  5228. } else {
  5229. updateComponent(n1, n2, optimized);
  5230. }
  5231. };
  5232. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  5233. const instance = (initialVNode.component = createComponentInstance(
  5234. initialVNode,
  5235. parentComponent,
  5236. parentSuspense
  5237. ));
  5238. if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
  5239. registerHMR(instance);
  5240. }
  5241. if (!!(process.env.NODE_ENV !== "production")) {
  5242. pushWarningContext(initialVNode);
  5243. startMeasure(instance, `mount`);
  5244. }
  5245. if (isKeepAlive(initialVNode)) {
  5246. instance.ctx.renderer = internals;
  5247. }
  5248. {
  5249. if (!!(process.env.NODE_ENV !== "production")) {
  5250. startMeasure(instance, `init`);
  5251. }
  5252. setupComponent(instance, false, optimized);
  5253. if (!!(process.env.NODE_ENV !== "production")) {
  5254. endMeasure(instance, `init`);
  5255. }
  5256. }
  5257. if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
  5258. if (instance.asyncDep) {
  5259. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  5260. if (!initialVNode.el) {
  5261. const placeholder = instance.subTree = createVNode(Comment);
  5262. processCommentNode(null, placeholder, container, anchor);
  5263. initialVNode.placeholder = placeholder.el;
  5264. }
  5265. } else {
  5266. setupRenderEffect(
  5267. instance,
  5268. initialVNode,
  5269. container,
  5270. anchor,
  5271. parentSuspense,
  5272. namespace,
  5273. optimized
  5274. );
  5275. }
  5276. if (!!(process.env.NODE_ENV !== "production")) {
  5277. popWarningContext();
  5278. endMeasure(instance, `mount`);
  5279. }
  5280. };
  5281. const updateComponent = (n1, n2, optimized) => {
  5282. const instance = n2.component = n1.component;
  5283. if (shouldUpdateComponent(n1, n2, optimized)) {
  5284. if (instance.asyncDep && !instance.asyncResolved) {
  5285. if (!!(process.env.NODE_ENV !== "production")) {
  5286. pushWarningContext(n2);
  5287. }
  5288. updateComponentPreRender(instance, n2, optimized);
  5289. if (!!(process.env.NODE_ENV !== "production")) {
  5290. popWarningContext();
  5291. }
  5292. return;
  5293. } else {
  5294. instance.next = n2;
  5295. instance.update();
  5296. }
  5297. } else {
  5298. n2.el = n1.el;
  5299. instance.vnode = n2;
  5300. }
  5301. };
  5302. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  5303. const componentUpdateFn = () => {
  5304. if (!instance.isMounted) {
  5305. let vnodeHook;
  5306. const { el, props } = initialVNode;
  5307. const { bm, m, parent, root, type } = instance;
  5308. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  5309. toggleRecurse(instance, false);
  5310. if (bm) {
  5311. invokeArrayFns(bm);
  5312. }
  5313. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  5314. invokeVNodeHook(vnodeHook, parent, initialVNode);
  5315. }
  5316. toggleRecurse(instance, true);
  5317. if (el && hydrateNode) {
  5318. const hydrateSubTree = () => {
  5319. if (!!(process.env.NODE_ENV !== "production")) {
  5320. startMeasure(instance, `render`);
  5321. }
  5322. instance.subTree = renderComponentRoot(instance);
  5323. if (!!(process.env.NODE_ENV !== "production")) {
  5324. endMeasure(instance, `render`);
  5325. }
  5326. if (!!(process.env.NODE_ENV !== "production")) {
  5327. startMeasure(instance, `hydrate`);
  5328. }
  5329. hydrateNode(
  5330. el,
  5331. instance.subTree,
  5332. instance,
  5333. parentSuspense,
  5334. null
  5335. );
  5336. if (!!(process.env.NODE_ENV !== "production")) {
  5337. endMeasure(instance, `hydrate`);
  5338. }
  5339. };
  5340. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  5341. type.__asyncHydrate(
  5342. el,
  5343. instance,
  5344. hydrateSubTree
  5345. );
  5346. } else {
  5347. hydrateSubTree();
  5348. }
  5349. } else {
  5350. if (root.ce && // @ts-expect-error _def is private
  5351. root.ce._def.shadowRoot !== false) {
  5352. root.ce._injectChildStyle(type);
  5353. }
  5354. if (!!(process.env.NODE_ENV !== "production")) {
  5355. startMeasure(instance, `render`);
  5356. }
  5357. const subTree = instance.subTree = renderComponentRoot(instance);
  5358. if (!!(process.env.NODE_ENV !== "production")) {
  5359. endMeasure(instance, `render`);
  5360. }
  5361. if (!!(process.env.NODE_ENV !== "production")) {
  5362. startMeasure(instance, `patch`);
  5363. }
  5364. patch(
  5365. null,
  5366. subTree,
  5367. container,
  5368. anchor,
  5369. instance,
  5370. parentSuspense,
  5371. namespace
  5372. );
  5373. if (!!(process.env.NODE_ENV !== "production")) {
  5374. endMeasure(instance, `patch`);
  5375. }
  5376. initialVNode.el = subTree.el;
  5377. }
  5378. if (m) {
  5379. queuePostRenderEffect(m, parentSuspense);
  5380. }
  5381. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  5382. const scopedInitialVNode = initialVNode;
  5383. queuePostRenderEffect(
  5384. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  5385. parentSuspense
  5386. );
  5387. }
  5388. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  5389. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  5390. }
  5391. instance.isMounted = true;
  5392. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  5393. devtoolsComponentAdded(instance);
  5394. }
  5395. initialVNode = container = anchor = null;
  5396. } else {
  5397. let { next, bu, u, parent, vnode } = instance;
  5398. {
  5399. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  5400. if (nonHydratedAsyncRoot) {
  5401. if (next) {
  5402. next.el = vnode.el;
  5403. updateComponentPreRender(instance, next, optimized);
  5404. }
  5405. nonHydratedAsyncRoot.asyncDep.then(() => {
  5406. if (!instance.isUnmounted) {
  5407. componentUpdateFn();
  5408. }
  5409. });
  5410. return;
  5411. }
  5412. }
  5413. let originNext = next;
  5414. let vnodeHook;
  5415. if (!!(process.env.NODE_ENV !== "production")) {
  5416. pushWarningContext(next || instance.vnode);
  5417. }
  5418. toggleRecurse(instance, false);
  5419. if (next) {
  5420. next.el = vnode.el;
  5421. updateComponentPreRender(instance, next, optimized);
  5422. } else {
  5423. next = vnode;
  5424. }
  5425. if (bu) {
  5426. invokeArrayFns(bu);
  5427. }
  5428. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  5429. invokeVNodeHook(vnodeHook, parent, next, vnode);
  5430. }
  5431. toggleRecurse(instance, true);
  5432. if (!!(process.env.NODE_ENV !== "production")) {
  5433. startMeasure(instance, `render`);
  5434. }
  5435. const nextTree = renderComponentRoot(instance);
  5436. if (!!(process.env.NODE_ENV !== "production")) {
  5437. endMeasure(instance, `render`);
  5438. }
  5439. const prevTree = instance.subTree;
  5440. instance.subTree = nextTree;
  5441. if (!!(process.env.NODE_ENV !== "production")) {
  5442. startMeasure(instance, `patch`);
  5443. }
  5444. patch(
  5445. prevTree,
  5446. nextTree,
  5447. // parent may have changed if it's in a teleport
  5448. hostParentNode(prevTree.el),
  5449. // anchor may have changed if it's in a fragment
  5450. getNextHostNode(prevTree),
  5451. instance,
  5452. parentSuspense,
  5453. namespace
  5454. );
  5455. if (!!(process.env.NODE_ENV !== "production")) {
  5456. endMeasure(instance, `patch`);
  5457. }
  5458. next.el = nextTree.el;
  5459. if (originNext === null) {
  5460. updateHOCHostEl(instance, nextTree.el);
  5461. }
  5462. if (u) {
  5463. queuePostRenderEffect(u, parentSuspense);
  5464. }
  5465. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  5466. queuePostRenderEffect(
  5467. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  5468. parentSuspense
  5469. );
  5470. }
  5471. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  5472. devtoolsComponentUpdated(instance);
  5473. }
  5474. if (!!(process.env.NODE_ENV !== "production")) {
  5475. popWarningContext();
  5476. }
  5477. }
  5478. };
  5479. instance.scope.on();
  5480. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  5481. instance.scope.off();
  5482. const update = instance.update = effect.run.bind(effect);
  5483. const job = instance.job = effect.runIfDirty.bind(effect);
  5484. job.i = instance;
  5485. job.id = instance.uid;
  5486. effect.scheduler = () => queueJob(job);
  5487. toggleRecurse(instance, true);
  5488. if (!!(process.env.NODE_ENV !== "production")) {
  5489. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  5490. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  5491. }
  5492. update();
  5493. };
  5494. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  5495. nextVNode.component = instance;
  5496. const prevProps = instance.vnode.props;
  5497. instance.vnode = nextVNode;
  5498. instance.next = null;
  5499. updateProps(instance, nextVNode.props, prevProps, optimized);
  5500. updateSlots(instance, nextVNode.children, optimized);
  5501. pauseTracking();
  5502. flushPreFlushCbs(instance);
  5503. resetTracking();
  5504. };
  5505. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  5506. const c1 = n1 && n1.children;
  5507. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  5508. const c2 = n2.children;
  5509. const { patchFlag, shapeFlag } = n2;
  5510. if (patchFlag > 0) {
  5511. if (patchFlag & 128) {
  5512. patchKeyedChildren(
  5513. c1,
  5514. c2,
  5515. container,
  5516. anchor,
  5517. parentComponent,
  5518. parentSuspense,
  5519. namespace,
  5520. slotScopeIds,
  5521. optimized
  5522. );
  5523. return;
  5524. } else if (patchFlag & 256) {
  5525. patchUnkeyedChildren(
  5526. c1,
  5527. c2,
  5528. container,
  5529. anchor,
  5530. parentComponent,
  5531. parentSuspense,
  5532. namespace,
  5533. slotScopeIds,
  5534. optimized
  5535. );
  5536. return;
  5537. }
  5538. }
  5539. if (shapeFlag & 8) {
  5540. if (prevShapeFlag & 16) {
  5541. unmountChildren(c1, parentComponent, parentSuspense);
  5542. }
  5543. if (c2 !== c1) {
  5544. hostSetElementText(container, c2);
  5545. }
  5546. } else {
  5547. if (prevShapeFlag & 16) {
  5548. if (shapeFlag & 16) {
  5549. patchKeyedChildren(
  5550. c1,
  5551. c2,
  5552. container,
  5553. anchor,
  5554. parentComponent,
  5555. parentSuspense,
  5556. namespace,
  5557. slotScopeIds,
  5558. optimized
  5559. );
  5560. } else {
  5561. unmountChildren(c1, parentComponent, parentSuspense, true);
  5562. }
  5563. } else {
  5564. if (prevShapeFlag & 8) {
  5565. hostSetElementText(container, "");
  5566. }
  5567. if (shapeFlag & 16) {
  5568. mountChildren(
  5569. c2,
  5570. container,
  5571. anchor,
  5572. parentComponent,
  5573. parentSuspense,
  5574. namespace,
  5575. slotScopeIds,
  5576. optimized
  5577. );
  5578. }
  5579. }
  5580. }
  5581. };
  5582. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5583. c1 = c1 || EMPTY_ARR;
  5584. c2 = c2 || EMPTY_ARR;
  5585. const oldLength = c1.length;
  5586. const newLength = c2.length;
  5587. const commonLength = Math.min(oldLength, newLength);
  5588. let i;
  5589. for (i = 0; i < commonLength; i++) {
  5590. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5591. patch(
  5592. c1[i],
  5593. nextChild,
  5594. container,
  5595. null,
  5596. parentComponent,
  5597. parentSuspense,
  5598. namespace,
  5599. slotScopeIds,
  5600. optimized
  5601. );
  5602. }
  5603. if (oldLength > newLength) {
  5604. unmountChildren(
  5605. c1,
  5606. parentComponent,
  5607. parentSuspense,
  5608. true,
  5609. false,
  5610. commonLength
  5611. );
  5612. } else {
  5613. mountChildren(
  5614. c2,
  5615. container,
  5616. anchor,
  5617. parentComponent,
  5618. parentSuspense,
  5619. namespace,
  5620. slotScopeIds,
  5621. optimized,
  5622. commonLength
  5623. );
  5624. }
  5625. };
  5626. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5627. let i = 0;
  5628. const l2 = c2.length;
  5629. let e1 = c1.length - 1;
  5630. let e2 = l2 - 1;
  5631. while (i <= e1 && i <= e2) {
  5632. const n1 = c1[i];
  5633. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5634. if (isSameVNodeType(n1, n2)) {
  5635. patch(
  5636. n1,
  5637. n2,
  5638. container,
  5639. null,
  5640. parentComponent,
  5641. parentSuspense,
  5642. namespace,
  5643. slotScopeIds,
  5644. optimized
  5645. );
  5646. } else {
  5647. break;
  5648. }
  5649. i++;
  5650. }
  5651. while (i <= e1 && i <= e2) {
  5652. const n1 = c1[e1];
  5653. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  5654. if (isSameVNodeType(n1, n2)) {
  5655. patch(
  5656. n1,
  5657. n2,
  5658. container,
  5659. null,
  5660. parentComponent,
  5661. parentSuspense,
  5662. namespace,
  5663. slotScopeIds,
  5664. optimized
  5665. );
  5666. } else {
  5667. break;
  5668. }
  5669. e1--;
  5670. e2--;
  5671. }
  5672. if (i > e1) {
  5673. if (i <= e2) {
  5674. const nextPos = e2 + 1;
  5675. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  5676. while (i <= e2) {
  5677. patch(
  5678. null,
  5679. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  5680. container,
  5681. anchor,
  5682. parentComponent,
  5683. parentSuspense,
  5684. namespace,
  5685. slotScopeIds,
  5686. optimized
  5687. );
  5688. i++;
  5689. }
  5690. }
  5691. } else if (i > e2) {
  5692. while (i <= e1) {
  5693. unmount(c1[i], parentComponent, parentSuspense, true);
  5694. i++;
  5695. }
  5696. } else {
  5697. const s1 = i;
  5698. const s2 = i;
  5699. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  5700. for (i = s2; i <= e2; i++) {
  5701. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5702. if (nextChild.key != null) {
  5703. if (!!(process.env.NODE_ENV !== "production") && keyToNewIndexMap.has(nextChild.key)) {
  5704. warn$1(
  5705. `Duplicate keys found during update:`,
  5706. JSON.stringify(nextChild.key),
  5707. `Make sure keys are unique.`
  5708. );
  5709. }
  5710. keyToNewIndexMap.set(nextChild.key, i);
  5711. }
  5712. }
  5713. let j;
  5714. let patched = 0;
  5715. const toBePatched = e2 - s2 + 1;
  5716. let moved = false;
  5717. let maxNewIndexSoFar = 0;
  5718. const newIndexToOldIndexMap = new Array(toBePatched);
  5719. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  5720. for (i = s1; i <= e1; i++) {
  5721. const prevChild = c1[i];
  5722. if (patched >= toBePatched) {
  5723. unmount(prevChild, parentComponent, parentSuspense, true);
  5724. continue;
  5725. }
  5726. let newIndex;
  5727. if (prevChild.key != null) {
  5728. newIndex = keyToNewIndexMap.get(prevChild.key);
  5729. } else {
  5730. for (j = s2; j <= e2; j++) {
  5731. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  5732. newIndex = j;
  5733. break;
  5734. }
  5735. }
  5736. }
  5737. if (newIndex === void 0) {
  5738. unmount(prevChild, parentComponent, parentSuspense, true);
  5739. } else {
  5740. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  5741. if (newIndex >= maxNewIndexSoFar) {
  5742. maxNewIndexSoFar = newIndex;
  5743. } else {
  5744. moved = true;
  5745. }
  5746. patch(
  5747. prevChild,
  5748. c2[newIndex],
  5749. container,
  5750. null,
  5751. parentComponent,
  5752. parentSuspense,
  5753. namespace,
  5754. slotScopeIds,
  5755. optimized
  5756. );
  5757. patched++;
  5758. }
  5759. }
  5760. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  5761. j = increasingNewIndexSequence.length - 1;
  5762. for (i = toBePatched - 1; i >= 0; i--) {
  5763. const nextIndex = s2 + i;
  5764. const nextChild = c2[nextIndex];
  5765. const anchorVNode = c2[nextIndex + 1];
  5766. const anchor = nextIndex + 1 < l2 ? (
  5767. // #13559, fallback to el placeholder for unresolved async component
  5768. anchorVNode.el || anchorVNode.placeholder
  5769. ) : parentAnchor;
  5770. if (newIndexToOldIndexMap[i] === 0) {
  5771. patch(
  5772. null,
  5773. nextChild,
  5774. container,
  5775. anchor,
  5776. parentComponent,
  5777. parentSuspense,
  5778. namespace,
  5779. slotScopeIds,
  5780. optimized
  5781. );
  5782. } else if (moved) {
  5783. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  5784. move(nextChild, container, anchor, 2);
  5785. } else {
  5786. j--;
  5787. }
  5788. }
  5789. }
  5790. }
  5791. };
  5792. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  5793. const { el, type, transition, children, shapeFlag } = vnode;
  5794. if (shapeFlag & 6) {
  5795. move(vnode.component.subTree, container, anchor, moveType);
  5796. return;
  5797. }
  5798. if (shapeFlag & 128) {
  5799. vnode.suspense.move(container, anchor, moveType);
  5800. return;
  5801. }
  5802. if (shapeFlag & 64) {
  5803. type.move(vnode, container, anchor, internals);
  5804. return;
  5805. }
  5806. if (type === Fragment) {
  5807. hostInsert(el, container, anchor);
  5808. for (let i = 0; i < children.length; i++) {
  5809. move(children[i], container, anchor, moveType);
  5810. }
  5811. hostInsert(vnode.anchor, container, anchor);
  5812. return;
  5813. }
  5814. if (type === Static) {
  5815. moveStaticNode(vnode, container, anchor);
  5816. return;
  5817. }
  5818. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  5819. if (needTransition2) {
  5820. if (moveType === 0) {
  5821. transition.beforeEnter(el);
  5822. hostInsert(el, container, anchor);
  5823. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  5824. } else {
  5825. const { leave, delayLeave, afterLeave } = transition;
  5826. const remove2 = () => {
  5827. if (vnode.ctx.isUnmounted) {
  5828. hostRemove(el);
  5829. } else {
  5830. hostInsert(el, container, anchor);
  5831. }
  5832. };
  5833. const performLeave = () => {
  5834. if (el._isLeaving) {
  5835. el[leaveCbKey](
  5836. true
  5837. /* cancelled */
  5838. );
  5839. }
  5840. leave(el, () => {
  5841. remove2();
  5842. afterLeave && afterLeave();
  5843. });
  5844. };
  5845. if (delayLeave) {
  5846. delayLeave(el, remove2, performLeave);
  5847. } else {
  5848. performLeave();
  5849. }
  5850. }
  5851. } else {
  5852. hostInsert(el, container, anchor);
  5853. }
  5854. };
  5855. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  5856. const {
  5857. type,
  5858. props,
  5859. ref,
  5860. children,
  5861. dynamicChildren,
  5862. shapeFlag,
  5863. patchFlag,
  5864. dirs,
  5865. cacheIndex
  5866. } = vnode;
  5867. if (patchFlag === -2) {
  5868. optimized = false;
  5869. }
  5870. if (ref != null) {
  5871. pauseTracking();
  5872. setRef(ref, null, parentSuspense, vnode, true);
  5873. resetTracking();
  5874. }
  5875. if (cacheIndex != null) {
  5876. parentComponent.renderCache[cacheIndex] = void 0;
  5877. }
  5878. if (shapeFlag & 256) {
  5879. parentComponent.ctx.deactivate(vnode);
  5880. return;
  5881. }
  5882. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  5883. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  5884. let vnodeHook;
  5885. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  5886. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5887. }
  5888. if (shapeFlag & 6) {
  5889. unmountComponent(vnode.component, parentSuspense, doRemove);
  5890. } else {
  5891. if (shapeFlag & 128) {
  5892. vnode.suspense.unmount(parentSuspense, doRemove);
  5893. return;
  5894. }
  5895. if (shouldInvokeDirs) {
  5896. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  5897. }
  5898. if (shapeFlag & 64) {
  5899. vnode.type.remove(
  5900. vnode,
  5901. parentComponent,
  5902. parentSuspense,
  5903. internals,
  5904. doRemove
  5905. );
  5906. } else if (dynamicChildren && // #5154
  5907. // when v-once is used inside a block, setBlockTracking(-1) marks the
  5908. // parent block with hasOnce: true
  5909. // so that it doesn't take the fast path during unmount - otherwise
  5910. // components nested in v-once are never unmounted.
  5911. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  5912. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  5913. unmountChildren(
  5914. dynamicChildren,
  5915. parentComponent,
  5916. parentSuspense,
  5917. false,
  5918. true
  5919. );
  5920. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  5921. unmountChildren(children, parentComponent, parentSuspense);
  5922. }
  5923. if (doRemove) {
  5924. remove(vnode);
  5925. }
  5926. }
  5927. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  5928. queuePostRenderEffect(() => {
  5929. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5930. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  5931. }, parentSuspense);
  5932. }
  5933. };
  5934. const remove = (vnode) => {
  5935. const { type, el, anchor, transition } = vnode;
  5936. if (type === Fragment) {
  5937. if (!!(process.env.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  5938. vnode.children.forEach((child) => {
  5939. if (child.type === Comment) {
  5940. hostRemove(child.el);
  5941. } else {
  5942. remove(child);
  5943. }
  5944. });
  5945. } else {
  5946. removeFragment(el, anchor);
  5947. }
  5948. return;
  5949. }
  5950. if (type === Static) {
  5951. removeStaticNode(vnode);
  5952. return;
  5953. }
  5954. const performRemove = () => {
  5955. hostRemove(el);
  5956. if (transition && !transition.persisted && transition.afterLeave) {
  5957. transition.afterLeave();
  5958. }
  5959. };
  5960. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  5961. const { leave, delayLeave } = transition;
  5962. const performLeave = () => leave(el, performRemove);
  5963. if (delayLeave) {
  5964. delayLeave(vnode.el, performRemove, performLeave);
  5965. } else {
  5966. performLeave();
  5967. }
  5968. } else {
  5969. performRemove();
  5970. }
  5971. };
  5972. const removeFragment = (cur, end) => {
  5973. let next;
  5974. while (cur !== end) {
  5975. next = hostNextSibling(cur);
  5976. hostRemove(cur);
  5977. cur = next;
  5978. }
  5979. hostRemove(end);
  5980. };
  5981. const unmountComponent = (instance, parentSuspense, doRemove) => {
  5982. if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
  5983. unregisterHMR(instance);
  5984. }
  5985. const { bum, scope, job, subTree, um, m, a } = instance;
  5986. invalidateMount(m);
  5987. invalidateMount(a);
  5988. if (bum) {
  5989. invokeArrayFns(bum);
  5990. }
  5991. scope.stop();
  5992. if (job) {
  5993. job.flags |= 8;
  5994. unmount(subTree, instance, parentSuspense, doRemove);
  5995. }
  5996. if (um) {
  5997. queuePostRenderEffect(um, parentSuspense);
  5998. }
  5999. queuePostRenderEffect(() => {
  6000. instance.isUnmounted = true;
  6001. }, parentSuspense);
  6002. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  6003. devtoolsComponentRemoved(instance);
  6004. }
  6005. };
  6006. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  6007. for (let i = start; i < children.length; i++) {
  6008. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  6009. }
  6010. };
  6011. const getNextHostNode = (vnode) => {
  6012. if (vnode.shapeFlag & 6) {
  6013. return getNextHostNode(vnode.component.subTree);
  6014. }
  6015. if (vnode.shapeFlag & 128) {
  6016. return vnode.suspense.next();
  6017. }
  6018. const el = hostNextSibling(vnode.anchor || vnode.el);
  6019. const teleportEnd = el && el[TeleportEndKey];
  6020. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  6021. };
  6022. let isFlushing = false;
  6023. const render = (vnode, container, namespace) => {
  6024. if (vnode == null) {
  6025. if (container._vnode) {
  6026. unmount(container._vnode, null, null, true);
  6027. }
  6028. } else {
  6029. patch(
  6030. container._vnode || null,
  6031. vnode,
  6032. container,
  6033. null,
  6034. null,
  6035. null,
  6036. namespace
  6037. );
  6038. }
  6039. container._vnode = vnode;
  6040. if (!isFlushing) {
  6041. isFlushing = true;
  6042. flushPreFlushCbs();
  6043. flushPostFlushCbs();
  6044. isFlushing = false;
  6045. }
  6046. };
  6047. const internals = {
  6048. p: patch,
  6049. um: unmount,
  6050. m: move,
  6051. r: remove,
  6052. mt: mountComponent,
  6053. mc: mountChildren,
  6054. pc: patchChildren,
  6055. pbc: patchBlockChildren,
  6056. n: getNextHostNode,
  6057. o: options
  6058. };
  6059. let hydrate;
  6060. let hydrateNode;
  6061. if (createHydrationFns) {
  6062. [hydrate, hydrateNode] = createHydrationFns(
  6063. internals
  6064. );
  6065. }
  6066. return {
  6067. render,
  6068. hydrate,
  6069. createApp: createAppAPI(render, hydrate)
  6070. };
  6071. }
  6072. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  6073. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  6074. }
  6075. function toggleRecurse({ effect, job }, allowed) {
  6076. if (allowed) {
  6077. effect.flags |= 32;
  6078. job.flags |= 4;
  6079. } else {
  6080. effect.flags &= -33;
  6081. job.flags &= -5;
  6082. }
  6083. }
  6084. function needTransition(parentSuspense, transition) {
  6085. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  6086. }
  6087. function traverseStaticChildren(n1, n2, shallow = false) {
  6088. const ch1 = n1.children;
  6089. const ch2 = n2.children;
  6090. if (isArray(ch1) && isArray(ch2)) {
  6091. for (let i = 0; i < ch1.length; i++) {
  6092. const c1 = ch1[i];
  6093. let c2 = ch2[i];
  6094. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  6095. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  6096. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  6097. c2.el = c1.el;
  6098. }
  6099. if (!shallow && c2.patchFlag !== -2)
  6100. traverseStaticChildren(c1, c2);
  6101. }
  6102. if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
  6103. c2.patchFlag !== -1) {
  6104. c2.el = c1.el;
  6105. }
  6106. if (c2.type === Comment && !c2.el) {
  6107. c2.el = c1.el;
  6108. }
  6109. if (!!(process.env.NODE_ENV !== "production")) {
  6110. c2.el && (c2.el.__vnode = c2);
  6111. }
  6112. }
  6113. }
  6114. }
  6115. function getSequence(arr) {
  6116. const p = arr.slice();
  6117. const result = [0];
  6118. let i, j, u, v, c;
  6119. const len = arr.length;
  6120. for (i = 0; i < len; i++) {
  6121. const arrI = arr[i];
  6122. if (arrI !== 0) {
  6123. j = result[result.length - 1];
  6124. if (arr[j] < arrI) {
  6125. p[i] = j;
  6126. result.push(i);
  6127. continue;
  6128. }
  6129. u = 0;
  6130. v = result.length - 1;
  6131. while (u < v) {
  6132. c = u + v >> 1;
  6133. if (arr[result[c]] < arrI) {
  6134. u = c + 1;
  6135. } else {
  6136. v = c;
  6137. }
  6138. }
  6139. if (arrI < arr[result[u]]) {
  6140. if (u > 0) {
  6141. p[i] = result[u - 1];
  6142. }
  6143. result[u] = i;
  6144. }
  6145. }
  6146. }
  6147. u = result.length;
  6148. v = result[u - 1];
  6149. while (u-- > 0) {
  6150. result[u] = v;
  6151. v = p[v];
  6152. }
  6153. return result;
  6154. }
  6155. function locateNonHydratedAsyncRoot(instance) {
  6156. const subComponent = instance.subTree.component;
  6157. if (subComponent) {
  6158. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  6159. return subComponent;
  6160. } else {
  6161. return locateNonHydratedAsyncRoot(subComponent);
  6162. }
  6163. }
  6164. }
  6165. function invalidateMount(hooks) {
  6166. if (hooks) {
  6167. for (let i = 0; i < hooks.length; i++)
  6168. hooks[i].flags |= 8;
  6169. }
  6170. }
  6171. const ssrContextKey = Symbol.for("v-scx");
  6172. const useSSRContext = () => {
  6173. {
  6174. const ctx = inject(ssrContextKey);
  6175. if (!ctx) {
  6176. !!(process.env.NODE_ENV !== "production") && warn$1(
  6177. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  6178. );
  6179. }
  6180. return ctx;
  6181. }
  6182. };
  6183. function watchEffect(effect, options) {
  6184. return doWatch(effect, null, options);
  6185. }
  6186. function watchPostEffect(effect, options) {
  6187. return doWatch(
  6188. effect,
  6189. null,
  6190. !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "post" }) : { flush: "post" }
  6191. );
  6192. }
  6193. function watchSyncEffect(effect, options) {
  6194. return doWatch(
  6195. effect,
  6196. null,
  6197. !!(process.env.NODE_ENV !== "production") ? extend({}, options, { flush: "sync" }) : { flush: "sync" }
  6198. );
  6199. }
  6200. function watch(source, cb, options) {
  6201. if (!!(process.env.NODE_ENV !== "production") && !isFunction(cb)) {
  6202. warn$1(
  6203. `\`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.`
  6204. );
  6205. }
  6206. return doWatch(source, cb, options);
  6207. }
  6208. function doWatch(source, cb, options = EMPTY_OBJ) {
  6209. const { immediate, deep, flush, once } = options;
  6210. if (!!(process.env.NODE_ENV !== "production") && !cb) {
  6211. if (immediate !== void 0) {
  6212. warn$1(
  6213. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  6214. );
  6215. }
  6216. if (deep !== void 0) {
  6217. warn$1(
  6218. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  6219. );
  6220. }
  6221. if (once !== void 0) {
  6222. warn$1(
  6223. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  6224. );
  6225. }
  6226. }
  6227. const baseWatchOptions = extend({}, options);
  6228. if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
  6229. const runsImmediately = cb && immediate || !cb && flush !== "post";
  6230. let ssrCleanup;
  6231. if (isInSSRComponentSetup) {
  6232. if (flush === "sync") {
  6233. const ctx = useSSRContext();
  6234. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  6235. } else if (!runsImmediately) {
  6236. const watchStopHandle = () => {
  6237. };
  6238. watchStopHandle.stop = NOOP;
  6239. watchStopHandle.resume = NOOP;
  6240. watchStopHandle.pause = NOOP;
  6241. return watchStopHandle;
  6242. }
  6243. }
  6244. const instance = currentInstance;
  6245. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  6246. let isPre = false;
  6247. if (flush === "post") {
  6248. baseWatchOptions.scheduler = (job) => {
  6249. queuePostRenderEffect(job, instance && instance.suspense);
  6250. };
  6251. } else if (flush !== "sync") {
  6252. isPre = true;
  6253. baseWatchOptions.scheduler = (job, isFirstRun) => {
  6254. if (isFirstRun) {
  6255. job();
  6256. } else {
  6257. queueJob(job);
  6258. }
  6259. };
  6260. }
  6261. baseWatchOptions.augmentJob = (job) => {
  6262. if (cb) {
  6263. job.flags |= 4;
  6264. }
  6265. if (isPre) {
  6266. job.flags |= 2;
  6267. if (instance) {
  6268. job.id = instance.uid;
  6269. job.i = instance;
  6270. }
  6271. }
  6272. };
  6273. const watchHandle = watch$1(source, cb, baseWatchOptions);
  6274. if (isInSSRComponentSetup) {
  6275. if (ssrCleanup) {
  6276. ssrCleanup.push(watchHandle);
  6277. } else if (runsImmediately) {
  6278. watchHandle();
  6279. }
  6280. }
  6281. return watchHandle;
  6282. }
  6283. function instanceWatch(source, value, options) {
  6284. const publicThis = this.proxy;
  6285. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  6286. let cb;
  6287. if (isFunction(value)) {
  6288. cb = value;
  6289. } else {
  6290. cb = value.handler;
  6291. options = value;
  6292. }
  6293. const reset = setCurrentInstance(this);
  6294. const res = doWatch(getter, cb.bind(publicThis), options);
  6295. reset();
  6296. return res;
  6297. }
  6298. function createPathGetter(ctx, path) {
  6299. const segments = path.split(".");
  6300. return () => {
  6301. let cur = ctx;
  6302. for (let i = 0; i < segments.length && cur; i++) {
  6303. cur = cur[segments[i]];
  6304. }
  6305. return cur;
  6306. };
  6307. }
  6308. function useModel(props, name, options = EMPTY_OBJ) {
  6309. const i = getCurrentInstance();
  6310. if (!!(process.env.NODE_ENV !== "production") && !i) {
  6311. warn$1(`useModel() called without active instance.`);
  6312. return ref();
  6313. }
  6314. const camelizedName = camelize(name);
  6315. if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
  6316. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  6317. return ref();
  6318. }
  6319. const hyphenatedName = hyphenate(name);
  6320. const modifiers = getModelModifiers(props, camelizedName);
  6321. const res = customRef((track, trigger) => {
  6322. let localValue;
  6323. let prevSetValue = EMPTY_OBJ;
  6324. let prevEmittedValue;
  6325. watchSyncEffect(() => {
  6326. const propValue = props[camelizedName];
  6327. if (hasChanged(localValue, propValue)) {
  6328. localValue = propValue;
  6329. trigger();
  6330. }
  6331. });
  6332. return {
  6333. get() {
  6334. track();
  6335. return options.get ? options.get(localValue) : localValue;
  6336. },
  6337. set(value) {
  6338. const emittedValue = options.set ? options.set(value) : value;
  6339. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  6340. return;
  6341. }
  6342. const rawProps = i.vnode.props;
  6343. if (!(rawProps && // check if parent has passed v-model
  6344. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  6345. localValue = value;
  6346. trigger();
  6347. }
  6348. i.emit(`update:${name}`, emittedValue);
  6349. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  6350. trigger();
  6351. }
  6352. prevSetValue = value;
  6353. prevEmittedValue = emittedValue;
  6354. }
  6355. };
  6356. });
  6357. res[Symbol.iterator] = () => {
  6358. let i2 = 0;
  6359. return {
  6360. next() {
  6361. if (i2 < 2) {
  6362. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  6363. } else {
  6364. return { done: true };
  6365. }
  6366. }
  6367. };
  6368. };
  6369. return res;
  6370. }
  6371. const getModelModifiers = (props, modelName) => {
  6372. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  6373. };
  6374. function emit(instance, event, ...rawArgs) {
  6375. if (instance.isUnmounted) return;
  6376. const props = instance.vnode.props || EMPTY_OBJ;
  6377. if (!!(process.env.NODE_ENV !== "production")) {
  6378. const {
  6379. emitsOptions,
  6380. propsOptions: [propsOptions]
  6381. } = instance;
  6382. if (emitsOptions) {
  6383. if (!(event in emitsOptions) && true) {
  6384. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  6385. warn$1(
  6386. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  6387. );
  6388. }
  6389. } else {
  6390. const validator = emitsOptions[event];
  6391. if (isFunction(validator)) {
  6392. const isValid = validator(...rawArgs);
  6393. if (!isValid) {
  6394. warn$1(
  6395. `Invalid event arguments: event validation failed for event "${event}".`
  6396. );
  6397. }
  6398. }
  6399. }
  6400. }
  6401. }
  6402. let args = rawArgs;
  6403. const isModelListener = event.startsWith("update:");
  6404. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  6405. if (modifiers) {
  6406. if (modifiers.trim) {
  6407. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  6408. }
  6409. if (modifiers.number) {
  6410. args = rawArgs.map(looseToNumber);
  6411. }
  6412. }
  6413. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  6414. devtoolsComponentEmit(instance, event, args);
  6415. }
  6416. if (!!(process.env.NODE_ENV !== "production")) {
  6417. const lowerCaseEvent = event.toLowerCase();
  6418. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  6419. warn$1(
  6420. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  6421. instance,
  6422. instance.type
  6423. )} 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(
  6424. event
  6425. )}" instead of "${event}".`
  6426. );
  6427. }
  6428. }
  6429. let handlerName;
  6430. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  6431. props[handlerName = toHandlerKey(camelize(event))];
  6432. if (!handler && isModelListener) {
  6433. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  6434. }
  6435. if (handler) {
  6436. callWithAsyncErrorHandling(
  6437. handler,
  6438. instance,
  6439. 6,
  6440. args
  6441. );
  6442. }
  6443. const onceHandler = props[handlerName + `Once`];
  6444. if (onceHandler) {
  6445. if (!instance.emitted) {
  6446. instance.emitted = {};
  6447. } else if (instance.emitted[handlerName]) {
  6448. return;
  6449. }
  6450. instance.emitted[handlerName] = true;
  6451. callWithAsyncErrorHandling(
  6452. onceHandler,
  6453. instance,
  6454. 6,
  6455. args
  6456. );
  6457. }
  6458. }
  6459. const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
  6460. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  6461. const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
  6462. const cached = cache.get(comp);
  6463. if (cached !== void 0) {
  6464. return cached;
  6465. }
  6466. const raw = comp.emits;
  6467. let normalized = {};
  6468. let hasExtends = false;
  6469. if (__VUE_OPTIONS_API__ && !isFunction(comp)) {
  6470. const extendEmits = (raw2) => {
  6471. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  6472. if (normalizedFromExtend) {
  6473. hasExtends = true;
  6474. extend(normalized, normalizedFromExtend);
  6475. }
  6476. };
  6477. if (!asMixin && appContext.mixins.length) {
  6478. appContext.mixins.forEach(extendEmits);
  6479. }
  6480. if (comp.extends) {
  6481. extendEmits(comp.extends);
  6482. }
  6483. if (comp.mixins) {
  6484. comp.mixins.forEach(extendEmits);
  6485. }
  6486. }
  6487. if (!raw && !hasExtends) {
  6488. if (isObject(comp)) {
  6489. cache.set(comp, null);
  6490. }
  6491. return null;
  6492. }
  6493. if (isArray(raw)) {
  6494. raw.forEach((key) => normalized[key] = null);
  6495. } else {
  6496. extend(normalized, raw);
  6497. }
  6498. if (isObject(comp)) {
  6499. cache.set(comp, normalized);
  6500. }
  6501. return normalized;
  6502. }
  6503. function isEmitListener(options, key) {
  6504. if (!options || !isOn(key)) {
  6505. return false;
  6506. }
  6507. key = key.slice(2).replace(/Once$/, "");
  6508. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  6509. }
  6510. let accessedAttrs = false;
  6511. function markAttrsAccessed() {
  6512. accessedAttrs = true;
  6513. }
  6514. function renderComponentRoot(instance) {
  6515. const {
  6516. type: Component,
  6517. vnode,
  6518. proxy,
  6519. withProxy,
  6520. propsOptions: [propsOptions],
  6521. slots,
  6522. attrs,
  6523. emit,
  6524. render,
  6525. renderCache,
  6526. props,
  6527. data,
  6528. setupState,
  6529. ctx,
  6530. inheritAttrs
  6531. } = instance;
  6532. const prev = setCurrentRenderingInstance(instance);
  6533. let result;
  6534. let fallthroughAttrs;
  6535. if (!!(process.env.NODE_ENV !== "production")) {
  6536. accessedAttrs = false;
  6537. }
  6538. try {
  6539. if (vnode.shapeFlag & 4) {
  6540. const proxyToUse = withProxy || proxy;
  6541. const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  6542. get(target, key, receiver) {
  6543. warn$1(
  6544. `Property '${String(
  6545. key
  6546. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  6547. );
  6548. return Reflect.get(target, key, receiver);
  6549. }
  6550. }) : proxyToUse;
  6551. result = normalizeVNode(
  6552. render.call(
  6553. thisProxy,
  6554. proxyToUse,
  6555. renderCache,
  6556. !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props,
  6557. setupState,
  6558. data,
  6559. ctx
  6560. )
  6561. );
  6562. fallthroughAttrs = attrs;
  6563. } else {
  6564. const render2 = Component;
  6565. if (!!(process.env.NODE_ENV !== "production") && attrs === props) {
  6566. markAttrsAccessed();
  6567. }
  6568. result = normalizeVNode(
  6569. render2.length > 1 ? render2(
  6570. !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props,
  6571. !!(process.env.NODE_ENV !== "production") ? {
  6572. get attrs() {
  6573. markAttrsAccessed();
  6574. return shallowReadonly(attrs);
  6575. },
  6576. slots,
  6577. emit
  6578. } : { attrs, slots, emit }
  6579. ) : render2(
  6580. !!(process.env.NODE_ENV !== "production") ? shallowReadonly(props) : props,
  6581. null
  6582. )
  6583. );
  6584. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  6585. }
  6586. } catch (err) {
  6587. blockStack.length = 0;
  6588. handleError(err, instance, 1);
  6589. result = createVNode(Comment);
  6590. }
  6591. let root = result;
  6592. let setRoot = void 0;
  6593. if (!!(process.env.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) {
  6594. [root, setRoot] = getChildRoot(result);
  6595. }
  6596. if (fallthroughAttrs && inheritAttrs !== false) {
  6597. const keys = Object.keys(fallthroughAttrs);
  6598. const { shapeFlag } = root;
  6599. if (keys.length) {
  6600. if (shapeFlag & (1 | 6)) {
  6601. if (propsOptions && keys.some(isModelListener)) {
  6602. fallthroughAttrs = filterModelListeners(
  6603. fallthroughAttrs,
  6604. propsOptions
  6605. );
  6606. }
  6607. root = cloneVNode(root, fallthroughAttrs, false, true);
  6608. } else if (!!(process.env.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) {
  6609. const allAttrs = Object.keys(attrs);
  6610. const eventAttrs = [];
  6611. const extraAttrs = [];
  6612. for (let i = 0, l = allAttrs.length; i < l; i++) {
  6613. const key = allAttrs[i];
  6614. if (isOn(key)) {
  6615. if (!isModelListener(key)) {
  6616. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  6617. }
  6618. } else {
  6619. extraAttrs.push(key);
  6620. }
  6621. }
  6622. if (extraAttrs.length) {
  6623. warn$1(
  6624. `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.`
  6625. );
  6626. }
  6627. if (eventAttrs.length) {
  6628. warn$1(
  6629. `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.`
  6630. );
  6631. }
  6632. }
  6633. }
  6634. }
  6635. if (vnode.dirs) {
  6636. if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
  6637. warn$1(
  6638. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  6639. );
  6640. }
  6641. root = cloneVNode(root, null, false, true);
  6642. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  6643. }
  6644. if (vnode.transition) {
  6645. if (!!(process.env.NODE_ENV !== "production") && !isElementRoot(root)) {
  6646. warn$1(
  6647. `Component inside <Transition> renders non-element root node that cannot be animated.`
  6648. );
  6649. }
  6650. setTransitionHooks(root, vnode.transition);
  6651. }
  6652. if (!!(process.env.NODE_ENV !== "production") && setRoot) {
  6653. setRoot(root);
  6654. } else {
  6655. result = root;
  6656. }
  6657. setCurrentRenderingInstance(prev);
  6658. return result;
  6659. }
  6660. const getChildRoot = (vnode) => {
  6661. const rawChildren = vnode.children;
  6662. const dynamicChildren = vnode.dynamicChildren;
  6663. const childRoot = filterSingleRoot(rawChildren, false);
  6664. if (!childRoot) {
  6665. return [vnode, void 0];
  6666. } else if (!!(process.env.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  6667. return getChildRoot(childRoot);
  6668. }
  6669. const index = rawChildren.indexOf(childRoot);
  6670. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  6671. const setRoot = (updatedRoot) => {
  6672. rawChildren[index] = updatedRoot;
  6673. if (dynamicChildren) {
  6674. if (dynamicIndex > -1) {
  6675. dynamicChildren[dynamicIndex] = updatedRoot;
  6676. } else if (updatedRoot.patchFlag > 0) {
  6677. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  6678. }
  6679. }
  6680. };
  6681. return [normalizeVNode(childRoot), setRoot];
  6682. };
  6683. function filterSingleRoot(children, recurse = true) {
  6684. let singleRoot;
  6685. for (let i = 0; i < children.length; i++) {
  6686. const child = children[i];
  6687. if (isVNode(child)) {
  6688. if (child.type !== Comment || child.children === "v-if") {
  6689. if (singleRoot) {
  6690. return;
  6691. } else {
  6692. singleRoot = child;
  6693. if (!!(process.env.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  6694. return filterSingleRoot(singleRoot.children);
  6695. }
  6696. }
  6697. }
  6698. } else {
  6699. return;
  6700. }
  6701. }
  6702. return singleRoot;
  6703. }
  6704. const getFunctionalFallthrough = (attrs) => {
  6705. let res;
  6706. for (const key in attrs) {
  6707. if (key === "class" || key === "style" || isOn(key)) {
  6708. (res || (res = {}))[key] = attrs[key];
  6709. }
  6710. }
  6711. return res;
  6712. };
  6713. const filterModelListeners = (attrs, props) => {
  6714. const res = {};
  6715. for (const key in attrs) {
  6716. if (!isModelListener(key) || !(key.slice(9) in props)) {
  6717. res[key] = attrs[key];
  6718. }
  6719. }
  6720. return res;
  6721. };
  6722. const isElementRoot = (vnode) => {
  6723. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  6724. };
  6725. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  6726. const { props: prevProps, children: prevChildren, component } = prevVNode;
  6727. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  6728. const emits = component.emitsOptions;
  6729. if (!!(process.env.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) {
  6730. return true;
  6731. }
  6732. if (nextVNode.dirs || nextVNode.transition) {
  6733. return true;
  6734. }
  6735. if (optimized && patchFlag >= 0) {
  6736. if (patchFlag & 1024) {
  6737. return true;
  6738. }
  6739. if (patchFlag & 16) {
  6740. if (!prevProps) {
  6741. return !!nextProps;
  6742. }
  6743. return hasPropsChanged(prevProps, nextProps, emits);
  6744. } else if (patchFlag & 8) {
  6745. const dynamicProps = nextVNode.dynamicProps;
  6746. for (let i = 0; i < dynamicProps.length; i++) {
  6747. const key = dynamicProps[i];
  6748. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  6749. return true;
  6750. }
  6751. }
  6752. }
  6753. } else {
  6754. if (prevChildren || nextChildren) {
  6755. if (!nextChildren || !nextChildren.$stable) {
  6756. return true;
  6757. }
  6758. }
  6759. if (prevProps === nextProps) {
  6760. return false;
  6761. }
  6762. if (!prevProps) {
  6763. return !!nextProps;
  6764. }
  6765. if (!nextProps) {
  6766. return true;
  6767. }
  6768. return hasPropsChanged(prevProps, nextProps, emits);
  6769. }
  6770. return false;
  6771. }
  6772. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  6773. const nextKeys = Object.keys(nextProps);
  6774. if (nextKeys.length !== Object.keys(prevProps).length) {
  6775. return true;
  6776. }
  6777. for (let i = 0; i < nextKeys.length; i++) {
  6778. const key = nextKeys[i];
  6779. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  6780. return true;
  6781. }
  6782. }
  6783. return false;
  6784. }
  6785. function updateHOCHostEl({ vnode, parent }, el) {
  6786. while (parent) {
  6787. const root = parent.subTree;
  6788. if (root.suspense && root.suspense.activeBranch === vnode) {
  6789. root.el = vnode.el;
  6790. }
  6791. if (root === vnode) {
  6792. (vnode = parent.vnode).el = el;
  6793. parent = parent.parent;
  6794. } else {
  6795. break;
  6796. }
  6797. }
  6798. }
  6799. const isSuspense = (type) => type.__isSuspense;
  6800. let suspenseId = 0;
  6801. const SuspenseImpl = {
  6802. name: "Suspense",
  6803. // In order to make Suspense tree-shakable, we need to avoid importing it
  6804. // directly in the renderer. The renderer checks for the __isSuspense flag
  6805. // on a vnode's type and calls the `process` method, passing in renderer
  6806. // internals.
  6807. __isSuspense: true,
  6808. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  6809. if (n1 == null) {
  6810. mountSuspense(
  6811. n2,
  6812. container,
  6813. anchor,
  6814. parentComponent,
  6815. parentSuspense,
  6816. namespace,
  6817. slotScopeIds,
  6818. optimized,
  6819. rendererInternals
  6820. );
  6821. } else {
  6822. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  6823. n2.suspense = n1.suspense;
  6824. n2.suspense.vnode = n2;
  6825. n2.el = n1.el;
  6826. return;
  6827. }
  6828. patchSuspense(
  6829. n1,
  6830. n2,
  6831. container,
  6832. anchor,
  6833. parentComponent,
  6834. namespace,
  6835. slotScopeIds,
  6836. optimized,
  6837. rendererInternals
  6838. );
  6839. }
  6840. },
  6841. hydrate: hydrateSuspense,
  6842. normalize: normalizeSuspenseChildren
  6843. };
  6844. const Suspense = SuspenseImpl ;
  6845. function triggerEvent(vnode, name) {
  6846. const eventListener = vnode.props && vnode.props[name];
  6847. if (isFunction(eventListener)) {
  6848. eventListener();
  6849. }
  6850. }
  6851. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  6852. const {
  6853. p: patch,
  6854. o: { createElement }
  6855. } = rendererInternals;
  6856. const hiddenContainer = createElement("div");
  6857. const suspense = vnode.suspense = createSuspenseBoundary(
  6858. vnode,
  6859. parentSuspense,
  6860. parentComponent,
  6861. container,
  6862. hiddenContainer,
  6863. anchor,
  6864. namespace,
  6865. slotScopeIds,
  6866. optimized,
  6867. rendererInternals
  6868. );
  6869. patch(
  6870. null,
  6871. suspense.pendingBranch = vnode.ssContent,
  6872. hiddenContainer,
  6873. null,
  6874. parentComponent,
  6875. suspense,
  6876. namespace,
  6877. slotScopeIds
  6878. );
  6879. if (suspense.deps > 0) {
  6880. triggerEvent(vnode, "onPending");
  6881. triggerEvent(vnode, "onFallback");
  6882. patch(
  6883. null,
  6884. vnode.ssFallback,
  6885. container,
  6886. anchor,
  6887. parentComponent,
  6888. null,
  6889. // fallback tree will not have suspense context
  6890. namespace,
  6891. slotScopeIds
  6892. );
  6893. setActiveBranch(suspense, vnode.ssFallback);
  6894. } else {
  6895. suspense.resolve(false, true);
  6896. }
  6897. }
  6898. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  6899. const suspense = n2.suspense = n1.suspense;
  6900. suspense.vnode = n2;
  6901. n2.el = n1.el;
  6902. const newBranch = n2.ssContent;
  6903. const newFallback = n2.ssFallback;
  6904. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  6905. if (pendingBranch) {
  6906. suspense.pendingBranch = newBranch;
  6907. if (isSameVNodeType(pendingBranch, newBranch)) {
  6908. patch(
  6909. pendingBranch,
  6910. newBranch,
  6911. suspense.hiddenContainer,
  6912. null,
  6913. parentComponent,
  6914. suspense,
  6915. namespace,
  6916. slotScopeIds,
  6917. optimized
  6918. );
  6919. if (suspense.deps <= 0) {
  6920. suspense.resolve();
  6921. } else if (isInFallback) {
  6922. if (!isHydrating) {
  6923. patch(
  6924. activeBranch,
  6925. newFallback,
  6926. container,
  6927. anchor,
  6928. parentComponent,
  6929. null,
  6930. // fallback tree will not have suspense context
  6931. namespace,
  6932. slotScopeIds,
  6933. optimized
  6934. );
  6935. setActiveBranch(suspense, newFallback);
  6936. }
  6937. }
  6938. } else {
  6939. suspense.pendingId = suspenseId++;
  6940. if (isHydrating) {
  6941. suspense.isHydrating = false;
  6942. suspense.activeBranch = pendingBranch;
  6943. } else {
  6944. unmount(pendingBranch, parentComponent, suspense);
  6945. }
  6946. suspense.deps = 0;
  6947. suspense.effects.length = 0;
  6948. suspense.hiddenContainer = createElement("div");
  6949. if (isInFallback) {
  6950. patch(
  6951. null,
  6952. newBranch,
  6953. suspense.hiddenContainer,
  6954. null,
  6955. parentComponent,
  6956. suspense,
  6957. namespace,
  6958. slotScopeIds,
  6959. optimized
  6960. );
  6961. if (suspense.deps <= 0) {
  6962. suspense.resolve();
  6963. } else {
  6964. patch(
  6965. activeBranch,
  6966. newFallback,
  6967. container,
  6968. anchor,
  6969. parentComponent,
  6970. null,
  6971. // fallback tree will not have suspense context
  6972. namespace,
  6973. slotScopeIds,
  6974. optimized
  6975. );
  6976. setActiveBranch(suspense, newFallback);
  6977. }
  6978. } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  6979. patch(
  6980. activeBranch,
  6981. newBranch,
  6982. container,
  6983. anchor,
  6984. parentComponent,
  6985. suspense,
  6986. namespace,
  6987. slotScopeIds,
  6988. optimized
  6989. );
  6990. suspense.resolve(true);
  6991. } else {
  6992. patch(
  6993. null,
  6994. newBranch,
  6995. suspense.hiddenContainer,
  6996. null,
  6997. parentComponent,
  6998. suspense,
  6999. namespace,
  7000. slotScopeIds,
  7001. optimized
  7002. );
  7003. if (suspense.deps <= 0) {
  7004. suspense.resolve();
  7005. }
  7006. }
  7007. }
  7008. } else {
  7009. if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  7010. patch(
  7011. activeBranch,
  7012. newBranch,
  7013. container,
  7014. anchor,
  7015. parentComponent,
  7016. suspense,
  7017. namespace,
  7018. slotScopeIds,
  7019. optimized
  7020. );
  7021. setActiveBranch(suspense, newBranch);
  7022. } else {
  7023. triggerEvent(n2, "onPending");
  7024. suspense.pendingBranch = newBranch;
  7025. if (newBranch.shapeFlag & 512) {
  7026. suspense.pendingId = newBranch.component.suspenseId;
  7027. } else {
  7028. suspense.pendingId = suspenseId++;
  7029. }
  7030. patch(
  7031. null,
  7032. newBranch,
  7033. suspense.hiddenContainer,
  7034. null,
  7035. parentComponent,
  7036. suspense,
  7037. namespace,
  7038. slotScopeIds,
  7039. optimized
  7040. );
  7041. if (suspense.deps <= 0) {
  7042. suspense.resolve();
  7043. } else {
  7044. const { timeout, pendingId } = suspense;
  7045. if (timeout > 0) {
  7046. setTimeout(() => {
  7047. if (suspense.pendingId === pendingId) {
  7048. suspense.fallback(newFallback);
  7049. }
  7050. }, timeout);
  7051. } else if (timeout === 0) {
  7052. suspense.fallback(newFallback);
  7053. }
  7054. }
  7055. }
  7056. }
  7057. }
  7058. let hasWarned = false;
  7059. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  7060. if (!!(process.env.NODE_ENV !== "production") && true && !hasWarned) {
  7061. hasWarned = true;
  7062. console[console.info ? "info" : "log"](
  7063. `<Suspense> is an experimental feature and its API will likely change.`
  7064. );
  7065. }
  7066. const {
  7067. p: patch,
  7068. m: move,
  7069. um: unmount,
  7070. n: next,
  7071. o: { parentNode, remove }
  7072. } = rendererInternals;
  7073. let parentSuspenseId;
  7074. const isSuspensible = isVNodeSuspensible(vnode);
  7075. if (isSuspensible) {
  7076. if (parentSuspense && parentSuspense.pendingBranch) {
  7077. parentSuspenseId = parentSuspense.pendingId;
  7078. parentSuspense.deps++;
  7079. }
  7080. }
  7081. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  7082. if (!!(process.env.NODE_ENV !== "production")) {
  7083. assertNumber(timeout, `Suspense timeout`);
  7084. }
  7085. const initialAnchor = anchor;
  7086. const suspense = {
  7087. vnode,
  7088. parent: parentSuspense,
  7089. parentComponent,
  7090. namespace,
  7091. container,
  7092. hiddenContainer,
  7093. deps: 0,
  7094. pendingId: suspenseId++,
  7095. timeout: typeof timeout === "number" ? timeout : -1,
  7096. activeBranch: null,
  7097. pendingBranch: null,
  7098. isInFallback: !isHydrating,
  7099. isHydrating,
  7100. isUnmounted: false,
  7101. effects: [],
  7102. resolve(resume = false, sync = false) {
  7103. if (!!(process.env.NODE_ENV !== "production")) {
  7104. if (!resume && !suspense.pendingBranch) {
  7105. throw new Error(
  7106. `suspense.resolve() is called without a pending branch.`
  7107. );
  7108. }
  7109. if (suspense.isUnmounted) {
  7110. throw new Error(
  7111. `suspense.resolve() is called on an already unmounted suspense boundary.`
  7112. );
  7113. }
  7114. }
  7115. const {
  7116. vnode: vnode2,
  7117. activeBranch,
  7118. pendingBranch,
  7119. pendingId,
  7120. effects,
  7121. parentComponent: parentComponent2,
  7122. container: container2
  7123. } = suspense;
  7124. let delayEnter = false;
  7125. if (suspense.isHydrating) {
  7126. suspense.isHydrating = false;
  7127. } else if (!resume) {
  7128. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  7129. if (delayEnter) {
  7130. activeBranch.transition.afterLeave = () => {
  7131. if (pendingId === suspense.pendingId) {
  7132. move(
  7133. pendingBranch,
  7134. container2,
  7135. anchor === initialAnchor ? next(activeBranch) : anchor,
  7136. 0
  7137. );
  7138. queuePostFlushCb(effects);
  7139. }
  7140. };
  7141. }
  7142. if (activeBranch) {
  7143. if (parentNode(activeBranch.el) === container2) {
  7144. anchor = next(activeBranch);
  7145. }
  7146. unmount(activeBranch, parentComponent2, suspense, true);
  7147. }
  7148. if (!delayEnter) {
  7149. move(pendingBranch, container2, anchor, 0);
  7150. }
  7151. }
  7152. setActiveBranch(suspense, pendingBranch);
  7153. suspense.pendingBranch = null;
  7154. suspense.isInFallback = false;
  7155. let parent = suspense.parent;
  7156. let hasUnresolvedAncestor = false;
  7157. while (parent) {
  7158. if (parent.pendingBranch) {
  7159. parent.effects.push(...effects);
  7160. hasUnresolvedAncestor = true;
  7161. break;
  7162. }
  7163. parent = parent.parent;
  7164. }
  7165. if (!hasUnresolvedAncestor && !delayEnter) {
  7166. queuePostFlushCb(effects);
  7167. }
  7168. suspense.effects = [];
  7169. if (isSuspensible) {
  7170. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  7171. parentSuspense.deps--;
  7172. if (parentSuspense.deps === 0 && !sync) {
  7173. parentSuspense.resolve();
  7174. }
  7175. }
  7176. }
  7177. triggerEvent(vnode2, "onResolve");
  7178. },
  7179. fallback(fallbackVNode) {
  7180. if (!suspense.pendingBranch) {
  7181. return;
  7182. }
  7183. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  7184. triggerEvent(vnode2, "onFallback");
  7185. const anchor2 = next(activeBranch);
  7186. const mountFallback = () => {
  7187. if (!suspense.isInFallback) {
  7188. return;
  7189. }
  7190. patch(
  7191. null,
  7192. fallbackVNode,
  7193. container2,
  7194. anchor2,
  7195. parentComponent2,
  7196. null,
  7197. // fallback tree will not have suspense context
  7198. namespace2,
  7199. slotScopeIds,
  7200. optimized
  7201. );
  7202. setActiveBranch(suspense, fallbackVNode);
  7203. };
  7204. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  7205. if (delayEnter) {
  7206. activeBranch.transition.afterLeave = mountFallback;
  7207. }
  7208. suspense.isInFallback = true;
  7209. unmount(
  7210. activeBranch,
  7211. parentComponent2,
  7212. null,
  7213. // no suspense so unmount hooks fire now
  7214. true
  7215. // shouldRemove
  7216. );
  7217. if (!delayEnter) {
  7218. mountFallback();
  7219. }
  7220. },
  7221. move(container2, anchor2, type) {
  7222. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  7223. suspense.container = container2;
  7224. },
  7225. next() {
  7226. return suspense.activeBranch && next(suspense.activeBranch);
  7227. },
  7228. registerDep(instance, setupRenderEffect, optimized2) {
  7229. const isInPendingSuspense = !!suspense.pendingBranch;
  7230. if (isInPendingSuspense) {
  7231. suspense.deps++;
  7232. }
  7233. const hydratedEl = instance.vnode.el;
  7234. instance.asyncDep.catch((err) => {
  7235. handleError(err, instance, 0);
  7236. }).then((asyncSetupResult) => {
  7237. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  7238. return;
  7239. }
  7240. instance.asyncResolved = true;
  7241. const { vnode: vnode2 } = instance;
  7242. if (!!(process.env.NODE_ENV !== "production")) {
  7243. pushWarningContext(vnode2);
  7244. }
  7245. handleSetupResult(instance, asyncSetupResult, false);
  7246. if (hydratedEl) {
  7247. vnode2.el = hydratedEl;
  7248. }
  7249. const placeholder = !hydratedEl && instance.subTree.el;
  7250. setupRenderEffect(
  7251. instance,
  7252. vnode2,
  7253. // component may have been moved before resolve.
  7254. // if this is not a hydration, instance.subTree will be the comment
  7255. // placeholder.
  7256. parentNode(hydratedEl || instance.subTree.el),
  7257. // anchor will not be used if this is hydration, so only need to
  7258. // consider the comment placeholder case.
  7259. hydratedEl ? null : next(instance.subTree),
  7260. suspense,
  7261. namespace,
  7262. optimized2
  7263. );
  7264. if (placeholder) {
  7265. remove(placeholder);
  7266. }
  7267. updateHOCHostEl(instance, vnode2.el);
  7268. if (!!(process.env.NODE_ENV !== "production")) {
  7269. popWarningContext();
  7270. }
  7271. if (isInPendingSuspense && --suspense.deps === 0) {
  7272. suspense.resolve();
  7273. }
  7274. });
  7275. },
  7276. unmount(parentSuspense2, doRemove) {
  7277. suspense.isUnmounted = true;
  7278. if (suspense.activeBranch) {
  7279. unmount(
  7280. suspense.activeBranch,
  7281. parentComponent,
  7282. parentSuspense2,
  7283. doRemove
  7284. );
  7285. }
  7286. if (suspense.pendingBranch) {
  7287. unmount(
  7288. suspense.pendingBranch,
  7289. parentComponent,
  7290. parentSuspense2,
  7291. doRemove
  7292. );
  7293. }
  7294. }
  7295. };
  7296. return suspense;
  7297. }
  7298. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  7299. const suspense = vnode.suspense = createSuspenseBoundary(
  7300. vnode,
  7301. parentSuspense,
  7302. parentComponent,
  7303. node.parentNode,
  7304. // eslint-disable-next-line no-restricted-globals
  7305. document.createElement("div"),
  7306. null,
  7307. namespace,
  7308. slotScopeIds,
  7309. optimized,
  7310. rendererInternals,
  7311. true
  7312. );
  7313. const result = hydrateNode(
  7314. node,
  7315. suspense.pendingBranch = vnode.ssContent,
  7316. parentComponent,
  7317. suspense,
  7318. slotScopeIds,
  7319. optimized
  7320. );
  7321. if (suspense.deps === 0) {
  7322. suspense.resolve(false, true);
  7323. }
  7324. return result;
  7325. }
  7326. function normalizeSuspenseChildren(vnode) {
  7327. const { shapeFlag, children } = vnode;
  7328. const isSlotChildren = shapeFlag & 32;
  7329. vnode.ssContent = normalizeSuspenseSlot(
  7330. isSlotChildren ? children.default : children
  7331. );
  7332. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  7333. }
  7334. function normalizeSuspenseSlot(s) {
  7335. let block;
  7336. if (isFunction(s)) {
  7337. const trackBlock = isBlockTreeEnabled && s._c;
  7338. if (trackBlock) {
  7339. s._d = false;
  7340. openBlock();
  7341. }
  7342. s = s();
  7343. if (trackBlock) {
  7344. s._d = true;
  7345. block = currentBlock;
  7346. closeBlock();
  7347. }
  7348. }
  7349. if (isArray(s)) {
  7350. const singleChild = filterSingleRoot(s);
  7351. if (!!(process.env.NODE_ENV !== "production") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  7352. warn$1(`<Suspense> slots expect a single root node.`);
  7353. }
  7354. s = singleChild;
  7355. }
  7356. s = normalizeVNode(s);
  7357. if (block && !s.dynamicChildren) {
  7358. s.dynamicChildren = block.filter((c) => c !== s);
  7359. }
  7360. return s;
  7361. }
  7362. function queueEffectWithSuspense(fn, suspense) {
  7363. if (suspense && suspense.pendingBranch) {
  7364. if (isArray(fn)) {
  7365. suspense.effects.push(...fn);
  7366. } else {
  7367. suspense.effects.push(fn);
  7368. }
  7369. } else {
  7370. queuePostFlushCb(fn);
  7371. }
  7372. }
  7373. function setActiveBranch(suspense, branch) {
  7374. suspense.activeBranch = branch;
  7375. const { vnode, parentComponent } = suspense;
  7376. let el = branch.el;
  7377. while (!el && branch.component) {
  7378. branch = branch.component.subTree;
  7379. el = branch.el;
  7380. }
  7381. vnode.el = el;
  7382. if (parentComponent && parentComponent.subTree === vnode) {
  7383. parentComponent.vnode.el = el;
  7384. updateHOCHostEl(parentComponent, el);
  7385. }
  7386. }
  7387. function isVNodeSuspensible(vnode) {
  7388. const suspensible = vnode.props && vnode.props.suspensible;
  7389. return suspensible != null && suspensible !== false;
  7390. }
  7391. const Fragment = Symbol.for("v-fgt");
  7392. const Text = Symbol.for("v-txt");
  7393. const Comment = Symbol.for("v-cmt");
  7394. const Static = Symbol.for("v-stc");
  7395. const blockStack = [];
  7396. let currentBlock = null;
  7397. function openBlock(disableTracking = false) {
  7398. blockStack.push(currentBlock = disableTracking ? null : []);
  7399. }
  7400. function closeBlock() {
  7401. blockStack.pop();
  7402. currentBlock = blockStack[blockStack.length - 1] || null;
  7403. }
  7404. let isBlockTreeEnabled = 1;
  7405. function setBlockTracking(value, inVOnce = false) {
  7406. isBlockTreeEnabled += value;
  7407. if (value < 0 && currentBlock && inVOnce) {
  7408. currentBlock.hasOnce = true;
  7409. }
  7410. }
  7411. function setupBlock(vnode) {
  7412. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  7413. closeBlock();
  7414. if (isBlockTreeEnabled > 0 && currentBlock) {
  7415. currentBlock.push(vnode);
  7416. }
  7417. return vnode;
  7418. }
  7419. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  7420. return setupBlock(
  7421. createBaseVNode(
  7422. type,
  7423. props,
  7424. children,
  7425. patchFlag,
  7426. dynamicProps,
  7427. shapeFlag,
  7428. true
  7429. )
  7430. );
  7431. }
  7432. function createBlock(type, props, children, patchFlag, dynamicProps) {
  7433. return setupBlock(
  7434. createVNode(
  7435. type,
  7436. props,
  7437. children,
  7438. patchFlag,
  7439. dynamicProps,
  7440. true
  7441. )
  7442. );
  7443. }
  7444. function isVNode(value) {
  7445. return value ? value.__v_isVNode === true : false;
  7446. }
  7447. function isSameVNodeType(n1, n2) {
  7448. if (!!(process.env.NODE_ENV !== "production") && n2.shapeFlag & 6 && n1.component) {
  7449. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  7450. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  7451. n1.shapeFlag &= -257;
  7452. n2.shapeFlag &= -513;
  7453. return false;
  7454. }
  7455. }
  7456. return n1.type === n2.type && n1.key === n2.key;
  7457. }
  7458. let vnodeArgsTransformer;
  7459. function transformVNodeArgs(transformer) {
  7460. vnodeArgsTransformer = transformer;
  7461. }
  7462. const createVNodeWithArgsTransform = (...args) => {
  7463. return _createVNode(
  7464. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  7465. );
  7466. };
  7467. const normalizeKey = ({ key }) => key != null ? key : null;
  7468. const normalizeRef = ({
  7469. ref,
  7470. ref_key,
  7471. ref_for
  7472. }) => {
  7473. if (typeof ref === "number") {
  7474. ref = "" + ref;
  7475. }
  7476. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  7477. };
  7478. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  7479. const vnode = {
  7480. __v_isVNode: true,
  7481. __v_skip: true,
  7482. type,
  7483. props,
  7484. key: props && normalizeKey(props),
  7485. ref: props && normalizeRef(props),
  7486. scopeId: currentScopeId,
  7487. slotScopeIds: null,
  7488. children,
  7489. component: null,
  7490. suspense: null,
  7491. ssContent: null,
  7492. ssFallback: null,
  7493. dirs: null,
  7494. transition: null,
  7495. el: null,
  7496. anchor: null,
  7497. target: null,
  7498. targetStart: null,
  7499. targetAnchor: null,
  7500. staticCount: 0,
  7501. shapeFlag,
  7502. patchFlag,
  7503. dynamicProps,
  7504. dynamicChildren: null,
  7505. appContext: null,
  7506. ctx: currentRenderingInstance
  7507. };
  7508. if (needFullChildrenNormalization) {
  7509. normalizeChildren(vnode, children);
  7510. if (shapeFlag & 128) {
  7511. type.normalize(vnode);
  7512. }
  7513. } else if (children) {
  7514. vnode.shapeFlag |= isString(children) ? 8 : 16;
  7515. }
  7516. if (!!(process.env.NODE_ENV !== "production") && vnode.key !== vnode.key) {
  7517. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  7518. }
  7519. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  7520. !isBlockNode && // has current parent block
  7521. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  7522. // component nodes also should always be patched, because even if the
  7523. // component doesn't need to update, it needs to persist the instance on to
  7524. // the next vnode so that it can be properly unmounted later.
  7525. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  7526. // vnode should not be considered dynamic due to handler caching.
  7527. vnode.patchFlag !== 32) {
  7528. currentBlock.push(vnode);
  7529. }
  7530. return vnode;
  7531. }
  7532. const createVNode = !!(process.env.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode;
  7533. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  7534. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  7535. if (!!(process.env.NODE_ENV !== "production") && !type) {
  7536. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  7537. }
  7538. type = Comment;
  7539. }
  7540. if (isVNode(type)) {
  7541. const cloned = cloneVNode(
  7542. type,
  7543. props,
  7544. true
  7545. /* mergeRef: true */
  7546. );
  7547. if (children) {
  7548. normalizeChildren(cloned, children);
  7549. }
  7550. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  7551. if (cloned.shapeFlag & 6) {
  7552. currentBlock[currentBlock.indexOf(type)] = cloned;
  7553. } else {
  7554. currentBlock.push(cloned);
  7555. }
  7556. }
  7557. cloned.patchFlag = -2;
  7558. return cloned;
  7559. }
  7560. if (isClassComponent(type)) {
  7561. type = type.__vccOpts;
  7562. }
  7563. if (props) {
  7564. props = guardReactiveProps(props);
  7565. let { class: klass, style } = props;
  7566. if (klass && !isString(klass)) {
  7567. props.class = normalizeClass(klass);
  7568. }
  7569. if (isObject(style)) {
  7570. if (isProxy(style) && !isArray(style)) {
  7571. style = extend({}, style);
  7572. }
  7573. props.style = normalizeStyle(style);
  7574. }
  7575. }
  7576. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  7577. if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
  7578. type = toRaw(type);
  7579. warn$1(
  7580. `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\`.`,
  7581. `
  7582. Component that was made reactive: `,
  7583. type
  7584. );
  7585. }
  7586. return createBaseVNode(
  7587. type,
  7588. props,
  7589. children,
  7590. patchFlag,
  7591. dynamicProps,
  7592. shapeFlag,
  7593. isBlockNode,
  7594. true
  7595. );
  7596. }
  7597. function guardReactiveProps(props) {
  7598. if (!props) return null;
  7599. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  7600. }
  7601. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  7602. const { props, ref, patchFlag, children, transition } = vnode;
  7603. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  7604. const cloned = {
  7605. __v_isVNode: true,
  7606. __v_skip: true,
  7607. type: vnode.type,
  7608. props: mergedProps,
  7609. key: mergedProps && normalizeKey(mergedProps),
  7610. ref: extraProps && extraProps.ref ? (
  7611. // #2078 in the case of <component :is="vnode" ref="extra"/>
  7612. // if the vnode itself already has a ref, cloneVNode will need to merge
  7613. // the refs so the single vnode can be set on multiple refs
  7614. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  7615. ) : ref,
  7616. scopeId: vnode.scopeId,
  7617. slotScopeIds: vnode.slotScopeIds,
  7618. children: !!(process.env.NODE_ENV !== "production") && patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  7619. target: vnode.target,
  7620. targetStart: vnode.targetStart,
  7621. targetAnchor: vnode.targetAnchor,
  7622. staticCount: vnode.staticCount,
  7623. shapeFlag: vnode.shapeFlag,
  7624. // if the vnode is cloned with extra props, we can no longer assume its
  7625. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  7626. // note: preserve flag for fragments since they use the flag for children
  7627. // fast paths only.
  7628. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  7629. dynamicProps: vnode.dynamicProps,
  7630. dynamicChildren: vnode.dynamicChildren,
  7631. appContext: vnode.appContext,
  7632. dirs: vnode.dirs,
  7633. transition,
  7634. // These should technically only be non-null on mounted VNodes. However,
  7635. // they *should* be copied for kept-alive vnodes. So we just always copy
  7636. // them since them being non-null during a mount doesn't affect the logic as
  7637. // they will simply be overwritten.
  7638. component: vnode.component,
  7639. suspense: vnode.suspense,
  7640. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  7641. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  7642. placeholder: vnode.placeholder,
  7643. el: vnode.el,
  7644. anchor: vnode.anchor,
  7645. ctx: vnode.ctx,
  7646. ce: vnode.ce
  7647. };
  7648. if (transition && cloneTransition) {
  7649. setTransitionHooks(
  7650. cloned,
  7651. transition.clone(cloned)
  7652. );
  7653. }
  7654. return cloned;
  7655. }
  7656. function deepCloneVNode(vnode) {
  7657. const cloned = cloneVNode(vnode);
  7658. if (isArray(vnode.children)) {
  7659. cloned.children = vnode.children.map(deepCloneVNode);
  7660. }
  7661. return cloned;
  7662. }
  7663. function createTextVNode(text = " ", flag = 0) {
  7664. return createVNode(Text, null, text, flag);
  7665. }
  7666. function createStaticVNode(content, numberOfNodes) {
  7667. const vnode = createVNode(Static, null, content);
  7668. vnode.staticCount = numberOfNodes;
  7669. return vnode;
  7670. }
  7671. function createCommentVNode(text = "", asBlock = false) {
  7672. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  7673. }
  7674. function normalizeVNode(child) {
  7675. if (child == null || typeof child === "boolean") {
  7676. return createVNode(Comment);
  7677. } else if (isArray(child)) {
  7678. return createVNode(
  7679. Fragment,
  7680. null,
  7681. // #3666, avoid reference pollution when reusing vnode
  7682. child.slice()
  7683. );
  7684. } else if (isVNode(child)) {
  7685. return cloneIfMounted(child);
  7686. } else {
  7687. return createVNode(Text, null, String(child));
  7688. }
  7689. }
  7690. function cloneIfMounted(child) {
  7691. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  7692. }
  7693. function normalizeChildren(vnode, children) {
  7694. let type = 0;
  7695. const { shapeFlag } = vnode;
  7696. if (children == null) {
  7697. children = null;
  7698. } else if (isArray(children)) {
  7699. type = 16;
  7700. } else if (typeof children === "object") {
  7701. if (shapeFlag & (1 | 64)) {
  7702. const slot = children.default;
  7703. if (slot) {
  7704. slot._c && (slot._d = false);
  7705. normalizeChildren(vnode, slot());
  7706. slot._c && (slot._d = true);
  7707. }
  7708. return;
  7709. } else {
  7710. type = 32;
  7711. const slotFlag = children._;
  7712. if (!slotFlag && !isInternalObject(children)) {
  7713. children._ctx = currentRenderingInstance;
  7714. } else if (slotFlag === 3 && currentRenderingInstance) {
  7715. if (currentRenderingInstance.slots._ === 1) {
  7716. children._ = 1;
  7717. } else {
  7718. children._ = 2;
  7719. vnode.patchFlag |= 1024;
  7720. }
  7721. }
  7722. }
  7723. } else if (isFunction(children)) {
  7724. children = { default: children, _ctx: currentRenderingInstance };
  7725. type = 32;
  7726. } else {
  7727. children = String(children);
  7728. if (shapeFlag & 64) {
  7729. type = 16;
  7730. children = [createTextVNode(children)];
  7731. } else {
  7732. type = 8;
  7733. }
  7734. }
  7735. vnode.children = children;
  7736. vnode.shapeFlag |= type;
  7737. }
  7738. function mergeProps(...args) {
  7739. const ret = {};
  7740. for (let i = 0; i < args.length; i++) {
  7741. const toMerge = args[i];
  7742. for (const key in toMerge) {
  7743. if (key === "class") {
  7744. if (ret.class !== toMerge.class) {
  7745. ret.class = normalizeClass([ret.class, toMerge.class]);
  7746. }
  7747. } else if (key === "style") {
  7748. ret.style = normalizeStyle([ret.style, toMerge.style]);
  7749. } else if (isOn(key)) {
  7750. const existing = ret[key];
  7751. const incoming = toMerge[key];
  7752. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  7753. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  7754. }
  7755. } else if (key !== "") {
  7756. ret[key] = toMerge[key];
  7757. }
  7758. }
  7759. }
  7760. return ret;
  7761. }
  7762. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  7763. callWithAsyncErrorHandling(hook, instance, 7, [
  7764. vnode,
  7765. prevVNode
  7766. ]);
  7767. }
  7768. const emptyAppContext = createAppContext();
  7769. let uid = 0;
  7770. function createComponentInstance(vnode, parent, suspense) {
  7771. const type = vnode.type;
  7772. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  7773. const instance = {
  7774. uid: uid++,
  7775. vnode,
  7776. type,
  7777. parent,
  7778. appContext,
  7779. root: null,
  7780. // to be immediately set
  7781. next: null,
  7782. subTree: null,
  7783. // will be set synchronously right after creation
  7784. effect: null,
  7785. update: null,
  7786. // will be set synchronously right after creation
  7787. job: null,
  7788. scope: new EffectScope(
  7789. true
  7790. /* detached */
  7791. ),
  7792. render: null,
  7793. proxy: null,
  7794. exposed: null,
  7795. exposeProxy: null,
  7796. withProxy: null,
  7797. provides: parent ? parent.provides : Object.create(appContext.provides),
  7798. ids: parent ? parent.ids : ["", 0, 0],
  7799. accessCache: null,
  7800. renderCache: [],
  7801. // local resolved assets
  7802. components: null,
  7803. directives: null,
  7804. // resolved props and emits options
  7805. propsOptions: normalizePropsOptions(type, appContext),
  7806. emitsOptions: normalizeEmitsOptions(type, appContext),
  7807. // emit
  7808. emit: null,
  7809. // to be set immediately
  7810. emitted: null,
  7811. // props default value
  7812. propsDefaults: EMPTY_OBJ,
  7813. // inheritAttrs
  7814. inheritAttrs: type.inheritAttrs,
  7815. // state
  7816. ctx: EMPTY_OBJ,
  7817. data: EMPTY_OBJ,
  7818. props: EMPTY_OBJ,
  7819. attrs: EMPTY_OBJ,
  7820. slots: EMPTY_OBJ,
  7821. refs: EMPTY_OBJ,
  7822. setupState: EMPTY_OBJ,
  7823. setupContext: null,
  7824. // suspense related
  7825. suspense,
  7826. suspenseId: suspense ? suspense.pendingId : 0,
  7827. asyncDep: null,
  7828. asyncResolved: false,
  7829. // lifecycle hooks
  7830. // not using enums here because it results in computed properties
  7831. isMounted: false,
  7832. isUnmounted: false,
  7833. isDeactivated: false,
  7834. bc: null,
  7835. c: null,
  7836. bm: null,
  7837. m: null,
  7838. bu: null,
  7839. u: null,
  7840. um: null,
  7841. bum: null,
  7842. da: null,
  7843. a: null,
  7844. rtg: null,
  7845. rtc: null,
  7846. ec: null,
  7847. sp: null
  7848. };
  7849. if (!!(process.env.NODE_ENV !== "production")) {
  7850. instance.ctx = createDevRenderContext(instance);
  7851. } else {
  7852. instance.ctx = { _: instance };
  7853. }
  7854. instance.root = parent ? parent.root : instance;
  7855. instance.emit = emit.bind(null, instance);
  7856. if (vnode.ce) {
  7857. vnode.ce(instance);
  7858. }
  7859. return instance;
  7860. }
  7861. let currentInstance = null;
  7862. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  7863. let internalSetCurrentInstance;
  7864. let setInSSRSetupState;
  7865. {
  7866. const g = getGlobalThis();
  7867. const registerGlobalSetter = (key, setter) => {
  7868. let setters;
  7869. if (!(setters = g[key])) setters = g[key] = [];
  7870. setters.push(setter);
  7871. return (v) => {
  7872. if (setters.length > 1) setters.forEach((set) => set(v));
  7873. else setters[0](v);
  7874. };
  7875. };
  7876. internalSetCurrentInstance = registerGlobalSetter(
  7877. `__VUE_INSTANCE_SETTERS__`,
  7878. (v) => currentInstance = v
  7879. );
  7880. setInSSRSetupState = registerGlobalSetter(
  7881. `__VUE_SSR_SETTERS__`,
  7882. (v) => isInSSRComponentSetup = v
  7883. );
  7884. }
  7885. const setCurrentInstance = (instance) => {
  7886. const prev = currentInstance;
  7887. internalSetCurrentInstance(instance);
  7888. instance.scope.on();
  7889. return () => {
  7890. instance.scope.off();
  7891. internalSetCurrentInstance(prev);
  7892. };
  7893. };
  7894. const unsetCurrentInstance = () => {
  7895. currentInstance && currentInstance.scope.off();
  7896. internalSetCurrentInstance(null);
  7897. };
  7898. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  7899. function validateComponentName(name, { isNativeTag }) {
  7900. if (isBuiltInTag(name) || isNativeTag(name)) {
  7901. warn$1(
  7902. "Do not use built-in or reserved HTML elements as component id: " + name
  7903. );
  7904. }
  7905. }
  7906. function isStatefulComponent(instance) {
  7907. return instance.vnode.shapeFlag & 4;
  7908. }
  7909. let isInSSRComponentSetup = false;
  7910. function setupComponent(instance, isSSR = false, optimized = false) {
  7911. isSSR && setInSSRSetupState(isSSR);
  7912. const { props, children } = instance.vnode;
  7913. const isStateful = isStatefulComponent(instance);
  7914. initProps(instance, props, isStateful, isSSR);
  7915. initSlots(instance, children, optimized || isSSR);
  7916. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  7917. isSSR && setInSSRSetupState(false);
  7918. return setupResult;
  7919. }
  7920. function setupStatefulComponent(instance, isSSR) {
  7921. var _a;
  7922. const Component = instance.type;
  7923. if (!!(process.env.NODE_ENV !== "production")) {
  7924. if (Component.name) {
  7925. validateComponentName(Component.name, instance.appContext.config);
  7926. }
  7927. if (Component.components) {
  7928. const names = Object.keys(Component.components);
  7929. for (let i = 0; i < names.length; i++) {
  7930. validateComponentName(names[i], instance.appContext.config);
  7931. }
  7932. }
  7933. if (Component.directives) {
  7934. const names = Object.keys(Component.directives);
  7935. for (let i = 0; i < names.length; i++) {
  7936. validateDirectiveName(names[i]);
  7937. }
  7938. }
  7939. if (Component.compilerOptions && isRuntimeOnly()) {
  7940. warn$1(
  7941. `"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.`
  7942. );
  7943. }
  7944. }
  7945. instance.accessCache = /* @__PURE__ */ Object.create(null);
  7946. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  7947. if (!!(process.env.NODE_ENV !== "production")) {
  7948. exposePropsOnRenderContext(instance);
  7949. }
  7950. const { setup } = Component;
  7951. if (setup) {
  7952. pauseTracking();
  7953. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  7954. const reset = setCurrentInstance(instance);
  7955. const setupResult = callWithErrorHandling(
  7956. setup,
  7957. instance,
  7958. 0,
  7959. [
  7960. !!(process.env.NODE_ENV !== "production") ? shallowReadonly(instance.props) : instance.props,
  7961. setupContext
  7962. ]
  7963. );
  7964. const isAsyncSetup = isPromise(setupResult);
  7965. resetTracking();
  7966. reset();
  7967. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  7968. markAsyncBoundary(instance);
  7969. }
  7970. if (isAsyncSetup) {
  7971. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  7972. if (isSSR) {
  7973. return setupResult.then((resolvedResult) => {
  7974. handleSetupResult(instance, resolvedResult, isSSR);
  7975. }).catch((e) => {
  7976. handleError(e, instance, 0);
  7977. });
  7978. } else {
  7979. instance.asyncDep = setupResult;
  7980. if (!!(process.env.NODE_ENV !== "production") && !instance.suspense) {
  7981. const name = (_a = Component.name) != null ? _a : "Anonymous";
  7982. warn$1(
  7983. `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.`
  7984. );
  7985. }
  7986. }
  7987. } else {
  7988. handleSetupResult(instance, setupResult, isSSR);
  7989. }
  7990. } else {
  7991. finishComponentSetup(instance, isSSR);
  7992. }
  7993. }
  7994. function handleSetupResult(instance, setupResult, isSSR) {
  7995. if (isFunction(setupResult)) {
  7996. if (instance.type.__ssrInlineRender) {
  7997. instance.ssrRender = setupResult;
  7998. } else {
  7999. instance.render = setupResult;
  8000. }
  8001. } else if (isObject(setupResult)) {
  8002. if (!!(process.env.NODE_ENV !== "production") && isVNode(setupResult)) {
  8003. warn$1(
  8004. `setup() should not return VNodes directly - return a render function instead.`
  8005. );
  8006. }
  8007. if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
  8008. instance.devtoolsRawSetupState = setupResult;
  8009. }
  8010. instance.setupState = proxyRefs(setupResult);
  8011. if (!!(process.env.NODE_ENV !== "production")) {
  8012. exposeSetupStateOnRenderContext(instance);
  8013. }
  8014. } else if (!!(process.env.NODE_ENV !== "production") && setupResult !== void 0) {
  8015. warn$1(
  8016. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  8017. );
  8018. }
  8019. finishComponentSetup(instance, isSSR);
  8020. }
  8021. let compile;
  8022. let installWithProxy;
  8023. function registerRuntimeCompiler(_compile) {
  8024. compile = _compile;
  8025. installWithProxy = (i) => {
  8026. if (i.render._rc) {
  8027. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  8028. }
  8029. };
  8030. }
  8031. const isRuntimeOnly = () => !compile;
  8032. function finishComponentSetup(instance, isSSR, skipOptions) {
  8033. const Component = instance.type;
  8034. if (!instance.render) {
  8035. if (!isSSR && compile && !Component.render) {
  8036. const template = Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template;
  8037. if (template) {
  8038. if (!!(process.env.NODE_ENV !== "production")) {
  8039. startMeasure(instance, `compile`);
  8040. }
  8041. const { isCustomElement, compilerOptions } = instance.appContext.config;
  8042. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  8043. const finalCompilerOptions = extend(
  8044. extend(
  8045. {
  8046. isCustomElement,
  8047. delimiters
  8048. },
  8049. compilerOptions
  8050. ),
  8051. componentCompilerOptions
  8052. );
  8053. Component.render = compile(template, finalCompilerOptions);
  8054. if (!!(process.env.NODE_ENV !== "production")) {
  8055. endMeasure(instance, `compile`);
  8056. }
  8057. }
  8058. }
  8059. instance.render = Component.render || NOOP;
  8060. if (installWithProxy) {
  8061. installWithProxy(instance);
  8062. }
  8063. }
  8064. if (__VUE_OPTIONS_API__ && true) {
  8065. const reset = setCurrentInstance(instance);
  8066. pauseTracking();
  8067. try {
  8068. applyOptions(instance);
  8069. } finally {
  8070. resetTracking();
  8071. reset();
  8072. }
  8073. }
  8074. if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
  8075. if (!compile && Component.template) {
  8076. warn$1(
  8077. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` )
  8078. );
  8079. } else {
  8080. warn$1(`Component is missing template or render function: `, Component);
  8081. }
  8082. }
  8083. }
  8084. const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
  8085. get(target, key) {
  8086. markAttrsAccessed();
  8087. track(target, "get", "");
  8088. return target[key];
  8089. },
  8090. set() {
  8091. warn$1(`setupContext.attrs is readonly.`);
  8092. return false;
  8093. },
  8094. deleteProperty() {
  8095. warn$1(`setupContext.attrs is readonly.`);
  8096. return false;
  8097. }
  8098. } : {
  8099. get(target, key) {
  8100. track(target, "get", "");
  8101. return target[key];
  8102. }
  8103. };
  8104. function getSlotsProxy(instance) {
  8105. return new Proxy(instance.slots, {
  8106. get(target, key) {
  8107. track(instance, "get", "$slots");
  8108. return target[key];
  8109. }
  8110. });
  8111. }
  8112. function createSetupContext(instance) {
  8113. const expose = (exposed) => {
  8114. if (!!(process.env.NODE_ENV !== "production")) {
  8115. if (instance.exposed) {
  8116. warn$1(`expose() should be called only once per setup().`);
  8117. }
  8118. if (exposed != null) {
  8119. let exposedType = typeof exposed;
  8120. if (exposedType === "object") {
  8121. if (isArray(exposed)) {
  8122. exposedType = "array";
  8123. } else if (isRef(exposed)) {
  8124. exposedType = "ref";
  8125. }
  8126. }
  8127. if (exposedType !== "object") {
  8128. warn$1(
  8129. `expose() should be passed a plain object, received ${exposedType}.`
  8130. );
  8131. }
  8132. }
  8133. }
  8134. instance.exposed = exposed || {};
  8135. };
  8136. if (!!(process.env.NODE_ENV !== "production")) {
  8137. let attrsProxy;
  8138. let slotsProxy;
  8139. return Object.freeze({
  8140. get attrs() {
  8141. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  8142. },
  8143. get slots() {
  8144. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  8145. },
  8146. get emit() {
  8147. return (event, ...args) => instance.emit(event, ...args);
  8148. },
  8149. expose
  8150. });
  8151. } else {
  8152. return {
  8153. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  8154. slots: instance.slots,
  8155. emit: instance.emit,
  8156. expose
  8157. };
  8158. }
  8159. }
  8160. function getComponentPublicInstance(instance) {
  8161. if (instance.exposed) {
  8162. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  8163. get(target, key) {
  8164. if (key in target) {
  8165. return target[key];
  8166. } else if (key in publicPropertiesMap) {
  8167. return publicPropertiesMap[key](instance);
  8168. }
  8169. },
  8170. has(target, key) {
  8171. return key in target || key in publicPropertiesMap;
  8172. }
  8173. }));
  8174. } else {
  8175. return instance.proxy;
  8176. }
  8177. }
  8178. const classifyRE = /(?:^|[-_])\w/g;
  8179. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  8180. function getComponentName(Component, includeInferred = true) {
  8181. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  8182. }
  8183. function formatComponentName(instance, Component, isRoot = false) {
  8184. let name = getComponentName(Component);
  8185. if (!name && Component.__file) {
  8186. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  8187. if (match) {
  8188. name = match[1];
  8189. }
  8190. }
  8191. if (!name && instance && instance.parent) {
  8192. const inferFromRegistry = (registry) => {
  8193. for (const key in registry) {
  8194. if (registry[key] === Component) {
  8195. return key;
  8196. }
  8197. }
  8198. };
  8199. name = inferFromRegistry(
  8200. instance.components || instance.parent.type.components
  8201. ) || inferFromRegistry(instance.appContext.components);
  8202. }
  8203. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  8204. }
  8205. function isClassComponent(value) {
  8206. return isFunction(value) && "__vccOpts" in value;
  8207. }
  8208. const computed = (getterOrOptions, debugOptions) => {
  8209. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  8210. if (!!(process.env.NODE_ENV !== "production")) {
  8211. const i = getCurrentInstance();
  8212. if (i && i.appContext.config.warnRecursiveComputed) {
  8213. c._warnRecursive = true;
  8214. }
  8215. }
  8216. return c;
  8217. };
  8218. function h(type, propsOrChildren, children) {
  8219. const doCreateVNode = (type2, props, children2) => {
  8220. setBlockTracking(-1);
  8221. try {
  8222. return createVNode(type2, props, children2);
  8223. } finally {
  8224. setBlockTracking(1);
  8225. }
  8226. };
  8227. const l = arguments.length;
  8228. if (l === 2) {
  8229. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  8230. if (isVNode(propsOrChildren)) {
  8231. return doCreateVNode(type, null, [propsOrChildren]);
  8232. }
  8233. return doCreateVNode(type, propsOrChildren);
  8234. } else {
  8235. return doCreateVNode(type, null, propsOrChildren);
  8236. }
  8237. } else {
  8238. if (l > 3) {
  8239. children = Array.prototype.slice.call(arguments, 2);
  8240. } else if (l === 3 && isVNode(children)) {
  8241. children = [children];
  8242. }
  8243. return doCreateVNode(type, propsOrChildren, children);
  8244. }
  8245. }
  8246. function initCustomFormatter() {
  8247. if (!!!(process.env.NODE_ENV !== "production") || typeof window === "undefined") {
  8248. return;
  8249. }
  8250. const vueStyle = { style: "color:#3ba776" };
  8251. const numberStyle = { style: "color:#1677ff" };
  8252. const stringStyle = { style: "color:#f5222d" };
  8253. const keywordStyle = { style: "color:#eb2f96" };
  8254. const formatter = {
  8255. __vue_custom_formatter: true,
  8256. header(obj) {
  8257. if (!isObject(obj)) {
  8258. return null;
  8259. }
  8260. if (obj.__isVue) {
  8261. return ["div", vueStyle, `VueInstance`];
  8262. } else if (isRef(obj)) {
  8263. pauseTracking();
  8264. const value = obj.value;
  8265. resetTracking();
  8266. return [
  8267. "div",
  8268. {},
  8269. ["span", vueStyle, genRefFlag(obj)],
  8270. "<",
  8271. formatValue(value),
  8272. `>`
  8273. ];
  8274. } else if (isReactive(obj)) {
  8275. return [
  8276. "div",
  8277. {},
  8278. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  8279. "<",
  8280. formatValue(obj),
  8281. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  8282. ];
  8283. } else if (isReadonly(obj)) {
  8284. return [
  8285. "div",
  8286. {},
  8287. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  8288. "<",
  8289. formatValue(obj),
  8290. ">"
  8291. ];
  8292. }
  8293. return null;
  8294. },
  8295. hasBody(obj) {
  8296. return obj && obj.__isVue;
  8297. },
  8298. body(obj) {
  8299. if (obj && obj.__isVue) {
  8300. return [
  8301. "div",
  8302. {},
  8303. ...formatInstance(obj.$)
  8304. ];
  8305. }
  8306. }
  8307. };
  8308. function formatInstance(instance) {
  8309. const blocks = [];
  8310. if (instance.type.props && instance.props) {
  8311. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  8312. }
  8313. if (instance.setupState !== EMPTY_OBJ) {
  8314. blocks.push(createInstanceBlock("setup", instance.setupState));
  8315. }
  8316. if (instance.data !== EMPTY_OBJ) {
  8317. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  8318. }
  8319. const computed = extractKeys(instance, "computed");
  8320. if (computed) {
  8321. blocks.push(createInstanceBlock("computed", computed));
  8322. }
  8323. const injected = extractKeys(instance, "inject");
  8324. if (injected) {
  8325. blocks.push(createInstanceBlock("injected", injected));
  8326. }
  8327. blocks.push([
  8328. "div",
  8329. {},
  8330. [
  8331. "span",
  8332. {
  8333. style: keywordStyle.style + ";opacity:0.66"
  8334. },
  8335. "$ (internal): "
  8336. ],
  8337. ["object", { object: instance }]
  8338. ]);
  8339. return blocks;
  8340. }
  8341. function createInstanceBlock(type, target) {
  8342. target = extend({}, target);
  8343. if (!Object.keys(target).length) {
  8344. return ["span", {}];
  8345. }
  8346. return [
  8347. "div",
  8348. { style: "line-height:1.25em;margin-bottom:0.6em" },
  8349. [
  8350. "div",
  8351. {
  8352. style: "color:#476582"
  8353. },
  8354. type
  8355. ],
  8356. [
  8357. "div",
  8358. {
  8359. style: "padding-left:1.25em"
  8360. },
  8361. ...Object.keys(target).map((key) => {
  8362. return [
  8363. "div",
  8364. {},
  8365. ["span", keywordStyle, key + ": "],
  8366. formatValue(target[key], false)
  8367. ];
  8368. })
  8369. ]
  8370. ];
  8371. }
  8372. function formatValue(v, asRaw = true) {
  8373. if (typeof v === "number") {
  8374. return ["span", numberStyle, v];
  8375. } else if (typeof v === "string") {
  8376. return ["span", stringStyle, JSON.stringify(v)];
  8377. } else if (typeof v === "boolean") {
  8378. return ["span", keywordStyle, v];
  8379. } else if (isObject(v)) {
  8380. return ["object", { object: asRaw ? toRaw(v) : v }];
  8381. } else {
  8382. return ["span", stringStyle, String(v)];
  8383. }
  8384. }
  8385. function extractKeys(instance, type) {
  8386. const Comp = instance.type;
  8387. if (isFunction(Comp)) {
  8388. return;
  8389. }
  8390. const extracted = {};
  8391. for (const key in instance.ctx) {
  8392. if (isKeyOfType(Comp, key, type)) {
  8393. extracted[key] = instance.ctx[key];
  8394. }
  8395. }
  8396. return extracted;
  8397. }
  8398. function isKeyOfType(Comp, key, type) {
  8399. const opts = Comp[type];
  8400. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  8401. return true;
  8402. }
  8403. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  8404. return true;
  8405. }
  8406. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  8407. return true;
  8408. }
  8409. }
  8410. function genRefFlag(v) {
  8411. if (isShallow(v)) {
  8412. return `ShallowRef`;
  8413. }
  8414. if (v.effect) {
  8415. return `ComputedRef`;
  8416. }
  8417. return `Ref`;
  8418. }
  8419. if (window.devtoolsFormatters) {
  8420. window.devtoolsFormatters.push(formatter);
  8421. } else {
  8422. window.devtoolsFormatters = [formatter];
  8423. }
  8424. }
  8425. function withMemo(memo, render, cache, index) {
  8426. const cached = cache[index];
  8427. if (cached && isMemoSame(cached, memo)) {
  8428. return cached;
  8429. }
  8430. const ret = render();
  8431. ret.memo = memo.slice();
  8432. ret.cacheIndex = index;
  8433. return cache[index] = ret;
  8434. }
  8435. function isMemoSame(cached, memo) {
  8436. const prev = cached.memo;
  8437. if (prev.length != memo.length) {
  8438. return false;
  8439. }
  8440. for (let i = 0; i < prev.length; i++) {
  8441. if (hasChanged(prev[i], memo[i])) {
  8442. return false;
  8443. }
  8444. }
  8445. if (isBlockTreeEnabled > 0 && currentBlock) {
  8446. currentBlock.push(cached);
  8447. }
  8448. return true;
  8449. }
  8450. const version = "3.5.21";
  8451. const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
  8452. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  8453. const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
  8454. const setDevtoolsHook = !!(process.env.NODE_ENV !== "production") || true ? setDevtoolsHook$1 : NOOP;
  8455. const _ssrUtils = {
  8456. createComponentInstance,
  8457. setupComponent,
  8458. renderComponentRoot,
  8459. setCurrentRenderingInstance,
  8460. isVNode: isVNode,
  8461. normalizeVNode,
  8462. getComponentPublicInstance,
  8463. ensureValidVNode,
  8464. pushWarningContext,
  8465. popWarningContext
  8466. };
  8467. const ssrUtils = _ssrUtils ;
  8468. const resolveFilter = null;
  8469. const compatUtils = null;
  8470. const DeprecationTypes = null;
  8471. export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };