runtime-core.esm-bundler.js 266 KB

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