Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runtime-dom.global.js 351KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332
  1. /**
  2. * @vue/runtime-dom v3.4.38
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. var VueRuntimeDOM = (function (exports) {
  7. 'use strict';
  8. /*! #__NO_SIDE_EFFECTS__ */
  9. // @__NO_SIDE_EFFECTS__
  10. function makeMap(str, expectsLowerCase) {
  11. const set = new Set(str.split(","));
  12. return (val) => set.has(val);
  13. }
  14. const EMPTY_OBJ = Object.freeze({}) ;
  15. const EMPTY_ARR = Object.freeze([]) ;
  16. const NOOP = () => {
  17. };
  18. const NO = () => false;
  19. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  20. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  21. const isModelListener = (key) => key.startsWith("onUpdate:");
  22. const extend = Object.assign;
  23. const remove = (arr, el) => {
  24. const i = arr.indexOf(el);
  25. if (i > -1) {
  26. arr.splice(i, 1);
  27. }
  28. };
  29. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  30. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  31. const isArray = Array.isArray;
  32. const isMap = (val) => toTypeString(val) === "[object Map]";
  33. const isSet = (val) => toTypeString(val) === "[object Set]";
  34. const isDate = (val) => toTypeString(val) === "[object Date]";
  35. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  36. const isFunction = (val) => typeof val === "function";
  37. const isString = (val) => typeof val === "string";
  38. const isSymbol = (val) => typeof val === "symbol";
  39. const isObject = (val) => val !== null && typeof val === "object";
  40. const isPromise = (val) => {
  41. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  42. };
  43. const objectToString = Object.prototype.toString;
  44. const toTypeString = (value) => objectToString.call(value);
  45. const toRawType = (value) => {
  46. return toTypeString(value).slice(8, -1);
  47. };
  48. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  49. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  50. const isReservedProp = /* @__PURE__ */ makeMap(
  51. // the leading comma is intentional so empty string "" is also included
  52. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  53. );
  54. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  55. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  56. );
  57. const cacheStringFunction = (fn) => {
  58. const cache = /* @__PURE__ */ Object.create(null);
  59. return (str) => {
  60. const hit = cache[str];
  61. return hit || (cache[str] = fn(str));
  62. };
  63. };
  64. const camelizeRE = /-(\w)/g;
  65. const camelize = cacheStringFunction((str) => {
  66. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  67. });
  68. const hyphenateRE = /\B([A-Z])/g;
  69. const hyphenate = cacheStringFunction(
  70. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  71. );
  72. const capitalize = cacheStringFunction((str) => {
  73. return str.charAt(0).toUpperCase() + str.slice(1);
  74. });
  75. const toHandlerKey = cacheStringFunction((str) => {
  76. const s = str ? `on${capitalize(str)}` : ``;
  77. return s;
  78. });
  79. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  80. const invokeArrayFns = (fns, ...arg) => {
  81. for (let i = 0; i < fns.length; i++) {
  82. fns[i](...arg);
  83. }
  84. };
  85. const def = (obj, key, value, writable = false) => {
  86. Object.defineProperty(obj, key, {
  87. configurable: true,
  88. enumerable: false,
  89. writable,
  90. value
  91. });
  92. };
  93. const looseToNumber = (val) => {
  94. const n = parseFloat(val);
  95. return isNaN(n) ? val : n;
  96. };
  97. const toNumber = (val) => {
  98. const n = isString(val) ? Number(val) : NaN;
  99. return isNaN(n) ? val : n;
  100. };
  101. let _globalThis;
  102. const getGlobalThis = () => {
  103. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  104. };
  105. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
  106. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  107. function normalizeStyle(value) {
  108. if (isArray(value)) {
  109. const res = {};
  110. for (let i = 0; i < value.length; i++) {
  111. const item = value[i];
  112. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  113. if (normalized) {
  114. for (const key in normalized) {
  115. res[key] = normalized[key];
  116. }
  117. }
  118. }
  119. return res;
  120. } else if (isString(value) || isObject(value)) {
  121. return value;
  122. }
  123. }
  124. const listDelimiterRE = /;(?![^(]*\))/g;
  125. const propertyDelimiterRE = /:([^]+)/;
  126. const styleCommentRE = /\/\*[^]*?\*\//g;
  127. function parseStringStyle(cssText) {
  128. const ret = {};
  129. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  130. if (item) {
  131. const tmp = item.split(propertyDelimiterRE);
  132. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  133. }
  134. });
  135. return ret;
  136. }
  137. function stringifyStyle(styles) {
  138. let ret = "";
  139. if (!styles || isString(styles)) {
  140. return ret;
  141. }
  142. for (const key in styles) {
  143. const value = styles[key];
  144. if (isString(value) || typeof value === "number") {
  145. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  146. ret += `${normalizedKey}:${value};`;
  147. }
  148. }
  149. return ret;
  150. }
  151. function normalizeClass(value) {
  152. let res = "";
  153. if (isString(value)) {
  154. res = value;
  155. } else if (isArray(value)) {
  156. for (let i = 0; i < value.length; i++) {
  157. const normalized = normalizeClass(value[i]);
  158. if (normalized) {
  159. res += normalized + " ";
  160. }
  161. }
  162. } else if (isObject(value)) {
  163. for (const name in value) {
  164. if (value[name]) {
  165. res += name + " ";
  166. }
  167. }
  168. }
  169. return res.trim();
  170. }
  171. function normalizeProps(props) {
  172. if (!props) return null;
  173. let { class: klass, style } = props;
  174. if (klass && !isString(klass)) {
  175. props.class = normalizeClass(klass);
  176. }
  177. if (style) {
  178. props.style = normalizeStyle(style);
  179. }
  180. return props;
  181. }
  182. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  183. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  184. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  185. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  186. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  187. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  188. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  189. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  190. const isBooleanAttr = /* @__PURE__ */ makeMap(
  191. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  192. );
  193. function includeBooleanAttr(value) {
  194. return !!value || value === "";
  195. }
  196. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  197. `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
  198. );
  199. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  200. `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  201. );
  202. function isRenderableAttrValue(value) {
  203. if (value == null) {
  204. return false;
  205. }
  206. const type = typeof value;
  207. return type === "string" || type === "number" || type === "boolean";
  208. }
  209. function looseCompareArrays(a, b) {
  210. if (a.length !== b.length) return false;
  211. let equal = true;
  212. for (let i = 0; equal && i < a.length; i++) {
  213. equal = looseEqual(a[i], b[i]);
  214. }
  215. return equal;
  216. }
  217. function looseEqual(a, b) {
  218. if (a === b) return true;
  219. let aValidType = isDate(a);
  220. let bValidType = isDate(b);
  221. if (aValidType || bValidType) {
  222. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  223. }
  224. aValidType = isSymbol(a);
  225. bValidType = isSymbol(b);
  226. if (aValidType || bValidType) {
  227. return a === b;
  228. }
  229. aValidType = isArray(a);
  230. bValidType = isArray(b);
  231. if (aValidType || bValidType) {
  232. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  233. }
  234. aValidType = isObject(a);
  235. bValidType = isObject(b);
  236. if (aValidType || bValidType) {
  237. if (!aValidType || !bValidType) {
  238. return false;
  239. }
  240. const aKeysCount = Object.keys(a).length;
  241. const bKeysCount = Object.keys(b).length;
  242. if (aKeysCount !== bKeysCount) {
  243. return false;
  244. }
  245. for (const key in a) {
  246. const aHasKey = a.hasOwnProperty(key);
  247. const bHasKey = b.hasOwnProperty(key);
  248. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  249. return false;
  250. }
  251. }
  252. }
  253. return String(a) === String(b);
  254. }
  255. function looseIndexOf(arr, val) {
  256. return arr.findIndex((item) => looseEqual(item, val));
  257. }
  258. const isRef$1 = (val) => {
  259. return !!(val && val.__v_isRef === true);
  260. };
  261. const toDisplayString = (val) => {
  262. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  263. };
  264. const replacer = (_key, val) => {
  265. if (isRef$1(val)) {
  266. return replacer(_key, val.value);
  267. } else if (isMap(val)) {
  268. return {
  269. [`Map(${val.size})`]: [...val.entries()].reduce(
  270. (entries, [key, val2], i) => {
  271. entries[stringifySymbol(key, i) + " =>"] = val2;
  272. return entries;
  273. },
  274. {}
  275. )
  276. };
  277. } else if (isSet(val)) {
  278. return {
  279. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  280. };
  281. } else if (isSymbol(val)) {
  282. return stringifySymbol(val);
  283. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  284. return String(val);
  285. }
  286. return val;
  287. };
  288. const stringifySymbol = (v, i = "") => {
  289. var _a;
  290. return (
  291. // Symbol.description in es2019+ so we need to cast here to pass
  292. // the lib: es2016 check
  293. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  294. );
  295. };
  296. function warn$2(msg, ...args) {
  297. console.warn(`[Vue warn] ${msg}`, ...args);
  298. }
  299. let activeEffectScope;
  300. class EffectScope {
  301. constructor(detached = false) {
  302. this.detached = detached;
  303. /**
  304. * @internal
  305. */
  306. this._active = true;
  307. /**
  308. * @internal
  309. */
  310. this.effects = [];
  311. /**
  312. * @internal
  313. */
  314. this.cleanups = [];
  315. this.parent = activeEffectScope;
  316. if (!detached && activeEffectScope) {
  317. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  318. this
  319. ) - 1;
  320. }
  321. }
  322. get active() {
  323. return this._active;
  324. }
  325. run(fn) {
  326. if (this._active) {
  327. const currentEffectScope = activeEffectScope;
  328. try {
  329. activeEffectScope = this;
  330. return fn();
  331. } finally {
  332. activeEffectScope = currentEffectScope;
  333. }
  334. } else {
  335. warn$2(`cannot run an inactive effect scope.`);
  336. }
  337. }
  338. /**
  339. * This should only be called on non-detached scopes
  340. * @internal
  341. */
  342. on() {
  343. activeEffectScope = this;
  344. }
  345. /**
  346. * This should only be called on non-detached scopes
  347. * @internal
  348. */
  349. off() {
  350. activeEffectScope = this.parent;
  351. }
  352. stop(fromParent) {
  353. if (this._active) {
  354. let i, l;
  355. for (i = 0, l = this.effects.length; i < l; i++) {
  356. this.effects[i].stop();
  357. }
  358. for (i = 0, l = this.cleanups.length; i < l; i++) {
  359. this.cleanups[i]();
  360. }
  361. if (this.scopes) {
  362. for (i = 0, l = this.scopes.length; i < l; i++) {
  363. this.scopes[i].stop(true);
  364. }
  365. }
  366. if (!this.detached && this.parent && !fromParent) {
  367. const last = this.parent.scopes.pop();
  368. if (last && last !== this) {
  369. this.parent.scopes[this.index] = last;
  370. last.index = this.index;
  371. }
  372. }
  373. this.parent = void 0;
  374. this._active = false;
  375. }
  376. }
  377. }
  378. function effectScope(detached) {
  379. return new EffectScope(detached);
  380. }
  381. function recordEffectScope(effect, scope = activeEffectScope) {
  382. if (scope && scope.active) {
  383. scope.effects.push(effect);
  384. }
  385. }
  386. function getCurrentScope() {
  387. return activeEffectScope;
  388. }
  389. function onScopeDispose(fn) {
  390. if (activeEffectScope) {
  391. activeEffectScope.cleanups.push(fn);
  392. } else {
  393. warn$2(
  394. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  395. );
  396. }
  397. }
  398. let activeEffect;
  399. class ReactiveEffect {
  400. constructor(fn, trigger, scheduler, scope) {
  401. this.fn = fn;
  402. this.trigger = trigger;
  403. this.scheduler = scheduler;
  404. this.active = true;
  405. this.deps = [];
  406. /**
  407. * @internal
  408. */
  409. this._dirtyLevel = 4;
  410. /**
  411. * @internal
  412. */
  413. this._trackId = 0;
  414. /**
  415. * @internal
  416. */
  417. this._runnings = 0;
  418. /**
  419. * @internal
  420. */
  421. this._shouldSchedule = false;
  422. /**
  423. * @internal
  424. */
  425. this._depsLength = 0;
  426. recordEffectScope(this, scope);
  427. }
  428. get dirty() {
  429. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  430. this._dirtyLevel = 1;
  431. pauseTracking();
  432. for (let i = 0; i < this._depsLength; i++) {
  433. const dep = this.deps[i];
  434. if (dep.computed) {
  435. triggerComputed(dep.computed);
  436. if (this._dirtyLevel >= 4) {
  437. break;
  438. }
  439. }
  440. }
  441. if (this._dirtyLevel === 1) {
  442. this._dirtyLevel = 0;
  443. }
  444. resetTracking();
  445. }
  446. return this._dirtyLevel >= 4;
  447. }
  448. set dirty(v) {
  449. this._dirtyLevel = v ? 4 : 0;
  450. }
  451. run() {
  452. this._dirtyLevel = 0;
  453. if (!this.active) {
  454. return this.fn();
  455. }
  456. let lastShouldTrack = shouldTrack;
  457. let lastEffect = activeEffect;
  458. try {
  459. shouldTrack = true;
  460. activeEffect = this;
  461. this._runnings++;
  462. preCleanupEffect(this);
  463. return this.fn();
  464. } finally {
  465. postCleanupEffect(this);
  466. this._runnings--;
  467. activeEffect = lastEffect;
  468. shouldTrack = lastShouldTrack;
  469. }
  470. }
  471. stop() {
  472. if (this.active) {
  473. preCleanupEffect(this);
  474. postCleanupEffect(this);
  475. this.onStop && this.onStop();
  476. this.active = false;
  477. }
  478. }
  479. }
  480. function triggerComputed(computed) {
  481. return computed.value;
  482. }
  483. function preCleanupEffect(effect2) {
  484. effect2._trackId++;
  485. effect2._depsLength = 0;
  486. }
  487. function postCleanupEffect(effect2) {
  488. if (effect2.deps.length > effect2._depsLength) {
  489. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  490. cleanupDepEffect(effect2.deps[i], effect2);
  491. }
  492. effect2.deps.length = effect2._depsLength;
  493. }
  494. }
  495. function cleanupDepEffect(dep, effect2) {
  496. const trackId = dep.get(effect2);
  497. if (trackId !== void 0 && effect2._trackId !== trackId) {
  498. dep.delete(effect2);
  499. if (dep.size === 0) {
  500. dep.cleanup();
  501. }
  502. }
  503. }
  504. function effect(fn, options) {
  505. if (fn.effect instanceof ReactiveEffect) {
  506. fn = fn.effect.fn;
  507. }
  508. const _effect = new ReactiveEffect(fn, NOOP, () => {
  509. if (_effect.dirty) {
  510. _effect.run();
  511. }
  512. });
  513. if (options) {
  514. extend(_effect, options);
  515. if (options.scope) recordEffectScope(_effect, options.scope);
  516. }
  517. if (!options || !options.lazy) {
  518. _effect.run();
  519. }
  520. const runner = _effect.run.bind(_effect);
  521. runner.effect = _effect;
  522. return runner;
  523. }
  524. function stop(runner) {
  525. runner.effect.stop();
  526. }
  527. let shouldTrack = true;
  528. let pauseScheduleStack = 0;
  529. const trackStack = [];
  530. function pauseTracking() {
  531. trackStack.push(shouldTrack);
  532. shouldTrack = false;
  533. }
  534. function resetTracking() {
  535. const last = trackStack.pop();
  536. shouldTrack = last === void 0 ? true : last;
  537. }
  538. function pauseScheduling() {
  539. pauseScheduleStack++;
  540. }
  541. function resetScheduling() {
  542. pauseScheduleStack--;
  543. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  544. queueEffectSchedulers.shift()();
  545. }
  546. }
  547. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  548. var _a;
  549. if (dep.get(effect2) !== effect2._trackId) {
  550. dep.set(effect2, effect2._trackId);
  551. const oldDep = effect2.deps[effect2._depsLength];
  552. if (oldDep !== dep) {
  553. if (oldDep) {
  554. cleanupDepEffect(oldDep, effect2);
  555. }
  556. effect2.deps[effect2._depsLength++] = dep;
  557. } else {
  558. effect2._depsLength++;
  559. }
  560. {
  561. (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  562. }
  563. }
  564. }
  565. const queueEffectSchedulers = [];
  566. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  567. var _a;
  568. pauseScheduling();
  569. for (const effect2 of dep.keys()) {
  570. let tracking;
  571. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  572. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  573. effect2._dirtyLevel = dirtyLevel;
  574. }
  575. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  576. {
  577. (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  578. }
  579. effect2.trigger();
  580. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  581. effect2._shouldSchedule = false;
  582. if (effect2.scheduler) {
  583. queueEffectSchedulers.push(effect2.scheduler);
  584. }
  585. }
  586. }
  587. }
  588. resetScheduling();
  589. }
  590. const createDep = (cleanup, computed) => {
  591. const dep = /* @__PURE__ */ new Map();
  592. dep.cleanup = cleanup;
  593. dep.computed = computed;
  594. return dep;
  595. };
  596. const targetMap = /* @__PURE__ */ new WeakMap();
  597. const ITERATE_KEY = Symbol("iterate" );
  598. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
  599. function track(target, type, key) {
  600. if (shouldTrack && activeEffect) {
  601. let depsMap = targetMap.get(target);
  602. if (!depsMap) {
  603. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  604. }
  605. let dep = depsMap.get(key);
  606. if (!dep) {
  607. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  608. }
  609. trackEffect(
  610. activeEffect,
  611. dep,
  612. {
  613. target,
  614. type,
  615. key
  616. }
  617. );
  618. }
  619. }
  620. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  621. const depsMap = targetMap.get(target);
  622. if (!depsMap) {
  623. return;
  624. }
  625. let deps = [];
  626. if (type === "clear") {
  627. deps = [...depsMap.values()];
  628. } else if (key === "length" && isArray(target)) {
  629. const newLength = Number(newValue);
  630. depsMap.forEach((dep, key2) => {
  631. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  632. deps.push(dep);
  633. }
  634. });
  635. } else {
  636. if (key !== void 0) {
  637. deps.push(depsMap.get(key));
  638. }
  639. switch (type) {
  640. case "add":
  641. if (!isArray(target)) {
  642. deps.push(depsMap.get(ITERATE_KEY));
  643. if (isMap(target)) {
  644. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  645. }
  646. } else if (isIntegerKey(key)) {
  647. deps.push(depsMap.get("length"));
  648. }
  649. break;
  650. case "delete":
  651. if (!isArray(target)) {
  652. deps.push(depsMap.get(ITERATE_KEY));
  653. if (isMap(target)) {
  654. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  655. }
  656. }
  657. break;
  658. case "set":
  659. if (isMap(target)) {
  660. deps.push(depsMap.get(ITERATE_KEY));
  661. }
  662. break;
  663. }
  664. }
  665. pauseScheduling();
  666. for (const dep of deps) {
  667. if (dep) {
  668. triggerEffects(
  669. dep,
  670. 4,
  671. {
  672. target,
  673. type,
  674. key,
  675. newValue,
  676. oldValue,
  677. oldTarget
  678. }
  679. );
  680. }
  681. }
  682. resetScheduling();
  683. }
  684. function getDepFromReactive(object, key) {
  685. const depsMap = targetMap.get(object);
  686. return depsMap && depsMap.get(key);
  687. }
  688. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  689. const builtInSymbols = new Set(
  690. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  691. );
  692. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  693. function createArrayInstrumentations() {
  694. const instrumentations = {};
  695. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  696. instrumentations[key] = function(...args) {
  697. const arr = toRaw(this);
  698. for (let i = 0, l = this.length; i < l; i++) {
  699. track(arr, "get", i + "");
  700. }
  701. const res = arr[key](...args);
  702. if (res === -1 || res === false) {
  703. return arr[key](...args.map(toRaw));
  704. } else {
  705. return res;
  706. }
  707. };
  708. });
  709. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  710. instrumentations[key] = function(...args) {
  711. pauseTracking();
  712. pauseScheduling();
  713. const res = toRaw(this)[key].apply(this, args);
  714. resetScheduling();
  715. resetTracking();
  716. return res;
  717. };
  718. });
  719. return instrumentations;
  720. }
  721. function hasOwnProperty(key) {
  722. if (!isSymbol(key)) key = String(key);
  723. const obj = toRaw(this);
  724. track(obj, "has", key);
  725. return obj.hasOwnProperty(key);
  726. }
  727. class BaseReactiveHandler {
  728. constructor(_isReadonly = false, _isShallow = false) {
  729. this._isReadonly = _isReadonly;
  730. this._isShallow = _isShallow;
  731. }
  732. get(target, key, receiver) {
  733. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  734. if (key === "__v_isReactive") {
  735. return !isReadonly2;
  736. } else if (key === "__v_isReadonly") {
  737. return isReadonly2;
  738. } else if (key === "__v_isShallow") {
  739. return isShallow2;
  740. } else if (key === "__v_raw") {
  741. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  742. // this means the receiver is a user proxy of the reactive proxy
  743. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  744. return target;
  745. }
  746. return;
  747. }
  748. const targetIsArray = isArray(target);
  749. if (!isReadonly2) {
  750. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  751. return Reflect.get(arrayInstrumentations, key, receiver);
  752. }
  753. if (key === "hasOwnProperty") {
  754. return hasOwnProperty;
  755. }
  756. }
  757. const res = Reflect.get(target, key, receiver);
  758. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  759. return res;
  760. }
  761. if (!isReadonly2) {
  762. track(target, "get", key);
  763. }
  764. if (isShallow2) {
  765. return res;
  766. }
  767. if (isRef(res)) {
  768. return targetIsArray && isIntegerKey(key) ? res : res.value;
  769. }
  770. if (isObject(res)) {
  771. return isReadonly2 ? readonly(res) : reactive(res);
  772. }
  773. return res;
  774. }
  775. }
  776. class MutableReactiveHandler extends BaseReactiveHandler {
  777. constructor(isShallow2 = false) {
  778. super(false, isShallow2);
  779. }
  780. set(target, key, value, receiver) {
  781. let oldValue = target[key];
  782. if (!this._isShallow) {
  783. const isOldValueReadonly = isReadonly(oldValue);
  784. if (!isShallow(value) && !isReadonly(value)) {
  785. oldValue = toRaw(oldValue);
  786. value = toRaw(value);
  787. }
  788. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  789. if (isOldValueReadonly) {
  790. return false;
  791. } else {
  792. oldValue.value = value;
  793. return true;
  794. }
  795. }
  796. }
  797. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  798. const result = Reflect.set(target, key, value, receiver);
  799. if (target === toRaw(receiver)) {
  800. if (!hadKey) {
  801. trigger(target, "add", key, value);
  802. } else if (hasChanged(value, oldValue)) {
  803. trigger(target, "set", key, value, oldValue);
  804. }
  805. }
  806. return result;
  807. }
  808. deleteProperty(target, key) {
  809. const hadKey = hasOwn(target, key);
  810. const oldValue = target[key];
  811. const result = Reflect.deleteProperty(target, key);
  812. if (result && hadKey) {
  813. trigger(target, "delete", key, void 0, oldValue);
  814. }
  815. return result;
  816. }
  817. has(target, key) {
  818. const result = Reflect.has(target, key);
  819. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  820. track(target, "has", key);
  821. }
  822. return result;
  823. }
  824. ownKeys(target) {
  825. track(
  826. target,
  827. "iterate",
  828. isArray(target) ? "length" : ITERATE_KEY
  829. );
  830. return Reflect.ownKeys(target);
  831. }
  832. }
  833. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  834. constructor(isShallow2 = false) {
  835. super(true, isShallow2);
  836. }
  837. set(target, key) {
  838. {
  839. warn$2(
  840. `Set operation on key "${String(key)}" failed: target is readonly.`,
  841. target
  842. );
  843. }
  844. return true;
  845. }
  846. deleteProperty(target, key) {
  847. {
  848. warn$2(
  849. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  850. target
  851. );
  852. }
  853. return true;
  854. }
  855. }
  856. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  857. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  858. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  859. true
  860. );
  861. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  862. const toShallow = (value) => value;
  863. const getProto = (v) => Reflect.getPrototypeOf(v);
  864. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  865. target = target["__v_raw"];
  866. const rawTarget = toRaw(target);
  867. const rawKey = toRaw(key);
  868. if (!isReadonly2) {
  869. if (hasChanged(key, rawKey)) {
  870. track(rawTarget, "get", key);
  871. }
  872. track(rawTarget, "get", rawKey);
  873. }
  874. const { has: has2 } = getProto(rawTarget);
  875. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  876. if (has2.call(rawTarget, key)) {
  877. return wrap(target.get(key));
  878. } else if (has2.call(rawTarget, rawKey)) {
  879. return wrap(target.get(rawKey));
  880. } else if (target !== rawTarget) {
  881. target.get(key);
  882. }
  883. }
  884. function has(key, isReadonly2 = false) {
  885. const target = this["__v_raw"];
  886. const rawTarget = toRaw(target);
  887. const rawKey = toRaw(key);
  888. if (!isReadonly2) {
  889. if (hasChanged(key, rawKey)) {
  890. track(rawTarget, "has", key);
  891. }
  892. track(rawTarget, "has", rawKey);
  893. }
  894. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  895. }
  896. function size(target, isReadonly2 = false) {
  897. target = target["__v_raw"];
  898. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  899. return Reflect.get(target, "size", target);
  900. }
  901. function add(value, _isShallow = false) {
  902. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  903. value = toRaw(value);
  904. }
  905. const target = toRaw(this);
  906. const proto = getProto(target);
  907. const hadKey = proto.has.call(target, value);
  908. if (!hadKey) {
  909. target.add(value);
  910. trigger(target, "add", value, value);
  911. }
  912. return this;
  913. }
  914. function set(key, value, _isShallow = false) {
  915. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  916. value = toRaw(value);
  917. }
  918. const target = toRaw(this);
  919. const { has: has2, get: get2 } = getProto(target);
  920. let hadKey = has2.call(target, key);
  921. if (!hadKey) {
  922. key = toRaw(key);
  923. hadKey = has2.call(target, key);
  924. } else {
  925. checkIdentityKeys(target, has2, key);
  926. }
  927. const oldValue = get2.call(target, key);
  928. target.set(key, value);
  929. if (!hadKey) {
  930. trigger(target, "add", key, value);
  931. } else if (hasChanged(value, oldValue)) {
  932. trigger(target, "set", key, value, oldValue);
  933. }
  934. return this;
  935. }
  936. function deleteEntry(key) {
  937. const target = toRaw(this);
  938. const { has: has2, get: get2 } = getProto(target);
  939. let hadKey = has2.call(target, key);
  940. if (!hadKey) {
  941. key = toRaw(key);
  942. hadKey = has2.call(target, key);
  943. } else {
  944. checkIdentityKeys(target, has2, key);
  945. }
  946. const oldValue = get2 ? get2.call(target, key) : void 0;
  947. const result = target.delete(key);
  948. if (hadKey) {
  949. trigger(target, "delete", key, void 0, oldValue);
  950. }
  951. return result;
  952. }
  953. function clear() {
  954. const target = toRaw(this);
  955. const hadItems = target.size !== 0;
  956. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  957. const result = target.clear();
  958. if (hadItems) {
  959. trigger(target, "clear", void 0, void 0, oldTarget);
  960. }
  961. return result;
  962. }
  963. function createForEach(isReadonly2, isShallow2) {
  964. return function forEach(callback, thisArg) {
  965. const observed = this;
  966. const target = observed["__v_raw"];
  967. const rawTarget = toRaw(target);
  968. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  969. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  970. return target.forEach((value, key) => {
  971. return callback.call(thisArg, wrap(value), wrap(key), observed);
  972. });
  973. };
  974. }
  975. function createIterableMethod(method, isReadonly2, isShallow2) {
  976. return function(...args) {
  977. const target = this["__v_raw"];
  978. const rawTarget = toRaw(target);
  979. const targetIsMap = isMap(rawTarget);
  980. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  981. const isKeyOnly = method === "keys" && targetIsMap;
  982. const innerIterator = target[method](...args);
  983. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  984. !isReadonly2 && track(
  985. rawTarget,
  986. "iterate",
  987. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  988. );
  989. return {
  990. // iterator protocol
  991. next() {
  992. const { value, done } = innerIterator.next();
  993. return done ? { value, done } : {
  994. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  995. done
  996. };
  997. },
  998. // iterable protocol
  999. [Symbol.iterator]() {
  1000. return this;
  1001. }
  1002. };
  1003. };
  1004. }
  1005. function createReadonlyMethod(type) {
  1006. return function(...args) {
  1007. {
  1008. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1009. warn$2(
  1010. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1011. toRaw(this)
  1012. );
  1013. }
  1014. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1015. };
  1016. }
  1017. function createInstrumentations() {
  1018. const mutableInstrumentations2 = {
  1019. get(key) {
  1020. return get(this, key);
  1021. },
  1022. get size() {
  1023. return size(this);
  1024. },
  1025. has,
  1026. add,
  1027. set,
  1028. delete: deleteEntry,
  1029. clear,
  1030. forEach: createForEach(false, false)
  1031. };
  1032. const shallowInstrumentations2 = {
  1033. get(key) {
  1034. return get(this, key, false, true);
  1035. },
  1036. get size() {
  1037. return size(this);
  1038. },
  1039. has,
  1040. add(value) {
  1041. return add.call(this, value, true);
  1042. },
  1043. set(key, value) {
  1044. return set.call(this, key, value, true);
  1045. },
  1046. delete: deleteEntry,
  1047. clear,
  1048. forEach: createForEach(false, true)
  1049. };
  1050. const readonlyInstrumentations2 = {
  1051. get(key) {
  1052. return get(this, key, true);
  1053. },
  1054. get size() {
  1055. return size(this, true);
  1056. },
  1057. has(key) {
  1058. return has.call(this, key, true);
  1059. },
  1060. add: createReadonlyMethod("add"),
  1061. set: createReadonlyMethod("set"),
  1062. delete: createReadonlyMethod("delete"),
  1063. clear: createReadonlyMethod("clear"),
  1064. forEach: createForEach(true, false)
  1065. };
  1066. const shallowReadonlyInstrumentations2 = {
  1067. get(key) {
  1068. return get(this, key, true, true);
  1069. },
  1070. get size() {
  1071. return size(this, true);
  1072. },
  1073. has(key) {
  1074. return has.call(this, key, true);
  1075. },
  1076. add: createReadonlyMethod("add"),
  1077. set: createReadonlyMethod("set"),
  1078. delete: createReadonlyMethod("delete"),
  1079. clear: createReadonlyMethod("clear"),
  1080. forEach: createForEach(true, true)
  1081. };
  1082. const iteratorMethods = [
  1083. "keys",
  1084. "values",
  1085. "entries",
  1086. Symbol.iterator
  1087. ];
  1088. iteratorMethods.forEach((method) => {
  1089. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  1090. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  1091. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  1092. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1093. method,
  1094. true,
  1095. true
  1096. );
  1097. });
  1098. return [
  1099. mutableInstrumentations2,
  1100. readonlyInstrumentations2,
  1101. shallowInstrumentations2,
  1102. shallowReadonlyInstrumentations2
  1103. ];
  1104. }
  1105. const [
  1106. mutableInstrumentations,
  1107. readonlyInstrumentations,
  1108. shallowInstrumentations,
  1109. shallowReadonlyInstrumentations
  1110. ] = /* @__PURE__ */ createInstrumentations();
  1111. function createInstrumentationGetter(isReadonly2, shallow) {
  1112. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  1113. return (target, key, receiver) => {
  1114. if (key === "__v_isReactive") {
  1115. return !isReadonly2;
  1116. } else if (key === "__v_isReadonly") {
  1117. return isReadonly2;
  1118. } else if (key === "__v_raw") {
  1119. return target;
  1120. }
  1121. return Reflect.get(
  1122. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1123. key,
  1124. receiver
  1125. );
  1126. };
  1127. }
  1128. const mutableCollectionHandlers = {
  1129. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1130. };
  1131. const shallowCollectionHandlers = {
  1132. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1133. };
  1134. const readonlyCollectionHandlers = {
  1135. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1136. };
  1137. const shallowReadonlyCollectionHandlers = {
  1138. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1139. };
  1140. function checkIdentityKeys(target, has2, key) {
  1141. const rawKey = toRaw(key);
  1142. if (rawKey !== key && has2.call(target, rawKey)) {
  1143. const type = toRawType(target);
  1144. warn$2(
  1145. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1146. );
  1147. }
  1148. }
  1149. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1150. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1151. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1152. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1153. function targetTypeMap(rawType) {
  1154. switch (rawType) {
  1155. case "Object":
  1156. case "Array":
  1157. return 1 /* COMMON */;
  1158. case "Map":
  1159. case "Set":
  1160. case "WeakMap":
  1161. case "WeakSet":
  1162. return 2 /* COLLECTION */;
  1163. default:
  1164. return 0 /* INVALID */;
  1165. }
  1166. }
  1167. function getTargetType(value) {
  1168. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1169. }
  1170. function reactive(target) {
  1171. if (isReadonly(target)) {
  1172. return target;
  1173. }
  1174. return createReactiveObject(
  1175. target,
  1176. false,
  1177. mutableHandlers,
  1178. mutableCollectionHandlers,
  1179. reactiveMap
  1180. );
  1181. }
  1182. function shallowReactive(target) {
  1183. return createReactiveObject(
  1184. target,
  1185. false,
  1186. shallowReactiveHandlers,
  1187. shallowCollectionHandlers,
  1188. shallowReactiveMap
  1189. );
  1190. }
  1191. function readonly(target) {
  1192. return createReactiveObject(
  1193. target,
  1194. true,
  1195. readonlyHandlers,
  1196. readonlyCollectionHandlers,
  1197. readonlyMap
  1198. );
  1199. }
  1200. function shallowReadonly(target) {
  1201. return createReactiveObject(
  1202. target,
  1203. true,
  1204. shallowReadonlyHandlers,
  1205. shallowReadonlyCollectionHandlers,
  1206. shallowReadonlyMap
  1207. );
  1208. }
  1209. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1210. if (!isObject(target)) {
  1211. {
  1212. warn$2(
  1213. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1214. target
  1215. )}`
  1216. );
  1217. }
  1218. return target;
  1219. }
  1220. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1221. return target;
  1222. }
  1223. const existingProxy = proxyMap.get(target);
  1224. if (existingProxy) {
  1225. return existingProxy;
  1226. }
  1227. const targetType = getTargetType(target);
  1228. if (targetType === 0 /* INVALID */) {
  1229. return target;
  1230. }
  1231. const proxy = new Proxy(
  1232. target,
  1233. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1234. );
  1235. proxyMap.set(target, proxy);
  1236. return proxy;
  1237. }
  1238. function isReactive(value) {
  1239. if (isReadonly(value)) {
  1240. return isReactive(value["__v_raw"]);
  1241. }
  1242. return !!(value && value["__v_isReactive"]);
  1243. }
  1244. function isReadonly(value) {
  1245. return !!(value && value["__v_isReadonly"]);
  1246. }
  1247. function isShallow(value) {
  1248. return !!(value && value["__v_isShallow"]);
  1249. }
  1250. function isProxy(value) {
  1251. return value ? !!value["__v_raw"] : false;
  1252. }
  1253. function toRaw(observed) {
  1254. const raw = observed && observed["__v_raw"];
  1255. return raw ? toRaw(raw) : observed;
  1256. }
  1257. function markRaw(value) {
  1258. if (Object.isExtensible(value)) {
  1259. def(value, "__v_skip", true);
  1260. }
  1261. return value;
  1262. }
  1263. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1264. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1265. const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
  1266. class ComputedRefImpl {
  1267. constructor(getter, _setter, isReadonly, isSSR) {
  1268. this.getter = getter;
  1269. this._setter = _setter;
  1270. this.dep = void 0;
  1271. this.__v_isRef = true;
  1272. this["__v_isReadonly"] = false;
  1273. this.effect = new ReactiveEffect(
  1274. () => getter(this._value),
  1275. () => triggerRefValue(
  1276. this,
  1277. this.effect._dirtyLevel === 2 ? 2 : 3
  1278. )
  1279. );
  1280. this.effect.computed = this;
  1281. this.effect.active = this._cacheable = !isSSR;
  1282. this["__v_isReadonly"] = isReadonly;
  1283. }
  1284. get value() {
  1285. const self = toRaw(this);
  1286. if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
  1287. triggerRefValue(self, 4);
  1288. }
  1289. trackRefValue(self);
  1290. if (self.effect._dirtyLevel >= 2) {
  1291. if (this._warnRecursive) {
  1292. warn$2(COMPUTED_SIDE_EFFECT_WARN, `
  1293. getter: `, this.getter);
  1294. }
  1295. triggerRefValue(self, 2);
  1296. }
  1297. return self._value;
  1298. }
  1299. set value(newValue) {
  1300. this._setter(newValue);
  1301. }
  1302. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1303. get _dirty() {
  1304. return this.effect.dirty;
  1305. }
  1306. set _dirty(v) {
  1307. this.effect.dirty = v;
  1308. }
  1309. // #endregion
  1310. }
  1311. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1312. let getter;
  1313. let setter;
  1314. const onlyGetter = isFunction(getterOrOptions);
  1315. if (onlyGetter) {
  1316. getter = getterOrOptions;
  1317. setter = () => {
  1318. warn$2("Write operation failed: computed value is readonly");
  1319. } ;
  1320. } else {
  1321. getter = getterOrOptions.get;
  1322. setter = getterOrOptions.set;
  1323. }
  1324. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1325. if (debugOptions && !isSSR) {
  1326. cRef.effect.onTrack = debugOptions.onTrack;
  1327. cRef.effect.onTrigger = debugOptions.onTrigger;
  1328. }
  1329. return cRef;
  1330. }
  1331. function trackRefValue(ref2) {
  1332. var _a;
  1333. if (shouldTrack && activeEffect) {
  1334. ref2 = toRaw(ref2);
  1335. trackEffect(
  1336. activeEffect,
  1337. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1338. () => ref2.dep = void 0,
  1339. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1340. ),
  1341. {
  1342. target: ref2,
  1343. type: "get",
  1344. key: "value"
  1345. }
  1346. );
  1347. }
  1348. }
  1349. function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
  1350. ref2 = toRaw(ref2);
  1351. const dep = ref2.dep;
  1352. if (dep) {
  1353. triggerEffects(
  1354. dep,
  1355. dirtyLevel,
  1356. {
  1357. target: ref2,
  1358. type: "set",
  1359. key: "value",
  1360. newValue: newVal,
  1361. oldValue: oldVal
  1362. }
  1363. );
  1364. }
  1365. }
  1366. function isRef(r) {
  1367. return !!(r && r.__v_isRef === true);
  1368. }
  1369. function ref(value) {
  1370. return createRef(value, false);
  1371. }
  1372. function shallowRef(value) {
  1373. return createRef(value, true);
  1374. }
  1375. function createRef(rawValue, shallow) {
  1376. if (isRef(rawValue)) {
  1377. return rawValue;
  1378. }
  1379. return new RefImpl(rawValue, shallow);
  1380. }
  1381. class RefImpl {
  1382. constructor(value, __v_isShallow) {
  1383. this.__v_isShallow = __v_isShallow;
  1384. this.dep = void 0;
  1385. this.__v_isRef = true;
  1386. this._rawValue = __v_isShallow ? value : toRaw(value);
  1387. this._value = __v_isShallow ? value : toReactive(value);
  1388. }
  1389. get value() {
  1390. trackRefValue(this);
  1391. return this._value;
  1392. }
  1393. set value(newVal) {
  1394. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1395. newVal = useDirectValue ? newVal : toRaw(newVal);
  1396. if (hasChanged(newVal, this._rawValue)) {
  1397. const oldVal = this._rawValue;
  1398. this._rawValue = newVal;
  1399. this._value = useDirectValue ? newVal : toReactive(newVal);
  1400. triggerRefValue(this, 4, newVal, oldVal);
  1401. }
  1402. }
  1403. }
  1404. function triggerRef(ref2) {
  1405. triggerRefValue(ref2, 4, ref2.value );
  1406. }
  1407. function unref(ref2) {
  1408. return isRef(ref2) ? ref2.value : ref2;
  1409. }
  1410. function toValue(source) {
  1411. return isFunction(source) ? source() : unref(source);
  1412. }
  1413. const shallowUnwrapHandlers = {
  1414. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1415. set: (target, key, value, receiver) => {
  1416. const oldValue = target[key];
  1417. if (isRef(oldValue) && !isRef(value)) {
  1418. oldValue.value = value;
  1419. return true;
  1420. } else {
  1421. return Reflect.set(target, key, value, receiver);
  1422. }
  1423. }
  1424. };
  1425. function proxyRefs(objectWithRefs) {
  1426. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1427. }
  1428. class CustomRefImpl {
  1429. constructor(factory) {
  1430. this.dep = void 0;
  1431. this.__v_isRef = true;
  1432. const { get, set } = factory(
  1433. () => trackRefValue(this),
  1434. () => triggerRefValue(this)
  1435. );
  1436. this._get = get;
  1437. this._set = set;
  1438. }
  1439. get value() {
  1440. return this._get();
  1441. }
  1442. set value(newVal) {
  1443. this._set(newVal);
  1444. }
  1445. }
  1446. function customRef(factory) {
  1447. return new CustomRefImpl(factory);
  1448. }
  1449. function toRefs(object) {
  1450. if (!isProxy(object)) {
  1451. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1452. }
  1453. const ret = isArray(object) ? new Array(object.length) : {};
  1454. for (const key in object) {
  1455. ret[key] = propertyToRef(object, key);
  1456. }
  1457. return ret;
  1458. }
  1459. class ObjectRefImpl {
  1460. constructor(_object, _key, _defaultValue) {
  1461. this._object = _object;
  1462. this._key = _key;
  1463. this._defaultValue = _defaultValue;
  1464. this.__v_isRef = true;
  1465. }
  1466. get value() {
  1467. const val = this._object[this._key];
  1468. return val === void 0 ? this._defaultValue : val;
  1469. }
  1470. set value(newVal) {
  1471. this._object[this._key] = newVal;
  1472. }
  1473. get dep() {
  1474. return getDepFromReactive(toRaw(this._object), this._key);
  1475. }
  1476. }
  1477. class GetterRefImpl {
  1478. constructor(_getter) {
  1479. this._getter = _getter;
  1480. this.__v_isRef = true;
  1481. this.__v_isReadonly = true;
  1482. }
  1483. get value() {
  1484. return this._getter();
  1485. }
  1486. }
  1487. function toRef(source, key, defaultValue) {
  1488. if (isRef(source)) {
  1489. return source;
  1490. } else if (isFunction(source)) {
  1491. return new GetterRefImpl(source);
  1492. } else if (isObject(source) && arguments.length > 1) {
  1493. return propertyToRef(source, key, defaultValue);
  1494. } else {
  1495. return ref(source);
  1496. }
  1497. }
  1498. function propertyToRef(source, key, defaultValue) {
  1499. const val = source[key];
  1500. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1501. }
  1502. const TrackOpTypes = {
  1503. "GET": "get",
  1504. "HAS": "has",
  1505. "ITERATE": "iterate"
  1506. };
  1507. const TriggerOpTypes = {
  1508. "SET": "set",
  1509. "ADD": "add",
  1510. "DELETE": "delete",
  1511. "CLEAR": "clear"
  1512. };
  1513. const stack = [];
  1514. function pushWarningContext(vnode) {
  1515. stack.push(vnode);
  1516. }
  1517. function popWarningContext() {
  1518. stack.pop();
  1519. }
  1520. let isWarning = false;
  1521. function warn$1(msg, ...args) {
  1522. if (isWarning) return;
  1523. isWarning = true;
  1524. pauseTracking();
  1525. const instance = stack.length ? stack[stack.length - 1].component : null;
  1526. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1527. const trace = getComponentTrace();
  1528. if (appWarnHandler) {
  1529. callWithErrorHandling(
  1530. appWarnHandler,
  1531. instance,
  1532. 11,
  1533. [
  1534. // eslint-disable-next-line no-restricted-syntax
  1535. msg + args.map((a) => {
  1536. var _a, _b;
  1537. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1538. }).join(""),
  1539. instance && instance.proxy,
  1540. trace.map(
  1541. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1542. ).join("\n"),
  1543. trace
  1544. ]
  1545. );
  1546. } else {
  1547. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1548. if (trace.length && // avoid spamming console during tests
  1549. true) {
  1550. warnArgs.push(`
  1551. `, ...formatTrace(trace));
  1552. }
  1553. console.warn(...warnArgs);
  1554. }
  1555. resetTracking();
  1556. isWarning = false;
  1557. }
  1558. function getComponentTrace() {
  1559. let currentVNode = stack[stack.length - 1];
  1560. if (!currentVNode) {
  1561. return [];
  1562. }
  1563. const normalizedStack = [];
  1564. while (currentVNode) {
  1565. const last = normalizedStack[0];
  1566. if (last && last.vnode === currentVNode) {
  1567. last.recurseCount++;
  1568. } else {
  1569. normalizedStack.push({
  1570. vnode: currentVNode,
  1571. recurseCount: 0
  1572. });
  1573. }
  1574. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1575. currentVNode = parentInstance && parentInstance.vnode;
  1576. }
  1577. return normalizedStack;
  1578. }
  1579. function formatTrace(trace) {
  1580. const logs = [];
  1581. trace.forEach((entry, i) => {
  1582. logs.push(...i === 0 ? [] : [`
  1583. `], ...formatTraceEntry(entry));
  1584. });
  1585. return logs;
  1586. }
  1587. function formatTraceEntry({ vnode, recurseCount }) {
  1588. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1589. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1590. const open = ` at <${formatComponentName(
  1591. vnode.component,
  1592. vnode.type,
  1593. isRoot
  1594. )}`;
  1595. const close = `>` + postfix;
  1596. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1597. }
  1598. function formatProps(props) {
  1599. const res = [];
  1600. const keys = Object.keys(props);
  1601. keys.slice(0, 3).forEach((key) => {
  1602. res.push(...formatProp(key, props[key]));
  1603. });
  1604. if (keys.length > 3) {
  1605. res.push(` ...`);
  1606. }
  1607. return res;
  1608. }
  1609. function formatProp(key, value, raw) {
  1610. if (isString(value)) {
  1611. value = JSON.stringify(value);
  1612. return raw ? value : [`${key}=${value}`];
  1613. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1614. return raw ? value : [`${key}=${value}`];
  1615. } else if (isRef(value)) {
  1616. value = formatProp(key, toRaw(value.value), true);
  1617. return raw ? value : [`${key}=Ref<`, value, `>`];
  1618. } else if (isFunction(value)) {
  1619. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1620. } else {
  1621. value = toRaw(value);
  1622. return raw ? value : [`${key}=`, value];
  1623. }
  1624. }
  1625. function assertNumber(val, type) {
  1626. if (val === void 0) {
  1627. return;
  1628. } else if (typeof val !== "number") {
  1629. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  1630. } else if (isNaN(val)) {
  1631. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  1632. }
  1633. }
  1634. const ErrorCodes = {
  1635. "SETUP_FUNCTION": 0,
  1636. "0": "SETUP_FUNCTION",
  1637. "RENDER_FUNCTION": 1,
  1638. "1": "RENDER_FUNCTION",
  1639. "WATCH_GETTER": 2,
  1640. "2": "WATCH_GETTER",
  1641. "WATCH_CALLBACK": 3,
  1642. "3": "WATCH_CALLBACK",
  1643. "WATCH_CLEANUP": 4,
  1644. "4": "WATCH_CLEANUP",
  1645. "NATIVE_EVENT_HANDLER": 5,
  1646. "5": "NATIVE_EVENT_HANDLER",
  1647. "COMPONENT_EVENT_HANDLER": 6,
  1648. "6": "COMPONENT_EVENT_HANDLER",
  1649. "VNODE_HOOK": 7,
  1650. "7": "VNODE_HOOK",
  1651. "DIRECTIVE_HOOK": 8,
  1652. "8": "DIRECTIVE_HOOK",
  1653. "TRANSITION_HOOK": 9,
  1654. "9": "TRANSITION_HOOK",
  1655. "APP_ERROR_HANDLER": 10,
  1656. "10": "APP_ERROR_HANDLER",
  1657. "APP_WARN_HANDLER": 11,
  1658. "11": "APP_WARN_HANDLER",
  1659. "FUNCTION_REF": 12,
  1660. "12": "FUNCTION_REF",
  1661. "ASYNC_COMPONENT_LOADER": 13,
  1662. "13": "ASYNC_COMPONENT_LOADER",
  1663. "SCHEDULER": 14,
  1664. "14": "SCHEDULER",
  1665. "COMPONENT_UPDATE": 15,
  1666. "15": "COMPONENT_UPDATE"
  1667. };
  1668. const ErrorTypeStrings$1 = {
  1669. ["sp"]: "serverPrefetch hook",
  1670. ["bc"]: "beforeCreate hook",
  1671. ["c"]: "created hook",
  1672. ["bm"]: "beforeMount hook",
  1673. ["m"]: "mounted hook",
  1674. ["bu"]: "beforeUpdate hook",
  1675. ["u"]: "updated",
  1676. ["bum"]: "beforeUnmount hook",
  1677. ["um"]: "unmounted hook",
  1678. ["a"]: "activated hook",
  1679. ["da"]: "deactivated hook",
  1680. ["ec"]: "errorCaptured hook",
  1681. ["rtc"]: "renderTracked hook",
  1682. ["rtg"]: "renderTriggered hook",
  1683. [0]: "setup function",
  1684. [1]: "render function",
  1685. [2]: "watcher getter",
  1686. [3]: "watcher callback",
  1687. [4]: "watcher cleanup function",
  1688. [5]: "native event handler",
  1689. [6]: "component event handler",
  1690. [7]: "vnode hook",
  1691. [8]: "directive hook",
  1692. [9]: "transition hook",
  1693. [10]: "app errorHandler",
  1694. [11]: "app warnHandler",
  1695. [12]: "ref function",
  1696. [13]: "async component loader",
  1697. [14]: "scheduler flush",
  1698. [15]: "component update"
  1699. };
  1700. function callWithErrorHandling(fn, instance, type, args) {
  1701. try {
  1702. return args ? fn(...args) : fn();
  1703. } catch (err) {
  1704. handleError(err, instance, type);
  1705. }
  1706. }
  1707. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1708. if (isFunction(fn)) {
  1709. const res = callWithErrorHandling(fn, instance, type, args);
  1710. if (res && isPromise(res)) {
  1711. res.catch((err) => {
  1712. handleError(err, instance, type);
  1713. });
  1714. }
  1715. return res;
  1716. }
  1717. if (isArray(fn)) {
  1718. const values = [];
  1719. for (let i = 0; i < fn.length; i++) {
  1720. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1721. }
  1722. return values;
  1723. } else {
  1724. warn$1(
  1725. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  1726. );
  1727. }
  1728. }
  1729. function handleError(err, instance, type, throwInDev = true) {
  1730. const contextVNode = instance ? instance.vnode : null;
  1731. if (instance) {
  1732. let cur = instance.parent;
  1733. const exposedInstance = instance.proxy;
  1734. const errorInfo = ErrorTypeStrings$1[type] ;
  1735. while (cur) {
  1736. const errorCapturedHooks = cur.ec;
  1737. if (errorCapturedHooks) {
  1738. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1739. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1740. return;
  1741. }
  1742. }
  1743. }
  1744. cur = cur.parent;
  1745. }
  1746. const appErrorHandler = instance.appContext.config.errorHandler;
  1747. if (appErrorHandler) {
  1748. pauseTracking();
  1749. callWithErrorHandling(
  1750. appErrorHandler,
  1751. null,
  1752. 10,
  1753. [err, exposedInstance, errorInfo]
  1754. );
  1755. resetTracking();
  1756. return;
  1757. }
  1758. }
  1759. logError(err, type, contextVNode, throwInDev);
  1760. }
  1761. function logError(err, type, contextVNode, throwInDev = true) {
  1762. {
  1763. const info = ErrorTypeStrings$1[type];
  1764. if (contextVNode) {
  1765. pushWarningContext(contextVNode);
  1766. }
  1767. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  1768. if (contextVNode) {
  1769. popWarningContext();
  1770. }
  1771. if (throwInDev) {
  1772. throw err;
  1773. } else {
  1774. console.error(err);
  1775. }
  1776. }
  1777. }
  1778. let isFlushing = false;
  1779. let isFlushPending = false;
  1780. const queue = [];
  1781. let flushIndex = 0;
  1782. const pendingPostFlushCbs = [];
  1783. let activePostFlushCbs = null;
  1784. let postFlushIndex = 0;
  1785. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1786. let currentFlushPromise = null;
  1787. const RECURSION_LIMIT = 100;
  1788. function nextTick(fn) {
  1789. const p = currentFlushPromise || resolvedPromise;
  1790. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  1791. }
  1792. function findInsertionIndex(id) {
  1793. let start = flushIndex + 1;
  1794. let end = queue.length;
  1795. while (start < end) {
  1796. const middle = start + end >>> 1;
  1797. const middleJob = queue[middle];
  1798. const middleJobId = getId(middleJob);
  1799. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1800. start = middle + 1;
  1801. } else {
  1802. end = middle;
  1803. }
  1804. }
  1805. return start;
  1806. }
  1807. function queueJob(job) {
  1808. if (!queue.length || !queue.includes(
  1809. job,
  1810. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1811. )) {
  1812. if (job.id == null) {
  1813. queue.push(job);
  1814. } else {
  1815. queue.splice(findInsertionIndex(job.id), 0, job);
  1816. }
  1817. queueFlush();
  1818. }
  1819. }
  1820. function queueFlush() {
  1821. if (!isFlushing && !isFlushPending) {
  1822. isFlushPending = true;
  1823. currentFlushPromise = resolvedPromise.then(flushJobs);
  1824. }
  1825. }
  1826. function invalidateJob(job) {
  1827. const i = queue.indexOf(job);
  1828. if (i > flushIndex) {
  1829. queue.splice(i, 1);
  1830. }
  1831. }
  1832. function queuePostFlushCb(cb) {
  1833. if (!isArray(cb)) {
  1834. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  1835. cb,
  1836. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  1837. )) {
  1838. pendingPostFlushCbs.push(cb);
  1839. }
  1840. } else {
  1841. pendingPostFlushCbs.push(...cb);
  1842. }
  1843. queueFlush();
  1844. }
  1845. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  1846. {
  1847. seen = seen || /* @__PURE__ */ new Map();
  1848. }
  1849. for (; i < queue.length; i++) {
  1850. const cb = queue[i];
  1851. if (cb && cb.pre) {
  1852. if (instance && cb.id !== instance.uid) {
  1853. continue;
  1854. }
  1855. if (checkRecursiveUpdates(seen, cb)) {
  1856. continue;
  1857. }
  1858. queue.splice(i, 1);
  1859. i--;
  1860. cb();
  1861. }
  1862. }
  1863. }
  1864. function flushPostFlushCbs(seen) {
  1865. if (pendingPostFlushCbs.length) {
  1866. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  1867. (a, b) => getId(a) - getId(b)
  1868. );
  1869. pendingPostFlushCbs.length = 0;
  1870. if (activePostFlushCbs) {
  1871. activePostFlushCbs.push(...deduped);
  1872. return;
  1873. }
  1874. activePostFlushCbs = deduped;
  1875. {
  1876. seen = seen || /* @__PURE__ */ new Map();
  1877. }
  1878. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  1879. const cb = activePostFlushCbs[postFlushIndex];
  1880. if (checkRecursiveUpdates(seen, cb)) {
  1881. continue;
  1882. }
  1883. if (cb.active !== false) cb();
  1884. }
  1885. activePostFlushCbs = null;
  1886. postFlushIndex = 0;
  1887. }
  1888. }
  1889. const getId = (job) => job.id == null ? Infinity : job.id;
  1890. const comparator = (a, b) => {
  1891. const diff = getId(a) - getId(b);
  1892. if (diff === 0) {
  1893. if (a.pre && !b.pre) return -1;
  1894. if (b.pre && !a.pre) return 1;
  1895. }
  1896. return diff;
  1897. };
  1898. function flushJobs(seen) {
  1899. isFlushPending = false;
  1900. isFlushing = true;
  1901. {
  1902. seen = seen || /* @__PURE__ */ new Map();
  1903. }
  1904. queue.sort(comparator);
  1905. const check = (job) => checkRecursiveUpdates(seen, job) ;
  1906. try {
  1907. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  1908. const job = queue[flushIndex];
  1909. if (job && job.active !== false) {
  1910. if (check(job)) {
  1911. continue;
  1912. }
  1913. callWithErrorHandling(
  1914. job,
  1915. job.i,
  1916. job.i ? 15 : 14
  1917. );
  1918. }
  1919. }
  1920. } finally {
  1921. flushIndex = 0;
  1922. queue.length = 0;
  1923. flushPostFlushCbs(seen);
  1924. isFlushing = false;
  1925. currentFlushPromise = null;
  1926. if (queue.length || pendingPostFlushCbs.length) {
  1927. flushJobs(seen);
  1928. }
  1929. }
  1930. }
  1931. function checkRecursiveUpdates(seen, fn) {
  1932. if (!seen.has(fn)) {
  1933. seen.set(fn, 1);
  1934. } else {
  1935. const count = seen.get(fn);
  1936. if (count > RECURSION_LIMIT) {
  1937. const instance = fn.i;
  1938. const componentName = instance && getComponentName(instance.type);
  1939. handleError(
  1940. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  1941. null,
  1942. 10
  1943. );
  1944. return true;
  1945. } else {
  1946. seen.set(fn, count + 1);
  1947. }
  1948. }
  1949. }
  1950. let isHmrUpdating = false;
  1951. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  1952. {
  1953. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  1954. createRecord: tryWrap(createRecord),
  1955. rerender: tryWrap(rerender),
  1956. reload: tryWrap(reload)
  1957. };
  1958. }
  1959. const map = /* @__PURE__ */ new Map();
  1960. function registerHMR(instance) {
  1961. const id = instance.type.__hmrId;
  1962. let record = map.get(id);
  1963. if (!record) {
  1964. createRecord(id, instance.type);
  1965. record = map.get(id);
  1966. }
  1967. record.instances.add(instance);
  1968. }
  1969. function unregisterHMR(instance) {
  1970. map.get(instance.type.__hmrId).instances.delete(instance);
  1971. }
  1972. function createRecord(id, initialDef) {
  1973. if (map.has(id)) {
  1974. return false;
  1975. }
  1976. map.set(id, {
  1977. initialDef: normalizeClassComponent(initialDef),
  1978. instances: /* @__PURE__ */ new Set()
  1979. });
  1980. return true;
  1981. }
  1982. function normalizeClassComponent(component) {
  1983. return isClassComponent(component) ? component.__vccOpts : component;
  1984. }
  1985. function rerender(id, newRender) {
  1986. const record = map.get(id);
  1987. if (!record) {
  1988. return;
  1989. }
  1990. record.initialDef.render = newRender;
  1991. [...record.instances].forEach((instance) => {
  1992. if (newRender) {
  1993. instance.render = newRender;
  1994. normalizeClassComponent(instance.type).render = newRender;
  1995. }
  1996. instance.renderCache = [];
  1997. isHmrUpdating = true;
  1998. instance.effect.dirty = true;
  1999. instance.update();
  2000. isHmrUpdating = false;
  2001. });
  2002. }
  2003. function reload(id, newComp) {
  2004. const record = map.get(id);
  2005. if (!record) return;
  2006. newComp = normalizeClassComponent(newComp);
  2007. updateComponentDef(record.initialDef, newComp);
  2008. const instances = [...record.instances];
  2009. for (let i = 0; i < instances.length; i++) {
  2010. const instance = instances[i];
  2011. const oldComp = normalizeClassComponent(instance.type);
  2012. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2013. if (!dirtyInstances) {
  2014. if (oldComp !== record.initialDef) {
  2015. updateComponentDef(oldComp, newComp);
  2016. }
  2017. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2018. }
  2019. dirtyInstances.add(instance);
  2020. instance.appContext.propsCache.delete(instance.type);
  2021. instance.appContext.emitsCache.delete(instance.type);
  2022. instance.appContext.optionsCache.delete(instance.type);
  2023. if (instance.ceReload) {
  2024. dirtyInstances.add(instance);
  2025. instance.ceReload(newComp.styles);
  2026. dirtyInstances.delete(instance);
  2027. } else if (instance.parent) {
  2028. instance.parent.effect.dirty = true;
  2029. queueJob(() => {
  2030. instance.parent.update();
  2031. dirtyInstances.delete(instance);
  2032. });
  2033. } else if (instance.appContext.reload) {
  2034. instance.appContext.reload();
  2035. } else if (typeof window !== "undefined") {
  2036. window.location.reload();
  2037. } else {
  2038. console.warn(
  2039. "[HMR] Root or manually mounted instance modified. Full reload required."
  2040. );
  2041. }
  2042. }
  2043. queuePostFlushCb(() => {
  2044. hmrDirtyComponents.clear();
  2045. });
  2046. }
  2047. function updateComponentDef(oldComp, newComp) {
  2048. extend(oldComp, newComp);
  2049. for (const key in oldComp) {
  2050. if (key !== "__file" && !(key in newComp)) {
  2051. delete oldComp[key];
  2052. }
  2053. }
  2054. }
  2055. function tryWrap(fn) {
  2056. return (id, arg) => {
  2057. try {
  2058. return fn(id, arg);
  2059. } catch (e) {
  2060. console.error(e);
  2061. console.warn(
  2062. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2063. );
  2064. }
  2065. };
  2066. }
  2067. let devtools$1;
  2068. let buffer = [];
  2069. let devtoolsNotInstalled = false;
  2070. function emit$1(event, ...args) {
  2071. if (devtools$1) {
  2072. devtools$1.emit(event, ...args);
  2073. } else if (!devtoolsNotInstalled) {
  2074. buffer.push({ event, args });
  2075. }
  2076. }
  2077. function setDevtoolsHook$1(hook, target) {
  2078. var _a, _b;
  2079. devtools$1 = hook;
  2080. if (devtools$1) {
  2081. devtools$1.enabled = true;
  2082. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2083. buffer = [];
  2084. } else if (
  2085. // handle late devtools injection - only do this if we are in an actual
  2086. // browser environment to avoid the timer handle stalling test runner exit
  2087. // (#4815)
  2088. typeof window !== "undefined" && // some envs mock window but not fully
  2089. window.HTMLElement && // also exclude jsdom
  2090. // eslint-disable-next-line no-restricted-syntax
  2091. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2092. ) {
  2093. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2094. replay.push((newHook) => {
  2095. setDevtoolsHook$1(newHook, target);
  2096. });
  2097. setTimeout(() => {
  2098. if (!devtools$1) {
  2099. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2100. devtoolsNotInstalled = true;
  2101. buffer = [];
  2102. }
  2103. }, 3e3);
  2104. } else {
  2105. devtoolsNotInstalled = true;
  2106. buffer = [];
  2107. }
  2108. }
  2109. function devtoolsInitApp(app, version) {
  2110. emit$1("app:init" /* APP_INIT */, app, version, {
  2111. Fragment,
  2112. Text,
  2113. Comment,
  2114. Static
  2115. });
  2116. }
  2117. function devtoolsUnmountApp(app) {
  2118. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2119. }
  2120. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  2121. "component:added" /* COMPONENT_ADDED */
  2122. );
  2123. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2124. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2125. "component:removed" /* COMPONENT_REMOVED */
  2126. );
  2127. const devtoolsComponentRemoved = (component) => {
  2128. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2129. !devtools$1.cleanupBuffer(component)) {
  2130. _devtoolsComponentRemoved(component);
  2131. }
  2132. };
  2133. /*! #__NO_SIDE_EFFECTS__ */
  2134. // @__NO_SIDE_EFFECTS__
  2135. function createDevtoolsComponentHook(hook) {
  2136. return (component) => {
  2137. emit$1(
  2138. hook,
  2139. component.appContext.app,
  2140. component.uid,
  2141. component.parent ? component.parent.uid : void 0,
  2142. component
  2143. );
  2144. };
  2145. }
  2146. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2147. "perf:start" /* PERFORMANCE_START */
  2148. );
  2149. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2150. "perf:end" /* PERFORMANCE_END */
  2151. );
  2152. function createDevtoolsPerformanceHook(hook) {
  2153. return (component, type, time) => {
  2154. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2155. };
  2156. }
  2157. function devtoolsComponentEmit(component, event, params) {
  2158. emit$1(
  2159. "component:emit" /* COMPONENT_EMIT */,
  2160. component.appContext.app,
  2161. component,
  2162. event,
  2163. params
  2164. );
  2165. }
  2166. let currentRenderingInstance = null;
  2167. let currentScopeId = null;
  2168. function setCurrentRenderingInstance(instance) {
  2169. const prev = currentRenderingInstance;
  2170. currentRenderingInstance = instance;
  2171. currentScopeId = instance && instance.type.__scopeId || null;
  2172. return prev;
  2173. }
  2174. function pushScopeId(id) {
  2175. currentScopeId = id;
  2176. }
  2177. function popScopeId() {
  2178. currentScopeId = null;
  2179. }
  2180. const withScopeId = (_id) => withCtx;
  2181. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2182. if (!ctx) return fn;
  2183. if (fn._n) {
  2184. return fn;
  2185. }
  2186. const renderFnWithContext = (...args) => {
  2187. if (renderFnWithContext._d) {
  2188. setBlockTracking(-1);
  2189. }
  2190. const prevInstance = setCurrentRenderingInstance(ctx);
  2191. let res;
  2192. try {
  2193. res = fn(...args);
  2194. } finally {
  2195. setCurrentRenderingInstance(prevInstance);
  2196. if (renderFnWithContext._d) {
  2197. setBlockTracking(1);
  2198. }
  2199. }
  2200. {
  2201. devtoolsComponentUpdated(ctx);
  2202. }
  2203. return res;
  2204. };
  2205. renderFnWithContext._n = true;
  2206. renderFnWithContext._c = true;
  2207. renderFnWithContext._d = true;
  2208. return renderFnWithContext;
  2209. }
  2210. function validateDirectiveName(name) {
  2211. if (isBuiltInDirective(name)) {
  2212. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2213. }
  2214. }
  2215. function withDirectives(vnode, directives) {
  2216. if (currentRenderingInstance === null) {
  2217. warn$1(`withDirectives can only be used inside render functions.`);
  2218. return vnode;
  2219. }
  2220. const instance = getComponentPublicInstance(currentRenderingInstance);
  2221. const bindings = vnode.dirs || (vnode.dirs = []);
  2222. for (let i = 0; i < directives.length; i++) {
  2223. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2224. if (dir) {
  2225. if (isFunction(dir)) {
  2226. dir = {
  2227. mounted: dir,
  2228. updated: dir
  2229. };
  2230. }
  2231. if (dir.deep) {
  2232. traverse(value);
  2233. }
  2234. bindings.push({
  2235. dir,
  2236. instance,
  2237. value,
  2238. oldValue: void 0,
  2239. arg,
  2240. modifiers
  2241. });
  2242. }
  2243. }
  2244. return vnode;
  2245. }
  2246. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2247. const bindings = vnode.dirs;
  2248. const oldBindings = prevVNode && prevVNode.dirs;
  2249. for (let i = 0; i < bindings.length; i++) {
  2250. const binding = bindings[i];
  2251. if (oldBindings) {
  2252. binding.oldValue = oldBindings[i].value;
  2253. }
  2254. let hook = binding.dir[name];
  2255. if (hook) {
  2256. pauseTracking();
  2257. callWithAsyncErrorHandling(hook, instance, 8, [
  2258. vnode.el,
  2259. binding,
  2260. vnode,
  2261. prevVNode
  2262. ]);
  2263. resetTracking();
  2264. }
  2265. }
  2266. }
  2267. const leaveCbKey = Symbol("_leaveCb");
  2268. const enterCbKey$1 = Symbol("_enterCb");
  2269. function useTransitionState() {
  2270. const state = {
  2271. isMounted: false,
  2272. isLeaving: false,
  2273. isUnmounting: false,
  2274. leavingVNodes: /* @__PURE__ */ new Map()
  2275. };
  2276. onMounted(() => {
  2277. state.isMounted = true;
  2278. });
  2279. onBeforeUnmount(() => {
  2280. state.isUnmounting = true;
  2281. });
  2282. return state;
  2283. }
  2284. const TransitionHookValidator = [Function, Array];
  2285. const BaseTransitionPropsValidators = {
  2286. mode: String,
  2287. appear: Boolean,
  2288. persisted: Boolean,
  2289. // enter
  2290. onBeforeEnter: TransitionHookValidator,
  2291. onEnter: TransitionHookValidator,
  2292. onAfterEnter: TransitionHookValidator,
  2293. onEnterCancelled: TransitionHookValidator,
  2294. // leave
  2295. onBeforeLeave: TransitionHookValidator,
  2296. onLeave: TransitionHookValidator,
  2297. onAfterLeave: TransitionHookValidator,
  2298. onLeaveCancelled: TransitionHookValidator,
  2299. // appear
  2300. onBeforeAppear: TransitionHookValidator,
  2301. onAppear: TransitionHookValidator,
  2302. onAfterAppear: TransitionHookValidator,
  2303. onAppearCancelled: TransitionHookValidator
  2304. };
  2305. const recursiveGetSubtree = (instance) => {
  2306. const subTree = instance.subTree;
  2307. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  2308. };
  2309. const BaseTransitionImpl = {
  2310. name: `BaseTransition`,
  2311. props: BaseTransitionPropsValidators,
  2312. setup(props, { slots }) {
  2313. const instance = getCurrentInstance();
  2314. const state = useTransitionState();
  2315. return () => {
  2316. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  2317. if (!children || !children.length) {
  2318. return;
  2319. }
  2320. let child = children[0];
  2321. if (children.length > 1) {
  2322. let hasFound = false;
  2323. for (const c of children) {
  2324. if (c.type !== Comment) {
  2325. if (hasFound) {
  2326. warn$1(
  2327. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  2328. );
  2329. break;
  2330. }
  2331. child = c;
  2332. hasFound = true;
  2333. }
  2334. }
  2335. }
  2336. const rawProps = toRaw(props);
  2337. const { mode } = rawProps;
  2338. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  2339. warn$1(`invalid <transition> mode: ${mode}`);
  2340. }
  2341. if (state.isLeaving) {
  2342. return emptyPlaceholder(child);
  2343. }
  2344. const innerChild = getKeepAliveChild(child);
  2345. if (!innerChild) {
  2346. return emptyPlaceholder(child);
  2347. }
  2348. let enterHooks = resolveTransitionHooks(
  2349. innerChild,
  2350. rawProps,
  2351. state,
  2352. instance,
  2353. // #11061, ensure enterHooks is fresh after clone
  2354. (hooks) => enterHooks = hooks
  2355. );
  2356. setTransitionHooks(innerChild, enterHooks);
  2357. const oldChild = instance.subTree;
  2358. const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
  2359. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  2360. const leavingHooks = resolveTransitionHooks(
  2361. oldInnerChild,
  2362. rawProps,
  2363. state,
  2364. instance
  2365. );
  2366. setTransitionHooks(oldInnerChild, leavingHooks);
  2367. if (mode === "out-in" && innerChild.type !== Comment) {
  2368. state.isLeaving = true;
  2369. leavingHooks.afterLeave = () => {
  2370. state.isLeaving = false;
  2371. if (instance.update.active !== false) {
  2372. instance.effect.dirty = true;
  2373. instance.update();
  2374. }
  2375. };
  2376. return emptyPlaceholder(child);
  2377. } else if (mode === "in-out" && innerChild.type !== Comment) {
  2378. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  2379. const leavingVNodesCache = getLeavingNodesForType(
  2380. state,
  2381. oldInnerChild
  2382. );
  2383. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  2384. el[leaveCbKey] = () => {
  2385. earlyRemove();
  2386. el[leaveCbKey] = void 0;
  2387. delete enterHooks.delayedLeave;
  2388. };
  2389. enterHooks.delayedLeave = delayedLeave;
  2390. };
  2391. }
  2392. }
  2393. return child;
  2394. };
  2395. }
  2396. };
  2397. const BaseTransition = BaseTransitionImpl;
  2398. function getLeavingNodesForType(state, vnode) {
  2399. const { leavingVNodes } = state;
  2400. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  2401. if (!leavingVNodesCache) {
  2402. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  2403. leavingVNodes.set(vnode.type, leavingVNodesCache);
  2404. }
  2405. return leavingVNodesCache;
  2406. }
  2407. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  2408. const {
  2409. appear,
  2410. mode,
  2411. persisted = false,
  2412. onBeforeEnter,
  2413. onEnter,
  2414. onAfterEnter,
  2415. onEnterCancelled,
  2416. onBeforeLeave,
  2417. onLeave,
  2418. onAfterLeave,
  2419. onLeaveCancelled,
  2420. onBeforeAppear,
  2421. onAppear,
  2422. onAfterAppear,
  2423. onAppearCancelled
  2424. } = props;
  2425. const key = String(vnode.key);
  2426. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  2427. const callHook = (hook, args) => {
  2428. hook && callWithAsyncErrorHandling(
  2429. hook,
  2430. instance,
  2431. 9,
  2432. args
  2433. );
  2434. };
  2435. const callAsyncHook = (hook, args) => {
  2436. const done = args[1];
  2437. callHook(hook, args);
  2438. if (isArray(hook)) {
  2439. if (hook.every((hook2) => hook2.length <= 1)) done();
  2440. } else if (hook.length <= 1) {
  2441. done();
  2442. }
  2443. };
  2444. const hooks = {
  2445. mode,
  2446. persisted,
  2447. beforeEnter(el) {
  2448. let hook = onBeforeEnter;
  2449. if (!state.isMounted) {
  2450. if (appear) {
  2451. hook = onBeforeAppear || onBeforeEnter;
  2452. } else {
  2453. return;
  2454. }
  2455. }
  2456. if (el[leaveCbKey]) {
  2457. el[leaveCbKey](
  2458. true
  2459. /* cancelled */
  2460. );
  2461. }
  2462. const leavingVNode = leavingVNodesCache[key];
  2463. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  2464. leavingVNode.el[leaveCbKey]();
  2465. }
  2466. callHook(hook, [el]);
  2467. },
  2468. enter(el) {
  2469. let hook = onEnter;
  2470. let afterHook = onAfterEnter;
  2471. let cancelHook = onEnterCancelled;
  2472. if (!state.isMounted) {
  2473. if (appear) {
  2474. hook = onAppear || onEnter;
  2475. afterHook = onAfterAppear || onAfterEnter;
  2476. cancelHook = onAppearCancelled || onEnterCancelled;
  2477. } else {
  2478. return;
  2479. }
  2480. }
  2481. let called = false;
  2482. const done = el[enterCbKey$1] = (cancelled) => {
  2483. if (called) return;
  2484. called = true;
  2485. if (cancelled) {
  2486. callHook(cancelHook, [el]);
  2487. } else {
  2488. callHook(afterHook, [el]);
  2489. }
  2490. if (hooks.delayedLeave) {
  2491. hooks.delayedLeave();
  2492. }
  2493. el[enterCbKey$1] = void 0;
  2494. };
  2495. if (hook) {
  2496. callAsyncHook(hook, [el, done]);
  2497. } else {
  2498. done();
  2499. }
  2500. },
  2501. leave(el, remove) {
  2502. const key2 = String(vnode.key);
  2503. if (el[enterCbKey$1]) {
  2504. el[enterCbKey$1](
  2505. true
  2506. /* cancelled */
  2507. );
  2508. }
  2509. if (state.isUnmounting) {
  2510. return remove();
  2511. }
  2512. callHook(onBeforeLeave, [el]);
  2513. let called = false;
  2514. const done = el[leaveCbKey] = (cancelled) => {
  2515. if (called) return;
  2516. called = true;
  2517. remove();
  2518. if (cancelled) {
  2519. callHook(onLeaveCancelled, [el]);
  2520. } else {
  2521. callHook(onAfterLeave, [el]);
  2522. }
  2523. el[leaveCbKey] = void 0;
  2524. if (leavingVNodesCache[key2] === vnode) {
  2525. delete leavingVNodesCache[key2];
  2526. }
  2527. };
  2528. leavingVNodesCache[key2] = vnode;
  2529. if (onLeave) {
  2530. callAsyncHook(onLeave, [el, done]);
  2531. } else {
  2532. done();
  2533. }
  2534. },
  2535. clone(vnode2) {
  2536. const hooks2 = resolveTransitionHooks(
  2537. vnode2,
  2538. props,
  2539. state,
  2540. instance,
  2541. postClone
  2542. );
  2543. if (postClone) postClone(hooks2);
  2544. return hooks2;
  2545. }
  2546. };
  2547. return hooks;
  2548. }
  2549. function emptyPlaceholder(vnode) {
  2550. if (isKeepAlive(vnode)) {
  2551. vnode = cloneVNode(vnode);
  2552. vnode.children = null;
  2553. return vnode;
  2554. }
  2555. }
  2556. function getKeepAliveChild(vnode) {
  2557. if (!isKeepAlive(vnode)) {
  2558. return vnode;
  2559. }
  2560. if (vnode.component) {
  2561. return vnode.component.subTree;
  2562. }
  2563. const { shapeFlag, children } = vnode;
  2564. if (children) {
  2565. if (shapeFlag & 16) {
  2566. return children[0];
  2567. }
  2568. if (shapeFlag & 32 && isFunction(children.default)) {
  2569. return children.default();
  2570. }
  2571. }
  2572. }
  2573. function setTransitionHooks(vnode, hooks) {
  2574. if (vnode.shapeFlag & 6 && vnode.component) {
  2575. setTransitionHooks(vnode.component.subTree, hooks);
  2576. } else if (vnode.shapeFlag & 128) {
  2577. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  2578. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  2579. } else {
  2580. vnode.transition = hooks;
  2581. }
  2582. }
  2583. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  2584. let ret = [];
  2585. let keyedFragmentCount = 0;
  2586. for (let i = 0; i < children.length; i++) {
  2587. let child = children[i];
  2588. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  2589. if (child.type === Fragment) {
  2590. if (child.patchFlag & 128) keyedFragmentCount++;
  2591. ret = ret.concat(
  2592. getTransitionRawChildren(child.children, keepComment, key)
  2593. );
  2594. } else if (keepComment || child.type !== Comment) {
  2595. ret.push(key != null ? cloneVNode(child, { key }) : child);
  2596. }
  2597. }
  2598. if (keyedFragmentCount > 1) {
  2599. for (let i = 0; i < ret.length; i++) {
  2600. ret[i].patchFlag = -2;
  2601. }
  2602. }
  2603. return ret;
  2604. }
  2605. /*! #__NO_SIDE_EFFECTS__ */
  2606. // @__NO_SIDE_EFFECTS__
  2607. function defineComponent(options, extraOptions) {
  2608. return isFunction(options) ? (
  2609. // #8326: extend call and options.name access are considered side-effects
  2610. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  2611. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  2612. ) : options;
  2613. }
  2614. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2615. /*! #__NO_SIDE_EFFECTS__ */
  2616. // @__NO_SIDE_EFFECTS__
  2617. function defineAsyncComponent(source) {
  2618. if (isFunction(source)) {
  2619. source = { loader: source };
  2620. }
  2621. const {
  2622. loader,
  2623. loadingComponent,
  2624. errorComponent,
  2625. delay = 200,
  2626. timeout,
  2627. // undefined = never times out
  2628. suspensible = true,
  2629. onError: userOnError
  2630. } = source;
  2631. let pendingRequest = null;
  2632. let resolvedComp;
  2633. let retries = 0;
  2634. const retry = () => {
  2635. retries++;
  2636. pendingRequest = null;
  2637. return load();
  2638. };
  2639. const load = () => {
  2640. let thisRequest;
  2641. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  2642. err = err instanceof Error ? err : new Error(String(err));
  2643. if (userOnError) {
  2644. return new Promise((resolve, reject) => {
  2645. const userRetry = () => resolve(retry());
  2646. const userFail = () => reject(err);
  2647. userOnError(err, userRetry, userFail, retries + 1);
  2648. });
  2649. } else {
  2650. throw err;
  2651. }
  2652. }).then((comp) => {
  2653. if (thisRequest !== pendingRequest && pendingRequest) {
  2654. return pendingRequest;
  2655. }
  2656. if (!comp) {
  2657. warn$1(
  2658. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  2659. );
  2660. }
  2661. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  2662. comp = comp.default;
  2663. }
  2664. if (comp && !isObject(comp) && !isFunction(comp)) {
  2665. throw new Error(`Invalid async component load result: ${comp}`);
  2666. }
  2667. resolvedComp = comp;
  2668. return comp;
  2669. }));
  2670. };
  2671. return defineComponent({
  2672. name: "AsyncComponentWrapper",
  2673. __asyncLoader: load,
  2674. get __asyncResolved() {
  2675. return resolvedComp;
  2676. },
  2677. setup() {
  2678. const instance = currentInstance;
  2679. if (resolvedComp) {
  2680. return () => createInnerComp(resolvedComp, instance);
  2681. }
  2682. const onError = (err) => {
  2683. pendingRequest = null;
  2684. handleError(
  2685. err,
  2686. instance,
  2687. 13,
  2688. !errorComponent
  2689. );
  2690. };
  2691. if (suspensible && instance.suspense || false) {
  2692. return load().then((comp) => {
  2693. return () => createInnerComp(comp, instance);
  2694. }).catch((err) => {
  2695. onError(err);
  2696. return () => errorComponent ? createVNode(errorComponent, {
  2697. error: err
  2698. }) : null;
  2699. });
  2700. }
  2701. const loaded = ref(false);
  2702. const error = ref();
  2703. const delayed = ref(!!delay);
  2704. if (delay) {
  2705. setTimeout(() => {
  2706. delayed.value = false;
  2707. }, delay);
  2708. }
  2709. if (timeout != null) {
  2710. setTimeout(() => {
  2711. if (!loaded.value && !error.value) {
  2712. const err = new Error(
  2713. `Async component timed out after ${timeout}ms.`
  2714. );
  2715. onError(err);
  2716. error.value = err;
  2717. }
  2718. }, timeout);
  2719. }
  2720. load().then(() => {
  2721. loaded.value = true;
  2722. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2723. instance.parent.effect.dirty = true;
  2724. queueJob(instance.parent.update);
  2725. }
  2726. }).catch((err) => {
  2727. onError(err);
  2728. error.value = err;
  2729. });
  2730. return () => {
  2731. if (loaded.value && resolvedComp) {
  2732. return createInnerComp(resolvedComp, instance);
  2733. } else if (error.value && errorComponent) {
  2734. return createVNode(errorComponent, {
  2735. error: error.value
  2736. });
  2737. } else if (loadingComponent && !delayed.value) {
  2738. return createVNode(loadingComponent);
  2739. }
  2740. };
  2741. }
  2742. });
  2743. }
  2744. function createInnerComp(comp, parent) {
  2745. const { ref: ref2, props, children, ce } = parent.vnode;
  2746. const vnode = createVNode(comp, props, children);
  2747. vnode.ref = ref2;
  2748. vnode.ce = ce;
  2749. delete parent.vnode.ce;
  2750. return vnode;
  2751. }
  2752. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2753. const KeepAliveImpl = {
  2754. name: `KeepAlive`,
  2755. // Marker for special handling inside the renderer. We are not using a ===
  2756. // check directly on KeepAlive in the renderer, because importing it directly
  2757. // would prevent it from being tree-shaken.
  2758. __isKeepAlive: true,
  2759. props: {
  2760. include: [String, RegExp, Array],
  2761. exclude: [String, RegExp, Array],
  2762. max: [String, Number]
  2763. },
  2764. setup(props, { slots }) {
  2765. const instance = getCurrentInstance();
  2766. const sharedContext = instance.ctx;
  2767. const cache = /* @__PURE__ */ new Map();
  2768. const keys = /* @__PURE__ */ new Set();
  2769. let current = null;
  2770. {
  2771. instance.__v_cache = cache;
  2772. }
  2773. const parentSuspense = instance.suspense;
  2774. const {
  2775. renderer: {
  2776. p: patch,
  2777. m: move,
  2778. um: _unmount,
  2779. o: { createElement }
  2780. }
  2781. } = sharedContext;
  2782. const storageContainer = createElement("div");
  2783. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2784. const instance2 = vnode.component;
  2785. move(vnode, container, anchor, 0, parentSuspense);
  2786. patch(
  2787. instance2.vnode,
  2788. vnode,
  2789. container,
  2790. anchor,
  2791. instance2,
  2792. parentSuspense,
  2793. namespace,
  2794. vnode.slotScopeIds,
  2795. optimized
  2796. );
  2797. queuePostRenderEffect(() => {
  2798. instance2.isDeactivated = false;
  2799. if (instance2.a) {
  2800. invokeArrayFns(instance2.a);
  2801. }
  2802. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2803. if (vnodeHook) {
  2804. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2805. }
  2806. }, parentSuspense);
  2807. {
  2808. devtoolsComponentAdded(instance2);
  2809. }
  2810. };
  2811. sharedContext.deactivate = (vnode) => {
  2812. const instance2 = vnode.component;
  2813. invalidateMount(instance2.m);
  2814. invalidateMount(instance2.a);
  2815. move(vnode, storageContainer, null, 1, parentSuspense);
  2816. queuePostRenderEffect(() => {
  2817. if (instance2.da) {
  2818. invokeArrayFns(instance2.da);
  2819. }
  2820. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2821. if (vnodeHook) {
  2822. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2823. }
  2824. instance2.isDeactivated = true;
  2825. }, parentSuspense);
  2826. {
  2827. devtoolsComponentAdded(instance2);
  2828. }
  2829. };
  2830. function unmount(vnode) {
  2831. resetShapeFlag(vnode);
  2832. _unmount(vnode, instance, parentSuspense, true);
  2833. }
  2834. function pruneCache(filter) {
  2835. cache.forEach((vnode, key) => {
  2836. const name = getComponentName(vnode.type);
  2837. if (name && (!filter || !filter(name))) {
  2838. pruneCacheEntry(key);
  2839. }
  2840. });
  2841. }
  2842. function pruneCacheEntry(key) {
  2843. const cached = cache.get(key);
  2844. if (cached && (!current || !isSameVNodeType(cached, current))) {
  2845. unmount(cached);
  2846. } else if (current) {
  2847. resetShapeFlag(current);
  2848. }
  2849. cache.delete(key);
  2850. keys.delete(key);
  2851. }
  2852. watch(
  2853. () => [props.include, props.exclude],
  2854. ([include, exclude]) => {
  2855. include && pruneCache((name) => matches(include, name));
  2856. exclude && pruneCache((name) => !matches(exclude, name));
  2857. },
  2858. // prune post-render after `current` has been updated
  2859. { flush: "post", deep: true }
  2860. );
  2861. let pendingCacheKey = null;
  2862. const cacheSubtree = () => {
  2863. if (pendingCacheKey != null) {
  2864. if (isSuspense(instance.subTree.type)) {
  2865. queuePostRenderEffect(() => {
  2866. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2867. }, instance.subTree.suspense);
  2868. } else {
  2869. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2870. }
  2871. }
  2872. };
  2873. onMounted(cacheSubtree);
  2874. onUpdated(cacheSubtree);
  2875. onBeforeUnmount(() => {
  2876. cache.forEach((cached) => {
  2877. const { subTree, suspense } = instance;
  2878. const vnode = getInnerChild(subTree);
  2879. if (cached.type === vnode.type && cached.key === vnode.key) {
  2880. resetShapeFlag(vnode);
  2881. const da = vnode.component.da;
  2882. da && queuePostRenderEffect(da, suspense);
  2883. return;
  2884. }
  2885. unmount(cached);
  2886. });
  2887. });
  2888. return () => {
  2889. pendingCacheKey = null;
  2890. if (!slots.default) {
  2891. return null;
  2892. }
  2893. const children = slots.default();
  2894. const rawVNode = children[0];
  2895. if (children.length > 1) {
  2896. {
  2897. warn$1(`KeepAlive should contain exactly one component child.`);
  2898. }
  2899. current = null;
  2900. return children;
  2901. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2902. current = null;
  2903. return rawVNode;
  2904. }
  2905. let vnode = getInnerChild(rawVNode);
  2906. if (vnode.type === Comment) {
  2907. current = null;
  2908. return vnode;
  2909. }
  2910. const comp = vnode.type;
  2911. const name = getComponentName(
  2912. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2913. );
  2914. const { include, exclude, max } = props;
  2915. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2916. current = vnode;
  2917. return rawVNode;
  2918. }
  2919. const key = vnode.key == null ? comp : vnode.key;
  2920. const cachedVNode = cache.get(key);
  2921. if (vnode.el) {
  2922. vnode = cloneVNode(vnode);
  2923. if (rawVNode.shapeFlag & 128) {
  2924. rawVNode.ssContent = vnode;
  2925. }
  2926. }
  2927. pendingCacheKey = key;
  2928. if (cachedVNode) {
  2929. vnode.el = cachedVNode.el;
  2930. vnode.component = cachedVNode.component;
  2931. if (vnode.transition) {
  2932. setTransitionHooks(vnode, vnode.transition);
  2933. }
  2934. vnode.shapeFlag |= 512;
  2935. keys.delete(key);
  2936. keys.add(key);
  2937. } else {
  2938. keys.add(key);
  2939. if (max && keys.size > parseInt(max, 10)) {
  2940. pruneCacheEntry(keys.values().next().value);
  2941. }
  2942. }
  2943. vnode.shapeFlag |= 256;
  2944. current = vnode;
  2945. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2946. };
  2947. }
  2948. };
  2949. const KeepAlive = KeepAliveImpl;
  2950. function matches(pattern, name) {
  2951. if (isArray(pattern)) {
  2952. return pattern.some((p) => matches(p, name));
  2953. } else if (isString(pattern)) {
  2954. return pattern.split(",").includes(name);
  2955. } else if (isRegExp(pattern)) {
  2956. return pattern.test(name);
  2957. }
  2958. return false;
  2959. }
  2960. function onActivated(hook, target) {
  2961. registerKeepAliveHook(hook, "a", target);
  2962. }
  2963. function onDeactivated(hook, target) {
  2964. registerKeepAliveHook(hook, "da", target);
  2965. }
  2966. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2967. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2968. let current = target;
  2969. while (current) {
  2970. if (current.isDeactivated) {
  2971. return;
  2972. }
  2973. current = current.parent;
  2974. }
  2975. return hook();
  2976. });
  2977. injectHook(type, wrappedHook, target);
  2978. if (target) {
  2979. let current = target.parent;
  2980. while (current && current.parent) {
  2981. if (isKeepAlive(current.parent.vnode)) {
  2982. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2983. }
  2984. current = current.parent;
  2985. }
  2986. }
  2987. }
  2988. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2989. const injected = injectHook(
  2990. type,
  2991. hook,
  2992. keepAliveRoot,
  2993. true
  2994. /* prepend */
  2995. );
  2996. onUnmounted(() => {
  2997. remove(keepAliveRoot[type], injected);
  2998. }, target);
  2999. }
  3000. function resetShapeFlag(vnode) {
  3001. vnode.shapeFlag &= ~256;
  3002. vnode.shapeFlag &= ~512;
  3003. }
  3004. function getInnerChild(vnode) {
  3005. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  3006. }
  3007. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3008. if (target) {
  3009. const hooks = target[type] || (target[type] = []);
  3010. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3011. pauseTracking();
  3012. const reset = setCurrentInstance(target);
  3013. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3014. reset();
  3015. resetTracking();
  3016. return res;
  3017. });
  3018. if (prepend) {
  3019. hooks.unshift(wrappedHook);
  3020. } else {
  3021. hooks.push(wrappedHook);
  3022. }
  3023. return wrappedHook;
  3024. } else {
  3025. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  3026. warn$1(
  3027. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
  3028. );
  3029. }
  3030. }
  3031. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  3032. if (!isInSSRComponentSetup || lifecycle === "sp") {
  3033. injectHook(lifecycle, (...args) => hook(...args), target);
  3034. }
  3035. };
  3036. const onBeforeMount = createHook("bm");
  3037. const onMounted = createHook("m");
  3038. const onBeforeUpdate = createHook("bu");
  3039. const onUpdated = createHook("u");
  3040. const onBeforeUnmount = createHook("bum");
  3041. const onUnmounted = createHook("um");
  3042. const onServerPrefetch = createHook("sp");
  3043. const onRenderTriggered = createHook(
  3044. "rtg"
  3045. );
  3046. const onRenderTracked = createHook(
  3047. "rtc"
  3048. );
  3049. function onErrorCaptured(hook, target = currentInstance) {
  3050. injectHook("ec", hook, target);
  3051. }
  3052. const COMPONENTS = "components";
  3053. const DIRECTIVES = "directives";
  3054. function resolveComponent(name, maybeSelfReference) {
  3055. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3056. }
  3057. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  3058. function resolveDynamicComponent(component) {
  3059. if (isString(component)) {
  3060. return resolveAsset(COMPONENTS, component, false) || component;
  3061. } else {
  3062. return component || NULL_DYNAMIC_COMPONENT;
  3063. }
  3064. }
  3065. function resolveDirective(name) {
  3066. return resolveAsset(DIRECTIVES, name);
  3067. }
  3068. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3069. const instance = currentRenderingInstance || currentInstance;
  3070. if (instance) {
  3071. const Component = instance.type;
  3072. if (type === COMPONENTS) {
  3073. const selfName = getComponentName(
  3074. Component,
  3075. false
  3076. );
  3077. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3078. return Component;
  3079. }
  3080. }
  3081. const res = (
  3082. // local registration
  3083. // check instance[type] first which is resolved for options API
  3084. resolve(instance[type] || Component[type], name) || // global registration
  3085. resolve(instance.appContext[type], name)
  3086. );
  3087. if (!res && maybeSelfReference) {
  3088. return Component;
  3089. }
  3090. if (warnMissing && !res) {
  3091. const extra = type === COMPONENTS ? `
  3092. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3093. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3094. }
  3095. return res;
  3096. } else {
  3097. warn$1(
  3098. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  3099. );
  3100. }
  3101. }
  3102. function resolve(registry, name) {
  3103. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3104. }
  3105. function renderList(source, renderItem, cache, index) {
  3106. let ret;
  3107. const cached = cache && cache[index];
  3108. if (isArray(source) || isString(source)) {
  3109. ret = new Array(source.length);
  3110. for (let i = 0, l = source.length; i < l; i++) {
  3111. ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
  3112. }
  3113. } else if (typeof source === "number") {
  3114. if (!Number.isInteger(source)) {
  3115. warn$1(`The v-for range expect an integer value but got ${source}.`);
  3116. }
  3117. ret = new Array(source);
  3118. for (let i = 0; i < source; i++) {
  3119. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  3120. }
  3121. } else if (isObject(source)) {
  3122. if (source[Symbol.iterator]) {
  3123. ret = Array.from(
  3124. source,
  3125. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  3126. );
  3127. } else {
  3128. const keys = Object.keys(source);
  3129. ret = new Array(keys.length);
  3130. for (let i = 0, l = keys.length; i < l; i++) {
  3131. const key = keys[i];
  3132. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  3133. }
  3134. }
  3135. } else {
  3136. ret = [];
  3137. }
  3138. if (cache) {
  3139. cache[index] = ret;
  3140. }
  3141. return ret;
  3142. }
  3143. function createSlots(slots, dynamicSlots) {
  3144. for (let i = 0; i < dynamicSlots.length; i++) {
  3145. const slot = dynamicSlots[i];
  3146. if (isArray(slot)) {
  3147. for (let j = 0; j < slot.length; j++) {
  3148. slots[slot[j].name] = slot[j].fn;
  3149. }
  3150. } else if (slot) {
  3151. slots[slot.name] = slot.key ? (...args) => {
  3152. const res = slot.fn(...args);
  3153. if (res) res.key = slot.key;
  3154. return res;
  3155. } : slot.fn;
  3156. }
  3157. }
  3158. return slots;
  3159. }
  3160. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  3161. if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
  3162. if (name !== "default") props.name = name;
  3163. return createVNode("slot", props, fallback && fallback());
  3164. }
  3165. let slot = slots[name];
  3166. if (slot && slot.length > 1) {
  3167. warn$1(
  3168. `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
  3169. );
  3170. slot = () => [];
  3171. }
  3172. if (slot && slot._c) {
  3173. slot._d = false;
  3174. }
  3175. openBlock();
  3176. const validSlotContent = slot && ensureValidVNode(slot(props));
  3177. const rendered = createBlock(
  3178. Fragment,
  3179. {
  3180. key: (props.key || // slot content array of a dynamic conditional slot may have a branch
  3181. // key attached in the `createSlots` helper, respect that
  3182. validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
  3183. (!validSlotContent && fallback ? "_fb" : "")
  3184. },
  3185. validSlotContent || (fallback ? fallback() : []),
  3186. validSlotContent && slots._ === 1 ? 64 : -2
  3187. );
  3188. if (!noSlotted && rendered.scopeId) {
  3189. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  3190. }
  3191. if (slot && slot._c) {
  3192. slot._d = true;
  3193. }
  3194. return rendered;
  3195. }
  3196. function ensureValidVNode(vnodes) {
  3197. return vnodes.some((child) => {
  3198. if (!isVNode(child)) return true;
  3199. if (child.type === Comment) return false;
  3200. if (child.type === Fragment && !ensureValidVNode(child.children))
  3201. return false;
  3202. return true;
  3203. }) ? vnodes : null;
  3204. }
  3205. function toHandlers(obj, preserveCaseIfNecessary) {
  3206. const ret = {};
  3207. if (!isObject(obj)) {
  3208. warn$1(`v-on with no argument expects an object value.`);
  3209. return ret;
  3210. }
  3211. for (const key in obj) {
  3212. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  3213. }
  3214. return ret;
  3215. }
  3216. const getPublicInstance = (i) => {
  3217. if (!i) return null;
  3218. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  3219. return getPublicInstance(i.parent);
  3220. };
  3221. const publicPropertiesMap = (
  3222. // Move PURE marker to new line to workaround compiler discarding it
  3223. // due to type annotation
  3224. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3225. $: (i) => i,
  3226. $el: (i) => i.vnode.el,
  3227. $data: (i) => i.data,
  3228. $props: (i) => shallowReadonly(i.props) ,
  3229. $attrs: (i) => shallowReadonly(i.attrs) ,
  3230. $slots: (i) => shallowReadonly(i.slots) ,
  3231. $refs: (i) => shallowReadonly(i.refs) ,
  3232. $parent: (i) => getPublicInstance(i.parent),
  3233. $root: (i) => getPublicInstance(i.root),
  3234. $emit: (i) => i.emit,
  3235. $options: (i) => resolveMergedOptions(i) ,
  3236. $forceUpdate: (i) => i.f || (i.f = () => {
  3237. i.effect.dirty = true;
  3238. queueJob(i.update);
  3239. }),
  3240. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  3241. $watch: (i) => instanceWatch.bind(i)
  3242. })
  3243. );
  3244. const isReservedPrefix = (key) => key === "_" || key === "$";
  3245. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  3246. const PublicInstanceProxyHandlers = {
  3247. get({ _: instance }, key) {
  3248. if (key === "__v_skip") {
  3249. return true;
  3250. }
  3251. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3252. if (key === "__isVue") {
  3253. return true;
  3254. }
  3255. let normalizedProps;
  3256. if (key[0] !== "$") {
  3257. const n = accessCache[key];
  3258. if (n !== void 0) {
  3259. switch (n) {
  3260. case 1 /* SETUP */:
  3261. return setupState[key];
  3262. case 2 /* DATA */:
  3263. return data[key];
  3264. case 4 /* CONTEXT */:
  3265. return ctx[key];
  3266. case 3 /* PROPS */:
  3267. return props[key];
  3268. }
  3269. } else if (hasSetupBinding(setupState, key)) {
  3270. accessCache[key] = 1 /* SETUP */;
  3271. return setupState[key];
  3272. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3273. accessCache[key] = 2 /* DATA */;
  3274. return data[key];
  3275. } else if (
  3276. // only cache other properties when instance has declared (thus stable)
  3277. // props
  3278. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  3279. ) {
  3280. accessCache[key] = 3 /* PROPS */;
  3281. return props[key];
  3282. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3283. accessCache[key] = 4 /* CONTEXT */;
  3284. return ctx[key];
  3285. } else if (shouldCacheAccess) {
  3286. accessCache[key] = 0 /* OTHER */;
  3287. }
  3288. }
  3289. const publicGetter = publicPropertiesMap[key];
  3290. let cssModule, globalProperties;
  3291. if (publicGetter) {
  3292. if (key === "$attrs") {
  3293. track(instance.attrs, "get", "");
  3294. markAttrsAccessed();
  3295. } else if (key === "$slots") {
  3296. track(instance, "get", key);
  3297. }
  3298. return publicGetter(instance);
  3299. } else if (
  3300. // css module (injected by vue-loader)
  3301. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3302. ) {
  3303. return cssModule;
  3304. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3305. accessCache[key] = 4 /* CONTEXT */;
  3306. return ctx[key];
  3307. } else if (
  3308. // global properties
  3309. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  3310. ) {
  3311. {
  3312. return globalProperties[key];
  3313. }
  3314. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3315. // to infinite warning loop
  3316. key.indexOf("__v") !== 0)) {
  3317. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  3318. warn$1(
  3319. `Property ${JSON.stringify(
  3320. key
  3321. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3322. );
  3323. } else if (instance === currentRenderingInstance) {
  3324. warn$1(
  3325. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3326. );
  3327. }
  3328. }
  3329. },
  3330. set({ _: instance }, key, value) {
  3331. const { data, setupState, ctx } = instance;
  3332. if (hasSetupBinding(setupState, key)) {
  3333. setupState[key] = value;
  3334. return true;
  3335. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  3336. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3337. return false;
  3338. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3339. data[key] = value;
  3340. return true;
  3341. } else if (hasOwn(instance.props, key)) {
  3342. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3343. return false;
  3344. }
  3345. if (key[0] === "$" && key.slice(1) in instance) {
  3346. warn$1(
  3347. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3348. );
  3349. return false;
  3350. } else {
  3351. if (key in instance.appContext.config.globalProperties) {
  3352. Object.defineProperty(ctx, key, {
  3353. enumerable: true,
  3354. configurable: true,
  3355. value
  3356. });
  3357. } else {
  3358. ctx[key] = value;
  3359. }
  3360. }
  3361. return true;
  3362. },
  3363. has({
  3364. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  3365. }, key) {
  3366. let normalizedProps;
  3367. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
  3368. },
  3369. defineProperty(target, key, descriptor) {
  3370. if (descriptor.get != null) {
  3371. target._.accessCache[key] = 0;
  3372. } else if (hasOwn(descriptor, "value")) {
  3373. this.set(target, key, descriptor.value, null);
  3374. }
  3375. return Reflect.defineProperty(target, key, descriptor);
  3376. }
  3377. };
  3378. {
  3379. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3380. warn$1(
  3381. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3382. );
  3383. return Reflect.ownKeys(target);
  3384. };
  3385. }
  3386. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
  3387. {},
  3388. PublicInstanceProxyHandlers,
  3389. {
  3390. get(target, key) {
  3391. if (key === Symbol.unscopables) {
  3392. return;
  3393. }
  3394. return PublicInstanceProxyHandlers.get(target, key, target);
  3395. },
  3396. has(_, key) {
  3397. const has = key[0] !== "_" && !isGloballyAllowed(key);
  3398. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  3399. warn$1(
  3400. `Property ${JSON.stringify(
  3401. key
  3402. )} should not start with _ which is a reserved prefix for Vue internals.`
  3403. );
  3404. }
  3405. return has;
  3406. }
  3407. }
  3408. );
  3409. function createDevRenderContext(instance) {
  3410. const target = {};
  3411. Object.defineProperty(target, `_`, {
  3412. configurable: true,
  3413. enumerable: false,
  3414. get: () => instance
  3415. });
  3416. Object.keys(publicPropertiesMap).forEach((key) => {
  3417. Object.defineProperty(target, key, {
  3418. configurable: true,
  3419. enumerable: false,
  3420. get: () => publicPropertiesMap[key](instance),
  3421. // intercepted by the proxy so no need for implementation,
  3422. // but needed to prevent set errors
  3423. set: NOOP
  3424. });
  3425. });
  3426. return target;
  3427. }
  3428. function exposePropsOnRenderContext(instance) {
  3429. const {
  3430. ctx,
  3431. propsOptions: [propsOptions]
  3432. } = instance;
  3433. if (propsOptions) {
  3434. Object.keys(propsOptions).forEach((key) => {
  3435. Object.defineProperty(ctx, key, {
  3436. enumerable: true,
  3437. configurable: true,
  3438. get: () => instance.props[key],
  3439. set: NOOP
  3440. });
  3441. });
  3442. }
  3443. }
  3444. function exposeSetupStateOnRenderContext(instance) {
  3445. const { ctx, setupState } = instance;
  3446. Object.keys(toRaw(setupState)).forEach((key) => {
  3447. if (!setupState.__isScriptSetup) {
  3448. if (isReservedPrefix(key[0])) {
  3449. warn$1(
  3450. `setup() return property ${JSON.stringify(
  3451. key
  3452. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3453. );
  3454. return;
  3455. }
  3456. Object.defineProperty(ctx, key, {
  3457. enumerable: true,
  3458. configurable: true,
  3459. get: () => setupState[key],
  3460. set: NOOP
  3461. });
  3462. }
  3463. });
  3464. }
  3465. const warnRuntimeUsage = (method) => warn$1(
  3466. `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
  3467. );
  3468. function defineProps() {
  3469. {
  3470. warnRuntimeUsage(`defineProps`);
  3471. }
  3472. return null;
  3473. }
  3474. function defineEmits() {
  3475. {
  3476. warnRuntimeUsage(`defineEmits`);
  3477. }
  3478. return null;
  3479. }
  3480. function defineExpose(exposed) {
  3481. {
  3482. warnRuntimeUsage(`defineExpose`);
  3483. }
  3484. }
  3485. function defineOptions(options) {
  3486. {
  3487. warnRuntimeUsage(`defineOptions`);
  3488. }
  3489. }
  3490. function defineSlots() {
  3491. {
  3492. warnRuntimeUsage(`defineSlots`);
  3493. }
  3494. return null;
  3495. }
  3496. function defineModel() {
  3497. {
  3498. warnRuntimeUsage("defineModel");
  3499. }
  3500. }
  3501. function withDefaults(props, defaults) {
  3502. {
  3503. warnRuntimeUsage(`withDefaults`);
  3504. }
  3505. return null;
  3506. }
  3507. function useSlots() {
  3508. return getContext().slots;
  3509. }
  3510. function useAttrs() {
  3511. return getContext().attrs;
  3512. }
  3513. function getContext() {
  3514. const i = getCurrentInstance();
  3515. if (!i) {
  3516. warn$1(`useContext() called without active instance.`);
  3517. }
  3518. return i.setupContext || (i.setupContext = createSetupContext(i));
  3519. }
  3520. function normalizePropsOrEmits(props) {
  3521. return isArray(props) ? props.reduce(
  3522. (normalized, p) => (normalized[p] = null, normalized),
  3523. {}
  3524. ) : props;
  3525. }
  3526. function mergeDefaults(raw, defaults) {
  3527. const props = normalizePropsOrEmits(raw);
  3528. for (const key in defaults) {
  3529. if (key.startsWith("__skip")) continue;
  3530. let opt = props[key];
  3531. if (opt) {
  3532. if (isArray(opt) || isFunction(opt)) {
  3533. opt = props[key] = { type: opt, default: defaults[key] };
  3534. } else {
  3535. opt.default = defaults[key];
  3536. }
  3537. } else if (opt === null) {
  3538. opt = props[key] = { default: defaults[key] };
  3539. } else {
  3540. warn$1(`props default key "${key}" has no corresponding declaration.`);
  3541. }
  3542. if (opt && defaults[`__skip_${key}`]) {
  3543. opt.skipFactory = true;
  3544. }
  3545. }
  3546. return props;
  3547. }
  3548. function mergeModels(a, b) {
  3549. if (!a || !b) return a || b;
  3550. if (isArray(a) && isArray(b)) return a.concat(b);
  3551. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  3552. }
  3553. function createPropsRestProxy(props, excludedKeys) {
  3554. const ret = {};
  3555. for (const key in props) {
  3556. if (!excludedKeys.includes(key)) {
  3557. Object.defineProperty(ret, key, {
  3558. enumerable: true,
  3559. get: () => props[key]
  3560. });
  3561. }
  3562. }
  3563. return ret;
  3564. }
  3565. function withAsyncContext(getAwaitable) {
  3566. const ctx = getCurrentInstance();
  3567. if (!ctx) {
  3568. warn$1(
  3569. `withAsyncContext called without active current instance. This is likely a bug.`
  3570. );
  3571. }
  3572. let awaitable = getAwaitable();
  3573. unsetCurrentInstance();
  3574. if (isPromise(awaitable)) {
  3575. awaitable = awaitable.catch((e) => {
  3576. setCurrentInstance(ctx);
  3577. throw e;
  3578. });
  3579. }
  3580. return [awaitable, () => setCurrentInstance(ctx)];
  3581. }
  3582. function createDuplicateChecker() {
  3583. const cache = /* @__PURE__ */ Object.create(null);
  3584. return (type, key) => {
  3585. if (cache[key]) {
  3586. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3587. } else {
  3588. cache[key] = type;
  3589. }
  3590. };
  3591. }
  3592. let shouldCacheAccess = true;
  3593. function applyOptions(instance) {
  3594. const options = resolveMergedOptions(instance);
  3595. const publicThis = instance.proxy;
  3596. const ctx = instance.ctx;
  3597. shouldCacheAccess = false;
  3598. if (options.beforeCreate) {
  3599. callHook$1(options.beforeCreate, instance, "bc");
  3600. }
  3601. const {
  3602. // state
  3603. data: dataOptions,
  3604. computed: computedOptions,
  3605. methods,
  3606. watch: watchOptions,
  3607. provide: provideOptions,
  3608. inject: injectOptions,
  3609. // lifecycle
  3610. created,
  3611. beforeMount,
  3612. mounted,
  3613. beforeUpdate,
  3614. updated,
  3615. activated,
  3616. deactivated,
  3617. beforeDestroy,
  3618. beforeUnmount,
  3619. destroyed,
  3620. unmounted,
  3621. render,
  3622. renderTracked,
  3623. renderTriggered,
  3624. errorCaptured,
  3625. serverPrefetch,
  3626. // public API
  3627. expose,
  3628. inheritAttrs,
  3629. // assets
  3630. components,
  3631. directives,
  3632. filters
  3633. } = options;
  3634. const checkDuplicateProperties = createDuplicateChecker() ;
  3635. {
  3636. const [propsOptions] = instance.propsOptions;
  3637. if (propsOptions) {
  3638. for (const key in propsOptions) {
  3639. checkDuplicateProperties("Props" /* PROPS */, key);
  3640. }
  3641. }
  3642. }
  3643. if (injectOptions) {
  3644. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3645. }
  3646. if (methods) {
  3647. for (const key in methods) {
  3648. const methodHandler = methods[key];
  3649. if (isFunction(methodHandler)) {
  3650. {
  3651. Object.defineProperty(ctx, key, {
  3652. value: methodHandler.bind(publicThis),
  3653. configurable: true,
  3654. enumerable: true,
  3655. writable: true
  3656. });
  3657. }
  3658. {
  3659. checkDuplicateProperties("Methods" /* METHODS */, key);
  3660. }
  3661. } else {
  3662. warn$1(
  3663. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3664. );
  3665. }
  3666. }
  3667. }
  3668. if (dataOptions) {
  3669. if (!isFunction(dataOptions)) {
  3670. warn$1(
  3671. `The data option must be a function. Plain object usage is no longer supported.`
  3672. );
  3673. }
  3674. const data = dataOptions.call(publicThis, publicThis);
  3675. if (isPromise(data)) {
  3676. warn$1(
  3677. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3678. );
  3679. }
  3680. if (!isObject(data)) {
  3681. warn$1(`data() should return an object.`);
  3682. } else {
  3683. instance.data = reactive(data);
  3684. {
  3685. for (const key in data) {
  3686. checkDuplicateProperties("Data" /* DATA */, key);
  3687. if (!isReservedPrefix(key[0])) {
  3688. Object.defineProperty(ctx, key, {
  3689. configurable: true,
  3690. enumerable: true,
  3691. get: () => data[key],
  3692. set: NOOP
  3693. });
  3694. }
  3695. }
  3696. }
  3697. }
  3698. }
  3699. shouldCacheAccess = true;
  3700. if (computedOptions) {
  3701. for (const key in computedOptions) {
  3702. const opt = computedOptions[key];
  3703. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3704. if (get === NOOP) {
  3705. warn$1(`Computed property "${key}" has no getter.`);
  3706. }
  3707. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3708. warn$1(
  3709. `Write operation failed: computed property "${key}" is readonly.`
  3710. );
  3711. } ;
  3712. const c = computed({
  3713. get,
  3714. set
  3715. });
  3716. Object.defineProperty(ctx, key, {
  3717. enumerable: true,
  3718. configurable: true,
  3719. get: () => c.value,
  3720. set: (v) => c.value = v
  3721. });
  3722. {
  3723. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  3724. }
  3725. }
  3726. }
  3727. if (watchOptions) {
  3728. for (const key in watchOptions) {
  3729. createWatcher(watchOptions[key], ctx, publicThis, key);
  3730. }
  3731. }
  3732. if (provideOptions) {
  3733. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3734. Reflect.ownKeys(provides).forEach((key) => {
  3735. provide(key, provides[key]);
  3736. });
  3737. }
  3738. if (created) {
  3739. callHook$1(created, instance, "c");
  3740. }
  3741. function registerLifecycleHook(register, hook) {
  3742. if (isArray(hook)) {
  3743. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3744. } else if (hook) {
  3745. register(hook.bind(publicThis));
  3746. }
  3747. }
  3748. registerLifecycleHook(onBeforeMount, beforeMount);
  3749. registerLifecycleHook(onMounted, mounted);
  3750. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3751. registerLifecycleHook(onUpdated, updated);
  3752. registerLifecycleHook(onActivated, activated);
  3753. registerLifecycleHook(onDeactivated, deactivated);
  3754. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3755. registerLifecycleHook(onRenderTracked, renderTracked);
  3756. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3757. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3758. registerLifecycleHook(onUnmounted, unmounted);
  3759. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3760. if (isArray(expose)) {
  3761. if (expose.length) {
  3762. const exposed = instance.exposed || (instance.exposed = {});
  3763. expose.forEach((key) => {
  3764. Object.defineProperty(exposed, key, {
  3765. get: () => publicThis[key],
  3766. set: (val) => publicThis[key] = val
  3767. });
  3768. });
  3769. } else if (!instance.exposed) {
  3770. instance.exposed = {};
  3771. }
  3772. }
  3773. if (render && instance.render === NOOP) {
  3774. instance.render = render;
  3775. }
  3776. if (inheritAttrs != null) {
  3777. instance.inheritAttrs = inheritAttrs;
  3778. }
  3779. if (components) instance.components = components;
  3780. if (directives) instance.directives = directives;
  3781. }
  3782. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3783. if (isArray(injectOptions)) {
  3784. injectOptions = normalizeInject(injectOptions);
  3785. }
  3786. for (const key in injectOptions) {
  3787. const opt = injectOptions[key];
  3788. let injected;
  3789. if (isObject(opt)) {
  3790. if ("default" in opt) {
  3791. injected = inject(
  3792. opt.from || key,
  3793. opt.default,
  3794. true
  3795. );
  3796. } else {
  3797. injected = inject(opt.from || key);
  3798. }
  3799. } else {
  3800. injected = inject(opt);
  3801. }
  3802. if (isRef(injected)) {
  3803. Object.defineProperty(ctx, key, {
  3804. enumerable: true,
  3805. configurable: true,
  3806. get: () => injected.value,
  3807. set: (v) => injected.value = v
  3808. });
  3809. } else {
  3810. ctx[key] = injected;
  3811. }
  3812. {
  3813. checkDuplicateProperties("Inject" /* INJECT */, key);
  3814. }
  3815. }
  3816. }
  3817. function callHook$1(hook, instance, type) {
  3818. callWithAsyncErrorHandling(
  3819. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  3820. instance,
  3821. type
  3822. );
  3823. }
  3824. function createWatcher(raw, ctx, publicThis, key) {
  3825. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3826. if (isString(raw)) {
  3827. const handler = ctx[raw];
  3828. if (isFunction(handler)) {
  3829. watch(getter, handler);
  3830. } else {
  3831. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3832. }
  3833. } else if (isFunction(raw)) {
  3834. watch(getter, raw.bind(publicThis));
  3835. } else if (isObject(raw)) {
  3836. if (isArray(raw)) {
  3837. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3838. } else {
  3839. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3840. if (isFunction(handler)) {
  3841. watch(getter, handler, raw);
  3842. } else {
  3843. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3844. }
  3845. }
  3846. } else {
  3847. warn$1(`Invalid watch option: "${key}"`, raw);
  3848. }
  3849. }
  3850. function resolveMergedOptions(instance) {
  3851. const base = instance.type;
  3852. const { mixins, extends: extendsOptions } = base;
  3853. const {
  3854. mixins: globalMixins,
  3855. optionsCache: cache,
  3856. config: { optionMergeStrategies }
  3857. } = instance.appContext;
  3858. const cached = cache.get(base);
  3859. let resolved;
  3860. if (cached) {
  3861. resolved = cached;
  3862. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3863. {
  3864. resolved = base;
  3865. }
  3866. } else {
  3867. resolved = {};
  3868. if (globalMixins.length) {
  3869. globalMixins.forEach(
  3870. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3871. );
  3872. }
  3873. mergeOptions(resolved, base, optionMergeStrategies);
  3874. }
  3875. if (isObject(base)) {
  3876. cache.set(base, resolved);
  3877. }
  3878. return resolved;
  3879. }
  3880. function mergeOptions(to, from, strats, asMixin = false) {
  3881. const { mixins, extends: extendsOptions } = from;
  3882. if (extendsOptions) {
  3883. mergeOptions(to, extendsOptions, strats, true);
  3884. }
  3885. if (mixins) {
  3886. mixins.forEach(
  3887. (m) => mergeOptions(to, m, strats, true)
  3888. );
  3889. }
  3890. for (const key in from) {
  3891. if (asMixin && key === "expose") {
  3892. warn$1(
  3893. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3894. );
  3895. } else {
  3896. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3897. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3898. }
  3899. }
  3900. return to;
  3901. }
  3902. const internalOptionMergeStrats = {
  3903. data: mergeDataFn,
  3904. props: mergeEmitsOrPropsOptions,
  3905. emits: mergeEmitsOrPropsOptions,
  3906. // objects
  3907. methods: mergeObjectOptions,
  3908. computed: mergeObjectOptions,
  3909. // lifecycle
  3910. beforeCreate: mergeAsArray,
  3911. created: mergeAsArray,
  3912. beforeMount: mergeAsArray,
  3913. mounted: mergeAsArray,
  3914. beforeUpdate: mergeAsArray,
  3915. updated: mergeAsArray,
  3916. beforeDestroy: mergeAsArray,
  3917. beforeUnmount: mergeAsArray,
  3918. destroyed: mergeAsArray,
  3919. unmounted: mergeAsArray,
  3920. activated: mergeAsArray,
  3921. deactivated: mergeAsArray,
  3922. errorCaptured: mergeAsArray,
  3923. serverPrefetch: mergeAsArray,
  3924. // assets
  3925. components: mergeObjectOptions,
  3926. directives: mergeObjectOptions,
  3927. // watch
  3928. watch: mergeWatchOptions,
  3929. // provide / inject
  3930. provide: mergeDataFn,
  3931. inject: mergeInject
  3932. };
  3933. function mergeDataFn(to, from) {
  3934. if (!from) {
  3935. return to;
  3936. }
  3937. if (!to) {
  3938. return from;
  3939. }
  3940. return function mergedDataFn() {
  3941. return (extend)(
  3942. isFunction(to) ? to.call(this, this) : to,
  3943. isFunction(from) ? from.call(this, this) : from
  3944. );
  3945. };
  3946. }
  3947. function mergeInject(to, from) {
  3948. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3949. }
  3950. function normalizeInject(raw) {
  3951. if (isArray(raw)) {
  3952. const res = {};
  3953. for (let i = 0; i < raw.length; i++) {
  3954. res[raw[i]] = raw[i];
  3955. }
  3956. return res;
  3957. }
  3958. return raw;
  3959. }
  3960. function mergeAsArray(to, from) {
  3961. return to ? [...new Set([].concat(to, from))] : from;
  3962. }
  3963. function mergeObjectOptions(to, from) {
  3964. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3965. }
  3966. function mergeEmitsOrPropsOptions(to, from) {
  3967. if (to) {
  3968. if (isArray(to) && isArray(from)) {
  3969. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3970. }
  3971. return extend(
  3972. /* @__PURE__ */ Object.create(null),
  3973. normalizePropsOrEmits(to),
  3974. normalizePropsOrEmits(from != null ? from : {})
  3975. );
  3976. } else {
  3977. return from;
  3978. }
  3979. }
  3980. function mergeWatchOptions(to, from) {
  3981. if (!to) return from;
  3982. if (!from) return to;
  3983. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3984. for (const key in from) {
  3985. merged[key] = mergeAsArray(to[key], from[key]);
  3986. }
  3987. return merged;
  3988. }
  3989. function createAppContext() {
  3990. return {
  3991. app: null,
  3992. config: {
  3993. isNativeTag: NO,
  3994. performance: false,
  3995. globalProperties: {},
  3996. optionMergeStrategies: {},
  3997. errorHandler: void 0,
  3998. warnHandler: void 0,
  3999. compilerOptions: {}
  4000. },
  4001. mixins: [],
  4002. components: {},
  4003. directives: {},
  4004. provides: /* @__PURE__ */ Object.create(null),
  4005. optionsCache: /* @__PURE__ */ new WeakMap(),
  4006. propsCache: /* @__PURE__ */ new WeakMap(),
  4007. emitsCache: /* @__PURE__ */ new WeakMap()
  4008. };
  4009. }
  4010. let uid$1 = 0;
  4011. function createAppAPI(render, hydrate) {
  4012. return function createApp(rootComponent, rootProps = null) {
  4013. if (!isFunction(rootComponent)) {
  4014. rootComponent = extend({}, rootComponent);
  4015. }
  4016. if (rootProps != null && !isObject(rootProps)) {
  4017. warn$1(`root props passed to app.mount() must be an object.`);
  4018. rootProps = null;
  4019. }
  4020. const context = createAppContext();
  4021. const installedPlugins = /* @__PURE__ */ new WeakSet();
  4022. let isMounted = false;
  4023. const app = context.app = {
  4024. _uid: uid$1++,
  4025. _component: rootComponent,
  4026. _props: rootProps,
  4027. _container: null,
  4028. _context: context,
  4029. _instance: null,
  4030. version,
  4031. get config() {
  4032. return context.config;
  4033. },
  4034. set config(v) {
  4035. {
  4036. warn$1(
  4037. `app.config cannot be replaced. Modify individual options instead.`
  4038. );
  4039. }
  4040. },
  4041. use(plugin, ...options) {
  4042. if (installedPlugins.has(plugin)) {
  4043. warn$1(`Plugin has already been applied to target app.`);
  4044. } else if (plugin && isFunction(plugin.install)) {
  4045. installedPlugins.add(plugin);
  4046. plugin.install(app, ...options);
  4047. } else if (isFunction(plugin)) {
  4048. installedPlugins.add(plugin);
  4049. plugin(app, ...options);
  4050. } else {
  4051. warn$1(
  4052. `A plugin must either be a function or an object with an "install" function.`
  4053. );
  4054. }
  4055. return app;
  4056. },
  4057. mixin(mixin) {
  4058. {
  4059. if (!context.mixins.includes(mixin)) {
  4060. context.mixins.push(mixin);
  4061. } else {
  4062. warn$1(
  4063. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  4064. );
  4065. }
  4066. }
  4067. return app;
  4068. },
  4069. component(name, component) {
  4070. {
  4071. validateComponentName(name, context.config);
  4072. }
  4073. if (!component) {
  4074. return context.components[name];
  4075. }
  4076. if (context.components[name]) {
  4077. warn$1(`Component "${name}" has already been registered in target app.`);
  4078. }
  4079. context.components[name] = component;
  4080. return app;
  4081. },
  4082. directive(name, directive) {
  4083. {
  4084. validateDirectiveName(name);
  4085. }
  4086. if (!directive) {
  4087. return context.directives[name];
  4088. }
  4089. if (context.directives[name]) {
  4090. warn$1(`Directive "${name}" has already been registered in target app.`);
  4091. }
  4092. context.directives[name] = directive;
  4093. return app;
  4094. },
  4095. mount(rootContainer, isHydrate, namespace) {
  4096. if (!isMounted) {
  4097. if (rootContainer.__vue_app__) {
  4098. warn$1(
  4099. `There is already an app instance mounted on the host container.
  4100. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  4101. );
  4102. }
  4103. const vnode = createVNode(rootComponent, rootProps);
  4104. vnode.appContext = context;
  4105. if (namespace === true) {
  4106. namespace = "svg";
  4107. } else if (namespace === false) {
  4108. namespace = void 0;
  4109. }
  4110. {
  4111. context.reload = () => {
  4112. render(
  4113. cloneVNode(vnode),
  4114. rootContainer,
  4115. namespace
  4116. );
  4117. };
  4118. }
  4119. if (isHydrate && hydrate) {
  4120. hydrate(vnode, rootContainer);
  4121. } else {
  4122. render(vnode, rootContainer, namespace);
  4123. }
  4124. isMounted = true;
  4125. app._container = rootContainer;
  4126. rootContainer.__vue_app__ = app;
  4127. {
  4128. app._instance = vnode.component;
  4129. devtoolsInitApp(app, version);
  4130. }
  4131. return getComponentPublicInstance(vnode.component);
  4132. } else {
  4133. warn$1(
  4134. `App has already been mounted.
  4135. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
  4136. );
  4137. }
  4138. },
  4139. unmount() {
  4140. if (isMounted) {
  4141. render(null, app._container);
  4142. {
  4143. app._instance = null;
  4144. devtoolsUnmountApp(app);
  4145. }
  4146. delete app._container.__vue_app__;
  4147. } else {
  4148. warn$1(`Cannot unmount an app that is not mounted.`);
  4149. }
  4150. },
  4151. provide(key, value) {
  4152. if (key in context.provides) {
  4153. warn$1(
  4154. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  4155. );
  4156. }
  4157. context.provides[key] = value;
  4158. return app;
  4159. },
  4160. runWithContext(fn) {
  4161. const lastApp = currentApp;
  4162. currentApp = app;
  4163. try {
  4164. return fn();
  4165. } finally {
  4166. currentApp = lastApp;
  4167. }
  4168. }
  4169. };
  4170. return app;
  4171. };
  4172. }
  4173. let currentApp = null;
  4174. function provide(key, value) {
  4175. if (!currentInstance) {
  4176. {
  4177. warn$1(`provide() can only be used inside setup().`);
  4178. }
  4179. } else {
  4180. let provides = currentInstance.provides;
  4181. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  4182. if (parentProvides === provides) {
  4183. provides = currentInstance.provides = Object.create(parentProvides);
  4184. }
  4185. provides[key] = value;
  4186. }
  4187. }
  4188. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  4189. const instance = currentInstance || currentRenderingInstance;
  4190. if (instance || currentApp) {
  4191. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  4192. if (provides && key in provides) {
  4193. return provides[key];
  4194. } else if (arguments.length > 1) {
  4195. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  4196. } else {
  4197. warn$1(`injection "${String(key)}" not found.`);
  4198. }
  4199. } else {
  4200. warn$1(`inject() can only be used inside setup() or functional components.`);
  4201. }
  4202. }
  4203. function hasInjectionContext() {
  4204. return !!(currentInstance || currentRenderingInstance || currentApp);
  4205. }
  4206. const internalObjectProto = {};
  4207. const createInternalObject = () => Object.create(internalObjectProto);
  4208. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  4209. function initProps(instance, rawProps, isStateful, isSSR = false) {
  4210. const props = {};
  4211. const attrs = createInternalObject();
  4212. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4213. setFullProps(instance, rawProps, props, attrs);
  4214. for (const key in instance.propsOptions[0]) {
  4215. if (!(key in props)) {
  4216. props[key] = void 0;
  4217. }
  4218. }
  4219. {
  4220. validateProps(rawProps || {}, props, instance);
  4221. }
  4222. if (isStateful) {
  4223. instance.props = isSSR ? props : shallowReactive(props);
  4224. } else {
  4225. if (!instance.type.props) {
  4226. instance.props = attrs;
  4227. } else {
  4228. instance.props = props;
  4229. }
  4230. }
  4231. instance.attrs = attrs;
  4232. }
  4233. function isInHmrContext(instance) {
  4234. while (instance) {
  4235. if (instance.type.__hmrId) return true;
  4236. instance = instance.parent;
  4237. }
  4238. }
  4239. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4240. const {
  4241. props,
  4242. attrs,
  4243. vnode: { patchFlag }
  4244. } = instance;
  4245. const rawCurrentProps = toRaw(props);
  4246. const [options] = instance.propsOptions;
  4247. let hasAttrsChanged = false;
  4248. if (
  4249. // always force full diff in dev
  4250. // - #1942 if hmr is enabled with sfc component
  4251. // - vite#872 non-sfc component used by sfc component
  4252. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4253. ) {
  4254. if (patchFlag & 8) {
  4255. const propsToUpdate = instance.vnode.dynamicProps;
  4256. for (let i = 0; i < propsToUpdate.length; i++) {
  4257. let key = propsToUpdate[i];
  4258. if (isEmitListener(instance.emitsOptions, key)) {
  4259. continue;
  4260. }
  4261. const value = rawProps[key];
  4262. if (options) {
  4263. if (hasOwn(attrs, key)) {
  4264. if (value !== attrs[key]) {
  4265. attrs[key] = value;
  4266. hasAttrsChanged = true;
  4267. }
  4268. } else {
  4269. const camelizedKey = camelize(key);
  4270. props[camelizedKey] = resolvePropValue(
  4271. options,
  4272. rawCurrentProps,
  4273. camelizedKey,
  4274. value,
  4275. instance,
  4276. false
  4277. );
  4278. }
  4279. } else {
  4280. if (value !== attrs[key]) {
  4281. attrs[key] = value;
  4282. hasAttrsChanged = true;
  4283. }
  4284. }
  4285. }
  4286. }
  4287. } else {
  4288. if (setFullProps(instance, rawProps, props, attrs)) {
  4289. hasAttrsChanged = true;
  4290. }
  4291. let kebabKey;
  4292. for (const key in rawCurrentProps) {
  4293. if (!rawProps || // for camelCase
  4294. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4295. // and converted to camelCase (#955)
  4296. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  4297. if (options) {
  4298. if (rawPrevProps && // for camelCase
  4299. (rawPrevProps[key] !== void 0 || // for kebab-case
  4300. rawPrevProps[kebabKey] !== void 0)) {
  4301. props[key] = resolvePropValue(
  4302. options,
  4303. rawCurrentProps,
  4304. key,
  4305. void 0,
  4306. instance,
  4307. true
  4308. );
  4309. }
  4310. } else {
  4311. delete props[key];
  4312. }
  4313. }
  4314. }
  4315. if (attrs !== rawCurrentProps) {
  4316. for (const key in attrs) {
  4317. if (!rawProps || !hasOwn(rawProps, key) && true) {
  4318. delete attrs[key];
  4319. hasAttrsChanged = true;
  4320. }
  4321. }
  4322. }
  4323. }
  4324. if (hasAttrsChanged) {
  4325. trigger(instance.attrs, "set", "");
  4326. }
  4327. {
  4328. validateProps(rawProps || {}, props, instance);
  4329. }
  4330. }
  4331. function setFullProps(instance, rawProps, props, attrs) {
  4332. const [options, needCastKeys] = instance.propsOptions;
  4333. let hasAttrsChanged = false;
  4334. let rawCastValues;
  4335. if (rawProps) {
  4336. for (let key in rawProps) {
  4337. if (isReservedProp(key)) {
  4338. continue;
  4339. }
  4340. const value = rawProps[key];
  4341. let camelKey;
  4342. if (options && hasOwn(options, camelKey = camelize(key))) {
  4343. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4344. props[camelKey] = value;
  4345. } else {
  4346. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4347. }
  4348. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4349. if (!(key in attrs) || value !== attrs[key]) {
  4350. attrs[key] = value;
  4351. hasAttrsChanged = true;
  4352. }
  4353. }
  4354. }
  4355. }
  4356. if (needCastKeys) {
  4357. const rawCurrentProps = toRaw(props);
  4358. const castValues = rawCastValues || EMPTY_OBJ;
  4359. for (let i = 0; i < needCastKeys.length; i++) {
  4360. const key = needCastKeys[i];
  4361. props[key] = resolvePropValue(
  4362. options,
  4363. rawCurrentProps,
  4364. key,
  4365. castValues[key],
  4366. instance,
  4367. !hasOwn(castValues, key)
  4368. );
  4369. }
  4370. }
  4371. return hasAttrsChanged;
  4372. }
  4373. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4374. const opt = options[key];
  4375. if (opt != null) {
  4376. const hasDefault = hasOwn(opt, "default");
  4377. if (hasDefault && value === void 0) {
  4378. const defaultValue = opt.default;
  4379. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  4380. const { propsDefaults } = instance;
  4381. if (key in propsDefaults) {
  4382. value = propsDefaults[key];
  4383. } else {
  4384. const reset = setCurrentInstance(instance);
  4385. value = propsDefaults[key] = defaultValue.call(
  4386. null,
  4387. props
  4388. );
  4389. reset();
  4390. }
  4391. } else {
  4392. value = defaultValue;
  4393. }
  4394. }
  4395. if (opt[0 /* shouldCast */]) {
  4396. if (isAbsent && !hasDefault) {
  4397. value = false;
  4398. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  4399. value = true;
  4400. }
  4401. }
  4402. }
  4403. return value;
  4404. }
  4405. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  4406. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4407. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  4408. const cached = cache.get(comp);
  4409. if (cached) {
  4410. return cached;
  4411. }
  4412. const raw = comp.props;
  4413. const normalized = {};
  4414. const needCastKeys = [];
  4415. let hasExtends = false;
  4416. if (!isFunction(comp)) {
  4417. const extendProps = (raw2) => {
  4418. hasExtends = true;
  4419. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4420. extend(normalized, props);
  4421. if (keys) needCastKeys.push(...keys);
  4422. };
  4423. if (!asMixin && appContext.mixins.length) {
  4424. appContext.mixins.forEach(extendProps);
  4425. }
  4426. if (comp.extends) {
  4427. extendProps(comp.extends);
  4428. }
  4429. if (comp.mixins) {
  4430. comp.mixins.forEach(extendProps);
  4431. }
  4432. }
  4433. if (!raw && !hasExtends) {
  4434. if (isObject(comp)) {
  4435. cache.set(comp, EMPTY_ARR);
  4436. }
  4437. return EMPTY_ARR;
  4438. }
  4439. if (isArray(raw)) {
  4440. for (let i = 0; i < raw.length; i++) {
  4441. if (!isString(raw[i])) {
  4442. warn$1(`props must be strings when using array syntax.`, raw[i]);
  4443. }
  4444. const normalizedKey = camelize(raw[i]);
  4445. if (validatePropName(normalizedKey)) {
  4446. normalized[normalizedKey] = EMPTY_OBJ;
  4447. }
  4448. }
  4449. } else if (raw) {
  4450. if (!isObject(raw)) {
  4451. warn$1(`invalid props options`, raw);
  4452. }
  4453. for (const key in raw) {
  4454. const normalizedKey = camelize(key);
  4455. if (validatePropName(normalizedKey)) {
  4456. const opt = raw[key];
  4457. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  4458. const propType = prop.type;
  4459. let shouldCast = false;
  4460. let shouldCastTrue = true;
  4461. if (isArray(propType)) {
  4462. for (let index = 0; index < propType.length; ++index) {
  4463. const type = propType[index];
  4464. const typeName = isFunction(type) && type.name;
  4465. if (typeName === "Boolean") {
  4466. shouldCast = true;
  4467. break;
  4468. } else if (typeName === "String") {
  4469. shouldCastTrue = false;
  4470. }
  4471. }
  4472. } else {
  4473. shouldCast = isFunction(propType) && propType.name === "Boolean";
  4474. }
  4475. prop[0 /* shouldCast */] = shouldCast;
  4476. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  4477. if (shouldCast || hasOwn(prop, "default")) {
  4478. needCastKeys.push(normalizedKey);
  4479. }
  4480. }
  4481. }
  4482. }
  4483. const res = [normalized, needCastKeys];
  4484. if (isObject(comp)) {
  4485. cache.set(comp, res);
  4486. }
  4487. return res;
  4488. }
  4489. function validatePropName(key) {
  4490. if (key[0] !== "$" && !isReservedProp(key)) {
  4491. return true;
  4492. } else {
  4493. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  4494. }
  4495. return false;
  4496. }
  4497. function getType(ctor) {
  4498. if (ctor === null) {
  4499. return "null";
  4500. }
  4501. if (typeof ctor === "function") {
  4502. return ctor.name || "";
  4503. } else if (typeof ctor === "object") {
  4504. const name = ctor.constructor && ctor.constructor.name;
  4505. return name || "";
  4506. }
  4507. return "";
  4508. }
  4509. function validateProps(rawProps, props, instance) {
  4510. const resolvedValues = toRaw(props);
  4511. const options = instance.propsOptions[0];
  4512. for (const key in options) {
  4513. let opt = options[key];
  4514. if (opt == null) continue;
  4515. validateProp(
  4516. key,
  4517. resolvedValues[key],
  4518. opt,
  4519. shallowReadonly(resolvedValues) ,
  4520. !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
  4521. );
  4522. }
  4523. }
  4524. function validateProp(name, value, prop, props, isAbsent) {
  4525. const { type, required, validator, skipCheck } = prop;
  4526. if (required && isAbsent) {
  4527. warn$1('Missing required prop: "' + name + '"');
  4528. return;
  4529. }
  4530. if (value == null && !required) {
  4531. return;
  4532. }
  4533. if (type != null && type !== true && !skipCheck) {
  4534. let isValid = false;
  4535. const types = isArray(type) ? type : [type];
  4536. const expectedTypes = [];
  4537. for (let i = 0; i < types.length && !isValid; i++) {
  4538. const { valid, expectedType } = assertType(value, types[i]);
  4539. expectedTypes.push(expectedType || "");
  4540. isValid = valid;
  4541. }
  4542. if (!isValid) {
  4543. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  4544. return;
  4545. }
  4546. }
  4547. if (validator && !validator(value, props)) {
  4548. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  4549. }
  4550. }
  4551. const isSimpleType = /* @__PURE__ */ makeMap(
  4552. "String,Number,Boolean,Function,Symbol,BigInt"
  4553. );
  4554. function assertType(value, type) {
  4555. let valid;
  4556. const expectedType = getType(type);
  4557. if (isSimpleType(expectedType)) {
  4558. const t = typeof value;
  4559. valid = t === expectedType.toLowerCase();
  4560. if (!valid && t === "object") {
  4561. valid = value instanceof type;
  4562. }
  4563. } else if (expectedType === "Object") {
  4564. valid = isObject(value);
  4565. } else if (expectedType === "Array") {
  4566. valid = isArray(value);
  4567. } else if (expectedType === "null") {
  4568. valid = value === null;
  4569. } else {
  4570. valid = value instanceof type;
  4571. }
  4572. return {
  4573. valid,
  4574. expectedType
  4575. };
  4576. }
  4577. function getInvalidTypeMessage(name, value, expectedTypes) {
  4578. if (expectedTypes.length === 0) {
  4579. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  4580. }
  4581. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4582. const expectedType = expectedTypes[0];
  4583. const receivedType = toRawType(value);
  4584. const expectedValue = styleValue(value, expectedType);
  4585. const receivedValue = styleValue(value, receivedType);
  4586. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4587. message += ` with value ${expectedValue}`;
  4588. }
  4589. message += `, got ${receivedType} `;
  4590. if (isExplicable(receivedType)) {
  4591. message += `with value ${receivedValue}.`;
  4592. }
  4593. return message;
  4594. }
  4595. function styleValue(value, type) {
  4596. if (type === "String") {
  4597. return `"${value}"`;
  4598. } else if (type === "Number") {
  4599. return `${Number(value)}`;
  4600. } else {
  4601. return `${value}`;
  4602. }
  4603. }
  4604. function isExplicable(type) {
  4605. const explicitTypes = ["string", "number", "boolean"];
  4606. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4607. }
  4608. function isBoolean(...args) {
  4609. return args.some((elem) => elem.toLowerCase() === "boolean");
  4610. }
  4611. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  4612. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  4613. const normalizeSlot = (key, rawSlot, ctx) => {
  4614. if (rawSlot._n) {
  4615. return rawSlot;
  4616. }
  4617. const normalized = withCtx((...args) => {
  4618. if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
  4619. warn$1(
  4620. `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  4621. );
  4622. }
  4623. return normalizeSlotValue(rawSlot(...args));
  4624. }, ctx);
  4625. normalized._c = false;
  4626. return normalized;
  4627. };
  4628. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  4629. const ctx = rawSlots._ctx;
  4630. for (const key in rawSlots) {
  4631. if (isInternalKey(key)) continue;
  4632. const value = rawSlots[key];
  4633. if (isFunction(value)) {
  4634. slots[key] = normalizeSlot(key, value, ctx);
  4635. } else if (value != null) {
  4636. {
  4637. warn$1(
  4638. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  4639. );
  4640. }
  4641. const normalized = normalizeSlotValue(value);
  4642. slots[key] = () => normalized;
  4643. }
  4644. }
  4645. };
  4646. const normalizeVNodeSlots = (instance, children) => {
  4647. if (!isKeepAlive(instance.vnode) && true) {
  4648. warn$1(
  4649. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  4650. );
  4651. }
  4652. const normalized = normalizeSlotValue(children);
  4653. instance.slots.default = () => normalized;
  4654. };
  4655. const assignSlots = (slots, children, optimized) => {
  4656. for (const key in children) {
  4657. if (optimized || key !== "_") {
  4658. slots[key] = children[key];
  4659. }
  4660. }
  4661. };
  4662. const initSlots = (instance, children, optimized) => {
  4663. const slots = instance.slots = createInternalObject();
  4664. if (instance.vnode.shapeFlag & 32) {
  4665. const type = children._;
  4666. if (type) {
  4667. assignSlots(slots, children, optimized);
  4668. if (optimized) {
  4669. def(slots, "_", type, true);
  4670. }
  4671. } else {
  4672. normalizeObjectSlots(children, slots);
  4673. }
  4674. } else if (children) {
  4675. normalizeVNodeSlots(instance, children);
  4676. }
  4677. };
  4678. const updateSlots = (instance, children, optimized) => {
  4679. const { vnode, slots } = instance;
  4680. let needDeletionCheck = true;
  4681. let deletionComparisonTarget = EMPTY_OBJ;
  4682. if (vnode.shapeFlag & 32) {
  4683. const type = children._;
  4684. if (type) {
  4685. if (isHmrUpdating) {
  4686. assignSlots(slots, children, optimized);
  4687. trigger(instance, "set", "$slots");
  4688. } else if (optimized && type === 1) {
  4689. needDeletionCheck = false;
  4690. } else {
  4691. assignSlots(slots, children, optimized);
  4692. }
  4693. } else {
  4694. needDeletionCheck = !children.$stable;
  4695. normalizeObjectSlots(children, slots);
  4696. }
  4697. deletionComparisonTarget = children;
  4698. } else if (children) {
  4699. normalizeVNodeSlots(instance, children);
  4700. deletionComparisonTarget = { default: 1 };
  4701. }
  4702. if (needDeletionCheck) {
  4703. for (const key in slots) {
  4704. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  4705. delete slots[key];
  4706. }
  4707. }
  4708. }
  4709. };
  4710. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  4711. if (isArray(rawRef)) {
  4712. rawRef.forEach(
  4713. (r, i) => setRef(
  4714. r,
  4715. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  4716. parentSuspense,
  4717. vnode,
  4718. isUnmount
  4719. )
  4720. );
  4721. return;
  4722. }
  4723. if (isAsyncWrapper(vnode) && !isUnmount) {
  4724. return;
  4725. }
  4726. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  4727. const value = isUnmount ? null : refValue;
  4728. const { i: owner, r: ref } = rawRef;
  4729. if (!owner) {
  4730. warn$1(
  4731. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  4732. );
  4733. return;
  4734. }
  4735. const oldRef = oldRawRef && oldRawRef.r;
  4736. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  4737. const setupState = owner.setupState;
  4738. if (oldRef != null && oldRef !== ref) {
  4739. if (isString(oldRef)) {
  4740. refs[oldRef] = null;
  4741. if (hasOwn(setupState, oldRef)) {
  4742. setupState[oldRef] = null;
  4743. }
  4744. } else if (isRef(oldRef)) {
  4745. oldRef.value = null;
  4746. }
  4747. }
  4748. if (isFunction(ref)) {
  4749. callWithErrorHandling(ref, owner, 12, [value, refs]);
  4750. } else {
  4751. const _isString = isString(ref);
  4752. const _isRef = isRef(ref);
  4753. if (_isString || _isRef) {
  4754. const doSet = () => {
  4755. if (rawRef.f) {
  4756. const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
  4757. if (isUnmount) {
  4758. isArray(existing) && remove(existing, refValue);
  4759. } else {
  4760. if (!isArray(existing)) {
  4761. if (_isString) {
  4762. refs[ref] = [refValue];
  4763. if (hasOwn(setupState, ref)) {
  4764. setupState[ref] = refs[ref];
  4765. }
  4766. } else {
  4767. ref.value = [refValue];
  4768. if (rawRef.k) refs[rawRef.k] = ref.value;
  4769. }
  4770. } else if (!existing.includes(refValue)) {
  4771. existing.push(refValue);
  4772. }
  4773. }
  4774. } else if (_isString) {
  4775. refs[ref] = value;
  4776. if (hasOwn(setupState, ref)) {
  4777. setupState[ref] = value;
  4778. }
  4779. } else if (_isRef) {
  4780. ref.value = value;
  4781. if (rawRef.k) refs[rawRef.k] = value;
  4782. } else {
  4783. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  4784. }
  4785. };
  4786. if (value) {
  4787. doSet.id = -1;
  4788. queuePostRenderEffect(doSet, parentSuspense);
  4789. } else {
  4790. doSet();
  4791. }
  4792. } else {
  4793. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  4794. }
  4795. }
  4796. }
  4797. const TeleportEndKey = Symbol("_vte");
  4798. const isTeleport = (type) => type.__isTeleport;
  4799. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  4800. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  4801. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  4802. const resolveTarget = (props, select) => {
  4803. const targetSelector = props && props.to;
  4804. if (isString(targetSelector)) {
  4805. if (!select) {
  4806. warn$1(
  4807. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  4808. );
  4809. return null;
  4810. } else {
  4811. const target = select(targetSelector);
  4812. if (!target && !isTeleportDisabled(props)) {
  4813. warn$1(
  4814. `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
  4815. );
  4816. }
  4817. return target;
  4818. }
  4819. } else {
  4820. if (!targetSelector && !isTeleportDisabled(props)) {
  4821. warn$1(`Invalid Teleport target: ${targetSelector}`);
  4822. }
  4823. return targetSelector;
  4824. }
  4825. };
  4826. const TeleportImpl = {
  4827. name: "Teleport",
  4828. __isTeleport: true,
  4829. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  4830. const {
  4831. mc: mountChildren,
  4832. pc: patchChildren,
  4833. pbc: patchBlockChildren,
  4834. o: { insert, querySelector, createText, createComment }
  4835. } = internals;
  4836. const disabled = isTeleportDisabled(n2.props);
  4837. let { shapeFlag, children, dynamicChildren } = n2;
  4838. if (isHmrUpdating) {
  4839. optimized = false;
  4840. dynamicChildren = null;
  4841. }
  4842. if (n1 == null) {
  4843. const placeholder = n2.el = createComment("teleport start") ;
  4844. const mainAnchor = n2.anchor = createComment("teleport end") ;
  4845. insert(placeholder, container, anchor);
  4846. insert(mainAnchor, container, anchor);
  4847. const target = n2.target = resolveTarget(n2.props, querySelector);
  4848. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  4849. if (target) {
  4850. if (namespace === "svg" || isTargetSVG(target)) {
  4851. namespace = "svg";
  4852. } else if (namespace === "mathml" || isTargetMathML(target)) {
  4853. namespace = "mathml";
  4854. }
  4855. } else if (!disabled) {
  4856. warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
  4857. }
  4858. const mount = (container2, anchor2) => {
  4859. if (shapeFlag & 16) {
  4860. mountChildren(
  4861. children,
  4862. container2,
  4863. anchor2,
  4864. parentComponent,
  4865. parentSuspense,
  4866. namespace,
  4867. slotScopeIds,
  4868. optimized
  4869. );
  4870. }
  4871. };
  4872. if (disabled) {
  4873. mount(container, mainAnchor);
  4874. } else if (target) {
  4875. mount(target, targetAnchor);
  4876. }
  4877. } else {
  4878. n2.el = n1.el;
  4879. n2.targetStart = n1.targetStart;
  4880. const mainAnchor = n2.anchor = n1.anchor;
  4881. const target = n2.target = n1.target;
  4882. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  4883. const wasDisabled = isTeleportDisabled(n1.props);
  4884. const currentContainer = wasDisabled ? container : target;
  4885. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  4886. if (namespace === "svg" || isTargetSVG(target)) {
  4887. namespace = "svg";
  4888. } else if (namespace === "mathml" || isTargetMathML(target)) {
  4889. namespace = "mathml";
  4890. }
  4891. if (dynamicChildren) {
  4892. patchBlockChildren(
  4893. n1.dynamicChildren,
  4894. dynamicChildren,
  4895. currentContainer,
  4896. parentComponent,
  4897. parentSuspense,
  4898. namespace,
  4899. slotScopeIds
  4900. );
  4901. traverseStaticChildren(n1, n2, true);
  4902. } else if (!optimized) {
  4903. patchChildren(
  4904. n1,
  4905. n2,
  4906. currentContainer,
  4907. currentAnchor,
  4908. parentComponent,
  4909. parentSuspense,
  4910. namespace,
  4911. slotScopeIds,
  4912. false
  4913. );
  4914. }
  4915. if (disabled) {
  4916. if (!wasDisabled) {
  4917. moveTeleport(
  4918. n2,
  4919. container,
  4920. mainAnchor,
  4921. internals,
  4922. 1
  4923. );
  4924. } else {
  4925. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  4926. n2.props.to = n1.props.to;
  4927. }
  4928. }
  4929. } else {
  4930. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  4931. const nextTarget = n2.target = resolveTarget(
  4932. n2.props,
  4933. querySelector
  4934. );
  4935. if (nextTarget) {
  4936. moveTeleport(
  4937. n2,
  4938. nextTarget,
  4939. null,
  4940. internals,
  4941. 0
  4942. );
  4943. } else {
  4944. warn$1(
  4945. "Invalid Teleport target on update:",
  4946. target,
  4947. `(${typeof target})`
  4948. );
  4949. }
  4950. } else if (wasDisabled) {
  4951. moveTeleport(
  4952. n2,
  4953. target,
  4954. targetAnchor,
  4955. internals,
  4956. 1
  4957. );
  4958. }
  4959. }
  4960. }
  4961. updateCssVars(n2);
  4962. },
  4963. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  4964. const {
  4965. shapeFlag,
  4966. children,
  4967. anchor,
  4968. targetStart,
  4969. targetAnchor,
  4970. target,
  4971. props
  4972. } = vnode;
  4973. if (target) {
  4974. hostRemove(targetStart);
  4975. hostRemove(targetAnchor);
  4976. }
  4977. doRemove && hostRemove(anchor);
  4978. if (shapeFlag & 16) {
  4979. const shouldRemove = doRemove || !isTeleportDisabled(props);
  4980. for (let i = 0; i < children.length; i++) {
  4981. const child = children[i];
  4982. unmount(
  4983. child,
  4984. parentComponent,
  4985. parentSuspense,
  4986. shouldRemove,
  4987. !!child.dynamicChildren
  4988. );
  4989. }
  4990. }
  4991. },
  4992. move: moveTeleport,
  4993. hydrate: hydrateTeleport
  4994. };
  4995. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  4996. if (moveType === 0) {
  4997. insert(vnode.targetAnchor, container, parentAnchor);
  4998. }
  4999. const { el, anchor, shapeFlag, children, props } = vnode;
  5000. const isReorder = moveType === 2;
  5001. if (isReorder) {
  5002. insert(el, container, parentAnchor);
  5003. }
  5004. if (!isReorder || isTeleportDisabled(props)) {
  5005. if (shapeFlag & 16) {
  5006. for (let i = 0; i < children.length; i++) {
  5007. move(
  5008. children[i],
  5009. container,
  5010. parentAnchor,
  5011. 2
  5012. );
  5013. }
  5014. }
  5015. }
  5016. if (isReorder) {
  5017. insert(anchor, container, parentAnchor);
  5018. }
  5019. }
  5020. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  5021. o: { nextSibling, parentNode, querySelector, insert, createText }
  5022. }, hydrateChildren) {
  5023. const target = vnode.target = resolveTarget(
  5024. vnode.props,
  5025. querySelector
  5026. );
  5027. if (target) {
  5028. const targetNode = target._lpa || target.firstChild;
  5029. if (vnode.shapeFlag & 16) {
  5030. if (isTeleportDisabled(vnode.props)) {
  5031. vnode.anchor = hydrateChildren(
  5032. nextSibling(node),
  5033. vnode,
  5034. parentNode(node),
  5035. parentComponent,
  5036. parentSuspense,
  5037. slotScopeIds,
  5038. optimized
  5039. );
  5040. vnode.targetStart = targetNode;
  5041. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  5042. } else {
  5043. vnode.anchor = nextSibling(node);
  5044. let targetAnchor = targetNode;
  5045. while (targetAnchor) {
  5046. if (targetAnchor && targetAnchor.nodeType === 8) {
  5047. if (targetAnchor.data === "teleport start anchor") {
  5048. vnode.targetStart = targetAnchor;
  5049. } else if (targetAnchor.data === "teleport anchor") {
  5050. vnode.targetAnchor = targetAnchor;
  5051. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  5052. break;
  5053. }
  5054. }
  5055. targetAnchor = nextSibling(targetAnchor);
  5056. }
  5057. if (!vnode.targetAnchor) {
  5058. prepareAnchor(target, vnode, createText, insert);
  5059. }
  5060. hydrateChildren(
  5061. targetNode && nextSibling(targetNode),
  5062. vnode,
  5063. target,
  5064. parentComponent,
  5065. parentSuspense,
  5066. slotScopeIds,
  5067. optimized
  5068. );
  5069. }
  5070. }
  5071. updateCssVars(vnode);
  5072. }
  5073. return vnode.anchor && nextSibling(vnode.anchor);
  5074. }
  5075. const Teleport = TeleportImpl;
  5076. function updateCssVars(vnode) {
  5077. const ctx = vnode.ctx;
  5078. if (ctx && ctx.ut) {
  5079. let node = vnode.children[0].el;
  5080. while (node && node !== vnode.targetAnchor) {
  5081. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  5082. node = node.nextSibling;
  5083. }
  5084. ctx.ut();
  5085. }
  5086. }
  5087. function prepareAnchor(target, vnode, createText, insert) {
  5088. const targetStart = vnode.targetStart = createText("");
  5089. const targetAnchor = vnode.targetAnchor = createText("");
  5090. targetStart[TeleportEndKey] = targetAnchor;
  5091. if (target) {
  5092. insert(targetStart, target);
  5093. insert(targetAnchor, target);
  5094. }
  5095. return targetAnchor;
  5096. }
  5097. let hasLoggedMismatchError = false;
  5098. const logMismatchError = () => {
  5099. if (hasLoggedMismatchError) {
  5100. return;
  5101. }
  5102. console.error("Hydration completed but contains mismatches.");
  5103. hasLoggedMismatchError = true;
  5104. };
  5105. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  5106. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  5107. const getContainerType = (container) => {
  5108. if (isSVGContainer(container)) return "svg";
  5109. if (isMathMLContainer(container)) return "mathml";
  5110. return void 0;
  5111. };
  5112. const isComment = (node) => node.nodeType === 8 /* COMMENT */;
  5113. function createHydrationFunctions(rendererInternals) {
  5114. const {
  5115. mt: mountComponent,
  5116. p: patch,
  5117. o: {
  5118. patchProp,
  5119. createText,
  5120. nextSibling,
  5121. parentNode,
  5122. remove,
  5123. insert,
  5124. createComment
  5125. }
  5126. } = rendererInternals;
  5127. const hydrate = (vnode, container) => {
  5128. if (!container.hasChildNodes()) {
  5129. warn$1(
  5130. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  5131. );
  5132. patch(null, vnode, container);
  5133. flushPostFlushCbs();
  5134. container._vnode = vnode;
  5135. return;
  5136. }
  5137. hydrateNode(container.firstChild, vnode, null, null, null);
  5138. flushPostFlushCbs();
  5139. container._vnode = vnode;
  5140. };
  5141. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  5142. optimized = optimized || !!vnode.dynamicChildren;
  5143. const isFragmentStart = isComment(node) && node.data === "[";
  5144. const onMismatch = () => handleMismatch(
  5145. node,
  5146. vnode,
  5147. parentComponent,
  5148. parentSuspense,
  5149. slotScopeIds,
  5150. isFragmentStart
  5151. );
  5152. const { type, ref, shapeFlag, patchFlag } = vnode;
  5153. let domType = node.nodeType;
  5154. vnode.el = node;
  5155. {
  5156. def(node, "__vnode", vnode, true);
  5157. def(node, "__vueParentComponent", parentComponent, true);
  5158. }
  5159. if (patchFlag === -2) {
  5160. optimized = false;
  5161. vnode.dynamicChildren = null;
  5162. }
  5163. let nextNode = null;
  5164. switch (type) {
  5165. case Text:
  5166. if (domType !== 3 /* TEXT */) {
  5167. if (vnode.children === "") {
  5168. insert(vnode.el = createText(""), parentNode(node), node);
  5169. nextNode = node;
  5170. } else {
  5171. nextNode = onMismatch();
  5172. }
  5173. } else {
  5174. if (node.data !== vnode.children) {
  5175. warn$1(
  5176. `Hydration text mismatch in`,
  5177. node.parentNode,
  5178. `
  5179. - rendered on server: ${JSON.stringify(
  5180. node.data
  5181. )}
  5182. - expected on client: ${JSON.stringify(vnode.children)}`
  5183. );
  5184. logMismatchError();
  5185. node.data = vnode.children;
  5186. }
  5187. nextNode = nextSibling(node);
  5188. }
  5189. break;
  5190. case Comment:
  5191. if (isTemplateNode(node)) {
  5192. nextNode = nextSibling(node);
  5193. replaceNode(
  5194. vnode.el = node.content.firstChild,
  5195. node,
  5196. parentComponent
  5197. );
  5198. } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
  5199. nextNode = onMismatch();
  5200. } else {
  5201. nextNode = nextSibling(node);
  5202. }
  5203. break;
  5204. case Static:
  5205. if (isFragmentStart) {
  5206. node = nextSibling(node);
  5207. domType = node.nodeType;
  5208. }
  5209. if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
  5210. nextNode = node;
  5211. const needToAdoptContent = !vnode.children.length;
  5212. for (let i = 0; i < vnode.staticCount; i++) {
  5213. if (needToAdoptContent)
  5214. vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
  5215. if (i === vnode.staticCount - 1) {
  5216. vnode.anchor = nextNode;
  5217. }
  5218. nextNode = nextSibling(nextNode);
  5219. }
  5220. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  5221. } else {
  5222. onMismatch();
  5223. }
  5224. break;
  5225. case Fragment:
  5226. if (!isFragmentStart) {
  5227. nextNode = onMismatch();
  5228. } else {
  5229. nextNode = hydrateFragment(
  5230. node,
  5231. vnode,
  5232. parentComponent,
  5233. parentSuspense,
  5234. slotScopeIds,
  5235. optimized
  5236. );
  5237. }
  5238. break;
  5239. default:
  5240. if (shapeFlag & 1) {
  5241. if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  5242. nextNode = onMismatch();
  5243. } else {
  5244. nextNode = hydrateElement(
  5245. node,
  5246. vnode,
  5247. parentComponent,
  5248. parentSuspense,
  5249. slotScopeIds,
  5250. optimized
  5251. );
  5252. }
  5253. } else if (shapeFlag & 6) {
  5254. vnode.slotScopeIds = slotScopeIds;
  5255. const container = parentNode(node);
  5256. if (isFragmentStart) {
  5257. nextNode = locateClosingAnchor(node);
  5258. } else if (isComment(node) && node.data === "teleport start") {
  5259. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  5260. } else {
  5261. nextNode = nextSibling(node);
  5262. }
  5263. mountComponent(
  5264. vnode,
  5265. container,
  5266. null,
  5267. parentComponent,
  5268. parentSuspense,
  5269. getContainerType(container),
  5270. optimized
  5271. );
  5272. if (isAsyncWrapper(vnode)) {
  5273. let subTree;
  5274. if (isFragmentStart) {
  5275. subTree = createVNode(Fragment);
  5276. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  5277. } else {
  5278. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  5279. }
  5280. subTree.el = node;
  5281. vnode.component.subTree = subTree;
  5282. }
  5283. } else if (shapeFlag & 64) {
  5284. if (domType !== 8 /* COMMENT */) {
  5285. nextNode = onMismatch();
  5286. } else {
  5287. nextNode = vnode.type.hydrate(
  5288. node,
  5289. vnode,
  5290. parentComponent,
  5291. parentSuspense,
  5292. slotScopeIds,
  5293. optimized,
  5294. rendererInternals,
  5295. hydrateChildren
  5296. );
  5297. }
  5298. } else if (shapeFlag & 128) {
  5299. nextNode = vnode.type.hydrate(
  5300. node,
  5301. vnode,
  5302. parentComponent,
  5303. parentSuspense,
  5304. getContainerType(parentNode(node)),
  5305. slotScopeIds,
  5306. optimized,
  5307. rendererInternals,
  5308. hydrateNode
  5309. );
  5310. } else {
  5311. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  5312. }
  5313. }
  5314. if (ref != null) {
  5315. setRef(ref, null, parentSuspense, vnode);
  5316. }
  5317. return nextNode;
  5318. };
  5319. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5320. optimized = optimized || !!vnode.dynamicChildren;
  5321. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  5322. const forcePatch = type === "input" || type === "option";
  5323. {
  5324. if (dirs) {
  5325. invokeDirectiveHook(vnode, null, parentComponent, "created");
  5326. }
  5327. let needCallTransitionHooks = false;
  5328. if (isTemplateNode(el)) {
  5329. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  5330. const content = el.content.firstChild;
  5331. if (needCallTransitionHooks) {
  5332. transition.beforeEnter(content);
  5333. }
  5334. replaceNode(content, el, parentComponent);
  5335. vnode.el = el = content;
  5336. }
  5337. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  5338. !(props && (props.innerHTML || props.textContent))) {
  5339. let next = hydrateChildren(
  5340. el.firstChild,
  5341. vnode,
  5342. el,
  5343. parentComponent,
  5344. parentSuspense,
  5345. slotScopeIds,
  5346. optimized
  5347. );
  5348. let hasWarned = false;
  5349. while (next) {
  5350. if (!hasWarned) {
  5351. warn$1(
  5352. `Hydration children mismatch on`,
  5353. el,
  5354. `
  5355. Server rendered element contains more child nodes than client vdom.`
  5356. );
  5357. hasWarned = true;
  5358. }
  5359. logMismatchError();
  5360. const cur = next;
  5361. next = next.nextSibling;
  5362. remove(cur);
  5363. }
  5364. } else if (shapeFlag & 8) {
  5365. if (el.textContent !== vnode.children) {
  5366. warn$1(
  5367. `Hydration text content mismatch on`,
  5368. el,
  5369. `
  5370. - rendered on server: ${el.textContent}
  5371. - expected on client: ${vnode.children}`
  5372. );
  5373. logMismatchError();
  5374. el.textContent = vnode.children;
  5375. }
  5376. }
  5377. if (props) {
  5378. {
  5379. const isCustomElement = el.tagName.includes("-");
  5380. for (const key in props) {
  5381. if (// #11189 skip if this node has directives that have created hooks
  5382. // as it could have mutated the DOM in any possible way
  5383. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  5384. logMismatchError();
  5385. }
  5386. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  5387. key[0] === "." || isCustomElement) {
  5388. patchProp(el, key, null, props[key], void 0, parentComponent);
  5389. }
  5390. }
  5391. }
  5392. }
  5393. let vnodeHooks;
  5394. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  5395. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  5396. }
  5397. if (dirs) {
  5398. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5399. }
  5400. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  5401. queueEffectWithSuspense(() => {
  5402. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  5403. needCallTransitionHooks && transition.enter(el);
  5404. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5405. }, parentSuspense);
  5406. }
  5407. }
  5408. return el.nextSibling;
  5409. };
  5410. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5411. optimized = optimized || !!parentVNode.dynamicChildren;
  5412. const children = parentVNode.children;
  5413. const l = children.length;
  5414. let hasWarned = false;
  5415. for (let i = 0; i < l; i++) {
  5416. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  5417. const isText = vnode.type === Text;
  5418. if (node) {
  5419. if (isText && !optimized) {
  5420. let next = children[i + 1];
  5421. if (next && (next = normalizeVNode(next)).type === Text) {
  5422. insert(
  5423. createText(
  5424. node.data.slice(vnode.children.length)
  5425. ),
  5426. container,
  5427. nextSibling(node)
  5428. );
  5429. node.data = vnode.children;
  5430. }
  5431. }
  5432. node = hydrateNode(
  5433. node,
  5434. vnode,
  5435. parentComponent,
  5436. parentSuspense,
  5437. slotScopeIds,
  5438. optimized
  5439. );
  5440. } else if (isText && !vnode.children) {
  5441. insert(vnode.el = createText(""), container);
  5442. } else {
  5443. if (!hasWarned) {
  5444. warn$1(
  5445. `Hydration children mismatch on`,
  5446. container,
  5447. `
  5448. Server rendered element contains fewer child nodes than client vdom.`
  5449. );
  5450. hasWarned = true;
  5451. }
  5452. logMismatchError();
  5453. patch(
  5454. null,
  5455. vnode,
  5456. container,
  5457. null,
  5458. parentComponent,
  5459. parentSuspense,
  5460. getContainerType(container),
  5461. slotScopeIds
  5462. );
  5463. }
  5464. }
  5465. return node;
  5466. };
  5467. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5468. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  5469. if (fragmentSlotScopeIds) {
  5470. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  5471. }
  5472. const container = parentNode(node);
  5473. const next = hydrateChildren(
  5474. nextSibling(node),
  5475. vnode,
  5476. container,
  5477. parentComponent,
  5478. parentSuspense,
  5479. slotScopeIds,
  5480. optimized
  5481. );
  5482. if (next && isComment(next) && next.data === "]") {
  5483. return nextSibling(vnode.anchor = next);
  5484. } else {
  5485. logMismatchError();
  5486. insert(vnode.anchor = createComment(`]`), container, next);
  5487. return next;
  5488. }
  5489. };
  5490. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  5491. warn$1(
  5492. `Hydration node mismatch:
  5493. - rendered on server:`,
  5494. node,
  5495. node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  5496. `
  5497. - expected on client:`,
  5498. vnode.type
  5499. );
  5500. logMismatchError();
  5501. vnode.el = null;
  5502. if (isFragment) {
  5503. const end = locateClosingAnchor(node);
  5504. while (true) {
  5505. const next2 = nextSibling(node);
  5506. if (next2 && next2 !== end) {
  5507. remove(next2);
  5508. } else {
  5509. break;
  5510. }
  5511. }
  5512. }
  5513. const next = nextSibling(node);
  5514. const container = parentNode(node);
  5515. remove(node);
  5516. patch(
  5517. null,
  5518. vnode,
  5519. container,
  5520. next,
  5521. parentComponent,
  5522. parentSuspense,
  5523. getContainerType(container),
  5524. slotScopeIds
  5525. );
  5526. return next;
  5527. };
  5528. const locateClosingAnchor = (node, open = "[", close = "]") => {
  5529. let match = 0;
  5530. while (node) {
  5531. node = nextSibling(node);
  5532. if (node && isComment(node)) {
  5533. if (node.data === open) match++;
  5534. if (node.data === close) {
  5535. if (match === 0) {
  5536. return nextSibling(node);
  5537. } else {
  5538. match--;
  5539. }
  5540. }
  5541. }
  5542. }
  5543. return node;
  5544. };
  5545. const replaceNode = (newNode, oldNode, parentComponent) => {
  5546. const parentNode2 = oldNode.parentNode;
  5547. if (parentNode2) {
  5548. parentNode2.replaceChild(newNode, oldNode);
  5549. }
  5550. let parent = parentComponent;
  5551. while (parent) {
  5552. if (parent.vnode.el === oldNode) {
  5553. parent.vnode.el = parent.subTree.el = newNode;
  5554. }
  5555. parent = parent.parent;
  5556. }
  5557. };
  5558. const isTemplateNode = (node) => {
  5559. return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
  5560. };
  5561. return [hydrate, hydrateNode];
  5562. }
  5563. function propHasMismatch(el, key, clientValue, vnode, instance) {
  5564. let mismatchType;
  5565. let mismatchKey;
  5566. let actual;
  5567. let expected;
  5568. if (key === "class") {
  5569. actual = el.getAttribute("class");
  5570. expected = normalizeClass(clientValue);
  5571. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  5572. mismatchType = mismatchKey = `class`;
  5573. }
  5574. } else if (key === "style") {
  5575. actual = el.getAttribute("style") || "";
  5576. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  5577. const actualMap = toStyleMap(actual);
  5578. const expectedMap = toStyleMap(expected);
  5579. if (vnode.dirs) {
  5580. for (const { dir, value } of vnode.dirs) {
  5581. if (dir.name === "show" && !value) {
  5582. expectedMap.set("display", "none");
  5583. }
  5584. }
  5585. }
  5586. if (instance) {
  5587. resolveCssVars(instance, vnode, expectedMap);
  5588. }
  5589. if (!isMapEqual(actualMap, expectedMap)) {
  5590. mismatchType = mismatchKey = "style";
  5591. }
  5592. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  5593. if (isBooleanAttr(key)) {
  5594. actual = el.hasAttribute(key);
  5595. expected = includeBooleanAttr(clientValue);
  5596. } else if (clientValue == null) {
  5597. actual = el.hasAttribute(key);
  5598. expected = false;
  5599. } else {
  5600. if (el.hasAttribute(key)) {
  5601. actual = el.getAttribute(key);
  5602. } else if (key === "value" && el.tagName === "TEXTAREA") {
  5603. actual = el.value;
  5604. } else {
  5605. actual = false;
  5606. }
  5607. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  5608. }
  5609. if (actual !== expected) {
  5610. mismatchType = `attribute`;
  5611. mismatchKey = key;
  5612. }
  5613. }
  5614. if (mismatchType) {
  5615. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  5616. const preSegment = `Hydration ${mismatchType} mismatch on`;
  5617. const postSegment = `
  5618. - rendered on server: ${format(actual)}
  5619. - expected on client: ${format(expected)}
  5620. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  5621. You should fix the source of the mismatch.`;
  5622. {
  5623. warn$1(preSegment, el, postSegment);
  5624. }
  5625. return true;
  5626. }
  5627. return false;
  5628. }
  5629. function toClassSet(str) {
  5630. return new Set(str.trim().split(/\s+/));
  5631. }
  5632. function isSetEqual(a, b) {
  5633. if (a.size !== b.size) {
  5634. return false;
  5635. }
  5636. for (const s of a) {
  5637. if (!b.has(s)) {
  5638. return false;
  5639. }
  5640. }
  5641. return true;
  5642. }
  5643. function toStyleMap(str) {
  5644. const styleMap = /* @__PURE__ */ new Map();
  5645. for (const item of str.split(";")) {
  5646. let [key, value] = item.split(":");
  5647. key = key.trim();
  5648. value = value && value.trim();
  5649. if (key && value) {
  5650. styleMap.set(key, value);
  5651. }
  5652. }
  5653. return styleMap;
  5654. }
  5655. function isMapEqual(a, b) {
  5656. if (a.size !== b.size) {
  5657. return false;
  5658. }
  5659. for (const [key, value] of a) {
  5660. if (value !== b.get(key)) {
  5661. return false;
  5662. }
  5663. }
  5664. return true;
  5665. }
  5666. function resolveCssVars(instance, vnode, expectedMap) {
  5667. const root = instance.subTree;
  5668. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  5669. const cssVars = instance.getCssVars();
  5670. for (const key in cssVars) {
  5671. expectedMap.set(`--${key}`, String(cssVars[key]));
  5672. }
  5673. }
  5674. if (vnode === root && instance.parent) {
  5675. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  5676. }
  5677. }
  5678. let supported;
  5679. let perf;
  5680. function startMeasure(instance, type) {
  5681. if (instance.appContext.config.performance && isSupported()) {
  5682. perf.mark(`vue-${type}-${instance.uid}`);
  5683. }
  5684. {
  5685. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  5686. }
  5687. }
  5688. function endMeasure(instance, type) {
  5689. if (instance.appContext.config.performance && isSupported()) {
  5690. const startTag = `vue-${type}-${instance.uid}`;
  5691. const endTag = startTag + `:end`;
  5692. perf.mark(endTag);
  5693. perf.measure(
  5694. `<${formatComponentName(instance, instance.type)}> ${type}`,
  5695. startTag,
  5696. endTag
  5697. );
  5698. perf.clearMarks(startTag);
  5699. perf.clearMarks(endTag);
  5700. }
  5701. {
  5702. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  5703. }
  5704. }
  5705. function isSupported() {
  5706. if (supported !== void 0) {
  5707. return supported;
  5708. }
  5709. if (typeof window !== "undefined" && window.performance) {
  5710. supported = true;
  5711. perf = window.performance;
  5712. } else {
  5713. supported = false;
  5714. }
  5715. return supported;
  5716. }
  5717. const queuePostRenderEffect = queueEffectWithSuspense ;
  5718. function createRenderer(options) {
  5719. return baseCreateRenderer(options);
  5720. }
  5721. function createHydrationRenderer(options) {
  5722. return baseCreateRenderer(options, createHydrationFunctions);
  5723. }
  5724. function baseCreateRenderer(options, createHydrationFns) {
  5725. const target = getGlobalThis();
  5726. target.__VUE__ = true;
  5727. {
  5728. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5729. }
  5730. const {
  5731. insert: hostInsert,
  5732. remove: hostRemove,
  5733. patchProp: hostPatchProp,
  5734. createElement: hostCreateElement,
  5735. createText: hostCreateText,
  5736. createComment: hostCreateComment,
  5737. setText: hostSetText,
  5738. setElementText: hostSetElementText,
  5739. parentNode: hostParentNode,
  5740. nextSibling: hostNextSibling,
  5741. setScopeId: hostSetScopeId = NOOP,
  5742. insertStaticContent: hostInsertStaticContent
  5743. } = options;
  5744. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  5745. if (n1 === n2) {
  5746. return;
  5747. }
  5748. if (n1 && !isSameVNodeType(n1, n2)) {
  5749. anchor = getNextHostNode(n1);
  5750. unmount(n1, parentComponent, parentSuspense, true);
  5751. n1 = null;
  5752. }
  5753. if (n2.patchFlag === -2) {
  5754. optimized = false;
  5755. n2.dynamicChildren = null;
  5756. }
  5757. const { type, ref, shapeFlag } = n2;
  5758. switch (type) {
  5759. case Text:
  5760. processText(n1, n2, container, anchor);
  5761. break;
  5762. case Comment:
  5763. processCommentNode(n1, n2, container, anchor);
  5764. break;
  5765. case Static:
  5766. if (n1 == null) {
  5767. mountStaticNode(n2, container, anchor, namespace);
  5768. } else {
  5769. patchStaticNode(n1, n2, container, namespace);
  5770. }
  5771. break;
  5772. case Fragment:
  5773. processFragment(
  5774. n1,
  5775. n2,
  5776. container,
  5777. anchor,
  5778. parentComponent,
  5779. parentSuspense,
  5780. namespace,
  5781. slotScopeIds,
  5782. optimized
  5783. );
  5784. break;
  5785. default:
  5786. if (shapeFlag & 1) {
  5787. processElement(
  5788. n1,
  5789. n2,
  5790. container,
  5791. anchor,
  5792. parentComponent,
  5793. parentSuspense,
  5794. namespace,
  5795. slotScopeIds,
  5796. optimized
  5797. );
  5798. } else if (shapeFlag & 6) {
  5799. processComponent(
  5800. n1,
  5801. n2,
  5802. container,
  5803. anchor,
  5804. parentComponent,
  5805. parentSuspense,
  5806. namespace,
  5807. slotScopeIds,
  5808. optimized
  5809. );
  5810. } else if (shapeFlag & 64) {
  5811. type.process(
  5812. n1,
  5813. n2,
  5814. container,
  5815. anchor,
  5816. parentComponent,
  5817. parentSuspense,
  5818. namespace,
  5819. slotScopeIds,
  5820. optimized,
  5821. internals
  5822. );
  5823. } else if (shapeFlag & 128) {
  5824. type.process(
  5825. n1,
  5826. n2,
  5827. container,
  5828. anchor,
  5829. parentComponent,
  5830. parentSuspense,
  5831. namespace,
  5832. slotScopeIds,
  5833. optimized,
  5834. internals
  5835. );
  5836. } else {
  5837. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  5838. }
  5839. }
  5840. if (ref != null && parentComponent) {
  5841. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  5842. }
  5843. };
  5844. const processText = (n1, n2, container, anchor) => {
  5845. if (n1 == null) {
  5846. hostInsert(
  5847. n2.el = hostCreateText(n2.children),
  5848. container,
  5849. anchor
  5850. );
  5851. } else {
  5852. const el = n2.el = n1.el;
  5853. if (n2.children !== n1.children) {
  5854. hostSetText(el, n2.children);
  5855. }
  5856. }
  5857. };
  5858. const processCommentNode = (n1, n2, container, anchor) => {
  5859. if (n1 == null) {
  5860. hostInsert(
  5861. n2.el = hostCreateComment(n2.children || ""),
  5862. container,
  5863. anchor
  5864. );
  5865. } else {
  5866. n2.el = n1.el;
  5867. }
  5868. };
  5869. const mountStaticNode = (n2, container, anchor, namespace) => {
  5870. [n2.el, n2.anchor] = hostInsertStaticContent(
  5871. n2.children,
  5872. container,
  5873. anchor,
  5874. namespace,
  5875. n2.el,
  5876. n2.anchor
  5877. );
  5878. };
  5879. const patchStaticNode = (n1, n2, container, namespace) => {
  5880. if (n2.children !== n1.children) {
  5881. const anchor = hostNextSibling(n1.anchor);
  5882. removeStaticNode(n1);
  5883. [n2.el, n2.anchor] = hostInsertStaticContent(
  5884. n2.children,
  5885. container,
  5886. anchor,
  5887. namespace
  5888. );
  5889. } else {
  5890. n2.el = n1.el;
  5891. n2.anchor = n1.anchor;
  5892. }
  5893. };
  5894. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  5895. let next;
  5896. while (el && el !== anchor) {
  5897. next = hostNextSibling(el);
  5898. hostInsert(el, container, nextSibling);
  5899. el = next;
  5900. }
  5901. hostInsert(anchor, container, nextSibling);
  5902. };
  5903. const removeStaticNode = ({ el, anchor }) => {
  5904. let next;
  5905. while (el && el !== anchor) {
  5906. next = hostNextSibling(el);
  5907. hostRemove(el);
  5908. el = next;
  5909. }
  5910. hostRemove(anchor);
  5911. };
  5912. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5913. if (n2.type === "svg") {
  5914. namespace = "svg";
  5915. } else if (n2.type === "math") {
  5916. namespace = "mathml";
  5917. }
  5918. if (n1 == null) {
  5919. mountElement(
  5920. n2,
  5921. container,
  5922. anchor,
  5923. parentComponent,
  5924. parentSuspense,
  5925. namespace,
  5926. slotScopeIds,
  5927. optimized
  5928. );
  5929. } else {
  5930. patchElement(
  5931. n1,
  5932. n2,
  5933. parentComponent,
  5934. parentSuspense,
  5935. namespace,
  5936. slotScopeIds,
  5937. optimized
  5938. );
  5939. }
  5940. };
  5941. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5942. let el;
  5943. let vnodeHook;
  5944. const { props, shapeFlag, transition, dirs } = vnode;
  5945. el = vnode.el = hostCreateElement(
  5946. vnode.type,
  5947. namespace,
  5948. props && props.is,
  5949. props
  5950. );
  5951. if (shapeFlag & 8) {
  5952. hostSetElementText(el, vnode.children);
  5953. } else if (shapeFlag & 16) {
  5954. mountChildren(
  5955. vnode.children,
  5956. el,
  5957. null,
  5958. parentComponent,
  5959. parentSuspense,
  5960. resolveChildrenNamespace(vnode, namespace),
  5961. slotScopeIds,
  5962. optimized
  5963. );
  5964. }
  5965. if (dirs) {
  5966. invokeDirectiveHook(vnode, null, parentComponent, "created");
  5967. }
  5968. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  5969. if (props) {
  5970. for (const key in props) {
  5971. if (key !== "value" && !isReservedProp(key)) {
  5972. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  5973. }
  5974. }
  5975. if ("value" in props) {
  5976. hostPatchProp(el, "value", null, props.value, namespace);
  5977. }
  5978. if (vnodeHook = props.onVnodeBeforeMount) {
  5979. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5980. }
  5981. }
  5982. {
  5983. def(el, "__vnode", vnode, true);
  5984. def(el, "__vueParentComponent", parentComponent, true);
  5985. }
  5986. if (dirs) {
  5987. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5988. }
  5989. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  5990. if (needCallTransitionHooks) {
  5991. transition.beforeEnter(el);
  5992. }
  5993. hostInsert(el, container, anchor);
  5994. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  5995. queuePostRenderEffect(() => {
  5996. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5997. needCallTransitionHooks && transition.enter(el);
  5998. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5999. }, parentSuspense);
  6000. }
  6001. };
  6002. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  6003. if (scopeId) {
  6004. hostSetScopeId(el, scopeId);
  6005. }
  6006. if (slotScopeIds) {
  6007. for (let i = 0; i < slotScopeIds.length; i++) {
  6008. hostSetScopeId(el, slotScopeIds[i]);
  6009. }
  6010. }
  6011. if (parentComponent) {
  6012. let subTree = parentComponent.subTree;
  6013. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  6014. subTree = filterSingleRoot(subTree.children) || subTree;
  6015. }
  6016. if (vnode === subTree) {
  6017. const parentVNode = parentComponent.vnode;
  6018. setScopeId(
  6019. el,
  6020. parentVNode,
  6021. parentVNode.scopeId,
  6022. parentVNode.slotScopeIds,
  6023. parentComponent.parent
  6024. );
  6025. }
  6026. }
  6027. };
  6028. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  6029. for (let i = start; i < children.length; i++) {
  6030. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  6031. patch(
  6032. null,
  6033. child,
  6034. container,
  6035. anchor,
  6036. parentComponent,
  6037. parentSuspense,
  6038. namespace,
  6039. slotScopeIds,
  6040. optimized
  6041. );
  6042. }
  6043. };
  6044. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6045. const el = n2.el = n1.el;
  6046. {
  6047. el.__vnode = n2;
  6048. }
  6049. let { patchFlag, dynamicChildren, dirs } = n2;
  6050. patchFlag |= n1.patchFlag & 16;
  6051. const oldProps = n1.props || EMPTY_OBJ;
  6052. const newProps = n2.props || EMPTY_OBJ;
  6053. let vnodeHook;
  6054. parentComponent && toggleRecurse(parentComponent, false);
  6055. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  6056. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6057. }
  6058. if (dirs) {
  6059. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  6060. }
  6061. parentComponent && toggleRecurse(parentComponent, true);
  6062. if (isHmrUpdating) {
  6063. patchFlag = 0;
  6064. optimized = false;
  6065. dynamicChildren = null;
  6066. }
  6067. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  6068. hostSetElementText(el, "");
  6069. }
  6070. if (dynamicChildren) {
  6071. patchBlockChildren(
  6072. n1.dynamicChildren,
  6073. dynamicChildren,
  6074. el,
  6075. parentComponent,
  6076. parentSuspense,
  6077. resolveChildrenNamespace(n2, namespace),
  6078. slotScopeIds
  6079. );
  6080. {
  6081. traverseStaticChildren(n1, n2);
  6082. }
  6083. } else if (!optimized) {
  6084. patchChildren(
  6085. n1,
  6086. n2,
  6087. el,
  6088. null,
  6089. parentComponent,
  6090. parentSuspense,
  6091. resolveChildrenNamespace(n2, namespace),
  6092. slotScopeIds,
  6093. false
  6094. );
  6095. }
  6096. if (patchFlag > 0) {
  6097. if (patchFlag & 16) {
  6098. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6099. } else {
  6100. if (patchFlag & 2) {
  6101. if (oldProps.class !== newProps.class) {
  6102. hostPatchProp(el, "class", null, newProps.class, namespace);
  6103. }
  6104. }
  6105. if (patchFlag & 4) {
  6106. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  6107. }
  6108. if (patchFlag & 8) {
  6109. const propsToUpdate = n2.dynamicProps;
  6110. for (let i = 0; i < propsToUpdate.length; i++) {
  6111. const key = propsToUpdate[i];
  6112. const prev = oldProps[key];
  6113. const next = newProps[key];
  6114. if (next !== prev || key === "value") {
  6115. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  6116. }
  6117. }
  6118. }
  6119. }
  6120. if (patchFlag & 1) {
  6121. if (n1.children !== n2.children) {
  6122. hostSetElementText(el, n2.children);
  6123. }
  6124. }
  6125. } else if (!optimized && dynamicChildren == null) {
  6126. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6127. }
  6128. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  6129. queuePostRenderEffect(() => {
  6130. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6131. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  6132. }, parentSuspense);
  6133. }
  6134. };
  6135. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  6136. for (let i = 0; i < newChildren.length; i++) {
  6137. const oldVNode = oldChildren[i];
  6138. const newVNode = newChildren[i];
  6139. const container = (
  6140. // oldVNode may be an errored async setup() component inside Suspense
  6141. // which will not have a mounted element
  6142. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  6143. // of the Fragment itself so it can move its children.
  6144. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  6145. // which also requires the correct parent container
  6146. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  6147. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  6148. // In other cases, the parent container is not actually used so we
  6149. // just pass the block element here to avoid a DOM parentNode call.
  6150. fallbackContainer
  6151. )
  6152. );
  6153. patch(
  6154. oldVNode,
  6155. newVNode,
  6156. container,
  6157. null,
  6158. parentComponent,
  6159. parentSuspense,
  6160. namespace,
  6161. slotScopeIds,
  6162. true
  6163. );
  6164. }
  6165. };
  6166. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  6167. if (oldProps !== newProps) {
  6168. if (oldProps !== EMPTY_OBJ) {
  6169. for (const key in oldProps) {
  6170. if (!isReservedProp(key) && !(key in newProps)) {
  6171. hostPatchProp(
  6172. el,
  6173. key,
  6174. oldProps[key],
  6175. null,
  6176. namespace,
  6177. parentComponent
  6178. );
  6179. }
  6180. }
  6181. }
  6182. for (const key in newProps) {
  6183. if (isReservedProp(key)) continue;
  6184. const next = newProps[key];
  6185. const prev = oldProps[key];
  6186. if (next !== prev && key !== "value") {
  6187. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  6188. }
  6189. }
  6190. if ("value" in newProps) {
  6191. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  6192. }
  6193. }
  6194. };
  6195. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6196. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  6197. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  6198. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  6199. if (
  6200. // #5523 dev root fragment may inherit directives
  6201. isHmrUpdating || patchFlag & 2048
  6202. ) {
  6203. patchFlag = 0;
  6204. optimized = false;
  6205. dynamicChildren = null;
  6206. }
  6207. if (fragmentSlotScopeIds) {
  6208. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  6209. }
  6210. if (n1 == null) {
  6211. hostInsert(fragmentStartAnchor, container, anchor);
  6212. hostInsert(fragmentEndAnchor, container, anchor);
  6213. mountChildren(
  6214. // #10007
  6215. // such fragment like `<></>` will be compiled into
  6216. // a fragment which doesn't have a children.
  6217. // In this case fallback to an empty array
  6218. n2.children || [],
  6219. container,
  6220. fragmentEndAnchor,
  6221. parentComponent,
  6222. parentSuspense,
  6223. namespace,
  6224. slotScopeIds,
  6225. optimized
  6226. );
  6227. } else {
  6228. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  6229. // of renderSlot() with no valid children
  6230. n1.dynamicChildren) {
  6231. patchBlockChildren(
  6232. n1.dynamicChildren,
  6233. dynamicChildren,
  6234. container,
  6235. parentComponent,
  6236. parentSuspense,
  6237. namespace,
  6238. slotScopeIds
  6239. );
  6240. {
  6241. traverseStaticChildren(n1, n2);
  6242. }
  6243. } else {
  6244. patchChildren(
  6245. n1,
  6246. n2,
  6247. container,
  6248. fragmentEndAnchor,
  6249. parentComponent,
  6250. parentSuspense,
  6251. namespace,
  6252. slotScopeIds,
  6253. optimized
  6254. );
  6255. }
  6256. }
  6257. };
  6258. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6259. n2.slotScopeIds = slotScopeIds;
  6260. if (n1 == null) {
  6261. if (n2.shapeFlag & 512) {
  6262. parentComponent.ctx.activate(
  6263. n2,
  6264. container,
  6265. anchor,
  6266. namespace,
  6267. optimized
  6268. );
  6269. } else {
  6270. mountComponent(
  6271. n2,
  6272. container,
  6273. anchor,
  6274. parentComponent,
  6275. parentSuspense,
  6276. namespace,
  6277. optimized
  6278. );
  6279. }
  6280. } else {
  6281. updateComponent(n1, n2, optimized);
  6282. }
  6283. };
  6284. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  6285. const instance = (initialVNode.component = createComponentInstance(
  6286. initialVNode,
  6287. parentComponent,
  6288. parentSuspense
  6289. ));
  6290. if (instance.type.__hmrId) {
  6291. registerHMR(instance);
  6292. }
  6293. {
  6294. pushWarningContext(initialVNode);
  6295. startMeasure(instance, `mount`);
  6296. }
  6297. if (isKeepAlive(initialVNode)) {
  6298. instance.ctx.renderer = internals;
  6299. }
  6300. {
  6301. {
  6302. startMeasure(instance, `init`);
  6303. }
  6304. setupComponent(instance, false, optimized);
  6305. {
  6306. endMeasure(instance, `init`);
  6307. }
  6308. }
  6309. if (instance.asyncDep) {
  6310. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  6311. if (!initialVNode.el) {
  6312. const placeholder = instance.subTree = createVNode(Comment);
  6313. processCommentNode(null, placeholder, container, anchor);
  6314. }
  6315. } else {
  6316. setupRenderEffect(
  6317. instance,
  6318. initialVNode,
  6319. container,
  6320. anchor,
  6321. parentSuspense,
  6322. namespace,
  6323. optimized
  6324. );
  6325. }
  6326. {
  6327. popWarningContext();
  6328. endMeasure(instance, `mount`);
  6329. }
  6330. };
  6331. const updateComponent = (n1, n2, optimized) => {
  6332. const instance = n2.component = n1.component;
  6333. if (shouldUpdateComponent(n1, n2, optimized)) {
  6334. if (instance.asyncDep && !instance.asyncResolved) {
  6335. {
  6336. pushWarningContext(n2);
  6337. }
  6338. updateComponentPreRender(instance, n2, optimized);
  6339. {
  6340. popWarningContext();
  6341. }
  6342. return;
  6343. } else {
  6344. instance.next = n2;
  6345. invalidateJob(instance.update);
  6346. instance.effect.dirty = true;
  6347. instance.update();
  6348. }
  6349. } else {
  6350. n2.el = n1.el;
  6351. instance.vnode = n2;
  6352. }
  6353. };
  6354. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  6355. const componentUpdateFn = () => {
  6356. if (!instance.isMounted) {
  6357. let vnodeHook;
  6358. const { el, props } = initialVNode;
  6359. const { bm, m, parent } = instance;
  6360. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  6361. toggleRecurse(instance, false);
  6362. if (bm) {
  6363. invokeArrayFns(bm);
  6364. }
  6365. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  6366. invokeVNodeHook(vnodeHook, parent, initialVNode);
  6367. }
  6368. toggleRecurse(instance, true);
  6369. if (el && hydrateNode) {
  6370. const hydrateSubTree = () => {
  6371. {
  6372. startMeasure(instance, `render`);
  6373. }
  6374. instance.subTree = renderComponentRoot(instance);
  6375. {
  6376. endMeasure(instance, `render`);
  6377. }
  6378. {
  6379. startMeasure(instance, `hydrate`);
  6380. }
  6381. hydrateNode(
  6382. el,
  6383. instance.subTree,
  6384. instance,
  6385. parentSuspense,
  6386. null
  6387. );
  6388. {
  6389. endMeasure(instance, `hydrate`);
  6390. }
  6391. };
  6392. if (isAsyncWrapperVNode) {
  6393. initialVNode.type.__asyncLoader().then(
  6394. // note: we are moving the render call into an async callback,
  6395. // which means it won't track dependencies - but it's ok because
  6396. // a server-rendered async wrapper is already in resolved state
  6397. // and it will never need to change.
  6398. () => !instance.isUnmounted && hydrateSubTree()
  6399. );
  6400. } else {
  6401. hydrateSubTree();
  6402. }
  6403. } else {
  6404. {
  6405. startMeasure(instance, `render`);
  6406. }
  6407. const subTree = instance.subTree = renderComponentRoot(instance);
  6408. {
  6409. endMeasure(instance, `render`);
  6410. }
  6411. {
  6412. startMeasure(instance, `patch`);
  6413. }
  6414. patch(
  6415. null,
  6416. subTree,
  6417. container,
  6418. anchor,
  6419. instance,
  6420. parentSuspense,
  6421. namespace
  6422. );
  6423. {
  6424. endMeasure(instance, `patch`);
  6425. }
  6426. initialVNode.el = subTree.el;
  6427. }
  6428. if (m) {
  6429. queuePostRenderEffect(m, parentSuspense);
  6430. }
  6431. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  6432. const scopedInitialVNode = initialVNode;
  6433. queuePostRenderEffect(
  6434. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  6435. parentSuspense
  6436. );
  6437. }
  6438. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  6439. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  6440. }
  6441. instance.isMounted = true;
  6442. {
  6443. devtoolsComponentAdded(instance);
  6444. }
  6445. initialVNode = container = anchor = null;
  6446. } else {
  6447. let { next, bu, u, parent, vnode } = instance;
  6448. {
  6449. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  6450. if (nonHydratedAsyncRoot) {
  6451. if (next) {
  6452. next.el = vnode.el;
  6453. updateComponentPreRender(instance, next, optimized);
  6454. }
  6455. nonHydratedAsyncRoot.asyncDep.then(() => {
  6456. if (!instance.isUnmounted) {
  6457. componentUpdateFn();
  6458. }
  6459. });
  6460. return;
  6461. }
  6462. }
  6463. let originNext = next;
  6464. let vnodeHook;
  6465. {
  6466. pushWarningContext(next || instance.vnode);
  6467. }
  6468. toggleRecurse(instance, false);
  6469. if (next) {
  6470. next.el = vnode.el;
  6471. updateComponentPreRender(instance, next, optimized);
  6472. } else {
  6473. next = vnode;
  6474. }
  6475. if (bu) {
  6476. invokeArrayFns(bu);
  6477. }
  6478. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  6479. invokeVNodeHook(vnodeHook, parent, next, vnode);
  6480. }
  6481. toggleRecurse(instance, true);
  6482. {
  6483. startMeasure(instance, `render`);
  6484. }
  6485. const nextTree = renderComponentRoot(instance);
  6486. {
  6487. endMeasure(instance, `render`);
  6488. }
  6489. const prevTree = instance.subTree;
  6490. instance.subTree = nextTree;
  6491. {
  6492. startMeasure(instance, `patch`);
  6493. }
  6494. patch(
  6495. prevTree,
  6496. nextTree,
  6497. // parent may have changed if it's in a teleport
  6498. hostParentNode(prevTree.el),
  6499. // anchor may have changed if it's in a fragment
  6500. getNextHostNode(prevTree),
  6501. instance,
  6502. parentSuspense,
  6503. namespace
  6504. );
  6505. {
  6506. endMeasure(instance, `patch`);
  6507. }
  6508. next.el = nextTree.el;
  6509. if (originNext === null) {
  6510. updateHOCHostEl(instance, nextTree.el);
  6511. }
  6512. if (u) {
  6513. queuePostRenderEffect(u, parentSuspense);
  6514. }
  6515. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  6516. queuePostRenderEffect(
  6517. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  6518. parentSuspense
  6519. );
  6520. }
  6521. {
  6522. devtoolsComponentUpdated(instance);
  6523. }
  6524. {
  6525. popWarningContext();
  6526. }
  6527. }
  6528. };
  6529. const effect = instance.effect = new ReactiveEffect(
  6530. componentUpdateFn,
  6531. NOOP,
  6532. () => queueJob(update),
  6533. instance.scope
  6534. // track it in component's effect scope
  6535. );
  6536. const update = instance.update = () => {
  6537. if (effect.dirty) {
  6538. effect.run();
  6539. }
  6540. };
  6541. update.i = instance;
  6542. update.id = instance.uid;
  6543. toggleRecurse(instance, true);
  6544. {
  6545. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  6546. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  6547. }
  6548. update();
  6549. };
  6550. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  6551. nextVNode.component = instance;
  6552. const prevProps = instance.vnode.props;
  6553. instance.vnode = nextVNode;
  6554. instance.next = null;
  6555. updateProps(instance, nextVNode.props, prevProps, optimized);
  6556. updateSlots(instance, nextVNode.children, optimized);
  6557. pauseTracking();
  6558. flushPreFlushCbs(instance);
  6559. resetTracking();
  6560. };
  6561. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  6562. const c1 = n1 && n1.children;
  6563. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  6564. const c2 = n2.children;
  6565. const { patchFlag, shapeFlag } = n2;
  6566. if (patchFlag > 0) {
  6567. if (patchFlag & 128) {
  6568. patchKeyedChildren(
  6569. c1,
  6570. c2,
  6571. container,
  6572. anchor,
  6573. parentComponent,
  6574. parentSuspense,
  6575. namespace,
  6576. slotScopeIds,
  6577. optimized
  6578. );
  6579. return;
  6580. } else if (patchFlag & 256) {
  6581. patchUnkeyedChildren(
  6582. c1,
  6583. c2,
  6584. container,
  6585. anchor,
  6586. parentComponent,
  6587. parentSuspense,
  6588. namespace,
  6589. slotScopeIds,
  6590. optimized
  6591. );
  6592. return;
  6593. }
  6594. }
  6595. if (shapeFlag & 8) {
  6596. if (prevShapeFlag & 16) {
  6597. unmountChildren(c1, parentComponent, parentSuspense);
  6598. }
  6599. if (c2 !== c1) {
  6600. hostSetElementText(container, c2);
  6601. }
  6602. } else {
  6603. if (prevShapeFlag & 16) {
  6604. if (shapeFlag & 16) {
  6605. patchKeyedChildren(
  6606. c1,
  6607. c2,
  6608. container,
  6609. anchor,
  6610. parentComponent,
  6611. parentSuspense,
  6612. namespace,
  6613. slotScopeIds,
  6614. optimized
  6615. );
  6616. } else {
  6617. unmountChildren(c1, parentComponent, parentSuspense, true);
  6618. }
  6619. } else {
  6620. if (prevShapeFlag & 8) {
  6621. hostSetElementText(container, "");
  6622. }
  6623. if (shapeFlag & 16) {
  6624. mountChildren(
  6625. c2,
  6626. container,
  6627. anchor,
  6628. parentComponent,
  6629. parentSuspense,
  6630. namespace,
  6631. slotScopeIds,
  6632. optimized
  6633. );
  6634. }
  6635. }
  6636. }
  6637. };
  6638. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6639. c1 = c1 || EMPTY_ARR;
  6640. c2 = c2 || EMPTY_ARR;
  6641. const oldLength = c1.length;
  6642. const newLength = c2.length;
  6643. const commonLength = Math.min(oldLength, newLength);
  6644. let i;
  6645. for (i = 0; i < commonLength; i++) {
  6646. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6647. patch(
  6648. c1[i],
  6649. nextChild,
  6650. container,
  6651. null,
  6652. parentComponent,
  6653. parentSuspense,
  6654. namespace,
  6655. slotScopeIds,
  6656. optimized
  6657. );
  6658. }
  6659. if (oldLength > newLength) {
  6660. unmountChildren(
  6661. c1,
  6662. parentComponent,
  6663. parentSuspense,
  6664. true,
  6665. false,
  6666. commonLength
  6667. );
  6668. } else {
  6669. mountChildren(
  6670. c2,
  6671. container,
  6672. anchor,
  6673. parentComponent,
  6674. parentSuspense,
  6675. namespace,
  6676. slotScopeIds,
  6677. optimized,
  6678. commonLength
  6679. );
  6680. }
  6681. };
  6682. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6683. let i = 0;
  6684. const l2 = c2.length;
  6685. let e1 = c1.length - 1;
  6686. let e2 = l2 - 1;
  6687. while (i <= e1 && i <= e2) {
  6688. const n1 = c1[i];
  6689. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6690. if (isSameVNodeType(n1, n2)) {
  6691. patch(
  6692. n1,
  6693. n2,
  6694. container,
  6695. null,
  6696. parentComponent,
  6697. parentSuspense,
  6698. namespace,
  6699. slotScopeIds,
  6700. optimized
  6701. );
  6702. } else {
  6703. break;
  6704. }
  6705. i++;
  6706. }
  6707. while (i <= e1 && i <= e2) {
  6708. const n1 = c1[e1];
  6709. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  6710. if (isSameVNodeType(n1, n2)) {
  6711. patch(
  6712. n1,
  6713. n2,
  6714. container,
  6715. null,
  6716. parentComponent,
  6717. parentSuspense,
  6718. namespace,
  6719. slotScopeIds,
  6720. optimized
  6721. );
  6722. } else {
  6723. break;
  6724. }
  6725. e1--;
  6726. e2--;
  6727. }
  6728. if (i > e1) {
  6729. if (i <= e2) {
  6730. const nextPos = e2 + 1;
  6731. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  6732. while (i <= e2) {
  6733. patch(
  6734. null,
  6735. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  6736. container,
  6737. anchor,
  6738. parentComponent,
  6739. parentSuspense,
  6740. namespace,
  6741. slotScopeIds,
  6742. optimized
  6743. );
  6744. i++;
  6745. }
  6746. }
  6747. } else if (i > e2) {
  6748. while (i <= e1) {
  6749. unmount(c1[i], parentComponent, parentSuspense, true);
  6750. i++;
  6751. }
  6752. } else {
  6753. const s1 = i;
  6754. const s2 = i;
  6755. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  6756. for (i = s2; i <= e2; i++) {
  6757. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6758. if (nextChild.key != null) {
  6759. if (keyToNewIndexMap.has(nextChild.key)) {
  6760. warn$1(
  6761. `Duplicate keys found during update:`,
  6762. JSON.stringify(nextChild.key),
  6763. `Make sure keys are unique.`
  6764. );
  6765. }
  6766. keyToNewIndexMap.set(nextChild.key, i);
  6767. }
  6768. }
  6769. let j;
  6770. let patched = 0;
  6771. const toBePatched = e2 - s2 + 1;
  6772. let moved = false;
  6773. let maxNewIndexSoFar = 0;
  6774. const newIndexToOldIndexMap = new Array(toBePatched);
  6775. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  6776. for (i = s1; i <= e1; i++) {
  6777. const prevChild = c1[i];
  6778. if (patched >= toBePatched) {
  6779. unmount(prevChild, parentComponent, parentSuspense, true);
  6780. continue;
  6781. }
  6782. let newIndex;
  6783. if (prevChild.key != null) {
  6784. newIndex = keyToNewIndexMap.get(prevChild.key);
  6785. } else {
  6786. for (j = s2; j <= e2; j++) {
  6787. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  6788. newIndex = j;
  6789. break;
  6790. }
  6791. }
  6792. }
  6793. if (newIndex === void 0) {
  6794. unmount(prevChild, parentComponent, parentSuspense, true);
  6795. } else {
  6796. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  6797. if (newIndex >= maxNewIndexSoFar) {
  6798. maxNewIndexSoFar = newIndex;
  6799. } else {
  6800. moved = true;
  6801. }
  6802. patch(
  6803. prevChild,
  6804. c2[newIndex],
  6805. container,
  6806. null,
  6807. parentComponent,
  6808. parentSuspense,
  6809. namespace,
  6810. slotScopeIds,
  6811. optimized
  6812. );
  6813. patched++;
  6814. }
  6815. }
  6816. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  6817. j = increasingNewIndexSequence.length - 1;
  6818. for (i = toBePatched - 1; i >= 0; i--) {
  6819. const nextIndex = s2 + i;
  6820. const nextChild = c2[nextIndex];
  6821. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  6822. if (newIndexToOldIndexMap[i] === 0) {
  6823. patch(
  6824. null,
  6825. nextChild,
  6826. container,
  6827. anchor,
  6828. parentComponent,
  6829. parentSuspense,
  6830. namespace,
  6831. slotScopeIds,
  6832. optimized
  6833. );
  6834. } else if (moved) {
  6835. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  6836. move(nextChild, container, anchor, 2);
  6837. } else {
  6838. j--;
  6839. }
  6840. }
  6841. }
  6842. }
  6843. };
  6844. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  6845. const { el, type, transition, children, shapeFlag } = vnode;
  6846. if (shapeFlag & 6) {
  6847. move(vnode.component.subTree, container, anchor, moveType);
  6848. return;
  6849. }
  6850. if (shapeFlag & 128) {
  6851. vnode.suspense.move(container, anchor, moveType);
  6852. return;
  6853. }
  6854. if (shapeFlag & 64) {
  6855. type.move(vnode, container, anchor, internals);
  6856. return;
  6857. }
  6858. if (type === Fragment) {
  6859. hostInsert(el, container, anchor);
  6860. for (let i = 0; i < children.length; i++) {
  6861. move(children[i], container, anchor, moveType);
  6862. }
  6863. hostInsert(vnode.anchor, container, anchor);
  6864. return;
  6865. }
  6866. if (type === Static) {
  6867. moveStaticNode(vnode, container, anchor);
  6868. return;
  6869. }
  6870. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  6871. if (needTransition2) {
  6872. if (moveType === 0) {
  6873. transition.beforeEnter(el);
  6874. hostInsert(el, container, anchor);
  6875. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  6876. } else {
  6877. const { leave, delayLeave, afterLeave } = transition;
  6878. const remove2 = () => hostInsert(el, container, anchor);
  6879. const performLeave = () => {
  6880. leave(el, () => {
  6881. remove2();
  6882. afterLeave && afterLeave();
  6883. });
  6884. };
  6885. if (delayLeave) {
  6886. delayLeave(el, remove2, performLeave);
  6887. } else {
  6888. performLeave();
  6889. }
  6890. }
  6891. } else {
  6892. hostInsert(el, container, anchor);
  6893. }
  6894. };
  6895. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  6896. const {
  6897. type,
  6898. props,
  6899. ref,
  6900. children,
  6901. dynamicChildren,
  6902. shapeFlag,
  6903. patchFlag,
  6904. dirs,
  6905. cacheIndex
  6906. } = vnode;
  6907. if (patchFlag === -2) {
  6908. optimized = false;
  6909. }
  6910. if (ref != null) {
  6911. setRef(ref, null, parentSuspense, vnode, true);
  6912. }
  6913. if (cacheIndex != null) {
  6914. parentComponent.renderCache[cacheIndex] = void 0;
  6915. }
  6916. if (shapeFlag & 256) {
  6917. parentComponent.ctx.deactivate(vnode);
  6918. return;
  6919. }
  6920. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  6921. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  6922. let vnodeHook;
  6923. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  6924. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6925. }
  6926. if (shapeFlag & 6) {
  6927. unmountComponent(vnode.component, parentSuspense, doRemove);
  6928. } else {
  6929. if (shapeFlag & 128) {
  6930. vnode.suspense.unmount(parentSuspense, doRemove);
  6931. return;
  6932. }
  6933. if (shouldInvokeDirs) {
  6934. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  6935. }
  6936. if (shapeFlag & 64) {
  6937. vnode.type.remove(
  6938. vnode,
  6939. parentComponent,
  6940. parentSuspense,
  6941. internals,
  6942. doRemove
  6943. );
  6944. } else if (dynamicChildren && // #5154
  6945. // when v-once is used inside a block, setBlockTracking(-1) marks the
  6946. // parent block with hasOnce: true
  6947. // so that it doesn't take the fast path during unmount - otherwise
  6948. // components nested in v-once are never unmounted.
  6949. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  6950. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  6951. unmountChildren(
  6952. dynamicChildren,
  6953. parentComponent,
  6954. parentSuspense,
  6955. false,
  6956. true
  6957. );
  6958. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  6959. unmountChildren(children, parentComponent, parentSuspense);
  6960. }
  6961. if (doRemove) {
  6962. remove(vnode);
  6963. }
  6964. }
  6965. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  6966. queuePostRenderEffect(() => {
  6967. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6968. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  6969. }, parentSuspense);
  6970. }
  6971. };
  6972. const remove = (vnode) => {
  6973. const { type, el, anchor, transition } = vnode;
  6974. if (type === Fragment) {
  6975. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  6976. vnode.children.forEach((child) => {
  6977. if (child.type === Comment) {
  6978. hostRemove(child.el);
  6979. } else {
  6980. remove(child);
  6981. }
  6982. });
  6983. } else {
  6984. removeFragment(el, anchor);
  6985. }
  6986. return;
  6987. }
  6988. if (type === Static) {
  6989. removeStaticNode(vnode);
  6990. return;
  6991. }
  6992. const performRemove = () => {
  6993. hostRemove(el);
  6994. if (transition && !transition.persisted && transition.afterLeave) {
  6995. transition.afterLeave();
  6996. }
  6997. };
  6998. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  6999. const { leave, delayLeave } = transition;
  7000. const performLeave = () => leave(el, performRemove);
  7001. if (delayLeave) {
  7002. delayLeave(vnode.el, performRemove, performLeave);
  7003. } else {
  7004. performLeave();
  7005. }
  7006. } else {
  7007. performRemove();
  7008. }
  7009. };
  7010. const removeFragment = (cur, end) => {
  7011. let next;
  7012. while (cur !== end) {
  7013. next = hostNextSibling(cur);
  7014. hostRemove(cur);
  7015. cur = next;
  7016. }
  7017. hostRemove(end);
  7018. };
  7019. const unmountComponent = (instance, parentSuspense, doRemove) => {
  7020. if (instance.type.__hmrId) {
  7021. unregisterHMR(instance);
  7022. }
  7023. const { bum, scope, update, subTree, um, m, a } = instance;
  7024. invalidateMount(m);
  7025. invalidateMount(a);
  7026. if (bum) {
  7027. invokeArrayFns(bum);
  7028. }
  7029. scope.stop();
  7030. if (update) {
  7031. update.active = false;
  7032. unmount(subTree, instance, parentSuspense, doRemove);
  7033. }
  7034. if (um) {
  7035. queuePostRenderEffect(um, parentSuspense);
  7036. }
  7037. queuePostRenderEffect(() => {
  7038. instance.isUnmounted = true;
  7039. }, parentSuspense);
  7040. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  7041. parentSuspense.deps--;
  7042. if (parentSuspense.deps === 0) {
  7043. parentSuspense.resolve();
  7044. }
  7045. }
  7046. {
  7047. devtoolsComponentRemoved(instance);
  7048. }
  7049. };
  7050. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  7051. for (let i = start; i < children.length; i++) {
  7052. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  7053. }
  7054. };
  7055. const getNextHostNode = (vnode) => {
  7056. if (vnode.shapeFlag & 6) {
  7057. return getNextHostNode(vnode.component.subTree);
  7058. }
  7059. if (vnode.shapeFlag & 128) {
  7060. return vnode.suspense.next();
  7061. }
  7062. const el = hostNextSibling(vnode.anchor || vnode.el);
  7063. const teleportEnd = el && el[TeleportEndKey];
  7064. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  7065. };
  7066. let isFlushing = false;
  7067. const render = (vnode, container, namespace) => {
  7068. if (vnode == null) {
  7069. if (container._vnode) {
  7070. unmount(container._vnode, null, null, true);
  7071. }
  7072. } else {
  7073. patch(
  7074. container._vnode || null,
  7075. vnode,
  7076. container,
  7077. null,
  7078. null,
  7079. null,
  7080. namespace
  7081. );
  7082. }
  7083. container._vnode = vnode;
  7084. if (!isFlushing) {
  7085. isFlushing = true;
  7086. flushPreFlushCbs();
  7087. flushPostFlushCbs();
  7088. isFlushing = false;
  7089. }
  7090. };
  7091. const internals = {
  7092. p: patch,
  7093. um: unmount,
  7094. m: move,
  7095. r: remove,
  7096. mt: mountComponent,
  7097. mc: mountChildren,
  7098. pc: patchChildren,
  7099. pbc: patchBlockChildren,
  7100. n: getNextHostNode,
  7101. o: options
  7102. };
  7103. let hydrate;
  7104. let hydrateNode;
  7105. if (createHydrationFns) {
  7106. [hydrate, hydrateNode] = createHydrationFns(
  7107. internals
  7108. );
  7109. }
  7110. return {
  7111. render,
  7112. hydrate,
  7113. createApp: createAppAPI(render, hydrate)
  7114. };
  7115. }
  7116. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  7117. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  7118. }
  7119. function toggleRecurse({ effect, update }, allowed) {
  7120. effect.allowRecurse = update.allowRecurse = allowed;
  7121. }
  7122. function needTransition(parentSuspense, transition) {
  7123. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  7124. }
  7125. function traverseStaticChildren(n1, n2, shallow = false) {
  7126. const ch1 = n1.children;
  7127. const ch2 = n2.children;
  7128. if (isArray(ch1) && isArray(ch2)) {
  7129. for (let i = 0; i < ch1.length; i++) {
  7130. const c1 = ch1[i];
  7131. let c2 = ch2[i];
  7132. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  7133. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  7134. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  7135. c2.el = c1.el;
  7136. }
  7137. if (!shallow && c2.patchFlag !== -2)
  7138. traverseStaticChildren(c1, c2);
  7139. }
  7140. if (c2.type === Text) {
  7141. c2.el = c1.el;
  7142. }
  7143. if (c2.type === Comment && !c2.el) {
  7144. c2.el = c1.el;
  7145. }
  7146. }
  7147. }
  7148. }
  7149. function getSequence(arr) {
  7150. const p = arr.slice();
  7151. const result = [0];
  7152. let i, j, u, v, c;
  7153. const len = arr.length;
  7154. for (i = 0; i < len; i++) {
  7155. const arrI = arr[i];
  7156. if (arrI !== 0) {
  7157. j = result[result.length - 1];
  7158. if (arr[j] < arrI) {
  7159. p[i] = j;
  7160. result.push(i);
  7161. continue;
  7162. }
  7163. u = 0;
  7164. v = result.length - 1;
  7165. while (u < v) {
  7166. c = u + v >> 1;
  7167. if (arr[result[c]] < arrI) {
  7168. u = c + 1;
  7169. } else {
  7170. v = c;
  7171. }
  7172. }
  7173. if (arrI < arr[result[u]]) {
  7174. if (u > 0) {
  7175. p[i] = result[u - 1];
  7176. }
  7177. result[u] = i;
  7178. }
  7179. }
  7180. }
  7181. u = result.length;
  7182. v = result[u - 1];
  7183. while (u-- > 0) {
  7184. result[u] = v;
  7185. v = p[v];
  7186. }
  7187. return result;
  7188. }
  7189. function locateNonHydratedAsyncRoot(instance) {
  7190. const subComponent = instance.subTree.component;
  7191. if (subComponent) {
  7192. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  7193. return subComponent;
  7194. } else {
  7195. return locateNonHydratedAsyncRoot(subComponent);
  7196. }
  7197. }
  7198. }
  7199. function invalidateMount(hooks) {
  7200. if (hooks) {
  7201. for (let i = 0; i < hooks.length; i++) hooks[i].active = false;
  7202. }
  7203. }
  7204. const ssrContextKey = Symbol.for("v-scx");
  7205. const useSSRContext = () => {
  7206. {
  7207. warn$1(`useSSRContext() is not supported in the global build.`);
  7208. }
  7209. };
  7210. function watchEffect(effect, options) {
  7211. return doWatch(effect, null, options);
  7212. }
  7213. function watchPostEffect(effect, options) {
  7214. return doWatch(
  7215. effect,
  7216. null,
  7217. extend({}, options, { flush: "post" })
  7218. );
  7219. }
  7220. function watchSyncEffect(effect, options) {
  7221. return doWatch(
  7222. effect,
  7223. null,
  7224. extend({}, options, { flush: "sync" })
  7225. );
  7226. }
  7227. const INITIAL_WATCHER_VALUE = {};
  7228. function watch(source, cb, options) {
  7229. if (!isFunction(cb)) {
  7230. warn$1(
  7231. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  7232. );
  7233. }
  7234. return doWatch(source, cb, options);
  7235. }
  7236. function doWatch(source, cb, {
  7237. immediate,
  7238. deep,
  7239. flush,
  7240. once,
  7241. onTrack,
  7242. onTrigger
  7243. } = EMPTY_OBJ) {
  7244. if (cb && once) {
  7245. const _cb = cb;
  7246. cb = (...args) => {
  7247. _cb(...args);
  7248. unwatch();
  7249. };
  7250. }
  7251. if (deep !== void 0 && typeof deep === "number") {
  7252. warn$1(
  7253. `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
  7254. );
  7255. }
  7256. if (!cb) {
  7257. if (immediate !== void 0) {
  7258. warn$1(
  7259. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  7260. );
  7261. }
  7262. if (deep !== void 0) {
  7263. warn$1(
  7264. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  7265. );
  7266. }
  7267. if (once !== void 0) {
  7268. warn$1(
  7269. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  7270. );
  7271. }
  7272. }
  7273. const warnInvalidSource = (s) => {
  7274. warn$1(
  7275. `Invalid watch source: `,
  7276. s,
  7277. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  7278. );
  7279. };
  7280. const instance = currentInstance;
  7281. const reactiveGetter = (source2) => deep === true ? source2 : (
  7282. // for deep: false, only traverse root-level properties
  7283. traverse(source2, deep === false ? 1 : void 0)
  7284. );
  7285. let getter;
  7286. let forceTrigger = false;
  7287. let isMultiSource = false;
  7288. if (isRef(source)) {
  7289. getter = () => source.value;
  7290. forceTrigger = isShallow(source);
  7291. } else if (isReactive(source)) {
  7292. getter = () => reactiveGetter(source);
  7293. forceTrigger = true;
  7294. } else if (isArray(source)) {
  7295. isMultiSource = true;
  7296. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  7297. getter = () => source.map((s) => {
  7298. if (isRef(s)) {
  7299. return s.value;
  7300. } else if (isReactive(s)) {
  7301. return reactiveGetter(s);
  7302. } else if (isFunction(s)) {
  7303. return callWithErrorHandling(s, instance, 2);
  7304. } else {
  7305. warnInvalidSource(s);
  7306. }
  7307. });
  7308. } else if (isFunction(source)) {
  7309. if (cb) {
  7310. getter = () => callWithErrorHandling(source, instance, 2);
  7311. } else {
  7312. getter = () => {
  7313. if (cleanup) {
  7314. cleanup();
  7315. }
  7316. return callWithAsyncErrorHandling(
  7317. source,
  7318. instance,
  7319. 3,
  7320. [onCleanup]
  7321. );
  7322. };
  7323. }
  7324. } else {
  7325. getter = NOOP;
  7326. warnInvalidSource(source);
  7327. }
  7328. if (cb && deep) {
  7329. const baseGetter = getter;
  7330. getter = () => traverse(baseGetter());
  7331. }
  7332. let cleanup;
  7333. let onCleanup = (fn) => {
  7334. cleanup = effect.onStop = () => {
  7335. callWithErrorHandling(fn, instance, 4);
  7336. cleanup = effect.onStop = void 0;
  7337. };
  7338. };
  7339. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  7340. const job = () => {
  7341. if (!effect.active || !effect.dirty) {
  7342. return;
  7343. }
  7344. if (cb) {
  7345. const newValue = effect.run();
  7346. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  7347. if (cleanup) {
  7348. cleanup();
  7349. }
  7350. callWithAsyncErrorHandling(cb, instance, 3, [
  7351. newValue,
  7352. // pass undefined as the old value when it's changed for the first time
  7353. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  7354. onCleanup
  7355. ]);
  7356. oldValue = newValue;
  7357. }
  7358. } else {
  7359. effect.run();
  7360. }
  7361. };
  7362. job.allowRecurse = !!cb;
  7363. let scheduler;
  7364. if (flush === "sync") {
  7365. scheduler = job;
  7366. } else if (flush === "post") {
  7367. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  7368. } else {
  7369. job.pre = true;
  7370. if (instance) job.id = instance.uid;
  7371. scheduler = () => queueJob(job);
  7372. }
  7373. const effect = new ReactiveEffect(getter, NOOP, scheduler);
  7374. const scope = getCurrentScope();
  7375. const unwatch = () => {
  7376. effect.stop();
  7377. if (scope) {
  7378. remove(scope.effects, effect);
  7379. }
  7380. };
  7381. {
  7382. effect.onTrack = onTrack;
  7383. effect.onTrigger = onTrigger;
  7384. }
  7385. if (cb) {
  7386. if (immediate) {
  7387. job();
  7388. } else {
  7389. oldValue = effect.run();
  7390. }
  7391. } else if (flush === "post") {
  7392. queuePostRenderEffect(
  7393. effect.run.bind(effect),
  7394. instance && instance.suspense
  7395. );
  7396. } else {
  7397. effect.run();
  7398. }
  7399. return unwatch;
  7400. }
  7401. function instanceWatch(source, value, options) {
  7402. const publicThis = this.proxy;
  7403. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  7404. let cb;
  7405. if (isFunction(value)) {
  7406. cb = value;
  7407. } else {
  7408. cb = value.handler;
  7409. options = value;
  7410. }
  7411. const reset = setCurrentInstance(this);
  7412. const res = doWatch(getter, cb.bind(publicThis), options);
  7413. reset();
  7414. return res;
  7415. }
  7416. function createPathGetter(ctx, path) {
  7417. const segments = path.split(".");
  7418. return () => {
  7419. let cur = ctx;
  7420. for (let i = 0; i < segments.length && cur; i++) {
  7421. cur = cur[segments[i]];
  7422. }
  7423. return cur;
  7424. };
  7425. }
  7426. function traverse(value, depth = Infinity, seen) {
  7427. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  7428. return value;
  7429. }
  7430. seen = seen || /* @__PURE__ */ new Set();
  7431. if (seen.has(value)) {
  7432. return value;
  7433. }
  7434. seen.add(value);
  7435. depth--;
  7436. if (isRef(value)) {
  7437. traverse(value.value, depth, seen);
  7438. } else if (isArray(value)) {
  7439. for (let i = 0; i < value.length; i++) {
  7440. traverse(value[i], depth, seen);
  7441. }
  7442. } else if (isSet(value) || isMap(value)) {
  7443. value.forEach((v) => {
  7444. traverse(v, depth, seen);
  7445. });
  7446. } else if (isPlainObject(value)) {
  7447. for (const key in value) {
  7448. traverse(value[key], depth, seen);
  7449. }
  7450. for (const key of Object.getOwnPropertySymbols(value)) {
  7451. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  7452. traverse(value[key], depth, seen);
  7453. }
  7454. }
  7455. }
  7456. return value;
  7457. }
  7458. function useModel(props, name, options = EMPTY_OBJ) {
  7459. const i = getCurrentInstance();
  7460. if (!i) {
  7461. warn$1(`useModel() called without active instance.`);
  7462. return ref();
  7463. }
  7464. if (!i.propsOptions[0][name]) {
  7465. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  7466. return ref();
  7467. }
  7468. const camelizedName = camelize(name);
  7469. const hyphenatedName = hyphenate(name);
  7470. const modifiers = getModelModifiers(props, name);
  7471. const res = customRef((track, trigger) => {
  7472. let localValue;
  7473. let prevSetValue = EMPTY_OBJ;
  7474. let prevEmittedValue;
  7475. watchSyncEffect(() => {
  7476. const propValue = props[name];
  7477. if (hasChanged(localValue, propValue)) {
  7478. localValue = propValue;
  7479. trigger();
  7480. }
  7481. });
  7482. return {
  7483. get() {
  7484. track();
  7485. return options.get ? options.get(localValue) : localValue;
  7486. },
  7487. set(value) {
  7488. const emittedValue = options.set ? options.set(value) : value;
  7489. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  7490. return;
  7491. }
  7492. const rawProps = i.vnode.props;
  7493. if (!(rawProps && // check if parent has passed v-model
  7494. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  7495. localValue = value;
  7496. trigger();
  7497. }
  7498. i.emit(`update:${name}`, emittedValue);
  7499. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  7500. trigger();
  7501. }
  7502. prevSetValue = value;
  7503. prevEmittedValue = emittedValue;
  7504. }
  7505. };
  7506. });
  7507. res[Symbol.iterator] = () => {
  7508. let i2 = 0;
  7509. return {
  7510. next() {
  7511. if (i2 < 2) {
  7512. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  7513. } else {
  7514. return { done: true };
  7515. }
  7516. }
  7517. };
  7518. };
  7519. return res;
  7520. }
  7521. const getModelModifiers = (props, modelName) => {
  7522. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  7523. };
  7524. function emit(instance, event, ...rawArgs) {
  7525. if (instance.isUnmounted) return;
  7526. const props = instance.vnode.props || EMPTY_OBJ;
  7527. {
  7528. const {
  7529. emitsOptions,
  7530. propsOptions: [propsOptions]
  7531. } = instance;
  7532. if (emitsOptions) {
  7533. if (!(event in emitsOptions) && true) {
  7534. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  7535. warn$1(
  7536. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  7537. );
  7538. }
  7539. } else {
  7540. const validator = emitsOptions[event];
  7541. if (isFunction(validator)) {
  7542. const isValid = validator(...rawArgs);
  7543. if (!isValid) {
  7544. warn$1(
  7545. `Invalid event arguments: event validation failed for event "${event}".`
  7546. );
  7547. }
  7548. }
  7549. }
  7550. }
  7551. }
  7552. let args = rawArgs;
  7553. const isModelListener = event.startsWith("update:");
  7554. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  7555. if (modifiers) {
  7556. if (modifiers.trim) {
  7557. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  7558. }
  7559. if (modifiers.number) {
  7560. args = rawArgs.map(looseToNumber);
  7561. }
  7562. }
  7563. {
  7564. devtoolsComponentEmit(instance, event, args);
  7565. }
  7566. {
  7567. const lowerCaseEvent = event.toLowerCase();
  7568. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  7569. warn$1(
  7570. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  7571. instance,
  7572. instance.type
  7573. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
  7574. event
  7575. )}" instead of "${event}".`
  7576. );
  7577. }
  7578. }
  7579. let handlerName;
  7580. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  7581. props[handlerName = toHandlerKey(camelize(event))];
  7582. if (!handler && isModelListener) {
  7583. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  7584. }
  7585. if (handler) {
  7586. callWithAsyncErrorHandling(
  7587. handler,
  7588. instance,
  7589. 6,
  7590. args
  7591. );
  7592. }
  7593. const onceHandler = props[handlerName + `Once`];
  7594. if (onceHandler) {
  7595. if (!instance.emitted) {
  7596. instance.emitted = {};
  7597. } else if (instance.emitted[handlerName]) {
  7598. return;
  7599. }
  7600. instance.emitted[handlerName] = true;
  7601. callWithAsyncErrorHandling(
  7602. onceHandler,
  7603. instance,
  7604. 6,
  7605. args
  7606. );
  7607. }
  7608. }
  7609. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  7610. const cache = appContext.emitsCache;
  7611. const cached = cache.get(comp);
  7612. if (cached !== void 0) {
  7613. return cached;
  7614. }
  7615. const raw = comp.emits;
  7616. let normalized = {};
  7617. let hasExtends = false;
  7618. if (!isFunction(comp)) {
  7619. const extendEmits = (raw2) => {
  7620. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  7621. if (normalizedFromExtend) {
  7622. hasExtends = true;
  7623. extend(normalized, normalizedFromExtend);
  7624. }
  7625. };
  7626. if (!asMixin && appContext.mixins.length) {
  7627. appContext.mixins.forEach(extendEmits);
  7628. }
  7629. if (comp.extends) {
  7630. extendEmits(comp.extends);
  7631. }
  7632. if (comp.mixins) {
  7633. comp.mixins.forEach(extendEmits);
  7634. }
  7635. }
  7636. if (!raw && !hasExtends) {
  7637. if (isObject(comp)) {
  7638. cache.set(comp, null);
  7639. }
  7640. return null;
  7641. }
  7642. if (isArray(raw)) {
  7643. raw.forEach((key) => normalized[key] = null);
  7644. } else {
  7645. extend(normalized, raw);
  7646. }
  7647. if (isObject(comp)) {
  7648. cache.set(comp, normalized);
  7649. }
  7650. return normalized;
  7651. }
  7652. function isEmitListener(options, key) {
  7653. if (!options || !isOn(key)) {
  7654. return false;
  7655. }
  7656. key = key.slice(2).replace(/Once$/, "");
  7657. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  7658. }
  7659. let accessedAttrs = false;
  7660. function markAttrsAccessed() {
  7661. accessedAttrs = true;
  7662. }
  7663. function renderComponentRoot(instance) {
  7664. const {
  7665. type: Component,
  7666. vnode,
  7667. proxy,
  7668. withProxy,
  7669. propsOptions: [propsOptions],
  7670. slots,
  7671. attrs,
  7672. emit,
  7673. render,
  7674. renderCache,
  7675. props,
  7676. data,
  7677. setupState,
  7678. ctx,
  7679. inheritAttrs
  7680. } = instance;
  7681. const prev = setCurrentRenderingInstance(instance);
  7682. let result;
  7683. let fallthroughAttrs;
  7684. {
  7685. accessedAttrs = false;
  7686. }
  7687. try {
  7688. if (vnode.shapeFlag & 4) {
  7689. const proxyToUse = withProxy || proxy;
  7690. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  7691. get(target, key, receiver) {
  7692. warn$1(
  7693. `Property '${String(
  7694. key
  7695. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  7696. );
  7697. return Reflect.get(target, key, receiver);
  7698. }
  7699. }) : proxyToUse;
  7700. result = normalizeVNode(
  7701. render.call(
  7702. thisProxy,
  7703. proxyToUse,
  7704. renderCache,
  7705. true ? shallowReadonly(props) : props,
  7706. setupState,
  7707. data,
  7708. ctx
  7709. )
  7710. );
  7711. fallthroughAttrs = attrs;
  7712. } else {
  7713. const render2 = Component;
  7714. if (attrs === props) {
  7715. markAttrsAccessed();
  7716. }
  7717. result = normalizeVNode(
  7718. render2.length > 1 ? render2(
  7719. true ? shallowReadonly(props) : props,
  7720. true ? {
  7721. get attrs() {
  7722. markAttrsAccessed();
  7723. return shallowReadonly(attrs);
  7724. },
  7725. slots,
  7726. emit
  7727. } : { attrs, slots, emit }
  7728. ) : render2(
  7729. true ? shallowReadonly(props) : props,
  7730. null
  7731. )
  7732. );
  7733. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  7734. }
  7735. } catch (err) {
  7736. blockStack.length = 0;
  7737. handleError(err, instance, 1);
  7738. result = createVNode(Comment);
  7739. }
  7740. let root = result;
  7741. let setRoot = void 0;
  7742. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  7743. [root, setRoot] = getChildRoot(result);
  7744. }
  7745. if (fallthroughAttrs && inheritAttrs !== false) {
  7746. const keys = Object.keys(fallthroughAttrs);
  7747. const { shapeFlag } = root;
  7748. if (keys.length) {
  7749. if (shapeFlag & (1 | 6)) {
  7750. if (propsOptions && keys.some(isModelListener)) {
  7751. fallthroughAttrs = filterModelListeners(
  7752. fallthroughAttrs,
  7753. propsOptions
  7754. );
  7755. }
  7756. root = cloneVNode(root, fallthroughAttrs, false, true);
  7757. } else if (!accessedAttrs && root.type !== Comment) {
  7758. const allAttrs = Object.keys(attrs);
  7759. const eventAttrs = [];
  7760. const extraAttrs = [];
  7761. for (let i = 0, l = allAttrs.length; i < l; i++) {
  7762. const key = allAttrs[i];
  7763. if (isOn(key)) {
  7764. if (!isModelListener(key)) {
  7765. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  7766. }
  7767. } else {
  7768. extraAttrs.push(key);
  7769. }
  7770. }
  7771. if (extraAttrs.length) {
  7772. warn$1(
  7773. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  7774. );
  7775. }
  7776. if (eventAttrs.length) {
  7777. warn$1(
  7778. `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
  7779. );
  7780. }
  7781. }
  7782. }
  7783. }
  7784. if (vnode.dirs) {
  7785. if (!isElementRoot(root)) {
  7786. warn$1(
  7787. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  7788. );
  7789. }
  7790. root = cloneVNode(root, null, false, true);
  7791. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  7792. }
  7793. if (vnode.transition) {
  7794. if (!isElementRoot(root)) {
  7795. warn$1(
  7796. `Component inside <Transition> renders non-element root node that cannot be animated.`
  7797. );
  7798. }
  7799. root.transition = vnode.transition;
  7800. }
  7801. if (setRoot) {
  7802. setRoot(root);
  7803. } else {
  7804. result = root;
  7805. }
  7806. setCurrentRenderingInstance(prev);
  7807. return result;
  7808. }
  7809. const getChildRoot = (vnode) => {
  7810. const rawChildren = vnode.children;
  7811. const dynamicChildren = vnode.dynamicChildren;
  7812. const childRoot = filterSingleRoot(rawChildren, false);
  7813. if (!childRoot) {
  7814. return [vnode, void 0];
  7815. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  7816. return getChildRoot(childRoot);
  7817. }
  7818. const index = rawChildren.indexOf(childRoot);
  7819. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  7820. const setRoot = (updatedRoot) => {
  7821. rawChildren[index] = updatedRoot;
  7822. if (dynamicChildren) {
  7823. if (dynamicIndex > -1) {
  7824. dynamicChildren[dynamicIndex] = updatedRoot;
  7825. } else if (updatedRoot.patchFlag > 0) {
  7826. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  7827. }
  7828. }
  7829. };
  7830. return [normalizeVNode(childRoot), setRoot];
  7831. };
  7832. function filterSingleRoot(children, recurse = true) {
  7833. let singleRoot;
  7834. for (let i = 0; i < children.length; i++) {
  7835. const child = children[i];
  7836. if (isVNode(child)) {
  7837. if (child.type !== Comment || child.children === "v-if") {
  7838. if (singleRoot) {
  7839. return;
  7840. } else {
  7841. singleRoot = child;
  7842. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  7843. return filterSingleRoot(singleRoot.children);
  7844. }
  7845. }
  7846. }
  7847. } else {
  7848. return;
  7849. }
  7850. }
  7851. return singleRoot;
  7852. }
  7853. const getFunctionalFallthrough = (attrs) => {
  7854. let res;
  7855. for (const key in attrs) {
  7856. if (key === "class" || key === "style" || isOn(key)) {
  7857. (res || (res = {}))[key] = attrs[key];
  7858. }
  7859. }
  7860. return res;
  7861. };
  7862. const filterModelListeners = (attrs, props) => {
  7863. const res = {};
  7864. for (const key in attrs) {
  7865. if (!isModelListener(key) || !(key.slice(9) in props)) {
  7866. res[key] = attrs[key];
  7867. }
  7868. }
  7869. return res;
  7870. };
  7871. const isElementRoot = (vnode) => {
  7872. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  7873. };
  7874. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  7875. const { props: prevProps, children: prevChildren, component } = prevVNode;
  7876. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  7877. const emits = component.emitsOptions;
  7878. if ((prevChildren || nextChildren) && isHmrUpdating) {
  7879. return true;
  7880. }
  7881. if (nextVNode.dirs || nextVNode.transition) {
  7882. return true;
  7883. }
  7884. if (optimized && patchFlag >= 0) {
  7885. if (patchFlag & 1024) {
  7886. return true;
  7887. }
  7888. if (patchFlag & 16) {
  7889. if (!prevProps) {
  7890. return !!nextProps;
  7891. }
  7892. return hasPropsChanged(prevProps, nextProps, emits);
  7893. } else if (patchFlag & 8) {
  7894. const dynamicProps = nextVNode.dynamicProps;
  7895. for (let i = 0; i < dynamicProps.length; i++) {
  7896. const key = dynamicProps[i];
  7897. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  7898. return true;
  7899. }
  7900. }
  7901. }
  7902. } else {
  7903. if (prevChildren || nextChildren) {
  7904. if (!nextChildren || !nextChildren.$stable) {
  7905. return true;
  7906. }
  7907. }
  7908. if (prevProps === nextProps) {
  7909. return false;
  7910. }
  7911. if (!prevProps) {
  7912. return !!nextProps;
  7913. }
  7914. if (!nextProps) {
  7915. return true;
  7916. }
  7917. return hasPropsChanged(prevProps, nextProps, emits);
  7918. }
  7919. return false;
  7920. }
  7921. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  7922. const nextKeys = Object.keys(nextProps);
  7923. if (nextKeys.length !== Object.keys(prevProps).length) {
  7924. return true;
  7925. }
  7926. for (let i = 0; i < nextKeys.length; i++) {
  7927. const key = nextKeys[i];
  7928. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  7929. return true;
  7930. }
  7931. }
  7932. return false;
  7933. }
  7934. function updateHOCHostEl({ vnode, parent }, el) {
  7935. while (parent) {
  7936. const root = parent.subTree;
  7937. if (root.suspense && root.suspense.activeBranch === vnode) {
  7938. root.el = vnode.el;
  7939. }
  7940. if (root === vnode) {
  7941. (vnode = parent.vnode).el = el;
  7942. parent = parent.parent;
  7943. } else {
  7944. break;
  7945. }
  7946. }
  7947. }
  7948. const isSuspense = (type) => type.__isSuspense;
  7949. let suspenseId = 0;
  7950. const SuspenseImpl = {
  7951. name: "Suspense",
  7952. // In order to make Suspense tree-shakable, we need to avoid importing it
  7953. // directly in the renderer. The renderer checks for the __isSuspense flag
  7954. // on a vnode's type and calls the `process` method, passing in renderer
  7955. // internals.
  7956. __isSuspense: true,
  7957. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  7958. if (n1 == null) {
  7959. mountSuspense(
  7960. n2,
  7961. container,
  7962. anchor,
  7963. parentComponent,
  7964. parentSuspense,
  7965. namespace,
  7966. slotScopeIds,
  7967. optimized,
  7968. rendererInternals
  7969. );
  7970. } else {
  7971. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  7972. n2.suspense = n1.suspense;
  7973. n2.suspense.vnode = n2;
  7974. n2.el = n1.el;
  7975. return;
  7976. }
  7977. patchSuspense(
  7978. n1,
  7979. n2,
  7980. container,
  7981. anchor,
  7982. parentComponent,
  7983. namespace,
  7984. slotScopeIds,
  7985. optimized,
  7986. rendererInternals
  7987. );
  7988. }
  7989. },
  7990. hydrate: hydrateSuspense,
  7991. normalize: normalizeSuspenseChildren
  7992. };
  7993. const Suspense = SuspenseImpl ;
  7994. function triggerEvent(vnode, name) {
  7995. const eventListener = vnode.props && vnode.props[name];
  7996. if (isFunction(eventListener)) {
  7997. eventListener();
  7998. }
  7999. }
  8000. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8001. const {
  8002. p: patch,
  8003. o: { createElement }
  8004. } = rendererInternals;
  8005. const hiddenContainer = createElement("div");
  8006. const suspense = vnode.suspense = createSuspenseBoundary(
  8007. vnode,
  8008. parentSuspense,
  8009. parentComponent,
  8010. container,
  8011. hiddenContainer,
  8012. anchor,
  8013. namespace,
  8014. slotScopeIds,
  8015. optimized,
  8016. rendererInternals
  8017. );
  8018. patch(
  8019. null,
  8020. suspense.pendingBranch = vnode.ssContent,
  8021. hiddenContainer,
  8022. null,
  8023. parentComponent,
  8024. suspense,
  8025. namespace,
  8026. slotScopeIds
  8027. );
  8028. if (suspense.deps > 0) {
  8029. triggerEvent(vnode, "onPending");
  8030. triggerEvent(vnode, "onFallback");
  8031. patch(
  8032. null,
  8033. vnode.ssFallback,
  8034. container,
  8035. anchor,
  8036. parentComponent,
  8037. null,
  8038. // fallback tree will not have suspense context
  8039. namespace,
  8040. slotScopeIds
  8041. );
  8042. setActiveBranch(suspense, vnode.ssFallback);
  8043. } else {
  8044. suspense.resolve(false, true);
  8045. }
  8046. }
  8047. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  8048. const suspense = n2.suspense = n1.suspense;
  8049. suspense.vnode = n2;
  8050. n2.el = n1.el;
  8051. const newBranch = n2.ssContent;
  8052. const newFallback = n2.ssFallback;
  8053. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  8054. if (pendingBranch) {
  8055. suspense.pendingBranch = newBranch;
  8056. if (isSameVNodeType(newBranch, pendingBranch)) {
  8057. patch(
  8058. pendingBranch,
  8059. newBranch,
  8060. suspense.hiddenContainer,
  8061. null,
  8062. parentComponent,
  8063. suspense,
  8064. namespace,
  8065. slotScopeIds,
  8066. optimized
  8067. );
  8068. if (suspense.deps <= 0) {
  8069. suspense.resolve();
  8070. } else if (isInFallback) {
  8071. if (!isHydrating) {
  8072. patch(
  8073. activeBranch,
  8074. newFallback,
  8075. container,
  8076. anchor,
  8077. parentComponent,
  8078. null,
  8079. // fallback tree will not have suspense context
  8080. namespace,
  8081. slotScopeIds,
  8082. optimized
  8083. );
  8084. setActiveBranch(suspense, newFallback);
  8085. }
  8086. }
  8087. } else {
  8088. suspense.pendingId = suspenseId++;
  8089. if (isHydrating) {
  8090. suspense.isHydrating = false;
  8091. suspense.activeBranch = pendingBranch;
  8092. } else {
  8093. unmount(pendingBranch, parentComponent, suspense);
  8094. }
  8095. suspense.deps = 0;
  8096. suspense.effects.length = 0;
  8097. suspense.hiddenContainer = createElement("div");
  8098. if (isInFallback) {
  8099. patch(
  8100. null,
  8101. newBranch,
  8102. suspense.hiddenContainer,
  8103. null,
  8104. parentComponent,
  8105. suspense,
  8106. namespace,
  8107. slotScopeIds,
  8108. optimized
  8109. );
  8110. if (suspense.deps <= 0) {
  8111. suspense.resolve();
  8112. } else {
  8113. patch(
  8114. activeBranch,
  8115. newFallback,
  8116. container,
  8117. anchor,
  8118. parentComponent,
  8119. null,
  8120. // fallback tree will not have suspense context
  8121. namespace,
  8122. slotScopeIds,
  8123. optimized
  8124. );
  8125. setActiveBranch(suspense, newFallback);
  8126. }
  8127. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8128. patch(
  8129. activeBranch,
  8130. newBranch,
  8131. container,
  8132. anchor,
  8133. parentComponent,
  8134. suspense,
  8135. namespace,
  8136. slotScopeIds,
  8137. optimized
  8138. );
  8139. suspense.resolve(true);
  8140. } else {
  8141. patch(
  8142. null,
  8143. newBranch,
  8144. suspense.hiddenContainer,
  8145. null,
  8146. parentComponent,
  8147. suspense,
  8148. namespace,
  8149. slotScopeIds,
  8150. optimized
  8151. );
  8152. if (suspense.deps <= 0) {
  8153. suspense.resolve();
  8154. }
  8155. }
  8156. }
  8157. } else {
  8158. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8159. patch(
  8160. activeBranch,
  8161. newBranch,
  8162. container,
  8163. anchor,
  8164. parentComponent,
  8165. suspense,
  8166. namespace,
  8167. slotScopeIds,
  8168. optimized
  8169. );
  8170. setActiveBranch(suspense, newBranch);
  8171. } else {
  8172. triggerEvent(n2, "onPending");
  8173. suspense.pendingBranch = newBranch;
  8174. if (newBranch.shapeFlag & 512) {
  8175. suspense.pendingId = newBranch.component.suspenseId;
  8176. } else {
  8177. suspense.pendingId = suspenseId++;
  8178. }
  8179. patch(
  8180. null,
  8181. newBranch,
  8182. suspense.hiddenContainer,
  8183. null,
  8184. parentComponent,
  8185. suspense,
  8186. namespace,
  8187. slotScopeIds,
  8188. optimized
  8189. );
  8190. if (suspense.deps <= 0) {
  8191. suspense.resolve();
  8192. } else {
  8193. const { timeout, pendingId } = suspense;
  8194. if (timeout > 0) {
  8195. setTimeout(() => {
  8196. if (suspense.pendingId === pendingId) {
  8197. suspense.fallback(newFallback);
  8198. }
  8199. }, timeout);
  8200. } else if (timeout === 0) {
  8201. suspense.fallback(newFallback);
  8202. }
  8203. }
  8204. }
  8205. }
  8206. }
  8207. let hasWarned = false;
  8208. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  8209. if (!hasWarned) {
  8210. hasWarned = true;
  8211. console[console.info ? "info" : "log"](
  8212. `<Suspense> is an experimental feature and its API will likely change.`
  8213. );
  8214. }
  8215. const {
  8216. p: patch,
  8217. m: move,
  8218. um: unmount,
  8219. n: next,
  8220. o: { parentNode, remove }
  8221. } = rendererInternals;
  8222. let parentSuspenseId;
  8223. const isSuspensible = isVNodeSuspensible(vnode);
  8224. if (isSuspensible) {
  8225. if (parentSuspense && parentSuspense.pendingBranch) {
  8226. parentSuspenseId = parentSuspense.pendingId;
  8227. parentSuspense.deps++;
  8228. }
  8229. }
  8230. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  8231. {
  8232. assertNumber(timeout, `Suspense timeout`);
  8233. }
  8234. const initialAnchor = anchor;
  8235. const suspense = {
  8236. vnode,
  8237. parent: parentSuspense,
  8238. parentComponent,
  8239. namespace,
  8240. container,
  8241. hiddenContainer,
  8242. deps: 0,
  8243. pendingId: suspenseId++,
  8244. timeout: typeof timeout === "number" ? timeout : -1,
  8245. activeBranch: null,
  8246. pendingBranch: null,
  8247. isInFallback: !isHydrating,
  8248. isHydrating,
  8249. isUnmounted: false,
  8250. effects: [],
  8251. resolve(resume = false, sync = false) {
  8252. {
  8253. if (!resume && !suspense.pendingBranch) {
  8254. throw new Error(
  8255. `suspense.resolve() is called without a pending branch.`
  8256. );
  8257. }
  8258. if (suspense.isUnmounted) {
  8259. throw new Error(
  8260. `suspense.resolve() is called on an already unmounted suspense boundary.`
  8261. );
  8262. }
  8263. }
  8264. const {
  8265. vnode: vnode2,
  8266. activeBranch,
  8267. pendingBranch,
  8268. pendingId,
  8269. effects,
  8270. parentComponent: parentComponent2,
  8271. container: container2
  8272. } = suspense;
  8273. let delayEnter = false;
  8274. if (suspense.isHydrating) {
  8275. suspense.isHydrating = false;
  8276. } else if (!resume) {
  8277. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  8278. if (delayEnter) {
  8279. activeBranch.transition.afterLeave = () => {
  8280. if (pendingId === suspense.pendingId) {
  8281. move(
  8282. pendingBranch,
  8283. container2,
  8284. anchor === initialAnchor ? next(activeBranch) : anchor,
  8285. 0
  8286. );
  8287. queuePostFlushCb(effects);
  8288. }
  8289. };
  8290. }
  8291. if (activeBranch) {
  8292. if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
  8293. anchor = next(activeBranch);
  8294. }
  8295. unmount(activeBranch, parentComponent2, suspense, true);
  8296. }
  8297. if (!delayEnter) {
  8298. move(pendingBranch, container2, anchor, 0);
  8299. }
  8300. }
  8301. setActiveBranch(suspense, pendingBranch);
  8302. suspense.pendingBranch = null;
  8303. suspense.isInFallback = false;
  8304. let parent = suspense.parent;
  8305. let hasUnresolvedAncestor = false;
  8306. while (parent) {
  8307. if (parent.pendingBranch) {
  8308. parent.effects.push(...effects);
  8309. hasUnresolvedAncestor = true;
  8310. break;
  8311. }
  8312. parent = parent.parent;
  8313. }
  8314. if (!hasUnresolvedAncestor && !delayEnter) {
  8315. queuePostFlushCb(effects);
  8316. }
  8317. suspense.effects = [];
  8318. if (isSuspensible) {
  8319. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  8320. parentSuspense.deps--;
  8321. if (parentSuspense.deps === 0 && !sync) {
  8322. parentSuspense.resolve();
  8323. }
  8324. }
  8325. }
  8326. triggerEvent(vnode2, "onResolve");
  8327. },
  8328. fallback(fallbackVNode) {
  8329. if (!suspense.pendingBranch) {
  8330. return;
  8331. }
  8332. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  8333. triggerEvent(vnode2, "onFallback");
  8334. const anchor2 = next(activeBranch);
  8335. const mountFallback = () => {
  8336. if (!suspense.isInFallback) {
  8337. return;
  8338. }
  8339. patch(
  8340. null,
  8341. fallbackVNode,
  8342. container2,
  8343. anchor2,
  8344. parentComponent2,
  8345. null,
  8346. // fallback tree will not have suspense context
  8347. namespace2,
  8348. slotScopeIds,
  8349. optimized
  8350. );
  8351. setActiveBranch(suspense, fallbackVNode);
  8352. };
  8353. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  8354. if (delayEnter) {
  8355. activeBranch.transition.afterLeave = mountFallback;
  8356. }
  8357. suspense.isInFallback = true;
  8358. unmount(
  8359. activeBranch,
  8360. parentComponent2,
  8361. null,
  8362. // no suspense so unmount hooks fire now
  8363. true
  8364. // shouldRemove
  8365. );
  8366. if (!delayEnter) {
  8367. mountFallback();
  8368. }
  8369. },
  8370. move(container2, anchor2, type) {
  8371. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  8372. suspense.container = container2;
  8373. },
  8374. next() {
  8375. return suspense.activeBranch && next(suspense.activeBranch);
  8376. },
  8377. registerDep(instance, setupRenderEffect, optimized2) {
  8378. const isInPendingSuspense = !!suspense.pendingBranch;
  8379. if (isInPendingSuspense) {
  8380. suspense.deps++;
  8381. }
  8382. const hydratedEl = instance.vnode.el;
  8383. instance.asyncDep.catch((err) => {
  8384. handleError(err, instance, 0);
  8385. }).then((asyncSetupResult) => {
  8386. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  8387. return;
  8388. }
  8389. instance.asyncResolved = true;
  8390. const { vnode: vnode2 } = instance;
  8391. {
  8392. pushWarningContext(vnode2);
  8393. }
  8394. handleSetupResult(instance, asyncSetupResult, false);
  8395. if (hydratedEl) {
  8396. vnode2.el = hydratedEl;
  8397. }
  8398. const placeholder = !hydratedEl && instance.subTree.el;
  8399. setupRenderEffect(
  8400. instance,
  8401. vnode2,
  8402. // component may have been moved before resolve.
  8403. // if this is not a hydration, instance.subTree will be the comment
  8404. // placeholder.
  8405. parentNode(hydratedEl || instance.subTree.el),
  8406. // anchor will not be used if this is hydration, so only need to
  8407. // consider the comment placeholder case.
  8408. hydratedEl ? null : next(instance.subTree),
  8409. suspense,
  8410. namespace,
  8411. optimized2
  8412. );
  8413. if (placeholder) {
  8414. remove(placeholder);
  8415. }
  8416. updateHOCHostEl(instance, vnode2.el);
  8417. {
  8418. popWarningContext();
  8419. }
  8420. if (isInPendingSuspense && --suspense.deps === 0) {
  8421. suspense.resolve();
  8422. }
  8423. });
  8424. },
  8425. unmount(parentSuspense2, doRemove) {
  8426. suspense.isUnmounted = true;
  8427. if (suspense.activeBranch) {
  8428. unmount(
  8429. suspense.activeBranch,
  8430. parentComponent,
  8431. parentSuspense2,
  8432. doRemove
  8433. );
  8434. }
  8435. if (suspense.pendingBranch) {
  8436. unmount(
  8437. suspense.pendingBranch,
  8438. parentComponent,
  8439. parentSuspense2,
  8440. doRemove
  8441. );
  8442. }
  8443. }
  8444. };
  8445. return suspense;
  8446. }
  8447. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  8448. const suspense = vnode.suspense = createSuspenseBoundary(
  8449. vnode,
  8450. parentSuspense,
  8451. parentComponent,
  8452. node.parentNode,
  8453. // eslint-disable-next-line no-restricted-globals
  8454. document.createElement("div"),
  8455. null,
  8456. namespace,
  8457. slotScopeIds,
  8458. optimized,
  8459. rendererInternals,
  8460. true
  8461. );
  8462. const result = hydrateNode(
  8463. node,
  8464. suspense.pendingBranch = vnode.ssContent,
  8465. parentComponent,
  8466. suspense,
  8467. slotScopeIds,
  8468. optimized
  8469. );
  8470. if (suspense.deps === 0) {
  8471. suspense.resolve(false, true);
  8472. }
  8473. return result;
  8474. }
  8475. function normalizeSuspenseChildren(vnode) {
  8476. const { shapeFlag, children } = vnode;
  8477. const isSlotChildren = shapeFlag & 32;
  8478. vnode.ssContent = normalizeSuspenseSlot(
  8479. isSlotChildren ? children.default : children
  8480. );
  8481. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  8482. }
  8483. function normalizeSuspenseSlot(s) {
  8484. let block;
  8485. if (isFunction(s)) {
  8486. const trackBlock = isBlockTreeEnabled && s._c;
  8487. if (trackBlock) {
  8488. s._d = false;
  8489. openBlock();
  8490. }
  8491. s = s();
  8492. if (trackBlock) {
  8493. s._d = true;
  8494. block = currentBlock;
  8495. closeBlock();
  8496. }
  8497. }
  8498. if (isArray(s)) {
  8499. const singleChild = filterSingleRoot(s);
  8500. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  8501. warn$1(`<Suspense> slots expect a single root node.`);
  8502. }
  8503. s = singleChild;
  8504. }
  8505. s = normalizeVNode(s);
  8506. if (block && !s.dynamicChildren) {
  8507. s.dynamicChildren = block.filter((c) => c !== s);
  8508. }
  8509. return s;
  8510. }
  8511. function queueEffectWithSuspense(fn, suspense) {
  8512. if (suspense && suspense.pendingBranch) {
  8513. if (isArray(fn)) {
  8514. suspense.effects.push(...fn);
  8515. } else {
  8516. suspense.effects.push(fn);
  8517. }
  8518. } else {
  8519. queuePostFlushCb(fn);
  8520. }
  8521. }
  8522. function setActiveBranch(suspense, branch) {
  8523. suspense.activeBranch = branch;
  8524. const { vnode, parentComponent } = suspense;
  8525. let el = branch.el;
  8526. while (!el && branch.component) {
  8527. branch = branch.component.subTree;
  8528. el = branch.el;
  8529. }
  8530. vnode.el = el;
  8531. if (parentComponent && parentComponent.subTree === vnode) {
  8532. parentComponent.vnode.el = el;
  8533. updateHOCHostEl(parentComponent, el);
  8534. }
  8535. }
  8536. function isVNodeSuspensible(vnode) {
  8537. const suspensible = vnode.props && vnode.props.suspensible;
  8538. return suspensible != null && suspensible !== false;
  8539. }
  8540. const Fragment = Symbol.for("v-fgt");
  8541. const Text = Symbol.for("v-txt");
  8542. const Comment = Symbol.for("v-cmt");
  8543. const Static = Symbol.for("v-stc");
  8544. const blockStack = [];
  8545. let currentBlock = null;
  8546. function openBlock(disableTracking = false) {
  8547. blockStack.push(currentBlock = disableTracking ? null : []);
  8548. }
  8549. function closeBlock() {
  8550. blockStack.pop();
  8551. currentBlock = blockStack[blockStack.length - 1] || null;
  8552. }
  8553. let isBlockTreeEnabled = 1;
  8554. function setBlockTracking(value) {
  8555. isBlockTreeEnabled += value;
  8556. if (value < 0 && currentBlock) {
  8557. currentBlock.hasOnce = true;
  8558. }
  8559. }
  8560. function setupBlock(vnode) {
  8561. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  8562. closeBlock();
  8563. if (isBlockTreeEnabled > 0 && currentBlock) {
  8564. currentBlock.push(vnode);
  8565. }
  8566. return vnode;
  8567. }
  8568. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  8569. return setupBlock(
  8570. createBaseVNode(
  8571. type,
  8572. props,
  8573. children,
  8574. patchFlag,
  8575. dynamicProps,
  8576. shapeFlag,
  8577. true
  8578. )
  8579. );
  8580. }
  8581. function createBlock(type, props, children, patchFlag, dynamicProps) {
  8582. return setupBlock(
  8583. createVNode(
  8584. type,
  8585. props,
  8586. children,
  8587. patchFlag,
  8588. dynamicProps,
  8589. true
  8590. )
  8591. );
  8592. }
  8593. function isVNode(value) {
  8594. return value ? value.__v_isVNode === true : false;
  8595. }
  8596. function isSameVNodeType(n1, n2) {
  8597. if (n2.shapeFlag & 6 && n1.component) {
  8598. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  8599. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  8600. n1.shapeFlag &= ~256;
  8601. n2.shapeFlag &= ~512;
  8602. return false;
  8603. }
  8604. }
  8605. return n1.type === n2.type && n1.key === n2.key;
  8606. }
  8607. let vnodeArgsTransformer;
  8608. function transformVNodeArgs(transformer) {
  8609. vnodeArgsTransformer = transformer;
  8610. }
  8611. const createVNodeWithArgsTransform = (...args) => {
  8612. return _createVNode(
  8613. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  8614. );
  8615. };
  8616. const normalizeKey = ({ key }) => key != null ? key : null;
  8617. const normalizeRef = ({
  8618. ref,
  8619. ref_key,
  8620. ref_for
  8621. }) => {
  8622. if (typeof ref === "number") {
  8623. ref = "" + ref;
  8624. }
  8625. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  8626. };
  8627. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  8628. const vnode = {
  8629. __v_isVNode: true,
  8630. __v_skip: true,
  8631. type,
  8632. props,
  8633. key: props && normalizeKey(props),
  8634. ref: props && normalizeRef(props),
  8635. scopeId: currentScopeId,
  8636. slotScopeIds: null,
  8637. children,
  8638. component: null,
  8639. suspense: null,
  8640. ssContent: null,
  8641. ssFallback: null,
  8642. dirs: null,
  8643. transition: null,
  8644. el: null,
  8645. anchor: null,
  8646. target: null,
  8647. targetStart: null,
  8648. targetAnchor: null,
  8649. staticCount: 0,
  8650. shapeFlag,
  8651. patchFlag,
  8652. dynamicProps,
  8653. dynamicChildren: null,
  8654. appContext: null,
  8655. ctx: currentRenderingInstance
  8656. };
  8657. if (needFullChildrenNormalization) {
  8658. normalizeChildren(vnode, children);
  8659. if (shapeFlag & 128) {
  8660. type.normalize(vnode);
  8661. }
  8662. } else if (children) {
  8663. vnode.shapeFlag |= isString(children) ? 8 : 16;
  8664. }
  8665. if (vnode.key !== vnode.key) {
  8666. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  8667. }
  8668. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  8669. !isBlockNode && // has current parent block
  8670. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  8671. // component nodes also should always be patched, because even if the
  8672. // component doesn't need to update, it needs to persist the instance on to
  8673. // the next vnode so that it can be properly unmounted later.
  8674. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  8675. // vnode should not be considered dynamic due to handler caching.
  8676. vnode.patchFlag !== 32) {
  8677. currentBlock.push(vnode);
  8678. }
  8679. return vnode;
  8680. }
  8681. const createVNode = createVNodeWithArgsTransform ;
  8682. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  8683. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  8684. if (!type) {
  8685. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  8686. }
  8687. type = Comment;
  8688. }
  8689. if (isVNode(type)) {
  8690. const cloned = cloneVNode(
  8691. type,
  8692. props,
  8693. true
  8694. /* mergeRef: true */
  8695. );
  8696. if (children) {
  8697. normalizeChildren(cloned, children);
  8698. }
  8699. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  8700. if (cloned.shapeFlag & 6) {
  8701. currentBlock[currentBlock.indexOf(type)] = cloned;
  8702. } else {
  8703. currentBlock.push(cloned);
  8704. }
  8705. }
  8706. cloned.patchFlag = -2;
  8707. return cloned;
  8708. }
  8709. if (isClassComponent(type)) {
  8710. type = type.__vccOpts;
  8711. }
  8712. if (props) {
  8713. props = guardReactiveProps(props);
  8714. let { class: klass, style } = props;
  8715. if (klass && !isString(klass)) {
  8716. props.class = normalizeClass(klass);
  8717. }
  8718. if (isObject(style)) {
  8719. if (isProxy(style) && !isArray(style)) {
  8720. style = extend({}, style);
  8721. }
  8722. props.style = normalizeStyle(style);
  8723. }
  8724. }
  8725. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  8726. if (shapeFlag & 4 && isProxy(type)) {
  8727. type = toRaw(type);
  8728. warn$1(
  8729. `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
  8730. `
  8731. Component that was made reactive: `,
  8732. type
  8733. );
  8734. }
  8735. return createBaseVNode(
  8736. type,
  8737. props,
  8738. children,
  8739. patchFlag,
  8740. dynamicProps,
  8741. shapeFlag,
  8742. isBlockNode,
  8743. true
  8744. );
  8745. }
  8746. function guardReactiveProps(props) {
  8747. if (!props) return null;
  8748. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  8749. }
  8750. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  8751. const { props, ref, patchFlag, children, transition } = vnode;
  8752. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  8753. const cloned = {
  8754. __v_isVNode: true,
  8755. __v_skip: true,
  8756. type: vnode.type,
  8757. props: mergedProps,
  8758. key: mergedProps && normalizeKey(mergedProps),
  8759. ref: extraProps && extraProps.ref ? (
  8760. // #2078 in the case of <component :is="vnode" ref="extra"/>
  8761. // if the vnode itself already has a ref, cloneVNode will need to merge
  8762. // the refs so the single vnode can be set on multiple refs
  8763. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  8764. ) : ref,
  8765. scopeId: vnode.scopeId,
  8766. slotScopeIds: vnode.slotScopeIds,
  8767. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  8768. target: vnode.target,
  8769. targetStart: vnode.targetStart,
  8770. targetAnchor: vnode.targetAnchor,
  8771. staticCount: vnode.staticCount,
  8772. shapeFlag: vnode.shapeFlag,
  8773. // if the vnode is cloned with extra props, we can no longer assume its
  8774. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  8775. // note: preserve flag for fragments since they use the flag for children
  8776. // fast paths only.
  8777. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  8778. dynamicProps: vnode.dynamicProps,
  8779. dynamicChildren: vnode.dynamicChildren,
  8780. appContext: vnode.appContext,
  8781. dirs: vnode.dirs,
  8782. transition,
  8783. // These should technically only be non-null on mounted VNodes. However,
  8784. // they *should* be copied for kept-alive vnodes. So we just always copy
  8785. // them since them being non-null during a mount doesn't affect the logic as
  8786. // they will simply be overwritten.
  8787. component: vnode.component,
  8788. suspense: vnode.suspense,
  8789. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  8790. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  8791. el: vnode.el,
  8792. anchor: vnode.anchor,
  8793. ctx: vnode.ctx,
  8794. ce: vnode.ce
  8795. };
  8796. if (transition && cloneTransition) {
  8797. setTransitionHooks(
  8798. cloned,
  8799. transition.clone(cloned)
  8800. );
  8801. }
  8802. return cloned;
  8803. }
  8804. function deepCloneVNode(vnode) {
  8805. const cloned = cloneVNode(vnode);
  8806. if (isArray(vnode.children)) {
  8807. cloned.children = vnode.children.map(deepCloneVNode);
  8808. }
  8809. return cloned;
  8810. }
  8811. function createTextVNode(text = " ", flag = 0) {
  8812. return createVNode(Text, null, text, flag);
  8813. }
  8814. function createStaticVNode(content, numberOfNodes) {
  8815. const vnode = createVNode(Static, null, content);
  8816. vnode.staticCount = numberOfNodes;
  8817. return vnode;
  8818. }
  8819. function createCommentVNode(text = "", asBlock = false) {
  8820. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  8821. }
  8822. function normalizeVNode(child) {
  8823. if (child == null || typeof child === "boolean") {
  8824. return createVNode(Comment);
  8825. } else if (isArray(child)) {
  8826. return createVNode(
  8827. Fragment,
  8828. null,
  8829. // #3666, avoid reference pollution when reusing vnode
  8830. child.slice()
  8831. );
  8832. } else if (typeof child === "object") {
  8833. return cloneIfMounted(child);
  8834. } else {
  8835. return createVNode(Text, null, String(child));
  8836. }
  8837. }
  8838. function cloneIfMounted(child) {
  8839. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  8840. }
  8841. function normalizeChildren(vnode, children) {
  8842. let type = 0;
  8843. const { shapeFlag } = vnode;
  8844. if (children == null) {
  8845. children = null;
  8846. } else if (isArray(children)) {
  8847. type = 16;
  8848. } else if (typeof children === "object") {
  8849. if (shapeFlag & (1 | 64)) {
  8850. const slot = children.default;
  8851. if (slot) {
  8852. slot._c && (slot._d = false);
  8853. normalizeChildren(vnode, slot());
  8854. slot._c && (slot._d = true);
  8855. }
  8856. return;
  8857. } else {
  8858. type = 32;
  8859. const slotFlag = children._;
  8860. if (!slotFlag && !isInternalObject(children)) {
  8861. children._ctx = currentRenderingInstance;
  8862. } else if (slotFlag === 3 && currentRenderingInstance) {
  8863. if (currentRenderingInstance.slots._ === 1) {
  8864. children._ = 1;
  8865. } else {
  8866. children._ = 2;
  8867. vnode.patchFlag |= 1024;
  8868. }
  8869. }
  8870. }
  8871. } else if (isFunction(children)) {
  8872. children = { default: children, _ctx: currentRenderingInstance };
  8873. type = 32;
  8874. } else {
  8875. children = String(children);
  8876. if (shapeFlag & 64) {
  8877. type = 16;
  8878. children = [createTextVNode(children)];
  8879. } else {
  8880. type = 8;
  8881. }
  8882. }
  8883. vnode.children = children;
  8884. vnode.shapeFlag |= type;
  8885. }
  8886. function mergeProps(...args) {
  8887. const ret = {};
  8888. for (let i = 0; i < args.length; i++) {
  8889. const toMerge = args[i];
  8890. for (const key in toMerge) {
  8891. if (key === "class") {
  8892. if (ret.class !== toMerge.class) {
  8893. ret.class = normalizeClass([ret.class, toMerge.class]);
  8894. }
  8895. } else if (key === "style") {
  8896. ret.style = normalizeStyle([ret.style, toMerge.style]);
  8897. } else if (isOn(key)) {
  8898. const existing = ret[key];
  8899. const incoming = toMerge[key];
  8900. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  8901. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  8902. }
  8903. } else if (key !== "") {
  8904. ret[key] = toMerge[key];
  8905. }
  8906. }
  8907. }
  8908. return ret;
  8909. }
  8910. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  8911. callWithAsyncErrorHandling(hook, instance, 7, [
  8912. vnode,
  8913. prevVNode
  8914. ]);
  8915. }
  8916. const emptyAppContext = createAppContext();
  8917. let uid = 0;
  8918. function createComponentInstance(vnode, parent, suspense) {
  8919. const type = vnode.type;
  8920. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  8921. const instance = {
  8922. uid: uid++,
  8923. vnode,
  8924. type,
  8925. parent,
  8926. appContext,
  8927. root: null,
  8928. // to be immediately set
  8929. next: null,
  8930. subTree: null,
  8931. // will be set synchronously right after creation
  8932. effect: null,
  8933. update: null,
  8934. // will be set synchronously right after creation
  8935. scope: new EffectScope(
  8936. true
  8937. /* detached */
  8938. ),
  8939. render: null,
  8940. proxy: null,
  8941. exposed: null,
  8942. exposeProxy: null,
  8943. withProxy: null,
  8944. provides: parent ? parent.provides : Object.create(appContext.provides),
  8945. accessCache: null,
  8946. renderCache: [],
  8947. // local resolved assets
  8948. components: null,
  8949. directives: null,
  8950. // resolved props and emits options
  8951. propsOptions: normalizePropsOptions(type, appContext),
  8952. emitsOptions: normalizeEmitsOptions(type, appContext),
  8953. // emit
  8954. emit: null,
  8955. // to be set immediately
  8956. emitted: null,
  8957. // props default value
  8958. propsDefaults: EMPTY_OBJ,
  8959. // inheritAttrs
  8960. inheritAttrs: type.inheritAttrs,
  8961. // state
  8962. ctx: EMPTY_OBJ,
  8963. data: EMPTY_OBJ,
  8964. props: EMPTY_OBJ,
  8965. attrs: EMPTY_OBJ,
  8966. slots: EMPTY_OBJ,
  8967. refs: EMPTY_OBJ,
  8968. setupState: EMPTY_OBJ,
  8969. setupContext: null,
  8970. // suspense related
  8971. suspense,
  8972. suspenseId: suspense ? suspense.pendingId : 0,
  8973. asyncDep: null,
  8974. asyncResolved: false,
  8975. // lifecycle hooks
  8976. // not using enums here because it results in computed properties
  8977. isMounted: false,
  8978. isUnmounted: false,
  8979. isDeactivated: false,
  8980. bc: null,
  8981. c: null,
  8982. bm: null,
  8983. m: null,
  8984. bu: null,
  8985. u: null,
  8986. um: null,
  8987. bum: null,
  8988. da: null,
  8989. a: null,
  8990. rtg: null,
  8991. rtc: null,
  8992. ec: null,
  8993. sp: null
  8994. };
  8995. {
  8996. instance.ctx = createDevRenderContext(instance);
  8997. }
  8998. instance.root = parent ? parent.root : instance;
  8999. instance.emit = emit.bind(null, instance);
  9000. if (vnode.ce) {
  9001. vnode.ce(instance);
  9002. }
  9003. return instance;
  9004. }
  9005. let currentInstance = null;
  9006. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  9007. let internalSetCurrentInstance;
  9008. let setInSSRSetupState;
  9009. {
  9010. internalSetCurrentInstance = (i) => {
  9011. currentInstance = i;
  9012. };
  9013. setInSSRSetupState = (v) => {
  9014. isInSSRComponentSetup = v;
  9015. };
  9016. }
  9017. const setCurrentInstance = (instance) => {
  9018. const prev = currentInstance;
  9019. internalSetCurrentInstance(instance);
  9020. instance.scope.on();
  9021. return () => {
  9022. instance.scope.off();
  9023. internalSetCurrentInstance(prev);
  9024. };
  9025. };
  9026. const unsetCurrentInstance = () => {
  9027. currentInstance && currentInstance.scope.off();
  9028. internalSetCurrentInstance(null);
  9029. };
  9030. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  9031. function validateComponentName(name, { isNativeTag }) {
  9032. if (isBuiltInTag(name) || isNativeTag(name)) {
  9033. warn$1(
  9034. "Do not use built-in or reserved HTML elements as component id: " + name
  9035. );
  9036. }
  9037. }
  9038. function isStatefulComponent(instance) {
  9039. return instance.vnode.shapeFlag & 4;
  9040. }
  9041. let isInSSRComponentSetup = false;
  9042. function setupComponent(instance, isSSR = false, optimized = false) {
  9043. isSSR && setInSSRSetupState(isSSR);
  9044. const { props, children } = instance.vnode;
  9045. const isStateful = isStatefulComponent(instance);
  9046. initProps(instance, props, isStateful, isSSR);
  9047. initSlots(instance, children, optimized);
  9048. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  9049. isSSR && setInSSRSetupState(false);
  9050. return setupResult;
  9051. }
  9052. function setupStatefulComponent(instance, isSSR) {
  9053. var _a;
  9054. const Component = instance.type;
  9055. {
  9056. if (Component.name) {
  9057. validateComponentName(Component.name, instance.appContext.config);
  9058. }
  9059. if (Component.components) {
  9060. const names = Object.keys(Component.components);
  9061. for (let i = 0; i < names.length; i++) {
  9062. validateComponentName(names[i], instance.appContext.config);
  9063. }
  9064. }
  9065. if (Component.directives) {
  9066. const names = Object.keys(Component.directives);
  9067. for (let i = 0; i < names.length; i++) {
  9068. validateDirectiveName(names[i]);
  9069. }
  9070. }
  9071. if (Component.compilerOptions && isRuntimeOnly()) {
  9072. warn$1(
  9073. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  9074. );
  9075. }
  9076. }
  9077. instance.accessCache = /* @__PURE__ */ Object.create(null);
  9078. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  9079. {
  9080. exposePropsOnRenderContext(instance);
  9081. }
  9082. const { setup } = Component;
  9083. if (setup) {
  9084. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  9085. const reset = setCurrentInstance(instance);
  9086. pauseTracking();
  9087. const setupResult = callWithErrorHandling(
  9088. setup,
  9089. instance,
  9090. 0,
  9091. [
  9092. shallowReadonly(instance.props) ,
  9093. setupContext
  9094. ]
  9095. );
  9096. resetTracking();
  9097. reset();
  9098. if (isPromise(setupResult)) {
  9099. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  9100. if (isSSR) {
  9101. return setupResult.then((resolvedResult) => {
  9102. handleSetupResult(instance, resolvedResult, isSSR);
  9103. }).catch((e) => {
  9104. handleError(e, instance, 0);
  9105. });
  9106. } else {
  9107. instance.asyncDep = setupResult;
  9108. if (!instance.suspense) {
  9109. const name = (_a = Component.name) != null ? _a : "Anonymous";
  9110. warn$1(
  9111. `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
  9112. );
  9113. }
  9114. }
  9115. } else {
  9116. handleSetupResult(instance, setupResult, isSSR);
  9117. }
  9118. } else {
  9119. finishComponentSetup(instance, isSSR);
  9120. }
  9121. }
  9122. function handleSetupResult(instance, setupResult, isSSR) {
  9123. if (isFunction(setupResult)) {
  9124. {
  9125. instance.render = setupResult;
  9126. }
  9127. } else if (isObject(setupResult)) {
  9128. if (isVNode(setupResult)) {
  9129. warn$1(
  9130. `setup() should not return VNodes directly - return a render function instead.`
  9131. );
  9132. }
  9133. {
  9134. instance.devtoolsRawSetupState = setupResult;
  9135. }
  9136. instance.setupState = proxyRefs(setupResult);
  9137. {
  9138. exposeSetupStateOnRenderContext(instance);
  9139. }
  9140. } else if (setupResult !== void 0) {
  9141. warn$1(
  9142. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  9143. );
  9144. }
  9145. finishComponentSetup(instance, isSSR);
  9146. }
  9147. let compile;
  9148. let installWithProxy;
  9149. function registerRuntimeCompiler(_compile) {
  9150. compile = _compile;
  9151. installWithProxy = (i) => {
  9152. if (i.render._rc) {
  9153. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  9154. }
  9155. };
  9156. }
  9157. const isRuntimeOnly = () => !compile;
  9158. function finishComponentSetup(instance, isSSR, skipOptions) {
  9159. const Component = instance.type;
  9160. if (!instance.render) {
  9161. if (!isSSR && compile && !Component.render) {
  9162. const template = Component.template || resolveMergedOptions(instance).template;
  9163. if (template) {
  9164. {
  9165. startMeasure(instance, `compile`);
  9166. }
  9167. const { isCustomElement, compilerOptions } = instance.appContext.config;
  9168. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  9169. const finalCompilerOptions = extend(
  9170. extend(
  9171. {
  9172. isCustomElement,
  9173. delimiters
  9174. },
  9175. compilerOptions
  9176. ),
  9177. componentCompilerOptions
  9178. );
  9179. Component.render = compile(template, finalCompilerOptions);
  9180. {
  9181. endMeasure(instance, `compile`);
  9182. }
  9183. }
  9184. }
  9185. instance.render = Component.render || NOOP;
  9186. if (installWithProxy) {
  9187. installWithProxy(instance);
  9188. }
  9189. }
  9190. {
  9191. const reset = setCurrentInstance(instance);
  9192. pauseTracking();
  9193. try {
  9194. applyOptions(instance);
  9195. } finally {
  9196. resetTracking();
  9197. reset();
  9198. }
  9199. }
  9200. if (!Component.render && instance.render === NOOP && !isSSR) {
  9201. if (!compile && Component.template) {
  9202. warn$1(
  9203. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  9204. );
  9205. } else {
  9206. warn$1(`Component is missing template or render function: `, Component);
  9207. }
  9208. }
  9209. }
  9210. const attrsProxyHandlers = {
  9211. get(target, key) {
  9212. markAttrsAccessed();
  9213. track(target, "get", "");
  9214. return target[key];
  9215. },
  9216. set() {
  9217. warn$1(`setupContext.attrs is readonly.`);
  9218. return false;
  9219. },
  9220. deleteProperty() {
  9221. warn$1(`setupContext.attrs is readonly.`);
  9222. return false;
  9223. }
  9224. } ;
  9225. function getSlotsProxy(instance) {
  9226. return new Proxy(instance.slots, {
  9227. get(target, key) {
  9228. track(instance, "get", "$slots");
  9229. return target[key];
  9230. }
  9231. });
  9232. }
  9233. function createSetupContext(instance) {
  9234. const expose = (exposed) => {
  9235. {
  9236. if (instance.exposed) {
  9237. warn$1(`expose() should be called only once per setup().`);
  9238. }
  9239. if (exposed != null) {
  9240. let exposedType = typeof exposed;
  9241. if (exposedType === "object") {
  9242. if (isArray(exposed)) {
  9243. exposedType = "array";
  9244. } else if (isRef(exposed)) {
  9245. exposedType = "ref";
  9246. }
  9247. }
  9248. if (exposedType !== "object") {
  9249. warn$1(
  9250. `expose() should be passed a plain object, received ${exposedType}.`
  9251. );
  9252. }
  9253. }
  9254. }
  9255. instance.exposed = exposed || {};
  9256. };
  9257. {
  9258. let attrsProxy;
  9259. let slotsProxy;
  9260. return Object.freeze({
  9261. get attrs() {
  9262. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  9263. },
  9264. get slots() {
  9265. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  9266. },
  9267. get emit() {
  9268. return (event, ...args) => instance.emit(event, ...args);
  9269. },
  9270. expose
  9271. });
  9272. }
  9273. }
  9274. function getComponentPublicInstance(instance) {
  9275. if (instance.exposed) {
  9276. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  9277. get(target, key) {
  9278. if (key in target) {
  9279. return target[key];
  9280. } else if (key in publicPropertiesMap) {
  9281. return publicPropertiesMap[key](instance);
  9282. }
  9283. },
  9284. has(target, key) {
  9285. return key in target || key in publicPropertiesMap;
  9286. }
  9287. }));
  9288. } else {
  9289. return instance.proxy;
  9290. }
  9291. }
  9292. const classifyRE = /(?:^|[-_])(\w)/g;
  9293. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  9294. function getComponentName(Component, includeInferred = true) {
  9295. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  9296. }
  9297. function formatComponentName(instance, Component, isRoot = false) {
  9298. let name = getComponentName(Component);
  9299. if (!name && Component.__file) {
  9300. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  9301. if (match) {
  9302. name = match[1];
  9303. }
  9304. }
  9305. if (!name && instance && instance.parent) {
  9306. const inferFromRegistry = (registry) => {
  9307. for (const key in registry) {
  9308. if (registry[key] === Component) {
  9309. return key;
  9310. }
  9311. }
  9312. };
  9313. name = inferFromRegistry(
  9314. instance.components || instance.parent.type.components
  9315. ) || inferFromRegistry(instance.appContext.components);
  9316. }
  9317. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  9318. }
  9319. function isClassComponent(value) {
  9320. return isFunction(value) && "__vccOpts" in value;
  9321. }
  9322. const computed = (getterOrOptions, debugOptions) => {
  9323. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  9324. {
  9325. const i = getCurrentInstance();
  9326. if (i && i.appContext.config.warnRecursiveComputed) {
  9327. c._warnRecursive = true;
  9328. }
  9329. }
  9330. return c;
  9331. };
  9332. function h(type, propsOrChildren, children) {
  9333. const l = arguments.length;
  9334. if (l === 2) {
  9335. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  9336. if (isVNode(propsOrChildren)) {
  9337. return createVNode(type, null, [propsOrChildren]);
  9338. }
  9339. return createVNode(type, propsOrChildren);
  9340. } else {
  9341. return createVNode(type, null, propsOrChildren);
  9342. }
  9343. } else {
  9344. if (l > 3) {
  9345. children = Array.prototype.slice.call(arguments, 2);
  9346. } else if (l === 3 && isVNode(children)) {
  9347. children = [children];
  9348. }
  9349. return createVNode(type, propsOrChildren, children);
  9350. }
  9351. }
  9352. function initCustomFormatter() {
  9353. if (typeof window === "undefined") {
  9354. return;
  9355. }
  9356. const vueStyle = { style: "color:#3ba776" };
  9357. const numberStyle = { style: "color:#1677ff" };
  9358. const stringStyle = { style: "color:#f5222d" };
  9359. const keywordStyle = { style: "color:#eb2f96" };
  9360. const formatter = {
  9361. __vue_custom_formatter: true,
  9362. header(obj) {
  9363. if (!isObject(obj)) {
  9364. return null;
  9365. }
  9366. if (obj.__isVue) {
  9367. return ["div", vueStyle, `VueInstance`];
  9368. } else if (isRef(obj)) {
  9369. return [
  9370. "div",
  9371. {},
  9372. ["span", vueStyle, genRefFlag(obj)],
  9373. "<",
  9374. formatValue(obj.value),
  9375. `>`
  9376. ];
  9377. } else if (isReactive(obj)) {
  9378. return [
  9379. "div",
  9380. {},
  9381. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  9382. "<",
  9383. formatValue(obj),
  9384. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  9385. ];
  9386. } else if (isReadonly(obj)) {
  9387. return [
  9388. "div",
  9389. {},
  9390. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  9391. "<",
  9392. formatValue(obj),
  9393. ">"
  9394. ];
  9395. }
  9396. return null;
  9397. },
  9398. hasBody(obj) {
  9399. return obj && obj.__isVue;
  9400. },
  9401. body(obj) {
  9402. if (obj && obj.__isVue) {
  9403. return [
  9404. "div",
  9405. {},
  9406. ...formatInstance(obj.$)
  9407. ];
  9408. }
  9409. }
  9410. };
  9411. function formatInstance(instance) {
  9412. const blocks = [];
  9413. if (instance.type.props && instance.props) {
  9414. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  9415. }
  9416. if (instance.setupState !== EMPTY_OBJ) {
  9417. blocks.push(createInstanceBlock("setup", instance.setupState));
  9418. }
  9419. if (instance.data !== EMPTY_OBJ) {
  9420. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  9421. }
  9422. const computed = extractKeys(instance, "computed");
  9423. if (computed) {
  9424. blocks.push(createInstanceBlock("computed", computed));
  9425. }
  9426. const injected = extractKeys(instance, "inject");
  9427. if (injected) {
  9428. blocks.push(createInstanceBlock("injected", injected));
  9429. }
  9430. blocks.push([
  9431. "div",
  9432. {},
  9433. [
  9434. "span",
  9435. {
  9436. style: keywordStyle.style + ";opacity:0.66"
  9437. },
  9438. "$ (internal): "
  9439. ],
  9440. ["object", { object: instance }]
  9441. ]);
  9442. return blocks;
  9443. }
  9444. function createInstanceBlock(type, target) {
  9445. target = extend({}, target);
  9446. if (!Object.keys(target).length) {
  9447. return ["span", {}];
  9448. }
  9449. return [
  9450. "div",
  9451. { style: "line-height:1.25em;margin-bottom:0.6em" },
  9452. [
  9453. "div",
  9454. {
  9455. style: "color:#476582"
  9456. },
  9457. type
  9458. ],
  9459. [
  9460. "div",
  9461. {
  9462. style: "padding-left:1.25em"
  9463. },
  9464. ...Object.keys(target).map((key) => {
  9465. return [
  9466. "div",
  9467. {},
  9468. ["span", keywordStyle, key + ": "],
  9469. formatValue(target[key], false)
  9470. ];
  9471. })
  9472. ]
  9473. ];
  9474. }
  9475. function formatValue(v, asRaw = true) {
  9476. if (typeof v === "number") {
  9477. return ["span", numberStyle, v];
  9478. } else if (typeof v === "string") {
  9479. return ["span", stringStyle, JSON.stringify(v)];
  9480. } else if (typeof v === "boolean") {
  9481. return ["span", keywordStyle, v];
  9482. } else if (isObject(v)) {
  9483. return ["object", { object: asRaw ? toRaw(v) : v }];
  9484. } else {
  9485. return ["span", stringStyle, String(v)];
  9486. }
  9487. }
  9488. function extractKeys(instance, type) {
  9489. const Comp = instance.type;
  9490. if (isFunction(Comp)) {
  9491. return;
  9492. }
  9493. const extracted = {};
  9494. for (const key in instance.ctx) {
  9495. if (isKeyOfType(Comp, key, type)) {
  9496. extracted[key] = instance.ctx[key];
  9497. }
  9498. }
  9499. return extracted;
  9500. }
  9501. function isKeyOfType(Comp, key, type) {
  9502. const opts = Comp[type];
  9503. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  9504. return true;
  9505. }
  9506. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  9507. return true;
  9508. }
  9509. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  9510. return true;
  9511. }
  9512. }
  9513. function genRefFlag(v) {
  9514. if (isShallow(v)) {
  9515. return `ShallowRef`;
  9516. }
  9517. if (v.effect) {
  9518. return `ComputedRef`;
  9519. }
  9520. return `Ref`;
  9521. }
  9522. if (window.devtoolsFormatters) {
  9523. window.devtoolsFormatters.push(formatter);
  9524. } else {
  9525. window.devtoolsFormatters = [formatter];
  9526. }
  9527. }
  9528. function withMemo(memo, render, cache, index) {
  9529. const cached = cache[index];
  9530. if (cached && isMemoSame(cached, memo)) {
  9531. return cached;
  9532. }
  9533. const ret = render();
  9534. ret.memo = memo.slice();
  9535. ret.cacheIndex = index;
  9536. return cache[index] = ret;
  9537. }
  9538. function isMemoSame(cached, memo) {
  9539. const prev = cached.memo;
  9540. if (prev.length != memo.length) {
  9541. return false;
  9542. }
  9543. for (let i = 0; i < prev.length; i++) {
  9544. if (hasChanged(prev[i], memo[i])) {
  9545. return false;
  9546. }
  9547. }
  9548. if (isBlockTreeEnabled > 0 && currentBlock) {
  9549. currentBlock.push(cached);
  9550. }
  9551. return true;
  9552. }
  9553. const version = "3.4.38";
  9554. const warn = warn$1 ;
  9555. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  9556. const devtools = devtools$1 ;
  9557. const setDevtoolsHook = setDevtoolsHook$1 ;
  9558. const ssrUtils = null;
  9559. const resolveFilter = null;
  9560. const compatUtils = null;
  9561. const DeprecationTypes = null;
  9562. const svgNS = "http://www.w3.org/2000/svg";
  9563. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  9564. const doc = typeof document !== "undefined" ? document : null;
  9565. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  9566. const nodeOps = {
  9567. insert: (child, parent, anchor) => {
  9568. parent.insertBefore(child, anchor || null);
  9569. },
  9570. remove: (child) => {
  9571. const parent = child.parentNode;
  9572. if (parent) {
  9573. parent.removeChild(child);
  9574. }
  9575. },
  9576. createElement: (tag, namespace, is, props) => {
  9577. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  9578. if (tag === "select" && props && props.multiple != null) {
  9579. el.setAttribute("multiple", props.multiple);
  9580. }
  9581. return el;
  9582. },
  9583. createText: (text) => doc.createTextNode(text),
  9584. createComment: (text) => doc.createComment(text),
  9585. setText: (node, text) => {
  9586. node.nodeValue = text;
  9587. },
  9588. setElementText: (el, text) => {
  9589. el.textContent = text;
  9590. },
  9591. parentNode: (node) => node.parentNode,
  9592. nextSibling: (node) => node.nextSibling,
  9593. querySelector: (selector) => doc.querySelector(selector),
  9594. setScopeId(el, id) {
  9595. el.setAttribute(id, "");
  9596. },
  9597. // __UNSAFE__
  9598. // Reason: innerHTML.
  9599. // Static content here can only come from compiled templates.
  9600. // As long as the user only uses trusted templates, this is safe.
  9601. insertStaticContent(content, parent, anchor, namespace, start, end) {
  9602. const before = anchor ? anchor.previousSibling : parent.lastChild;
  9603. if (start && (start === end || start.nextSibling)) {
  9604. while (true) {
  9605. parent.insertBefore(start.cloneNode(true), anchor);
  9606. if (start === end || !(start = start.nextSibling)) break;
  9607. }
  9608. } else {
  9609. templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
  9610. const template = templateContainer.content;
  9611. if (namespace === "svg" || namespace === "mathml") {
  9612. const wrapper = template.firstChild;
  9613. while (wrapper.firstChild) {
  9614. template.appendChild(wrapper.firstChild);
  9615. }
  9616. template.removeChild(wrapper);
  9617. }
  9618. parent.insertBefore(template, anchor);
  9619. }
  9620. return [
  9621. // first
  9622. before ? before.nextSibling : parent.firstChild,
  9623. // last
  9624. anchor ? anchor.previousSibling : parent.lastChild
  9625. ];
  9626. }
  9627. };
  9628. const TRANSITION = "transition";
  9629. const ANIMATION = "animation";
  9630. const vtcKey = Symbol("_vtc");
  9631. const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
  9632. Transition.displayName = "Transition";
  9633. const DOMTransitionPropsValidators = {
  9634. name: String,
  9635. type: String,
  9636. css: {
  9637. type: Boolean,
  9638. default: true
  9639. },
  9640. duration: [String, Number, Object],
  9641. enterFromClass: String,
  9642. enterActiveClass: String,
  9643. enterToClass: String,
  9644. appearFromClass: String,
  9645. appearActiveClass: String,
  9646. appearToClass: String,
  9647. leaveFromClass: String,
  9648. leaveActiveClass: String,
  9649. leaveToClass: String
  9650. };
  9651. const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
  9652. {},
  9653. BaseTransitionPropsValidators,
  9654. DOMTransitionPropsValidators
  9655. );
  9656. const callHook = (hook, args = []) => {
  9657. if (isArray(hook)) {
  9658. hook.forEach((h2) => h2(...args));
  9659. } else if (hook) {
  9660. hook(...args);
  9661. }
  9662. };
  9663. const hasExplicitCallback = (hook) => {
  9664. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  9665. };
  9666. function resolveTransitionProps(rawProps) {
  9667. const baseProps = {};
  9668. for (const key in rawProps) {
  9669. if (!(key in DOMTransitionPropsValidators)) {
  9670. baseProps[key] = rawProps[key];
  9671. }
  9672. }
  9673. if (rawProps.css === false) {
  9674. return baseProps;
  9675. }
  9676. const {
  9677. name = "v",
  9678. type,
  9679. duration,
  9680. enterFromClass = `${name}-enter-from`,
  9681. enterActiveClass = `${name}-enter-active`,
  9682. enterToClass = `${name}-enter-to`,
  9683. appearFromClass = enterFromClass,
  9684. appearActiveClass = enterActiveClass,
  9685. appearToClass = enterToClass,
  9686. leaveFromClass = `${name}-leave-from`,
  9687. leaveActiveClass = `${name}-leave-active`,
  9688. leaveToClass = `${name}-leave-to`
  9689. } = rawProps;
  9690. const durations = normalizeDuration(duration);
  9691. const enterDuration = durations && durations[0];
  9692. const leaveDuration = durations && durations[1];
  9693. const {
  9694. onBeforeEnter,
  9695. onEnter,
  9696. onEnterCancelled,
  9697. onLeave,
  9698. onLeaveCancelled,
  9699. onBeforeAppear = onBeforeEnter,
  9700. onAppear = onEnter,
  9701. onAppearCancelled = onEnterCancelled
  9702. } = baseProps;
  9703. const finishEnter = (el, isAppear, done) => {
  9704. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9705. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  9706. done && done();
  9707. };
  9708. const finishLeave = (el, done) => {
  9709. el._isLeaving = false;
  9710. removeTransitionClass(el, leaveFromClass);
  9711. removeTransitionClass(el, leaveToClass);
  9712. removeTransitionClass(el, leaveActiveClass);
  9713. done && done();
  9714. };
  9715. const makeEnterHook = (isAppear) => {
  9716. return (el, done) => {
  9717. const hook = isAppear ? onAppear : onEnter;
  9718. const resolve = () => finishEnter(el, isAppear, done);
  9719. callHook(hook, [el, resolve]);
  9720. nextFrame(() => {
  9721. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  9722. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9723. if (!hasExplicitCallback(hook)) {
  9724. whenTransitionEnds(el, type, enterDuration, resolve);
  9725. }
  9726. });
  9727. };
  9728. };
  9729. return extend(baseProps, {
  9730. onBeforeEnter(el) {
  9731. callHook(onBeforeEnter, [el]);
  9732. addTransitionClass(el, enterFromClass);
  9733. addTransitionClass(el, enterActiveClass);
  9734. },
  9735. onBeforeAppear(el) {
  9736. callHook(onBeforeAppear, [el]);
  9737. addTransitionClass(el, appearFromClass);
  9738. addTransitionClass(el, appearActiveClass);
  9739. },
  9740. onEnter: makeEnterHook(false),
  9741. onAppear: makeEnterHook(true),
  9742. onLeave(el, done) {
  9743. el._isLeaving = true;
  9744. const resolve = () => finishLeave(el, done);
  9745. addTransitionClass(el, leaveFromClass);
  9746. addTransitionClass(el, leaveActiveClass);
  9747. forceReflow();
  9748. nextFrame(() => {
  9749. if (!el._isLeaving) {
  9750. return;
  9751. }
  9752. removeTransitionClass(el, leaveFromClass);
  9753. addTransitionClass(el, leaveToClass);
  9754. if (!hasExplicitCallback(onLeave)) {
  9755. whenTransitionEnds(el, type, leaveDuration, resolve);
  9756. }
  9757. });
  9758. callHook(onLeave, [el, resolve]);
  9759. },
  9760. onEnterCancelled(el) {
  9761. finishEnter(el, false);
  9762. callHook(onEnterCancelled, [el]);
  9763. },
  9764. onAppearCancelled(el) {
  9765. finishEnter(el, true);
  9766. callHook(onAppearCancelled, [el]);
  9767. },
  9768. onLeaveCancelled(el) {
  9769. finishLeave(el);
  9770. callHook(onLeaveCancelled, [el]);
  9771. }
  9772. });
  9773. }
  9774. function normalizeDuration(duration) {
  9775. if (duration == null) {
  9776. return null;
  9777. } else if (isObject(duration)) {
  9778. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  9779. } else {
  9780. const n = NumberOf(duration);
  9781. return [n, n];
  9782. }
  9783. }
  9784. function NumberOf(val) {
  9785. const res = toNumber(val);
  9786. {
  9787. assertNumber(res, "<transition> explicit duration");
  9788. }
  9789. return res;
  9790. }
  9791. function addTransitionClass(el, cls) {
  9792. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  9793. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  9794. }
  9795. function removeTransitionClass(el, cls) {
  9796. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  9797. const _vtc = el[vtcKey];
  9798. if (_vtc) {
  9799. _vtc.delete(cls);
  9800. if (!_vtc.size) {
  9801. el[vtcKey] = void 0;
  9802. }
  9803. }
  9804. }
  9805. function nextFrame(cb) {
  9806. requestAnimationFrame(() => {
  9807. requestAnimationFrame(cb);
  9808. });
  9809. }
  9810. let endId = 0;
  9811. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  9812. const id = el._endId = ++endId;
  9813. const resolveIfNotStale = () => {
  9814. if (id === el._endId) {
  9815. resolve();
  9816. }
  9817. };
  9818. if (explicitTimeout) {
  9819. return setTimeout(resolveIfNotStale, explicitTimeout);
  9820. }
  9821. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  9822. if (!type) {
  9823. return resolve();
  9824. }
  9825. const endEvent = type + "end";
  9826. let ended = 0;
  9827. const end = () => {
  9828. el.removeEventListener(endEvent, onEnd);
  9829. resolveIfNotStale();
  9830. };
  9831. const onEnd = (e) => {
  9832. if (e.target === el && ++ended >= propCount) {
  9833. end();
  9834. }
  9835. };
  9836. setTimeout(() => {
  9837. if (ended < propCount) {
  9838. end();
  9839. }
  9840. }, timeout + 1);
  9841. el.addEventListener(endEvent, onEnd);
  9842. }
  9843. function getTransitionInfo(el, expectedType) {
  9844. const styles = window.getComputedStyle(el);
  9845. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  9846. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  9847. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  9848. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  9849. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  9850. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  9851. const animationTimeout = getTimeout(animationDelays, animationDurations);
  9852. let type = null;
  9853. let timeout = 0;
  9854. let propCount = 0;
  9855. if (expectedType === TRANSITION) {
  9856. if (transitionTimeout > 0) {
  9857. type = TRANSITION;
  9858. timeout = transitionTimeout;
  9859. propCount = transitionDurations.length;
  9860. }
  9861. } else if (expectedType === ANIMATION) {
  9862. if (animationTimeout > 0) {
  9863. type = ANIMATION;
  9864. timeout = animationTimeout;
  9865. propCount = animationDurations.length;
  9866. }
  9867. } else {
  9868. timeout = Math.max(transitionTimeout, animationTimeout);
  9869. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  9870. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  9871. }
  9872. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  9873. getStyleProperties(`${TRANSITION}Property`).toString()
  9874. );
  9875. return {
  9876. type,
  9877. timeout,
  9878. propCount,
  9879. hasTransform
  9880. };
  9881. }
  9882. function getTimeout(delays, durations) {
  9883. while (delays.length < durations.length) {
  9884. delays = delays.concat(delays);
  9885. }
  9886. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  9887. }
  9888. function toMs(s) {
  9889. if (s === "auto") return 0;
  9890. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  9891. }
  9892. function forceReflow() {
  9893. return document.body.offsetHeight;
  9894. }
  9895. function patchClass(el, value, isSVG) {
  9896. const transitionClasses = el[vtcKey];
  9897. if (transitionClasses) {
  9898. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  9899. }
  9900. if (value == null) {
  9901. el.removeAttribute("class");
  9902. } else if (isSVG) {
  9903. el.setAttribute("class", value);
  9904. } else {
  9905. el.className = value;
  9906. }
  9907. }
  9908. const vShowOriginalDisplay = Symbol("_vod");
  9909. const vShowHidden = Symbol("_vsh");
  9910. const vShow = {
  9911. beforeMount(el, { value }, { transition }) {
  9912. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  9913. if (transition && value) {
  9914. transition.beforeEnter(el);
  9915. } else {
  9916. setDisplay(el, value);
  9917. }
  9918. },
  9919. mounted(el, { value }, { transition }) {
  9920. if (transition && value) {
  9921. transition.enter(el);
  9922. }
  9923. },
  9924. updated(el, { value, oldValue }, { transition }) {
  9925. if (!value === !oldValue) return;
  9926. if (transition) {
  9927. if (value) {
  9928. transition.beforeEnter(el);
  9929. setDisplay(el, true);
  9930. transition.enter(el);
  9931. } else {
  9932. transition.leave(el, () => {
  9933. setDisplay(el, false);
  9934. });
  9935. }
  9936. } else {
  9937. setDisplay(el, value);
  9938. }
  9939. },
  9940. beforeUnmount(el, { value }) {
  9941. setDisplay(el, value);
  9942. }
  9943. };
  9944. {
  9945. vShow.name = "show";
  9946. }
  9947. function setDisplay(el, value) {
  9948. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  9949. el[vShowHidden] = !value;
  9950. }
  9951. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  9952. function useCssVars(getter) {
  9953. const instance = getCurrentInstance();
  9954. if (!instance) {
  9955. warn(`useCssVars is called without current active component instance.`);
  9956. return;
  9957. }
  9958. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  9959. Array.from(
  9960. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  9961. ).forEach((node) => setVarsOnNode(node, vars));
  9962. };
  9963. {
  9964. instance.getCssVars = () => getter(instance.proxy);
  9965. }
  9966. const setVars = () => {
  9967. const vars = getter(instance.proxy);
  9968. setVarsOnVNode(instance.subTree, vars);
  9969. updateTeleports(vars);
  9970. };
  9971. onBeforeMount(() => {
  9972. watchPostEffect(setVars);
  9973. });
  9974. onMounted(() => {
  9975. const ob = new MutationObserver(setVars);
  9976. ob.observe(instance.subTree.el.parentNode, { childList: true });
  9977. onUnmounted(() => ob.disconnect());
  9978. });
  9979. }
  9980. function setVarsOnVNode(vnode, vars) {
  9981. if (vnode.shapeFlag & 128) {
  9982. const suspense = vnode.suspense;
  9983. vnode = suspense.activeBranch;
  9984. if (suspense.pendingBranch && !suspense.isHydrating) {
  9985. suspense.effects.push(() => {
  9986. setVarsOnVNode(suspense.activeBranch, vars);
  9987. });
  9988. }
  9989. }
  9990. while (vnode.component) {
  9991. vnode = vnode.component.subTree;
  9992. }
  9993. if (vnode.shapeFlag & 1 && vnode.el) {
  9994. setVarsOnNode(vnode.el, vars);
  9995. } else if (vnode.type === Fragment) {
  9996. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  9997. } else if (vnode.type === Static) {
  9998. let { el, anchor } = vnode;
  9999. while (el) {
  10000. setVarsOnNode(el, vars);
  10001. if (el === anchor) break;
  10002. el = el.nextSibling;
  10003. }
  10004. }
  10005. }
  10006. function setVarsOnNode(el, vars) {
  10007. if (el.nodeType === 1) {
  10008. const style = el.style;
  10009. let cssText = "";
  10010. for (const key in vars) {
  10011. style.setProperty(`--${key}`, vars[key]);
  10012. cssText += `--${key}: ${vars[key]};`;
  10013. }
  10014. style[CSS_VAR_TEXT] = cssText;
  10015. }
  10016. }
  10017. const displayRE = /(^|;)\s*display\s*:/;
  10018. function patchStyle(el, prev, next) {
  10019. const style = el.style;
  10020. const isCssString = isString(next);
  10021. let hasControlledDisplay = false;
  10022. if (next && !isCssString) {
  10023. if (prev) {
  10024. if (!isString(prev)) {
  10025. for (const key in prev) {
  10026. if (next[key] == null) {
  10027. setStyle(style, key, "");
  10028. }
  10029. }
  10030. } else {
  10031. for (const prevStyle of prev.split(";")) {
  10032. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  10033. if (next[key] == null) {
  10034. setStyle(style, key, "");
  10035. }
  10036. }
  10037. }
  10038. }
  10039. for (const key in next) {
  10040. if (key === "display") {
  10041. hasControlledDisplay = true;
  10042. }
  10043. setStyle(style, key, next[key]);
  10044. }
  10045. } else {
  10046. if (isCssString) {
  10047. if (prev !== next) {
  10048. const cssVarText = style[CSS_VAR_TEXT];
  10049. if (cssVarText) {
  10050. next += ";" + cssVarText;
  10051. }
  10052. style.cssText = next;
  10053. hasControlledDisplay = displayRE.test(next);
  10054. }
  10055. } else if (prev) {
  10056. el.removeAttribute("style");
  10057. }
  10058. }
  10059. if (vShowOriginalDisplay in el) {
  10060. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  10061. if (el[vShowHidden]) {
  10062. style.display = "none";
  10063. }
  10064. }
  10065. }
  10066. const semicolonRE = /[^\\];\s*$/;
  10067. const importantRE = /\s*!important$/;
  10068. function setStyle(style, name, val) {
  10069. if (isArray(val)) {
  10070. val.forEach((v) => setStyle(style, name, v));
  10071. } else {
  10072. if (val == null) val = "";
  10073. {
  10074. if (semicolonRE.test(val)) {
  10075. warn(
  10076. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  10077. );
  10078. }
  10079. }
  10080. if (name.startsWith("--")) {
  10081. style.setProperty(name, val);
  10082. } else {
  10083. const prefixed = autoPrefix(style, name);
  10084. if (importantRE.test(val)) {
  10085. style.setProperty(
  10086. hyphenate(prefixed),
  10087. val.replace(importantRE, ""),
  10088. "important"
  10089. );
  10090. } else {
  10091. style[prefixed] = val;
  10092. }
  10093. }
  10094. }
  10095. }
  10096. const prefixes = ["Webkit", "Moz", "ms"];
  10097. const prefixCache = {};
  10098. function autoPrefix(style, rawName) {
  10099. const cached = prefixCache[rawName];
  10100. if (cached) {
  10101. return cached;
  10102. }
  10103. let name = camelize(rawName);
  10104. if (name !== "filter" && name in style) {
  10105. return prefixCache[rawName] = name;
  10106. }
  10107. name = capitalize(name);
  10108. for (let i = 0; i < prefixes.length; i++) {
  10109. const prefixed = prefixes[i] + name;
  10110. if (prefixed in style) {
  10111. return prefixCache[rawName] = prefixed;
  10112. }
  10113. }
  10114. return rawName;
  10115. }
  10116. const xlinkNS = "http://www.w3.org/1999/xlink";
  10117. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  10118. if (isSVG && key.startsWith("xlink:")) {
  10119. if (value == null) {
  10120. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  10121. } else {
  10122. el.setAttributeNS(xlinkNS, key, value);
  10123. }
  10124. } else {
  10125. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  10126. el.removeAttribute(key);
  10127. } else {
  10128. el.setAttribute(
  10129. key,
  10130. isBoolean ? "" : isSymbol(value) ? String(value) : value
  10131. );
  10132. }
  10133. }
  10134. }
  10135. function patchDOMProp(el, key, value, parentComponent) {
  10136. if (key === "innerHTML" || key === "textContent") {
  10137. if (value == null) return;
  10138. el[key] = value;
  10139. return;
  10140. }
  10141. const tag = el.tagName;
  10142. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  10143. !tag.includes("-")) {
  10144. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  10145. const newValue = value == null ? "" : String(value);
  10146. if (oldValue !== newValue || !("_value" in el)) {
  10147. el.value = newValue;
  10148. }
  10149. if (value == null) {
  10150. el.removeAttribute(key);
  10151. }
  10152. el._value = value;
  10153. return;
  10154. }
  10155. let needRemove = false;
  10156. if (value === "" || value == null) {
  10157. const type = typeof el[key];
  10158. if (type === "boolean") {
  10159. value = includeBooleanAttr(value);
  10160. } else if (value == null && type === "string") {
  10161. value = "";
  10162. needRemove = true;
  10163. } else if (type === "number") {
  10164. value = 0;
  10165. needRemove = true;
  10166. }
  10167. }
  10168. try {
  10169. el[key] = value;
  10170. } catch (e) {
  10171. if (!needRemove) {
  10172. warn(
  10173. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  10174. e
  10175. );
  10176. }
  10177. }
  10178. needRemove && el.removeAttribute(key);
  10179. }
  10180. function addEventListener(el, event, handler, options) {
  10181. el.addEventListener(event, handler, options);
  10182. }
  10183. function removeEventListener(el, event, handler, options) {
  10184. el.removeEventListener(event, handler, options);
  10185. }
  10186. const veiKey = Symbol("_vei");
  10187. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  10188. const invokers = el[veiKey] || (el[veiKey] = {});
  10189. const existingInvoker = invokers[rawName];
  10190. if (nextValue && existingInvoker) {
  10191. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  10192. } else {
  10193. const [name, options] = parseName(rawName);
  10194. if (nextValue) {
  10195. const invoker = invokers[rawName] = createInvoker(
  10196. sanitizeEventValue(nextValue, rawName) ,
  10197. instance
  10198. );
  10199. addEventListener(el, name, invoker, options);
  10200. } else if (existingInvoker) {
  10201. removeEventListener(el, name, existingInvoker, options);
  10202. invokers[rawName] = void 0;
  10203. }
  10204. }
  10205. }
  10206. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  10207. function parseName(name) {
  10208. let options;
  10209. if (optionsModifierRE.test(name)) {
  10210. options = {};
  10211. let m;
  10212. while (m = name.match(optionsModifierRE)) {
  10213. name = name.slice(0, name.length - m[0].length);
  10214. options[m[0].toLowerCase()] = true;
  10215. }
  10216. }
  10217. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  10218. return [event, options];
  10219. }
  10220. let cachedNow = 0;
  10221. const p = /* @__PURE__ */ Promise.resolve();
  10222. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  10223. function createInvoker(initialValue, instance) {
  10224. const invoker = (e) => {
  10225. if (!e._vts) {
  10226. e._vts = Date.now();
  10227. } else if (e._vts <= invoker.attached) {
  10228. return;
  10229. }
  10230. callWithAsyncErrorHandling(
  10231. patchStopImmediatePropagation(e, invoker.value),
  10232. instance,
  10233. 5,
  10234. [e]
  10235. );
  10236. };
  10237. invoker.value = initialValue;
  10238. invoker.attached = getNow();
  10239. return invoker;
  10240. }
  10241. function sanitizeEventValue(value, propName) {
  10242. if (isFunction(value) || isArray(value)) {
  10243. return value;
  10244. }
  10245. warn(
  10246. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  10247. Expected function or array of functions, received type ${typeof value}.`
  10248. );
  10249. return NOOP;
  10250. }
  10251. function patchStopImmediatePropagation(e, value) {
  10252. if (isArray(value)) {
  10253. const originalStop = e.stopImmediatePropagation;
  10254. e.stopImmediatePropagation = () => {
  10255. originalStop.call(e);
  10256. e._stopped = true;
  10257. };
  10258. return value.map(
  10259. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  10260. );
  10261. } else {
  10262. return value;
  10263. }
  10264. }
  10265. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  10266. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  10267. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  10268. const isSVG = namespace === "svg";
  10269. if (key === "class") {
  10270. patchClass(el, nextValue, isSVG);
  10271. } else if (key === "style") {
  10272. patchStyle(el, prevValue, nextValue);
  10273. } else if (isOn(key)) {
  10274. if (!isModelListener(key)) {
  10275. patchEvent(el, key, prevValue, nextValue, parentComponent);
  10276. }
  10277. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  10278. patchDOMProp(el, key, nextValue);
  10279. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  10280. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  10281. }
  10282. } else {
  10283. if (key === "true-value") {
  10284. el._trueValue = nextValue;
  10285. } else if (key === "false-value") {
  10286. el._falseValue = nextValue;
  10287. }
  10288. patchAttr(el, key, nextValue, isSVG);
  10289. }
  10290. };
  10291. function shouldSetAsProp(el, key, value, isSVG) {
  10292. if (isSVG) {
  10293. if (key === "innerHTML" || key === "textContent") {
  10294. return true;
  10295. }
  10296. if (key in el && isNativeOn(key) && isFunction(value)) {
  10297. return true;
  10298. }
  10299. return false;
  10300. }
  10301. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  10302. return false;
  10303. }
  10304. if (key === "form") {
  10305. return false;
  10306. }
  10307. if (key === "list" && el.tagName === "INPUT") {
  10308. return false;
  10309. }
  10310. if (key === "type" && el.tagName === "TEXTAREA") {
  10311. return false;
  10312. }
  10313. if (key === "width" || key === "height") {
  10314. const tag = el.tagName;
  10315. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  10316. return false;
  10317. }
  10318. }
  10319. if (isNativeOn(key) && isString(value)) {
  10320. return false;
  10321. }
  10322. return key in el;
  10323. }
  10324. /*! #__NO_SIDE_EFFECTS__ */
  10325. // @__NO_SIDE_EFFECTS__
  10326. function defineCustomElement(options, extraOptions, hydrate2) {
  10327. const Comp = defineComponent(options, extraOptions);
  10328. class VueCustomElement extends VueElement {
  10329. constructor(initialProps) {
  10330. super(Comp, initialProps, hydrate2);
  10331. }
  10332. }
  10333. VueCustomElement.def = Comp;
  10334. return VueCustomElement;
  10335. }
  10336. /*! #__NO_SIDE_EFFECTS__ */
  10337. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  10338. return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
  10339. };
  10340. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  10341. };
  10342. class VueElement extends BaseClass {
  10343. constructor(_def, _props = {}, hydrate2) {
  10344. super();
  10345. this._def = _def;
  10346. this._props = _props;
  10347. /**
  10348. * @internal
  10349. */
  10350. this._instance = null;
  10351. this._connected = false;
  10352. this._resolved = false;
  10353. this._numberProps = null;
  10354. this._ob = null;
  10355. if (this.shadowRoot && hydrate2) {
  10356. hydrate2(this._createVNode(), this.shadowRoot);
  10357. } else {
  10358. if (this.shadowRoot) {
  10359. warn(
  10360. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  10361. );
  10362. }
  10363. this.attachShadow({ mode: "open" });
  10364. if (!this._def.__asyncLoader) {
  10365. this._resolveProps(this._def);
  10366. }
  10367. }
  10368. }
  10369. connectedCallback() {
  10370. this._connected = true;
  10371. if (!this._instance) {
  10372. if (this._resolved) {
  10373. this._update();
  10374. } else {
  10375. this._resolveDef();
  10376. }
  10377. }
  10378. }
  10379. disconnectedCallback() {
  10380. this._connected = false;
  10381. nextTick(() => {
  10382. if (!this._connected) {
  10383. if (this._ob) {
  10384. this._ob.disconnect();
  10385. this._ob = null;
  10386. }
  10387. render(null, this.shadowRoot);
  10388. this._instance = null;
  10389. }
  10390. });
  10391. }
  10392. /**
  10393. * resolve inner component definition (handle possible async component)
  10394. */
  10395. _resolveDef() {
  10396. this._resolved = true;
  10397. for (let i = 0; i < this.attributes.length; i++) {
  10398. this._setAttr(this.attributes[i].name);
  10399. }
  10400. this._ob = new MutationObserver((mutations) => {
  10401. for (const m of mutations) {
  10402. this._setAttr(m.attributeName);
  10403. }
  10404. });
  10405. this._ob.observe(this, { attributes: true });
  10406. const resolve = (def, isAsync = false) => {
  10407. const { props, styles } = def;
  10408. let numberProps;
  10409. if (props && !isArray(props)) {
  10410. for (const key in props) {
  10411. const opt = props[key];
  10412. if (opt === Number || opt && opt.type === Number) {
  10413. if (key in this._props) {
  10414. this._props[key] = toNumber(this._props[key]);
  10415. }
  10416. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  10417. }
  10418. }
  10419. }
  10420. this._numberProps = numberProps;
  10421. if (isAsync) {
  10422. this._resolveProps(def);
  10423. }
  10424. this._applyStyles(styles);
  10425. this._update();
  10426. };
  10427. const asyncDef = this._def.__asyncLoader;
  10428. if (asyncDef) {
  10429. asyncDef().then((def) => resolve(def, true));
  10430. } else {
  10431. resolve(this._def);
  10432. }
  10433. }
  10434. _resolveProps(def) {
  10435. const { props } = def;
  10436. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  10437. for (const key of Object.keys(this)) {
  10438. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  10439. this._setProp(key, this[key], true, false);
  10440. }
  10441. }
  10442. for (const key of declaredPropKeys.map(camelize)) {
  10443. Object.defineProperty(this, key, {
  10444. get() {
  10445. return this._getProp(key);
  10446. },
  10447. set(val) {
  10448. this._setProp(key, val);
  10449. }
  10450. });
  10451. }
  10452. }
  10453. _setAttr(key) {
  10454. let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
  10455. const camelKey = camelize(key);
  10456. if (this._numberProps && this._numberProps[camelKey]) {
  10457. value = toNumber(value);
  10458. }
  10459. this._setProp(camelKey, value, false);
  10460. }
  10461. /**
  10462. * @internal
  10463. */
  10464. _getProp(key) {
  10465. return this._props[key];
  10466. }
  10467. /**
  10468. * @internal
  10469. */
  10470. _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
  10471. if (val !== this._props[key]) {
  10472. this._props[key] = val;
  10473. if (shouldUpdate && this._instance) {
  10474. this._update();
  10475. }
  10476. if (shouldReflect) {
  10477. if (val === true) {
  10478. this.setAttribute(hyphenate(key), "");
  10479. } else if (typeof val === "string" || typeof val === "number") {
  10480. this.setAttribute(hyphenate(key), val + "");
  10481. } else if (!val) {
  10482. this.removeAttribute(hyphenate(key));
  10483. }
  10484. }
  10485. }
  10486. }
  10487. _update() {
  10488. render(this._createVNode(), this.shadowRoot);
  10489. }
  10490. _createVNode() {
  10491. const vnode = createVNode(this._def, extend({}, this._props));
  10492. if (!this._instance) {
  10493. vnode.ce = (instance) => {
  10494. this._instance = instance;
  10495. instance.isCE = true;
  10496. {
  10497. instance.ceReload = (newStyles) => {
  10498. if (this._styles) {
  10499. this._styles.forEach((s) => this.shadowRoot.removeChild(s));
  10500. this._styles.length = 0;
  10501. }
  10502. this._applyStyles(newStyles);
  10503. this._instance = null;
  10504. this._update();
  10505. };
  10506. }
  10507. const dispatch = (event, args) => {
  10508. this.dispatchEvent(
  10509. new CustomEvent(event, {
  10510. detail: args
  10511. })
  10512. );
  10513. };
  10514. instance.emit = (event, ...args) => {
  10515. dispatch(event, args);
  10516. if (hyphenate(event) !== event) {
  10517. dispatch(hyphenate(event), args);
  10518. }
  10519. };
  10520. let parent = this;
  10521. while (parent = parent && (parent.parentNode || parent.host)) {
  10522. if (parent instanceof VueElement) {
  10523. instance.parent = parent._instance;
  10524. instance.provides = parent._instance.provides;
  10525. break;
  10526. }
  10527. }
  10528. };
  10529. }
  10530. return vnode;
  10531. }
  10532. _applyStyles(styles) {
  10533. if (styles) {
  10534. styles.forEach((css) => {
  10535. const s = document.createElement("style");
  10536. s.textContent = css;
  10537. this.shadowRoot.appendChild(s);
  10538. {
  10539. (this._styles || (this._styles = [])).push(s);
  10540. }
  10541. });
  10542. }
  10543. }
  10544. }
  10545. function useCssModule(name = "$style") {
  10546. {
  10547. {
  10548. warn(`useCssModule() is not supported in the global build.`);
  10549. }
  10550. return EMPTY_OBJ;
  10551. }
  10552. }
  10553. const positionMap = /* @__PURE__ */ new WeakMap();
  10554. const newPositionMap = /* @__PURE__ */ new WeakMap();
  10555. const moveCbKey = Symbol("_moveCb");
  10556. const enterCbKey = Symbol("_enterCb");
  10557. const TransitionGroupImpl = {
  10558. name: "TransitionGroup",
  10559. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  10560. tag: String,
  10561. moveClass: String
  10562. }),
  10563. setup(props, { slots }) {
  10564. const instance = getCurrentInstance();
  10565. const state = useTransitionState();
  10566. let prevChildren;
  10567. let children;
  10568. onUpdated(() => {
  10569. if (!prevChildren.length) {
  10570. return;
  10571. }
  10572. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  10573. if (!hasCSSTransform(
  10574. prevChildren[0].el,
  10575. instance.vnode.el,
  10576. moveClass
  10577. )) {
  10578. return;
  10579. }
  10580. prevChildren.forEach(callPendingCbs);
  10581. prevChildren.forEach(recordPosition);
  10582. const movedChildren = prevChildren.filter(applyTranslation);
  10583. forceReflow();
  10584. movedChildren.forEach((c) => {
  10585. const el = c.el;
  10586. const style = el.style;
  10587. addTransitionClass(el, moveClass);
  10588. style.transform = style.webkitTransform = style.transitionDuration = "";
  10589. const cb = el[moveCbKey] = (e) => {
  10590. if (e && e.target !== el) {
  10591. return;
  10592. }
  10593. if (!e || /transform$/.test(e.propertyName)) {
  10594. el.removeEventListener("transitionend", cb);
  10595. el[moveCbKey] = null;
  10596. removeTransitionClass(el, moveClass);
  10597. }
  10598. };
  10599. el.addEventListener("transitionend", cb);
  10600. });
  10601. });
  10602. return () => {
  10603. const rawProps = toRaw(props);
  10604. const cssTransitionProps = resolveTransitionProps(rawProps);
  10605. let tag = rawProps.tag || Fragment;
  10606. prevChildren = [];
  10607. if (children) {
  10608. for (let i = 0; i < children.length; i++) {
  10609. const child = children[i];
  10610. if (child.el && child.el instanceof Element) {
  10611. prevChildren.push(child);
  10612. setTransitionHooks(
  10613. child,
  10614. resolveTransitionHooks(
  10615. child,
  10616. cssTransitionProps,
  10617. state,
  10618. instance
  10619. )
  10620. );
  10621. positionMap.set(
  10622. child,
  10623. child.el.getBoundingClientRect()
  10624. );
  10625. }
  10626. }
  10627. }
  10628. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  10629. for (let i = 0; i < children.length; i++) {
  10630. const child = children[i];
  10631. if (child.key != null) {
  10632. setTransitionHooks(
  10633. child,
  10634. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  10635. );
  10636. } else {
  10637. warn(`<TransitionGroup> children must be keyed.`);
  10638. }
  10639. }
  10640. return createVNode(tag, null, children);
  10641. };
  10642. }
  10643. };
  10644. const removeMode = (props) => delete props.mode;
  10645. /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
  10646. const TransitionGroup = TransitionGroupImpl;
  10647. function callPendingCbs(c) {
  10648. const el = c.el;
  10649. if (el[moveCbKey]) {
  10650. el[moveCbKey]();
  10651. }
  10652. if (el[enterCbKey]) {
  10653. el[enterCbKey]();
  10654. }
  10655. }
  10656. function recordPosition(c) {
  10657. newPositionMap.set(c, c.el.getBoundingClientRect());
  10658. }
  10659. function applyTranslation(c) {
  10660. const oldPos = positionMap.get(c);
  10661. const newPos = newPositionMap.get(c);
  10662. const dx = oldPos.left - newPos.left;
  10663. const dy = oldPos.top - newPos.top;
  10664. if (dx || dy) {
  10665. const s = c.el.style;
  10666. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  10667. s.transitionDuration = "0s";
  10668. return c;
  10669. }
  10670. }
  10671. function hasCSSTransform(el, root, moveClass) {
  10672. const clone = el.cloneNode();
  10673. const _vtc = el[vtcKey];
  10674. if (_vtc) {
  10675. _vtc.forEach((cls) => {
  10676. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  10677. });
  10678. }
  10679. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  10680. clone.style.display = "none";
  10681. const container = root.nodeType === 1 ? root : root.parentNode;
  10682. container.appendChild(clone);
  10683. const { hasTransform } = getTransitionInfo(clone);
  10684. container.removeChild(clone);
  10685. return hasTransform;
  10686. }
  10687. const getModelAssigner = (vnode) => {
  10688. const fn = vnode.props["onUpdate:modelValue"] || false;
  10689. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  10690. };
  10691. function onCompositionStart(e) {
  10692. e.target.composing = true;
  10693. }
  10694. function onCompositionEnd(e) {
  10695. const target = e.target;
  10696. if (target.composing) {
  10697. target.composing = false;
  10698. target.dispatchEvent(new Event("input"));
  10699. }
  10700. }
  10701. const assignKey = Symbol("_assign");
  10702. const vModelText = {
  10703. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  10704. el[assignKey] = getModelAssigner(vnode);
  10705. const castToNumber = number || vnode.props && vnode.props.type === "number";
  10706. addEventListener(el, lazy ? "change" : "input", (e) => {
  10707. if (e.target.composing) return;
  10708. let domValue = el.value;
  10709. if (trim) {
  10710. domValue = domValue.trim();
  10711. }
  10712. if (castToNumber) {
  10713. domValue = looseToNumber(domValue);
  10714. }
  10715. el[assignKey](domValue);
  10716. });
  10717. if (trim) {
  10718. addEventListener(el, "change", () => {
  10719. el.value = el.value.trim();
  10720. });
  10721. }
  10722. if (!lazy) {
  10723. addEventListener(el, "compositionstart", onCompositionStart);
  10724. addEventListener(el, "compositionend", onCompositionEnd);
  10725. addEventListener(el, "change", onCompositionEnd);
  10726. }
  10727. },
  10728. // set value on mounted so it's after min/max for type="range"
  10729. mounted(el, { value }) {
  10730. el.value = value == null ? "" : value;
  10731. },
  10732. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  10733. el[assignKey] = getModelAssigner(vnode);
  10734. if (el.composing) return;
  10735. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  10736. const newValue = value == null ? "" : value;
  10737. if (elValue === newValue) {
  10738. return;
  10739. }
  10740. if (document.activeElement === el && el.type !== "range") {
  10741. if (lazy && value === oldValue) {
  10742. return;
  10743. }
  10744. if (trim && el.value.trim() === newValue) {
  10745. return;
  10746. }
  10747. }
  10748. el.value = newValue;
  10749. }
  10750. };
  10751. const vModelCheckbox = {
  10752. // #4096 array checkboxes need to be deep traversed
  10753. deep: true,
  10754. created(el, _, vnode) {
  10755. el[assignKey] = getModelAssigner(vnode);
  10756. addEventListener(el, "change", () => {
  10757. const modelValue = el._modelValue;
  10758. const elementValue = getValue(el);
  10759. const checked = el.checked;
  10760. const assign = el[assignKey];
  10761. if (isArray(modelValue)) {
  10762. const index = looseIndexOf(modelValue, elementValue);
  10763. const found = index !== -1;
  10764. if (checked && !found) {
  10765. assign(modelValue.concat(elementValue));
  10766. } else if (!checked && found) {
  10767. const filtered = [...modelValue];
  10768. filtered.splice(index, 1);
  10769. assign(filtered);
  10770. }
  10771. } else if (isSet(modelValue)) {
  10772. const cloned = new Set(modelValue);
  10773. if (checked) {
  10774. cloned.add(elementValue);
  10775. } else {
  10776. cloned.delete(elementValue);
  10777. }
  10778. assign(cloned);
  10779. } else {
  10780. assign(getCheckboxValue(el, checked));
  10781. }
  10782. });
  10783. },
  10784. // set initial checked on mount to wait for true-value/false-value
  10785. mounted: setChecked,
  10786. beforeUpdate(el, binding, vnode) {
  10787. el[assignKey] = getModelAssigner(vnode);
  10788. setChecked(el, binding, vnode);
  10789. }
  10790. };
  10791. function setChecked(el, { value, oldValue }, vnode) {
  10792. el._modelValue = value;
  10793. if (isArray(value)) {
  10794. el.checked = looseIndexOf(value, vnode.props.value) > -1;
  10795. } else if (isSet(value)) {
  10796. el.checked = value.has(vnode.props.value);
  10797. } else if (value !== oldValue) {
  10798. el.checked = looseEqual(value, getCheckboxValue(el, true));
  10799. }
  10800. }
  10801. const vModelRadio = {
  10802. created(el, { value }, vnode) {
  10803. el.checked = looseEqual(value, vnode.props.value);
  10804. el[assignKey] = getModelAssigner(vnode);
  10805. addEventListener(el, "change", () => {
  10806. el[assignKey](getValue(el));
  10807. });
  10808. },
  10809. beforeUpdate(el, { value, oldValue }, vnode) {
  10810. el[assignKey] = getModelAssigner(vnode);
  10811. if (value !== oldValue) {
  10812. el.checked = looseEqual(value, vnode.props.value);
  10813. }
  10814. }
  10815. };
  10816. const vModelSelect = {
  10817. // <select multiple> value need to be deep traversed
  10818. deep: true,
  10819. created(el, { value, modifiers: { number } }, vnode) {
  10820. const isSetModel = isSet(value);
  10821. addEventListener(el, "change", () => {
  10822. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  10823. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  10824. );
  10825. el[assignKey](
  10826. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  10827. );
  10828. el._assigning = true;
  10829. nextTick(() => {
  10830. el._assigning = false;
  10831. });
  10832. });
  10833. el[assignKey] = getModelAssigner(vnode);
  10834. },
  10835. // set value in mounted & updated because <select> relies on its children
  10836. // <option>s.
  10837. mounted(el, { value, modifiers: { number } }) {
  10838. setSelected(el, value);
  10839. },
  10840. beforeUpdate(el, _binding, vnode) {
  10841. el[assignKey] = getModelAssigner(vnode);
  10842. },
  10843. updated(el, { value, modifiers: { number } }) {
  10844. if (!el._assigning) {
  10845. setSelected(el, value);
  10846. }
  10847. }
  10848. };
  10849. function setSelected(el, value, number) {
  10850. const isMultiple = el.multiple;
  10851. const isArrayValue = isArray(value);
  10852. if (isMultiple && !isArrayValue && !isSet(value)) {
  10853. warn(
  10854. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  10855. );
  10856. return;
  10857. }
  10858. for (let i = 0, l = el.options.length; i < l; i++) {
  10859. const option = el.options[i];
  10860. const optionValue = getValue(option);
  10861. if (isMultiple) {
  10862. if (isArrayValue) {
  10863. const optionType = typeof optionValue;
  10864. if (optionType === "string" || optionType === "number") {
  10865. option.selected = value.some((v) => String(v) === String(optionValue));
  10866. } else {
  10867. option.selected = looseIndexOf(value, optionValue) > -1;
  10868. }
  10869. } else {
  10870. option.selected = value.has(optionValue);
  10871. }
  10872. } else if (looseEqual(getValue(option), value)) {
  10873. if (el.selectedIndex !== i) el.selectedIndex = i;
  10874. return;
  10875. }
  10876. }
  10877. if (!isMultiple && el.selectedIndex !== -1) {
  10878. el.selectedIndex = -1;
  10879. }
  10880. }
  10881. function getValue(el) {
  10882. return "_value" in el ? el._value : el.value;
  10883. }
  10884. function getCheckboxValue(el, checked) {
  10885. const key = checked ? "_trueValue" : "_falseValue";
  10886. return key in el ? el[key] : checked;
  10887. }
  10888. const vModelDynamic = {
  10889. created(el, binding, vnode) {
  10890. callModelHook(el, binding, vnode, null, "created");
  10891. },
  10892. mounted(el, binding, vnode) {
  10893. callModelHook(el, binding, vnode, null, "mounted");
  10894. },
  10895. beforeUpdate(el, binding, vnode, prevVNode) {
  10896. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  10897. },
  10898. updated(el, binding, vnode, prevVNode) {
  10899. callModelHook(el, binding, vnode, prevVNode, "updated");
  10900. }
  10901. };
  10902. function resolveDynamicModel(tagName, type) {
  10903. switch (tagName) {
  10904. case "SELECT":
  10905. return vModelSelect;
  10906. case "TEXTAREA":
  10907. return vModelText;
  10908. default:
  10909. switch (type) {
  10910. case "checkbox":
  10911. return vModelCheckbox;
  10912. case "radio":
  10913. return vModelRadio;
  10914. default:
  10915. return vModelText;
  10916. }
  10917. }
  10918. }
  10919. function callModelHook(el, binding, vnode, prevVNode, hook) {
  10920. const modelToUse = resolveDynamicModel(
  10921. el.tagName,
  10922. vnode.props && vnode.props.type
  10923. );
  10924. const fn = modelToUse[hook];
  10925. fn && fn(el, binding, vnode, prevVNode);
  10926. }
  10927. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  10928. const modifierGuards = {
  10929. stop: (e) => e.stopPropagation(),
  10930. prevent: (e) => e.preventDefault(),
  10931. self: (e) => e.target !== e.currentTarget,
  10932. ctrl: (e) => !e.ctrlKey,
  10933. shift: (e) => !e.shiftKey,
  10934. alt: (e) => !e.altKey,
  10935. meta: (e) => !e.metaKey,
  10936. left: (e) => "button" in e && e.button !== 0,
  10937. middle: (e) => "button" in e && e.button !== 1,
  10938. right: (e) => "button" in e && e.button !== 2,
  10939. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  10940. };
  10941. const withModifiers = (fn, modifiers) => {
  10942. const cache = fn._withMods || (fn._withMods = {});
  10943. const cacheKey = modifiers.join(".");
  10944. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  10945. for (let i = 0; i < modifiers.length; i++) {
  10946. const guard = modifierGuards[modifiers[i]];
  10947. if (guard && guard(event, modifiers)) return;
  10948. }
  10949. return fn(event, ...args);
  10950. });
  10951. };
  10952. const keyNames = {
  10953. esc: "escape",
  10954. space: " ",
  10955. up: "arrow-up",
  10956. left: "arrow-left",
  10957. right: "arrow-right",
  10958. down: "arrow-down",
  10959. delete: "backspace"
  10960. };
  10961. const withKeys = (fn, modifiers) => {
  10962. const cache = fn._withKeys || (fn._withKeys = {});
  10963. const cacheKey = modifiers.join(".");
  10964. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  10965. if (!("key" in event)) {
  10966. return;
  10967. }
  10968. const eventKey = hyphenate(event.key);
  10969. if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
  10970. return fn(event);
  10971. }
  10972. });
  10973. };
  10974. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  10975. let renderer;
  10976. let enabledHydration = false;
  10977. function ensureRenderer() {
  10978. return renderer || (renderer = createRenderer(rendererOptions));
  10979. }
  10980. function ensureHydrationRenderer() {
  10981. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  10982. enabledHydration = true;
  10983. return renderer;
  10984. }
  10985. const render = (...args) => {
  10986. ensureRenderer().render(...args);
  10987. };
  10988. const hydrate = (...args) => {
  10989. ensureHydrationRenderer().hydrate(...args);
  10990. };
  10991. const createApp = (...args) => {
  10992. const app = ensureRenderer().createApp(...args);
  10993. {
  10994. injectNativeTagCheck(app);
  10995. injectCompilerOptionsCheck(app);
  10996. }
  10997. const { mount } = app;
  10998. app.mount = (containerOrSelector) => {
  10999. const container = normalizeContainer(containerOrSelector);
  11000. if (!container) return;
  11001. const component = app._component;
  11002. if (!isFunction(component) && !component.render && !component.template) {
  11003. component.template = container.innerHTML;
  11004. }
  11005. container.innerHTML = "";
  11006. const proxy = mount(container, false, resolveRootNamespace(container));
  11007. if (container instanceof Element) {
  11008. container.removeAttribute("v-cloak");
  11009. container.setAttribute("data-v-app", "");
  11010. }
  11011. return proxy;
  11012. };
  11013. return app;
  11014. };
  11015. const createSSRApp = (...args) => {
  11016. const app = ensureHydrationRenderer().createApp(...args);
  11017. {
  11018. injectNativeTagCheck(app);
  11019. injectCompilerOptionsCheck(app);
  11020. }
  11021. const { mount } = app;
  11022. app.mount = (containerOrSelector) => {
  11023. const container = normalizeContainer(containerOrSelector);
  11024. if (container) {
  11025. return mount(container, true, resolveRootNamespace(container));
  11026. }
  11027. };
  11028. return app;
  11029. };
  11030. function resolveRootNamespace(container) {
  11031. if (container instanceof SVGElement) {
  11032. return "svg";
  11033. }
  11034. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  11035. return "mathml";
  11036. }
  11037. }
  11038. function injectNativeTagCheck(app) {
  11039. Object.defineProperty(app.config, "isNativeTag", {
  11040. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  11041. writable: false
  11042. });
  11043. }
  11044. function injectCompilerOptionsCheck(app) {
  11045. if (isRuntimeOnly()) {
  11046. const isCustomElement = app.config.isCustomElement;
  11047. Object.defineProperty(app.config, "isCustomElement", {
  11048. get() {
  11049. return isCustomElement;
  11050. },
  11051. set() {
  11052. warn(
  11053. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  11054. );
  11055. }
  11056. });
  11057. const compilerOptions = app.config.compilerOptions;
  11058. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  11059. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  11060. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  11061. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  11062. Object.defineProperty(app.config, "compilerOptions", {
  11063. get() {
  11064. warn(msg);
  11065. return compilerOptions;
  11066. },
  11067. set() {
  11068. warn(msg);
  11069. }
  11070. });
  11071. }
  11072. }
  11073. function normalizeContainer(container) {
  11074. if (isString(container)) {
  11075. const res = document.querySelector(container);
  11076. if (!res) {
  11077. warn(
  11078. `Failed to mount app: mount target selector "${container}" returned null.`
  11079. );
  11080. }
  11081. return res;
  11082. }
  11083. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  11084. warn(
  11085. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  11086. );
  11087. }
  11088. return container;
  11089. }
  11090. const initDirectivesForSSR = NOOP;
  11091. exports.BaseTransition = BaseTransition;
  11092. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  11093. exports.Comment = Comment;
  11094. exports.DeprecationTypes = DeprecationTypes;
  11095. exports.EffectScope = EffectScope;
  11096. exports.ErrorCodes = ErrorCodes;
  11097. exports.ErrorTypeStrings = ErrorTypeStrings;
  11098. exports.Fragment = Fragment;
  11099. exports.KeepAlive = KeepAlive;
  11100. exports.ReactiveEffect = ReactiveEffect;
  11101. exports.Static = Static;
  11102. exports.Suspense = Suspense;
  11103. exports.Teleport = Teleport;
  11104. exports.Text = Text;
  11105. exports.TrackOpTypes = TrackOpTypes;
  11106. exports.Transition = Transition;
  11107. exports.TransitionGroup = TransitionGroup;
  11108. exports.TriggerOpTypes = TriggerOpTypes;
  11109. exports.VueElement = VueElement;
  11110. exports.assertNumber = assertNumber;
  11111. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  11112. exports.callWithErrorHandling = callWithErrorHandling;
  11113. exports.camelize = camelize;
  11114. exports.capitalize = capitalize;
  11115. exports.cloneVNode = cloneVNode;
  11116. exports.compatUtils = compatUtils;
  11117. exports.computed = computed;
  11118. exports.createApp = createApp;
  11119. exports.createBlock = createBlock;
  11120. exports.createCommentVNode = createCommentVNode;
  11121. exports.createElementBlock = createElementBlock;
  11122. exports.createElementVNode = createBaseVNode;
  11123. exports.createHydrationRenderer = createHydrationRenderer;
  11124. exports.createPropsRestProxy = createPropsRestProxy;
  11125. exports.createRenderer = createRenderer;
  11126. exports.createSSRApp = createSSRApp;
  11127. exports.createSlots = createSlots;
  11128. exports.createStaticVNode = createStaticVNode;
  11129. exports.createTextVNode = createTextVNode;
  11130. exports.createVNode = createVNode;
  11131. exports.customRef = customRef;
  11132. exports.defineAsyncComponent = defineAsyncComponent;
  11133. exports.defineComponent = defineComponent;
  11134. exports.defineCustomElement = defineCustomElement;
  11135. exports.defineEmits = defineEmits;
  11136. exports.defineExpose = defineExpose;
  11137. exports.defineModel = defineModel;
  11138. exports.defineOptions = defineOptions;
  11139. exports.defineProps = defineProps;
  11140. exports.defineSSRCustomElement = defineSSRCustomElement;
  11141. exports.defineSlots = defineSlots;
  11142. exports.devtools = devtools;
  11143. exports.effect = effect;
  11144. exports.effectScope = effectScope;
  11145. exports.getCurrentInstance = getCurrentInstance;
  11146. exports.getCurrentScope = getCurrentScope;
  11147. exports.getTransitionRawChildren = getTransitionRawChildren;
  11148. exports.guardReactiveProps = guardReactiveProps;
  11149. exports.h = h;
  11150. exports.handleError = handleError;
  11151. exports.hasInjectionContext = hasInjectionContext;
  11152. exports.hydrate = hydrate;
  11153. exports.initCustomFormatter = initCustomFormatter;
  11154. exports.initDirectivesForSSR = initDirectivesForSSR;
  11155. exports.inject = inject;
  11156. exports.isMemoSame = isMemoSame;
  11157. exports.isProxy = isProxy;
  11158. exports.isReactive = isReactive;
  11159. exports.isReadonly = isReadonly;
  11160. exports.isRef = isRef;
  11161. exports.isRuntimeOnly = isRuntimeOnly;
  11162. exports.isShallow = isShallow;
  11163. exports.isVNode = isVNode;
  11164. exports.markRaw = markRaw;
  11165. exports.mergeDefaults = mergeDefaults;
  11166. exports.mergeModels = mergeModels;
  11167. exports.mergeProps = mergeProps;
  11168. exports.nextTick = nextTick;
  11169. exports.normalizeClass = normalizeClass;
  11170. exports.normalizeProps = normalizeProps;
  11171. exports.normalizeStyle = normalizeStyle;
  11172. exports.onActivated = onActivated;
  11173. exports.onBeforeMount = onBeforeMount;
  11174. exports.onBeforeUnmount = onBeforeUnmount;
  11175. exports.onBeforeUpdate = onBeforeUpdate;
  11176. exports.onDeactivated = onDeactivated;
  11177. exports.onErrorCaptured = onErrorCaptured;
  11178. exports.onMounted = onMounted;
  11179. exports.onRenderTracked = onRenderTracked;
  11180. exports.onRenderTriggered = onRenderTriggered;
  11181. exports.onScopeDispose = onScopeDispose;
  11182. exports.onServerPrefetch = onServerPrefetch;
  11183. exports.onUnmounted = onUnmounted;
  11184. exports.onUpdated = onUpdated;
  11185. exports.openBlock = openBlock;
  11186. exports.popScopeId = popScopeId;
  11187. exports.provide = provide;
  11188. exports.proxyRefs = proxyRefs;
  11189. exports.pushScopeId = pushScopeId;
  11190. exports.queuePostFlushCb = queuePostFlushCb;
  11191. exports.reactive = reactive;
  11192. exports.readonly = readonly;
  11193. exports.ref = ref;
  11194. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  11195. exports.render = render;
  11196. exports.renderList = renderList;
  11197. exports.renderSlot = renderSlot;
  11198. exports.resolveComponent = resolveComponent;
  11199. exports.resolveDirective = resolveDirective;
  11200. exports.resolveDynamicComponent = resolveDynamicComponent;
  11201. exports.resolveFilter = resolveFilter;
  11202. exports.resolveTransitionHooks = resolveTransitionHooks;
  11203. exports.setBlockTracking = setBlockTracking;
  11204. exports.setDevtoolsHook = setDevtoolsHook;
  11205. exports.setTransitionHooks = setTransitionHooks;
  11206. exports.shallowReactive = shallowReactive;
  11207. exports.shallowReadonly = shallowReadonly;
  11208. exports.shallowRef = shallowRef;
  11209. exports.ssrContextKey = ssrContextKey;
  11210. exports.ssrUtils = ssrUtils;
  11211. exports.stop = stop;
  11212. exports.toDisplayString = toDisplayString;
  11213. exports.toHandlerKey = toHandlerKey;
  11214. exports.toHandlers = toHandlers;
  11215. exports.toRaw = toRaw;
  11216. exports.toRef = toRef;
  11217. exports.toRefs = toRefs;
  11218. exports.toValue = toValue;
  11219. exports.transformVNodeArgs = transformVNodeArgs;
  11220. exports.triggerRef = triggerRef;
  11221. exports.unref = unref;
  11222. exports.useAttrs = useAttrs;
  11223. exports.useCssModule = useCssModule;
  11224. exports.useCssVars = useCssVars;
  11225. exports.useModel = useModel;
  11226. exports.useSSRContext = useSSRContext;
  11227. exports.useSlots = useSlots;
  11228. exports.useTransitionState = useTransitionState;
  11229. exports.vModelCheckbox = vModelCheckbox;
  11230. exports.vModelDynamic = vModelDynamic;
  11231. exports.vModelRadio = vModelRadio;
  11232. exports.vModelSelect = vModelSelect;
  11233. exports.vModelText = vModelText;
  11234. exports.vShow = vShow;
  11235. exports.version = version;
  11236. exports.warn = warn;
  11237. exports.watch = watch;
  11238. exports.watchEffect = watchEffect;
  11239. exports.watchPostEffect = watchPostEffect;
  11240. exports.watchSyncEffect = watchSyncEffect;
  11241. exports.withAsyncContext = withAsyncContext;
  11242. exports.withCtx = withCtx;
  11243. exports.withDefaults = withDefaults;
  11244. exports.withDirectives = withDirectives;
  11245. exports.withKeys = withKeys;
  11246. exports.withMemo = withMemo;
  11247. exports.withModifiers = withModifiers;
  11248. exports.withScopeId = withScopeId;
  11249. return exports;
  11250. })({});