vue.runtime.esm.js 296 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785
  1. /*!
  2. * Vue.js v2.7.13
  3. * (c) 2014-2022 Evan You
  4. * Released under the MIT License.
  5. */
  6. var emptyObject = Object.freeze({});
  7. var isArray = Array.isArray;
  8. // These helpers produce better VM code in JS engines due to their
  9. // explicitness and function inlining.
  10. function isUndef(v) {
  11. return v === undefined || v === null;
  12. }
  13. function isDef(v) {
  14. return v !== undefined && v !== null;
  15. }
  16. function isTrue(v) {
  17. return v === true;
  18. }
  19. function isFalse(v) {
  20. return v === false;
  21. }
  22. /**
  23. * Check if value is primitive.
  24. */
  25. function isPrimitive(value) {
  26. return (typeof value === 'string' ||
  27. typeof value === 'number' ||
  28. // $flow-disable-line
  29. typeof value === 'symbol' ||
  30. typeof value === 'boolean');
  31. }
  32. function isFunction(value) {
  33. return typeof value === 'function';
  34. }
  35. /**
  36. * Quick object check - this is primarily used to tell
  37. * objects from primitive values when we know the value
  38. * is a JSON-compliant type.
  39. */
  40. function isObject(obj) {
  41. return obj !== null && typeof obj === 'object';
  42. }
  43. /**
  44. * Get the raw type string of a value, e.g., [object Object].
  45. */
  46. var _toString = Object.prototype.toString;
  47. function toRawType(value) {
  48. return _toString.call(value).slice(8, -1);
  49. }
  50. /**
  51. * Strict object type check. Only returns true
  52. * for plain JavaScript objects.
  53. */
  54. function isPlainObject(obj) {
  55. return _toString.call(obj) === '[object Object]';
  56. }
  57. function isRegExp(v) {
  58. return _toString.call(v) === '[object RegExp]';
  59. }
  60. /**
  61. * Check if val is a valid array index.
  62. */
  63. function isValidArrayIndex(val) {
  64. var n = parseFloat(String(val));
  65. return n >= 0 && Math.floor(n) === n && isFinite(val);
  66. }
  67. function isPromise(val) {
  68. return (isDef(val) &&
  69. typeof val.then === 'function' &&
  70. typeof val.catch === 'function');
  71. }
  72. /**
  73. * Convert a value to a string that is actually rendered.
  74. */
  75. function toString(val) {
  76. return val == null
  77. ? ''
  78. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  79. ? JSON.stringify(val, null, 2)
  80. : String(val);
  81. }
  82. /**
  83. * Convert an input value to a number for persistence.
  84. * If the conversion fails, return original string.
  85. */
  86. function toNumber(val) {
  87. var n = parseFloat(val);
  88. return isNaN(n) ? val : n;
  89. }
  90. /**
  91. * Make a map and return a function for checking if a key
  92. * is in that map.
  93. */
  94. function makeMap(str, expectsLowerCase) {
  95. var map = Object.create(null);
  96. var list = str.split(',');
  97. for (var i = 0; i < list.length; i++) {
  98. map[list[i]] = true;
  99. }
  100. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  101. }
  102. /**
  103. * Check if a tag is a built-in tag.
  104. */
  105. var isBuiltInTag = makeMap('slot,component', true);
  106. /**
  107. * Check if an attribute is a reserved attribute.
  108. */
  109. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  110. /**
  111. * Remove an item from an array.
  112. */
  113. function remove$2(arr, item) {
  114. var len = arr.length;
  115. if (len) {
  116. // fast path for the only / last item
  117. if (item === arr[len - 1]) {
  118. arr.length = len - 1;
  119. return;
  120. }
  121. var index = arr.indexOf(item);
  122. if (index > -1) {
  123. return arr.splice(index, 1);
  124. }
  125. }
  126. }
  127. /**
  128. * Check whether an object has the property.
  129. */
  130. var hasOwnProperty = Object.prototype.hasOwnProperty;
  131. function hasOwn(obj, key) {
  132. return hasOwnProperty.call(obj, key);
  133. }
  134. /**
  135. * Create a cached version of a pure function.
  136. */
  137. function cached(fn) {
  138. var cache = Object.create(null);
  139. return function cachedFn(str) {
  140. var hit = cache[str];
  141. return hit || (cache[str] = fn(str));
  142. };
  143. }
  144. /**
  145. * Camelize a hyphen-delimited string.
  146. */
  147. var camelizeRE = /-(\w)/g;
  148. var camelize = cached(function (str) {
  149. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  150. });
  151. /**
  152. * Capitalize a string.
  153. */
  154. var capitalize = cached(function (str) {
  155. return str.charAt(0).toUpperCase() + str.slice(1);
  156. });
  157. /**
  158. * Hyphenate a camelCase string.
  159. */
  160. var hyphenateRE = /\B([A-Z])/g;
  161. var hyphenate = cached(function (str) {
  162. return str.replace(hyphenateRE, '-$1').toLowerCase();
  163. });
  164. /**
  165. * Simple bind polyfill for environments that do not support it,
  166. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  167. * since native bind is now performant enough in most browsers.
  168. * But removing it would mean breaking code that was able to run in
  169. * PhantomJS 1.x, so this must be kept for backward compatibility.
  170. */
  171. /* istanbul ignore next */
  172. function polyfillBind(fn, ctx) {
  173. function boundFn(a) {
  174. var l = arguments.length;
  175. return l
  176. ? l > 1
  177. ? fn.apply(ctx, arguments)
  178. : fn.call(ctx, a)
  179. : fn.call(ctx);
  180. }
  181. boundFn._length = fn.length;
  182. return boundFn;
  183. }
  184. function nativeBind(fn, ctx) {
  185. return fn.bind(ctx);
  186. }
  187. // @ts-expect-error bind cannot be `undefined`
  188. var bind = Function.prototype.bind ? nativeBind : polyfillBind;
  189. /**
  190. * Convert an Array-like object to a real Array.
  191. */
  192. function toArray(list, start) {
  193. start = start || 0;
  194. var i = list.length - start;
  195. var ret = new Array(i);
  196. while (i--) {
  197. ret[i] = list[i + start];
  198. }
  199. return ret;
  200. }
  201. /**
  202. * Mix properties into target object.
  203. */
  204. function extend(to, _from) {
  205. for (var key in _from) {
  206. to[key] = _from[key];
  207. }
  208. return to;
  209. }
  210. /**
  211. * Merge an Array of Objects into a single Object.
  212. */
  213. function toObject(arr) {
  214. var res = {};
  215. for (var i = 0; i < arr.length; i++) {
  216. if (arr[i]) {
  217. extend(res, arr[i]);
  218. }
  219. }
  220. return res;
  221. }
  222. /* eslint-disable no-unused-vars */
  223. /**
  224. * Perform no operation.
  225. * Stubbing args to make Flow happy without leaving useless transpiled code
  226. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  227. */
  228. function noop(a, b, c) { }
  229. /**
  230. * Always return false.
  231. */
  232. var no = function (a, b, c) { return false; };
  233. /* eslint-enable no-unused-vars */
  234. /**
  235. * Return the same value.
  236. */
  237. var identity = function (_) { return _; };
  238. /**
  239. * Check if two values are loosely equal - that is,
  240. * if they are plain objects, do they have the same shape?
  241. */
  242. function looseEqual(a, b) {
  243. if (a === b)
  244. return true;
  245. var isObjectA = isObject(a);
  246. var isObjectB = isObject(b);
  247. if (isObjectA && isObjectB) {
  248. try {
  249. var isArrayA = Array.isArray(a);
  250. var isArrayB = Array.isArray(b);
  251. if (isArrayA && isArrayB) {
  252. return (a.length === b.length &&
  253. a.every(function (e, i) {
  254. return looseEqual(e, b[i]);
  255. }));
  256. }
  257. else if (a instanceof Date && b instanceof Date) {
  258. return a.getTime() === b.getTime();
  259. }
  260. else if (!isArrayA && !isArrayB) {
  261. var keysA = Object.keys(a);
  262. var keysB = Object.keys(b);
  263. return (keysA.length === keysB.length &&
  264. keysA.every(function (key) {
  265. return looseEqual(a[key], b[key]);
  266. }));
  267. }
  268. else {
  269. /* istanbul ignore next */
  270. return false;
  271. }
  272. }
  273. catch (e) {
  274. /* istanbul ignore next */
  275. return false;
  276. }
  277. }
  278. else if (!isObjectA && !isObjectB) {
  279. return String(a) === String(b);
  280. }
  281. else {
  282. return false;
  283. }
  284. }
  285. /**
  286. * Return the first index at which a loosely equal value can be
  287. * found in the array (if value is a plain object, the array must
  288. * contain an object of the same shape), or -1 if it is not present.
  289. */
  290. function looseIndexOf(arr, val) {
  291. for (var i = 0; i < arr.length; i++) {
  292. if (looseEqual(arr[i], val))
  293. return i;
  294. }
  295. return -1;
  296. }
  297. /**
  298. * Ensure a function is called only once.
  299. */
  300. function once(fn) {
  301. var called = false;
  302. return function () {
  303. if (!called) {
  304. called = true;
  305. fn.apply(this, arguments);
  306. }
  307. };
  308. }
  309. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  310. function hasChanged(x, y) {
  311. if (x === y) {
  312. return x === 0 && 1 / x !== 1 / y;
  313. }
  314. else {
  315. return x === x || y === y;
  316. }
  317. }
  318. var SSR_ATTR = 'data-server-rendered';
  319. var ASSET_TYPES = ['component', 'directive', 'filter'];
  320. var LIFECYCLE_HOOKS = [
  321. 'beforeCreate',
  322. 'created',
  323. 'beforeMount',
  324. 'mounted',
  325. 'beforeUpdate',
  326. 'updated',
  327. 'beforeDestroy',
  328. 'destroyed',
  329. 'activated',
  330. 'deactivated',
  331. 'errorCaptured',
  332. 'serverPrefetch',
  333. 'renderTracked',
  334. 'renderTriggered'
  335. ];
  336. var config = {
  337. /**
  338. * Option merge strategies (used in core/util/options)
  339. */
  340. // $flow-disable-line
  341. optionMergeStrategies: Object.create(null),
  342. /**
  343. * Whether to suppress warnings.
  344. */
  345. silent: false,
  346. /**
  347. * Show production mode tip message on boot?
  348. */
  349. productionTip: process.env.NODE_ENV !== 'production',
  350. /**
  351. * Whether to enable devtools
  352. */
  353. devtools: process.env.NODE_ENV !== 'production',
  354. /**
  355. * Whether to record perf
  356. */
  357. performance: false,
  358. /**
  359. * Error handler for watcher errors
  360. */
  361. errorHandler: null,
  362. /**
  363. * Warn handler for watcher warns
  364. */
  365. warnHandler: null,
  366. /**
  367. * Ignore certain custom elements
  368. */
  369. ignoredElements: [],
  370. /**
  371. * Custom user key aliases for v-on
  372. */
  373. // $flow-disable-line
  374. keyCodes: Object.create(null),
  375. /**
  376. * Check if a tag is reserved so that it cannot be registered as a
  377. * component. This is platform-dependent and may be overwritten.
  378. */
  379. isReservedTag: no,
  380. /**
  381. * Check if an attribute is reserved so that it cannot be used as a component
  382. * prop. This is platform-dependent and may be overwritten.
  383. */
  384. isReservedAttr: no,
  385. /**
  386. * Check if a tag is an unknown element.
  387. * Platform-dependent.
  388. */
  389. isUnknownElement: no,
  390. /**
  391. * Get the namespace of an element
  392. */
  393. getTagNamespace: noop,
  394. /**
  395. * Parse the real tag name for the specific platform.
  396. */
  397. parsePlatformTagName: identity,
  398. /**
  399. * Check if an attribute must be bound using property, e.g. value
  400. * Platform-dependent.
  401. */
  402. mustUseProp: no,
  403. /**
  404. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  405. * This will significantly reduce performance if set to false.
  406. */
  407. async: true,
  408. /**
  409. * Exposed for legacy reasons
  410. */
  411. _lifecycleHooks: LIFECYCLE_HOOKS
  412. };
  413. /**
  414. * unicode letters used for parsing html tags, component names and property paths.
  415. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  416. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  417. */
  418. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  419. /**
  420. * Check if a string starts with $ or _
  421. */
  422. function isReserved(str) {
  423. var c = (str + '').charCodeAt(0);
  424. return c === 0x24 || c === 0x5f;
  425. }
  426. /**
  427. * Define a property.
  428. */
  429. function def(obj, key, val, enumerable) {
  430. Object.defineProperty(obj, key, {
  431. value: val,
  432. enumerable: !!enumerable,
  433. writable: true,
  434. configurable: true
  435. });
  436. }
  437. /**
  438. * Parse simple path.
  439. */
  440. var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
  441. function parsePath(path) {
  442. if (bailRE.test(path)) {
  443. return;
  444. }
  445. var segments = path.split('.');
  446. return function (obj) {
  447. for (var i = 0; i < segments.length; i++) {
  448. if (!obj)
  449. return;
  450. obj = obj[segments[i]];
  451. }
  452. return obj;
  453. };
  454. }
  455. // can we use __proto__?
  456. var hasProto = '__proto__' in {};
  457. // Browser environment sniffing
  458. var inBrowser = typeof window !== 'undefined';
  459. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  460. var isIE = UA && /msie|trident/.test(UA);
  461. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  462. var isEdge = UA && UA.indexOf('edge/') > 0;
  463. UA && UA.indexOf('android') > 0;
  464. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  465. UA && /chrome\/\d+/.test(UA) && !isEdge;
  466. UA && /phantomjs/.test(UA);
  467. var isFF = UA && UA.match(/firefox\/(\d+)/);
  468. // Firefox has a "watch" function on Object.prototype...
  469. // @ts-expect-error firebox support
  470. var nativeWatch = {}.watch;
  471. var supportsPassive = false;
  472. if (inBrowser) {
  473. try {
  474. var opts = {};
  475. Object.defineProperty(opts, 'passive', {
  476. get: function () {
  477. /* istanbul ignore next */
  478. supportsPassive = true;
  479. }
  480. }); // https://github.com/facebook/flow/issues/285
  481. window.addEventListener('test-passive', null, opts);
  482. }
  483. catch (e) { }
  484. }
  485. // this needs to be lazy-evaled because vue may be required before
  486. // vue-server-renderer can set VUE_ENV
  487. var _isServer;
  488. var isServerRendering = function () {
  489. if (_isServer === undefined) {
  490. /* istanbul ignore if */
  491. if (!inBrowser && typeof global !== 'undefined') {
  492. // detect presence of vue-server-renderer and avoid
  493. // Webpack shimming the process
  494. _isServer =
  495. global['process'] && global['process'].env.VUE_ENV === 'server';
  496. }
  497. else {
  498. _isServer = false;
  499. }
  500. }
  501. return _isServer;
  502. };
  503. // detect devtools
  504. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  505. /* istanbul ignore next */
  506. function isNative(Ctor) {
  507. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  508. }
  509. var hasSymbol = typeof Symbol !== 'undefined' &&
  510. isNative(Symbol) &&
  511. typeof Reflect !== 'undefined' &&
  512. isNative(Reflect.ownKeys);
  513. var _Set; // $flow-disable-line
  514. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  515. // use native Set when available.
  516. _Set = Set;
  517. }
  518. else {
  519. // a non-standard Set polyfill that only works with primitive keys.
  520. _Set = /** @class */ (function () {
  521. function Set() {
  522. this.set = Object.create(null);
  523. }
  524. Set.prototype.has = function (key) {
  525. return this.set[key] === true;
  526. };
  527. Set.prototype.add = function (key) {
  528. this.set[key] = true;
  529. };
  530. Set.prototype.clear = function () {
  531. this.set = Object.create(null);
  532. };
  533. return Set;
  534. }());
  535. }
  536. var currentInstance = null;
  537. /**
  538. * This is exposed for compatibility with v3 (e.g. some functions in VueUse
  539. * relies on it). Do not use this internally, just use `currentInstance`.
  540. *
  541. * @internal this function needs manual type declaration because it relies
  542. * on previously manually authored types from Vue 2
  543. */
  544. function getCurrentInstance() {
  545. return currentInstance && { proxy: currentInstance };
  546. }
  547. /**
  548. * @internal
  549. */
  550. function setCurrentInstance(vm) {
  551. if (vm === void 0) { vm = null; }
  552. if (!vm)
  553. currentInstance && currentInstance._scope.off();
  554. currentInstance = vm;
  555. vm && vm._scope.on();
  556. }
  557. /**
  558. * @internal
  559. */
  560. var VNode = /** @class */ (function () {
  561. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  562. this.tag = tag;
  563. this.data = data;
  564. this.children = children;
  565. this.text = text;
  566. this.elm = elm;
  567. this.ns = undefined;
  568. this.context = context;
  569. this.fnContext = undefined;
  570. this.fnOptions = undefined;
  571. this.fnScopeId = undefined;
  572. this.key = data && data.key;
  573. this.componentOptions = componentOptions;
  574. this.componentInstance = undefined;
  575. this.parent = undefined;
  576. this.raw = false;
  577. this.isStatic = false;
  578. this.isRootInsert = true;
  579. this.isComment = false;
  580. this.isCloned = false;
  581. this.isOnce = false;
  582. this.asyncFactory = asyncFactory;
  583. this.asyncMeta = undefined;
  584. this.isAsyncPlaceholder = false;
  585. }
  586. Object.defineProperty(VNode.prototype, "child", {
  587. // DEPRECATED: alias for componentInstance for backwards compat.
  588. /* istanbul ignore next */
  589. get: function () {
  590. return this.componentInstance;
  591. },
  592. enumerable: false,
  593. configurable: true
  594. });
  595. return VNode;
  596. }());
  597. var createEmptyVNode = function (text) {
  598. if (text === void 0) { text = ''; }
  599. var node = new VNode();
  600. node.text = text;
  601. node.isComment = true;
  602. return node;
  603. };
  604. function createTextVNode(val) {
  605. return new VNode(undefined, undefined, undefined, String(val));
  606. }
  607. // optimized shallow clone
  608. // used for static nodes and slot nodes because they may be reused across
  609. // multiple renders, cloning them avoids errors when DOM manipulations rely
  610. // on their elm reference.
  611. function cloneVNode(vnode) {
  612. var cloned = new VNode(vnode.tag, vnode.data,
  613. // #7975
  614. // clone children array to avoid mutating original in case of cloning
  615. // a child.
  616. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  617. cloned.ns = vnode.ns;
  618. cloned.isStatic = vnode.isStatic;
  619. cloned.key = vnode.key;
  620. cloned.isComment = vnode.isComment;
  621. cloned.fnContext = vnode.fnContext;
  622. cloned.fnOptions = vnode.fnOptions;
  623. cloned.fnScopeId = vnode.fnScopeId;
  624. cloned.asyncMeta = vnode.asyncMeta;
  625. cloned.isCloned = true;
  626. return cloned;
  627. }
  628. /******************************************************************************
  629. Copyright (c) Microsoft Corporation.
  630. Permission to use, copy, modify, and/or distribute this software for any
  631. purpose with or without fee is hereby granted.
  632. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  633. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  634. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  635. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  636. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  637. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  638. PERFORMANCE OF THIS SOFTWARE.
  639. ***************************************************************************** */
  640. var __assign = function() {
  641. __assign = Object.assign || function __assign(t) {
  642. for (var s, i = 1, n = arguments.length; i < n; i++) {
  643. s = arguments[i];
  644. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  645. }
  646. return t;
  647. };
  648. return __assign.apply(this, arguments);
  649. };
  650. var uid$2 = 0;
  651. var pendingCleanupDeps = [];
  652. var cleanupDeps = function () {
  653. for (var i = 0; i < pendingCleanupDeps.length; i++) {
  654. var dep = pendingCleanupDeps[i];
  655. dep.subs = dep.subs.filter(function (s) { return s; });
  656. dep._pending = false;
  657. }
  658. pendingCleanupDeps.length = 0;
  659. };
  660. /**
  661. * A dep is an observable that can have multiple
  662. * directives subscribing to it.
  663. * @internal
  664. */
  665. var Dep = /** @class */ (function () {
  666. function Dep() {
  667. // pending subs cleanup
  668. this._pending = false;
  669. this.id = uid$2++;
  670. this.subs = [];
  671. }
  672. Dep.prototype.addSub = function (sub) {
  673. this.subs.push(sub);
  674. };
  675. Dep.prototype.removeSub = function (sub) {
  676. // #12696 deps with massive amount of subscribers are extremely slow to
  677. // clean up in Chromium
  678. // to workaround this, we unset the sub for now, and clear them on
  679. // next scheduler flush.
  680. this.subs[this.subs.indexOf(sub)] = null;
  681. if (!this._pending) {
  682. this._pending = true;
  683. pendingCleanupDeps.push(this);
  684. }
  685. };
  686. Dep.prototype.depend = function (info) {
  687. if (Dep.target) {
  688. Dep.target.addDep(this);
  689. if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {
  690. Dep.target.onTrack(__assign({ effect: Dep.target }, info));
  691. }
  692. }
  693. };
  694. Dep.prototype.notify = function (info) {
  695. // stabilize the subscriber list first
  696. var subs = this.subs.filter(function (s) { return s; });
  697. if (process.env.NODE_ENV !== 'production' && !config.async) {
  698. // subs aren't sorted in scheduler if not running async
  699. // we need to sort them now to make sure they fire in correct
  700. // order
  701. subs.sort(function (a, b) { return a.id - b.id; });
  702. }
  703. for (var i = 0, l = subs.length; i < l; i++) {
  704. var sub = subs[i];
  705. if (process.env.NODE_ENV !== 'production' && info) {
  706. sub.onTrigger &&
  707. sub.onTrigger(__assign({ effect: subs[i] }, info));
  708. }
  709. sub.update();
  710. }
  711. };
  712. return Dep;
  713. }());
  714. // The current target watcher being evaluated.
  715. // This is globally unique because only one watcher
  716. // can be evaluated at a time.
  717. Dep.target = null;
  718. var targetStack = [];
  719. function pushTarget(target) {
  720. targetStack.push(target);
  721. Dep.target = target;
  722. }
  723. function popTarget() {
  724. targetStack.pop();
  725. Dep.target = targetStack[targetStack.length - 1];
  726. }
  727. /*
  728. * not type checking this file because flow doesn't play well with
  729. * dynamically accessing methods on Array prototype
  730. */
  731. var arrayProto = Array.prototype;
  732. var arrayMethods = Object.create(arrayProto);
  733. var methodsToPatch = [
  734. 'push',
  735. 'pop',
  736. 'shift',
  737. 'unshift',
  738. 'splice',
  739. 'sort',
  740. 'reverse'
  741. ];
  742. /**
  743. * Intercept mutating methods and emit events
  744. */
  745. methodsToPatch.forEach(function (method) {
  746. // cache original method
  747. var original = arrayProto[method];
  748. def(arrayMethods, method, function mutator() {
  749. var args = [];
  750. for (var _i = 0; _i < arguments.length; _i++) {
  751. args[_i] = arguments[_i];
  752. }
  753. var result = original.apply(this, args);
  754. var ob = this.__ob__;
  755. var inserted;
  756. switch (method) {
  757. case 'push':
  758. case 'unshift':
  759. inserted = args;
  760. break;
  761. case 'splice':
  762. inserted = args.slice(2);
  763. break;
  764. }
  765. if (inserted)
  766. ob.observeArray(inserted);
  767. // notify change
  768. if (process.env.NODE_ENV !== 'production') {
  769. ob.dep.notify({
  770. type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
  771. target: this,
  772. key: method
  773. });
  774. }
  775. else {
  776. ob.dep.notify();
  777. }
  778. return result;
  779. });
  780. });
  781. var rawMap = new WeakMap();
  782. function reactive(target) {
  783. makeReactive(target, false);
  784. return target;
  785. }
  786. /**
  787. * Return a shallowly-reactive copy of the original object, where only the root
  788. * level properties are reactive. It also does not auto-unwrap refs (even at the
  789. * root level).
  790. */
  791. function shallowReactive(target) {
  792. makeReactive(target, true);
  793. def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  794. return target;
  795. }
  796. function makeReactive(target, shallow) {
  797. // if trying to observe a readonly proxy, return the readonly version.
  798. if (!isReadonly(target)) {
  799. if (process.env.NODE_ENV !== 'production') {
  800. if (isArray(target)) {
  801. warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
  802. }
  803. var existingOb = target && target.__ob__;
  804. if (existingOb && existingOb.shallow !== shallow) {
  805. warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
  806. }
  807. }
  808. var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
  809. if (process.env.NODE_ENV !== 'production' && !ob) {
  810. if (target == null || isPrimitive(target)) {
  811. warn("value cannot be made reactive: ".concat(String(target)));
  812. }
  813. if (isCollectionType(target)) {
  814. warn("Vue 2 does not support reactive collection types such as Map or Set.");
  815. }
  816. }
  817. }
  818. }
  819. function isReactive(value) {
  820. if (isReadonly(value)) {
  821. return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
  822. }
  823. return !!(value && value.__ob__);
  824. }
  825. function isShallow(value) {
  826. return !!(value && value.__v_isShallow);
  827. }
  828. function isReadonly(value) {
  829. return !!(value && value.__v_isReadonly);
  830. }
  831. function isProxy(value) {
  832. return isReactive(value) || isReadonly(value);
  833. }
  834. function toRaw(observed) {
  835. var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
  836. return raw ? toRaw(raw) : observed;
  837. }
  838. function markRaw(value) {
  839. if (isObject(value)) {
  840. rawMap.set(value, true);
  841. }
  842. return value;
  843. }
  844. /**
  845. * @internal
  846. */
  847. function isCollectionType(value) {
  848. var type = toRawType(value);
  849. return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
  850. }
  851. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  852. var NO_INIITIAL_VALUE = {};
  853. /**
  854. * In some cases we may want to disable observation inside a component's
  855. * update computation.
  856. */
  857. var shouldObserve = true;
  858. function toggleObserving(value) {
  859. shouldObserve = value;
  860. }
  861. // ssr mock dep
  862. var mockDep = {
  863. notify: noop,
  864. depend: noop,
  865. addSub: noop,
  866. removeSub: noop
  867. };
  868. /**
  869. * Observer class that is attached to each observed
  870. * object. Once attached, the observer converts the target
  871. * object's property keys into getter/setters that
  872. * collect dependencies and dispatch updates.
  873. */
  874. var Observer = /** @class */ (function () {
  875. function Observer(value, shallow, mock) {
  876. if (shallow === void 0) { shallow = false; }
  877. if (mock === void 0) { mock = false; }
  878. this.value = value;
  879. this.shallow = shallow;
  880. this.mock = mock;
  881. // this.value = value
  882. this.dep = mock ? mockDep : new Dep();
  883. this.vmCount = 0;
  884. def(value, '__ob__', this);
  885. if (isArray(value)) {
  886. if (!mock) {
  887. if (hasProto) {
  888. value.__proto__ = arrayMethods;
  889. /* eslint-enable no-proto */
  890. }
  891. else {
  892. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  893. var key = arrayKeys[i];
  894. def(value, key, arrayMethods[key]);
  895. }
  896. }
  897. }
  898. if (!shallow) {
  899. this.observeArray(value);
  900. }
  901. }
  902. else {
  903. /**
  904. * Walk through all properties and convert them into
  905. * getter/setters. This method should only be called when
  906. * value type is Object.
  907. */
  908. var keys = Object.keys(value);
  909. for (var i = 0; i < keys.length; i++) {
  910. var key = keys[i];
  911. defineReactive(value, key, NO_INIITIAL_VALUE, undefined, shallow, mock);
  912. }
  913. }
  914. }
  915. /**
  916. * Observe a list of Array items.
  917. */
  918. Observer.prototype.observeArray = function (value) {
  919. for (var i = 0, l = value.length; i < l; i++) {
  920. observe(value[i], false, this.mock);
  921. }
  922. };
  923. return Observer;
  924. }());
  925. // helpers
  926. /**
  927. * Attempt to create an observer instance for a value,
  928. * returns the new observer if successfully observed,
  929. * or the existing observer if the value already has one.
  930. */
  931. function observe(value, shallow, ssrMockReactivity) {
  932. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  933. return value.__ob__;
  934. }
  935. if (shouldObserve &&
  936. (ssrMockReactivity || !isServerRendering()) &&
  937. (isArray(value) || isPlainObject(value)) &&
  938. Object.isExtensible(value) &&
  939. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  940. !rawMap.has(value) &&
  941. !isRef(value) &&
  942. !(value instanceof VNode)) {
  943. return new Observer(value, shallow, ssrMockReactivity);
  944. }
  945. }
  946. /**
  947. * Define a reactive property on an Object.
  948. */
  949. function defineReactive(obj, key, val, customSetter, shallow, mock) {
  950. var dep = new Dep();
  951. var property = Object.getOwnPropertyDescriptor(obj, key);
  952. if (property && property.configurable === false) {
  953. return;
  954. }
  955. // cater for pre-defined getter/setters
  956. var getter = property && property.get;
  957. var setter = property && property.set;
  958. if ((!getter || setter) &&
  959. (val === NO_INIITIAL_VALUE || arguments.length === 2)) {
  960. val = obj[key];
  961. }
  962. var childOb = !shallow && observe(val, false, mock);
  963. Object.defineProperty(obj, key, {
  964. enumerable: true,
  965. configurable: true,
  966. get: function reactiveGetter() {
  967. var value = getter ? getter.call(obj) : val;
  968. if (Dep.target) {
  969. if (process.env.NODE_ENV !== 'production') {
  970. dep.depend({
  971. target: obj,
  972. type: "get" /* TrackOpTypes.GET */,
  973. key: key
  974. });
  975. }
  976. else {
  977. dep.depend();
  978. }
  979. if (childOb) {
  980. childOb.dep.depend();
  981. if (isArray(value)) {
  982. dependArray(value);
  983. }
  984. }
  985. }
  986. return isRef(value) && !shallow ? value.value : value;
  987. },
  988. set: function reactiveSetter(newVal) {
  989. var value = getter ? getter.call(obj) : val;
  990. if (!hasChanged(value, newVal)) {
  991. return;
  992. }
  993. if (process.env.NODE_ENV !== 'production' && customSetter) {
  994. customSetter();
  995. }
  996. if (setter) {
  997. setter.call(obj, newVal);
  998. }
  999. else if (getter) {
  1000. // #7981: for accessor properties without setter
  1001. return;
  1002. }
  1003. else if (!shallow && isRef(value) && !isRef(newVal)) {
  1004. value.value = newVal;
  1005. return;
  1006. }
  1007. else {
  1008. val = newVal;
  1009. }
  1010. childOb = !shallow && observe(newVal, false, mock);
  1011. if (process.env.NODE_ENV !== 'production') {
  1012. dep.notify({
  1013. type: "set" /* TriggerOpTypes.SET */,
  1014. target: obj,
  1015. key: key,
  1016. newValue: newVal,
  1017. oldValue: value
  1018. });
  1019. }
  1020. else {
  1021. dep.notify();
  1022. }
  1023. }
  1024. });
  1025. return dep;
  1026. }
  1027. function set(target, key, val) {
  1028. if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
  1029. warn("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  1030. }
  1031. if (isReadonly(target)) {
  1032. process.env.NODE_ENV !== 'production' && warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1033. return;
  1034. }
  1035. var ob = target.__ob__;
  1036. if (isArray(target) && isValidArrayIndex(key)) {
  1037. target.length = Math.max(target.length, key);
  1038. target.splice(key, 1, val);
  1039. // when mocking for SSR, array methods are not hijacked
  1040. if (ob && !ob.shallow && ob.mock) {
  1041. observe(val, false, true);
  1042. }
  1043. return val;
  1044. }
  1045. if (key in target && !(key in Object.prototype)) {
  1046. target[key] = val;
  1047. return val;
  1048. }
  1049. if (target._isVue || (ob && ob.vmCount)) {
  1050. process.env.NODE_ENV !== 'production' &&
  1051. warn('Avoid adding reactive properties to a Vue instance or its root $data ' +
  1052. 'at runtime - declare it upfront in the data option.');
  1053. return val;
  1054. }
  1055. if (!ob) {
  1056. target[key] = val;
  1057. return val;
  1058. }
  1059. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  1060. if (process.env.NODE_ENV !== 'production') {
  1061. ob.dep.notify({
  1062. type: "add" /* TriggerOpTypes.ADD */,
  1063. target: target,
  1064. key: key,
  1065. newValue: val,
  1066. oldValue: undefined
  1067. });
  1068. }
  1069. else {
  1070. ob.dep.notify();
  1071. }
  1072. return val;
  1073. }
  1074. function del(target, key) {
  1075. if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
  1076. warn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
  1077. }
  1078. if (isArray(target) && isValidArrayIndex(key)) {
  1079. target.splice(key, 1);
  1080. return;
  1081. }
  1082. var ob = target.__ob__;
  1083. if (target._isVue || (ob && ob.vmCount)) {
  1084. process.env.NODE_ENV !== 'production' &&
  1085. warn('Avoid deleting properties on a Vue instance or its root $data ' +
  1086. '- just set it to null.');
  1087. return;
  1088. }
  1089. if (isReadonly(target)) {
  1090. process.env.NODE_ENV !== 'production' &&
  1091. warn("Delete operation on key \"".concat(key, "\" failed: target is readonly."));
  1092. return;
  1093. }
  1094. if (!hasOwn(target, key)) {
  1095. return;
  1096. }
  1097. delete target[key];
  1098. if (!ob) {
  1099. return;
  1100. }
  1101. if (process.env.NODE_ENV !== 'production') {
  1102. ob.dep.notify({
  1103. type: "delete" /* TriggerOpTypes.DELETE */,
  1104. target: target,
  1105. key: key
  1106. });
  1107. }
  1108. else {
  1109. ob.dep.notify();
  1110. }
  1111. }
  1112. /**
  1113. * Collect dependencies on array elements when the array is touched, since
  1114. * we cannot intercept array element access like property getters.
  1115. */
  1116. function dependArray(value) {
  1117. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  1118. e = value[i];
  1119. if (e && e.__ob__) {
  1120. e.__ob__.dep.depend();
  1121. }
  1122. if (isArray(e)) {
  1123. dependArray(e);
  1124. }
  1125. }
  1126. }
  1127. /**
  1128. * @internal
  1129. */
  1130. var RefFlag = "__v_isRef";
  1131. function isRef(r) {
  1132. return !!(r && r.__v_isRef === true);
  1133. }
  1134. function ref$1(value) {
  1135. return createRef(value, false);
  1136. }
  1137. function shallowRef(value) {
  1138. return createRef(value, true);
  1139. }
  1140. function createRef(rawValue, shallow) {
  1141. if (isRef(rawValue)) {
  1142. return rawValue;
  1143. }
  1144. var ref = {};
  1145. def(ref, RefFlag, true);
  1146. def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
  1147. def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
  1148. return ref;
  1149. }
  1150. function triggerRef(ref) {
  1151. if (process.env.NODE_ENV !== 'production' && !ref.dep) {
  1152. warn("received object is not a triggerable ref.");
  1153. }
  1154. if (process.env.NODE_ENV !== 'production') {
  1155. ref.dep &&
  1156. ref.dep.notify({
  1157. type: "set" /* TriggerOpTypes.SET */,
  1158. target: ref,
  1159. key: 'value'
  1160. });
  1161. }
  1162. else {
  1163. ref.dep && ref.dep.notify();
  1164. }
  1165. }
  1166. function unref(ref) {
  1167. return isRef(ref) ? ref.value : ref;
  1168. }
  1169. function proxyRefs(objectWithRefs) {
  1170. if (isReactive(objectWithRefs)) {
  1171. return objectWithRefs;
  1172. }
  1173. var proxy = {};
  1174. var keys = Object.keys(objectWithRefs);
  1175. for (var i = 0; i < keys.length; i++) {
  1176. proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
  1177. }
  1178. return proxy;
  1179. }
  1180. function proxyWithRefUnwrap(target, source, key) {
  1181. Object.defineProperty(target, key, {
  1182. enumerable: true,
  1183. configurable: true,
  1184. get: function () {
  1185. var val = source[key];
  1186. if (isRef(val)) {
  1187. return val.value;
  1188. }
  1189. else {
  1190. var ob = val && val.__ob__;
  1191. if (ob)
  1192. ob.dep.depend();
  1193. return val;
  1194. }
  1195. },
  1196. set: function (value) {
  1197. var oldValue = source[key];
  1198. if (isRef(oldValue) && !isRef(value)) {
  1199. oldValue.value = value;
  1200. }
  1201. else {
  1202. source[key] = value;
  1203. }
  1204. }
  1205. });
  1206. }
  1207. function customRef(factory) {
  1208. var dep = new Dep();
  1209. var _a = factory(function () {
  1210. if (process.env.NODE_ENV !== 'production') {
  1211. dep.depend({
  1212. target: ref,
  1213. type: "get" /* TrackOpTypes.GET */,
  1214. key: 'value'
  1215. });
  1216. }
  1217. else {
  1218. dep.depend();
  1219. }
  1220. }, function () {
  1221. if (process.env.NODE_ENV !== 'production') {
  1222. dep.notify({
  1223. target: ref,
  1224. type: "set" /* TriggerOpTypes.SET */,
  1225. key: 'value'
  1226. });
  1227. }
  1228. else {
  1229. dep.notify();
  1230. }
  1231. }), get = _a.get, set = _a.set;
  1232. var ref = {
  1233. get value() {
  1234. return get();
  1235. },
  1236. set value(newVal) {
  1237. set(newVal);
  1238. }
  1239. };
  1240. def(ref, RefFlag, true);
  1241. return ref;
  1242. }
  1243. function toRefs(object) {
  1244. if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {
  1245. warn("toRefs() expects a reactive object but received a plain one.");
  1246. }
  1247. var ret = isArray(object) ? new Array(object.length) : {};
  1248. for (var key in object) {
  1249. ret[key] = toRef(object, key);
  1250. }
  1251. return ret;
  1252. }
  1253. function toRef(object, key, defaultValue) {
  1254. var val = object[key];
  1255. if (isRef(val)) {
  1256. return val;
  1257. }
  1258. var ref = {
  1259. get value() {
  1260. var val = object[key];
  1261. return val === undefined ? defaultValue : val;
  1262. },
  1263. set value(newVal) {
  1264. object[key] = newVal;
  1265. }
  1266. };
  1267. def(ref, RefFlag, true);
  1268. return ref;
  1269. }
  1270. var rawToReadonlyMap = new WeakMap();
  1271. var rawToShallowReadonlyMap = new WeakMap();
  1272. function readonly(target) {
  1273. return createReadonly(target, false);
  1274. }
  1275. function createReadonly(target, shallow) {
  1276. if (!isPlainObject(target)) {
  1277. if (process.env.NODE_ENV !== 'production') {
  1278. if (isArray(target)) {
  1279. warn("Vue 2 does not support readonly arrays.");
  1280. }
  1281. else if (isCollectionType(target)) {
  1282. warn("Vue 2 does not support readonly collection types such as Map or Set.");
  1283. }
  1284. else {
  1285. warn("value cannot be made readonly: ".concat(typeof target));
  1286. }
  1287. }
  1288. return target;
  1289. }
  1290. // already a readonly object
  1291. if (isReadonly(target)) {
  1292. return target;
  1293. }
  1294. // already has a readonly proxy
  1295. var map = shallow ? rawToShallowReadonlyMap : rawToReadonlyMap;
  1296. var existingProxy = map.get(target);
  1297. if (existingProxy) {
  1298. return existingProxy;
  1299. }
  1300. var proxy = Object.create(Object.getPrototypeOf(target));
  1301. map.set(target, proxy);
  1302. def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
  1303. def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
  1304. if (isRef(target)) {
  1305. def(proxy, RefFlag, true);
  1306. }
  1307. if (shallow || isShallow(target)) {
  1308. def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  1309. }
  1310. var keys = Object.keys(target);
  1311. for (var i = 0; i < keys.length; i++) {
  1312. defineReadonlyProperty(proxy, target, keys[i], shallow);
  1313. }
  1314. return proxy;
  1315. }
  1316. function defineReadonlyProperty(proxy, target, key, shallow) {
  1317. Object.defineProperty(proxy, key, {
  1318. enumerable: true,
  1319. configurable: true,
  1320. get: function () {
  1321. var val = target[key];
  1322. return shallow || !isPlainObject(val) ? val : readonly(val);
  1323. },
  1324. set: function () {
  1325. process.env.NODE_ENV !== 'production' &&
  1326. warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1327. }
  1328. });
  1329. }
  1330. /**
  1331. * Returns a reactive-copy of the original object, where only the root level
  1332. * properties are readonly, and does NOT unwrap refs nor recursively convert
  1333. * returned properties.
  1334. * This is used for creating the props proxy object for stateful components.
  1335. */
  1336. function shallowReadonly(target) {
  1337. return createReadonly(target, true);
  1338. }
  1339. function computed(getterOrOptions, debugOptions) {
  1340. var getter;
  1341. var setter;
  1342. var onlyGetter = isFunction(getterOrOptions);
  1343. if (onlyGetter) {
  1344. getter = getterOrOptions;
  1345. setter = process.env.NODE_ENV !== 'production'
  1346. ? function () {
  1347. warn('Write operation failed: computed value is readonly');
  1348. }
  1349. : noop;
  1350. }
  1351. else {
  1352. getter = getterOrOptions.get;
  1353. setter = getterOrOptions.set;
  1354. }
  1355. var watcher = isServerRendering()
  1356. ? null
  1357. : new Watcher(currentInstance, getter, noop, { lazy: true });
  1358. if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {
  1359. watcher.onTrack = debugOptions.onTrack;
  1360. watcher.onTrigger = debugOptions.onTrigger;
  1361. }
  1362. var ref = {
  1363. // some libs rely on the presence effect for checking computed refs
  1364. // from normal refs, but the implementation doesn't matter
  1365. effect: watcher,
  1366. get value() {
  1367. if (watcher) {
  1368. if (watcher.dirty) {
  1369. watcher.evaluate();
  1370. }
  1371. if (Dep.target) {
  1372. if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
  1373. Dep.target.onTrack({
  1374. effect: Dep.target,
  1375. target: ref,
  1376. type: "get" /* TrackOpTypes.GET */,
  1377. key: 'value'
  1378. });
  1379. }
  1380. watcher.depend();
  1381. }
  1382. return watcher.value;
  1383. }
  1384. else {
  1385. return getter();
  1386. }
  1387. },
  1388. set value(newVal) {
  1389. setter(newVal);
  1390. }
  1391. };
  1392. def(ref, RefFlag, true);
  1393. def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
  1394. return ref;
  1395. }
  1396. var WATCHER = "watcher";
  1397. var WATCHER_CB = "".concat(WATCHER, " callback");
  1398. var WATCHER_GETTER = "".concat(WATCHER, " getter");
  1399. var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
  1400. // Simple effect.
  1401. function watchEffect(effect, options) {
  1402. return doWatch(effect, null, options);
  1403. }
  1404. function watchPostEffect(effect, options) {
  1405. return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
  1406. ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));
  1407. }
  1408. function watchSyncEffect(effect, options) {
  1409. return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
  1410. ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
  1411. }
  1412. // initial value for watchers to trigger on undefined initial values
  1413. var INITIAL_WATCHER_VALUE = {};
  1414. // implementation
  1415. function watch(source, cb, options) {
  1416. if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {
  1417. warn("`watch(fn, options?)` signature has been moved to a separate API. " +
  1418. "Use `watchEffect(fn, options?)` instead. `watch` now only " +
  1419. "supports `watch(source, cb, options?) signature.");
  1420. }
  1421. return doWatch(source, cb, options);
  1422. }
  1423. function doWatch(source, cb, _a) {
  1424. var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;
  1425. if (process.env.NODE_ENV !== 'production' && !cb) {
  1426. if (immediate !== undefined) {
  1427. warn("watch() \"immediate\" option is only respected when using the " +
  1428. "watch(source, callback, options?) signature.");
  1429. }
  1430. if (deep !== undefined) {
  1431. warn("watch() \"deep\" option is only respected when using the " +
  1432. "watch(source, callback, options?) signature.");
  1433. }
  1434. }
  1435. var warnInvalidSource = function (s) {
  1436. warn("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
  1437. "function, a ref, a reactive object, or an array of these types.");
  1438. };
  1439. var instance = currentInstance;
  1440. var call = function (fn, type, args) {
  1441. if (args === void 0) { args = null; }
  1442. return invokeWithErrorHandling(fn, null, args, instance, type);
  1443. };
  1444. var getter;
  1445. var forceTrigger = false;
  1446. var isMultiSource = false;
  1447. if (isRef(source)) {
  1448. getter = function () { return source.value; };
  1449. forceTrigger = isShallow(source);
  1450. }
  1451. else if (isReactive(source)) {
  1452. getter = function () {
  1453. source.__ob__.dep.depend();
  1454. return source;
  1455. };
  1456. deep = true;
  1457. }
  1458. else if (isArray(source)) {
  1459. isMultiSource = true;
  1460. forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
  1461. getter = function () {
  1462. return source.map(function (s) {
  1463. if (isRef(s)) {
  1464. return s.value;
  1465. }
  1466. else if (isReactive(s)) {
  1467. return traverse(s);
  1468. }
  1469. else if (isFunction(s)) {
  1470. return call(s, WATCHER_GETTER);
  1471. }
  1472. else {
  1473. process.env.NODE_ENV !== 'production' && warnInvalidSource(s);
  1474. }
  1475. });
  1476. };
  1477. }
  1478. else if (isFunction(source)) {
  1479. if (cb) {
  1480. // getter with cb
  1481. getter = function () { return call(source, WATCHER_GETTER); };
  1482. }
  1483. else {
  1484. // no cb -> simple effect
  1485. getter = function () {
  1486. if (instance && instance._isDestroyed) {
  1487. return;
  1488. }
  1489. if (cleanup) {
  1490. cleanup();
  1491. }
  1492. return call(source, WATCHER, [onCleanup]);
  1493. };
  1494. }
  1495. }
  1496. else {
  1497. getter = noop;
  1498. process.env.NODE_ENV !== 'production' && warnInvalidSource(source);
  1499. }
  1500. if (cb && deep) {
  1501. var baseGetter_1 = getter;
  1502. getter = function () { return traverse(baseGetter_1()); };
  1503. }
  1504. var cleanup;
  1505. var onCleanup = function (fn) {
  1506. cleanup = watcher.onStop = function () {
  1507. call(fn, WATCHER_CLEANUP);
  1508. };
  1509. };
  1510. // in SSR there is no need to setup an actual effect, and it should be noop
  1511. // unless it's eager
  1512. if (isServerRendering()) {
  1513. // we will also not call the invalidate callback (+ runner is not set up)
  1514. onCleanup = noop;
  1515. if (!cb) {
  1516. getter();
  1517. }
  1518. else if (immediate) {
  1519. call(cb, WATCHER_CB, [
  1520. getter(),
  1521. isMultiSource ? [] : undefined,
  1522. onCleanup
  1523. ]);
  1524. }
  1525. return noop;
  1526. }
  1527. var watcher = new Watcher(currentInstance, getter, noop, {
  1528. lazy: true
  1529. });
  1530. watcher.noRecurse = !cb;
  1531. var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
  1532. // overwrite default run
  1533. watcher.run = function () {
  1534. if (!watcher.active) {
  1535. return;
  1536. }
  1537. if (cb) {
  1538. // watch(source, cb)
  1539. var newValue = watcher.get();
  1540. if (deep ||
  1541. forceTrigger ||
  1542. (isMultiSource
  1543. ? newValue.some(function (v, i) {
  1544. return hasChanged(v, oldValue[i]);
  1545. })
  1546. : hasChanged(newValue, oldValue))) {
  1547. // cleanup before running cb again
  1548. if (cleanup) {
  1549. cleanup();
  1550. }
  1551. call(cb, WATCHER_CB, [
  1552. newValue,
  1553. // pass undefined as the old value when it's changed for the first time
  1554. oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
  1555. onCleanup
  1556. ]);
  1557. oldValue = newValue;
  1558. }
  1559. }
  1560. else {
  1561. // watchEffect
  1562. watcher.get();
  1563. }
  1564. };
  1565. if (flush === 'sync') {
  1566. watcher.update = watcher.run;
  1567. }
  1568. else if (flush === 'post') {
  1569. watcher.post = true;
  1570. watcher.update = function () { return queueWatcher(watcher); };
  1571. }
  1572. else {
  1573. // pre
  1574. watcher.update = function () {
  1575. if (instance && instance === currentInstance && !instance._isMounted) {
  1576. // pre-watcher triggered before
  1577. var buffer = instance._preWatchers || (instance._preWatchers = []);
  1578. if (buffer.indexOf(watcher) < 0)
  1579. buffer.push(watcher);
  1580. }
  1581. else {
  1582. queueWatcher(watcher);
  1583. }
  1584. };
  1585. }
  1586. if (process.env.NODE_ENV !== 'production') {
  1587. watcher.onTrack = onTrack;
  1588. watcher.onTrigger = onTrigger;
  1589. }
  1590. // initial run
  1591. if (cb) {
  1592. if (immediate) {
  1593. watcher.run();
  1594. }
  1595. else {
  1596. oldValue = watcher.get();
  1597. }
  1598. }
  1599. else if (flush === 'post' && instance) {
  1600. instance.$once('hook:mounted', function () { return watcher.get(); });
  1601. }
  1602. else {
  1603. watcher.get();
  1604. }
  1605. return function () {
  1606. watcher.teardown();
  1607. };
  1608. }
  1609. var activeEffectScope;
  1610. var EffectScope = /** @class */ (function () {
  1611. function EffectScope(detached) {
  1612. if (detached === void 0) { detached = false; }
  1613. this.detached = detached;
  1614. /**
  1615. * @internal
  1616. */
  1617. this.active = true;
  1618. /**
  1619. * @internal
  1620. */
  1621. this.effects = [];
  1622. /**
  1623. * @internal
  1624. */
  1625. this.cleanups = [];
  1626. this.parent = activeEffectScope;
  1627. if (!detached && activeEffectScope) {
  1628. this.index =
  1629. (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1630. }
  1631. }
  1632. EffectScope.prototype.run = function (fn) {
  1633. if (this.active) {
  1634. var currentEffectScope = activeEffectScope;
  1635. try {
  1636. activeEffectScope = this;
  1637. return fn();
  1638. }
  1639. finally {
  1640. activeEffectScope = currentEffectScope;
  1641. }
  1642. }
  1643. else if (process.env.NODE_ENV !== 'production') {
  1644. warn("cannot run an inactive effect scope.");
  1645. }
  1646. };
  1647. /**
  1648. * This should only be called on non-detached scopes
  1649. * @internal
  1650. */
  1651. EffectScope.prototype.on = function () {
  1652. activeEffectScope = this;
  1653. };
  1654. /**
  1655. * This should only be called on non-detached scopes
  1656. * @internal
  1657. */
  1658. EffectScope.prototype.off = function () {
  1659. activeEffectScope = this.parent;
  1660. };
  1661. EffectScope.prototype.stop = function (fromParent) {
  1662. if (this.active) {
  1663. var i = void 0, l = void 0;
  1664. for (i = 0, l = this.effects.length; i < l; i++) {
  1665. this.effects[i].teardown();
  1666. }
  1667. for (i = 0, l = this.cleanups.length; i < l; i++) {
  1668. this.cleanups[i]();
  1669. }
  1670. if (this.scopes) {
  1671. for (i = 0, l = this.scopes.length; i < l; i++) {
  1672. this.scopes[i].stop(true);
  1673. }
  1674. }
  1675. // nested scope, dereference from parent to avoid memory leaks
  1676. if (!this.detached && this.parent && !fromParent) {
  1677. // optimized O(1) removal
  1678. var last = this.parent.scopes.pop();
  1679. if (last && last !== this) {
  1680. this.parent.scopes[this.index] = last;
  1681. last.index = this.index;
  1682. }
  1683. }
  1684. this.parent = undefined;
  1685. this.active = false;
  1686. }
  1687. };
  1688. return EffectScope;
  1689. }());
  1690. function effectScope(detached) {
  1691. return new EffectScope(detached);
  1692. }
  1693. /**
  1694. * @internal
  1695. */
  1696. function recordEffectScope(effect, scope) {
  1697. if (scope === void 0) { scope = activeEffectScope; }
  1698. if (scope && scope.active) {
  1699. scope.effects.push(effect);
  1700. }
  1701. }
  1702. function getCurrentScope() {
  1703. return activeEffectScope;
  1704. }
  1705. function onScopeDispose(fn) {
  1706. if (activeEffectScope) {
  1707. activeEffectScope.cleanups.push(fn);
  1708. }
  1709. else if (process.env.NODE_ENV !== 'production') {
  1710. warn("onScopeDispose() is called when there is no active effect scope" +
  1711. " to be associated with.");
  1712. }
  1713. }
  1714. function provide(key, value) {
  1715. if (!currentInstance) {
  1716. if (process.env.NODE_ENV !== 'production') {
  1717. warn("provide() can only be used inside setup().");
  1718. }
  1719. }
  1720. else {
  1721. // TS doesn't allow symbol as index type
  1722. resolveProvided(currentInstance)[key] = value;
  1723. }
  1724. }
  1725. function resolveProvided(vm) {
  1726. // by default an instance inherits its parent's provides object
  1727. // but when it needs to provide values of its own, it creates its
  1728. // own provides object using parent provides object as prototype.
  1729. // this way in `inject` we can simply look up injections from direct
  1730. // parent and let the prototype chain do the work.
  1731. var existing = vm._provided;
  1732. var parentProvides = vm.$parent && vm.$parent._provided;
  1733. if (parentProvides === existing) {
  1734. return (vm._provided = Object.create(parentProvides));
  1735. }
  1736. else {
  1737. return existing;
  1738. }
  1739. }
  1740. function inject(key, defaultValue, treatDefaultAsFactory) {
  1741. if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
  1742. // fallback to `currentRenderingInstance` so that this can be called in
  1743. // a functional component
  1744. var instance = currentInstance;
  1745. if (instance) {
  1746. // #2400
  1747. // to support `app.use` plugins,
  1748. // fallback to appContext's `provides` if the instance is at root
  1749. var provides = instance.$parent && instance.$parent._provided;
  1750. if (provides && key in provides) {
  1751. // TS doesn't allow symbol as index type
  1752. return provides[key];
  1753. }
  1754. else if (arguments.length > 1) {
  1755. return treatDefaultAsFactory && isFunction(defaultValue)
  1756. ? defaultValue.call(instance)
  1757. : defaultValue;
  1758. }
  1759. else if (process.env.NODE_ENV !== 'production') {
  1760. warn("injection \"".concat(String(key), "\" not found."));
  1761. }
  1762. }
  1763. else if (process.env.NODE_ENV !== 'production') {
  1764. warn("inject() can only be used inside setup() or functional components.");
  1765. }
  1766. }
  1767. var normalizeEvent = cached(function (name) {
  1768. var passive = name.charAt(0) === '&';
  1769. name = passive ? name.slice(1) : name;
  1770. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  1771. name = once ? name.slice(1) : name;
  1772. var capture = name.charAt(0) === '!';
  1773. name = capture ? name.slice(1) : name;
  1774. return {
  1775. name: name,
  1776. once: once,
  1777. capture: capture,
  1778. passive: passive
  1779. };
  1780. });
  1781. function createFnInvoker(fns, vm) {
  1782. function invoker() {
  1783. var fns = invoker.fns;
  1784. if (isArray(fns)) {
  1785. var cloned = fns.slice();
  1786. for (var i = 0; i < cloned.length; i++) {
  1787. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  1788. }
  1789. }
  1790. else {
  1791. // return handler return value for single handlers
  1792. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  1793. }
  1794. }
  1795. invoker.fns = fns;
  1796. return invoker;
  1797. }
  1798. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  1799. var name, cur, old, event;
  1800. for (name in on) {
  1801. cur = on[name];
  1802. old = oldOn[name];
  1803. event = normalizeEvent(name);
  1804. if (isUndef(cur)) {
  1805. process.env.NODE_ENV !== 'production' &&
  1806. warn("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
  1807. }
  1808. else if (isUndef(old)) {
  1809. if (isUndef(cur.fns)) {
  1810. cur = on[name] = createFnInvoker(cur, vm);
  1811. }
  1812. if (isTrue(event.once)) {
  1813. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  1814. }
  1815. add(event.name, cur, event.capture, event.passive, event.params);
  1816. }
  1817. else if (cur !== old) {
  1818. old.fns = cur;
  1819. on[name] = old;
  1820. }
  1821. }
  1822. for (name in oldOn) {
  1823. if (isUndef(on[name])) {
  1824. event = normalizeEvent(name);
  1825. remove(event.name, oldOn[name], event.capture);
  1826. }
  1827. }
  1828. }
  1829. function mergeVNodeHook(def, hookKey, hook) {
  1830. if (def instanceof VNode) {
  1831. def = def.data.hook || (def.data.hook = {});
  1832. }
  1833. var invoker;
  1834. var oldHook = def[hookKey];
  1835. function wrappedHook() {
  1836. hook.apply(this, arguments);
  1837. // important: remove merged hook to ensure it's called only once
  1838. // and prevent memory leak
  1839. remove$2(invoker.fns, wrappedHook);
  1840. }
  1841. if (isUndef(oldHook)) {
  1842. // no existing hook
  1843. invoker = createFnInvoker([wrappedHook]);
  1844. }
  1845. else {
  1846. /* istanbul ignore if */
  1847. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  1848. // already a merged invoker
  1849. invoker = oldHook;
  1850. invoker.fns.push(wrappedHook);
  1851. }
  1852. else {
  1853. // existing plain hook
  1854. invoker = createFnInvoker([oldHook, wrappedHook]);
  1855. }
  1856. }
  1857. invoker.merged = true;
  1858. def[hookKey] = invoker;
  1859. }
  1860. function extractPropsFromVNodeData(data, Ctor, tag) {
  1861. // we are only extracting raw values here.
  1862. // validation and default values are handled in the child
  1863. // component itself.
  1864. var propOptions = Ctor.options.props;
  1865. if (isUndef(propOptions)) {
  1866. return;
  1867. }
  1868. var res = {};
  1869. var attrs = data.attrs, props = data.props;
  1870. if (isDef(attrs) || isDef(props)) {
  1871. for (var key in propOptions) {
  1872. var altKey = hyphenate(key);
  1873. if (process.env.NODE_ENV !== 'production') {
  1874. var keyInLowerCase = key.toLowerCase();
  1875. if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
  1876. tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
  1877. "".concat(formatComponentName(
  1878. // @ts-expect-error tag is string
  1879. tag || Ctor), ", but the declared prop name is") +
  1880. " \"".concat(key, "\". ") +
  1881. "Note that HTML attributes are case-insensitive and camelCased " +
  1882. "props need to use their kebab-case equivalents when using in-DOM " +
  1883. "templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
  1884. }
  1885. }
  1886. checkProp(res, props, key, altKey, true) ||
  1887. checkProp(res, attrs, key, altKey, false);
  1888. }
  1889. }
  1890. return res;
  1891. }
  1892. function checkProp(res, hash, key, altKey, preserve) {
  1893. if (isDef(hash)) {
  1894. if (hasOwn(hash, key)) {
  1895. res[key] = hash[key];
  1896. if (!preserve) {
  1897. delete hash[key];
  1898. }
  1899. return true;
  1900. }
  1901. else if (hasOwn(hash, altKey)) {
  1902. res[key] = hash[altKey];
  1903. if (!preserve) {
  1904. delete hash[altKey];
  1905. }
  1906. return true;
  1907. }
  1908. }
  1909. return false;
  1910. }
  1911. // The template compiler attempts to minimize the need for normalization by
  1912. // statically analyzing the template at compile time.
  1913. //
  1914. // For plain HTML markup, normalization can be completely skipped because the
  1915. // generated render function is guaranteed to return Array<VNode>. There are
  1916. // two cases where extra normalization is needed:
  1917. // 1. When the children contains components - because a functional component
  1918. // may return an Array instead of a single root. In this case, just a simple
  1919. // normalization is needed - if any child is an Array, we flatten the whole
  1920. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  1921. // because functional components already normalize their own children.
  1922. function simpleNormalizeChildren(children) {
  1923. for (var i = 0; i < children.length; i++) {
  1924. if (isArray(children[i])) {
  1925. return Array.prototype.concat.apply([], children);
  1926. }
  1927. }
  1928. return children;
  1929. }
  1930. // 2. When the children contains constructs that always generated nested Arrays,
  1931. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  1932. // with hand-written render functions / JSX. In such cases a full normalization
  1933. // is needed to cater to all possible types of children values.
  1934. function normalizeChildren(children) {
  1935. return isPrimitive(children)
  1936. ? [createTextVNode(children)]
  1937. : isArray(children)
  1938. ? normalizeArrayChildren(children)
  1939. : undefined;
  1940. }
  1941. function isTextNode(node) {
  1942. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  1943. }
  1944. function normalizeArrayChildren(children, nestedIndex) {
  1945. var res = [];
  1946. var i, c, lastIndex, last;
  1947. for (i = 0; i < children.length; i++) {
  1948. c = children[i];
  1949. if (isUndef(c) || typeof c === 'boolean')
  1950. continue;
  1951. lastIndex = res.length - 1;
  1952. last = res[lastIndex];
  1953. // nested
  1954. if (isArray(c)) {
  1955. if (c.length > 0) {
  1956. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  1957. // merge adjacent text nodes
  1958. if (isTextNode(c[0]) && isTextNode(last)) {
  1959. res[lastIndex] = createTextVNode(last.text + c[0].text);
  1960. c.shift();
  1961. }
  1962. res.push.apply(res, c);
  1963. }
  1964. }
  1965. else if (isPrimitive(c)) {
  1966. if (isTextNode(last)) {
  1967. // merge adjacent text nodes
  1968. // this is necessary for SSR hydration because text nodes are
  1969. // essentially merged when rendered to HTML strings
  1970. res[lastIndex] = createTextVNode(last.text + c);
  1971. }
  1972. else if (c !== '') {
  1973. // convert primitive to vnode
  1974. res.push(createTextVNode(c));
  1975. }
  1976. }
  1977. else {
  1978. if (isTextNode(c) && isTextNode(last)) {
  1979. // merge adjacent text nodes
  1980. res[lastIndex] = createTextVNode(last.text + c.text);
  1981. }
  1982. else {
  1983. // default key for nested array children (likely generated by v-for)
  1984. if (isTrue(children._isVList) &&
  1985. isDef(c.tag) &&
  1986. isUndef(c.key) &&
  1987. isDef(nestedIndex)) {
  1988. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  1989. }
  1990. res.push(c);
  1991. }
  1992. }
  1993. }
  1994. return res;
  1995. }
  1996. /**
  1997. * Runtime helper for rendering v-for lists.
  1998. */
  1999. function renderList(val, render) {
  2000. var ret = null, i, l, keys, key;
  2001. if (isArray(val) || typeof val === 'string') {
  2002. ret = new Array(val.length);
  2003. for (i = 0, l = val.length; i < l; i++) {
  2004. ret[i] = render(val[i], i);
  2005. }
  2006. }
  2007. else if (typeof val === 'number') {
  2008. ret = new Array(val);
  2009. for (i = 0; i < val; i++) {
  2010. ret[i] = render(i + 1, i);
  2011. }
  2012. }
  2013. else if (isObject(val)) {
  2014. if (hasSymbol && val[Symbol.iterator]) {
  2015. ret = [];
  2016. var iterator = val[Symbol.iterator]();
  2017. var result = iterator.next();
  2018. while (!result.done) {
  2019. ret.push(render(result.value, ret.length));
  2020. result = iterator.next();
  2021. }
  2022. }
  2023. else {
  2024. keys = Object.keys(val);
  2025. ret = new Array(keys.length);
  2026. for (i = 0, l = keys.length; i < l; i++) {
  2027. key = keys[i];
  2028. ret[i] = render(val[key], key, i);
  2029. }
  2030. }
  2031. }
  2032. if (!isDef(ret)) {
  2033. ret = [];
  2034. }
  2035. ret._isVList = true;
  2036. return ret;
  2037. }
  2038. /**
  2039. * Runtime helper for rendering <slot>
  2040. */
  2041. function renderSlot(name, fallbackRender, props, bindObject) {
  2042. var scopedSlotFn = this.$scopedSlots[name];
  2043. var nodes;
  2044. if (scopedSlotFn) {
  2045. // scoped slot
  2046. props = props || {};
  2047. if (bindObject) {
  2048. if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
  2049. warn('slot v-bind without argument expects an Object', this);
  2050. }
  2051. props = extend(extend({}, bindObject), props);
  2052. }
  2053. nodes =
  2054. scopedSlotFn(props) ||
  2055. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  2056. }
  2057. else {
  2058. nodes =
  2059. this.$slots[name] ||
  2060. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  2061. }
  2062. var target = props && props.slot;
  2063. if (target) {
  2064. return this.$createElement('template', { slot: target }, nodes);
  2065. }
  2066. else {
  2067. return nodes;
  2068. }
  2069. }
  2070. /**
  2071. * Runtime helper for resolving filters
  2072. */
  2073. function resolveFilter(id) {
  2074. return resolveAsset(this.$options, 'filters', id, true) || identity;
  2075. }
  2076. function isKeyNotMatch(expect, actual) {
  2077. if (isArray(expect)) {
  2078. return expect.indexOf(actual) === -1;
  2079. }
  2080. else {
  2081. return expect !== actual;
  2082. }
  2083. }
  2084. /**
  2085. * Runtime helper for checking keyCodes from config.
  2086. * exposed as Vue.prototype._k
  2087. * passing in eventKeyName as last argument separately for backwards compat
  2088. */
  2089. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  2090. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  2091. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  2092. return isKeyNotMatch(builtInKeyName, eventKeyName);
  2093. }
  2094. else if (mappedKeyCode) {
  2095. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  2096. }
  2097. else if (eventKeyName) {
  2098. return hyphenate(eventKeyName) !== key;
  2099. }
  2100. return eventKeyCode === undefined;
  2101. }
  2102. /**
  2103. * Runtime helper for merging v-bind="object" into a VNode's data.
  2104. */
  2105. function bindObjectProps(data, tag, value, asProp, isSync) {
  2106. if (value) {
  2107. if (!isObject(value)) {
  2108. process.env.NODE_ENV !== 'production' &&
  2109. warn('v-bind without argument expects an Object or Array value', this);
  2110. }
  2111. else {
  2112. if (isArray(value)) {
  2113. value = toObject(value);
  2114. }
  2115. var hash = void 0;
  2116. var _loop_1 = function (key) {
  2117. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  2118. hash = data;
  2119. }
  2120. else {
  2121. var type = data.attrs && data.attrs.type;
  2122. hash =
  2123. asProp || config.mustUseProp(tag, type, key)
  2124. ? data.domProps || (data.domProps = {})
  2125. : data.attrs || (data.attrs = {});
  2126. }
  2127. var camelizedKey = camelize(key);
  2128. var hyphenatedKey = hyphenate(key);
  2129. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  2130. hash[key] = value[key];
  2131. if (isSync) {
  2132. var on = data.on || (data.on = {});
  2133. on["update:".concat(key)] = function ($event) {
  2134. value[key] = $event;
  2135. };
  2136. }
  2137. }
  2138. };
  2139. for (var key in value) {
  2140. _loop_1(key);
  2141. }
  2142. }
  2143. }
  2144. return data;
  2145. }
  2146. /**
  2147. * Runtime helper for rendering static trees.
  2148. */
  2149. function renderStatic(index, isInFor) {
  2150. var cached = this._staticTrees || (this._staticTrees = []);
  2151. var tree = cached[index];
  2152. // if has already-rendered static tree and not inside v-for,
  2153. // we can reuse the same tree.
  2154. if (tree && !isInFor) {
  2155. return tree;
  2156. }
  2157. // otherwise, render a fresh tree.
  2158. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  2159. );
  2160. markStatic(tree, "__static__".concat(index), false);
  2161. return tree;
  2162. }
  2163. /**
  2164. * Runtime helper for v-once.
  2165. * Effectively it means marking the node as static with a unique key.
  2166. */
  2167. function markOnce(tree, index, key) {
  2168. markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  2169. return tree;
  2170. }
  2171. function markStatic(tree, key, isOnce) {
  2172. if (isArray(tree)) {
  2173. for (var i = 0; i < tree.length; i++) {
  2174. if (tree[i] && typeof tree[i] !== 'string') {
  2175. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  2176. }
  2177. }
  2178. }
  2179. else {
  2180. markStaticNode(tree, key, isOnce);
  2181. }
  2182. }
  2183. function markStaticNode(node, key, isOnce) {
  2184. node.isStatic = true;
  2185. node.key = key;
  2186. node.isOnce = isOnce;
  2187. }
  2188. function bindObjectListeners(data, value) {
  2189. if (value) {
  2190. if (!isPlainObject(value)) {
  2191. process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);
  2192. }
  2193. else {
  2194. var on = (data.on = data.on ? extend({}, data.on) : {});
  2195. for (var key in value) {
  2196. var existing = on[key];
  2197. var ours = value[key];
  2198. on[key] = existing ? [].concat(existing, ours) : ours;
  2199. }
  2200. }
  2201. }
  2202. return data;
  2203. }
  2204. function resolveScopedSlots(fns, res,
  2205. // the following are added in 2.6
  2206. hasDynamicKeys, contentHashKey) {
  2207. res = res || { $stable: !hasDynamicKeys };
  2208. for (var i = 0; i < fns.length; i++) {
  2209. var slot = fns[i];
  2210. if (isArray(slot)) {
  2211. resolveScopedSlots(slot, res, hasDynamicKeys);
  2212. }
  2213. else if (slot) {
  2214. // marker for reverse proxying v-slot without scope on this.$slots
  2215. // @ts-expect-error
  2216. if (slot.proxy) {
  2217. // @ts-expect-error
  2218. slot.fn.proxy = true;
  2219. }
  2220. res[slot.key] = slot.fn;
  2221. }
  2222. }
  2223. if (contentHashKey) {
  2224. res.$key = contentHashKey;
  2225. }
  2226. return res;
  2227. }
  2228. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  2229. function bindDynamicKeys(baseObj, values) {
  2230. for (var i = 0; i < values.length; i += 2) {
  2231. var key = values[i];
  2232. if (typeof key === 'string' && key) {
  2233. baseObj[values[i]] = values[i + 1];
  2234. }
  2235. else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {
  2236. // null is a special value for explicitly removing a binding
  2237. warn("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
  2238. }
  2239. }
  2240. return baseObj;
  2241. }
  2242. // helper to dynamically append modifier runtime markers to event names.
  2243. // ensure only append when value is already string, otherwise it will be cast
  2244. // to string and cause the type check to miss.
  2245. function prependModifier(value, symbol) {
  2246. return typeof value === 'string' ? symbol + value : value;
  2247. }
  2248. function installRenderHelpers(target) {
  2249. target._o = markOnce;
  2250. target._n = toNumber;
  2251. target._s = toString;
  2252. target._l = renderList;
  2253. target._t = renderSlot;
  2254. target._q = looseEqual;
  2255. target._i = looseIndexOf;
  2256. target._m = renderStatic;
  2257. target._f = resolveFilter;
  2258. target._k = checkKeyCodes;
  2259. target._b = bindObjectProps;
  2260. target._v = createTextVNode;
  2261. target._e = createEmptyVNode;
  2262. target._u = resolveScopedSlots;
  2263. target._g = bindObjectListeners;
  2264. target._d = bindDynamicKeys;
  2265. target._p = prependModifier;
  2266. }
  2267. /**
  2268. * Runtime helper for resolving raw children VNodes into a slot object.
  2269. */
  2270. function resolveSlots(children, context) {
  2271. if (!children || !children.length) {
  2272. return {};
  2273. }
  2274. var slots = {};
  2275. for (var i = 0, l = children.length; i < l; i++) {
  2276. var child = children[i];
  2277. var data = child.data;
  2278. // remove slot attribute if the node is resolved as a Vue slot node
  2279. if (data && data.attrs && data.attrs.slot) {
  2280. delete data.attrs.slot;
  2281. }
  2282. // named slots should only be respected if the vnode was rendered in the
  2283. // same context.
  2284. if ((child.context === context || child.fnContext === context) &&
  2285. data &&
  2286. data.slot != null) {
  2287. var name_1 = data.slot;
  2288. var slot = slots[name_1] || (slots[name_1] = []);
  2289. if (child.tag === 'template') {
  2290. slot.push.apply(slot, child.children || []);
  2291. }
  2292. else {
  2293. slot.push(child);
  2294. }
  2295. }
  2296. else {
  2297. (slots.default || (slots.default = [])).push(child);
  2298. }
  2299. }
  2300. // ignore slots that contains only whitespace
  2301. for (var name_2 in slots) {
  2302. if (slots[name_2].every(isWhitespace)) {
  2303. delete slots[name_2];
  2304. }
  2305. }
  2306. return slots;
  2307. }
  2308. function isWhitespace(node) {
  2309. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  2310. }
  2311. function isAsyncPlaceholder(node) {
  2312. // @ts-expect-error not really boolean type
  2313. return node.isComment && node.asyncFactory;
  2314. }
  2315. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  2316. var res;
  2317. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  2318. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  2319. var key = scopedSlots && scopedSlots.$key;
  2320. if (!scopedSlots) {
  2321. res = {};
  2322. }
  2323. else if (scopedSlots._normalized) {
  2324. // fast path 1: child component re-render only, parent did not change
  2325. return scopedSlots._normalized;
  2326. }
  2327. else if (isStable &&
  2328. prevScopedSlots &&
  2329. prevScopedSlots !== emptyObject &&
  2330. key === prevScopedSlots.$key &&
  2331. !hasNormalSlots &&
  2332. !prevScopedSlots.$hasNormal) {
  2333. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  2334. // only need to normalize once
  2335. return prevScopedSlots;
  2336. }
  2337. else {
  2338. res = {};
  2339. for (var key_1 in scopedSlots) {
  2340. if (scopedSlots[key_1] && key_1[0] !== '$') {
  2341. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  2342. }
  2343. }
  2344. }
  2345. // expose normal slots on scopedSlots
  2346. for (var key_2 in normalSlots) {
  2347. if (!(key_2 in res)) {
  2348. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  2349. }
  2350. }
  2351. // avoriaz seems to mock a non-extensible $scopedSlots object
  2352. // and when that is passed down this would cause an error
  2353. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  2354. scopedSlots._normalized = res;
  2355. }
  2356. def(res, '$stable', isStable);
  2357. def(res, '$key', key);
  2358. def(res, '$hasNormal', hasNormalSlots);
  2359. return res;
  2360. }
  2361. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  2362. var normalized = function () {
  2363. var cur = currentInstance;
  2364. setCurrentInstance(vm);
  2365. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  2366. res =
  2367. res && typeof res === 'object' && !isArray(res)
  2368. ? [res] // single vnode
  2369. : normalizeChildren(res);
  2370. var vnode = res && res[0];
  2371. setCurrentInstance(cur);
  2372. return res &&
  2373. (!vnode ||
  2374. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  2375. ? undefined
  2376. : res;
  2377. };
  2378. // this is a slot using the new v-slot syntax without scope. although it is
  2379. // compiled as a scoped slot, render fn users would expect it to be present
  2380. // on this.$slots because the usage is semantically a normal slot.
  2381. if (fn.proxy) {
  2382. Object.defineProperty(normalSlots, key, {
  2383. get: normalized,
  2384. enumerable: true,
  2385. configurable: true
  2386. });
  2387. }
  2388. return normalized;
  2389. }
  2390. function proxyNormalSlot(slots, key) {
  2391. return function () { return slots[key]; };
  2392. }
  2393. function initSetup(vm) {
  2394. var options = vm.$options;
  2395. var setup = options.setup;
  2396. if (setup) {
  2397. var ctx = (vm._setupContext = createSetupContext(vm));
  2398. setCurrentInstance(vm);
  2399. pushTarget();
  2400. var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
  2401. popTarget();
  2402. setCurrentInstance();
  2403. if (isFunction(setupResult)) {
  2404. // render function
  2405. // @ts-ignore
  2406. options.render = setupResult;
  2407. }
  2408. else if (isObject(setupResult)) {
  2409. // bindings
  2410. if (process.env.NODE_ENV !== 'production' && setupResult instanceof VNode) {
  2411. warn("setup() should not return VNodes directly - " +
  2412. "return a render function instead.");
  2413. }
  2414. vm._setupState = setupResult;
  2415. // __sfc indicates compiled bindings from <script setup>
  2416. if (!setupResult.__sfc) {
  2417. for (var key in setupResult) {
  2418. if (!isReserved(key)) {
  2419. proxyWithRefUnwrap(vm, setupResult, key);
  2420. }
  2421. else if (process.env.NODE_ENV !== 'production') {
  2422. warn("Avoid using variables that start with _ or $ in setup().");
  2423. }
  2424. }
  2425. }
  2426. else {
  2427. // exposed for compiled render fn
  2428. var proxy = (vm._setupProxy = {});
  2429. for (var key in setupResult) {
  2430. if (key !== '__sfc') {
  2431. proxyWithRefUnwrap(proxy, setupResult, key);
  2432. }
  2433. }
  2434. }
  2435. }
  2436. else if (process.env.NODE_ENV !== 'production' && setupResult !== undefined) {
  2437. warn("setup() should return an object. Received: ".concat(setupResult === null ? 'null' : typeof setupResult));
  2438. }
  2439. }
  2440. }
  2441. function createSetupContext(vm) {
  2442. var exposeCalled = false;
  2443. return {
  2444. get attrs() {
  2445. if (!vm._attrsProxy) {
  2446. var proxy = (vm._attrsProxy = {});
  2447. def(proxy, '_v_attr_proxy', true);
  2448. syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
  2449. }
  2450. return vm._attrsProxy;
  2451. },
  2452. get listeners() {
  2453. if (!vm._listenersProxy) {
  2454. var proxy = (vm._listenersProxy = {});
  2455. syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
  2456. }
  2457. return vm._listenersProxy;
  2458. },
  2459. get slots() {
  2460. return initSlotsProxy(vm);
  2461. },
  2462. emit: bind(vm.$emit, vm),
  2463. expose: function (exposed) {
  2464. if (process.env.NODE_ENV !== 'production') {
  2465. if (exposeCalled) {
  2466. warn("expose() should be called only once per setup().", vm);
  2467. }
  2468. exposeCalled = true;
  2469. }
  2470. if (exposed) {
  2471. Object.keys(exposed).forEach(function (key) {
  2472. return proxyWithRefUnwrap(vm, exposed, key);
  2473. });
  2474. }
  2475. }
  2476. };
  2477. }
  2478. function syncSetupProxy(to, from, prev, instance, type) {
  2479. var changed = false;
  2480. for (var key in from) {
  2481. if (!(key in to)) {
  2482. changed = true;
  2483. defineProxyAttr(to, key, instance, type);
  2484. }
  2485. else if (from[key] !== prev[key]) {
  2486. changed = true;
  2487. }
  2488. }
  2489. for (var key in to) {
  2490. if (!(key in from)) {
  2491. changed = true;
  2492. delete to[key];
  2493. }
  2494. }
  2495. return changed;
  2496. }
  2497. function defineProxyAttr(proxy, key, instance, type) {
  2498. Object.defineProperty(proxy, key, {
  2499. enumerable: true,
  2500. configurable: true,
  2501. get: function () {
  2502. return instance[type][key];
  2503. }
  2504. });
  2505. }
  2506. function initSlotsProxy(vm) {
  2507. if (!vm._slotsProxy) {
  2508. syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
  2509. }
  2510. return vm._slotsProxy;
  2511. }
  2512. function syncSetupSlots(to, from) {
  2513. for (var key in from) {
  2514. to[key] = from[key];
  2515. }
  2516. for (var key in to) {
  2517. if (!(key in from)) {
  2518. delete to[key];
  2519. }
  2520. }
  2521. }
  2522. /**
  2523. * @internal use manual type def because public setup context type relies on
  2524. * legacy VNode types
  2525. */
  2526. function useSlots() {
  2527. return getContext().slots;
  2528. }
  2529. /**
  2530. * @internal use manual type def because public setup context type relies on
  2531. * legacy VNode types
  2532. */
  2533. function useAttrs() {
  2534. return getContext().attrs;
  2535. }
  2536. /**
  2537. * Vue 2 only
  2538. * @internal use manual type def because public setup context type relies on
  2539. * legacy VNode types
  2540. */
  2541. function useListeners() {
  2542. return getContext().listeners;
  2543. }
  2544. function getContext() {
  2545. if (process.env.NODE_ENV !== 'production' && !currentInstance) {
  2546. warn("useContext() called without active instance.");
  2547. }
  2548. var vm = currentInstance;
  2549. return vm._setupContext || (vm._setupContext = createSetupContext(vm));
  2550. }
  2551. /**
  2552. * Runtime helper for merging default declarations. Imported by compiled code
  2553. * only.
  2554. * @internal
  2555. */
  2556. function mergeDefaults(raw, defaults) {
  2557. var props = isArray(raw)
  2558. ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
  2559. : raw;
  2560. for (var key in defaults) {
  2561. var opt = props[key];
  2562. if (opt) {
  2563. if (isArray(opt) || isFunction(opt)) {
  2564. props[key] = { type: opt, default: defaults[key] };
  2565. }
  2566. else {
  2567. opt.default = defaults[key];
  2568. }
  2569. }
  2570. else if (opt === null) {
  2571. props[key] = { default: defaults[key] };
  2572. }
  2573. else if (process.env.NODE_ENV !== 'production') {
  2574. warn("props default key \"".concat(key, "\" has no corresponding declaration."));
  2575. }
  2576. }
  2577. return props;
  2578. }
  2579. function initRender(vm) {
  2580. vm._vnode = null; // the root of the child tree
  2581. vm._staticTrees = null; // v-once cached trees
  2582. var options = vm.$options;
  2583. var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
  2584. var renderContext = parentVnode && parentVnode.context;
  2585. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  2586. vm.$scopedSlots = parentVnode
  2587. ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
  2588. : emptyObject;
  2589. // bind the createElement fn to this instance
  2590. // so that we get proper render context inside it.
  2591. // args order: tag, data, children, normalizationType, alwaysNormalize
  2592. // internal version is used by render functions compiled from templates
  2593. // @ts-expect-error
  2594. vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
  2595. // normalization is always applied for the public version, used in
  2596. // user-written render functions.
  2597. // @ts-expect-error
  2598. vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
  2599. // $attrs & $listeners are exposed for easier HOC creation.
  2600. // they need to be reactive so that HOCs using them are always updated
  2601. var parentData = parentVnode && parentVnode.data;
  2602. /* istanbul ignore else */
  2603. if (process.env.NODE_ENV !== 'production') {
  2604. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {
  2605. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  2606. }, true);
  2607. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
  2608. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  2609. }, true);
  2610. }
  2611. else {
  2612. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);
  2613. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
  2614. }
  2615. }
  2616. var currentRenderingInstance = null;
  2617. function renderMixin(Vue) {
  2618. // install runtime convenience helpers
  2619. installRenderHelpers(Vue.prototype);
  2620. Vue.prototype.$nextTick = function (fn) {
  2621. return nextTick(fn, this);
  2622. };
  2623. Vue.prototype._render = function () {
  2624. var vm = this;
  2625. var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
  2626. if (_parentVnode && vm._isMounted) {
  2627. vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
  2628. if (vm._slotsProxy) {
  2629. syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
  2630. }
  2631. }
  2632. // set parent vnode. this allows render functions to have access
  2633. // to the data on the placeholder node.
  2634. vm.$vnode = _parentVnode;
  2635. // render self
  2636. var vnode;
  2637. try {
  2638. // There's no need to maintain a stack because all render fns are called
  2639. // separately from one another. Nested component's render fns are called
  2640. // when parent component is patched.
  2641. setCurrentInstance(vm);
  2642. currentRenderingInstance = vm;
  2643. vnode = render.call(vm._renderProxy, vm.$createElement);
  2644. }
  2645. catch (e) {
  2646. handleError(e, vm, "render");
  2647. // return error render result,
  2648. // or previous vnode to prevent render error causing blank component
  2649. /* istanbul ignore else */
  2650. if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) {
  2651. try {
  2652. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  2653. }
  2654. catch (e) {
  2655. handleError(e, vm, "renderError");
  2656. vnode = vm._vnode;
  2657. }
  2658. }
  2659. else {
  2660. vnode = vm._vnode;
  2661. }
  2662. }
  2663. finally {
  2664. currentRenderingInstance = null;
  2665. setCurrentInstance();
  2666. }
  2667. // if the returned array contains only a single node, allow it
  2668. if (isArray(vnode) && vnode.length === 1) {
  2669. vnode = vnode[0];
  2670. }
  2671. // return empty vnode in case the render function errored out
  2672. if (!(vnode instanceof VNode)) {
  2673. if (process.env.NODE_ENV !== 'production' && isArray(vnode)) {
  2674. warn('Multiple root nodes returned from render function. Render function ' +
  2675. 'should return a single root node.', vm);
  2676. }
  2677. vnode = createEmptyVNode();
  2678. }
  2679. // set parent
  2680. vnode.parent = _parentVnode;
  2681. return vnode;
  2682. };
  2683. }
  2684. function ensureCtor(comp, base) {
  2685. if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
  2686. comp = comp.default;
  2687. }
  2688. return isObject(comp) ? base.extend(comp) : comp;
  2689. }
  2690. function createAsyncPlaceholder(factory, data, context, children, tag) {
  2691. var node = createEmptyVNode();
  2692. node.asyncFactory = factory;
  2693. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  2694. return node;
  2695. }
  2696. function resolveAsyncComponent(factory, baseCtor) {
  2697. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  2698. return factory.errorComp;
  2699. }
  2700. if (isDef(factory.resolved)) {
  2701. return factory.resolved;
  2702. }
  2703. var owner = currentRenderingInstance;
  2704. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  2705. // already pending
  2706. factory.owners.push(owner);
  2707. }
  2708. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  2709. return factory.loadingComp;
  2710. }
  2711. if (owner && !isDef(factory.owners)) {
  2712. var owners_1 = (factory.owners = [owner]);
  2713. var sync_1 = true;
  2714. var timerLoading_1 = null;
  2715. var timerTimeout_1 = null;
  2716. owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
  2717. var forceRender_1 = function (renderCompleted) {
  2718. for (var i = 0, l = owners_1.length; i < l; i++) {
  2719. owners_1[i].$forceUpdate();
  2720. }
  2721. if (renderCompleted) {
  2722. owners_1.length = 0;
  2723. if (timerLoading_1 !== null) {
  2724. clearTimeout(timerLoading_1);
  2725. timerLoading_1 = null;
  2726. }
  2727. if (timerTimeout_1 !== null) {
  2728. clearTimeout(timerTimeout_1);
  2729. timerTimeout_1 = null;
  2730. }
  2731. }
  2732. };
  2733. var resolve = once(function (res) {
  2734. // cache resolved
  2735. factory.resolved = ensureCtor(res, baseCtor);
  2736. // invoke callbacks only if this is not a synchronous resolve
  2737. // (async resolves are shimmed as synchronous during SSR)
  2738. if (!sync_1) {
  2739. forceRender_1(true);
  2740. }
  2741. else {
  2742. owners_1.length = 0;
  2743. }
  2744. });
  2745. var reject_1 = once(function (reason) {
  2746. process.env.NODE_ENV !== 'production' &&
  2747. warn("Failed to resolve async component: ".concat(String(factory)) +
  2748. (reason ? "\nReason: ".concat(reason) : ''));
  2749. if (isDef(factory.errorComp)) {
  2750. factory.error = true;
  2751. forceRender_1(true);
  2752. }
  2753. });
  2754. var res_1 = factory(resolve, reject_1);
  2755. if (isObject(res_1)) {
  2756. if (isPromise(res_1)) {
  2757. // () => Promise
  2758. if (isUndef(factory.resolved)) {
  2759. res_1.then(resolve, reject_1);
  2760. }
  2761. }
  2762. else if (isPromise(res_1.component)) {
  2763. res_1.component.then(resolve, reject_1);
  2764. if (isDef(res_1.error)) {
  2765. factory.errorComp = ensureCtor(res_1.error, baseCtor);
  2766. }
  2767. if (isDef(res_1.loading)) {
  2768. factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
  2769. if (res_1.delay === 0) {
  2770. factory.loading = true;
  2771. }
  2772. else {
  2773. // @ts-expect-error NodeJS timeout type
  2774. timerLoading_1 = setTimeout(function () {
  2775. timerLoading_1 = null;
  2776. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  2777. factory.loading = true;
  2778. forceRender_1(false);
  2779. }
  2780. }, res_1.delay || 200);
  2781. }
  2782. }
  2783. if (isDef(res_1.timeout)) {
  2784. // @ts-expect-error NodeJS timeout type
  2785. timerTimeout_1 = setTimeout(function () {
  2786. timerTimeout_1 = null;
  2787. if (isUndef(factory.resolved)) {
  2788. reject_1(process.env.NODE_ENV !== 'production' ? "timeout (".concat(res_1.timeout, "ms)") : null);
  2789. }
  2790. }, res_1.timeout);
  2791. }
  2792. }
  2793. }
  2794. sync_1 = false;
  2795. // return in case resolved synchronously
  2796. return factory.loading ? factory.loadingComp : factory.resolved;
  2797. }
  2798. }
  2799. function getFirstComponentChild(children) {
  2800. if (isArray(children)) {
  2801. for (var i = 0; i < children.length; i++) {
  2802. var c = children[i];
  2803. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  2804. return c;
  2805. }
  2806. }
  2807. }
  2808. }
  2809. var SIMPLE_NORMALIZE = 1;
  2810. var ALWAYS_NORMALIZE = 2;
  2811. // wrapper function for providing a more flexible interface
  2812. // without getting yelled at by flow
  2813. function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
  2814. if (isArray(data) || isPrimitive(data)) {
  2815. normalizationType = children;
  2816. children = data;
  2817. data = undefined;
  2818. }
  2819. if (isTrue(alwaysNormalize)) {
  2820. normalizationType = ALWAYS_NORMALIZE;
  2821. }
  2822. return _createElement(context, tag, data, children, normalizationType);
  2823. }
  2824. function _createElement(context, tag, data, children, normalizationType) {
  2825. if (isDef(data) && isDef(data.__ob__)) {
  2826. process.env.NODE_ENV !== 'production' &&
  2827. warn("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
  2828. return createEmptyVNode();
  2829. }
  2830. // object syntax in v-bind
  2831. if (isDef(data) && isDef(data.is)) {
  2832. tag = data.is;
  2833. }
  2834. if (!tag) {
  2835. // in case of component :is set to falsy value
  2836. return createEmptyVNode();
  2837. }
  2838. // warn against non-primitive key
  2839. if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
  2840. warn('Avoid using non-primitive value as key, ' +
  2841. 'use string/number value instead.', context);
  2842. }
  2843. // support single function children as default scoped slot
  2844. if (isArray(children) && isFunction(children[0])) {
  2845. data = data || {};
  2846. data.scopedSlots = { default: children[0] };
  2847. children.length = 0;
  2848. }
  2849. if (normalizationType === ALWAYS_NORMALIZE) {
  2850. children = normalizeChildren(children);
  2851. }
  2852. else if (normalizationType === SIMPLE_NORMALIZE) {
  2853. children = simpleNormalizeChildren(children);
  2854. }
  2855. var vnode, ns;
  2856. if (typeof tag === 'string') {
  2857. var Ctor = void 0;
  2858. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  2859. if (config.isReservedTag(tag)) {
  2860. // platform built-in elements
  2861. if (process.env.NODE_ENV !== 'production' &&
  2862. isDef(data) &&
  2863. isDef(data.nativeOn) &&
  2864. data.tag !== 'component') {
  2865. warn("The .native modifier for v-on is only valid on components but it was used on <".concat(tag, ">."), context);
  2866. }
  2867. vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
  2868. }
  2869. else if ((!data || !data.pre) &&
  2870. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  2871. // component
  2872. vnode = createComponent(Ctor, data, context, children, tag);
  2873. }
  2874. else {
  2875. // unknown or unlisted namespaced elements
  2876. // check at runtime because it may get assigned a namespace when its
  2877. // parent normalizes children
  2878. vnode = new VNode(tag, data, children, undefined, undefined, context);
  2879. }
  2880. }
  2881. else {
  2882. // direct component options / constructor
  2883. vnode = createComponent(tag, data, context, children);
  2884. }
  2885. if (isArray(vnode)) {
  2886. return vnode;
  2887. }
  2888. else if (isDef(vnode)) {
  2889. if (isDef(ns))
  2890. applyNS(vnode, ns);
  2891. if (isDef(data))
  2892. registerDeepBindings(data);
  2893. return vnode;
  2894. }
  2895. else {
  2896. return createEmptyVNode();
  2897. }
  2898. }
  2899. function applyNS(vnode, ns, force) {
  2900. vnode.ns = ns;
  2901. if (vnode.tag === 'foreignObject') {
  2902. // use default namespace inside foreignObject
  2903. ns = undefined;
  2904. force = true;
  2905. }
  2906. if (isDef(vnode.children)) {
  2907. for (var i = 0, l = vnode.children.length; i < l; i++) {
  2908. var child = vnode.children[i];
  2909. if (isDef(child.tag) &&
  2910. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  2911. applyNS(child, ns, force);
  2912. }
  2913. }
  2914. }
  2915. }
  2916. // ref #5318
  2917. // necessary to ensure parent re-render when deep bindings like :style and
  2918. // :class are used on slot nodes
  2919. function registerDeepBindings(data) {
  2920. if (isObject(data.style)) {
  2921. traverse(data.style);
  2922. }
  2923. if (isObject(data.class)) {
  2924. traverse(data.class);
  2925. }
  2926. }
  2927. /**
  2928. * @internal this function needs manual public type declaration because it relies
  2929. * on previously manually authored types from Vue 2
  2930. */
  2931. function h(type, props, children) {
  2932. if (!currentInstance) {
  2933. process.env.NODE_ENV !== 'production' &&
  2934. warn("globally imported h() can only be invoked when there is an active " +
  2935. "component instance, e.g. synchronously in a component's render or setup function.");
  2936. }
  2937. return createElement$1(currentInstance, type, props, children, 2, true);
  2938. }
  2939. function handleError(err, vm, info) {
  2940. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2941. // See: https://github.com/vuejs/vuex/issues/1505
  2942. pushTarget();
  2943. try {
  2944. if (vm) {
  2945. var cur = vm;
  2946. while ((cur = cur.$parent)) {
  2947. var hooks = cur.$options.errorCaptured;
  2948. if (hooks) {
  2949. for (var i = 0; i < hooks.length; i++) {
  2950. try {
  2951. var capture = hooks[i].call(cur, err, vm, info) === false;
  2952. if (capture)
  2953. return;
  2954. }
  2955. catch (e) {
  2956. globalHandleError(e, cur, 'errorCaptured hook');
  2957. }
  2958. }
  2959. }
  2960. }
  2961. }
  2962. globalHandleError(err, vm, info);
  2963. }
  2964. finally {
  2965. popTarget();
  2966. }
  2967. }
  2968. function invokeWithErrorHandling(handler, context, args, vm, info) {
  2969. var res;
  2970. try {
  2971. res = args ? handler.apply(context, args) : handler.call(context);
  2972. if (res && !res._isVue && isPromise(res) && !res._handled) {
  2973. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  2974. res._handled = true;
  2975. }
  2976. }
  2977. catch (e) {
  2978. handleError(e, vm, info);
  2979. }
  2980. return res;
  2981. }
  2982. function globalHandleError(err, vm, info) {
  2983. if (config.errorHandler) {
  2984. try {
  2985. return config.errorHandler.call(null, err, vm, info);
  2986. }
  2987. catch (e) {
  2988. // if the user intentionally throws the original error in the handler,
  2989. // do not log it twice
  2990. if (e !== err) {
  2991. logError(e, null, 'config.errorHandler');
  2992. }
  2993. }
  2994. }
  2995. logError(err, vm, info);
  2996. }
  2997. function logError(err, vm, info) {
  2998. if (process.env.NODE_ENV !== 'production') {
  2999. warn("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
  3000. }
  3001. /* istanbul ignore else */
  3002. if (inBrowser && typeof console !== 'undefined') {
  3003. console.error(err);
  3004. }
  3005. else {
  3006. throw err;
  3007. }
  3008. }
  3009. /* globals MutationObserver */
  3010. var isUsingMicroTask = false;
  3011. var callbacks = [];
  3012. var pending = false;
  3013. function flushCallbacks() {
  3014. pending = false;
  3015. var copies = callbacks.slice(0);
  3016. callbacks.length = 0;
  3017. for (var i = 0; i < copies.length; i++) {
  3018. copies[i]();
  3019. }
  3020. }
  3021. // Here we have async deferring wrappers using microtasks.
  3022. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3023. // However, it has subtle problems when state is changed right before repaint
  3024. // (e.g. #6813, out-in transitions).
  3025. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3026. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3027. // So we now use microtasks everywhere, again.
  3028. // A major drawback of this tradeoff is that there are some scenarios
  3029. // where microtasks have too high a priority and fire in between supposedly
  3030. // sequential events (e.g. #4521, #6690, which have workarounds)
  3031. // or even between bubbling of the same event (#6566).
  3032. var timerFunc;
  3033. // The nextTick behavior leverages the microtask queue, which can be accessed
  3034. // via either native Promise.then or MutationObserver.
  3035. // MutationObserver has wider support, however it is seriously bugged in
  3036. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3037. // completely stops working after triggering a few times... so, if native
  3038. // Promise is available, we will use it:
  3039. /* istanbul ignore next, $flow-disable-line */
  3040. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3041. var p_1 = Promise.resolve();
  3042. timerFunc = function () {
  3043. p_1.then(flushCallbacks);
  3044. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3045. // it can get stuck in a weird state where callbacks are pushed into the
  3046. // microtask queue but the queue isn't being flushed, until the browser
  3047. // needs to do some other work, e.g. handle a timer. Therefore we can
  3048. // "force" the microtask queue to be flushed by adding an empty timer.
  3049. if (isIOS)
  3050. setTimeout(noop);
  3051. };
  3052. isUsingMicroTask = true;
  3053. }
  3054. else if (!isIE &&
  3055. typeof MutationObserver !== 'undefined' &&
  3056. (isNative(MutationObserver) ||
  3057. // PhantomJS and iOS 7.x
  3058. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  3059. // Use MutationObserver where native Promise is not available,
  3060. // e.g. PhantomJS, iOS7, Android 4.4
  3061. // (#6466 MutationObserver is unreliable in IE11)
  3062. var counter_1 = 1;
  3063. var observer = new MutationObserver(flushCallbacks);
  3064. var textNode_1 = document.createTextNode(String(counter_1));
  3065. observer.observe(textNode_1, {
  3066. characterData: true
  3067. });
  3068. timerFunc = function () {
  3069. counter_1 = (counter_1 + 1) % 2;
  3070. textNode_1.data = String(counter_1);
  3071. };
  3072. isUsingMicroTask = true;
  3073. }
  3074. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3075. // Fallback to setImmediate.
  3076. // Technically it leverages the (macro) task queue,
  3077. // but it is still a better choice than setTimeout.
  3078. timerFunc = function () {
  3079. setImmediate(flushCallbacks);
  3080. };
  3081. }
  3082. else {
  3083. // Fallback to setTimeout.
  3084. timerFunc = function () {
  3085. setTimeout(flushCallbacks, 0);
  3086. };
  3087. }
  3088. /**
  3089. * @internal
  3090. */
  3091. function nextTick(cb, ctx) {
  3092. var _resolve;
  3093. callbacks.push(function () {
  3094. if (cb) {
  3095. try {
  3096. cb.call(ctx);
  3097. }
  3098. catch (e) {
  3099. handleError(e, ctx, 'nextTick');
  3100. }
  3101. }
  3102. else if (_resolve) {
  3103. _resolve(ctx);
  3104. }
  3105. });
  3106. if (!pending) {
  3107. pending = true;
  3108. timerFunc();
  3109. }
  3110. // $flow-disable-line
  3111. if (!cb && typeof Promise !== 'undefined') {
  3112. return new Promise(function (resolve) {
  3113. _resolve = resolve;
  3114. });
  3115. }
  3116. }
  3117. function useCssModule(name) {
  3118. if (name === void 0) { name = '$style'; }
  3119. /* istanbul ignore else */
  3120. {
  3121. if (!currentInstance) {
  3122. process.env.NODE_ENV !== 'production' && warn("useCssModule must be called inside setup()");
  3123. return emptyObject;
  3124. }
  3125. var mod = currentInstance[name];
  3126. if (!mod) {
  3127. process.env.NODE_ENV !== 'production' &&
  3128. warn("Current instance does not have CSS module named \"".concat(name, "\"."));
  3129. return emptyObject;
  3130. }
  3131. return mod;
  3132. }
  3133. }
  3134. /**
  3135. * Runtime helper for SFC's CSS variable injection feature.
  3136. * @private
  3137. */
  3138. function useCssVars(getter) {
  3139. if (!inBrowser && !false)
  3140. return;
  3141. var instance = currentInstance;
  3142. if (!instance) {
  3143. process.env.NODE_ENV !== 'production' &&
  3144. warn("useCssVars is called without current active component instance.");
  3145. return;
  3146. }
  3147. watchPostEffect(function () {
  3148. var el = instance.$el;
  3149. var vars = getter(instance, instance._setupProxy);
  3150. if (el && el.nodeType === 1) {
  3151. var style = el.style;
  3152. for (var key in vars) {
  3153. style.setProperty("--".concat(key), vars[key]);
  3154. }
  3155. }
  3156. });
  3157. }
  3158. /**
  3159. * v3-compatible async component API.
  3160. * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
  3161. * because it relies on existing manual types
  3162. */
  3163. function defineAsyncComponent(source) {
  3164. if (isFunction(source)) {
  3165. source = { loader: source };
  3166. }
  3167. var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
  3168. _b = source.suspensible, // undefined = never times out
  3169. suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
  3170. userOnError = source.onError;
  3171. if (process.env.NODE_ENV !== 'production' && suspensible) {
  3172. warn("The suspensiblbe option for async components is not supported in Vue2. It is ignored.");
  3173. }
  3174. var pendingRequest = null;
  3175. var retries = 0;
  3176. var retry = function () {
  3177. retries++;
  3178. pendingRequest = null;
  3179. return load();
  3180. };
  3181. var load = function () {
  3182. var thisRequest;
  3183. return (pendingRequest ||
  3184. (thisRequest = pendingRequest =
  3185. loader()
  3186. .catch(function (err) {
  3187. err = err instanceof Error ? err : new Error(String(err));
  3188. if (userOnError) {
  3189. return new Promise(function (resolve, reject) {
  3190. var userRetry = function () { return resolve(retry()); };
  3191. var userFail = function () { return reject(err); };
  3192. userOnError(err, userRetry, userFail, retries + 1);
  3193. });
  3194. }
  3195. else {
  3196. throw err;
  3197. }
  3198. })
  3199. .then(function (comp) {
  3200. if (thisRequest !== pendingRequest && pendingRequest) {
  3201. return pendingRequest;
  3202. }
  3203. if (process.env.NODE_ENV !== 'production' && !comp) {
  3204. warn("Async component loader resolved to undefined. " +
  3205. "If you are using retry(), make sure to return its return value.");
  3206. }
  3207. // interop module default
  3208. if (comp &&
  3209. (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
  3210. comp = comp.default;
  3211. }
  3212. if (process.env.NODE_ENV !== 'production' && comp && !isObject(comp) && !isFunction(comp)) {
  3213. throw new Error("Invalid async component load result: ".concat(comp));
  3214. }
  3215. return comp;
  3216. })));
  3217. };
  3218. return function () {
  3219. var component = load();
  3220. return {
  3221. component: component,
  3222. delay: delay,
  3223. timeout: timeout,
  3224. error: errorComponent,
  3225. loading: loadingComponent
  3226. };
  3227. };
  3228. }
  3229. function createLifeCycle(hookName) {
  3230. return function (fn, target) {
  3231. if (target === void 0) { target = currentInstance; }
  3232. if (!target) {
  3233. process.env.NODE_ENV !== 'production' &&
  3234. warn("".concat(formatName(hookName), " is called when there is no active component instance to be ") +
  3235. "associated with. " +
  3236. "Lifecycle injection APIs can only be used during execution of setup().");
  3237. return;
  3238. }
  3239. return injectHook(target, hookName, fn);
  3240. };
  3241. }
  3242. function formatName(name) {
  3243. if (name === 'beforeDestroy') {
  3244. name = 'beforeUnmount';
  3245. }
  3246. else if (name === 'destroyed') {
  3247. name = 'unmounted';
  3248. }
  3249. return "on".concat(name[0].toUpperCase() + name.slice(1));
  3250. }
  3251. function injectHook(instance, hookName, fn) {
  3252. var options = instance.$options;
  3253. options[hookName] = mergeLifecycleHook(options[hookName], fn);
  3254. }
  3255. var onBeforeMount = createLifeCycle('beforeMount');
  3256. var onMounted = createLifeCycle('mounted');
  3257. var onBeforeUpdate = createLifeCycle('beforeUpdate');
  3258. var onUpdated = createLifeCycle('updated');
  3259. var onBeforeUnmount = createLifeCycle('beforeDestroy');
  3260. var onUnmounted = createLifeCycle('destroyed');
  3261. var onActivated = createLifeCycle('activated');
  3262. var onDeactivated = createLifeCycle('deactivated');
  3263. var onServerPrefetch = createLifeCycle('serverPrefetch');
  3264. var onRenderTracked = createLifeCycle('renderTracked');
  3265. var onRenderTriggered = createLifeCycle('renderTriggered');
  3266. var injectErrorCapturedHook = createLifeCycle('errorCaptured');
  3267. function onErrorCaptured(hook, target) {
  3268. if (target === void 0) { target = currentInstance; }
  3269. injectErrorCapturedHook(hook, target);
  3270. }
  3271. /**
  3272. * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
  3273. */
  3274. var version = '2.7.13';
  3275. /**
  3276. * @internal type is manually declared in <root>/types/v3-define-component.d.ts
  3277. */
  3278. function defineComponent(options) {
  3279. return options;
  3280. }
  3281. var seenObjects = new _Set();
  3282. /**
  3283. * Recursively traverse an object to evoke all converted
  3284. * getters, so that every nested property inside the object
  3285. * is collected as a "deep" dependency.
  3286. */
  3287. function traverse(val) {
  3288. _traverse(val, seenObjects);
  3289. seenObjects.clear();
  3290. return val;
  3291. }
  3292. function _traverse(val, seen) {
  3293. var i, keys;
  3294. var isA = isArray(val);
  3295. if ((!isA && !isObject(val)) ||
  3296. val.__v_skip /* ReactiveFlags.SKIP */ ||
  3297. Object.isFrozen(val) ||
  3298. val instanceof VNode) {
  3299. return;
  3300. }
  3301. if (val.__ob__) {
  3302. var depId = val.__ob__.dep.id;
  3303. if (seen.has(depId)) {
  3304. return;
  3305. }
  3306. seen.add(depId);
  3307. }
  3308. if (isA) {
  3309. i = val.length;
  3310. while (i--)
  3311. _traverse(val[i], seen);
  3312. }
  3313. else if (isRef(val)) {
  3314. _traverse(val.value, seen);
  3315. }
  3316. else {
  3317. keys = Object.keys(val);
  3318. i = keys.length;
  3319. while (i--)
  3320. _traverse(val[keys[i]], seen);
  3321. }
  3322. }
  3323. var uid$1 = 0;
  3324. /**
  3325. * A watcher parses an expression, collects dependencies,
  3326. * and fires callback when the expression value changes.
  3327. * This is used for both the $watch() api and directives.
  3328. * @internal
  3329. */
  3330. var Watcher = /** @class */ (function () {
  3331. function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
  3332. recordEffectScope(this,
  3333. // if the active effect scope is manually created (not a component scope),
  3334. // prioritize it
  3335. activeEffectScope && !activeEffectScope._vm
  3336. ? activeEffectScope
  3337. : vm
  3338. ? vm._scope
  3339. : undefined);
  3340. if ((this.vm = vm) && isRenderWatcher) {
  3341. vm._watcher = this;
  3342. }
  3343. // options
  3344. if (options) {
  3345. this.deep = !!options.deep;
  3346. this.user = !!options.user;
  3347. this.lazy = !!options.lazy;
  3348. this.sync = !!options.sync;
  3349. this.before = options.before;
  3350. if (process.env.NODE_ENV !== 'production') {
  3351. this.onTrack = options.onTrack;
  3352. this.onTrigger = options.onTrigger;
  3353. }
  3354. }
  3355. else {
  3356. this.deep = this.user = this.lazy = this.sync = false;
  3357. }
  3358. this.cb = cb;
  3359. this.id = ++uid$1; // uid for batching
  3360. this.active = true;
  3361. this.post = false;
  3362. this.dirty = this.lazy; // for lazy watchers
  3363. this.deps = [];
  3364. this.newDeps = [];
  3365. this.depIds = new _Set();
  3366. this.newDepIds = new _Set();
  3367. this.expression = process.env.NODE_ENV !== 'production' ? expOrFn.toString() : '';
  3368. // parse expression for getter
  3369. if (isFunction(expOrFn)) {
  3370. this.getter = expOrFn;
  3371. }
  3372. else {
  3373. this.getter = parsePath(expOrFn);
  3374. if (!this.getter) {
  3375. this.getter = noop;
  3376. process.env.NODE_ENV !== 'production' &&
  3377. warn("Failed watching path: \"".concat(expOrFn, "\" ") +
  3378. 'Watcher only accepts simple dot-delimited paths. ' +
  3379. 'For full control, use a function instead.', vm);
  3380. }
  3381. }
  3382. this.value = this.lazy ? undefined : this.get();
  3383. }
  3384. /**
  3385. * Evaluate the getter, and re-collect dependencies.
  3386. */
  3387. Watcher.prototype.get = function () {
  3388. pushTarget(this);
  3389. var value;
  3390. var vm = this.vm;
  3391. try {
  3392. value = this.getter.call(vm, vm);
  3393. }
  3394. catch (e) {
  3395. if (this.user) {
  3396. handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
  3397. }
  3398. else {
  3399. throw e;
  3400. }
  3401. }
  3402. finally {
  3403. // "touch" every property so they are all tracked as
  3404. // dependencies for deep watching
  3405. if (this.deep) {
  3406. traverse(value);
  3407. }
  3408. popTarget();
  3409. this.cleanupDeps();
  3410. }
  3411. return value;
  3412. };
  3413. /**
  3414. * Add a dependency to this directive.
  3415. */
  3416. Watcher.prototype.addDep = function (dep) {
  3417. var id = dep.id;
  3418. if (!this.newDepIds.has(id)) {
  3419. this.newDepIds.add(id);
  3420. this.newDeps.push(dep);
  3421. if (!this.depIds.has(id)) {
  3422. dep.addSub(this);
  3423. }
  3424. }
  3425. };
  3426. /**
  3427. * Clean up for dependency collection.
  3428. */
  3429. Watcher.prototype.cleanupDeps = function () {
  3430. var i = this.deps.length;
  3431. while (i--) {
  3432. var dep = this.deps[i];
  3433. if (!this.newDepIds.has(dep.id)) {
  3434. dep.removeSub(this);
  3435. }
  3436. }
  3437. var tmp = this.depIds;
  3438. this.depIds = this.newDepIds;
  3439. this.newDepIds = tmp;
  3440. this.newDepIds.clear();
  3441. tmp = this.deps;
  3442. this.deps = this.newDeps;
  3443. this.newDeps = tmp;
  3444. this.newDeps.length = 0;
  3445. };
  3446. /**
  3447. * Subscriber interface.
  3448. * Will be called when a dependency changes.
  3449. */
  3450. Watcher.prototype.update = function () {
  3451. /* istanbul ignore else */
  3452. if (this.lazy) {
  3453. this.dirty = true;
  3454. }
  3455. else if (this.sync) {
  3456. this.run();
  3457. }
  3458. else {
  3459. queueWatcher(this);
  3460. }
  3461. };
  3462. /**
  3463. * Scheduler job interface.
  3464. * Will be called by the scheduler.
  3465. */
  3466. Watcher.prototype.run = function () {
  3467. if (this.active) {
  3468. var value = this.get();
  3469. if (value !== this.value ||
  3470. // Deep watchers and watchers on Object/Arrays should fire even
  3471. // when the value is the same, because the value may
  3472. // have mutated.
  3473. isObject(value) ||
  3474. this.deep) {
  3475. // set new value
  3476. var oldValue = this.value;
  3477. this.value = value;
  3478. if (this.user) {
  3479. var info = "callback for watcher \"".concat(this.expression, "\"");
  3480. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  3481. }
  3482. else {
  3483. this.cb.call(this.vm, value, oldValue);
  3484. }
  3485. }
  3486. }
  3487. };
  3488. /**
  3489. * Evaluate the value of the watcher.
  3490. * This only gets called for lazy watchers.
  3491. */
  3492. Watcher.prototype.evaluate = function () {
  3493. this.value = this.get();
  3494. this.dirty = false;
  3495. };
  3496. /**
  3497. * Depend on all deps collected by this watcher.
  3498. */
  3499. Watcher.prototype.depend = function () {
  3500. var i = this.deps.length;
  3501. while (i--) {
  3502. this.deps[i].depend();
  3503. }
  3504. };
  3505. /**
  3506. * Remove self from all dependencies' subscriber list.
  3507. */
  3508. Watcher.prototype.teardown = function () {
  3509. if (this.vm && !this.vm._isBeingDestroyed) {
  3510. remove$2(this.vm._scope.effects, this);
  3511. }
  3512. if (this.active) {
  3513. var i = this.deps.length;
  3514. while (i--) {
  3515. this.deps[i].removeSub(this);
  3516. }
  3517. this.active = false;
  3518. if (this.onStop) {
  3519. this.onStop();
  3520. }
  3521. }
  3522. };
  3523. return Watcher;
  3524. }());
  3525. var mark;
  3526. var measure;
  3527. if (process.env.NODE_ENV !== 'production') {
  3528. var perf_1 = inBrowser && window.performance;
  3529. /* istanbul ignore if */
  3530. if (perf_1 &&
  3531. // @ts-ignore
  3532. perf_1.mark &&
  3533. // @ts-ignore
  3534. perf_1.measure &&
  3535. // @ts-ignore
  3536. perf_1.clearMarks &&
  3537. // @ts-ignore
  3538. perf_1.clearMeasures) {
  3539. mark = function (tag) { return perf_1.mark(tag); };
  3540. measure = function (name, startTag, endTag) {
  3541. perf_1.measure(name, startTag, endTag);
  3542. perf_1.clearMarks(startTag);
  3543. perf_1.clearMarks(endTag);
  3544. // perf.clearMeasures(name)
  3545. };
  3546. }
  3547. }
  3548. function initEvents(vm) {
  3549. vm._events = Object.create(null);
  3550. vm._hasHookEvent = false;
  3551. // init parent attached events
  3552. var listeners = vm.$options._parentListeners;
  3553. if (listeners) {
  3554. updateComponentListeners(vm, listeners);
  3555. }
  3556. }
  3557. var target$1;
  3558. function add$1(event, fn) {
  3559. target$1.$on(event, fn);
  3560. }
  3561. function remove$1(event, fn) {
  3562. target$1.$off(event, fn);
  3563. }
  3564. function createOnceHandler$1(event, fn) {
  3565. var _target = target$1;
  3566. return function onceHandler() {
  3567. var res = fn.apply(null, arguments);
  3568. if (res !== null) {
  3569. _target.$off(event, onceHandler);
  3570. }
  3571. };
  3572. }
  3573. function updateComponentListeners(vm, listeners, oldListeners) {
  3574. target$1 = vm;
  3575. updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
  3576. target$1 = undefined;
  3577. }
  3578. function eventsMixin(Vue) {
  3579. var hookRE = /^hook:/;
  3580. Vue.prototype.$on = function (event, fn) {
  3581. var vm = this;
  3582. if (isArray(event)) {
  3583. for (var i = 0, l = event.length; i < l; i++) {
  3584. vm.$on(event[i], fn);
  3585. }
  3586. }
  3587. else {
  3588. (vm._events[event] || (vm._events[event] = [])).push(fn);
  3589. // optimize hook:event cost by using a boolean flag marked at registration
  3590. // instead of a hash lookup
  3591. if (hookRE.test(event)) {
  3592. vm._hasHookEvent = true;
  3593. }
  3594. }
  3595. return vm;
  3596. };
  3597. Vue.prototype.$once = function (event, fn) {
  3598. var vm = this;
  3599. function on() {
  3600. vm.$off(event, on);
  3601. fn.apply(vm, arguments);
  3602. }
  3603. on.fn = fn;
  3604. vm.$on(event, on);
  3605. return vm;
  3606. };
  3607. Vue.prototype.$off = function (event, fn) {
  3608. var vm = this;
  3609. // all
  3610. if (!arguments.length) {
  3611. vm._events = Object.create(null);
  3612. return vm;
  3613. }
  3614. // array of events
  3615. if (isArray(event)) {
  3616. for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
  3617. vm.$off(event[i_1], fn);
  3618. }
  3619. return vm;
  3620. }
  3621. // specific event
  3622. var cbs = vm._events[event];
  3623. if (!cbs) {
  3624. return vm;
  3625. }
  3626. if (!fn) {
  3627. vm._events[event] = null;
  3628. return vm;
  3629. }
  3630. // specific handler
  3631. var cb;
  3632. var i = cbs.length;
  3633. while (i--) {
  3634. cb = cbs[i];
  3635. if (cb === fn || cb.fn === fn) {
  3636. cbs.splice(i, 1);
  3637. break;
  3638. }
  3639. }
  3640. return vm;
  3641. };
  3642. Vue.prototype.$emit = function (event) {
  3643. var vm = this;
  3644. if (process.env.NODE_ENV !== 'production') {
  3645. var lowerCaseEvent = event.toLowerCase();
  3646. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  3647. tip("Event \"".concat(lowerCaseEvent, "\" is emitted in component ") +
  3648. "".concat(formatComponentName(vm), " but the handler is registered for \"").concat(event, "\". ") +
  3649. "Note that HTML attributes are case-insensitive and you cannot use " +
  3650. "v-on to listen to camelCase events when using in-DOM templates. " +
  3651. "You should probably use \"".concat(hyphenate(event), "\" instead of \"").concat(event, "\"."));
  3652. }
  3653. }
  3654. var cbs = vm._events[event];
  3655. if (cbs) {
  3656. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  3657. var args = toArray(arguments, 1);
  3658. var info = "event handler for \"".concat(event, "\"");
  3659. for (var i = 0, l = cbs.length; i < l; i++) {
  3660. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  3661. }
  3662. }
  3663. return vm;
  3664. };
  3665. }
  3666. var activeInstance = null;
  3667. var isUpdatingChildComponent = false;
  3668. function setActiveInstance(vm) {
  3669. var prevActiveInstance = activeInstance;
  3670. activeInstance = vm;
  3671. return function () {
  3672. activeInstance = prevActiveInstance;
  3673. };
  3674. }
  3675. function initLifecycle(vm) {
  3676. var options = vm.$options;
  3677. // locate first non-abstract parent
  3678. var parent = options.parent;
  3679. if (parent && !options.abstract) {
  3680. while (parent.$options.abstract && parent.$parent) {
  3681. parent = parent.$parent;
  3682. }
  3683. parent.$children.push(vm);
  3684. }
  3685. vm.$parent = parent;
  3686. vm.$root = parent ? parent.$root : vm;
  3687. vm.$children = [];
  3688. vm.$refs = {};
  3689. vm._provided = parent ? parent._provided : Object.create(null);
  3690. vm._watcher = null;
  3691. vm._inactive = null;
  3692. vm._directInactive = false;
  3693. vm._isMounted = false;
  3694. vm._isDestroyed = false;
  3695. vm._isBeingDestroyed = false;
  3696. }
  3697. function lifecycleMixin(Vue) {
  3698. Vue.prototype._update = function (vnode, hydrating) {
  3699. var vm = this;
  3700. var prevEl = vm.$el;
  3701. var prevVnode = vm._vnode;
  3702. var restoreActiveInstance = setActiveInstance(vm);
  3703. vm._vnode = vnode;
  3704. // Vue.prototype.__patch__ is injected in entry points
  3705. // based on the rendering backend used.
  3706. if (!prevVnode) {
  3707. // initial render
  3708. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  3709. }
  3710. else {
  3711. // updates
  3712. vm.$el = vm.__patch__(prevVnode, vnode);
  3713. }
  3714. restoreActiveInstance();
  3715. // update __vue__ reference
  3716. if (prevEl) {
  3717. prevEl.__vue__ = null;
  3718. }
  3719. if (vm.$el) {
  3720. vm.$el.__vue__ = vm;
  3721. }
  3722. // if parent is an HOC, update its $el as well
  3723. var wrapper = vm;
  3724. while (wrapper &&
  3725. wrapper.$vnode &&
  3726. wrapper.$parent &&
  3727. wrapper.$vnode === wrapper.$parent._vnode) {
  3728. wrapper.$parent.$el = wrapper.$el;
  3729. wrapper = wrapper.$parent;
  3730. }
  3731. // updated hook is called by the scheduler to ensure that children are
  3732. // updated in a parent's updated hook.
  3733. };
  3734. Vue.prototype.$forceUpdate = function () {
  3735. var vm = this;
  3736. if (vm._watcher) {
  3737. vm._watcher.update();
  3738. }
  3739. };
  3740. Vue.prototype.$destroy = function () {
  3741. var vm = this;
  3742. if (vm._isBeingDestroyed) {
  3743. return;
  3744. }
  3745. callHook$1(vm, 'beforeDestroy');
  3746. vm._isBeingDestroyed = true;
  3747. // remove self from parent
  3748. var parent = vm.$parent;
  3749. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  3750. remove$2(parent.$children, vm);
  3751. }
  3752. // teardown scope. this includes both the render watcher and other
  3753. // watchers created
  3754. vm._scope.stop();
  3755. // remove reference from data ob
  3756. // frozen object may not have observer.
  3757. if (vm._data.__ob__) {
  3758. vm._data.__ob__.vmCount--;
  3759. }
  3760. // call the last hook...
  3761. vm._isDestroyed = true;
  3762. // invoke destroy hooks on current rendered tree
  3763. vm.__patch__(vm._vnode, null);
  3764. // fire destroyed hook
  3765. callHook$1(vm, 'destroyed');
  3766. // turn off all instance listeners.
  3767. vm.$off();
  3768. // remove __vue__ reference
  3769. if (vm.$el) {
  3770. vm.$el.__vue__ = null;
  3771. }
  3772. // release circular reference (#6759)
  3773. if (vm.$vnode) {
  3774. vm.$vnode.parent = null;
  3775. }
  3776. };
  3777. }
  3778. function mountComponent(vm, el, hydrating) {
  3779. vm.$el = el;
  3780. if (!vm.$options.render) {
  3781. // @ts-expect-error invalid type
  3782. vm.$options.render = createEmptyVNode;
  3783. if (process.env.NODE_ENV !== 'production') {
  3784. /* istanbul ignore if */
  3785. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  3786. vm.$options.el ||
  3787. el) {
  3788. warn('You are using the runtime-only build of Vue where the template ' +
  3789. 'compiler is not available. Either pre-compile the templates into ' +
  3790. 'render functions, or use the compiler-included build.', vm);
  3791. }
  3792. else {
  3793. warn('Failed to mount component: template or render function not defined.', vm);
  3794. }
  3795. }
  3796. }
  3797. callHook$1(vm, 'beforeMount');
  3798. var updateComponent;
  3799. /* istanbul ignore if */
  3800. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  3801. updateComponent = function () {
  3802. var name = vm._name;
  3803. var id = vm._uid;
  3804. var startTag = "vue-perf-start:".concat(id);
  3805. var endTag = "vue-perf-end:".concat(id);
  3806. mark(startTag);
  3807. var vnode = vm._render();
  3808. mark(endTag);
  3809. measure("vue ".concat(name, " render"), startTag, endTag);
  3810. mark(startTag);
  3811. vm._update(vnode, hydrating);
  3812. mark(endTag);
  3813. measure("vue ".concat(name, " patch"), startTag, endTag);
  3814. };
  3815. }
  3816. else {
  3817. updateComponent = function () {
  3818. vm._update(vm._render(), hydrating);
  3819. };
  3820. }
  3821. var watcherOptions = {
  3822. before: function () {
  3823. if (vm._isMounted && !vm._isDestroyed) {
  3824. callHook$1(vm, 'beforeUpdate');
  3825. }
  3826. }
  3827. };
  3828. if (process.env.NODE_ENV !== 'production') {
  3829. watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };
  3830. watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };
  3831. }
  3832. // we set this to vm._watcher inside the watcher's constructor
  3833. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  3834. // component's mounted hook), which relies on vm._watcher being already defined
  3835. new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
  3836. hydrating = false;
  3837. // flush buffer for flush: "pre" watchers queued in setup()
  3838. var preWatchers = vm._preWatchers;
  3839. if (preWatchers) {
  3840. for (var i = 0; i < preWatchers.length; i++) {
  3841. preWatchers[i].run();
  3842. }
  3843. }
  3844. // manually mounted instance, call mounted on self
  3845. // mounted is called for render-created child components in its inserted hook
  3846. if (vm.$vnode == null) {
  3847. vm._isMounted = true;
  3848. callHook$1(vm, 'mounted');
  3849. }
  3850. return vm;
  3851. }
  3852. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  3853. if (process.env.NODE_ENV !== 'production') {
  3854. isUpdatingChildComponent = true;
  3855. }
  3856. // determine whether component has slot children
  3857. // we need to do this before overwriting $options._renderChildren.
  3858. // check if there are dynamic scopedSlots (hand-written or compiled but with
  3859. // dynamic slot names). Static scoped slots compiled from template has the
  3860. // "$stable" marker.
  3861. var newScopedSlots = parentVnode.data.scopedSlots;
  3862. var oldScopedSlots = vm.$scopedSlots;
  3863. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  3864. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  3865. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  3866. (!newScopedSlots && vm.$scopedSlots.$key));
  3867. // Any static slot children from the parent may have changed during parent's
  3868. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  3869. // update is necessary to ensure correctness.
  3870. var needsForceUpdate = !!(renderChildren || // has new static slots
  3871. vm.$options._renderChildren || // has old static slots
  3872. hasDynamicScopedSlot);
  3873. var prevVNode = vm.$vnode;
  3874. vm.$options._parentVnode = parentVnode;
  3875. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  3876. if (vm._vnode) {
  3877. // update child tree's parent
  3878. vm._vnode.parent = parentVnode;
  3879. }
  3880. vm.$options._renderChildren = renderChildren;
  3881. // update $attrs and $listeners hash
  3882. // these are also reactive so they may trigger child update if the child
  3883. // used them during render
  3884. var attrs = parentVnode.data.attrs || emptyObject;
  3885. if (vm._attrsProxy) {
  3886. // force update if attrs are accessed and has changed since it may be
  3887. // passed to a child component.
  3888. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  3889. needsForceUpdate = true;
  3890. }
  3891. }
  3892. vm.$attrs = attrs;
  3893. // update listeners
  3894. listeners = listeners || emptyObject;
  3895. var prevListeners = vm.$options._parentListeners;
  3896. if (vm._listenersProxy) {
  3897. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  3898. }
  3899. vm.$listeners = vm.$options._parentListeners = listeners;
  3900. updateComponentListeners(vm, listeners, prevListeners);
  3901. // update props
  3902. if (propsData && vm.$options.props) {
  3903. toggleObserving(false);
  3904. var props = vm._props;
  3905. var propKeys = vm.$options._propKeys || [];
  3906. for (var i = 0; i < propKeys.length; i++) {
  3907. var key = propKeys[i];
  3908. var propOptions = vm.$options.props; // wtf flow?
  3909. props[key] = validateProp(key, propOptions, propsData, vm);
  3910. }
  3911. toggleObserving(true);
  3912. // keep a copy of raw propsData
  3913. vm.$options.propsData = propsData;
  3914. }
  3915. // resolve slots + force update if has children
  3916. if (needsForceUpdate) {
  3917. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  3918. vm.$forceUpdate();
  3919. }
  3920. if (process.env.NODE_ENV !== 'production') {
  3921. isUpdatingChildComponent = false;
  3922. }
  3923. }
  3924. function isInInactiveTree(vm) {
  3925. while (vm && (vm = vm.$parent)) {
  3926. if (vm._inactive)
  3927. return true;
  3928. }
  3929. return false;
  3930. }
  3931. function activateChildComponent(vm, direct) {
  3932. if (direct) {
  3933. vm._directInactive = false;
  3934. if (isInInactiveTree(vm)) {
  3935. return;
  3936. }
  3937. }
  3938. else if (vm._directInactive) {
  3939. return;
  3940. }
  3941. if (vm._inactive || vm._inactive === null) {
  3942. vm._inactive = false;
  3943. for (var i = 0; i < vm.$children.length; i++) {
  3944. activateChildComponent(vm.$children[i]);
  3945. }
  3946. callHook$1(vm, 'activated');
  3947. }
  3948. }
  3949. function deactivateChildComponent(vm, direct) {
  3950. if (direct) {
  3951. vm._directInactive = true;
  3952. if (isInInactiveTree(vm)) {
  3953. return;
  3954. }
  3955. }
  3956. if (!vm._inactive) {
  3957. vm._inactive = true;
  3958. for (var i = 0; i < vm.$children.length; i++) {
  3959. deactivateChildComponent(vm.$children[i]);
  3960. }
  3961. callHook$1(vm, 'deactivated');
  3962. }
  3963. }
  3964. function callHook$1(vm, hook, args, setContext) {
  3965. if (setContext === void 0) { setContext = true; }
  3966. // #7573 disable dep collection when invoking lifecycle hooks
  3967. pushTarget();
  3968. var prev = currentInstance;
  3969. setContext && setCurrentInstance(vm);
  3970. var handlers = vm.$options[hook];
  3971. var info = "".concat(hook, " hook");
  3972. if (handlers) {
  3973. for (var i = 0, j = handlers.length; i < j; i++) {
  3974. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  3975. }
  3976. }
  3977. if (vm._hasHookEvent) {
  3978. vm.$emit('hook:' + hook);
  3979. }
  3980. setContext && setCurrentInstance(prev);
  3981. popTarget();
  3982. }
  3983. var MAX_UPDATE_COUNT = 100;
  3984. var queue = [];
  3985. var activatedChildren = [];
  3986. var has = {};
  3987. var circular = {};
  3988. var waiting = false;
  3989. var flushing = false;
  3990. var index = 0;
  3991. /**
  3992. * Reset the scheduler's state.
  3993. */
  3994. function resetSchedulerState() {
  3995. index = queue.length = activatedChildren.length = 0;
  3996. has = {};
  3997. if (process.env.NODE_ENV !== 'production') {
  3998. circular = {};
  3999. }
  4000. waiting = flushing = false;
  4001. }
  4002. // Async edge case #6566 requires saving the timestamp when event listeners are
  4003. // attached. However, calling performance.now() has a perf overhead especially
  4004. // if the page has thousands of event listeners. Instead, we take a timestamp
  4005. // every time the scheduler flushes and use that for all event listeners
  4006. // attached during that flush.
  4007. var currentFlushTimestamp = 0;
  4008. // Async edge case fix requires storing an event listener's attach timestamp.
  4009. var getNow = Date.now;
  4010. // Determine what event timestamp the browser is using. Annoyingly, the
  4011. // timestamp can either be hi-res (relative to page load) or low-res
  4012. // (relative to UNIX epoch), so in order to compare time we have to use the
  4013. // same timestamp type when saving the flush timestamp.
  4014. // All IE versions use low-res event timestamps, and have problematic clock
  4015. // implementations (#9632)
  4016. if (inBrowser && !isIE) {
  4017. var performance_1 = window.performance;
  4018. if (performance_1 &&
  4019. typeof performance_1.now === 'function' &&
  4020. getNow() > document.createEvent('Event').timeStamp) {
  4021. // if the event timestamp, although evaluated AFTER the Date.now(), is
  4022. // smaller than it, it means the event is using a hi-res timestamp,
  4023. // and we need to use the hi-res version for event listener timestamps as
  4024. // well.
  4025. getNow = function () { return performance_1.now(); };
  4026. }
  4027. }
  4028. var sortCompareFn = function (a, b) {
  4029. if (a.post) {
  4030. if (!b.post)
  4031. return 1;
  4032. }
  4033. else if (b.post) {
  4034. return -1;
  4035. }
  4036. return a.id - b.id;
  4037. };
  4038. /**
  4039. * Flush both queues and run the watchers.
  4040. */
  4041. function flushSchedulerQueue() {
  4042. currentFlushTimestamp = getNow();
  4043. flushing = true;
  4044. var watcher, id;
  4045. // Sort queue before flush.
  4046. // This ensures that:
  4047. // 1. Components are updated from parent to child. (because parent is always
  4048. // created before the child)
  4049. // 2. A component's user watchers are run before its render watcher (because
  4050. // user watchers are created before the render watcher)
  4051. // 3. If a component is destroyed during a parent component's watcher run,
  4052. // its watchers can be skipped.
  4053. queue.sort(sortCompareFn);
  4054. // do not cache length because more watchers might be pushed
  4055. // as we run existing watchers
  4056. for (index = 0; index < queue.length; index++) {
  4057. watcher = queue[index];
  4058. if (watcher.before) {
  4059. watcher.before();
  4060. }
  4061. id = watcher.id;
  4062. has[id] = null;
  4063. watcher.run();
  4064. // in dev build, check and stop circular updates.
  4065. if (process.env.NODE_ENV !== 'production' && has[id] != null) {
  4066. circular[id] = (circular[id] || 0) + 1;
  4067. if (circular[id] > MAX_UPDATE_COUNT) {
  4068. warn('You may have an infinite update loop ' +
  4069. (watcher.user
  4070. ? "in watcher with expression \"".concat(watcher.expression, "\"")
  4071. : "in a component render function."), watcher.vm);
  4072. break;
  4073. }
  4074. }
  4075. }
  4076. // keep copies of post queues before resetting state
  4077. var activatedQueue = activatedChildren.slice();
  4078. var updatedQueue = queue.slice();
  4079. resetSchedulerState();
  4080. // call component updated and activated hooks
  4081. callActivatedHooks(activatedQueue);
  4082. callUpdatedHooks(updatedQueue);
  4083. cleanupDeps();
  4084. // devtool hook
  4085. /* istanbul ignore if */
  4086. if (devtools && config.devtools) {
  4087. devtools.emit('flush');
  4088. }
  4089. }
  4090. function callUpdatedHooks(queue) {
  4091. var i = queue.length;
  4092. while (i--) {
  4093. var watcher = queue[i];
  4094. var vm = watcher.vm;
  4095. if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  4096. callHook$1(vm, 'updated');
  4097. }
  4098. }
  4099. }
  4100. /**
  4101. * Queue a kept-alive component that was activated during patch.
  4102. * The queue will be processed after the entire tree has been patched.
  4103. */
  4104. function queueActivatedComponent(vm) {
  4105. // setting _inactive to false here so that a render function can
  4106. // rely on checking whether it's in an inactive tree (e.g. router-view)
  4107. vm._inactive = false;
  4108. activatedChildren.push(vm);
  4109. }
  4110. function callActivatedHooks(queue) {
  4111. for (var i = 0; i < queue.length; i++) {
  4112. queue[i]._inactive = true;
  4113. activateChildComponent(queue[i], true /* true */);
  4114. }
  4115. }
  4116. /**
  4117. * Push a watcher into the watcher queue.
  4118. * Jobs with duplicate IDs will be skipped unless it's
  4119. * pushed when the queue is being flushed.
  4120. */
  4121. function queueWatcher(watcher) {
  4122. var id = watcher.id;
  4123. if (has[id] != null) {
  4124. return;
  4125. }
  4126. if (watcher === Dep.target && watcher.noRecurse) {
  4127. return;
  4128. }
  4129. has[id] = true;
  4130. if (!flushing) {
  4131. queue.push(watcher);
  4132. }
  4133. else {
  4134. // if already flushing, splice the watcher based on its id
  4135. // if already past its id, it will be run next immediately.
  4136. var i = queue.length - 1;
  4137. while (i > index && queue[i].id > watcher.id) {
  4138. i--;
  4139. }
  4140. queue.splice(i + 1, 0, watcher);
  4141. }
  4142. // queue the flush
  4143. if (!waiting) {
  4144. waiting = true;
  4145. if (process.env.NODE_ENV !== 'production' && !config.async) {
  4146. flushSchedulerQueue();
  4147. return;
  4148. }
  4149. nextTick(flushSchedulerQueue);
  4150. }
  4151. }
  4152. function initProvide(vm) {
  4153. var provideOption = vm.$options.provide;
  4154. if (provideOption) {
  4155. var provided = isFunction(provideOption)
  4156. ? provideOption.call(vm)
  4157. : provideOption;
  4158. if (!isObject(provided)) {
  4159. return;
  4160. }
  4161. var source = resolveProvided(vm);
  4162. // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
  4163. // iterate the keys ourselves.
  4164. var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
  4165. for (var i = 0; i < keys.length; i++) {
  4166. var key = keys[i];
  4167. Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
  4168. }
  4169. }
  4170. }
  4171. function initInjections(vm) {
  4172. var result = resolveInject(vm.$options.inject, vm);
  4173. if (result) {
  4174. toggleObserving(false);
  4175. Object.keys(result).forEach(function (key) {
  4176. /* istanbul ignore else */
  4177. if (process.env.NODE_ENV !== 'production') {
  4178. defineReactive(vm, key, result[key], function () {
  4179. warn("Avoid mutating an injected value directly since the changes will be " +
  4180. "overwritten whenever the provided component re-renders. " +
  4181. "injection being mutated: \"".concat(key, "\""), vm);
  4182. });
  4183. }
  4184. else {
  4185. defineReactive(vm, key, result[key]);
  4186. }
  4187. });
  4188. toggleObserving(true);
  4189. }
  4190. }
  4191. function resolveInject(inject, vm) {
  4192. if (inject) {
  4193. // inject is :any because flow is not smart enough to figure out cached
  4194. var result = Object.create(null);
  4195. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  4196. for (var i = 0; i < keys.length; i++) {
  4197. var key = keys[i];
  4198. // #6574 in case the inject object is observed...
  4199. if (key === '__ob__')
  4200. continue;
  4201. var provideKey = inject[key].from;
  4202. if (provideKey in vm._provided) {
  4203. result[key] = vm._provided[provideKey];
  4204. }
  4205. else if ('default' in inject[key]) {
  4206. var provideDefault = inject[key].default;
  4207. result[key] = isFunction(provideDefault)
  4208. ? provideDefault.call(vm)
  4209. : provideDefault;
  4210. }
  4211. else if (process.env.NODE_ENV !== 'production') {
  4212. warn("Injection \"".concat(key, "\" not found"), vm);
  4213. }
  4214. }
  4215. return result;
  4216. }
  4217. }
  4218. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  4219. var _this = this;
  4220. var options = Ctor.options;
  4221. // ensure the createElement function in functional components
  4222. // gets a unique context - this is necessary for correct named slot check
  4223. var contextVm;
  4224. if (hasOwn(parent, '_uid')) {
  4225. contextVm = Object.create(parent);
  4226. contextVm._original = parent;
  4227. }
  4228. else {
  4229. // the context vm passed in is a functional context as well.
  4230. // in this case we want to make sure we are able to get a hold to the
  4231. // real context instance.
  4232. contextVm = parent;
  4233. // @ts-ignore
  4234. parent = parent._original;
  4235. }
  4236. var isCompiled = isTrue(options._compiled);
  4237. var needNormalization = !isCompiled;
  4238. this.data = data;
  4239. this.props = props;
  4240. this.children = children;
  4241. this.parent = parent;
  4242. this.listeners = data.on || emptyObject;
  4243. this.injections = resolveInject(options.inject, parent);
  4244. this.slots = function () {
  4245. if (!_this.$slots) {
  4246. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  4247. }
  4248. return _this.$slots;
  4249. };
  4250. Object.defineProperty(this, 'scopedSlots', {
  4251. enumerable: true,
  4252. get: function () {
  4253. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  4254. }
  4255. });
  4256. // support for compiled functional template
  4257. if (isCompiled) {
  4258. // exposing $options for renderStatic()
  4259. this.$options = options;
  4260. // pre-resolve slots for renderSlot()
  4261. this.$slots = this.slots();
  4262. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  4263. }
  4264. if (options._scopeId) {
  4265. this._c = function (a, b, c, d) {
  4266. var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
  4267. if (vnode && !isArray(vnode)) {
  4268. vnode.fnScopeId = options._scopeId;
  4269. vnode.fnContext = parent;
  4270. }
  4271. return vnode;
  4272. };
  4273. }
  4274. else {
  4275. this._c = function (a, b, c, d) {
  4276. return createElement$1(contextVm, a, b, c, d, needNormalization);
  4277. };
  4278. }
  4279. }
  4280. installRenderHelpers(FunctionalRenderContext.prototype);
  4281. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  4282. var options = Ctor.options;
  4283. var props = {};
  4284. var propOptions = options.props;
  4285. if (isDef(propOptions)) {
  4286. for (var key in propOptions) {
  4287. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4288. }
  4289. }
  4290. else {
  4291. if (isDef(data.attrs))
  4292. mergeProps(props, data.attrs);
  4293. if (isDef(data.props))
  4294. mergeProps(props, data.props);
  4295. }
  4296. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  4297. var vnode = options.render.call(null, renderContext._c, renderContext);
  4298. if (vnode instanceof VNode) {
  4299. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
  4300. }
  4301. else if (isArray(vnode)) {
  4302. var vnodes = normalizeChildren(vnode) || [];
  4303. var res = new Array(vnodes.length);
  4304. for (var i = 0; i < vnodes.length; i++) {
  4305. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4306. }
  4307. return res;
  4308. }
  4309. }
  4310. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  4311. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4312. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4313. // that should not be matched to match.
  4314. var clone = cloneVNode(vnode);
  4315. clone.fnContext = contextVm;
  4316. clone.fnOptions = options;
  4317. if (process.env.NODE_ENV !== 'production') {
  4318. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
  4319. renderContext;
  4320. }
  4321. if (data.slot) {
  4322. (clone.data || (clone.data = {})).slot = data.slot;
  4323. }
  4324. return clone;
  4325. }
  4326. function mergeProps(to, from) {
  4327. for (var key in from) {
  4328. to[camelize(key)] = from[key];
  4329. }
  4330. }
  4331. function getComponentName(options) {
  4332. return options.name || options.__name || options._componentTag;
  4333. }
  4334. // inline hooks to be invoked on component VNodes during patch
  4335. var componentVNodeHooks = {
  4336. init: function (vnode, hydrating) {
  4337. if (vnode.componentInstance &&
  4338. !vnode.componentInstance._isDestroyed &&
  4339. vnode.data.keepAlive) {
  4340. // kept-alive components, treat as a patch
  4341. var mountedNode = vnode; // work around flow
  4342. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4343. }
  4344. else {
  4345. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  4346. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4347. }
  4348. },
  4349. prepatch: function (oldVnode, vnode) {
  4350. var options = vnode.componentOptions;
  4351. var child = (vnode.componentInstance = oldVnode.componentInstance);
  4352. updateChildComponent(child, options.propsData, // updated props
  4353. options.listeners, // updated listeners
  4354. vnode, // new parent vnode
  4355. options.children // new children
  4356. );
  4357. },
  4358. insert: function (vnode) {
  4359. var context = vnode.context, componentInstance = vnode.componentInstance;
  4360. if (!componentInstance._isMounted) {
  4361. componentInstance._isMounted = true;
  4362. callHook$1(componentInstance, 'mounted');
  4363. }
  4364. if (vnode.data.keepAlive) {
  4365. if (context._isMounted) {
  4366. // vue-router#1212
  4367. // During updates, a kept-alive component's child components may
  4368. // change, so directly walking the tree here may call activated hooks
  4369. // on incorrect children. Instead we push them into a queue which will
  4370. // be processed after the whole patch process ended.
  4371. queueActivatedComponent(componentInstance);
  4372. }
  4373. else {
  4374. activateChildComponent(componentInstance, true /* direct */);
  4375. }
  4376. }
  4377. },
  4378. destroy: function (vnode) {
  4379. var componentInstance = vnode.componentInstance;
  4380. if (!componentInstance._isDestroyed) {
  4381. if (!vnode.data.keepAlive) {
  4382. componentInstance.$destroy();
  4383. }
  4384. else {
  4385. deactivateChildComponent(componentInstance, true /* direct */);
  4386. }
  4387. }
  4388. }
  4389. };
  4390. var hooksToMerge = Object.keys(componentVNodeHooks);
  4391. function createComponent(Ctor, data, context, children, tag) {
  4392. if (isUndef(Ctor)) {
  4393. return;
  4394. }
  4395. var baseCtor = context.$options._base;
  4396. // plain options object: turn it into a constructor
  4397. if (isObject(Ctor)) {
  4398. Ctor = baseCtor.extend(Ctor);
  4399. }
  4400. // if at this stage it's not a constructor or an async component factory,
  4401. // reject.
  4402. if (typeof Ctor !== 'function') {
  4403. if (process.env.NODE_ENV !== 'production') {
  4404. warn("Invalid Component definition: ".concat(String(Ctor)), context);
  4405. }
  4406. return;
  4407. }
  4408. // async component
  4409. var asyncFactory;
  4410. // @ts-expect-error
  4411. if (isUndef(Ctor.cid)) {
  4412. asyncFactory = Ctor;
  4413. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4414. if (Ctor === undefined) {
  4415. // return a placeholder node for async component, which is rendered
  4416. // as a comment node but preserves all the raw information for the node.
  4417. // the information will be used for async server-rendering and hydration.
  4418. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  4419. }
  4420. }
  4421. data = data || {};
  4422. // resolve constructor options in case global mixins are applied after
  4423. // component constructor creation
  4424. resolveConstructorOptions(Ctor);
  4425. // transform component v-model data into props & events
  4426. if (isDef(data.model)) {
  4427. // @ts-expect-error
  4428. transformModel(Ctor.options, data);
  4429. }
  4430. // extract props
  4431. // @ts-expect-error
  4432. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  4433. // functional component
  4434. // @ts-expect-error
  4435. if (isTrue(Ctor.options.functional)) {
  4436. return createFunctionalComponent(Ctor, propsData, data, context, children);
  4437. }
  4438. // extract listeners, since these needs to be treated as
  4439. // child component listeners instead of DOM listeners
  4440. var listeners = data.on;
  4441. // replace with listeners with .native modifier
  4442. // so it gets processed during parent component patch.
  4443. data.on = data.nativeOn;
  4444. // @ts-expect-error
  4445. if (isTrue(Ctor.options.abstract)) {
  4446. // abstract components do not keep anything
  4447. // other than props & listeners & slot
  4448. // work around flow
  4449. var slot = data.slot;
  4450. data = {};
  4451. if (slot) {
  4452. data.slot = slot;
  4453. }
  4454. }
  4455. // install component management hooks onto the placeholder node
  4456. installComponentHooks(data);
  4457. // return a placeholder vnode
  4458. // @ts-expect-error
  4459. var name = getComponentName(Ctor.options) || tag;
  4460. var vnode = new VNode(
  4461. // @ts-expect-error
  4462. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  4463. // @ts-expect-error
  4464. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  4465. return vnode;
  4466. }
  4467. function createComponentInstanceForVnode(
  4468. // we know it's MountedComponentVNode but flow doesn't
  4469. vnode,
  4470. // activeInstance in lifecycle state
  4471. parent) {
  4472. var options = {
  4473. _isComponent: true,
  4474. _parentVnode: vnode,
  4475. parent: parent
  4476. };
  4477. // check inline-template render functions
  4478. var inlineTemplate = vnode.data.inlineTemplate;
  4479. if (isDef(inlineTemplate)) {
  4480. options.render = inlineTemplate.render;
  4481. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4482. }
  4483. return new vnode.componentOptions.Ctor(options);
  4484. }
  4485. function installComponentHooks(data) {
  4486. var hooks = data.hook || (data.hook = {});
  4487. for (var i = 0; i < hooksToMerge.length; i++) {
  4488. var key = hooksToMerge[i];
  4489. var existing = hooks[key];
  4490. var toMerge = componentVNodeHooks[key];
  4491. // @ts-expect-error
  4492. if (existing !== toMerge && !(existing && existing._merged)) {
  4493. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  4494. }
  4495. }
  4496. }
  4497. function mergeHook(f1, f2) {
  4498. var merged = function (a, b) {
  4499. // flow complains about extra args which is why we use any
  4500. f1(a, b);
  4501. f2(a, b);
  4502. };
  4503. merged._merged = true;
  4504. return merged;
  4505. }
  4506. // transform component v-model info (value and callback) into
  4507. // prop and event handler respectively.
  4508. function transformModel(options, data) {
  4509. var prop = (options.model && options.model.prop) || 'value';
  4510. var event = (options.model && options.model.event) || 'input';
  4511. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4512. var on = data.on || (data.on = {});
  4513. var existing = on[event];
  4514. var callback = data.model.callback;
  4515. if (isDef(existing)) {
  4516. if (isArray(existing)
  4517. ? existing.indexOf(callback) === -1
  4518. : existing !== callback) {
  4519. on[event] = [callback].concat(existing);
  4520. }
  4521. }
  4522. else {
  4523. on[event] = callback;
  4524. }
  4525. }
  4526. var warn = noop;
  4527. var tip = noop;
  4528. var generateComponentTrace; // work around flow check
  4529. var formatComponentName;
  4530. if (process.env.NODE_ENV !== 'production') {
  4531. var hasConsole_1 = typeof console !== 'undefined';
  4532. var classifyRE_1 = /(?:^|[-_])(\w)/g;
  4533. var classify_1 = function (str) {
  4534. return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
  4535. };
  4536. warn = function (msg, vm) {
  4537. if (vm === void 0) { vm = currentInstance; }
  4538. var trace = vm ? generateComponentTrace(vm) : '';
  4539. if (config.warnHandler) {
  4540. config.warnHandler.call(null, msg, vm, trace);
  4541. }
  4542. else if (hasConsole_1 && !config.silent) {
  4543. console.error("[Vue warn]: ".concat(msg).concat(trace));
  4544. }
  4545. };
  4546. tip = function (msg, vm) {
  4547. if (hasConsole_1 && !config.silent) {
  4548. console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
  4549. }
  4550. };
  4551. formatComponentName = function (vm, includeFile) {
  4552. if (vm.$root === vm) {
  4553. return '<Root>';
  4554. }
  4555. var options = isFunction(vm) && vm.cid != null
  4556. ? vm.options
  4557. : vm._isVue
  4558. ? vm.$options || vm.constructor.options
  4559. : vm;
  4560. var name = getComponentName(options);
  4561. var file = options.__file;
  4562. if (!name && file) {
  4563. var match = file.match(/([^/\\]+)\.vue$/);
  4564. name = match && match[1];
  4565. }
  4566. return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
  4567. (file && includeFile !== false ? " at ".concat(file) : ''));
  4568. };
  4569. var repeat_1 = function (str, n) {
  4570. var res = '';
  4571. while (n) {
  4572. if (n % 2 === 1)
  4573. res += str;
  4574. if (n > 1)
  4575. str += str;
  4576. n >>= 1;
  4577. }
  4578. return res;
  4579. };
  4580. generateComponentTrace = function (vm) {
  4581. if (vm._isVue && vm.$parent) {
  4582. var tree = [];
  4583. var currentRecursiveSequence = 0;
  4584. while (vm) {
  4585. if (tree.length > 0) {
  4586. var last = tree[tree.length - 1];
  4587. if (last.constructor === vm.constructor) {
  4588. currentRecursiveSequence++;
  4589. vm = vm.$parent;
  4590. continue;
  4591. }
  4592. else if (currentRecursiveSequence > 0) {
  4593. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4594. currentRecursiveSequence = 0;
  4595. }
  4596. }
  4597. tree.push(vm);
  4598. vm = vm.$parent;
  4599. }
  4600. return ('\n\nfound in\n\n' +
  4601. tree
  4602. .map(function (vm, i) {
  4603. return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
  4604. ? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
  4605. : formatComponentName(vm));
  4606. })
  4607. .join('\n'));
  4608. }
  4609. else {
  4610. return "\n\n(found in ".concat(formatComponentName(vm), ")");
  4611. }
  4612. };
  4613. }
  4614. /**
  4615. * Option overwriting strategies are functions that handle
  4616. * how to merge a parent option value and a child option
  4617. * value into the final value.
  4618. */
  4619. var strats = config.optionMergeStrategies;
  4620. /**
  4621. * Options with restrictions
  4622. */
  4623. if (process.env.NODE_ENV !== 'production') {
  4624. strats.el = strats.propsData = function (parent, child, vm, key) {
  4625. if (!vm) {
  4626. warn("option \"".concat(key, "\" can only be used during instance ") +
  4627. 'creation with the `new` keyword.');
  4628. }
  4629. return defaultStrat(parent, child);
  4630. };
  4631. }
  4632. /**
  4633. * Helper that recursively merges two data objects together.
  4634. */
  4635. function mergeData(to, from) {
  4636. if (!from)
  4637. return to;
  4638. var key, toVal, fromVal;
  4639. var keys = hasSymbol
  4640. ? Reflect.ownKeys(from)
  4641. : Object.keys(from);
  4642. for (var i = 0; i < keys.length; i++) {
  4643. key = keys[i];
  4644. // in case the object is already observed...
  4645. if (key === '__ob__')
  4646. continue;
  4647. toVal = to[key];
  4648. fromVal = from[key];
  4649. if (!hasOwn(to, key)) {
  4650. set(to, key, fromVal);
  4651. }
  4652. else if (toVal !== fromVal &&
  4653. isPlainObject(toVal) &&
  4654. isPlainObject(fromVal)) {
  4655. mergeData(toVal, fromVal);
  4656. }
  4657. }
  4658. return to;
  4659. }
  4660. /**
  4661. * Data
  4662. */
  4663. function mergeDataOrFn(parentVal, childVal, vm) {
  4664. if (!vm) {
  4665. // in a Vue.extend merge, both should be functions
  4666. if (!childVal) {
  4667. return parentVal;
  4668. }
  4669. if (!parentVal) {
  4670. return childVal;
  4671. }
  4672. // when parentVal & childVal are both present,
  4673. // we need to return a function that returns the
  4674. // merged result of both functions... no need to
  4675. // check if parentVal is a function here because
  4676. // it has to be a function to pass previous merges.
  4677. return function mergedDataFn() {
  4678. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  4679. };
  4680. }
  4681. else {
  4682. return function mergedInstanceDataFn() {
  4683. // instance merge
  4684. var instanceData = isFunction(childVal)
  4685. ? childVal.call(vm, vm)
  4686. : childVal;
  4687. var defaultData = isFunction(parentVal)
  4688. ? parentVal.call(vm, vm)
  4689. : parentVal;
  4690. if (instanceData) {
  4691. return mergeData(instanceData, defaultData);
  4692. }
  4693. else {
  4694. return defaultData;
  4695. }
  4696. };
  4697. }
  4698. }
  4699. strats.data = function (parentVal, childVal, vm) {
  4700. if (!vm) {
  4701. if (childVal && typeof childVal !== 'function') {
  4702. process.env.NODE_ENV !== 'production' &&
  4703. warn('The "data" option should be a function ' +
  4704. 'that returns a per-instance value in component ' +
  4705. 'definitions.', vm);
  4706. return parentVal;
  4707. }
  4708. return mergeDataOrFn(parentVal, childVal);
  4709. }
  4710. return mergeDataOrFn(parentVal, childVal, vm);
  4711. };
  4712. /**
  4713. * Hooks and props are merged as arrays.
  4714. */
  4715. function mergeLifecycleHook(parentVal, childVal) {
  4716. var res = childVal
  4717. ? parentVal
  4718. ? parentVal.concat(childVal)
  4719. : isArray(childVal)
  4720. ? childVal
  4721. : [childVal]
  4722. : parentVal;
  4723. return res ? dedupeHooks(res) : res;
  4724. }
  4725. function dedupeHooks(hooks) {
  4726. var res = [];
  4727. for (var i = 0; i < hooks.length; i++) {
  4728. if (res.indexOf(hooks[i]) === -1) {
  4729. res.push(hooks[i]);
  4730. }
  4731. }
  4732. return res;
  4733. }
  4734. LIFECYCLE_HOOKS.forEach(function (hook) {
  4735. strats[hook] = mergeLifecycleHook;
  4736. });
  4737. /**
  4738. * Assets
  4739. *
  4740. * When a vm is present (instance creation), we need to do
  4741. * a three-way merge between constructor options, instance
  4742. * options and parent options.
  4743. */
  4744. function mergeAssets(parentVal, childVal, vm, key) {
  4745. var res = Object.create(parentVal || null);
  4746. if (childVal) {
  4747. process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
  4748. return extend(res, childVal);
  4749. }
  4750. else {
  4751. return res;
  4752. }
  4753. }
  4754. ASSET_TYPES.forEach(function (type) {
  4755. strats[type + 's'] = mergeAssets;
  4756. });
  4757. /**
  4758. * Watchers.
  4759. *
  4760. * Watchers hashes should not overwrite one
  4761. * another, so we merge them as arrays.
  4762. */
  4763. strats.watch = function (parentVal, childVal, vm, key) {
  4764. // work around Firefox's Object.prototype.watch...
  4765. //@ts-expect-error work around
  4766. if (parentVal === nativeWatch)
  4767. parentVal = undefined;
  4768. //@ts-expect-error work around
  4769. if (childVal === nativeWatch)
  4770. childVal = undefined;
  4771. /* istanbul ignore if */
  4772. if (!childVal)
  4773. return Object.create(parentVal || null);
  4774. if (process.env.NODE_ENV !== 'production') {
  4775. assertObjectType(key, childVal, vm);
  4776. }
  4777. if (!parentVal)
  4778. return childVal;
  4779. var ret = {};
  4780. extend(ret, parentVal);
  4781. for (var key_1 in childVal) {
  4782. var parent_1 = ret[key_1];
  4783. var child = childVal[key_1];
  4784. if (parent_1 && !isArray(parent_1)) {
  4785. parent_1 = [parent_1];
  4786. }
  4787. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  4788. }
  4789. return ret;
  4790. };
  4791. /**
  4792. * Other object hashes.
  4793. */
  4794. strats.props =
  4795. strats.methods =
  4796. strats.inject =
  4797. strats.computed =
  4798. function (parentVal, childVal, vm, key) {
  4799. if (childVal && process.env.NODE_ENV !== 'production') {
  4800. assertObjectType(key, childVal, vm);
  4801. }
  4802. if (!parentVal)
  4803. return childVal;
  4804. var ret = Object.create(null);
  4805. extend(ret, parentVal);
  4806. if (childVal)
  4807. extend(ret, childVal);
  4808. return ret;
  4809. };
  4810. strats.provide = mergeDataOrFn;
  4811. /**
  4812. * Default strategy.
  4813. */
  4814. var defaultStrat = function (parentVal, childVal) {
  4815. return childVal === undefined ? parentVal : childVal;
  4816. };
  4817. /**
  4818. * Validate component names
  4819. */
  4820. function checkComponents(options) {
  4821. for (var key in options.components) {
  4822. validateComponentName(key);
  4823. }
  4824. }
  4825. function validateComponentName(name) {
  4826. if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
  4827. warn('Invalid component name: "' +
  4828. name +
  4829. '". Component names ' +
  4830. 'should conform to valid custom element name in html5 specification.');
  4831. }
  4832. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4833. warn('Do not use built-in or reserved HTML elements as component ' +
  4834. 'id: ' +
  4835. name);
  4836. }
  4837. }
  4838. /**
  4839. * Ensure all props option syntax are normalized into the
  4840. * Object-based format.
  4841. */
  4842. function normalizeProps(options, vm) {
  4843. var props = options.props;
  4844. if (!props)
  4845. return;
  4846. var res = {};
  4847. var i, val, name;
  4848. if (isArray(props)) {
  4849. i = props.length;
  4850. while (i--) {
  4851. val = props[i];
  4852. if (typeof val === 'string') {
  4853. name = camelize(val);
  4854. res[name] = { type: null };
  4855. }
  4856. else if (process.env.NODE_ENV !== 'production') {
  4857. warn('props must be strings when using array syntax.');
  4858. }
  4859. }
  4860. }
  4861. else if (isPlainObject(props)) {
  4862. for (var key in props) {
  4863. val = props[key];
  4864. name = camelize(key);
  4865. res[name] = isPlainObject(val) ? val : { type: val };
  4866. }
  4867. }
  4868. else if (process.env.NODE_ENV !== 'production') {
  4869. warn("Invalid value for option \"props\": expected an Array or an Object, " +
  4870. "but got ".concat(toRawType(props), "."), vm);
  4871. }
  4872. options.props = res;
  4873. }
  4874. /**
  4875. * Normalize all injections into Object-based format
  4876. */
  4877. function normalizeInject(options, vm) {
  4878. var inject = options.inject;
  4879. if (!inject)
  4880. return;
  4881. var normalized = (options.inject = {});
  4882. if (isArray(inject)) {
  4883. for (var i = 0; i < inject.length; i++) {
  4884. normalized[inject[i]] = { from: inject[i] };
  4885. }
  4886. }
  4887. else if (isPlainObject(inject)) {
  4888. for (var key in inject) {
  4889. var val = inject[key];
  4890. normalized[key] = isPlainObject(val)
  4891. ? extend({ from: key }, val)
  4892. : { from: val };
  4893. }
  4894. }
  4895. else if (process.env.NODE_ENV !== 'production') {
  4896. warn("Invalid value for option \"inject\": expected an Array or an Object, " +
  4897. "but got ".concat(toRawType(inject), "."), vm);
  4898. }
  4899. }
  4900. /**
  4901. * Normalize raw function directives into object format.
  4902. */
  4903. function normalizeDirectives$1(options) {
  4904. var dirs = options.directives;
  4905. if (dirs) {
  4906. for (var key in dirs) {
  4907. var def = dirs[key];
  4908. if (isFunction(def)) {
  4909. dirs[key] = { bind: def, update: def };
  4910. }
  4911. }
  4912. }
  4913. }
  4914. function assertObjectType(name, value, vm) {
  4915. if (!isPlainObject(value)) {
  4916. warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  4917. "but got ".concat(toRawType(value), "."), vm);
  4918. }
  4919. }
  4920. /**
  4921. * Merge two option objects into a new one.
  4922. * Core utility used in both instantiation and inheritance.
  4923. */
  4924. function mergeOptions(parent, child, vm) {
  4925. if (process.env.NODE_ENV !== 'production') {
  4926. checkComponents(child);
  4927. }
  4928. if (isFunction(child)) {
  4929. // @ts-expect-error
  4930. child = child.options;
  4931. }
  4932. normalizeProps(child, vm);
  4933. normalizeInject(child, vm);
  4934. normalizeDirectives$1(child);
  4935. // Apply extends and mixins on the child options,
  4936. // but only if it is a raw options object that isn't
  4937. // the result of another mergeOptions call.
  4938. // Only merged options has the _base property.
  4939. if (!child._base) {
  4940. if (child.extends) {
  4941. parent = mergeOptions(parent, child.extends, vm);
  4942. }
  4943. if (child.mixins) {
  4944. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4945. parent = mergeOptions(parent, child.mixins[i], vm);
  4946. }
  4947. }
  4948. }
  4949. var options = {};
  4950. var key;
  4951. for (key in parent) {
  4952. mergeField(key);
  4953. }
  4954. for (key in child) {
  4955. if (!hasOwn(parent, key)) {
  4956. mergeField(key);
  4957. }
  4958. }
  4959. function mergeField(key) {
  4960. var strat = strats[key] || defaultStrat;
  4961. options[key] = strat(parent[key], child[key], vm, key);
  4962. }
  4963. return options;
  4964. }
  4965. /**
  4966. * Resolve an asset.
  4967. * This function is used because child instances need access
  4968. * to assets defined in its ancestor chain.
  4969. */
  4970. function resolveAsset(options, type, id, warnMissing) {
  4971. /* istanbul ignore if */
  4972. if (typeof id !== 'string') {
  4973. return;
  4974. }
  4975. var assets = options[type];
  4976. // check local registration variations first
  4977. if (hasOwn(assets, id))
  4978. return assets[id];
  4979. var camelizedId = camelize(id);
  4980. if (hasOwn(assets, camelizedId))
  4981. return assets[camelizedId];
  4982. var PascalCaseId = capitalize(camelizedId);
  4983. if (hasOwn(assets, PascalCaseId))
  4984. return assets[PascalCaseId];
  4985. // fallback to prototype chain
  4986. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4987. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  4988. warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
  4989. }
  4990. return res;
  4991. }
  4992. function validateProp(key, propOptions, propsData, vm) {
  4993. var prop = propOptions[key];
  4994. var absent = !hasOwn(propsData, key);
  4995. var value = propsData[key];
  4996. // boolean casting
  4997. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4998. if (booleanIndex > -1) {
  4999. if (absent && !hasOwn(prop, 'default')) {
  5000. value = false;
  5001. }
  5002. else if (value === '' || value === hyphenate(key)) {
  5003. // only cast empty string / same name to boolean if
  5004. // boolean has higher priority
  5005. var stringIndex = getTypeIndex(String, prop.type);
  5006. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5007. value = true;
  5008. }
  5009. }
  5010. }
  5011. // check default value
  5012. if (value === undefined) {
  5013. value = getPropDefaultValue(vm, prop, key);
  5014. // since the default value is a fresh copy,
  5015. // make sure to observe it.
  5016. var prevShouldObserve = shouldObserve;
  5017. toggleObserving(true);
  5018. observe(value);
  5019. toggleObserving(prevShouldObserve);
  5020. }
  5021. if (process.env.NODE_ENV !== 'production') {
  5022. assertProp(prop, key, value, vm, absent);
  5023. }
  5024. return value;
  5025. }
  5026. /**
  5027. * Get the default value of a prop.
  5028. */
  5029. function getPropDefaultValue(vm, prop, key) {
  5030. // no default, return undefined
  5031. if (!hasOwn(prop, 'default')) {
  5032. return undefined;
  5033. }
  5034. var def = prop.default;
  5035. // warn against non-factory defaults for Object & Array
  5036. if (process.env.NODE_ENV !== 'production' && isObject(def)) {
  5037. warn('Invalid default value for prop "' +
  5038. key +
  5039. '": ' +
  5040. 'Props with type Object/Array must use a factory function ' +
  5041. 'to return the default value.', vm);
  5042. }
  5043. // the raw prop value was also undefined from previous render,
  5044. // return previous default value to avoid unnecessary watcher trigger
  5045. if (vm &&
  5046. vm.$options.propsData &&
  5047. vm.$options.propsData[key] === undefined &&
  5048. vm._props[key] !== undefined) {
  5049. return vm._props[key];
  5050. }
  5051. // call factory function for non-Function types
  5052. // a value is Function if its prototype is function even across different execution context
  5053. return isFunction(def) && getType(prop.type) !== 'Function'
  5054. ? def.call(vm)
  5055. : def;
  5056. }
  5057. /**
  5058. * Assert whether a prop is valid.
  5059. */
  5060. function assertProp(prop, name, value, vm, absent) {
  5061. if (prop.required && absent) {
  5062. warn('Missing required prop: "' + name + '"', vm);
  5063. return;
  5064. }
  5065. if (value == null && !prop.required) {
  5066. return;
  5067. }
  5068. var type = prop.type;
  5069. var valid = !type || type === true;
  5070. var expectedTypes = [];
  5071. if (type) {
  5072. if (!isArray(type)) {
  5073. type = [type];
  5074. }
  5075. for (var i = 0; i < type.length && !valid; i++) {
  5076. var assertedType = assertType(value, type[i], vm);
  5077. expectedTypes.push(assertedType.expectedType || '');
  5078. valid = assertedType.valid;
  5079. }
  5080. }
  5081. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  5082. if (!valid && haveExpectedTypes) {
  5083. warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
  5084. return;
  5085. }
  5086. var validator = prop.validator;
  5087. if (validator) {
  5088. if (!validator(value)) {
  5089. warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
  5090. }
  5091. }
  5092. }
  5093. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  5094. function assertType(value, type, vm) {
  5095. var valid;
  5096. var expectedType = getType(type);
  5097. if (simpleCheckRE.test(expectedType)) {
  5098. var t = typeof value;
  5099. valid = t === expectedType.toLowerCase();
  5100. // for primitive wrapper objects
  5101. if (!valid && t === 'object') {
  5102. valid = value instanceof type;
  5103. }
  5104. }
  5105. else if (expectedType === 'Object') {
  5106. valid = isPlainObject(value);
  5107. }
  5108. else if (expectedType === 'Array') {
  5109. valid = isArray(value);
  5110. }
  5111. else {
  5112. try {
  5113. valid = value instanceof type;
  5114. }
  5115. catch (e) {
  5116. warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  5117. valid = false;
  5118. }
  5119. }
  5120. return {
  5121. valid: valid,
  5122. expectedType: expectedType
  5123. };
  5124. }
  5125. var functionTypeCheckRE = /^\s*function (\w+)/;
  5126. /**
  5127. * Use function string name to check built-in types,
  5128. * because a simple equality check will fail when running
  5129. * across different vms / iframes.
  5130. */
  5131. function getType(fn) {
  5132. var match = fn && fn.toString().match(functionTypeCheckRE);
  5133. return match ? match[1] : '';
  5134. }
  5135. function isSameType(a, b) {
  5136. return getType(a) === getType(b);
  5137. }
  5138. function getTypeIndex(type, expectedTypes) {
  5139. if (!isArray(expectedTypes)) {
  5140. return isSameType(expectedTypes, type) ? 0 : -1;
  5141. }
  5142. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5143. if (isSameType(expectedTypes[i], type)) {
  5144. return i;
  5145. }
  5146. }
  5147. return -1;
  5148. }
  5149. function getInvalidTypeMessage(name, value, expectedTypes) {
  5150. var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
  5151. " Expected ".concat(expectedTypes.map(capitalize).join(', '));
  5152. var expectedType = expectedTypes[0];
  5153. var receivedType = toRawType(value);
  5154. // check if we need to specify expected value
  5155. if (expectedTypes.length === 1 &&
  5156. isExplicable(expectedType) &&
  5157. isExplicable(typeof value) &&
  5158. !isBoolean(expectedType, receivedType)) {
  5159. message += " with value ".concat(styleValue(value, expectedType));
  5160. }
  5161. message += ", got ".concat(receivedType, " ");
  5162. // check if we need to specify received value
  5163. if (isExplicable(receivedType)) {
  5164. message += "with value ".concat(styleValue(value, receivedType), ".");
  5165. }
  5166. return message;
  5167. }
  5168. function styleValue(value, type) {
  5169. if (type === 'String') {
  5170. return "\"".concat(value, "\"");
  5171. }
  5172. else if (type === 'Number') {
  5173. return "".concat(Number(value));
  5174. }
  5175. else {
  5176. return "".concat(value);
  5177. }
  5178. }
  5179. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  5180. function isExplicable(value) {
  5181. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
  5182. }
  5183. function isBoolean() {
  5184. var args = [];
  5185. for (var _i = 0; _i < arguments.length; _i++) {
  5186. args[_i] = arguments[_i];
  5187. }
  5188. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
  5189. }
  5190. /* not type checking this file because flow doesn't play well with Proxy */
  5191. var initProxy;
  5192. if (process.env.NODE_ENV !== 'production') {
  5193. var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
  5194. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5195. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  5196. 'require' // for Webpack/Browserify
  5197. );
  5198. var warnNonPresent_1 = function (target, key) {
  5199. warn("Property or method \"".concat(key, "\" is not defined on the instance but ") +
  5200. 'referenced during render. Make sure that this property is reactive, ' +
  5201. 'either in the data option, or for class-based components, by ' +
  5202. 'initializing the property. ' +
  5203. 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
  5204. };
  5205. var warnReservedPrefix_1 = function (target, key) {
  5206. warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
  5207. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5208. 'prevent conflicts with Vue internals. ' +
  5209. 'See: https://v2.vuejs.org/v2/api/#data', target);
  5210. };
  5211. var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
  5212. if (hasProxy_1) {
  5213. var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5214. config.keyCodes = new Proxy(config.keyCodes, {
  5215. set: function (target, key, value) {
  5216. if (isBuiltInModifier_1(key)) {
  5217. warn("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
  5218. return false;
  5219. }
  5220. else {
  5221. target[key] = value;
  5222. return true;
  5223. }
  5224. }
  5225. });
  5226. }
  5227. var hasHandler_1 = {
  5228. has: function (target, key) {
  5229. var has = key in target;
  5230. var isAllowed = allowedGlobals_1(key) ||
  5231. (typeof key === 'string' &&
  5232. key.charAt(0) === '_' &&
  5233. !(key in target.$data));
  5234. if (!has && !isAllowed) {
  5235. if (key in target.$data)
  5236. warnReservedPrefix_1(target, key);
  5237. else
  5238. warnNonPresent_1(target, key);
  5239. }
  5240. return has || !isAllowed;
  5241. }
  5242. };
  5243. var getHandler_1 = {
  5244. get: function (target, key) {
  5245. if (typeof key === 'string' && !(key in target)) {
  5246. if (key in target.$data)
  5247. warnReservedPrefix_1(target, key);
  5248. else
  5249. warnNonPresent_1(target, key);
  5250. }
  5251. return target[key];
  5252. }
  5253. };
  5254. initProxy = function initProxy(vm) {
  5255. if (hasProxy_1) {
  5256. // determine which proxy handler to use
  5257. var options = vm.$options;
  5258. var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;
  5259. vm._renderProxy = new Proxy(vm, handlers);
  5260. }
  5261. else {
  5262. vm._renderProxy = vm;
  5263. }
  5264. };
  5265. }
  5266. var sharedPropertyDefinition = {
  5267. enumerable: true,
  5268. configurable: true,
  5269. get: noop,
  5270. set: noop
  5271. };
  5272. function proxy(target, sourceKey, key) {
  5273. sharedPropertyDefinition.get = function proxyGetter() {
  5274. return this[sourceKey][key];
  5275. };
  5276. sharedPropertyDefinition.set = function proxySetter(val) {
  5277. this[sourceKey][key] = val;
  5278. };
  5279. Object.defineProperty(target, key, sharedPropertyDefinition);
  5280. }
  5281. function initState(vm) {
  5282. var opts = vm.$options;
  5283. if (opts.props)
  5284. initProps$1(vm, opts.props);
  5285. // Composition API
  5286. initSetup(vm);
  5287. if (opts.methods)
  5288. initMethods(vm, opts.methods);
  5289. if (opts.data) {
  5290. initData(vm);
  5291. }
  5292. else {
  5293. var ob = observe((vm._data = {}));
  5294. ob && ob.vmCount++;
  5295. }
  5296. if (opts.computed)
  5297. initComputed$1(vm, opts.computed);
  5298. if (opts.watch && opts.watch !== nativeWatch) {
  5299. initWatch(vm, opts.watch);
  5300. }
  5301. }
  5302. function initProps$1(vm, propsOptions) {
  5303. var propsData = vm.$options.propsData || {};
  5304. var props = (vm._props = shallowReactive({}));
  5305. // cache prop keys so that future props updates can iterate using Array
  5306. // instead of dynamic object key enumeration.
  5307. var keys = (vm.$options._propKeys = []);
  5308. var isRoot = !vm.$parent;
  5309. // root instance props should be converted
  5310. if (!isRoot) {
  5311. toggleObserving(false);
  5312. }
  5313. var _loop_1 = function (key) {
  5314. keys.push(key);
  5315. var value = validateProp(key, propsOptions, propsData, vm);
  5316. /* istanbul ignore else */
  5317. if (process.env.NODE_ENV !== 'production') {
  5318. var hyphenatedKey = hyphenate(key);
  5319. if (isReservedAttribute(hyphenatedKey) ||
  5320. config.isReservedAttr(hyphenatedKey)) {
  5321. warn("\"".concat(hyphenatedKey, "\" is a reserved attribute and cannot be used as component prop."), vm);
  5322. }
  5323. defineReactive(props, key, value, function () {
  5324. if (!isRoot && !isUpdatingChildComponent) {
  5325. warn("Avoid mutating a prop directly since the value will be " +
  5326. "overwritten whenever the parent component re-renders. " +
  5327. "Instead, use a data or computed property based on the prop's " +
  5328. "value. Prop being mutated: \"".concat(key, "\""), vm);
  5329. }
  5330. });
  5331. }
  5332. else {
  5333. defineReactive(props, key, value);
  5334. }
  5335. // static props are already proxied on the component's prototype
  5336. // during Vue.extend(). We only need to proxy props defined at
  5337. // instantiation here.
  5338. if (!(key in vm)) {
  5339. proxy(vm, "_props", key);
  5340. }
  5341. };
  5342. for (var key in propsOptions) {
  5343. _loop_1(key);
  5344. }
  5345. toggleObserving(true);
  5346. }
  5347. function initData(vm) {
  5348. var data = vm.$options.data;
  5349. data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
  5350. if (!isPlainObject(data)) {
  5351. data = {};
  5352. process.env.NODE_ENV !== 'production' &&
  5353. warn('data functions should return an object:\n' +
  5354. 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
  5355. }
  5356. // proxy data on instance
  5357. var keys = Object.keys(data);
  5358. var props = vm.$options.props;
  5359. var methods = vm.$options.methods;
  5360. var i = keys.length;
  5361. while (i--) {
  5362. var key = keys[i];
  5363. if (process.env.NODE_ENV !== 'production') {
  5364. if (methods && hasOwn(methods, key)) {
  5365. warn("Method \"".concat(key, "\" has already been defined as a data property."), vm);
  5366. }
  5367. }
  5368. if (props && hasOwn(props, key)) {
  5369. process.env.NODE_ENV !== 'production' &&
  5370. warn("The data property \"".concat(key, "\" is already declared as a prop. ") +
  5371. "Use prop default value instead.", vm);
  5372. }
  5373. else if (!isReserved(key)) {
  5374. proxy(vm, "_data", key);
  5375. }
  5376. }
  5377. // observe data
  5378. var ob = observe(data);
  5379. ob && ob.vmCount++;
  5380. }
  5381. function getData(data, vm) {
  5382. // #7573 disable dep collection when invoking data getters
  5383. pushTarget();
  5384. try {
  5385. return data.call(vm, vm);
  5386. }
  5387. catch (e) {
  5388. handleError(e, vm, "data()");
  5389. return {};
  5390. }
  5391. finally {
  5392. popTarget();
  5393. }
  5394. }
  5395. var computedWatcherOptions = { lazy: true };
  5396. function initComputed$1(vm, computed) {
  5397. // $flow-disable-line
  5398. var watchers = (vm._computedWatchers = Object.create(null));
  5399. // computed properties are just getters during SSR
  5400. var isSSR = isServerRendering();
  5401. for (var key in computed) {
  5402. var userDef = computed[key];
  5403. var getter = isFunction(userDef) ? userDef : userDef.get;
  5404. if (process.env.NODE_ENV !== 'production' && getter == null) {
  5405. warn("Getter is missing for computed property \"".concat(key, "\"."), vm);
  5406. }
  5407. if (!isSSR) {
  5408. // create internal watcher for the computed property.
  5409. watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
  5410. }
  5411. // component-defined computed properties are already defined on the
  5412. // component prototype. We only need to define computed properties defined
  5413. // at instantiation here.
  5414. if (!(key in vm)) {
  5415. defineComputed(vm, key, userDef);
  5416. }
  5417. else if (process.env.NODE_ENV !== 'production') {
  5418. if (key in vm.$data) {
  5419. warn("The computed property \"".concat(key, "\" is already defined in data."), vm);
  5420. }
  5421. else if (vm.$options.props && key in vm.$options.props) {
  5422. warn("The computed property \"".concat(key, "\" is already defined as a prop."), vm);
  5423. }
  5424. else if (vm.$options.methods && key in vm.$options.methods) {
  5425. warn("The computed property \"".concat(key, "\" is already defined as a method."), vm);
  5426. }
  5427. }
  5428. }
  5429. }
  5430. function defineComputed(target, key, userDef) {
  5431. var shouldCache = !isServerRendering();
  5432. if (isFunction(userDef)) {
  5433. sharedPropertyDefinition.get = shouldCache
  5434. ? createComputedGetter(key)
  5435. : createGetterInvoker(userDef);
  5436. sharedPropertyDefinition.set = noop;
  5437. }
  5438. else {
  5439. sharedPropertyDefinition.get = userDef.get
  5440. ? shouldCache && userDef.cache !== false
  5441. ? createComputedGetter(key)
  5442. : createGetterInvoker(userDef.get)
  5443. : noop;
  5444. sharedPropertyDefinition.set = userDef.set || noop;
  5445. }
  5446. if (process.env.NODE_ENV !== 'production' && sharedPropertyDefinition.set === noop) {
  5447. sharedPropertyDefinition.set = function () {
  5448. warn("Computed property \"".concat(key, "\" was assigned to but it has no setter."), this);
  5449. };
  5450. }
  5451. Object.defineProperty(target, key, sharedPropertyDefinition);
  5452. }
  5453. function createComputedGetter(key) {
  5454. return function computedGetter() {
  5455. var watcher = this._computedWatchers && this._computedWatchers[key];
  5456. if (watcher) {
  5457. if (watcher.dirty) {
  5458. watcher.evaluate();
  5459. }
  5460. if (Dep.target) {
  5461. if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
  5462. Dep.target.onTrack({
  5463. effect: Dep.target,
  5464. target: this,
  5465. type: "get" /* TrackOpTypes.GET */,
  5466. key: key
  5467. });
  5468. }
  5469. watcher.depend();
  5470. }
  5471. return watcher.value;
  5472. }
  5473. };
  5474. }
  5475. function createGetterInvoker(fn) {
  5476. return function computedGetter() {
  5477. return fn.call(this, this);
  5478. };
  5479. }
  5480. function initMethods(vm, methods) {
  5481. var props = vm.$options.props;
  5482. for (var key in methods) {
  5483. if (process.env.NODE_ENV !== 'production') {
  5484. if (typeof methods[key] !== 'function') {
  5485. warn("Method \"".concat(key, "\" has type \"").concat(typeof methods[key], "\" in the component definition. ") +
  5486. "Did you reference the function correctly?", vm);
  5487. }
  5488. if (props && hasOwn(props, key)) {
  5489. warn("Method \"".concat(key, "\" has already been defined as a prop."), vm);
  5490. }
  5491. if (key in vm && isReserved(key)) {
  5492. warn("Method \"".concat(key, "\" conflicts with an existing Vue instance method. ") +
  5493. "Avoid defining component methods that start with _ or $.");
  5494. }
  5495. }
  5496. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5497. }
  5498. }
  5499. function initWatch(vm, watch) {
  5500. for (var key in watch) {
  5501. var handler = watch[key];
  5502. if (isArray(handler)) {
  5503. for (var i = 0; i < handler.length; i++) {
  5504. createWatcher(vm, key, handler[i]);
  5505. }
  5506. }
  5507. else {
  5508. createWatcher(vm, key, handler);
  5509. }
  5510. }
  5511. }
  5512. function createWatcher(vm, expOrFn, handler, options) {
  5513. if (isPlainObject(handler)) {
  5514. options = handler;
  5515. handler = handler.handler;
  5516. }
  5517. if (typeof handler === 'string') {
  5518. handler = vm[handler];
  5519. }
  5520. return vm.$watch(expOrFn, handler, options);
  5521. }
  5522. function stateMixin(Vue) {
  5523. // flow somehow has problems with directly declared definition object
  5524. // when using Object.defineProperty, so we have to procedurally build up
  5525. // the object here.
  5526. var dataDef = {};
  5527. dataDef.get = function () {
  5528. return this._data;
  5529. };
  5530. var propsDef = {};
  5531. propsDef.get = function () {
  5532. return this._props;
  5533. };
  5534. if (process.env.NODE_ENV !== 'production') {
  5535. dataDef.set = function () {
  5536. warn('Avoid replacing instance root $data. ' +
  5537. 'Use nested data properties instead.', this);
  5538. };
  5539. propsDef.set = function () {
  5540. warn("$props is readonly.", this);
  5541. };
  5542. }
  5543. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5544. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5545. Vue.prototype.$set = set;
  5546. Vue.prototype.$delete = del;
  5547. Vue.prototype.$watch = function (expOrFn, cb, options) {
  5548. var vm = this;
  5549. if (isPlainObject(cb)) {
  5550. return createWatcher(vm, expOrFn, cb, options);
  5551. }
  5552. options = options || {};
  5553. options.user = true;
  5554. var watcher = new Watcher(vm, expOrFn, cb, options);
  5555. if (options.immediate) {
  5556. var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
  5557. pushTarget();
  5558. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  5559. popTarget();
  5560. }
  5561. return function unwatchFn() {
  5562. watcher.teardown();
  5563. };
  5564. };
  5565. }
  5566. var uid = 0;
  5567. function initMixin$1(Vue) {
  5568. Vue.prototype._init = function (options) {
  5569. var vm = this;
  5570. // a uid
  5571. vm._uid = uid++;
  5572. var startTag, endTag;
  5573. /* istanbul ignore if */
  5574. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  5575. startTag = "vue-perf-start:".concat(vm._uid);
  5576. endTag = "vue-perf-end:".concat(vm._uid);
  5577. mark(startTag);
  5578. }
  5579. // a flag to mark this as a Vue instance without having to do instanceof
  5580. // check
  5581. vm._isVue = true;
  5582. // avoid instances from being observed
  5583. vm.__v_skip = true;
  5584. // effect scope
  5585. vm._scope = new EffectScope(true /* detached */);
  5586. vm._scope._vm = true;
  5587. // merge options
  5588. if (options && options._isComponent) {
  5589. // optimize internal component instantiation
  5590. // since dynamic options merging is pretty slow, and none of the
  5591. // internal component options needs special treatment.
  5592. initInternalComponent(vm, options);
  5593. }
  5594. else {
  5595. vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
  5596. }
  5597. /* istanbul ignore else */
  5598. if (process.env.NODE_ENV !== 'production') {
  5599. initProxy(vm);
  5600. }
  5601. else {
  5602. vm._renderProxy = vm;
  5603. }
  5604. // expose real self
  5605. vm._self = vm;
  5606. initLifecycle(vm);
  5607. initEvents(vm);
  5608. initRender(vm);
  5609. callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
  5610. initInjections(vm); // resolve injections before data/props
  5611. initState(vm);
  5612. initProvide(vm); // resolve provide after data/props
  5613. callHook$1(vm, 'created');
  5614. /* istanbul ignore if */
  5615. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  5616. vm._name = formatComponentName(vm, false);
  5617. mark(endTag);
  5618. measure("vue ".concat(vm._name, " init"), startTag, endTag);
  5619. }
  5620. if (vm.$options.el) {
  5621. vm.$mount(vm.$options.el);
  5622. }
  5623. };
  5624. }
  5625. function initInternalComponent(vm, options) {
  5626. var opts = (vm.$options = Object.create(vm.constructor.options));
  5627. // doing this because it's faster than dynamic enumeration.
  5628. var parentVnode = options._parentVnode;
  5629. opts.parent = options.parent;
  5630. opts._parentVnode = parentVnode;
  5631. var vnodeComponentOptions = parentVnode.componentOptions;
  5632. opts.propsData = vnodeComponentOptions.propsData;
  5633. opts._parentListeners = vnodeComponentOptions.listeners;
  5634. opts._renderChildren = vnodeComponentOptions.children;
  5635. opts._componentTag = vnodeComponentOptions.tag;
  5636. if (options.render) {
  5637. opts.render = options.render;
  5638. opts.staticRenderFns = options.staticRenderFns;
  5639. }
  5640. }
  5641. function resolveConstructorOptions(Ctor) {
  5642. var options = Ctor.options;
  5643. if (Ctor.super) {
  5644. var superOptions = resolveConstructorOptions(Ctor.super);
  5645. var cachedSuperOptions = Ctor.superOptions;
  5646. if (superOptions !== cachedSuperOptions) {
  5647. // super option changed,
  5648. // need to resolve new options.
  5649. Ctor.superOptions = superOptions;
  5650. // check if there are any late-modified/attached options (#4976)
  5651. var modifiedOptions = resolveModifiedOptions(Ctor);
  5652. // update base extend options
  5653. if (modifiedOptions) {
  5654. extend(Ctor.extendOptions, modifiedOptions);
  5655. }
  5656. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  5657. if (options.name) {
  5658. options.components[options.name] = Ctor;
  5659. }
  5660. }
  5661. }
  5662. return options;
  5663. }
  5664. function resolveModifiedOptions(Ctor) {
  5665. var modified;
  5666. var latest = Ctor.options;
  5667. var sealed = Ctor.sealedOptions;
  5668. for (var key in latest) {
  5669. if (latest[key] !== sealed[key]) {
  5670. if (!modified)
  5671. modified = {};
  5672. modified[key] = latest[key];
  5673. }
  5674. }
  5675. return modified;
  5676. }
  5677. function Vue(options) {
  5678. if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {
  5679. warn('Vue is a constructor and should be called with the `new` keyword');
  5680. }
  5681. this._init(options);
  5682. }
  5683. //@ts-expect-error Vue has function type
  5684. initMixin$1(Vue);
  5685. //@ts-expect-error Vue has function type
  5686. stateMixin(Vue);
  5687. //@ts-expect-error Vue has function type
  5688. eventsMixin(Vue);
  5689. //@ts-expect-error Vue has function type
  5690. lifecycleMixin(Vue);
  5691. //@ts-expect-error Vue has function type
  5692. renderMixin(Vue);
  5693. function initUse(Vue) {
  5694. Vue.use = function (plugin) {
  5695. var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
  5696. if (installedPlugins.indexOf(plugin) > -1) {
  5697. return this;
  5698. }
  5699. // additional parameters
  5700. var args = toArray(arguments, 1);
  5701. args.unshift(this);
  5702. if (isFunction(plugin.install)) {
  5703. plugin.install.apply(plugin, args);
  5704. }
  5705. else if (isFunction(plugin)) {
  5706. plugin.apply(null, args);
  5707. }
  5708. installedPlugins.push(plugin);
  5709. return this;
  5710. };
  5711. }
  5712. function initMixin(Vue) {
  5713. Vue.mixin = function (mixin) {
  5714. this.options = mergeOptions(this.options, mixin);
  5715. return this;
  5716. };
  5717. }
  5718. function initExtend(Vue) {
  5719. /**
  5720. * Each instance constructor, including Vue, has a unique
  5721. * cid. This enables us to create wrapped "child
  5722. * constructors" for prototypal inheritance and cache them.
  5723. */
  5724. Vue.cid = 0;
  5725. var cid = 1;
  5726. /**
  5727. * Class inheritance
  5728. */
  5729. Vue.extend = function (extendOptions) {
  5730. extendOptions = extendOptions || {};
  5731. var Super = this;
  5732. var SuperId = Super.cid;
  5733. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5734. if (cachedCtors[SuperId]) {
  5735. return cachedCtors[SuperId];
  5736. }
  5737. var name = getComponentName(extendOptions) || getComponentName(Super.options);
  5738. if (process.env.NODE_ENV !== 'production' && name) {
  5739. validateComponentName(name);
  5740. }
  5741. var Sub = function VueComponent(options) {
  5742. this._init(options);
  5743. };
  5744. Sub.prototype = Object.create(Super.prototype);
  5745. Sub.prototype.constructor = Sub;
  5746. Sub.cid = cid++;
  5747. Sub.options = mergeOptions(Super.options, extendOptions);
  5748. Sub['super'] = Super;
  5749. // For props and computed properties, we define the proxy getters on
  5750. // the Vue instances at extension time, on the extended prototype. This
  5751. // avoids Object.defineProperty calls for each instance created.
  5752. if (Sub.options.props) {
  5753. initProps(Sub);
  5754. }
  5755. if (Sub.options.computed) {
  5756. initComputed(Sub);
  5757. }
  5758. // allow further extension/mixin/plugin usage
  5759. Sub.extend = Super.extend;
  5760. Sub.mixin = Super.mixin;
  5761. Sub.use = Super.use;
  5762. // create asset registers, so extended classes
  5763. // can have their private assets too.
  5764. ASSET_TYPES.forEach(function (type) {
  5765. Sub[type] = Super[type];
  5766. });
  5767. // enable recursive self-lookup
  5768. if (name) {
  5769. Sub.options.components[name] = Sub;
  5770. }
  5771. // keep a reference to the super options at extension time.
  5772. // later at instantiation we can check if Super's options have
  5773. // been updated.
  5774. Sub.superOptions = Super.options;
  5775. Sub.extendOptions = extendOptions;
  5776. Sub.sealedOptions = extend({}, Sub.options);
  5777. // cache constructor
  5778. cachedCtors[SuperId] = Sub;
  5779. return Sub;
  5780. };
  5781. }
  5782. function initProps(Comp) {
  5783. var props = Comp.options.props;
  5784. for (var key in props) {
  5785. proxy(Comp.prototype, "_props", key);
  5786. }
  5787. }
  5788. function initComputed(Comp) {
  5789. var computed = Comp.options.computed;
  5790. for (var key in computed) {
  5791. defineComputed(Comp.prototype, key, computed[key]);
  5792. }
  5793. }
  5794. function initAssetRegisters(Vue) {
  5795. /**
  5796. * Create asset registration methods.
  5797. */
  5798. ASSET_TYPES.forEach(function (type) {
  5799. // @ts-expect-error function is not exact same type
  5800. Vue[type] = function (id, definition) {
  5801. if (!definition) {
  5802. return this.options[type + 's'][id];
  5803. }
  5804. else {
  5805. /* istanbul ignore if */
  5806. if (process.env.NODE_ENV !== 'production' && type === 'component') {
  5807. validateComponentName(id);
  5808. }
  5809. if (type === 'component' && isPlainObject(definition)) {
  5810. // @ts-expect-error
  5811. definition.name = definition.name || id;
  5812. definition = this.options._base.extend(definition);
  5813. }
  5814. if (type === 'directive' && isFunction(definition)) {
  5815. definition = { bind: definition, update: definition };
  5816. }
  5817. this.options[type + 's'][id] = definition;
  5818. return definition;
  5819. }
  5820. };
  5821. });
  5822. }
  5823. function _getComponentName(opts) {
  5824. return opts && (getComponentName(opts.Ctor.options) || opts.tag);
  5825. }
  5826. function matches(pattern, name) {
  5827. if (isArray(pattern)) {
  5828. return pattern.indexOf(name) > -1;
  5829. }
  5830. else if (typeof pattern === 'string') {
  5831. return pattern.split(',').indexOf(name) > -1;
  5832. }
  5833. else if (isRegExp(pattern)) {
  5834. return pattern.test(name);
  5835. }
  5836. /* istanbul ignore next */
  5837. return false;
  5838. }
  5839. function pruneCache(keepAliveInstance, filter) {
  5840. var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode;
  5841. for (var key in cache) {
  5842. var entry = cache[key];
  5843. if (entry) {
  5844. var name_1 = entry.name;
  5845. if (name_1 && !filter(name_1)) {
  5846. pruneCacheEntry(cache, key, keys, _vnode);
  5847. }
  5848. }
  5849. }
  5850. }
  5851. function pruneCacheEntry(cache, key, keys, current) {
  5852. var entry = cache[key];
  5853. if (entry && (!current || entry.tag !== current.tag)) {
  5854. // @ts-expect-error can be undefined
  5855. entry.componentInstance.$destroy();
  5856. }
  5857. cache[key] = null;
  5858. remove$2(keys, key);
  5859. }
  5860. var patternTypes = [String, RegExp, Array];
  5861. // TODO defineComponent
  5862. var KeepAlive = {
  5863. name: 'keep-alive',
  5864. abstract: true,
  5865. props: {
  5866. include: patternTypes,
  5867. exclude: patternTypes,
  5868. max: [String, Number]
  5869. },
  5870. methods: {
  5871. cacheVNode: function () {
  5872. var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
  5873. if (vnodeToCache) {
  5874. var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
  5875. cache[keyToCache] = {
  5876. name: _getComponentName(componentOptions),
  5877. tag: tag,
  5878. componentInstance: componentInstance
  5879. };
  5880. keys.push(keyToCache);
  5881. // prune oldest entry
  5882. if (this.max && keys.length > parseInt(this.max)) {
  5883. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  5884. }
  5885. this.vnodeToCache = null;
  5886. }
  5887. }
  5888. },
  5889. created: function () {
  5890. this.cache = Object.create(null);
  5891. this.keys = [];
  5892. },
  5893. destroyed: function () {
  5894. for (var key in this.cache) {
  5895. pruneCacheEntry(this.cache, key, this.keys);
  5896. }
  5897. },
  5898. mounted: function () {
  5899. var _this = this;
  5900. this.cacheVNode();
  5901. this.$watch('include', function (val) {
  5902. pruneCache(_this, function (name) { return matches(val, name); });
  5903. });
  5904. this.$watch('exclude', function (val) {
  5905. pruneCache(_this, function (name) { return !matches(val, name); });
  5906. });
  5907. },
  5908. updated: function () {
  5909. this.cacheVNode();
  5910. },
  5911. render: function () {
  5912. var slot = this.$slots.default;
  5913. var vnode = getFirstComponentChild(slot);
  5914. var componentOptions = vnode && vnode.componentOptions;
  5915. if (componentOptions) {
  5916. // check pattern
  5917. var name_2 = _getComponentName(componentOptions);
  5918. var _a = this, include = _a.include, exclude = _a.exclude;
  5919. if (
  5920. // not included
  5921. (include && (!name_2 || !matches(include, name_2))) ||
  5922. // excluded
  5923. (exclude && name_2 && matches(exclude, name_2))) {
  5924. return vnode;
  5925. }
  5926. var _b = this, cache = _b.cache, keys = _b.keys;
  5927. var key = vnode.key == null
  5928. ? // same constructor may get registered as different local components
  5929. // so cid alone is not enough (#3269)
  5930. componentOptions.Ctor.cid +
  5931. (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
  5932. : vnode.key;
  5933. if (cache[key]) {
  5934. vnode.componentInstance = cache[key].componentInstance;
  5935. // make current key freshest
  5936. remove$2(keys, key);
  5937. keys.push(key);
  5938. }
  5939. else {
  5940. // delay setting the cache until update
  5941. this.vnodeToCache = vnode;
  5942. this.keyToCache = key;
  5943. }
  5944. // @ts-expect-error can vnode.data can be undefined
  5945. vnode.data.keepAlive = true;
  5946. }
  5947. return vnode || (slot && slot[0]);
  5948. }
  5949. };
  5950. var builtInComponents = {
  5951. KeepAlive: KeepAlive
  5952. };
  5953. function initGlobalAPI(Vue) {
  5954. // config
  5955. var configDef = {};
  5956. configDef.get = function () { return config; };
  5957. if (process.env.NODE_ENV !== 'production') {
  5958. configDef.set = function () {
  5959. warn('Do not replace the Vue.config object, set individual fields instead.');
  5960. };
  5961. }
  5962. Object.defineProperty(Vue, 'config', configDef);
  5963. // exposed util methods.
  5964. // NOTE: these are not considered part of the public API - avoid relying on
  5965. // them unless you are aware of the risk.
  5966. Vue.util = {
  5967. warn: warn,
  5968. extend: extend,
  5969. mergeOptions: mergeOptions,
  5970. defineReactive: defineReactive
  5971. };
  5972. Vue.set = set;
  5973. Vue.delete = del;
  5974. Vue.nextTick = nextTick;
  5975. // 2.6 explicit observable API
  5976. Vue.observable = function (obj) {
  5977. observe(obj);
  5978. return obj;
  5979. };
  5980. Vue.options = Object.create(null);
  5981. ASSET_TYPES.forEach(function (type) {
  5982. Vue.options[type + 's'] = Object.create(null);
  5983. });
  5984. // this is used to identify the "base" constructor to extend all plain-object
  5985. // components with in Weex's multi-instance scenarios.
  5986. Vue.options._base = Vue;
  5987. extend(Vue.options.components, builtInComponents);
  5988. initUse(Vue);
  5989. initMixin(Vue);
  5990. initExtend(Vue);
  5991. initAssetRegisters(Vue);
  5992. }
  5993. initGlobalAPI(Vue);
  5994. Object.defineProperty(Vue.prototype, '$isServer', {
  5995. get: isServerRendering
  5996. });
  5997. Object.defineProperty(Vue.prototype, '$ssrContext', {
  5998. get: function () {
  5999. /* istanbul ignore next */
  6000. return this.$vnode && this.$vnode.ssrContext;
  6001. }
  6002. });
  6003. // expose FunctionalRenderContext for ssr runtime helper installation
  6004. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6005. value: FunctionalRenderContext
  6006. });
  6007. Vue.version = version;
  6008. // these are reserved for web because they are directly compiled away
  6009. // during template compilation
  6010. var isReservedAttr = makeMap('style,class');
  6011. // attributes that should be using props for binding
  6012. var acceptValue = makeMap('input,textarea,option,select,progress');
  6013. var mustUseProp = function (tag, type, attr) {
  6014. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  6015. (attr === 'selected' && tag === 'option') ||
  6016. (attr === 'checked' && tag === 'input') ||
  6017. (attr === 'muted' && tag === 'video'));
  6018. };
  6019. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  6020. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  6021. var convertEnumeratedValue = function (key, value) {
  6022. return isFalsyAttrValue(value) || value === 'false'
  6023. ? 'false'
  6024. : // allow arbitrary string value for contenteditable
  6025. key === 'contenteditable' && isValidContentEditableValue(value)
  6026. ? value
  6027. : 'true';
  6028. };
  6029. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  6030. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  6031. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  6032. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  6033. 'required,reversed,scoped,seamless,selected,sortable,' +
  6034. 'truespeed,typemustmatch,visible');
  6035. var xlinkNS = 'http://www.w3.org/1999/xlink';
  6036. var isXlink = function (name) {
  6037. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
  6038. };
  6039. var getXlinkProp = function (name) {
  6040. return isXlink(name) ? name.slice(6, name.length) : '';
  6041. };
  6042. var isFalsyAttrValue = function (val) {
  6043. return val == null || val === false;
  6044. };
  6045. function genClassForVnode(vnode) {
  6046. var data = vnode.data;
  6047. var parentNode = vnode;
  6048. var childNode = vnode;
  6049. while (isDef(childNode.componentInstance)) {
  6050. childNode = childNode.componentInstance._vnode;
  6051. if (childNode && childNode.data) {
  6052. data = mergeClassData(childNode.data, data);
  6053. }
  6054. }
  6055. // @ts-expect-error parentNode.parent not VNodeWithData
  6056. while (isDef((parentNode = parentNode.parent))) {
  6057. if (parentNode && parentNode.data) {
  6058. data = mergeClassData(data, parentNode.data);
  6059. }
  6060. }
  6061. return renderClass(data.staticClass, data.class);
  6062. }
  6063. function mergeClassData(child, parent) {
  6064. return {
  6065. staticClass: concat(child.staticClass, parent.staticClass),
  6066. class: isDef(child.class) ? [child.class, parent.class] : parent.class
  6067. };
  6068. }
  6069. function renderClass(staticClass, dynamicClass) {
  6070. if (isDef(staticClass) || isDef(dynamicClass)) {
  6071. return concat(staticClass, stringifyClass(dynamicClass));
  6072. }
  6073. /* istanbul ignore next */
  6074. return '';
  6075. }
  6076. function concat(a, b) {
  6077. return a ? (b ? a + ' ' + b : a) : b || '';
  6078. }
  6079. function stringifyClass(value) {
  6080. if (Array.isArray(value)) {
  6081. return stringifyArray(value);
  6082. }
  6083. if (isObject(value)) {
  6084. return stringifyObject(value);
  6085. }
  6086. if (typeof value === 'string') {
  6087. return value;
  6088. }
  6089. /* istanbul ignore next */
  6090. return '';
  6091. }
  6092. function stringifyArray(value) {
  6093. var res = '';
  6094. var stringified;
  6095. for (var i = 0, l = value.length; i < l; i++) {
  6096. if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
  6097. if (res)
  6098. res += ' ';
  6099. res += stringified;
  6100. }
  6101. }
  6102. return res;
  6103. }
  6104. function stringifyObject(value) {
  6105. var res = '';
  6106. for (var key in value) {
  6107. if (value[key]) {
  6108. if (res)
  6109. res += ' ';
  6110. res += key;
  6111. }
  6112. }
  6113. return res;
  6114. }
  6115. var namespaceMap = {
  6116. svg: 'http://www.w3.org/2000/svg',
  6117. math: 'http://www.w3.org/1998/Math/MathML'
  6118. };
  6119. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  6120. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  6121. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  6122. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  6123. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  6124. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  6125. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  6126. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  6127. 'output,progress,select,textarea,' +
  6128. 'details,dialog,menu,menuitem,summary,' +
  6129. 'content,element,shadow,template,blockquote,iframe,tfoot');
  6130. // this map is intentionally selective, only covering SVG elements that may
  6131. // contain child elements.
  6132. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  6133. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  6134. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  6135. var isReservedTag = function (tag) {
  6136. return isHTMLTag(tag) || isSVG(tag);
  6137. };
  6138. function getTagNamespace(tag) {
  6139. if (isSVG(tag)) {
  6140. return 'svg';
  6141. }
  6142. // basic support for MathML
  6143. // note it doesn't support other MathML elements being component roots
  6144. if (tag === 'math') {
  6145. return 'math';
  6146. }
  6147. }
  6148. var unknownElementCache = Object.create(null);
  6149. function isUnknownElement(tag) {
  6150. /* istanbul ignore if */
  6151. if (!inBrowser) {
  6152. return true;
  6153. }
  6154. if (isReservedTag(tag)) {
  6155. return false;
  6156. }
  6157. tag = tag.toLowerCase();
  6158. /* istanbul ignore if */
  6159. if (unknownElementCache[tag] != null) {
  6160. return unknownElementCache[tag];
  6161. }
  6162. var el = document.createElement(tag);
  6163. if (tag.indexOf('-') > -1) {
  6164. // http://stackoverflow.com/a/28210364/1070244
  6165. return (unknownElementCache[tag] =
  6166. el.constructor === window.HTMLUnknownElement ||
  6167. el.constructor === window.HTMLElement);
  6168. }
  6169. else {
  6170. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
  6171. }
  6172. }
  6173. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  6174. /**
  6175. * Query an element selector if it's not an element already.
  6176. */
  6177. function query(el) {
  6178. if (typeof el === 'string') {
  6179. var selected = document.querySelector(el);
  6180. if (!selected) {
  6181. process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);
  6182. return document.createElement('div');
  6183. }
  6184. return selected;
  6185. }
  6186. else {
  6187. return el;
  6188. }
  6189. }
  6190. function createElement(tagName, vnode) {
  6191. var elm = document.createElement(tagName);
  6192. if (tagName !== 'select') {
  6193. return elm;
  6194. }
  6195. // false or null will remove the attribute but undefined will not
  6196. if (vnode.data &&
  6197. vnode.data.attrs &&
  6198. vnode.data.attrs.multiple !== undefined) {
  6199. elm.setAttribute('multiple', 'multiple');
  6200. }
  6201. return elm;
  6202. }
  6203. function createElementNS(namespace, tagName) {
  6204. return document.createElementNS(namespaceMap[namespace], tagName);
  6205. }
  6206. function createTextNode(text) {
  6207. return document.createTextNode(text);
  6208. }
  6209. function createComment(text) {
  6210. return document.createComment(text);
  6211. }
  6212. function insertBefore(parentNode, newNode, referenceNode) {
  6213. parentNode.insertBefore(newNode, referenceNode);
  6214. }
  6215. function removeChild(node, child) {
  6216. node.removeChild(child);
  6217. }
  6218. function appendChild(node, child) {
  6219. node.appendChild(child);
  6220. }
  6221. function parentNode(node) {
  6222. return node.parentNode;
  6223. }
  6224. function nextSibling(node) {
  6225. return node.nextSibling;
  6226. }
  6227. function tagName(node) {
  6228. return node.tagName;
  6229. }
  6230. function setTextContent(node, text) {
  6231. node.textContent = text;
  6232. }
  6233. function setStyleScope(node, scopeId) {
  6234. node.setAttribute(scopeId, '');
  6235. }
  6236. var nodeOps = /*#__PURE__*/Object.freeze({
  6237. __proto__: null,
  6238. createElement: createElement,
  6239. createElementNS: createElementNS,
  6240. createTextNode: createTextNode,
  6241. createComment: createComment,
  6242. insertBefore: insertBefore,
  6243. removeChild: removeChild,
  6244. appendChild: appendChild,
  6245. parentNode: parentNode,
  6246. nextSibling: nextSibling,
  6247. tagName: tagName,
  6248. setTextContent: setTextContent,
  6249. setStyleScope: setStyleScope
  6250. });
  6251. var ref = {
  6252. create: function (_, vnode) {
  6253. registerRef(vnode);
  6254. },
  6255. update: function (oldVnode, vnode) {
  6256. if (oldVnode.data.ref !== vnode.data.ref) {
  6257. registerRef(oldVnode, true);
  6258. registerRef(vnode);
  6259. }
  6260. },
  6261. destroy: function (vnode) {
  6262. registerRef(vnode, true);
  6263. }
  6264. };
  6265. function registerRef(vnode, isRemoval) {
  6266. var ref = vnode.data.ref;
  6267. if (!isDef(ref))
  6268. return;
  6269. var vm = vnode.context;
  6270. var refValue = vnode.componentInstance || vnode.elm;
  6271. var value = isRemoval ? null : refValue;
  6272. var $refsValue = isRemoval ? undefined : refValue;
  6273. if (isFunction(ref)) {
  6274. invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
  6275. return;
  6276. }
  6277. var isFor = vnode.data.refInFor;
  6278. var _isString = typeof ref === 'string' || typeof ref === 'number';
  6279. var _isRef = isRef(ref);
  6280. var refs = vm.$refs;
  6281. if (_isString || _isRef) {
  6282. if (isFor) {
  6283. var existing = _isString ? refs[ref] : ref.value;
  6284. if (isRemoval) {
  6285. isArray(existing) && remove$2(existing, refValue);
  6286. }
  6287. else {
  6288. if (!isArray(existing)) {
  6289. if (_isString) {
  6290. refs[ref] = [refValue];
  6291. setSetupRef(vm, ref, refs[ref]);
  6292. }
  6293. else {
  6294. ref.value = [refValue];
  6295. }
  6296. }
  6297. else if (!existing.includes(refValue)) {
  6298. existing.push(refValue);
  6299. }
  6300. }
  6301. }
  6302. else if (_isString) {
  6303. if (isRemoval && refs[ref] !== refValue) {
  6304. return;
  6305. }
  6306. refs[ref] = $refsValue;
  6307. setSetupRef(vm, ref, value);
  6308. }
  6309. else if (_isRef) {
  6310. if (isRemoval && ref.value !== refValue) {
  6311. return;
  6312. }
  6313. ref.value = value;
  6314. }
  6315. else if (process.env.NODE_ENV !== 'production') {
  6316. warn("Invalid template ref type: ".concat(typeof ref));
  6317. }
  6318. }
  6319. }
  6320. function setSetupRef(_a, key, val) {
  6321. var _setupState = _a._setupState;
  6322. if (_setupState && hasOwn(_setupState, key)) {
  6323. if (isRef(_setupState[key])) {
  6324. _setupState[key].value = val;
  6325. }
  6326. else {
  6327. _setupState[key] = val;
  6328. }
  6329. }
  6330. }
  6331. /**
  6332. * Virtual DOM patching algorithm based on Snabbdom by
  6333. * Simon Friis Vindum (@paldepind)
  6334. * Licensed under the MIT License
  6335. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  6336. *
  6337. * modified by Evan You (@yyx990803)
  6338. *
  6339. * Not type-checking this because this file is perf-critical and the cost
  6340. * of making flow understand it is not worth it.
  6341. */
  6342. var emptyNode = new VNode('', {}, []);
  6343. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  6344. function sameVnode(a, b) {
  6345. return (a.key === b.key &&
  6346. a.asyncFactory === b.asyncFactory &&
  6347. ((a.tag === b.tag &&
  6348. a.isComment === b.isComment &&
  6349. isDef(a.data) === isDef(b.data) &&
  6350. sameInputType(a, b)) ||
  6351. (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
  6352. }
  6353. function sameInputType(a, b) {
  6354. if (a.tag !== 'input')
  6355. return true;
  6356. var i;
  6357. var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
  6358. var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
  6359. return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
  6360. }
  6361. function createKeyToOldIdx(children, beginIdx, endIdx) {
  6362. var i, key;
  6363. var map = {};
  6364. for (i = beginIdx; i <= endIdx; ++i) {
  6365. key = children[i].key;
  6366. if (isDef(key))
  6367. map[key] = i;
  6368. }
  6369. return map;
  6370. }
  6371. function createPatchFunction(backend) {
  6372. var i, j;
  6373. var cbs = {};
  6374. var modules = backend.modules, nodeOps = backend.nodeOps;
  6375. for (i = 0; i < hooks.length; ++i) {
  6376. cbs[hooks[i]] = [];
  6377. for (j = 0; j < modules.length; ++j) {
  6378. if (isDef(modules[j][hooks[i]])) {
  6379. cbs[hooks[i]].push(modules[j][hooks[i]]);
  6380. }
  6381. }
  6382. }
  6383. function emptyNodeAt(elm) {
  6384. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
  6385. }
  6386. function createRmCb(childElm, listeners) {
  6387. function remove() {
  6388. if (--remove.listeners === 0) {
  6389. removeNode(childElm);
  6390. }
  6391. }
  6392. remove.listeners = listeners;
  6393. return remove;
  6394. }
  6395. function removeNode(el) {
  6396. var parent = nodeOps.parentNode(el);
  6397. // element may have already been removed due to v-html / v-text
  6398. if (isDef(parent)) {
  6399. nodeOps.removeChild(parent, el);
  6400. }
  6401. }
  6402. function isUnknownElement(vnode, inVPre) {
  6403. return (!inVPre &&
  6404. !vnode.ns &&
  6405. !(config.ignoredElements.length &&
  6406. config.ignoredElements.some(function (ignore) {
  6407. return isRegExp(ignore)
  6408. ? ignore.test(vnode.tag)
  6409. : ignore === vnode.tag;
  6410. })) &&
  6411. config.isUnknownElement(vnode.tag));
  6412. }
  6413. var creatingElmInVPre = 0;
  6414. function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
  6415. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6416. // This vnode was used in a previous render!
  6417. // now it's used as a new node, overwriting its elm would cause
  6418. // potential patch errors down the road when it's used as an insertion
  6419. // reference node. Instead, we clone the node on-demand before creating
  6420. // associated DOM element for it.
  6421. vnode = ownerArray[index] = cloneVNode(vnode);
  6422. }
  6423. vnode.isRootInsert = !nested; // for transition enter check
  6424. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  6425. return;
  6426. }
  6427. var data = vnode.data;
  6428. var children = vnode.children;
  6429. var tag = vnode.tag;
  6430. if (isDef(tag)) {
  6431. if (process.env.NODE_ENV !== 'production') {
  6432. if (data && data.pre) {
  6433. creatingElmInVPre++;
  6434. }
  6435. if (isUnknownElement(vnode, creatingElmInVPre)) {
  6436. warn('Unknown custom element: <' +
  6437. tag +
  6438. '> - did you ' +
  6439. 'register the component correctly? For recursive components, ' +
  6440. 'make sure to provide the "name" option.', vnode.context);
  6441. }
  6442. }
  6443. vnode.elm = vnode.ns
  6444. ? nodeOps.createElementNS(vnode.ns, tag)
  6445. : nodeOps.createElement(tag, vnode);
  6446. setScope(vnode);
  6447. createChildren(vnode, children, insertedVnodeQueue);
  6448. if (isDef(data)) {
  6449. invokeCreateHooks(vnode, insertedVnodeQueue);
  6450. }
  6451. insert(parentElm, vnode.elm, refElm);
  6452. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  6453. creatingElmInVPre--;
  6454. }
  6455. }
  6456. else if (isTrue(vnode.isComment)) {
  6457. vnode.elm = nodeOps.createComment(vnode.text);
  6458. insert(parentElm, vnode.elm, refElm);
  6459. }
  6460. else {
  6461. vnode.elm = nodeOps.createTextNode(vnode.text);
  6462. insert(parentElm, vnode.elm, refElm);
  6463. }
  6464. }
  6465. function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6466. var i = vnode.data;
  6467. if (isDef(i)) {
  6468. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  6469. if (isDef((i = i.hook)) && isDef((i = i.init))) {
  6470. i(vnode, false /* hydrating */);
  6471. }
  6472. // after calling the init hook, if the vnode is a child component
  6473. // it should've created a child instance and mounted it. the child
  6474. // component also has set the placeholder vnode's elm.
  6475. // in that case we can just return the element and be done.
  6476. if (isDef(vnode.componentInstance)) {
  6477. initComponent(vnode, insertedVnodeQueue);
  6478. insert(parentElm, vnode.elm, refElm);
  6479. if (isTrue(isReactivated)) {
  6480. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  6481. }
  6482. return true;
  6483. }
  6484. }
  6485. }
  6486. function initComponent(vnode, insertedVnodeQueue) {
  6487. if (isDef(vnode.data.pendingInsert)) {
  6488. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  6489. vnode.data.pendingInsert = null;
  6490. }
  6491. vnode.elm = vnode.componentInstance.$el;
  6492. if (isPatchable(vnode)) {
  6493. invokeCreateHooks(vnode, insertedVnodeQueue);
  6494. setScope(vnode);
  6495. }
  6496. else {
  6497. // empty component root.
  6498. // skip all element-related modules except for ref (#3455)
  6499. registerRef(vnode);
  6500. // make sure to invoke the insert hook
  6501. insertedVnodeQueue.push(vnode);
  6502. }
  6503. }
  6504. function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6505. var i;
  6506. // hack for #4339: a reactivated component with inner transition
  6507. // does not trigger because the inner node's created hooks are not called
  6508. // again. It's not ideal to involve module-specific logic in here but
  6509. // there doesn't seem to be a better way to do it.
  6510. var innerNode = vnode;
  6511. while (innerNode.componentInstance) {
  6512. innerNode = innerNode.componentInstance._vnode;
  6513. if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
  6514. for (i = 0; i < cbs.activate.length; ++i) {
  6515. cbs.activate[i](emptyNode, innerNode);
  6516. }
  6517. insertedVnodeQueue.push(innerNode);
  6518. break;
  6519. }
  6520. }
  6521. // unlike a newly created component,
  6522. // a reactivated keep-alive component doesn't insert itself
  6523. insert(parentElm, vnode.elm, refElm);
  6524. }
  6525. function insert(parent, elm, ref) {
  6526. if (isDef(parent)) {
  6527. if (isDef(ref)) {
  6528. if (nodeOps.parentNode(ref) === parent) {
  6529. nodeOps.insertBefore(parent, elm, ref);
  6530. }
  6531. }
  6532. else {
  6533. nodeOps.appendChild(parent, elm);
  6534. }
  6535. }
  6536. }
  6537. function createChildren(vnode, children, insertedVnodeQueue) {
  6538. if (isArray(children)) {
  6539. if (process.env.NODE_ENV !== 'production') {
  6540. checkDuplicateKeys(children);
  6541. }
  6542. for (var i_1 = 0; i_1 < children.length; ++i_1) {
  6543. createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
  6544. }
  6545. }
  6546. else if (isPrimitive(vnode.text)) {
  6547. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  6548. }
  6549. }
  6550. function isPatchable(vnode) {
  6551. while (vnode.componentInstance) {
  6552. vnode = vnode.componentInstance._vnode;
  6553. }
  6554. return isDef(vnode.tag);
  6555. }
  6556. function invokeCreateHooks(vnode, insertedVnodeQueue) {
  6557. for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
  6558. cbs.create[i_2](emptyNode, vnode);
  6559. }
  6560. i = vnode.data.hook; // Reuse variable
  6561. if (isDef(i)) {
  6562. if (isDef(i.create))
  6563. i.create(emptyNode, vnode);
  6564. if (isDef(i.insert))
  6565. insertedVnodeQueue.push(vnode);
  6566. }
  6567. }
  6568. // set scope id attribute for scoped CSS.
  6569. // this is implemented as a special case to avoid the overhead
  6570. // of going through the normal attribute patching process.
  6571. function setScope(vnode) {
  6572. var i;
  6573. if (isDef((i = vnode.fnScopeId))) {
  6574. nodeOps.setStyleScope(vnode.elm, i);
  6575. }
  6576. else {
  6577. var ancestor = vnode;
  6578. while (ancestor) {
  6579. if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
  6580. nodeOps.setStyleScope(vnode.elm, i);
  6581. }
  6582. ancestor = ancestor.parent;
  6583. }
  6584. }
  6585. // for slot content they should also get the scopeId from the host instance.
  6586. if (isDef((i = activeInstance)) &&
  6587. i !== vnode.context &&
  6588. i !== vnode.fnContext &&
  6589. isDef((i = i.$options._scopeId))) {
  6590. nodeOps.setStyleScope(vnode.elm, i);
  6591. }
  6592. }
  6593. function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  6594. for (; startIdx <= endIdx; ++startIdx) {
  6595. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  6596. }
  6597. }
  6598. function invokeDestroyHook(vnode) {
  6599. var i, j;
  6600. var data = vnode.data;
  6601. if (isDef(data)) {
  6602. if (isDef((i = data.hook)) && isDef((i = i.destroy)))
  6603. i(vnode);
  6604. for (i = 0; i < cbs.destroy.length; ++i)
  6605. cbs.destroy[i](vnode);
  6606. }
  6607. if (isDef((i = vnode.children))) {
  6608. for (j = 0; j < vnode.children.length; ++j) {
  6609. invokeDestroyHook(vnode.children[j]);
  6610. }
  6611. }
  6612. }
  6613. function removeVnodes(vnodes, startIdx, endIdx) {
  6614. for (; startIdx <= endIdx; ++startIdx) {
  6615. var ch = vnodes[startIdx];
  6616. if (isDef(ch)) {
  6617. if (isDef(ch.tag)) {
  6618. removeAndInvokeRemoveHook(ch);
  6619. invokeDestroyHook(ch);
  6620. }
  6621. else {
  6622. // Text node
  6623. removeNode(ch.elm);
  6624. }
  6625. }
  6626. }
  6627. }
  6628. function removeAndInvokeRemoveHook(vnode, rm) {
  6629. if (isDef(rm) || isDef(vnode.data)) {
  6630. var i_3;
  6631. var listeners = cbs.remove.length + 1;
  6632. if (isDef(rm)) {
  6633. // we have a recursively passed down rm callback
  6634. // increase the listeners count
  6635. rm.listeners += listeners;
  6636. }
  6637. else {
  6638. // directly removing
  6639. rm = createRmCb(vnode.elm, listeners);
  6640. }
  6641. // recursively invoke hooks on child component root node
  6642. if (isDef((i_3 = vnode.componentInstance)) &&
  6643. isDef((i_3 = i_3._vnode)) &&
  6644. isDef(i_3.data)) {
  6645. removeAndInvokeRemoveHook(i_3, rm);
  6646. }
  6647. for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
  6648. cbs.remove[i_3](vnode, rm);
  6649. }
  6650. if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
  6651. i_3(vnode, rm);
  6652. }
  6653. else {
  6654. rm();
  6655. }
  6656. }
  6657. else {
  6658. removeNode(vnode.elm);
  6659. }
  6660. }
  6661. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  6662. var oldStartIdx = 0;
  6663. var newStartIdx = 0;
  6664. var oldEndIdx = oldCh.length - 1;
  6665. var oldStartVnode = oldCh[0];
  6666. var oldEndVnode = oldCh[oldEndIdx];
  6667. var newEndIdx = newCh.length - 1;
  6668. var newStartVnode = newCh[0];
  6669. var newEndVnode = newCh[newEndIdx];
  6670. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  6671. // removeOnly is a special flag used only by <transition-group>
  6672. // to ensure removed elements stay in correct relative positions
  6673. // during leaving transitions
  6674. var canMove = !removeOnly;
  6675. if (process.env.NODE_ENV !== 'production') {
  6676. checkDuplicateKeys(newCh);
  6677. }
  6678. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  6679. if (isUndef(oldStartVnode)) {
  6680. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  6681. }
  6682. else if (isUndef(oldEndVnode)) {
  6683. oldEndVnode = oldCh[--oldEndIdx];
  6684. }
  6685. else if (sameVnode(oldStartVnode, newStartVnode)) {
  6686. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6687. oldStartVnode = oldCh[++oldStartIdx];
  6688. newStartVnode = newCh[++newStartIdx];
  6689. }
  6690. else if (sameVnode(oldEndVnode, newEndVnode)) {
  6691. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6692. oldEndVnode = oldCh[--oldEndIdx];
  6693. newEndVnode = newCh[--newEndIdx];
  6694. }
  6695. else if (sameVnode(oldStartVnode, newEndVnode)) {
  6696. // Vnode moved right
  6697. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6698. canMove &&
  6699. nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  6700. oldStartVnode = oldCh[++oldStartIdx];
  6701. newEndVnode = newCh[--newEndIdx];
  6702. }
  6703. else if (sameVnode(oldEndVnode, newStartVnode)) {
  6704. // Vnode moved left
  6705. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6706. canMove &&
  6707. nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  6708. oldEndVnode = oldCh[--oldEndIdx];
  6709. newStartVnode = newCh[++newStartIdx];
  6710. }
  6711. else {
  6712. if (isUndef(oldKeyToIdx))
  6713. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  6714. idxInOld = isDef(newStartVnode.key)
  6715. ? oldKeyToIdx[newStartVnode.key]
  6716. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  6717. if (isUndef(idxInOld)) {
  6718. // New element
  6719. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6720. }
  6721. else {
  6722. vnodeToMove = oldCh[idxInOld];
  6723. if (sameVnode(vnodeToMove, newStartVnode)) {
  6724. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6725. oldCh[idxInOld] = undefined;
  6726. canMove &&
  6727. nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  6728. }
  6729. else {
  6730. // same key but different element. treat as new element
  6731. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6732. }
  6733. }
  6734. newStartVnode = newCh[++newStartIdx];
  6735. }
  6736. }
  6737. if (oldStartIdx > oldEndIdx) {
  6738. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  6739. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  6740. }
  6741. else if (newStartIdx > newEndIdx) {
  6742. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  6743. }
  6744. }
  6745. function checkDuplicateKeys(children) {
  6746. var seenKeys = {};
  6747. for (var i_4 = 0; i_4 < children.length; i_4++) {
  6748. var vnode = children[i_4];
  6749. var key = vnode.key;
  6750. if (isDef(key)) {
  6751. if (seenKeys[key]) {
  6752. warn("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
  6753. }
  6754. else {
  6755. seenKeys[key] = true;
  6756. }
  6757. }
  6758. }
  6759. }
  6760. function findIdxInOld(node, oldCh, start, end) {
  6761. for (var i_5 = start; i_5 < end; i_5++) {
  6762. var c = oldCh[i_5];
  6763. if (isDef(c) && sameVnode(node, c))
  6764. return i_5;
  6765. }
  6766. }
  6767. function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
  6768. if (oldVnode === vnode) {
  6769. return;
  6770. }
  6771. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6772. // clone reused vnode
  6773. vnode = ownerArray[index] = cloneVNode(vnode);
  6774. }
  6775. var elm = (vnode.elm = oldVnode.elm);
  6776. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  6777. if (isDef(vnode.asyncFactory.resolved)) {
  6778. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  6779. }
  6780. else {
  6781. vnode.isAsyncPlaceholder = true;
  6782. }
  6783. return;
  6784. }
  6785. // reuse element for static trees.
  6786. // note we only do this if the vnode is cloned -
  6787. // if the new node is not cloned it means the render functions have been
  6788. // reset by the hot-reload-api and we need to do a proper re-render.
  6789. if (isTrue(vnode.isStatic) &&
  6790. isTrue(oldVnode.isStatic) &&
  6791. vnode.key === oldVnode.key &&
  6792. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
  6793. vnode.componentInstance = oldVnode.componentInstance;
  6794. return;
  6795. }
  6796. var i;
  6797. var data = vnode.data;
  6798. if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
  6799. i(oldVnode, vnode);
  6800. }
  6801. var oldCh = oldVnode.children;
  6802. var ch = vnode.children;
  6803. if (isDef(data) && isPatchable(vnode)) {
  6804. for (i = 0; i < cbs.update.length; ++i)
  6805. cbs.update[i](oldVnode, vnode);
  6806. if (isDef((i = data.hook)) && isDef((i = i.update)))
  6807. i(oldVnode, vnode);
  6808. }
  6809. if (isUndef(vnode.text)) {
  6810. if (isDef(oldCh) && isDef(ch)) {
  6811. if (oldCh !== ch)
  6812. updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
  6813. }
  6814. else if (isDef(ch)) {
  6815. if (process.env.NODE_ENV !== 'production') {
  6816. checkDuplicateKeys(ch);
  6817. }
  6818. if (isDef(oldVnode.text))
  6819. nodeOps.setTextContent(elm, '');
  6820. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  6821. }
  6822. else if (isDef(oldCh)) {
  6823. removeVnodes(oldCh, 0, oldCh.length - 1);
  6824. }
  6825. else if (isDef(oldVnode.text)) {
  6826. nodeOps.setTextContent(elm, '');
  6827. }
  6828. }
  6829. else if (oldVnode.text !== vnode.text) {
  6830. nodeOps.setTextContent(elm, vnode.text);
  6831. }
  6832. if (isDef(data)) {
  6833. if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
  6834. i(oldVnode, vnode);
  6835. }
  6836. }
  6837. function invokeInsertHook(vnode, queue, initial) {
  6838. // delay insert hooks for component root nodes, invoke them after the
  6839. // element is really inserted
  6840. if (isTrue(initial) && isDef(vnode.parent)) {
  6841. vnode.parent.data.pendingInsert = queue;
  6842. }
  6843. else {
  6844. for (var i_6 = 0; i_6 < queue.length; ++i_6) {
  6845. queue[i_6].data.hook.insert(queue[i_6]);
  6846. }
  6847. }
  6848. }
  6849. var hydrationBailed = false;
  6850. // list of modules that can skip create hook during hydration because they
  6851. // are already rendered on the client or has no need for initialization
  6852. // Note: style is excluded because it relies on initial clone for future
  6853. // deep updates (#7063).
  6854. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  6855. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  6856. function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
  6857. var i;
  6858. var tag = vnode.tag, data = vnode.data, children = vnode.children;
  6859. inVPre = inVPre || (data && data.pre);
  6860. vnode.elm = elm;
  6861. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  6862. vnode.isAsyncPlaceholder = true;
  6863. return true;
  6864. }
  6865. // assert node match
  6866. if (process.env.NODE_ENV !== 'production') {
  6867. if (!assertNodeMatch(elm, vnode, inVPre)) {
  6868. return false;
  6869. }
  6870. }
  6871. if (isDef(data)) {
  6872. if (isDef((i = data.hook)) && isDef((i = i.init)))
  6873. i(vnode, true /* hydrating */);
  6874. if (isDef((i = vnode.componentInstance))) {
  6875. // child component. it should have hydrated its own tree.
  6876. initComponent(vnode, insertedVnodeQueue);
  6877. return true;
  6878. }
  6879. }
  6880. if (isDef(tag)) {
  6881. if (isDef(children)) {
  6882. // empty element, allow client to pick up and populate children
  6883. if (!elm.hasChildNodes()) {
  6884. createChildren(vnode, children, insertedVnodeQueue);
  6885. }
  6886. else {
  6887. // v-html and domProps: innerHTML
  6888. if (isDef((i = data)) &&
  6889. isDef((i = i.domProps)) &&
  6890. isDef((i = i.innerHTML))) {
  6891. if (i !== elm.innerHTML) {
  6892. /* istanbul ignore if */
  6893. if (process.env.NODE_ENV !== 'production' &&
  6894. typeof console !== 'undefined' &&
  6895. !hydrationBailed) {
  6896. hydrationBailed = true;
  6897. console.warn('Parent: ', elm);
  6898. console.warn('server innerHTML: ', i);
  6899. console.warn('client innerHTML: ', elm.innerHTML);
  6900. }
  6901. return false;
  6902. }
  6903. }
  6904. else {
  6905. // iterate and compare children lists
  6906. var childrenMatch = true;
  6907. var childNode = elm.firstChild;
  6908. for (var i_7 = 0; i_7 < children.length; i_7++) {
  6909. if (!childNode ||
  6910. !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
  6911. childrenMatch = false;
  6912. break;
  6913. }
  6914. childNode = childNode.nextSibling;
  6915. }
  6916. // if childNode is not null, it means the actual childNodes list is
  6917. // longer than the virtual children list.
  6918. if (!childrenMatch || childNode) {
  6919. /* istanbul ignore if */
  6920. if (process.env.NODE_ENV !== 'production' &&
  6921. typeof console !== 'undefined' &&
  6922. !hydrationBailed) {
  6923. hydrationBailed = true;
  6924. console.warn('Parent: ', elm);
  6925. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  6926. }
  6927. return false;
  6928. }
  6929. }
  6930. }
  6931. }
  6932. if (isDef(data)) {
  6933. var fullInvoke = false;
  6934. for (var key in data) {
  6935. if (!isRenderedModule(key)) {
  6936. fullInvoke = true;
  6937. invokeCreateHooks(vnode, insertedVnodeQueue);
  6938. break;
  6939. }
  6940. }
  6941. if (!fullInvoke && data['class']) {
  6942. // ensure collecting deps for deep class bindings for future updates
  6943. traverse(data['class']);
  6944. }
  6945. }
  6946. }
  6947. else if (elm.data !== vnode.text) {
  6948. elm.data = vnode.text;
  6949. }
  6950. return true;
  6951. }
  6952. function assertNodeMatch(node, vnode, inVPre) {
  6953. if (isDef(vnode.tag)) {
  6954. return (vnode.tag.indexOf('vue-component') === 0 ||
  6955. (!isUnknownElement(vnode, inVPre) &&
  6956. vnode.tag.toLowerCase() ===
  6957. (node.tagName && node.tagName.toLowerCase())));
  6958. }
  6959. else {
  6960. return node.nodeType === (vnode.isComment ? 8 : 3);
  6961. }
  6962. }
  6963. return function patch(oldVnode, vnode, hydrating, removeOnly) {
  6964. if (isUndef(vnode)) {
  6965. if (isDef(oldVnode))
  6966. invokeDestroyHook(oldVnode);
  6967. return;
  6968. }
  6969. var isInitialPatch = false;
  6970. var insertedVnodeQueue = [];
  6971. if (isUndef(oldVnode)) {
  6972. // empty mount (likely as component), create new root element
  6973. isInitialPatch = true;
  6974. createElm(vnode, insertedVnodeQueue);
  6975. }
  6976. else {
  6977. var isRealElement = isDef(oldVnode.nodeType);
  6978. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  6979. // patch existing root node
  6980. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  6981. }
  6982. else {
  6983. if (isRealElement) {
  6984. // mounting to a real element
  6985. // check if this is server-rendered content and if we can perform
  6986. // a successful hydration.
  6987. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  6988. oldVnode.removeAttribute(SSR_ATTR);
  6989. hydrating = true;
  6990. }
  6991. if (isTrue(hydrating)) {
  6992. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  6993. invokeInsertHook(vnode, insertedVnodeQueue, true);
  6994. return oldVnode;
  6995. }
  6996. else if (process.env.NODE_ENV !== 'production') {
  6997. warn('The client-side rendered virtual DOM tree is not matching ' +
  6998. 'server-rendered content. This is likely caused by incorrect ' +
  6999. 'HTML markup, for example nesting block-level elements inside ' +
  7000. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  7001. 'full client-side render.');
  7002. }
  7003. }
  7004. // either not server-rendered, or hydration failed.
  7005. // create an empty node and replace it
  7006. oldVnode = emptyNodeAt(oldVnode);
  7007. }
  7008. // replacing existing element
  7009. var oldElm = oldVnode.elm;
  7010. var parentElm = nodeOps.parentNode(oldElm);
  7011. // create new node
  7012. createElm(vnode, insertedVnodeQueue,
  7013. // extremely rare edge case: do not insert if old element is in a
  7014. // leaving transition. Only happens when combining transition +
  7015. // keep-alive + HOCs. (#4590)
  7016. oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
  7017. // update parent placeholder node element, recursively
  7018. if (isDef(vnode.parent)) {
  7019. var ancestor = vnode.parent;
  7020. var patchable = isPatchable(vnode);
  7021. while (ancestor) {
  7022. for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
  7023. cbs.destroy[i_8](ancestor);
  7024. }
  7025. ancestor.elm = vnode.elm;
  7026. if (patchable) {
  7027. for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
  7028. cbs.create[i_9](emptyNode, ancestor);
  7029. }
  7030. // #6513
  7031. // invoke insert hooks that may have been merged by create hooks.
  7032. // e.g. for directives that uses the "inserted" hook.
  7033. var insert_1 = ancestor.data.hook.insert;
  7034. if (insert_1.merged) {
  7035. // start at index 1 to avoid re-invoking component mounted hook
  7036. for (var i_10 = 1; i_10 < insert_1.fns.length; i_10++) {
  7037. insert_1.fns[i_10]();
  7038. }
  7039. }
  7040. }
  7041. else {
  7042. registerRef(ancestor);
  7043. }
  7044. ancestor = ancestor.parent;
  7045. }
  7046. }
  7047. // destroy old node
  7048. if (isDef(parentElm)) {
  7049. removeVnodes([oldVnode], 0, 0);
  7050. }
  7051. else if (isDef(oldVnode.tag)) {
  7052. invokeDestroyHook(oldVnode);
  7053. }
  7054. }
  7055. }
  7056. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  7057. return vnode.elm;
  7058. };
  7059. }
  7060. var directives = {
  7061. create: updateDirectives,
  7062. update: updateDirectives,
  7063. destroy: function unbindDirectives(vnode) {
  7064. // @ts-expect-error emptyNode is not VNodeWithData
  7065. updateDirectives(vnode, emptyNode);
  7066. }
  7067. };
  7068. function updateDirectives(oldVnode, vnode) {
  7069. if (oldVnode.data.directives || vnode.data.directives) {
  7070. _update(oldVnode, vnode);
  7071. }
  7072. }
  7073. function _update(oldVnode, vnode) {
  7074. var isCreate = oldVnode === emptyNode;
  7075. var isDestroy = vnode === emptyNode;
  7076. var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
  7077. var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
  7078. var dirsWithInsert = [];
  7079. var dirsWithPostpatch = [];
  7080. var key, oldDir, dir;
  7081. for (key in newDirs) {
  7082. oldDir = oldDirs[key];
  7083. dir = newDirs[key];
  7084. if (!oldDir) {
  7085. // new directive, bind
  7086. callHook(dir, 'bind', vnode, oldVnode);
  7087. if (dir.def && dir.def.inserted) {
  7088. dirsWithInsert.push(dir);
  7089. }
  7090. }
  7091. else {
  7092. // existing directive, update
  7093. dir.oldValue = oldDir.value;
  7094. dir.oldArg = oldDir.arg;
  7095. callHook(dir, 'update', vnode, oldVnode);
  7096. if (dir.def && dir.def.componentUpdated) {
  7097. dirsWithPostpatch.push(dir);
  7098. }
  7099. }
  7100. }
  7101. if (dirsWithInsert.length) {
  7102. var callInsert = function () {
  7103. for (var i = 0; i < dirsWithInsert.length; i++) {
  7104. callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  7105. }
  7106. };
  7107. if (isCreate) {
  7108. mergeVNodeHook(vnode, 'insert', callInsert);
  7109. }
  7110. else {
  7111. callInsert();
  7112. }
  7113. }
  7114. if (dirsWithPostpatch.length) {
  7115. mergeVNodeHook(vnode, 'postpatch', function () {
  7116. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  7117. callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  7118. }
  7119. });
  7120. }
  7121. if (!isCreate) {
  7122. for (key in oldDirs) {
  7123. if (!newDirs[key]) {
  7124. // no longer present, unbind
  7125. callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  7126. }
  7127. }
  7128. }
  7129. }
  7130. var emptyModifiers = Object.create(null);
  7131. function normalizeDirectives(dirs, vm) {
  7132. var res = Object.create(null);
  7133. if (!dirs) {
  7134. // $flow-disable-line
  7135. return res;
  7136. }
  7137. var i, dir;
  7138. for (i = 0; i < dirs.length; i++) {
  7139. dir = dirs[i];
  7140. if (!dir.modifiers) {
  7141. // $flow-disable-line
  7142. dir.modifiers = emptyModifiers;
  7143. }
  7144. res[getRawDirName(dir)] = dir;
  7145. if (vm._setupState && vm._setupState.__sfc) {
  7146. var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
  7147. if (typeof setupDef === 'function') {
  7148. dir.def = {
  7149. bind: setupDef,
  7150. update: setupDef,
  7151. };
  7152. }
  7153. else {
  7154. dir.def = setupDef;
  7155. }
  7156. }
  7157. dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
  7158. }
  7159. // $flow-disable-line
  7160. return res;
  7161. }
  7162. function getRawDirName(dir) {
  7163. return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
  7164. }
  7165. function callHook(dir, hook, vnode, oldVnode, isDestroy) {
  7166. var fn = dir.def && dir.def[hook];
  7167. if (fn) {
  7168. try {
  7169. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  7170. }
  7171. catch (e) {
  7172. handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
  7173. }
  7174. }
  7175. }
  7176. var baseModules = [ref, directives];
  7177. function updateAttrs(oldVnode, vnode) {
  7178. var opts = vnode.componentOptions;
  7179. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  7180. return;
  7181. }
  7182. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  7183. return;
  7184. }
  7185. var key, cur, old;
  7186. var elm = vnode.elm;
  7187. var oldAttrs = oldVnode.data.attrs || {};
  7188. var attrs = vnode.data.attrs || {};
  7189. // clone observed objects, as the user probably wants to mutate it
  7190. if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
  7191. attrs = vnode.data.attrs = extend({}, attrs);
  7192. }
  7193. for (key in attrs) {
  7194. cur = attrs[key];
  7195. old = oldAttrs[key];
  7196. if (old !== cur) {
  7197. setAttr(elm, key, cur, vnode.data.pre);
  7198. }
  7199. }
  7200. // #4391: in IE9, setting type can reset value for input[type=radio]
  7201. // #6666: IE/Edge forces progress value down to 1 before setting a max
  7202. /* istanbul ignore if */
  7203. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  7204. setAttr(elm, 'value', attrs.value);
  7205. }
  7206. for (key in oldAttrs) {
  7207. if (isUndef(attrs[key])) {
  7208. if (isXlink(key)) {
  7209. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7210. }
  7211. else if (!isEnumeratedAttr(key)) {
  7212. elm.removeAttribute(key);
  7213. }
  7214. }
  7215. }
  7216. }
  7217. function setAttr(el, key, value, isInPre) {
  7218. if (isInPre || el.tagName.indexOf('-') > -1) {
  7219. baseSetAttr(el, key, value);
  7220. }
  7221. else if (isBooleanAttr(key)) {
  7222. // set attribute for blank value
  7223. // e.g. <option disabled>Select one</option>
  7224. if (isFalsyAttrValue(value)) {
  7225. el.removeAttribute(key);
  7226. }
  7227. else {
  7228. // technically allowfullscreen is a boolean attribute for <iframe>,
  7229. // but Flash expects a value of "true" when used on <embed> tag
  7230. value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
  7231. el.setAttribute(key, value);
  7232. }
  7233. }
  7234. else if (isEnumeratedAttr(key)) {
  7235. el.setAttribute(key, convertEnumeratedValue(key, value));
  7236. }
  7237. else if (isXlink(key)) {
  7238. if (isFalsyAttrValue(value)) {
  7239. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7240. }
  7241. else {
  7242. el.setAttributeNS(xlinkNS, key, value);
  7243. }
  7244. }
  7245. else {
  7246. baseSetAttr(el, key, value);
  7247. }
  7248. }
  7249. function baseSetAttr(el, key, value) {
  7250. if (isFalsyAttrValue(value)) {
  7251. el.removeAttribute(key);
  7252. }
  7253. else {
  7254. // #7138: IE10 & 11 fires input event when setting placeholder on
  7255. // <textarea>... block the first input event and remove the blocker
  7256. // immediately.
  7257. /* istanbul ignore if */
  7258. if (isIE &&
  7259. !isIE9 &&
  7260. el.tagName === 'TEXTAREA' &&
  7261. key === 'placeholder' &&
  7262. value !== '' &&
  7263. !el.__ieph) {
  7264. var blocker_1 = function (e) {
  7265. e.stopImmediatePropagation();
  7266. el.removeEventListener('input', blocker_1);
  7267. };
  7268. el.addEventListener('input', blocker_1);
  7269. // $flow-disable-line
  7270. el.__ieph = true; /* IE placeholder patched */
  7271. }
  7272. el.setAttribute(key, value);
  7273. }
  7274. }
  7275. var attrs = {
  7276. create: updateAttrs,
  7277. update: updateAttrs
  7278. };
  7279. function updateClass(oldVnode, vnode) {
  7280. var el = vnode.elm;
  7281. var data = vnode.data;
  7282. var oldData = oldVnode.data;
  7283. if (isUndef(data.staticClass) &&
  7284. isUndef(data.class) &&
  7285. (isUndef(oldData) ||
  7286. (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
  7287. return;
  7288. }
  7289. var cls = genClassForVnode(vnode);
  7290. // handle transition classes
  7291. var transitionClass = el._transitionClasses;
  7292. if (isDef(transitionClass)) {
  7293. cls = concat(cls, stringifyClass(transitionClass));
  7294. }
  7295. // set the class
  7296. if (cls !== el._prevClass) {
  7297. el.setAttribute('class', cls);
  7298. el._prevClass = cls;
  7299. }
  7300. }
  7301. var klass = {
  7302. create: updateClass,
  7303. update: updateClass
  7304. };
  7305. // in some cases, the event used has to be determined at runtime
  7306. // so we used some reserved tokens during compile.
  7307. var RANGE_TOKEN = '__r';
  7308. var CHECKBOX_RADIO_TOKEN = '__c';
  7309. // normalize v-model event tokens that can only be determined at runtime.
  7310. // it's important to place the event as the first in the array because
  7311. // the whole point is ensuring the v-model callback gets called before
  7312. // user-attached handlers.
  7313. function normalizeEvents(on) {
  7314. /* istanbul ignore if */
  7315. if (isDef(on[RANGE_TOKEN])) {
  7316. // IE input[type=range] only supports `change` event
  7317. var event_1 = isIE ? 'change' : 'input';
  7318. on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
  7319. delete on[RANGE_TOKEN];
  7320. }
  7321. // This was originally intended to fix #4521 but no longer necessary
  7322. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  7323. /* istanbul ignore if */
  7324. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  7325. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  7326. delete on[CHECKBOX_RADIO_TOKEN];
  7327. }
  7328. }
  7329. var target;
  7330. function createOnceHandler(event, handler, capture) {
  7331. var _target = target; // save current target element in closure
  7332. return function onceHandler() {
  7333. var res = handler.apply(null, arguments);
  7334. if (res !== null) {
  7335. remove(event, onceHandler, capture, _target);
  7336. }
  7337. };
  7338. }
  7339. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  7340. // implementation and does not fire microtasks in between event propagation, so
  7341. // safe to exclude.
  7342. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  7343. function add(name, handler, capture, passive) {
  7344. // async edge case #6566: inner click event triggers patch, event handler
  7345. // attached to outer element during patch, and triggered again. This
  7346. // happens because browsers fire microtask ticks between event propagation.
  7347. // the solution is simple: we save the timestamp when a handler is attached,
  7348. // and the handler would only fire if the event passed to it was fired
  7349. // AFTER it was attached.
  7350. if (useMicrotaskFix) {
  7351. var attachedTimestamp_1 = currentFlushTimestamp;
  7352. var original_1 = handler;
  7353. //@ts-expect-error
  7354. handler = original_1._wrapper = function (e) {
  7355. if (
  7356. // no bubbling, should always fire.
  7357. // this is just a safety net in case event.timeStamp is unreliable in
  7358. // certain weird environments...
  7359. e.target === e.currentTarget ||
  7360. // event is fired after handler attachment
  7361. e.timeStamp >= attachedTimestamp_1 ||
  7362. // bail for environments that have buggy event.timeStamp implementations
  7363. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  7364. // #9681 QtWebEngine event.timeStamp is negative value
  7365. e.timeStamp <= 0 ||
  7366. // #9448 bail if event is fired in another document in a multi-page
  7367. // electron/nw.js app, since event.timeStamp will be using a different
  7368. // starting reference
  7369. e.target.ownerDocument !== document) {
  7370. return original_1.apply(this, arguments);
  7371. }
  7372. };
  7373. }
  7374. target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
  7375. }
  7376. function remove(name, handler, capture, _target) {
  7377. (_target || target).removeEventListener(name,
  7378. //@ts-expect-error
  7379. handler._wrapper || handler, capture);
  7380. }
  7381. function updateDOMListeners(oldVnode, vnode) {
  7382. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  7383. return;
  7384. }
  7385. var on = vnode.data.on || {};
  7386. var oldOn = oldVnode.data.on || {};
  7387. // vnode is empty when removing all listeners,
  7388. // and use old vnode dom element
  7389. target = vnode.elm || oldVnode.elm;
  7390. normalizeEvents(on);
  7391. updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
  7392. target = undefined;
  7393. }
  7394. var events = {
  7395. create: updateDOMListeners,
  7396. update: updateDOMListeners,
  7397. // @ts-expect-error emptyNode has actually data
  7398. destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
  7399. };
  7400. var svgContainer;
  7401. function updateDOMProps(oldVnode, vnode) {
  7402. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  7403. return;
  7404. }
  7405. var key, cur;
  7406. var elm = vnode.elm;
  7407. var oldProps = oldVnode.data.domProps || {};
  7408. var props = vnode.data.domProps || {};
  7409. // clone observed objects, as the user probably wants to mutate it
  7410. if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
  7411. props = vnode.data.domProps = extend({}, props);
  7412. }
  7413. for (key in oldProps) {
  7414. if (!(key in props)) {
  7415. elm[key] = '';
  7416. }
  7417. }
  7418. for (key in props) {
  7419. cur = props[key];
  7420. // ignore children if the node has textContent or innerHTML,
  7421. // as these will throw away existing DOM nodes and cause removal errors
  7422. // on subsequent patches (#3360)
  7423. if (key === 'textContent' || key === 'innerHTML') {
  7424. if (vnode.children)
  7425. vnode.children.length = 0;
  7426. if (cur === oldProps[key])
  7427. continue;
  7428. // #6601 work around Chrome version <= 55 bug where single textNode
  7429. // replaced by innerHTML/textContent retains its parentNode property
  7430. if (elm.childNodes.length === 1) {
  7431. elm.removeChild(elm.childNodes[0]);
  7432. }
  7433. }
  7434. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  7435. // store value as _value as well since
  7436. // non-string values will be stringified
  7437. elm._value = cur;
  7438. // avoid resetting cursor position when value is the same
  7439. var strCur = isUndef(cur) ? '' : String(cur);
  7440. if (shouldUpdateValue(elm, strCur)) {
  7441. elm.value = strCur;
  7442. }
  7443. }
  7444. else if (key === 'innerHTML' &&
  7445. isSVG(elm.tagName) &&
  7446. isUndef(elm.innerHTML)) {
  7447. // IE doesn't support innerHTML for SVG elements
  7448. svgContainer = svgContainer || document.createElement('div');
  7449. svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
  7450. var svg = svgContainer.firstChild;
  7451. while (elm.firstChild) {
  7452. elm.removeChild(elm.firstChild);
  7453. }
  7454. while (svg.firstChild) {
  7455. elm.appendChild(svg.firstChild);
  7456. }
  7457. }
  7458. else if (
  7459. // skip the update if old and new VDOM state is the same.
  7460. // `value` is handled separately because the DOM value may be temporarily
  7461. // out of sync with VDOM state due to focus, composition and modifiers.
  7462. // This #4521 by skipping the unnecessary `checked` update.
  7463. cur !== oldProps[key]) {
  7464. // some property updates can throw
  7465. // e.g. `value` on <progress> w/ non-finite value
  7466. try {
  7467. elm[key] = cur;
  7468. }
  7469. catch (e) { }
  7470. }
  7471. }
  7472. }
  7473. function shouldUpdateValue(elm, checkVal) {
  7474. return (
  7475. //@ts-expect-error
  7476. !elm.composing &&
  7477. (elm.tagName === 'OPTION' ||
  7478. isNotInFocusAndDirty(elm, checkVal) ||
  7479. isDirtyWithModifiers(elm, checkVal)));
  7480. }
  7481. function isNotInFocusAndDirty(elm, checkVal) {
  7482. // return true when textbox (.number and .trim) loses focus and its value is
  7483. // not equal to the updated value
  7484. var notInFocus = true;
  7485. // #6157
  7486. // work around IE bug when accessing document.activeElement in an iframe
  7487. try {
  7488. notInFocus = document.activeElement !== elm;
  7489. }
  7490. catch (e) { }
  7491. return notInFocus && elm.value !== checkVal;
  7492. }
  7493. function isDirtyWithModifiers(elm, newVal) {
  7494. var value = elm.value;
  7495. var modifiers = elm._vModifiers; // injected by v-model runtime
  7496. if (isDef(modifiers)) {
  7497. if (modifiers.number) {
  7498. return toNumber(value) !== toNumber(newVal);
  7499. }
  7500. if (modifiers.trim) {
  7501. return value.trim() !== newVal.trim();
  7502. }
  7503. }
  7504. return value !== newVal;
  7505. }
  7506. var domProps = {
  7507. create: updateDOMProps,
  7508. update: updateDOMProps
  7509. };
  7510. var parseStyleText = cached(function (cssText) {
  7511. var res = {};
  7512. var listDelimiter = /;(?![^(]*\))/g;
  7513. var propertyDelimiter = /:(.+)/;
  7514. cssText.split(listDelimiter).forEach(function (item) {
  7515. if (item) {
  7516. var tmp = item.split(propertyDelimiter);
  7517. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7518. }
  7519. });
  7520. return res;
  7521. });
  7522. // merge static and dynamic style data on the same vnode
  7523. function normalizeStyleData(data) {
  7524. var style = normalizeStyleBinding(data.style);
  7525. // static style is pre-processed into an object during compilation
  7526. // and is always a fresh object, so it's safe to merge into it
  7527. return data.staticStyle ? extend(data.staticStyle, style) : style;
  7528. }
  7529. // normalize possible array / string values into Object
  7530. function normalizeStyleBinding(bindingStyle) {
  7531. if (Array.isArray(bindingStyle)) {
  7532. return toObject(bindingStyle);
  7533. }
  7534. if (typeof bindingStyle === 'string') {
  7535. return parseStyleText(bindingStyle);
  7536. }
  7537. return bindingStyle;
  7538. }
  7539. /**
  7540. * parent component style should be after child's
  7541. * so that parent component's style could override it
  7542. */
  7543. function getStyle(vnode, checkChild) {
  7544. var res = {};
  7545. var styleData;
  7546. if (checkChild) {
  7547. var childNode = vnode;
  7548. while (childNode.componentInstance) {
  7549. childNode = childNode.componentInstance._vnode;
  7550. if (childNode &&
  7551. childNode.data &&
  7552. (styleData = normalizeStyleData(childNode.data))) {
  7553. extend(res, styleData);
  7554. }
  7555. }
  7556. }
  7557. if ((styleData = normalizeStyleData(vnode.data))) {
  7558. extend(res, styleData);
  7559. }
  7560. var parentNode = vnode;
  7561. // @ts-expect-error parentNode.parent not VNodeWithData
  7562. while ((parentNode = parentNode.parent)) {
  7563. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  7564. extend(res, styleData);
  7565. }
  7566. }
  7567. return res;
  7568. }
  7569. var cssVarRE = /^--/;
  7570. var importantRE = /\s*!important$/;
  7571. var setProp = function (el, name, val) {
  7572. /* istanbul ignore if */
  7573. if (cssVarRE.test(name)) {
  7574. el.style.setProperty(name, val);
  7575. }
  7576. else if (importantRE.test(val)) {
  7577. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  7578. }
  7579. else {
  7580. var normalizedName = normalize(name);
  7581. if (Array.isArray(val)) {
  7582. // Support values array created by autoprefixer, e.g.
  7583. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  7584. // Set them one by one, and the browser will only set those it can recognize
  7585. for (var i = 0, len = val.length; i < len; i++) {
  7586. el.style[normalizedName] = val[i];
  7587. }
  7588. }
  7589. else {
  7590. el.style[normalizedName] = val;
  7591. }
  7592. }
  7593. };
  7594. var vendorNames = ['Webkit', 'Moz', 'ms'];
  7595. var emptyStyle;
  7596. var normalize = cached(function (prop) {
  7597. emptyStyle = emptyStyle || document.createElement('div').style;
  7598. prop = camelize(prop);
  7599. if (prop !== 'filter' && prop in emptyStyle) {
  7600. return prop;
  7601. }
  7602. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  7603. for (var i = 0; i < vendorNames.length; i++) {
  7604. var name_1 = vendorNames[i] + capName;
  7605. if (name_1 in emptyStyle) {
  7606. return name_1;
  7607. }
  7608. }
  7609. });
  7610. function updateStyle(oldVnode, vnode) {
  7611. var data = vnode.data;
  7612. var oldData = oldVnode.data;
  7613. if (isUndef(data.staticStyle) &&
  7614. isUndef(data.style) &&
  7615. isUndef(oldData.staticStyle) &&
  7616. isUndef(oldData.style)) {
  7617. return;
  7618. }
  7619. var cur, name;
  7620. var el = vnode.elm;
  7621. var oldStaticStyle = oldData.staticStyle;
  7622. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  7623. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  7624. var oldStyle = oldStaticStyle || oldStyleBinding;
  7625. var style = normalizeStyleBinding(vnode.data.style) || {};
  7626. // store normalized style under a different key for next diff
  7627. // make sure to clone it if it's reactive, since the user likely wants
  7628. // to mutate it.
  7629. vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
  7630. var newStyle = getStyle(vnode, true);
  7631. for (name in oldStyle) {
  7632. if (isUndef(newStyle[name])) {
  7633. setProp(el, name, '');
  7634. }
  7635. }
  7636. for (name in newStyle) {
  7637. cur = newStyle[name];
  7638. if (cur !== oldStyle[name]) {
  7639. // ie9 setting to null has no effect, must use empty string
  7640. setProp(el, name, cur == null ? '' : cur);
  7641. }
  7642. }
  7643. }
  7644. var style = {
  7645. create: updateStyle,
  7646. update: updateStyle
  7647. };
  7648. var whitespaceRE = /\s+/;
  7649. /**
  7650. * Add class with compatibility for SVG since classList is not supported on
  7651. * SVG elements in IE
  7652. */
  7653. function addClass(el, cls) {
  7654. /* istanbul ignore if */
  7655. if (!cls || !(cls = cls.trim())) {
  7656. return;
  7657. }
  7658. /* istanbul ignore else */
  7659. if (el.classList) {
  7660. if (cls.indexOf(' ') > -1) {
  7661. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  7662. }
  7663. else {
  7664. el.classList.add(cls);
  7665. }
  7666. }
  7667. else {
  7668. var cur = " ".concat(el.getAttribute('class') || '', " ");
  7669. if (cur.indexOf(' ' + cls + ' ') < 0) {
  7670. el.setAttribute('class', (cur + cls).trim());
  7671. }
  7672. }
  7673. }
  7674. /**
  7675. * Remove class with compatibility for SVG since classList is not supported on
  7676. * SVG elements in IE
  7677. */
  7678. function removeClass(el, cls) {
  7679. /* istanbul ignore if */
  7680. if (!cls || !(cls = cls.trim())) {
  7681. return;
  7682. }
  7683. /* istanbul ignore else */
  7684. if (el.classList) {
  7685. if (cls.indexOf(' ') > -1) {
  7686. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  7687. }
  7688. else {
  7689. el.classList.remove(cls);
  7690. }
  7691. if (!el.classList.length) {
  7692. el.removeAttribute('class');
  7693. }
  7694. }
  7695. else {
  7696. var cur = " ".concat(el.getAttribute('class') || '', " ");
  7697. var tar = ' ' + cls + ' ';
  7698. while (cur.indexOf(tar) >= 0) {
  7699. cur = cur.replace(tar, ' ');
  7700. }
  7701. cur = cur.trim();
  7702. if (cur) {
  7703. el.setAttribute('class', cur);
  7704. }
  7705. else {
  7706. el.removeAttribute('class');
  7707. }
  7708. }
  7709. }
  7710. function resolveTransition(def) {
  7711. if (!def) {
  7712. return;
  7713. }
  7714. /* istanbul ignore else */
  7715. if (typeof def === 'object') {
  7716. var res = {};
  7717. if (def.css !== false) {
  7718. extend(res, autoCssTransition(def.name || 'v'));
  7719. }
  7720. extend(res, def);
  7721. return res;
  7722. }
  7723. else if (typeof def === 'string') {
  7724. return autoCssTransition(def);
  7725. }
  7726. }
  7727. var autoCssTransition = cached(function (name) {
  7728. return {
  7729. enterClass: "".concat(name, "-enter"),
  7730. enterToClass: "".concat(name, "-enter-to"),
  7731. enterActiveClass: "".concat(name, "-enter-active"),
  7732. leaveClass: "".concat(name, "-leave"),
  7733. leaveToClass: "".concat(name, "-leave-to"),
  7734. leaveActiveClass: "".concat(name, "-leave-active")
  7735. };
  7736. });
  7737. var hasTransition = inBrowser && !isIE9;
  7738. var TRANSITION = 'transition';
  7739. var ANIMATION = 'animation';
  7740. // Transition property/event sniffing
  7741. var transitionProp = 'transition';
  7742. var transitionEndEvent = 'transitionend';
  7743. var animationProp = 'animation';
  7744. var animationEndEvent = 'animationend';
  7745. if (hasTransition) {
  7746. /* istanbul ignore if */
  7747. if (window.ontransitionend === undefined &&
  7748. window.onwebkittransitionend !== undefined) {
  7749. transitionProp = 'WebkitTransition';
  7750. transitionEndEvent = 'webkitTransitionEnd';
  7751. }
  7752. if (window.onanimationend === undefined &&
  7753. window.onwebkitanimationend !== undefined) {
  7754. animationProp = 'WebkitAnimation';
  7755. animationEndEvent = 'webkitAnimationEnd';
  7756. }
  7757. }
  7758. // binding to window is necessary to make hot reload work in IE in strict mode
  7759. var raf = inBrowser
  7760. ? window.requestAnimationFrame
  7761. ? window.requestAnimationFrame.bind(window)
  7762. : setTimeout
  7763. : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
  7764. function nextFrame(fn) {
  7765. raf(function () {
  7766. // @ts-expect-error
  7767. raf(fn);
  7768. });
  7769. }
  7770. function addTransitionClass(el, cls) {
  7771. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  7772. if (transitionClasses.indexOf(cls) < 0) {
  7773. transitionClasses.push(cls);
  7774. addClass(el, cls);
  7775. }
  7776. }
  7777. function removeTransitionClass(el, cls) {
  7778. if (el._transitionClasses) {
  7779. remove$2(el._transitionClasses, cls);
  7780. }
  7781. removeClass(el, cls);
  7782. }
  7783. function whenTransitionEnds(el, expectedType, cb) {
  7784. var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
  7785. if (!type)
  7786. return cb();
  7787. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  7788. var ended = 0;
  7789. var end = function () {
  7790. el.removeEventListener(event, onEnd);
  7791. cb();
  7792. };
  7793. var onEnd = function (e) {
  7794. if (e.target === el) {
  7795. if (++ended >= propCount) {
  7796. end();
  7797. }
  7798. }
  7799. };
  7800. setTimeout(function () {
  7801. if (ended < propCount) {
  7802. end();
  7803. }
  7804. }, timeout + 1);
  7805. el.addEventListener(event, onEnd);
  7806. }
  7807. var transformRE = /\b(transform|all)(,|$)/;
  7808. function getTransitionInfo(el, expectedType) {
  7809. var styles = window.getComputedStyle(el);
  7810. // JSDOM may return undefined for transition properties
  7811. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  7812. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  7813. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  7814. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  7815. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  7816. var animationTimeout = getTimeout(animationDelays, animationDurations);
  7817. var type;
  7818. var timeout = 0;
  7819. var propCount = 0;
  7820. /* istanbul ignore if */
  7821. if (expectedType === TRANSITION) {
  7822. if (transitionTimeout > 0) {
  7823. type = TRANSITION;
  7824. timeout = transitionTimeout;
  7825. propCount = transitionDurations.length;
  7826. }
  7827. }
  7828. else if (expectedType === ANIMATION) {
  7829. if (animationTimeout > 0) {
  7830. type = ANIMATION;
  7831. timeout = animationTimeout;
  7832. propCount = animationDurations.length;
  7833. }
  7834. }
  7835. else {
  7836. timeout = Math.max(transitionTimeout, animationTimeout);
  7837. type =
  7838. timeout > 0
  7839. ? transitionTimeout > animationTimeout
  7840. ? TRANSITION
  7841. : ANIMATION
  7842. : null;
  7843. propCount = type
  7844. ? type === TRANSITION
  7845. ? transitionDurations.length
  7846. : animationDurations.length
  7847. : 0;
  7848. }
  7849. var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
  7850. return {
  7851. type: type,
  7852. timeout: timeout,
  7853. propCount: propCount,
  7854. hasTransform: hasTransform
  7855. };
  7856. }
  7857. function getTimeout(delays, durations) {
  7858. /* istanbul ignore next */
  7859. while (delays.length < durations.length) {
  7860. delays = delays.concat(delays);
  7861. }
  7862. return Math.max.apply(null, durations.map(function (d, i) {
  7863. return toMs(d) + toMs(delays[i]);
  7864. }));
  7865. }
  7866. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  7867. // in a locale-dependent way, using a comma instead of a dot.
  7868. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  7869. // as a floor function) causing unexpected behaviors
  7870. function toMs(s) {
  7871. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  7872. }
  7873. function enter(vnode, toggleDisplay) {
  7874. var el = vnode.elm;
  7875. // call leave callback now
  7876. if (isDef(el._leaveCb)) {
  7877. el._leaveCb.cancelled = true;
  7878. el._leaveCb();
  7879. }
  7880. var data = resolveTransition(vnode.data.transition);
  7881. if (isUndef(data)) {
  7882. return;
  7883. }
  7884. /* istanbul ignore if */
  7885. if (isDef(el._enterCb) || el.nodeType !== 1) {
  7886. return;
  7887. }
  7888. var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
  7889. // activeInstance will always be the <transition> component managing this
  7890. // transition. One edge case to check is when the <transition> is placed
  7891. // as the root node of a child component. In that case we need to check
  7892. // <transition>'s parent for appear check.
  7893. var context = activeInstance;
  7894. var transitionNode = activeInstance.$vnode;
  7895. while (transitionNode && transitionNode.parent) {
  7896. context = transitionNode.context;
  7897. transitionNode = transitionNode.parent;
  7898. }
  7899. var isAppear = !context._isMounted || !vnode.isRootInsert;
  7900. if (isAppear && !appear && appear !== '') {
  7901. return;
  7902. }
  7903. var startClass = isAppear && appearClass ? appearClass : enterClass;
  7904. var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
  7905. var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
  7906. var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
  7907. var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
  7908. var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
  7909. var enterCancelledHook = isAppear
  7910. ? appearCancelled || enterCancelled
  7911. : enterCancelled;
  7912. var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
  7913. if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
  7914. checkDuration(explicitEnterDuration, 'enter', vnode);
  7915. }
  7916. var expectsCSS = css !== false && !isIE9;
  7917. var userWantsControl = getHookArgumentsLength(enterHook);
  7918. var cb = (el._enterCb = once(function () {
  7919. if (expectsCSS) {
  7920. removeTransitionClass(el, toClass);
  7921. removeTransitionClass(el, activeClass);
  7922. }
  7923. // @ts-expect-error
  7924. if (cb.cancelled) {
  7925. if (expectsCSS) {
  7926. removeTransitionClass(el, startClass);
  7927. }
  7928. enterCancelledHook && enterCancelledHook(el);
  7929. }
  7930. else {
  7931. afterEnterHook && afterEnterHook(el);
  7932. }
  7933. el._enterCb = null;
  7934. }));
  7935. if (!vnode.data.show) {
  7936. // remove pending leave element on enter by injecting an insert hook
  7937. mergeVNodeHook(vnode, 'insert', function () {
  7938. var parent = el.parentNode;
  7939. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  7940. if (pendingNode &&
  7941. pendingNode.tag === vnode.tag &&
  7942. pendingNode.elm._leaveCb) {
  7943. pendingNode.elm._leaveCb();
  7944. }
  7945. enterHook && enterHook(el, cb);
  7946. });
  7947. }
  7948. // start enter transition
  7949. beforeEnterHook && beforeEnterHook(el);
  7950. if (expectsCSS) {
  7951. addTransitionClass(el, startClass);
  7952. addTransitionClass(el, activeClass);
  7953. nextFrame(function () {
  7954. removeTransitionClass(el, startClass);
  7955. // @ts-expect-error
  7956. if (!cb.cancelled) {
  7957. addTransitionClass(el, toClass);
  7958. if (!userWantsControl) {
  7959. if (isValidDuration(explicitEnterDuration)) {
  7960. setTimeout(cb, explicitEnterDuration);
  7961. }
  7962. else {
  7963. whenTransitionEnds(el, type, cb);
  7964. }
  7965. }
  7966. }
  7967. });
  7968. }
  7969. if (vnode.data.show) {
  7970. toggleDisplay && toggleDisplay();
  7971. enterHook && enterHook(el, cb);
  7972. }
  7973. if (!expectsCSS && !userWantsControl) {
  7974. cb();
  7975. }
  7976. }
  7977. function leave(vnode, rm) {
  7978. var el = vnode.elm;
  7979. // call enter callback now
  7980. if (isDef(el._enterCb)) {
  7981. el._enterCb.cancelled = true;
  7982. el._enterCb();
  7983. }
  7984. var data = resolveTransition(vnode.data.transition);
  7985. if (isUndef(data) || el.nodeType !== 1) {
  7986. return rm();
  7987. }
  7988. /* istanbul ignore if */
  7989. if (isDef(el._leaveCb)) {
  7990. return;
  7991. }
  7992. var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
  7993. var expectsCSS = css !== false && !isIE9;
  7994. var userWantsControl = getHookArgumentsLength(leave);
  7995. var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
  7996. if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
  7997. checkDuration(explicitLeaveDuration, 'leave', vnode);
  7998. }
  7999. var cb = (el._leaveCb = once(function () {
  8000. if (el.parentNode && el.parentNode._pending) {
  8001. el.parentNode._pending[vnode.key] = null;
  8002. }
  8003. if (expectsCSS) {
  8004. removeTransitionClass(el, leaveToClass);
  8005. removeTransitionClass(el, leaveActiveClass);
  8006. }
  8007. // @ts-expect-error
  8008. if (cb.cancelled) {
  8009. if (expectsCSS) {
  8010. removeTransitionClass(el, leaveClass);
  8011. }
  8012. leaveCancelled && leaveCancelled(el);
  8013. }
  8014. else {
  8015. rm();
  8016. afterLeave && afterLeave(el);
  8017. }
  8018. el._leaveCb = null;
  8019. }));
  8020. if (delayLeave) {
  8021. delayLeave(performLeave);
  8022. }
  8023. else {
  8024. performLeave();
  8025. }
  8026. function performLeave() {
  8027. // the delayed leave may have already been cancelled
  8028. // @ts-expect-error
  8029. if (cb.cancelled) {
  8030. return;
  8031. }
  8032. // record leaving element
  8033. if (!vnode.data.show && el.parentNode) {
  8034. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
  8035. vnode;
  8036. }
  8037. beforeLeave && beforeLeave(el);
  8038. if (expectsCSS) {
  8039. addTransitionClass(el, leaveClass);
  8040. addTransitionClass(el, leaveActiveClass);
  8041. nextFrame(function () {
  8042. removeTransitionClass(el, leaveClass);
  8043. // @ts-expect-error
  8044. if (!cb.cancelled) {
  8045. addTransitionClass(el, leaveToClass);
  8046. if (!userWantsControl) {
  8047. if (isValidDuration(explicitLeaveDuration)) {
  8048. setTimeout(cb, explicitLeaveDuration);
  8049. }
  8050. else {
  8051. whenTransitionEnds(el, type, cb);
  8052. }
  8053. }
  8054. }
  8055. });
  8056. }
  8057. leave && leave(el, cb);
  8058. if (!expectsCSS && !userWantsControl) {
  8059. cb();
  8060. }
  8061. }
  8062. }
  8063. // only used in dev mode
  8064. function checkDuration(val, name, vnode) {
  8065. if (typeof val !== 'number') {
  8066. warn("<transition> explicit ".concat(name, " duration is not a valid number - ") +
  8067. "got ".concat(JSON.stringify(val), "."), vnode.context);
  8068. }
  8069. else if (isNaN(val)) {
  8070. warn("<transition> explicit ".concat(name, " duration is NaN - ") +
  8071. 'the duration expression might be incorrect.', vnode.context);
  8072. }
  8073. }
  8074. function isValidDuration(val) {
  8075. return typeof val === 'number' && !isNaN(val);
  8076. }
  8077. /**
  8078. * Normalize a transition hook's argument length. The hook may be:
  8079. * - a merged hook (invoker) with the original in .fns
  8080. * - a wrapped component method (check ._length)
  8081. * - a plain function (.length)
  8082. */
  8083. function getHookArgumentsLength(fn) {
  8084. if (isUndef(fn)) {
  8085. return false;
  8086. }
  8087. // @ts-expect-error
  8088. var invokerFns = fn.fns;
  8089. if (isDef(invokerFns)) {
  8090. // invoker
  8091. return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
  8092. }
  8093. else {
  8094. // @ts-expect-error
  8095. return (fn._length || fn.length) > 1;
  8096. }
  8097. }
  8098. function _enter(_, vnode) {
  8099. if (vnode.data.show !== true) {
  8100. enter(vnode);
  8101. }
  8102. }
  8103. var transition = inBrowser
  8104. ? {
  8105. create: _enter,
  8106. activate: _enter,
  8107. remove: function (vnode, rm) {
  8108. /* istanbul ignore else */
  8109. if (vnode.data.show !== true) {
  8110. // @ts-expect-error
  8111. leave(vnode, rm);
  8112. }
  8113. else {
  8114. rm();
  8115. }
  8116. }
  8117. }
  8118. : {};
  8119. var platformModules = [attrs, klass, events, domProps, style, transition];
  8120. // the directive module should be applied last, after all
  8121. // built-in modules have been applied.
  8122. var modules = platformModules.concat(baseModules);
  8123. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  8124. /**
  8125. * Not type checking this file because flow doesn't like attaching
  8126. * properties to Elements.
  8127. */
  8128. /* istanbul ignore if */
  8129. if (isIE9) {
  8130. // http://www.matts411.com/post/internet-explorer-9-oninput/
  8131. document.addEventListener('selectionchange', function () {
  8132. var el = document.activeElement;
  8133. // @ts-expect-error
  8134. if (el && el.vmodel) {
  8135. trigger(el, 'input');
  8136. }
  8137. });
  8138. }
  8139. var directive = {
  8140. inserted: function (el, binding, vnode, oldVnode) {
  8141. if (vnode.tag === 'select') {
  8142. // #6903
  8143. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  8144. mergeVNodeHook(vnode, 'postpatch', function () {
  8145. directive.componentUpdated(el, binding, vnode);
  8146. });
  8147. }
  8148. else {
  8149. setSelected(el, binding, vnode.context);
  8150. }
  8151. el._vOptions = [].map.call(el.options, getValue);
  8152. }
  8153. else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  8154. el._vModifiers = binding.modifiers;
  8155. if (!binding.modifiers.lazy) {
  8156. el.addEventListener('compositionstart', onCompositionStart);
  8157. el.addEventListener('compositionend', onCompositionEnd);
  8158. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  8159. // switching focus before confirming composition choice
  8160. // this also fixes the issue where some browsers e.g. iOS Chrome
  8161. // fires "change" instead of "input" on autocomplete.
  8162. el.addEventListener('change', onCompositionEnd);
  8163. /* istanbul ignore if */
  8164. if (isIE9) {
  8165. el.vmodel = true;
  8166. }
  8167. }
  8168. }
  8169. },
  8170. componentUpdated: function (el, binding, vnode) {
  8171. if (vnode.tag === 'select') {
  8172. setSelected(el, binding, vnode.context);
  8173. // in case the options rendered by v-for have changed,
  8174. // it's possible that the value is out-of-sync with the rendered options.
  8175. // detect such cases and filter out values that no longer has a matching
  8176. // option in the DOM.
  8177. var prevOptions_1 = el._vOptions;
  8178. var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
  8179. if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
  8180. // trigger change event if
  8181. // no matching option found for at least one value
  8182. var needReset = el.multiple
  8183. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
  8184. : binding.value !== binding.oldValue &&
  8185. hasNoMatchingOption(binding.value, curOptions_1);
  8186. if (needReset) {
  8187. trigger(el, 'change');
  8188. }
  8189. }
  8190. }
  8191. }
  8192. };
  8193. function setSelected(el, binding, vm) {
  8194. actuallySetSelected(el, binding, vm);
  8195. /* istanbul ignore if */
  8196. if (isIE || isEdge) {
  8197. setTimeout(function () {
  8198. actuallySetSelected(el, binding, vm);
  8199. }, 0);
  8200. }
  8201. }
  8202. function actuallySetSelected(el, binding, vm) {
  8203. var value = binding.value;
  8204. var isMultiple = el.multiple;
  8205. if (isMultiple && !Array.isArray(value)) {
  8206. process.env.NODE_ENV !== 'production' &&
  8207. warn("<select multiple v-model=\"".concat(binding.expression, "\"> ") +
  8208. "expects an Array value for its binding, but got ".concat(Object.prototype.toString
  8209. .call(value)
  8210. .slice(8, -1)), vm);
  8211. return;
  8212. }
  8213. var selected, option;
  8214. for (var i = 0, l = el.options.length; i < l; i++) {
  8215. option = el.options[i];
  8216. if (isMultiple) {
  8217. selected = looseIndexOf(value, getValue(option)) > -1;
  8218. if (option.selected !== selected) {
  8219. option.selected = selected;
  8220. }
  8221. }
  8222. else {
  8223. if (looseEqual(getValue(option), value)) {
  8224. if (el.selectedIndex !== i) {
  8225. el.selectedIndex = i;
  8226. }
  8227. return;
  8228. }
  8229. }
  8230. }
  8231. if (!isMultiple) {
  8232. el.selectedIndex = -1;
  8233. }
  8234. }
  8235. function hasNoMatchingOption(value, options) {
  8236. return options.every(function (o) { return !looseEqual(o, value); });
  8237. }
  8238. function getValue(option) {
  8239. return '_value' in option ? option._value : option.value;
  8240. }
  8241. function onCompositionStart(e) {
  8242. e.target.composing = true;
  8243. }
  8244. function onCompositionEnd(e) {
  8245. // prevent triggering an input event for no reason
  8246. if (!e.target.composing)
  8247. return;
  8248. e.target.composing = false;
  8249. trigger(e.target, 'input');
  8250. }
  8251. function trigger(el, type) {
  8252. var e = document.createEvent('HTMLEvents');
  8253. e.initEvent(type, true, true);
  8254. el.dispatchEvent(e);
  8255. }
  8256. // recursively search for possible transition defined inside the component root
  8257. function locateNode(vnode) {
  8258. // @ts-expect-error
  8259. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  8260. ? locateNode(vnode.componentInstance._vnode)
  8261. : vnode;
  8262. }
  8263. var show = {
  8264. bind: function (el, _a, vnode) {
  8265. var value = _a.value;
  8266. vnode = locateNode(vnode);
  8267. var transition = vnode.data && vnode.data.transition;
  8268. var originalDisplay = (el.__vOriginalDisplay =
  8269. el.style.display === 'none' ? '' : el.style.display);
  8270. if (value && transition) {
  8271. vnode.data.show = true;
  8272. enter(vnode, function () {
  8273. el.style.display = originalDisplay;
  8274. });
  8275. }
  8276. else {
  8277. el.style.display = value ? originalDisplay : 'none';
  8278. }
  8279. },
  8280. update: function (el, _a, vnode) {
  8281. var value = _a.value, oldValue = _a.oldValue;
  8282. /* istanbul ignore if */
  8283. if (!value === !oldValue)
  8284. return;
  8285. vnode = locateNode(vnode);
  8286. var transition = vnode.data && vnode.data.transition;
  8287. if (transition) {
  8288. vnode.data.show = true;
  8289. if (value) {
  8290. enter(vnode, function () {
  8291. el.style.display = el.__vOriginalDisplay;
  8292. });
  8293. }
  8294. else {
  8295. leave(vnode, function () {
  8296. el.style.display = 'none';
  8297. });
  8298. }
  8299. }
  8300. else {
  8301. el.style.display = value ? el.__vOriginalDisplay : 'none';
  8302. }
  8303. },
  8304. unbind: function (el, binding, vnode, oldVnode, isDestroy) {
  8305. if (!isDestroy) {
  8306. el.style.display = el.__vOriginalDisplay;
  8307. }
  8308. }
  8309. };
  8310. var platformDirectives = {
  8311. model: directive,
  8312. show: show
  8313. };
  8314. // Provides transition support for a single element/component.
  8315. var transitionProps = {
  8316. name: String,
  8317. appear: Boolean,
  8318. css: Boolean,
  8319. mode: String,
  8320. type: String,
  8321. enterClass: String,
  8322. leaveClass: String,
  8323. enterToClass: String,
  8324. leaveToClass: String,
  8325. enterActiveClass: String,
  8326. leaveActiveClass: String,
  8327. appearClass: String,
  8328. appearActiveClass: String,
  8329. appearToClass: String,
  8330. duration: [Number, String, Object]
  8331. };
  8332. // in case the child is also an abstract component, e.g. <keep-alive>
  8333. // we want to recursively retrieve the real component to be rendered
  8334. function getRealChild(vnode) {
  8335. var compOptions = vnode && vnode.componentOptions;
  8336. if (compOptions && compOptions.Ctor.options.abstract) {
  8337. return getRealChild(getFirstComponentChild(compOptions.children));
  8338. }
  8339. else {
  8340. return vnode;
  8341. }
  8342. }
  8343. function extractTransitionData(comp) {
  8344. var data = {};
  8345. var options = comp.$options;
  8346. // props
  8347. for (var key in options.propsData) {
  8348. data[key] = comp[key];
  8349. }
  8350. // events.
  8351. // extract listeners and pass them directly to the transition methods
  8352. var listeners = options._parentListeners;
  8353. for (var key in listeners) {
  8354. data[camelize(key)] = listeners[key];
  8355. }
  8356. return data;
  8357. }
  8358. function placeholder(h, rawChild) {
  8359. // @ts-expect-error
  8360. if (/\d-keep-alive$/.test(rawChild.tag)) {
  8361. return h('keep-alive', {
  8362. props: rawChild.componentOptions.propsData
  8363. });
  8364. }
  8365. }
  8366. function hasParentTransition(vnode) {
  8367. while ((vnode = vnode.parent)) {
  8368. if (vnode.data.transition) {
  8369. return true;
  8370. }
  8371. }
  8372. }
  8373. function isSameChild(child, oldChild) {
  8374. return oldChild.key === child.key && oldChild.tag === child.tag;
  8375. }
  8376. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  8377. var isVShowDirective = function (d) { return d.name === 'show'; };
  8378. var Transition = {
  8379. name: 'transition',
  8380. props: transitionProps,
  8381. abstract: true,
  8382. render: function (h) {
  8383. var _this = this;
  8384. var children = this.$slots.default;
  8385. if (!children) {
  8386. return;
  8387. }
  8388. // filter out text nodes (possible whitespaces)
  8389. children = children.filter(isNotTextNode);
  8390. /* istanbul ignore if */
  8391. if (!children.length) {
  8392. return;
  8393. }
  8394. // warn multiple elements
  8395. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  8396. warn('<transition> can only be used on a single element. Use ' +
  8397. '<transition-group> for lists.', this.$parent);
  8398. }
  8399. var mode = this.mode;
  8400. // warn invalid mode
  8401. if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') {
  8402. warn('invalid <transition> mode: ' + mode, this.$parent);
  8403. }
  8404. var rawChild = children[0];
  8405. // if this is a component root node and the component's
  8406. // parent container node also has transition, skip.
  8407. if (hasParentTransition(this.$vnode)) {
  8408. return rawChild;
  8409. }
  8410. // apply transition data to child
  8411. // use getRealChild() to ignore abstract components e.g. keep-alive
  8412. var child = getRealChild(rawChild);
  8413. /* istanbul ignore if */
  8414. if (!child) {
  8415. return rawChild;
  8416. }
  8417. if (this._leaving) {
  8418. return placeholder(h, rawChild);
  8419. }
  8420. // ensure a key that is unique to the vnode type and to this transition
  8421. // component instance. This key will be used to remove pending leaving nodes
  8422. // during entering.
  8423. var id = "__transition-".concat(this._uid, "-");
  8424. child.key =
  8425. child.key == null
  8426. ? child.isComment
  8427. ? id + 'comment'
  8428. : id + child.tag
  8429. : isPrimitive(child.key)
  8430. ? String(child.key).indexOf(id) === 0
  8431. ? child.key
  8432. : id + child.key
  8433. : child.key;
  8434. var data = ((child.data || (child.data = {})).transition =
  8435. extractTransitionData(this));
  8436. var oldRawChild = this._vnode;
  8437. var oldChild = getRealChild(oldRawChild);
  8438. // mark v-show
  8439. // so that the transition module can hand over the control to the directive
  8440. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  8441. child.data.show = true;
  8442. }
  8443. if (oldChild &&
  8444. oldChild.data &&
  8445. !isSameChild(child, oldChild) &&
  8446. !isAsyncPlaceholder(oldChild) &&
  8447. // #6687 component root is a comment node
  8448. !(oldChild.componentInstance &&
  8449. oldChild.componentInstance._vnode.isComment)) {
  8450. // replace old child transition data with fresh one
  8451. // important for dynamic transitions!
  8452. var oldData = (oldChild.data.transition = extend({}, data));
  8453. // handle transition mode
  8454. if (mode === 'out-in') {
  8455. // return placeholder node and queue update when leave finishes
  8456. this._leaving = true;
  8457. mergeVNodeHook(oldData, 'afterLeave', function () {
  8458. _this._leaving = false;
  8459. _this.$forceUpdate();
  8460. });
  8461. return placeholder(h, rawChild);
  8462. }
  8463. else if (mode === 'in-out') {
  8464. if (isAsyncPlaceholder(child)) {
  8465. return oldRawChild;
  8466. }
  8467. var delayedLeave_1;
  8468. var performLeave = function () {
  8469. delayedLeave_1();
  8470. };
  8471. mergeVNodeHook(data, 'afterEnter', performLeave);
  8472. mergeVNodeHook(data, 'enterCancelled', performLeave);
  8473. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  8474. delayedLeave_1 = leave;
  8475. });
  8476. }
  8477. }
  8478. return rawChild;
  8479. }
  8480. };
  8481. // Provides transition support for list items.
  8482. var props = extend({
  8483. tag: String,
  8484. moveClass: String
  8485. }, transitionProps);
  8486. delete props.mode;
  8487. var TransitionGroup = {
  8488. props: props,
  8489. beforeMount: function () {
  8490. var _this = this;
  8491. var update = this._update;
  8492. this._update = function (vnode, hydrating) {
  8493. var restoreActiveInstance = setActiveInstance(_this);
  8494. // force removing pass
  8495. _this.__patch__(_this._vnode, _this.kept, false, // hydrating
  8496. true // removeOnly (!important, avoids unnecessary moves)
  8497. );
  8498. _this._vnode = _this.kept;
  8499. restoreActiveInstance();
  8500. update.call(_this, vnode, hydrating);
  8501. };
  8502. },
  8503. render: function (h) {
  8504. var tag = this.tag || this.$vnode.data.tag || 'span';
  8505. var map = Object.create(null);
  8506. var prevChildren = (this.prevChildren = this.children);
  8507. var rawChildren = this.$slots.default || [];
  8508. var children = (this.children = []);
  8509. var transitionData = extractTransitionData(this);
  8510. for (var i = 0; i < rawChildren.length; i++) {
  8511. var c = rawChildren[i];
  8512. if (c.tag) {
  8513. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  8514. children.push(c);
  8515. map[c.key] = c;
  8516. (c.data || (c.data = {})).transition = transitionData;
  8517. }
  8518. else if (process.env.NODE_ENV !== 'production') {
  8519. var opts = c.componentOptions;
  8520. var name_1 = opts
  8521. ? getComponentName(opts.Ctor.options) || opts.tag || ''
  8522. : c.tag;
  8523. warn("<transition-group> children must be keyed: <".concat(name_1, ">"));
  8524. }
  8525. }
  8526. }
  8527. if (prevChildren) {
  8528. var kept = [];
  8529. var removed = [];
  8530. for (var i = 0; i < prevChildren.length; i++) {
  8531. var c = prevChildren[i];
  8532. c.data.transition = transitionData;
  8533. // @ts-expect-error .getBoundingClientRect is not typed in Node
  8534. c.data.pos = c.elm.getBoundingClientRect();
  8535. if (map[c.key]) {
  8536. kept.push(c);
  8537. }
  8538. else {
  8539. removed.push(c);
  8540. }
  8541. }
  8542. this.kept = h(tag, null, kept);
  8543. this.removed = removed;
  8544. }
  8545. return h(tag, null, children);
  8546. },
  8547. updated: function () {
  8548. var children = this.prevChildren;
  8549. var moveClass = this.moveClass || (this.name || 'v') + '-move';
  8550. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  8551. return;
  8552. }
  8553. // we divide the work into three loops to avoid mixing DOM reads and writes
  8554. // in each iteration - which helps prevent layout thrashing.
  8555. children.forEach(callPendingCbs);
  8556. children.forEach(recordPosition);
  8557. children.forEach(applyTranslation);
  8558. // force reflow to put everything in position
  8559. // assign to this to avoid being removed in tree-shaking
  8560. // $flow-disable-line
  8561. this._reflow = document.body.offsetHeight;
  8562. children.forEach(function (c) {
  8563. if (c.data.moved) {
  8564. var el_1 = c.elm;
  8565. var s = el_1.style;
  8566. addTransitionClass(el_1, moveClass);
  8567. s.transform = s.WebkitTransform = s.transitionDuration = '';
  8568. el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
  8569. if (e && e.target !== el_1) {
  8570. return;
  8571. }
  8572. if (!e || /transform$/.test(e.propertyName)) {
  8573. el_1.removeEventListener(transitionEndEvent, cb);
  8574. el_1._moveCb = null;
  8575. removeTransitionClass(el_1, moveClass);
  8576. }
  8577. }));
  8578. }
  8579. });
  8580. },
  8581. methods: {
  8582. hasMove: function (el, moveClass) {
  8583. /* istanbul ignore if */
  8584. if (!hasTransition) {
  8585. return false;
  8586. }
  8587. /* istanbul ignore if */
  8588. if (this._hasMove) {
  8589. return this._hasMove;
  8590. }
  8591. // Detect whether an element with the move class applied has
  8592. // CSS transitions. Since the element may be inside an entering
  8593. // transition at this very moment, we make a clone of it and remove
  8594. // all other transition classes applied to ensure only the move class
  8595. // is applied.
  8596. var clone = el.cloneNode();
  8597. if (el._transitionClasses) {
  8598. el._transitionClasses.forEach(function (cls) {
  8599. removeClass(clone, cls);
  8600. });
  8601. }
  8602. addClass(clone, moveClass);
  8603. clone.style.display = 'none';
  8604. this.$el.appendChild(clone);
  8605. var info = getTransitionInfo(clone);
  8606. this.$el.removeChild(clone);
  8607. return (this._hasMove = info.hasTransform);
  8608. }
  8609. }
  8610. };
  8611. function callPendingCbs(c) {
  8612. /* istanbul ignore if */
  8613. if (c.elm._moveCb) {
  8614. c.elm._moveCb();
  8615. }
  8616. /* istanbul ignore if */
  8617. if (c.elm._enterCb) {
  8618. c.elm._enterCb();
  8619. }
  8620. }
  8621. function recordPosition(c) {
  8622. c.data.newPos = c.elm.getBoundingClientRect();
  8623. }
  8624. function applyTranslation(c) {
  8625. var oldPos = c.data.pos;
  8626. var newPos = c.data.newPos;
  8627. var dx = oldPos.left - newPos.left;
  8628. var dy = oldPos.top - newPos.top;
  8629. if (dx || dy) {
  8630. c.data.moved = true;
  8631. var s = c.elm.style;
  8632. s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
  8633. s.transitionDuration = '0s';
  8634. }
  8635. }
  8636. var platformComponents = {
  8637. Transition: Transition,
  8638. TransitionGroup: TransitionGroup
  8639. };
  8640. // install platform specific utils
  8641. Vue.config.mustUseProp = mustUseProp;
  8642. Vue.config.isReservedTag = isReservedTag;
  8643. Vue.config.isReservedAttr = isReservedAttr;
  8644. Vue.config.getTagNamespace = getTagNamespace;
  8645. Vue.config.isUnknownElement = isUnknownElement;
  8646. // install platform runtime directives & components
  8647. extend(Vue.options.directives, platformDirectives);
  8648. extend(Vue.options.components, platformComponents);
  8649. // install platform patch function
  8650. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  8651. // public mount method
  8652. Vue.prototype.$mount = function (el, hydrating) {
  8653. el = el && inBrowser ? query(el) : undefined;
  8654. return mountComponent(this, el, hydrating);
  8655. };
  8656. // devtools global hook
  8657. /* istanbul ignore next */
  8658. if (inBrowser) {
  8659. setTimeout(function () {
  8660. if (config.devtools) {
  8661. if (devtools) {
  8662. devtools.emit('init', Vue);
  8663. }
  8664. else if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
  8665. // @ts-expect-error
  8666. console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' +
  8667. 'https://github.com/vuejs/vue-devtools');
  8668. }
  8669. }
  8670. if (process.env.NODE_ENV !== 'production' &&
  8671. process.env.NODE_ENV !== 'test' &&
  8672. config.productionTip !== false &&
  8673. typeof console !== 'undefined') {
  8674. // @ts-expect-error
  8675. console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" +
  8676. "Make sure to turn on production mode when deploying for production.\n" +
  8677. "See more tips at https://vuejs.org/guide/deployment.html");
  8678. }
  8679. }, 0);
  8680. }
  8681. export { EffectScope, computed, customRef, Vue as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref$1 as ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect };