browser.js 333 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  3. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VueTemplateCompiler = {}));
  5. })(this, (function (exports) { 'use strict';
  6. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  7. var splitRE$1 = /\r?\n/g;
  8. var emptyRE = /^\s*$/;
  9. var needFixRE = /^(\r?\n)*[\t\s]/;
  10. var deIndent = function deindent (str) {
  11. if (!needFixRE.test(str)) {
  12. return str
  13. }
  14. var lines = str.split(splitRE$1);
  15. var min = Infinity;
  16. var type, cur, c;
  17. for (var i = 0; i < lines.length; i++) {
  18. var line = lines[i];
  19. if (!emptyRE.test(line)) {
  20. if (!type) {
  21. c = line.charAt(0);
  22. if (c === ' ' || c === '\t') {
  23. type = c;
  24. cur = count(line, type);
  25. if (cur < min) {
  26. min = cur;
  27. }
  28. } else {
  29. return str
  30. }
  31. } else {
  32. cur = count(line, type);
  33. if (cur < min) {
  34. min = cur;
  35. }
  36. }
  37. }
  38. }
  39. return lines.map(function (line) {
  40. return line.slice(min)
  41. }).join('\n')
  42. };
  43. function count (line, type) {
  44. var i = 0;
  45. while (line.charAt(i) === type) {
  46. i++;
  47. }
  48. return i
  49. }
  50. var emptyObject = Object.freeze({});
  51. var isArray = Array.isArray;
  52. // These helpers produce better VM code in JS engines due to their
  53. // explicitness and function inlining.
  54. function isUndef(v) {
  55. return v === undefined || v === null;
  56. }
  57. function isDef(v) {
  58. return v !== undefined && v !== null;
  59. }
  60. function isTrue(v) {
  61. return v === true;
  62. }
  63. function isFalse(v) {
  64. return v === false;
  65. }
  66. /**
  67. * Check if value is primitive.
  68. */
  69. function isPrimitive(value) {
  70. return (typeof value === 'string' ||
  71. typeof value === 'number' ||
  72. // $flow-disable-line
  73. typeof value === 'symbol' ||
  74. typeof value === 'boolean');
  75. }
  76. function isFunction(value) {
  77. return typeof value === 'function';
  78. }
  79. /**
  80. * Quick object check - this is primarily used to tell
  81. * objects from primitive values when we know the value
  82. * is a JSON-compliant type.
  83. */
  84. function isObject(obj) {
  85. return obj !== null && typeof obj === 'object';
  86. }
  87. /**
  88. * Get the raw type string of a value, e.g., [object Object].
  89. */
  90. var _toString = Object.prototype.toString;
  91. function toRawType(value) {
  92. return _toString.call(value).slice(8, -1);
  93. }
  94. /**
  95. * Strict object type check. Only returns true
  96. * for plain JavaScript objects.
  97. */
  98. function isPlainObject(obj) {
  99. return _toString.call(obj) === '[object Object]';
  100. }
  101. /**
  102. * Check if val is a valid array index.
  103. */
  104. function isValidArrayIndex(val) {
  105. var n = parseFloat(String(val));
  106. return n >= 0 && Math.floor(n) === n && isFinite(val);
  107. }
  108. function isPromise(val) {
  109. return (isDef(val) &&
  110. typeof val.then === 'function' &&
  111. typeof val.catch === 'function');
  112. }
  113. /**
  114. * Convert a value to a string that is actually rendered.
  115. */
  116. function toString(val) {
  117. return val == null
  118. ? ''
  119. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  120. ? JSON.stringify(val, replacer, 2)
  121. : String(val);
  122. }
  123. function replacer(_key, val) {
  124. // avoid circular deps from v3
  125. if (val && val.__v_isRef) {
  126. return val.value;
  127. }
  128. return val;
  129. }
  130. /**
  131. * Convert an input value to a number for persistence.
  132. * If the conversion fails, return original string.
  133. */
  134. function toNumber(val) {
  135. var n = parseFloat(val);
  136. return isNaN(n) ? val : n;
  137. }
  138. /**
  139. * Make a map and return a function for checking if a key
  140. * is in that map.
  141. */
  142. function makeMap(str, expectsLowerCase) {
  143. var map = Object.create(null);
  144. var list = str.split(',');
  145. for (var i = 0; i < list.length; i++) {
  146. map[list[i]] = true;
  147. }
  148. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  149. }
  150. /**
  151. * Check if a tag is a built-in tag.
  152. */
  153. var isBuiltInTag = makeMap('slot,component', true);
  154. /**
  155. * Check if an attribute is a reserved attribute.
  156. */
  157. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  158. /**
  159. * Check whether an object has the property.
  160. */
  161. var hasOwnProperty = Object.prototype.hasOwnProperty;
  162. function hasOwn(obj, key) {
  163. return hasOwnProperty.call(obj, key);
  164. }
  165. /**
  166. * Create a cached version of a pure function.
  167. */
  168. function cached(fn) {
  169. var cache = Object.create(null);
  170. return function cachedFn(str) {
  171. var hit = cache[str];
  172. return hit || (cache[str] = fn(str));
  173. };
  174. }
  175. /**
  176. * Camelize a hyphen-delimited string.
  177. */
  178. var camelizeRE = /-(\w)/g;
  179. var camelize = cached(function (str) {
  180. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  181. });
  182. /**
  183. * Capitalize a string.
  184. */
  185. var capitalize = cached(function (str) {
  186. return str.charAt(0).toUpperCase() + str.slice(1);
  187. });
  188. /**
  189. * Hyphenate a camelCase string.
  190. */
  191. var hyphenateRE = /\B([A-Z])/g;
  192. var hyphenate = cached(function (str) {
  193. return str.replace(hyphenateRE, '-$1').toLowerCase();
  194. });
  195. /**
  196. * Mix properties into target object.
  197. */
  198. function extend(to, _from) {
  199. for (var key in _from) {
  200. to[key] = _from[key];
  201. }
  202. return to;
  203. }
  204. /**
  205. * Merge an Array of Objects into a single Object.
  206. */
  207. function toObject(arr) {
  208. var res = {};
  209. for (var i = 0; i < arr.length; i++) {
  210. if (arr[i]) {
  211. extend(res, arr[i]);
  212. }
  213. }
  214. return res;
  215. }
  216. /* eslint-disable no-unused-vars */
  217. /**
  218. * Perform no operation.
  219. * Stubbing args to make Flow happy without leaving useless transpiled code
  220. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  221. */
  222. function noop(a, b, c) { }
  223. /**
  224. * Always return false.
  225. */
  226. var no = function (a, b, c) { return false; };
  227. /* eslint-enable no-unused-vars */
  228. /**
  229. * Return the same value.
  230. */
  231. var identity = function (_) { return _; };
  232. /**
  233. * Generate a string containing static keys from compiler modules.
  234. */
  235. function genStaticKeys$1(modules) {
  236. return modules
  237. .reduce(function (keys, m) { return keys.concat(m.staticKeys || []); }, [])
  238. .join(',');
  239. }
  240. /**
  241. * Check if two values are loosely equal - that is,
  242. * if they are plain objects, do they have the same shape?
  243. */
  244. function looseEqual(a, b) {
  245. if (a === b)
  246. return true;
  247. var isObjectA = isObject(a);
  248. var isObjectB = isObject(b);
  249. if (isObjectA && isObjectB) {
  250. try {
  251. var isArrayA = Array.isArray(a);
  252. var isArrayB = Array.isArray(b);
  253. if (isArrayA && isArrayB) {
  254. return (a.length === b.length &&
  255. a.every(function (e, i) {
  256. return looseEqual(e, b[i]);
  257. }));
  258. }
  259. else if (a instanceof Date && b instanceof Date) {
  260. return a.getTime() === b.getTime();
  261. }
  262. else if (!isArrayA && !isArrayB) {
  263. var keysA = Object.keys(a);
  264. var keysB = Object.keys(b);
  265. return (keysA.length === keysB.length &&
  266. keysA.every(function (key) {
  267. return looseEqual(a[key], b[key]);
  268. }));
  269. }
  270. else {
  271. /* istanbul ignore next */
  272. return false;
  273. }
  274. }
  275. catch (e) {
  276. /* istanbul ignore next */
  277. return false;
  278. }
  279. }
  280. else if (!isObjectA && !isObjectB) {
  281. return String(a) === String(b);
  282. }
  283. else {
  284. return false;
  285. }
  286. }
  287. /**
  288. * Return the first index at which a loosely equal value can be
  289. * found in the array (if value is a plain object, the array must
  290. * contain an object of the same shape), or -1 if it is not present.
  291. */
  292. function looseIndexOf(arr, val) {
  293. for (var i = 0; i < arr.length; i++) {
  294. if (looseEqual(arr[i], val))
  295. return i;
  296. }
  297. return -1;
  298. }
  299. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  300. function hasChanged(x, y) {
  301. if (x === y) {
  302. return x === 0 && 1 / x !== 1 / y;
  303. }
  304. else {
  305. return x === x || y === y;
  306. }
  307. }
  308. var isUnaryTag = makeMap('area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  309. 'link,meta,param,source,track,wbr');
  310. // Elements that you can, intentionally, leave open
  311. // (and which close themselves)
  312. var canBeLeftOpenTag = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source');
  313. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  314. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  315. var isNonPhrasingTag = makeMap('address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  316. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  317. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  318. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  319. 'title,tr,track');
  320. /**
  321. * unicode letters used for parsing html tags, component names and property paths.
  322. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  323. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  324. */
  325. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  326. /**
  327. * Define a property.
  328. */
  329. function def(obj, key, val, enumerable) {
  330. Object.defineProperty(obj, key, {
  331. value: val,
  332. enumerable: !!enumerable,
  333. writable: true,
  334. configurable: true
  335. });
  336. }
  337. /**
  338. * Not type-checking this file because it's mostly vendor code.
  339. */
  340. // Regular Expressions for parsing tags and attributes
  341. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  342. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  343. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(unicodeRegExp.source, "]*");
  344. var qnameCapture = "((?:".concat(ncname, "\\:)?").concat(ncname, ")");
  345. var startTagOpen = new RegExp("^<".concat(qnameCapture));
  346. var startTagClose = /^\s*(\/?)>/;
  347. var endTag = new RegExp("^<\\/".concat(qnameCapture, "[^>]*>"));
  348. var doctype = /^<!DOCTYPE [^>]+>/i;
  349. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  350. var comment = /^<!\--/;
  351. var conditionalComment = /^<!\[/;
  352. // Special Elements (can contain anything)
  353. var isPlainTextElement = makeMap('script,style,textarea', true);
  354. var reCache = {};
  355. var decodingMap = {
  356. '&lt;': '<',
  357. '&gt;': '>',
  358. '&quot;': '"',
  359. '&amp;': '&',
  360. '&#10;': '\n',
  361. '&#9;': '\t',
  362. '&#39;': "'"
  363. };
  364. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  365. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  366. // #5992
  367. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  368. var shouldIgnoreFirstNewline = function (tag, html) {
  369. return tag && isIgnoreNewlineTag(tag) && html[0] === '\n';
  370. };
  371. function decodeAttr(value, shouldDecodeNewlines) {
  372. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  373. return value.replace(re, function (match) { return decodingMap[match]; });
  374. }
  375. function parseHTML(html, options) {
  376. var stack = [];
  377. var expectHTML = options.expectHTML;
  378. var isUnaryTag = options.isUnaryTag || no;
  379. var canBeLeftOpenTag = options.canBeLeftOpenTag || no;
  380. var index = 0;
  381. var last, lastTag;
  382. var _loop_1 = function () {
  383. last = html;
  384. // Make sure we're not in a plaintext content element like script/style
  385. if (!lastTag || !isPlainTextElement(lastTag)) {
  386. var textEnd = html.indexOf('<');
  387. if (textEnd === 0) {
  388. // Comment:
  389. if (comment.test(html)) {
  390. var commentEnd = html.indexOf('-->');
  391. if (commentEnd >= 0) {
  392. if (options.shouldKeepComment && options.comment) {
  393. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  394. }
  395. advance(commentEnd + 3);
  396. return "continue";
  397. }
  398. }
  399. // https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  400. if (conditionalComment.test(html)) {
  401. var conditionalEnd = html.indexOf(']>');
  402. if (conditionalEnd >= 0) {
  403. advance(conditionalEnd + 2);
  404. return "continue";
  405. }
  406. }
  407. // Doctype:
  408. var doctypeMatch = html.match(doctype);
  409. if (doctypeMatch) {
  410. advance(doctypeMatch[0].length);
  411. return "continue";
  412. }
  413. // End tag:
  414. var endTagMatch = html.match(endTag);
  415. if (endTagMatch) {
  416. var curIndex = index;
  417. advance(endTagMatch[0].length);
  418. parseEndTag(endTagMatch[1], curIndex, index);
  419. return "continue";
  420. }
  421. // Start tag:
  422. var startTagMatch = parseStartTag();
  423. if (startTagMatch) {
  424. handleStartTag(startTagMatch);
  425. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  426. advance(1);
  427. }
  428. return "continue";
  429. }
  430. }
  431. var text = void 0, rest = void 0, next = void 0;
  432. if (textEnd >= 0) {
  433. rest = html.slice(textEnd);
  434. while (!endTag.test(rest) &&
  435. !startTagOpen.test(rest) &&
  436. !comment.test(rest) &&
  437. !conditionalComment.test(rest)) {
  438. // < in plain text, be forgiving and treat it as text
  439. next = rest.indexOf('<', 1);
  440. if (next < 0)
  441. break;
  442. textEnd += next;
  443. rest = html.slice(textEnd);
  444. }
  445. text = html.substring(0, textEnd);
  446. }
  447. if (textEnd < 0) {
  448. text = html;
  449. }
  450. if (text) {
  451. advance(text.length);
  452. }
  453. if (options.chars && text) {
  454. options.chars(text, index - text.length, index);
  455. }
  456. }
  457. else {
  458. var endTagLength_1 = 0;
  459. var stackedTag_1 = lastTag.toLowerCase();
  460. var reStackedTag = reCache[stackedTag_1] ||
  461. (reCache[stackedTag_1] = new RegExp('([\\s\\S]*?)(</' + stackedTag_1 + '[^>]*>)', 'i'));
  462. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  463. endTagLength_1 = endTag.length;
  464. if (!isPlainTextElement(stackedTag_1) && stackedTag_1 !== 'noscript') {
  465. text = text
  466. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  467. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  468. }
  469. if (shouldIgnoreFirstNewline(stackedTag_1, text)) {
  470. text = text.slice(1);
  471. }
  472. if (options.chars) {
  473. options.chars(text);
  474. }
  475. return '';
  476. });
  477. index += html.length - rest.length;
  478. html = rest;
  479. parseEndTag(stackedTag_1, index - endTagLength_1, index);
  480. }
  481. if (html === last) {
  482. options.chars && options.chars(html);
  483. if (!stack.length && options.warn) {
  484. options.warn("Mal-formatted tag at end of template: \"".concat(html, "\""), {
  485. start: index + html.length
  486. });
  487. }
  488. return "break";
  489. }
  490. };
  491. while (html) {
  492. var state_1 = _loop_1();
  493. if (state_1 === "break")
  494. break;
  495. }
  496. // Clean up any remaining tags
  497. parseEndTag();
  498. function advance(n) {
  499. index += n;
  500. html = html.substring(n);
  501. }
  502. function parseStartTag() {
  503. var start = html.match(startTagOpen);
  504. if (start) {
  505. var match = {
  506. tagName: start[1],
  507. attrs: [],
  508. start: index
  509. };
  510. advance(start[0].length);
  511. var end = void 0, attr = void 0;
  512. while (!(end = html.match(startTagClose)) &&
  513. (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  514. attr.start = index;
  515. advance(attr[0].length);
  516. attr.end = index;
  517. match.attrs.push(attr);
  518. }
  519. if (end) {
  520. match.unarySlash = end[1];
  521. advance(end[0].length);
  522. match.end = index;
  523. return match;
  524. }
  525. }
  526. }
  527. function handleStartTag(match) {
  528. var tagName = match.tagName;
  529. var unarySlash = match.unarySlash;
  530. if (expectHTML) {
  531. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  532. parseEndTag(lastTag);
  533. }
  534. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  535. parseEndTag(tagName);
  536. }
  537. }
  538. var unary = isUnaryTag(tagName) || !!unarySlash;
  539. var l = match.attrs.length;
  540. var attrs = new Array(l);
  541. for (var i = 0; i < l; i++) {
  542. var args = match.attrs[i];
  543. var value = args[3] || args[4] || args[5] || '';
  544. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  545. ? options.shouldDecodeNewlinesForHref
  546. : options.shouldDecodeNewlines;
  547. attrs[i] = {
  548. name: args[1],
  549. value: decodeAttr(value, shouldDecodeNewlines)
  550. };
  551. if (options.outputSourceRange) {
  552. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  553. attrs[i].end = args.end;
  554. }
  555. }
  556. if (!unary) {
  557. stack.push({
  558. tag: tagName,
  559. lowerCasedTag: tagName.toLowerCase(),
  560. attrs: attrs,
  561. start: match.start,
  562. end: match.end
  563. });
  564. lastTag = tagName;
  565. }
  566. if (options.start) {
  567. options.start(tagName, attrs, unary, match.start, match.end);
  568. }
  569. }
  570. function parseEndTag(tagName, start, end) {
  571. var pos, lowerCasedTagName;
  572. if (start == null)
  573. start = index;
  574. if (end == null)
  575. end = index;
  576. // Find the closest opened tag of the same type
  577. if (tagName) {
  578. lowerCasedTagName = tagName.toLowerCase();
  579. for (pos = stack.length - 1; pos >= 0; pos--) {
  580. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  581. break;
  582. }
  583. }
  584. }
  585. else {
  586. // If no tag name is provided, clean shop
  587. pos = 0;
  588. }
  589. if (pos >= 0) {
  590. // Close all the open elements, up the stack
  591. for (var i = stack.length - 1; i >= pos; i--) {
  592. if ((i > pos || !tagName) && options.warn) {
  593. options.warn("tag <".concat(stack[i].tag, "> has no matching end tag."), {
  594. start: stack[i].start,
  595. end: stack[i].end
  596. });
  597. }
  598. if (options.end) {
  599. options.end(stack[i].tag, start, end);
  600. }
  601. }
  602. // Remove the open elements from the stack
  603. stack.length = pos;
  604. lastTag = pos && stack[pos - 1].tag;
  605. }
  606. else if (lowerCasedTagName === 'br') {
  607. if (options.start) {
  608. options.start(tagName, [], true, start, end);
  609. }
  610. }
  611. else if (lowerCasedTagName === 'p') {
  612. if (options.start) {
  613. options.start(tagName, [], false, start, end);
  614. }
  615. if (options.end) {
  616. options.end(tagName, start, end);
  617. }
  618. }
  619. }
  620. }
  621. var DEFAULT_FILENAME = 'anonymous.vue';
  622. var splitRE = /\r?\n/g;
  623. var replaceRE = /./g;
  624. var isSpecialTag = makeMap('script,style,template', true);
  625. /**
  626. * Parse a single-file component (*.vue) file into an SFC Descriptor Object.
  627. */
  628. function parseComponent(source, options) {
  629. if (options === void 0) { options = {}; }
  630. var sfc = {
  631. source: source,
  632. filename: DEFAULT_FILENAME,
  633. template: null,
  634. script: null,
  635. scriptSetup: null,
  636. styles: [],
  637. customBlocks: [],
  638. cssVars: [],
  639. errors: [],
  640. shouldForceReload: null // attached in parse() by compiler-sfc
  641. };
  642. var depth = 0;
  643. var currentBlock = null;
  644. var warn = function (msg) {
  645. sfc.errors.push(msg);
  646. };
  647. if (options.outputSourceRange) {
  648. warn = function (msg, range) {
  649. var data = { msg: msg };
  650. if (range.start != null) {
  651. data.start = range.start;
  652. }
  653. if (range.end != null) {
  654. data.end = range.end;
  655. }
  656. sfc.errors.push(data);
  657. };
  658. }
  659. function start(tag, attrs, unary, start, end) {
  660. if (depth === 0) {
  661. currentBlock = {
  662. type: tag,
  663. content: '',
  664. start: end,
  665. end: 0,
  666. attrs: attrs.reduce(function (cumulated, _a) {
  667. var name = _a.name, value = _a.value;
  668. cumulated[name] = value || true;
  669. return cumulated;
  670. }, {})
  671. };
  672. if (typeof currentBlock.attrs.src === 'string') {
  673. currentBlock.src = currentBlock.attrs.src;
  674. }
  675. if (isSpecialTag(tag)) {
  676. checkAttrs(currentBlock, attrs);
  677. if (tag === 'script') {
  678. var block = currentBlock;
  679. if (block.attrs.setup) {
  680. block.setup = currentBlock.attrs.setup;
  681. sfc.scriptSetup = block;
  682. }
  683. else {
  684. sfc.script = block;
  685. }
  686. }
  687. else if (tag === 'style') {
  688. sfc.styles.push(currentBlock);
  689. }
  690. else {
  691. sfc[tag] = currentBlock;
  692. }
  693. }
  694. else {
  695. // custom blocks
  696. sfc.customBlocks.push(currentBlock);
  697. }
  698. }
  699. if (!unary) {
  700. depth++;
  701. }
  702. }
  703. function checkAttrs(block, attrs) {
  704. for (var i = 0; i < attrs.length; i++) {
  705. var attr = attrs[i];
  706. if (attr.name === 'lang') {
  707. block.lang = attr.value;
  708. }
  709. if (attr.name === 'scoped') {
  710. block.scoped = true;
  711. }
  712. if (attr.name === 'module') {
  713. block.module = attr.value || true;
  714. }
  715. }
  716. }
  717. function end(tag, start) {
  718. if (depth === 1 && currentBlock) {
  719. currentBlock.end = start;
  720. var text = source.slice(currentBlock.start, currentBlock.end);
  721. if (options.deindent === true ||
  722. // by default, deindent unless it's script with default lang or (j/t)sx?
  723. (options.deindent !== false &&
  724. !(currentBlock.type === 'script' &&
  725. (!currentBlock.lang || /^(j|t)sx?$/.test(currentBlock.lang))))) {
  726. text = deIndent(text);
  727. }
  728. // pad content so that linters and pre-processors can output correct
  729. // line numbers in errors and warnings
  730. if (currentBlock.type !== 'template' && options.pad) {
  731. text = padContent(currentBlock, options.pad) + text;
  732. }
  733. currentBlock.content = text;
  734. currentBlock = null;
  735. }
  736. depth--;
  737. }
  738. function padContent(block, pad) {
  739. if (pad === 'space') {
  740. return source.slice(0, block.start).replace(replaceRE, ' ');
  741. }
  742. else {
  743. var offset = source.slice(0, block.start).split(splitRE).length;
  744. var padChar = block.type === 'script' && !block.lang ? '//\n' : '\n';
  745. return Array(offset).join(padChar);
  746. }
  747. }
  748. parseHTML(source, {
  749. warn: warn,
  750. start: start,
  751. end: end,
  752. outputSourceRange: options.outputSourceRange
  753. });
  754. return sfc;
  755. }
  756. // can we use __proto__?
  757. var hasProto = '__proto__' in {};
  758. // Browser environment sniffing
  759. var inBrowser = typeof window !== 'undefined';
  760. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  761. var isIE = UA && /msie|trident/.test(UA);
  762. UA && UA.indexOf('msie 9.0') > 0;
  763. var isEdge = UA && UA.indexOf('edge/') > 0;
  764. UA && UA.indexOf('android') > 0;
  765. UA && /iphone|ipad|ipod|ios/.test(UA);
  766. UA && /chrome\/\d+/.test(UA) && !isEdge;
  767. UA && /phantomjs/.test(UA);
  768. UA && UA.match(/firefox\/(\d+)/);
  769. // Firefox has a "watch" function on Object.prototype...
  770. // @ts-expect-error firebox support
  771. var nativeWatch = {}.watch;
  772. var supportsPassive = false;
  773. if (inBrowser) {
  774. try {
  775. var opts = {};
  776. Object.defineProperty(opts, 'passive', {
  777. get: function () {
  778. /* istanbul ignore next */
  779. supportsPassive = true;
  780. }
  781. }); // https://github.com/facebook/flow/issues/285
  782. window.addEventListener('test-passive', null, opts);
  783. }
  784. catch (e) { }
  785. }
  786. // this needs to be lazy-evaled because vue may be required before
  787. // vue-server-renderer can set VUE_ENV
  788. var _isServer;
  789. var isServerRendering = function () {
  790. if (_isServer === undefined) {
  791. /* istanbul ignore if */
  792. if (!inBrowser && typeof global !== 'undefined') {
  793. // detect presence of vue-server-renderer and avoid
  794. // Webpack shimming the process
  795. _isServer =
  796. global['process'] && global['process'].env.VUE_ENV === 'server';
  797. }
  798. else {
  799. _isServer = false;
  800. }
  801. }
  802. return _isServer;
  803. };
  804. /* istanbul ignore next */
  805. function isNative(Ctor) {
  806. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  807. }
  808. var hasSymbol = typeof Symbol !== 'undefined' &&
  809. isNative(Symbol) &&
  810. typeof Reflect !== 'undefined' &&
  811. isNative(Reflect.ownKeys);
  812. var _Set; // $flow-disable-line
  813. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  814. // use native Set when available.
  815. _Set = Set;
  816. }
  817. else {
  818. // a non-standard Set polyfill that only works with primitive keys.
  819. _Set = /** @class */ (function () {
  820. function Set() {
  821. this.set = Object.create(null);
  822. }
  823. Set.prototype.has = function (key) {
  824. return this.set[key] === true;
  825. };
  826. Set.prototype.add = function (key) {
  827. this.set[key] = true;
  828. };
  829. Set.prototype.clear = function () {
  830. this.set = Object.create(null);
  831. };
  832. return Set;
  833. }());
  834. }
  835. var ASSET_TYPES = ['component', 'directive', 'filter'];
  836. var LIFECYCLE_HOOKS = [
  837. 'beforeCreate',
  838. 'created',
  839. 'beforeMount',
  840. 'mounted',
  841. 'beforeUpdate',
  842. 'updated',
  843. 'beforeDestroy',
  844. 'destroyed',
  845. 'activated',
  846. 'deactivated',
  847. 'errorCaptured',
  848. 'serverPrefetch',
  849. 'renderTracked',
  850. 'renderTriggered'
  851. ];
  852. var config = {
  853. /**
  854. * Option merge strategies (used in core/util/options)
  855. */
  856. // $flow-disable-line
  857. optionMergeStrategies: Object.create(null),
  858. /**
  859. * Whether to suppress warnings.
  860. */
  861. silent: false,
  862. /**
  863. * Show production mode tip message on boot?
  864. */
  865. productionTip: true,
  866. /**
  867. * Whether to enable devtools
  868. */
  869. devtools: true,
  870. /**
  871. * Whether to record perf
  872. */
  873. performance: false,
  874. /**
  875. * Error handler for watcher errors
  876. */
  877. errorHandler: null,
  878. /**
  879. * Warn handler for watcher warns
  880. */
  881. warnHandler: null,
  882. /**
  883. * Ignore certain custom elements
  884. */
  885. ignoredElements: [],
  886. /**
  887. * Custom user key aliases for v-on
  888. */
  889. // $flow-disable-line
  890. keyCodes: Object.create(null),
  891. /**
  892. * Check if a tag is reserved so that it cannot be registered as a
  893. * component. This is platform-dependent and may be overwritten.
  894. */
  895. isReservedTag: no,
  896. /**
  897. * Check if an attribute is reserved so that it cannot be used as a component
  898. * prop. This is platform-dependent and may be overwritten.
  899. */
  900. isReservedAttr: no,
  901. /**
  902. * Check if a tag is an unknown element.
  903. * Platform-dependent.
  904. */
  905. isUnknownElement: no,
  906. /**
  907. * Get the namespace of an element
  908. */
  909. getTagNamespace: noop,
  910. /**
  911. * Parse the real tag name for the specific platform.
  912. */
  913. parsePlatformTagName: identity,
  914. /**
  915. * Check if an attribute must be bound using property, e.g. value
  916. * Platform-dependent.
  917. */
  918. mustUseProp: no,
  919. /**
  920. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  921. * This will significantly reduce performance if set to false.
  922. */
  923. async: true,
  924. /**
  925. * Exposed for legacy reasons
  926. */
  927. _lifecycleHooks: LIFECYCLE_HOOKS
  928. };
  929. var currentInstance = null;
  930. /**
  931. * @internal
  932. */
  933. function setCurrentInstance(vm) {
  934. if (vm === void 0) { vm = null; }
  935. if (!vm)
  936. currentInstance && currentInstance._scope.off();
  937. currentInstance = vm;
  938. vm && vm._scope.on();
  939. }
  940. /**
  941. * @internal
  942. */
  943. var VNode = /** @class */ (function () {
  944. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  945. this.tag = tag;
  946. this.data = data;
  947. this.children = children;
  948. this.text = text;
  949. this.elm = elm;
  950. this.ns = undefined;
  951. this.context = context;
  952. this.fnContext = undefined;
  953. this.fnOptions = undefined;
  954. this.fnScopeId = undefined;
  955. this.key = data && data.key;
  956. this.componentOptions = componentOptions;
  957. this.componentInstance = undefined;
  958. this.parent = undefined;
  959. this.raw = false;
  960. this.isStatic = false;
  961. this.isRootInsert = true;
  962. this.isComment = false;
  963. this.isCloned = false;
  964. this.isOnce = false;
  965. this.asyncFactory = asyncFactory;
  966. this.asyncMeta = undefined;
  967. this.isAsyncPlaceholder = false;
  968. }
  969. Object.defineProperty(VNode.prototype, "child", {
  970. // DEPRECATED: alias for componentInstance for backwards compat.
  971. /* istanbul ignore next */
  972. get: function () {
  973. return this.componentInstance;
  974. },
  975. enumerable: false,
  976. configurable: true
  977. });
  978. return VNode;
  979. }());
  980. var createEmptyVNode = function (text) {
  981. if (text === void 0) { text = ''; }
  982. var node = new VNode();
  983. node.text = text;
  984. node.isComment = true;
  985. return node;
  986. };
  987. function createTextVNode(val) {
  988. return new VNode(undefined, undefined, undefined, String(val));
  989. }
  990. // optimized shallow clone
  991. // used for static nodes and slot nodes because they may be reused across
  992. // multiple renders, cloning them avoids errors when DOM manipulations rely
  993. // on their elm reference.
  994. function cloneVNode(vnode) {
  995. var cloned = new VNode(vnode.tag, vnode.data,
  996. // #7975
  997. // clone children array to avoid mutating original in case of cloning
  998. // a child.
  999. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  1000. cloned.ns = vnode.ns;
  1001. cloned.isStatic = vnode.isStatic;
  1002. cloned.key = vnode.key;
  1003. cloned.isComment = vnode.isComment;
  1004. cloned.fnContext = vnode.fnContext;
  1005. cloned.fnOptions = vnode.fnOptions;
  1006. cloned.fnScopeId = vnode.fnScopeId;
  1007. cloned.asyncMeta = vnode.asyncMeta;
  1008. cloned.isCloned = true;
  1009. return cloned;
  1010. }
  1011. /* not type checking this file because flow doesn't play well with Proxy */
  1012. {
  1013. makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
  1014. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  1015. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  1016. 'require' // for Webpack/Browserify
  1017. );
  1018. var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
  1019. if (hasProxy_1) {
  1020. var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  1021. config.keyCodes = new Proxy(config.keyCodes, {
  1022. set: function (target, key, value) {
  1023. if (isBuiltInModifier_1(key)) {
  1024. warn$2("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
  1025. return false;
  1026. }
  1027. else {
  1028. target[key] = value;
  1029. return true;
  1030. }
  1031. }
  1032. });
  1033. }
  1034. }
  1035. /******************************************************************************
  1036. Copyright (c) Microsoft Corporation.
  1037. Permission to use, copy, modify, and/or distribute this software for any
  1038. purpose with or without fee is hereby granted.
  1039. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  1040. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  1041. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  1042. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  1043. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  1044. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  1045. PERFORMANCE OF THIS SOFTWARE.
  1046. ***************************************************************************** */
  1047. var __assign = function() {
  1048. __assign = Object.assign || function __assign(t) {
  1049. for (var s, i = 1, n = arguments.length; i < n; i++) {
  1050. s = arguments[i];
  1051. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  1052. }
  1053. return t;
  1054. };
  1055. return __assign.apply(this, arguments);
  1056. };
  1057. typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
  1058. var e = new Error(message);
  1059. return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
  1060. };
  1061. var uid = 0;
  1062. /**
  1063. * A dep is an observable that can have multiple
  1064. * directives subscribing to it.
  1065. * @internal
  1066. */
  1067. var Dep = /** @class */ (function () {
  1068. function Dep() {
  1069. // pending subs cleanup
  1070. this._pending = false;
  1071. this.id = uid++;
  1072. this.subs = [];
  1073. }
  1074. Dep.prototype.addSub = function (sub) {
  1075. this.subs.push(sub);
  1076. };
  1077. Dep.prototype.removeSub = function (sub) {
  1078. // #12696 deps with massive amount of subscribers are extremely slow to
  1079. // clean up in Chromium
  1080. // to workaround this, we unset the sub for now, and clear them on
  1081. // next scheduler flush.
  1082. this.subs[this.subs.indexOf(sub)] = null;
  1083. if (!this._pending) {
  1084. this._pending = true;
  1085. }
  1086. };
  1087. Dep.prototype.depend = function (info) {
  1088. if (Dep.target) {
  1089. Dep.target.addDep(this);
  1090. if (info && Dep.target.onTrack) {
  1091. Dep.target.onTrack(__assign({ effect: Dep.target }, info));
  1092. }
  1093. }
  1094. };
  1095. Dep.prototype.notify = function (info) {
  1096. // stabilize the subscriber list first
  1097. var subs = this.subs.filter(function (s) { return s; });
  1098. for (var i = 0, l = subs.length; i < l; i++) {
  1099. var sub = subs[i];
  1100. if (info) {
  1101. sub.onTrigger &&
  1102. sub.onTrigger(__assign({ effect: subs[i] }, info));
  1103. }
  1104. sub.update();
  1105. }
  1106. };
  1107. return Dep;
  1108. }());
  1109. // The current target watcher being evaluated.
  1110. // This is globally unique because only one watcher
  1111. // can be evaluated at a time.
  1112. Dep.target = null;
  1113. var targetStack = [];
  1114. function pushTarget(target) {
  1115. targetStack.push(target);
  1116. Dep.target = target;
  1117. }
  1118. function popTarget() {
  1119. targetStack.pop();
  1120. Dep.target = targetStack[targetStack.length - 1];
  1121. }
  1122. /*
  1123. * not type checking this file because flow doesn't play well with
  1124. * dynamically accessing methods on Array prototype
  1125. */
  1126. var arrayProto = Array.prototype;
  1127. var arrayMethods = Object.create(arrayProto);
  1128. var methodsToPatch = [
  1129. 'push',
  1130. 'pop',
  1131. 'shift',
  1132. 'unshift',
  1133. 'splice',
  1134. 'sort',
  1135. 'reverse'
  1136. ];
  1137. /**
  1138. * Intercept mutating methods and emit events
  1139. */
  1140. methodsToPatch.forEach(function (method) {
  1141. // cache original method
  1142. var original = arrayProto[method];
  1143. def(arrayMethods, method, function mutator() {
  1144. var args = [];
  1145. for (var _i = 0; _i < arguments.length; _i++) {
  1146. args[_i] = arguments[_i];
  1147. }
  1148. var result = original.apply(this, args);
  1149. var ob = this.__ob__;
  1150. var inserted;
  1151. switch (method) {
  1152. case 'push':
  1153. case 'unshift':
  1154. inserted = args;
  1155. break;
  1156. case 'splice':
  1157. inserted = args.slice(2);
  1158. break;
  1159. }
  1160. if (inserted)
  1161. ob.observeArray(inserted);
  1162. // notify change
  1163. {
  1164. ob.dep.notify({
  1165. type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
  1166. target: this,
  1167. key: method
  1168. });
  1169. }
  1170. return result;
  1171. });
  1172. });
  1173. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  1174. var NO_INITIAL_VALUE = {};
  1175. /**
  1176. * In some cases we may want to disable observation inside a component's
  1177. * update computation.
  1178. */
  1179. var shouldObserve = true;
  1180. function toggleObserving(value) {
  1181. shouldObserve = value;
  1182. }
  1183. // ssr mock dep
  1184. var mockDep = {
  1185. notify: noop,
  1186. depend: noop,
  1187. addSub: noop,
  1188. removeSub: noop
  1189. };
  1190. /**
  1191. * Observer class that is attached to each observed
  1192. * object. Once attached, the observer converts the target
  1193. * object's property keys into getter/setters that
  1194. * collect dependencies and dispatch updates.
  1195. */
  1196. var Observer = /** @class */ (function () {
  1197. function Observer(value, shallow, mock) {
  1198. if (shallow === void 0) { shallow = false; }
  1199. if (mock === void 0) { mock = false; }
  1200. this.value = value;
  1201. this.shallow = shallow;
  1202. this.mock = mock;
  1203. // this.value = value
  1204. this.dep = mock ? mockDep : new Dep();
  1205. this.vmCount = 0;
  1206. def(value, '__ob__', this);
  1207. if (isArray(value)) {
  1208. if (!mock) {
  1209. if (hasProto) {
  1210. value.__proto__ = arrayMethods;
  1211. /* eslint-enable no-proto */
  1212. }
  1213. else {
  1214. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  1215. var key = arrayKeys[i];
  1216. def(value, key, arrayMethods[key]);
  1217. }
  1218. }
  1219. }
  1220. if (!shallow) {
  1221. this.observeArray(value);
  1222. }
  1223. }
  1224. else {
  1225. /**
  1226. * Walk through all properties and convert them into
  1227. * getter/setters. This method should only be called when
  1228. * value type is Object.
  1229. */
  1230. var keys = Object.keys(value);
  1231. for (var i = 0; i < keys.length; i++) {
  1232. var key = keys[i];
  1233. defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
  1234. }
  1235. }
  1236. }
  1237. /**
  1238. * Observe a list of Array items.
  1239. */
  1240. Observer.prototype.observeArray = function (value) {
  1241. for (var i = 0, l = value.length; i < l; i++) {
  1242. observe(value[i], false, this.mock);
  1243. }
  1244. };
  1245. return Observer;
  1246. }());
  1247. // helpers
  1248. /**
  1249. * Attempt to create an observer instance for a value,
  1250. * returns the new observer if successfully observed,
  1251. * or the existing observer if the value already has one.
  1252. */
  1253. function observe(value, shallow, ssrMockReactivity) {
  1254. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  1255. return value.__ob__;
  1256. }
  1257. if (shouldObserve &&
  1258. (ssrMockReactivity || !isServerRendering()) &&
  1259. (isArray(value) || isPlainObject(value)) &&
  1260. Object.isExtensible(value) &&
  1261. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  1262. !isRef(value) &&
  1263. !(value instanceof VNode)) {
  1264. return new Observer(value, shallow, ssrMockReactivity);
  1265. }
  1266. }
  1267. /**
  1268. * Define a reactive property on an Object.
  1269. */
  1270. function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow) {
  1271. if (observeEvenIfShallow === void 0) { observeEvenIfShallow = false; }
  1272. var dep = new Dep();
  1273. var property = Object.getOwnPropertyDescriptor(obj, key);
  1274. if (property && property.configurable === false) {
  1275. return;
  1276. }
  1277. // cater for pre-defined getter/setters
  1278. var getter = property && property.get;
  1279. var setter = property && property.set;
  1280. if ((!getter || setter) &&
  1281. (val === NO_INITIAL_VALUE || arguments.length === 2)) {
  1282. val = obj[key];
  1283. }
  1284. var childOb = shallow ? val && val.__ob__ : observe(val, false, mock);
  1285. Object.defineProperty(obj, key, {
  1286. enumerable: true,
  1287. configurable: true,
  1288. get: function reactiveGetter() {
  1289. var value = getter ? getter.call(obj) : val;
  1290. if (Dep.target) {
  1291. {
  1292. dep.depend({
  1293. target: obj,
  1294. type: "get" /* TrackOpTypes.GET */,
  1295. key: key
  1296. });
  1297. }
  1298. if (childOb) {
  1299. childOb.dep.depend();
  1300. if (isArray(value)) {
  1301. dependArray(value);
  1302. }
  1303. }
  1304. }
  1305. return isRef(value) && !shallow ? value.value : value;
  1306. },
  1307. set: function reactiveSetter(newVal) {
  1308. var value = getter ? getter.call(obj) : val;
  1309. if (!hasChanged(value, newVal)) {
  1310. return;
  1311. }
  1312. if (customSetter) {
  1313. customSetter();
  1314. }
  1315. if (setter) {
  1316. setter.call(obj, newVal);
  1317. }
  1318. else if (getter) {
  1319. // #7981: for accessor properties without setter
  1320. return;
  1321. }
  1322. else if (!shallow && isRef(value) && !isRef(newVal)) {
  1323. value.value = newVal;
  1324. return;
  1325. }
  1326. else {
  1327. val = newVal;
  1328. }
  1329. childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);
  1330. {
  1331. dep.notify({
  1332. type: "set" /* TriggerOpTypes.SET */,
  1333. target: obj,
  1334. key: key,
  1335. newValue: newVal,
  1336. oldValue: value
  1337. });
  1338. }
  1339. }
  1340. });
  1341. return dep;
  1342. }
  1343. function set(target, key, val) {
  1344. if ((isUndef(target) || isPrimitive(target))) {
  1345. warn$2("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  1346. }
  1347. if (isReadonly(target)) {
  1348. warn$2("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1349. return;
  1350. }
  1351. var ob = target.__ob__;
  1352. if (isArray(target) && isValidArrayIndex(key)) {
  1353. target.length = Math.max(target.length, key);
  1354. target.splice(key, 1, val);
  1355. // when mocking for SSR, array methods are not hijacked
  1356. if (ob && !ob.shallow && ob.mock) {
  1357. observe(val, false, true);
  1358. }
  1359. return val;
  1360. }
  1361. if (key in target && !(key in Object.prototype)) {
  1362. target[key] = val;
  1363. return val;
  1364. }
  1365. if (target._isVue || (ob && ob.vmCount)) {
  1366. warn$2('Avoid adding reactive properties to a Vue instance or its root $data ' +
  1367. 'at runtime - declare it upfront in the data option.');
  1368. return val;
  1369. }
  1370. if (!ob) {
  1371. target[key] = val;
  1372. return val;
  1373. }
  1374. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  1375. {
  1376. ob.dep.notify({
  1377. type: "add" /* TriggerOpTypes.ADD */,
  1378. target: target,
  1379. key: key,
  1380. newValue: val,
  1381. oldValue: undefined
  1382. });
  1383. }
  1384. return val;
  1385. }
  1386. /**
  1387. * Collect dependencies on array elements when the array is touched, since
  1388. * we cannot intercept array element access like property getters.
  1389. */
  1390. function dependArray(value) {
  1391. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  1392. e = value[i];
  1393. if (e && e.__ob__) {
  1394. e.__ob__.dep.depend();
  1395. }
  1396. if (isArray(e)) {
  1397. dependArray(e);
  1398. }
  1399. }
  1400. }
  1401. function isReadonly(value) {
  1402. return !!(value && value.__v_isReadonly);
  1403. }
  1404. function isRef(r) {
  1405. return !!(r && r.__v_isRef === true);
  1406. }
  1407. {
  1408. var perf_1 = inBrowser && window.performance;
  1409. /* istanbul ignore if */
  1410. if (perf_1 &&
  1411. // @ts-ignore
  1412. perf_1.mark &&
  1413. // @ts-ignore
  1414. perf_1.measure &&
  1415. // @ts-ignore
  1416. perf_1.clearMarks &&
  1417. // @ts-ignore
  1418. perf_1.clearMeasures) ;
  1419. }
  1420. var normalizeEvent = cached(function (name) {
  1421. var passive = name.charAt(0) === '&';
  1422. name = passive ? name.slice(1) : name;
  1423. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  1424. name = once ? name.slice(1) : name;
  1425. var capture = name.charAt(0) === '!';
  1426. name = capture ? name.slice(1) : name;
  1427. return {
  1428. name: name,
  1429. once: once,
  1430. capture: capture,
  1431. passive: passive
  1432. };
  1433. });
  1434. function createFnInvoker(fns, vm) {
  1435. function invoker() {
  1436. var fns = invoker.fns;
  1437. if (isArray(fns)) {
  1438. var cloned = fns.slice();
  1439. for (var i = 0; i < cloned.length; i++) {
  1440. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  1441. }
  1442. }
  1443. else {
  1444. // return handler return value for single handlers
  1445. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  1446. }
  1447. }
  1448. invoker.fns = fns;
  1449. return invoker;
  1450. }
  1451. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  1452. var name, cur, old, event;
  1453. for (name in on) {
  1454. cur = on[name];
  1455. old = oldOn[name];
  1456. event = normalizeEvent(name);
  1457. if (isUndef(cur)) {
  1458. warn$2("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
  1459. }
  1460. else if (isUndef(old)) {
  1461. if (isUndef(cur.fns)) {
  1462. cur = on[name] = createFnInvoker(cur, vm);
  1463. }
  1464. if (isTrue(event.once)) {
  1465. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  1466. }
  1467. add(event.name, cur, event.capture, event.passive, event.params);
  1468. }
  1469. else if (cur !== old) {
  1470. old.fns = cur;
  1471. on[name] = old;
  1472. }
  1473. }
  1474. for (name in oldOn) {
  1475. if (isUndef(on[name])) {
  1476. event = normalizeEvent(name);
  1477. remove(event.name, oldOn[name], event.capture);
  1478. }
  1479. }
  1480. }
  1481. function extractPropsFromVNodeData(data, Ctor, tag) {
  1482. // we are only extracting raw values here.
  1483. // validation and default values are handled in the child
  1484. // component itself.
  1485. var propOptions = Ctor.options.props;
  1486. if (isUndef(propOptions)) {
  1487. return;
  1488. }
  1489. var res = {};
  1490. var attrs = data.attrs, props = data.props;
  1491. if (isDef(attrs) || isDef(props)) {
  1492. for (var key in propOptions) {
  1493. var altKey = hyphenate(key);
  1494. {
  1495. var keyInLowerCase = key.toLowerCase();
  1496. if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
  1497. tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
  1498. "".concat(formatComponentName(
  1499. // @ts-expect-error tag is string
  1500. tag || Ctor), ", but the declared prop name is") +
  1501. " \"".concat(key, "\". ") +
  1502. "Note that HTML attributes are case-insensitive and camelCased " +
  1503. "props need to use their kebab-case equivalents when using in-DOM " +
  1504. "templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
  1505. }
  1506. }
  1507. checkProp(res, props, key, altKey, true) ||
  1508. checkProp(res, attrs, key, altKey, false);
  1509. }
  1510. }
  1511. return res;
  1512. }
  1513. function checkProp(res, hash, key, altKey, preserve) {
  1514. if (isDef(hash)) {
  1515. if (hasOwn(hash, key)) {
  1516. res[key] = hash[key];
  1517. if (!preserve) {
  1518. delete hash[key];
  1519. }
  1520. return true;
  1521. }
  1522. else if (hasOwn(hash, altKey)) {
  1523. res[key] = hash[altKey];
  1524. if (!preserve) {
  1525. delete hash[altKey];
  1526. }
  1527. return true;
  1528. }
  1529. }
  1530. return false;
  1531. }
  1532. // The template compiler attempts to minimize the need for normalization by
  1533. // statically analyzing the template at compile time.
  1534. //
  1535. // For plain HTML markup, normalization can be completely skipped because the
  1536. // generated render function is guaranteed to return Array<VNode>. There are
  1537. // two cases where extra normalization is needed:
  1538. // 1. When the children contains components - because a functional component
  1539. // may return an Array instead of a single root. In this case, just a simple
  1540. // normalization is needed - if any child is an Array, we flatten the whole
  1541. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  1542. // because functional components already normalize their own children.
  1543. function simpleNormalizeChildren(children) {
  1544. for (var i = 0; i < children.length; i++) {
  1545. if (isArray(children[i])) {
  1546. return Array.prototype.concat.apply([], children);
  1547. }
  1548. }
  1549. return children;
  1550. }
  1551. // 2. When the children contains constructs that always generated nested Arrays,
  1552. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  1553. // with hand-written render functions / JSX. In such cases a full normalization
  1554. // is needed to cater to all possible types of children values.
  1555. function normalizeChildren(children) {
  1556. return isPrimitive(children)
  1557. ? [createTextVNode(children)]
  1558. : isArray(children)
  1559. ? normalizeArrayChildren(children)
  1560. : undefined;
  1561. }
  1562. function isTextNode(node) {
  1563. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  1564. }
  1565. function normalizeArrayChildren(children, nestedIndex) {
  1566. var res = [];
  1567. var i, c, lastIndex, last;
  1568. for (i = 0; i < children.length; i++) {
  1569. c = children[i];
  1570. if (isUndef(c) || typeof c === 'boolean')
  1571. continue;
  1572. lastIndex = res.length - 1;
  1573. last = res[lastIndex];
  1574. // nested
  1575. if (isArray(c)) {
  1576. if (c.length > 0) {
  1577. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  1578. // merge adjacent text nodes
  1579. if (isTextNode(c[0]) && isTextNode(last)) {
  1580. res[lastIndex] = createTextVNode(last.text + c[0].text);
  1581. c.shift();
  1582. }
  1583. res.push.apply(res, c);
  1584. }
  1585. }
  1586. else if (isPrimitive(c)) {
  1587. if (isTextNode(last)) {
  1588. // merge adjacent text nodes
  1589. // this is necessary for SSR hydration because text nodes are
  1590. // essentially merged when rendered to HTML strings
  1591. res[lastIndex] = createTextVNode(last.text + c);
  1592. }
  1593. else if (c !== '') {
  1594. // convert primitive to vnode
  1595. res.push(createTextVNode(c));
  1596. }
  1597. }
  1598. else {
  1599. if (isTextNode(c) && isTextNode(last)) {
  1600. // merge adjacent text nodes
  1601. res[lastIndex] = createTextVNode(last.text + c.text);
  1602. }
  1603. else {
  1604. // default key for nested array children (likely generated by v-for)
  1605. if (isTrue(children._isVList) &&
  1606. isDef(c.tag) &&
  1607. isUndef(c.key) &&
  1608. isDef(nestedIndex)) {
  1609. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  1610. }
  1611. res.push(c);
  1612. }
  1613. }
  1614. }
  1615. return res;
  1616. }
  1617. var SIMPLE_NORMALIZE = 1;
  1618. var ALWAYS_NORMALIZE = 2;
  1619. // wrapper function for providing a more flexible interface
  1620. // without getting yelled at by flow
  1621. function createElement(context, tag, data, children, normalizationType, alwaysNormalize) {
  1622. if (isArray(data) || isPrimitive(data)) {
  1623. normalizationType = children;
  1624. children = data;
  1625. data = undefined;
  1626. }
  1627. if (isTrue(alwaysNormalize)) {
  1628. normalizationType = ALWAYS_NORMALIZE;
  1629. }
  1630. return _createElement(context, tag, data, children, normalizationType);
  1631. }
  1632. function _createElement(context, tag, data, children, normalizationType) {
  1633. if (isDef(data) && isDef(data.__ob__)) {
  1634. warn$2("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
  1635. return createEmptyVNode();
  1636. }
  1637. // object syntax in v-bind
  1638. if (isDef(data) && isDef(data.is)) {
  1639. tag = data.is;
  1640. }
  1641. if (!tag) {
  1642. // in case of component :is set to falsy value
  1643. return createEmptyVNode();
  1644. }
  1645. // warn against non-primitive key
  1646. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
  1647. warn$2('Avoid using non-primitive value as key, ' +
  1648. 'use string/number value instead.', context);
  1649. }
  1650. // support single function children as default scoped slot
  1651. if (isArray(children) && isFunction(children[0])) {
  1652. data = data || {};
  1653. data.scopedSlots = { default: children[0] };
  1654. children.length = 0;
  1655. }
  1656. if (normalizationType === ALWAYS_NORMALIZE) {
  1657. children = normalizeChildren(children);
  1658. }
  1659. else if (normalizationType === SIMPLE_NORMALIZE) {
  1660. children = simpleNormalizeChildren(children);
  1661. }
  1662. var vnode, ns;
  1663. if (typeof tag === 'string') {
  1664. var Ctor = void 0;
  1665. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  1666. if ((!data || !data.pre) &&
  1667. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  1668. // component
  1669. vnode = createComponent(Ctor, data, context, children, tag);
  1670. }
  1671. else {
  1672. // unknown or unlisted namespaced elements
  1673. // check at runtime because it may get assigned a namespace when its
  1674. // parent normalizes children
  1675. vnode = new VNode(tag, data, children, undefined, undefined, context);
  1676. }
  1677. }
  1678. else {
  1679. // direct component options / constructor
  1680. vnode = createComponent(tag, data, context, children);
  1681. }
  1682. if (isArray(vnode)) {
  1683. return vnode;
  1684. }
  1685. else if (isDef(vnode)) {
  1686. if (isDef(ns))
  1687. applyNS(vnode, ns);
  1688. if (isDef(data))
  1689. registerDeepBindings(data);
  1690. return vnode;
  1691. }
  1692. else {
  1693. return createEmptyVNode();
  1694. }
  1695. }
  1696. function applyNS(vnode, ns, force) {
  1697. vnode.ns = ns;
  1698. if (vnode.tag === 'foreignObject') {
  1699. // use default namespace inside foreignObject
  1700. ns = undefined;
  1701. force = true;
  1702. }
  1703. if (isDef(vnode.children)) {
  1704. for (var i = 0, l = vnode.children.length; i < l; i++) {
  1705. var child = vnode.children[i];
  1706. if (isDef(child.tag) &&
  1707. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  1708. applyNS(child, ns, force);
  1709. }
  1710. }
  1711. }
  1712. }
  1713. // ref #5318
  1714. // necessary to ensure parent re-render when deep bindings like :style and
  1715. // :class are used on slot nodes
  1716. function registerDeepBindings(data) {
  1717. if (isObject(data.style)) {
  1718. traverse(data.style);
  1719. }
  1720. if (isObject(data.class)) {
  1721. traverse(data.class);
  1722. }
  1723. }
  1724. /**
  1725. * Runtime helper for rendering v-for lists.
  1726. */
  1727. function renderList(val, render) {
  1728. var ret = null, i, l, keys, key;
  1729. if (isArray(val) || typeof val === 'string') {
  1730. ret = new Array(val.length);
  1731. for (i = 0, l = val.length; i < l; i++) {
  1732. ret[i] = render(val[i], i);
  1733. }
  1734. }
  1735. else if (typeof val === 'number') {
  1736. ret = new Array(val);
  1737. for (i = 0; i < val; i++) {
  1738. ret[i] = render(i + 1, i);
  1739. }
  1740. }
  1741. else if (isObject(val)) {
  1742. if (hasSymbol && val[Symbol.iterator]) {
  1743. ret = [];
  1744. var iterator = val[Symbol.iterator]();
  1745. var result = iterator.next();
  1746. while (!result.done) {
  1747. ret.push(render(result.value, ret.length));
  1748. result = iterator.next();
  1749. }
  1750. }
  1751. else {
  1752. keys = Object.keys(val);
  1753. ret = new Array(keys.length);
  1754. for (i = 0, l = keys.length; i < l; i++) {
  1755. key = keys[i];
  1756. ret[i] = render(val[key], key, i);
  1757. }
  1758. }
  1759. }
  1760. if (!isDef(ret)) {
  1761. ret = [];
  1762. }
  1763. ret._isVList = true;
  1764. return ret;
  1765. }
  1766. /**
  1767. * Runtime helper for rendering <slot>
  1768. */
  1769. function renderSlot(name, fallbackRender, props, bindObject) {
  1770. var scopedSlotFn = this.$scopedSlots[name];
  1771. var nodes;
  1772. if (scopedSlotFn) {
  1773. // scoped slot
  1774. props = props || {};
  1775. if (bindObject) {
  1776. if (!isObject(bindObject)) {
  1777. warn$2('slot v-bind without argument expects an Object', this);
  1778. }
  1779. props = extend(extend({}, bindObject), props);
  1780. }
  1781. nodes =
  1782. scopedSlotFn(props) ||
  1783. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  1784. }
  1785. else {
  1786. nodes =
  1787. this.$slots[name] ||
  1788. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  1789. }
  1790. var target = props && props.slot;
  1791. if (target) {
  1792. return this.$createElement('template', { slot: target }, nodes);
  1793. }
  1794. else {
  1795. return nodes;
  1796. }
  1797. }
  1798. /**
  1799. * Runtime helper for resolving filters
  1800. */
  1801. function resolveFilter(id) {
  1802. return resolveAsset(this.$options, 'filters', id, true) || identity;
  1803. }
  1804. function isKeyNotMatch(expect, actual) {
  1805. if (isArray(expect)) {
  1806. return expect.indexOf(actual) === -1;
  1807. }
  1808. else {
  1809. return expect !== actual;
  1810. }
  1811. }
  1812. /**
  1813. * Runtime helper for checking keyCodes from config.
  1814. * exposed as Vue.prototype._k
  1815. * passing in eventKeyName as last argument separately for backwards compat
  1816. */
  1817. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  1818. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  1819. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  1820. return isKeyNotMatch(builtInKeyName, eventKeyName);
  1821. }
  1822. else if (mappedKeyCode) {
  1823. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  1824. }
  1825. else if (eventKeyName) {
  1826. return hyphenate(eventKeyName) !== key;
  1827. }
  1828. return eventKeyCode === undefined;
  1829. }
  1830. /**
  1831. * Runtime helper for merging v-bind="object" into a VNode's data.
  1832. */
  1833. function bindObjectProps(data, tag, value, asProp, isSync) {
  1834. if (value) {
  1835. if (!isObject(value)) {
  1836. warn$2('v-bind without argument expects an Object or Array value', this);
  1837. }
  1838. else {
  1839. if (isArray(value)) {
  1840. value = toObject(value);
  1841. }
  1842. var hash = void 0;
  1843. var _loop_1 = function (key) {
  1844. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  1845. hash = data;
  1846. }
  1847. else {
  1848. var type = data.attrs && data.attrs.type;
  1849. hash =
  1850. asProp || config.mustUseProp(tag, type, key)
  1851. ? data.domProps || (data.domProps = {})
  1852. : data.attrs || (data.attrs = {});
  1853. }
  1854. var camelizedKey = camelize(key);
  1855. var hyphenatedKey = hyphenate(key);
  1856. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  1857. hash[key] = value[key];
  1858. if (isSync) {
  1859. var on = data.on || (data.on = {});
  1860. on["update:".concat(key)] = function ($event) {
  1861. value[key] = $event;
  1862. };
  1863. }
  1864. }
  1865. };
  1866. for (var key in value) {
  1867. _loop_1(key);
  1868. }
  1869. }
  1870. }
  1871. return data;
  1872. }
  1873. /**
  1874. * Runtime helper for rendering static trees.
  1875. */
  1876. function renderStatic(index, isInFor) {
  1877. var cached = this._staticTrees || (this._staticTrees = []);
  1878. var tree = cached[index];
  1879. // if has already-rendered static tree and not inside v-for,
  1880. // we can reuse the same tree.
  1881. if (tree && !isInFor) {
  1882. return tree;
  1883. }
  1884. // otherwise, render a fresh tree.
  1885. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  1886. );
  1887. markStatic$1(tree, "__static__".concat(index), false);
  1888. return tree;
  1889. }
  1890. /**
  1891. * Runtime helper for v-once.
  1892. * Effectively it means marking the node as static with a unique key.
  1893. */
  1894. function markOnce(tree, index, key) {
  1895. markStatic$1(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  1896. return tree;
  1897. }
  1898. function markStatic$1(tree, key, isOnce) {
  1899. if (isArray(tree)) {
  1900. for (var i = 0; i < tree.length; i++) {
  1901. if (tree[i] && typeof tree[i] !== 'string') {
  1902. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  1903. }
  1904. }
  1905. }
  1906. else {
  1907. markStaticNode(tree, key, isOnce);
  1908. }
  1909. }
  1910. function markStaticNode(node, key, isOnce) {
  1911. node.isStatic = true;
  1912. node.key = key;
  1913. node.isOnce = isOnce;
  1914. }
  1915. function bindObjectListeners(data, value) {
  1916. if (value) {
  1917. if (!isPlainObject(value)) {
  1918. warn$2('v-on without argument expects an Object value', this);
  1919. }
  1920. else {
  1921. var on = (data.on = data.on ? extend({}, data.on) : {});
  1922. for (var key in value) {
  1923. var existing = on[key];
  1924. var ours = value[key];
  1925. on[key] = existing ? [].concat(existing, ours) : ours;
  1926. }
  1927. }
  1928. }
  1929. return data;
  1930. }
  1931. function resolveScopedSlots(fns, res,
  1932. // the following are added in 2.6
  1933. hasDynamicKeys, contentHashKey) {
  1934. res = res || { $stable: !hasDynamicKeys };
  1935. for (var i = 0; i < fns.length; i++) {
  1936. var slot = fns[i];
  1937. if (isArray(slot)) {
  1938. resolveScopedSlots(slot, res, hasDynamicKeys);
  1939. }
  1940. else if (slot) {
  1941. // marker for reverse proxying v-slot without scope on this.$slots
  1942. // @ts-expect-error
  1943. if (slot.proxy) {
  1944. // @ts-expect-error
  1945. slot.fn.proxy = true;
  1946. }
  1947. res[slot.key] = slot.fn;
  1948. }
  1949. }
  1950. if (contentHashKey) {
  1951. res.$key = contentHashKey;
  1952. }
  1953. return res;
  1954. }
  1955. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  1956. function bindDynamicKeys(baseObj, values) {
  1957. for (var i = 0; i < values.length; i += 2) {
  1958. var key = values[i];
  1959. if (typeof key === 'string' && key) {
  1960. baseObj[values[i]] = values[i + 1];
  1961. }
  1962. else if (key !== '' && key !== null) {
  1963. // null is a special value for explicitly removing a binding
  1964. warn$2("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
  1965. }
  1966. }
  1967. return baseObj;
  1968. }
  1969. // helper to dynamically append modifier runtime markers to event names.
  1970. // ensure only append when value is already string, otherwise it will be cast
  1971. // to string and cause the type check to miss.
  1972. function prependModifier(value, symbol) {
  1973. return typeof value === 'string' ? symbol + value : value;
  1974. }
  1975. function installRenderHelpers(target) {
  1976. target._o = markOnce;
  1977. target._n = toNumber;
  1978. target._s = toString;
  1979. target._l = renderList;
  1980. target._t = renderSlot;
  1981. target._q = looseEqual;
  1982. target._i = looseIndexOf;
  1983. target._m = renderStatic;
  1984. target._f = resolveFilter;
  1985. target._k = checkKeyCodes;
  1986. target._b = bindObjectProps;
  1987. target._v = createTextVNode;
  1988. target._e = createEmptyVNode;
  1989. target._u = resolveScopedSlots;
  1990. target._g = bindObjectListeners;
  1991. target._d = bindDynamicKeys;
  1992. target._p = prependModifier;
  1993. }
  1994. /**
  1995. * Runtime helper for resolving raw children VNodes into a slot object.
  1996. */
  1997. function resolveSlots(children, context) {
  1998. if (!children || !children.length) {
  1999. return {};
  2000. }
  2001. var slots = {};
  2002. for (var i = 0, l = children.length; i < l; i++) {
  2003. var child = children[i];
  2004. var data = child.data;
  2005. // remove slot attribute if the node is resolved as a Vue slot node
  2006. if (data && data.attrs && data.attrs.slot) {
  2007. delete data.attrs.slot;
  2008. }
  2009. // named slots should only be respected if the vnode was rendered in the
  2010. // same context.
  2011. if ((child.context === context || child.fnContext === context) &&
  2012. data &&
  2013. data.slot != null) {
  2014. var name_1 = data.slot;
  2015. var slot = slots[name_1] || (slots[name_1] = []);
  2016. if (child.tag === 'template') {
  2017. slot.push.apply(slot, child.children || []);
  2018. }
  2019. else {
  2020. slot.push(child);
  2021. }
  2022. }
  2023. else {
  2024. (slots.default || (slots.default = [])).push(child);
  2025. }
  2026. }
  2027. // ignore slots that contains only whitespace
  2028. for (var name_2 in slots) {
  2029. if (slots[name_2].every(isWhitespace)) {
  2030. delete slots[name_2];
  2031. }
  2032. }
  2033. return slots;
  2034. }
  2035. function isWhitespace(node) {
  2036. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  2037. }
  2038. function isAsyncPlaceholder(node) {
  2039. // @ts-expect-error not really boolean type
  2040. return node.isComment && node.asyncFactory;
  2041. }
  2042. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  2043. var res;
  2044. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  2045. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  2046. var key = scopedSlots && scopedSlots.$key;
  2047. if (!scopedSlots) {
  2048. res = {};
  2049. }
  2050. else if (scopedSlots._normalized) {
  2051. // fast path 1: child component re-render only, parent did not change
  2052. return scopedSlots._normalized;
  2053. }
  2054. else if (isStable &&
  2055. prevScopedSlots &&
  2056. prevScopedSlots !== emptyObject &&
  2057. key === prevScopedSlots.$key &&
  2058. !hasNormalSlots &&
  2059. !prevScopedSlots.$hasNormal) {
  2060. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  2061. // only need to normalize once
  2062. return prevScopedSlots;
  2063. }
  2064. else {
  2065. res = {};
  2066. for (var key_1 in scopedSlots) {
  2067. if (scopedSlots[key_1] && key_1[0] !== '$') {
  2068. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  2069. }
  2070. }
  2071. }
  2072. // expose normal slots on scopedSlots
  2073. for (var key_2 in normalSlots) {
  2074. if (!(key_2 in res)) {
  2075. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  2076. }
  2077. }
  2078. // avoriaz seems to mock a non-extensible $scopedSlots object
  2079. // and when that is passed down this would cause an error
  2080. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  2081. scopedSlots._normalized = res;
  2082. }
  2083. def(res, '$stable', isStable);
  2084. def(res, '$key', key);
  2085. def(res, '$hasNormal', hasNormalSlots);
  2086. return res;
  2087. }
  2088. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  2089. var normalized = function () {
  2090. var cur = currentInstance;
  2091. setCurrentInstance(vm);
  2092. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  2093. res =
  2094. res && typeof res === 'object' && !isArray(res)
  2095. ? [res] // single vnode
  2096. : normalizeChildren(res);
  2097. var vnode = res && res[0];
  2098. setCurrentInstance(cur);
  2099. return res &&
  2100. (!vnode ||
  2101. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  2102. ? undefined
  2103. : res;
  2104. };
  2105. // this is a slot using the new v-slot syntax without scope. although it is
  2106. // compiled as a scoped slot, render fn users would expect it to be present
  2107. // on this.$slots because the usage is semantically a normal slot.
  2108. if (fn.proxy) {
  2109. Object.defineProperty(normalSlots, key, {
  2110. get: normalized,
  2111. enumerable: true,
  2112. configurable: true
  2113. });
  2114. }
  2115. return normalized;
  2116. }
  2117. function proxyNormalSlot(slots, key) {
  2118. return function () { return slots[key]; };
  2119. }
  2120. function syncSetupProxy(to, from, prev, instance, type) {
  2121. var changed = false;
  2122. for (var key in from) {
  2123. if (!(key in to)) {
  2124. changed = true;
  2125. defineProxyAttr(to, key, instance, type);
  2126. }
  2127. else if (from[key] !== prev[key]) {
  2128. changed = true;
  2129. }
  2130. }
  2131. for (var key in to) {
  2132. if (!(key in from)) {
  2133. changed = true;
  2134. delete to[key];
  2135. }
  2136. }
  2137. return changed;
  2138. }
  2139. function defineProxyAttr(proxy, key, instance, type) {
  2140. Object.defineProperty(proxy, key, {
  2141. enumerable: true,
  2142. configurable: true,
  2143. get: function () {
  2144. return instance[type][key];
  2145. }
  2146. });
  2147. }
  2148. function createAsyncPlaceholder(factory, data, context, children, tag) {
  2149. var node = createEmptyVNode();
  2150. node.asyncFactory = factory;
  2151. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  2152. return node;
  2153. }
  2154. function resolveAsyncComponent(factory, baseCtor) {
  2155. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  2156. return factory.errorComp;
  2157. }
  2158. if (isDef(factory.resolved)) {
  2159. return factory.resolved;
  2160. }
  2161. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  2162. return factory.loadingComp;
  2163. }
  2164. }
  2165. var target;
  2166. function add(event, fn) {
  2167. target.$on(event, fn);
  2168. }
  2169. function remove(event, fn) {
  2170. target.$off(event, fn);
  2171. }
  2172. function createOnceHandler(event, fn) {
  2173. var _target = target;
  2174. return function onceHandler() {
  2175. var res = fn.apply(null, arguments);
  2176. if (res !== null) {
  2177. _target.$off(event, onceHandler);
  2178. }
  2179. };
  2180. }
  2181. function updateComponentListeners(vm, listeners, oldListeners) {
  2182. target = vm;
  2183. updateListeners(listeners, oldListeners || {}, add, remove, createOnceHandler, vm);
  2184. target = undefined;
  2185. }
  2186. var activeInstance = null;
  2187. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  2188. // determine whether component has slot children
  2189. // we need to do this before overwriting $options._renderChildren.
  2190. // check if there are dynamic scopedSlots (hand-written or compiled but with
  2191. // dynamic slot names). Static scoped slots compiled from template has the
  2192. // "$stable" marker.
  2193. var newScopedSlots = parentVnode.data.scopedSlots;
  2194. var oldScopedSlots = vm.$scopedSlots;
  2195. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  2196. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  2197. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  2198. (!newScopedSlots && vm.$scopedSlots.$key));
  2199. // Any static slot children from the parent may have changed during parent's
  2200. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  2201. // update is necessary to ensure correctness.
  2202. var needsForceUpdate = !!(renderChildren || // has new static slots
  2203. vm.$options._renderChildren || // has old static slots
  2204. hasDynamicScopedSlot);
  2205. var prevVNode = vm.$vnode;
  2206. vm.$options._parentVnode = parentVnode;
  2207. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  2208. if (vm._vnode) {
  2209. // update child tree's parent
  2210. vm._vnode.parent = parentVnode;
  2211. }
  2212. vm.$options._renderChildren = renderChildren;
  2213. // update $attrs and $listeners hash
  2214. // these are also reactive so they may trigger child update if the child
  2215. // used them during render
  2216. var attrs = parentVnode.data.attrs || emptyObject;
  2217. if (vm._attrsProxy) {
  2218. // force update if attrs are accessed and has changed since it may be
  2219. // passed to a child component.
  2220. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  2221. needsForceUpdate = true;
  2222. }
  2223. }
  2224. vm.$attrs = attrs;
  2225. // update listeners
  2226. listeners = listeners || emptyObject;
  2227. var prevListeners = vm.$options._parentListeners;
  2228. if (vm._listenersProxy) {
  2229. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  2230. }
  2231. vm.$listeners = vm.$options._parentListeners = listeners;
  2232. updateComponentListeners(vm, listeners, prevListeners);
  2233. // update props
  2234. if (propsData && vm.$options.props) {
  2235. toggleObserving(false);
  2236. var props = vm._props;
  2237. var propKeys = vm.$options._propKeys || [];
  2238. for (var i = 0; i < propKeys.length; i++) {
  2239. var key = propKeys[i];
  2240. var propOptions = vm.$options.props; // wtf flow?
  2241. props[key] = validateProp(key, propOptions, propsData, vm);
  2242. }
  2243. toggleObserving(true);
  2244. // keep a copy of raw propsData
  2245. vm.$options.propsData = propsData;
  2246. }
  2247. // resolve slots + force update if has children
  2248. if (needsForceUpdate) {
  2249. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  2250. vm.$forceUpdate();
  2251. }
  2252. }
  2253. function isInInactiveTree(vm) {
  2254. while (vm && (vm = vm.$parent)) {
  2255. if (vm._inactive)
  2256. return true;
  2257. }
  2258. return false;
  2259. }
  2260. function activateChildComponent(vm, direct) {
  2261. if (direct) {
  2262. vm._directInactive = false;
  2263. if (isInInactiveTree(vm)) {
  2264. return;
  2265. }
  2266. }
  2267. else if (vm._directInactive) {
  2268. return;
  2269. }
  2270. if (vm._inactive || vm._inactive === null) {
  2271. vm._inactive = false;
  2272. for (var i = 0; i < vm.$children.length; i++) {
  2273. activateChildComponent(vm.$children[i]);
  2274. }
  2275. callHook(vm, 'activated');
  2276. }
  2277. }
  2278. function deactivateChildComponent(vm, direct) {
  2279. if (direct) {
  2280. vm._directInactive = true;
  2281. if (isInInactiveTree(vm)) {
  2282. return;
  2283. }
  2284. }
  2285. if (!vm._inactive) {
  2286. vm._inactive = true;
  2287. for (var i = 0; i < vm.$children.length; i++) {
  2288. deactivateChildComponent(vm.$children[i]);
  2289. }
  2290. callHook(vm, 'deactivated');
  2291. }
  2292. }
  2293. function callHook(vm, hook, args, setContext) {
  2294. if (setContext === void 0) { setContext = true; }
  2295. // #7573 disable dep collection when invoking lifecycle hooks
  2296. pushTarget();
  2297. var prevInst = currentInstance;
  2298. setContext && setCurrentInstance(vm);
  2299. var handlers = vm.$options[hook];
  2300. var info = "".concat(hook, " hook");
  2301. if (handlers) {
  2302. for (var i = 0, j = handlers.length; i < j; i++) {
  2303. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  2304. }
  2305. }
  2306. if (vm._hasHookEvent) {
  2307. vm.$emit('hook:' + hook);
  2308. }
  2309. if (setContext) {
  2310. setCurrentInstance(prevInst);
  2311. }
  2312. popTarget();
  2313. }
  2314. // Async edge case fix requires storing an event listener's attach timestamp.
  2315. var getNow = Date.now;
  2316. // Determine what event timestamp the browser is using. Annoyingly, the
  2317. // timestamp can either be hi-res (relative to page load) or low-res
  2318. // (relative to UNIX epoch), so in order to compare time we have to use the
  2319. // same timestamp type when saving the flush timestamp.
  2320. // All IE versions use low-res event timestamps, and have problematic clock
  2321. // implementations (#9632)
  2322. if (inBrowser && !isIE) {
  2323. var performance_1 = window.performance;
  2324. if (performance_1 &&
  2325. typeof performance_1.now === 'function' &&
  2326. getNow() > document.createEvent('Event').timeStamp) {
  2327. // if the event timestamp, although evaluated AFTER the Date.now(), is
  2328. // smaller than it, it means the event is using a hi-res timestamp,
  2329. // and we need to use the hi-res version for event listener timestamps as
  2330. // well.
  2331. getNow = function () { return performance_1.now(); };
  2332. }
  2333. }
  2334. /**
  2335. * Queue a kept-alive component that was activated during patch.
  2336. * The queue will be processed after the entire tree has been patched.
  2337. */
  2338. function queueActivatedComponent(vm) {
  2339. // setting _inactive to false here so that a render function can
  2340. // rely on checking whether it's in an inactive tree (e.g. router-view)
  2341. vm._inactive = false;
  2342. }
  2343. function handleError(err, vm, info) {
  2344. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2345. // See: https://github.com/vuejs/vuex/issues/1505
  2346. pushTarget();
  2347. try {
  2348. if (vm) {
  2349. var cur = vm;
  2350. while ((cur = cur.$parent)) {
  2351. var hooks = cur.$options.errorCaptured;
  2352. if (hooks) {
  2353. for (var i = 0; i < hooks.length; i++) {
  2354. try {
  2355. var capture = hooks[i].call(cur, err, vm, info) === false;
  2356. if (capture)
  2357. return;
  2358. }
  2359. catch (e) {
  2360. globalHandleError(e, cur, 'errorCaptured hook');
  2361. }
  2362. }
  2363. }
  2364. }
  2365. }
  2366. globalHandleError(err, vm, info);
  2367. }
  2368. finally {
  2369. popTarget();
  2370. }
  2371. }
  2372. function invokeWithErrorHandling(handler, context, args, vm, info) {
  2373. var res;
  2374. try {
  2375. res = args ? handler.apply(context, args) : handler.call(context);
  2376. if (res && !res._isVue && isPromise(res) && !res._handled) {
  2377. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  2378. res._handled = true;
  2379. }
  2380. }
  2381. catch (e) {
  2382. handleError(e, vm, info);
  2383. }
  2384. return res;
  2385. }
  2386. function globalHandleError(err, vm, info) {
  2387. logError(err, vm, info);
  2388. }
  2389. function logError(err, vm, info) {
  2390. {
  2391. warn$2("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
  2392. }
  2393. /* istanbul ignore else */
  2394. if (inBrowser && typeof console !== 'undefined') {
  2395. console.error(err);
  2396. }
  2397. else {
  2398. throw err;
  2399. }
  2400. }
  2401. /* globals MutationObserver */
  2402. var callbacks = [];
  2403. function flushCallbacks() {
  2404. var copies = callbacks.slice(0);
  2405. callbacks.length = 0;
  2406. for (var i = 0; i < copies.length; i++) {
  2407. copies[i]();
  2408. }
  2409. }
  2410. // The nextTick behavior leverages the microtask queue, which can be accessed
  2411. // via either native Promise.then or MutationObserver.
  2412. // MutationObserver has wider support, however it is seriously bugged in
  2413. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  2414. // completely stops working after triggering a few times... so, if native
  2415. // Promise is available, we will use it:
  2416. /* istanbul ignore next, $flow-disable-line */
  2417. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  2418. Promise.resolve();
  2419. }
  2420. else if (!isIE &&
  2421. typeof MutationObserver !== 'undefined' &&
  2422. (isNative(MutationObserver) ||
  2423. // PhantomJS and iOS 7.x
  2424. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  2425. // Use MutationObserver where native Promise is not available,
  2426. // e.g. PhantomJS, iOS7, Android 4.4
  2427. // (#6466 MutationObserver is unreliable in IE11)
  2428. var counter_1 = 1;
  2429. var observer = new MutationObserver(flushCallbacks);
  2430. var textNode_1 = document.createTextNode(String(counter_1));
  2431. observer.observe(textNode_1, {
  2432. characterData: true
  2433. });
  2434. }
  2435. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) ;
  2436. else ;
  2437. var seenObjects = new _Set();
  2438. /**
  2439. * Recursively traverse an object to evoke all converted
  2440. * getters, so that every nested property inside the object
  2441. * is collected as a "deep" dependency.
  2442. */
  2443. function traverse(val) {
  2444. _traverse(val, seenObjects);
  2445. seenObjects.clear();
  2446. return val;
  2447. }
  2448. function _traverse(val, seen) {
  2449. var i, keys;
  2450. var isA = isArray(val);
  2451. if ((!isA && !isObject(val)) ||
  2452. val.__v_skip /* ReactiveFlags.SKIP */ ||
  2453. Object.isFrozen(val) ||
  2454. val instanceof VNode) {
  2455. return;
  2456. }
  2457. if (val.__ob__) {
  2458. var depId = val.__ob__.dep.id;
  2459. if (seen.has(depId)) {
  2460. return;
  2461. }
  2462. seen.add(depId);
  2463. }
  2464. if (isA) {
  2465. i = val.length;
  2466. while (i--)
  2467. _traverse(val[i], seen);
  2468. }
  2469. else if (isRef(val)) {
  2470. _traverse(val.value, seen);
  2471. }
  2472. else {
  2473. keys = Object.keys(val);
  2474. i = keys.length;
  2475. while (i--)
  2476. _traverse(val[keys[i]], seen);
  2477. }
  2478. }
  2479. function resolveInject(inject, vm) {
  2480. if (inject) {
  2481. // inject is :any because flow is not smart enough to figure out cached
  2482. var result = Object.create(null);
  2483. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  2484. for (var i = 0; i < keys.length; i++) {
  2485. var key = keys[i];
  2486. // #6574 in case the inject object is observed...
  2487. if (key === '__ob__')
  2488. continue;
  2489. var provideKey = inject[key].from;
  2490. if (provideKey in vm._provided) {
  2491. result[key] = vm._provided[provideKey];
  2492. }
  2493. else if ('default' in inject[key]) {
  2494. var provideDefault = inject[key].default;
  2495. result[key] = isFunction(provideDefault)
  2496. ? provideDefault.call(vm)
  2497. : provideDefault;
  2498. }
  2499. else {
  2500. warn$2("Injection \"".concat(key, "\" not found"), vm);
  2501. }
  2502. }
  2503. return result;
  2504. }
  2505. }
  2506. function resolveConstructorOptions(Ctor) {
  2507. var options = Ctor.options;
  2508. if (Ctor.super) {
  2509. var superOptions = resolveConstructorOptions(Ctor.super);
  2510. var cachedSuperOptions = Ctor.superOptions;
  2511. if (superOptions !== cachedSuperOptions) {
  2512. // super option changed,
  2513. // need to resolve new options.
  2514. Ctor.superOptions = superOptions;
  2515. // check if there are any late-modified/attached options (#4976)
  2516. var modifiedOptions = resolveModifiedOptions(Ctor);
  2517. // update base extend options
  2518. if (modifiedOptions) {
  2519. extend(Ctor.extendOptions, modifiedOptions);
  2520. }
  2521. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  2522. if (options.name) {
  2523. options.components[options.name] = Ctor;
  2524. }
  2525. }
  2526. }
  2527. return options;
  2528. }
  2529. function resolveModifiedOptions(Ctor) {
  2530. var modified;
  2531. var latest = Ctor.options;
  2532. var sealed = Ctor.sealedOptions;
  2533. for (var key in latest) {
  2534. if (latest[key] !== sealed[key]) {
  2535. if (!modified)
  2536. modified = {};
  2537. modified[key] = latest[key];
  2538. }
  2539. }
  2540. return modified;
  2541. }
  2542. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  2543. var _this = this;
  2544. var options = Ctor.options;
  2545. // ensure the createElement function in functional components
  2546. // gets a unique context - this is necessary for correct named slot check
  2547. var contextVm;
  2548. if (hasOwn(parent, '_uid')) {
  2549. contextVm = Object.create(parent);
  2550. contextVm._original = parent;
  2551. }
  2552. else {
  2553. // the context vm passed in is a functional context as well.
  2554. // in this case we want to make sure we are able to get a hold to the
  2555. // real context instance.
  2556. contextVm = parent;
  2557. // @ts-ignore
  2558. parent = parent._original;
  2559. }
  2560. var isCompiled = isTrue(options._compiled);
  2561. var needNormalization = !isCompiled;
  2562. this.data = data;
  2563. this.props = props;
  2564. this.children = children;
  2565. this.parent = parent;
  2566. this.listeners = data.on || emptyObject;
  2567. this.injections = resolveInject(options.inject, parent);
  2568. this.slots = function () {
  2569. if (!_this.$slots) {
  2570. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  2571. }
  2572. return _this.$slots;
  2573. };
  2574. Object.defineProperty(this, 'scopedSlots', {
  2575. enumerable: true,
  2576. get: function () {
  2577. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  2578. }
  2579. });
  2580. // support for compiled functional template
  2581. if (isCompiled) {
  2582. // exposing $options for renderStatic()
  2583. this.$options = options;
  2584. // pre-resolve slots for renderSlot()
  2585. this.$slots = this.slots();
  2586. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  2587. }
  2588. if (options._scopeId) {
  2589. this._c = function (a, b, c, d) {
  2590. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  2591. if (vnode && !isArray(vnode)) {
  2592. vnode.fnScopeId = options._scopeId;
  2593. vnode.fnContext = parent;
  2594. }
  2595. return vnode;
  2596. };
  2597. }
  2598. else {
  2599. this._c = function (a, b, c, d) {
  2600. return createElement(contextVm, a, b, c, d, needNormalization);
  2601. };
  2602. }
  2603. }
  2604. installRenderHelpers(FunctionalRenderContext.prototype);
  2605. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  2606. var options = Ctor.options;
  2607. var props = {};
  2608. var propOptions = options.props;
  2609. if (isDef(propOptions)) {
  2610. for (var key in propOptions) {
  2611. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  2612. }
  2613. }
  2614. else {
  2615. if (isDef(data.attrs))
  2616. mergeProps(props, data.attrs);
  2617. if (isDef(data.props))
  2618. mergeProps(props, data.props);
  2619. }
  2620. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  2621. var vnode = options.render.call(null, renderContext._c, renderContext);
  2622. if (vnode instanceof VNode) {
  2623. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
  2624. }
  2625. else if (isArray(vnode)) {
  2626. var vnodes = normalizeChildren(vnode) || [];
  2627. var res = new Array(vnodes.length);
  2628. for (var i = 0; i < vnodes.length; i++) {
  2629. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  2630. }
  2631. return res;
  2632. }
  2633. }
  2634. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  2635. // #7817 clone node before setting fnContext, otherwise if the node is reused
  2636. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  2637. // that should not be matched to match.
  2638. var clone = cloneVNode(vnode);
  2639. clone.fnContext = contextVm;
  2640. clone.fnOptions = options;
  2641. {
  2642. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
  2643. renderContext;
  2644. }
  2645. if (data.slot) {
  2646. (clone.data || (clone.data = {})).slot = data.slot;
  2647. }
  2648. return clone;
  2649. }
  2650. function mergeProps(to, from) {
  2651. for (var key in from) {
  2652. to[camelize(key)] = from[key];
  2653. }
  2654. }
  2655. function getComponentName(options) {
  2656. return options.name || options.__name || options._componentTag;
  2657. }
  2658. // inline hooks to be invoked on component VNodes during patch
  2659. var componentVNodeHooks = {
  2660. init: function (vnode, hydrating) {
  2661. if (vnode.componentInstance &&
  2662. !vnode.componentInstance._isDestroyed &&
  2663. vnode.data.keepAlive) {
  2664. // kept-alive components, treat as a patch
  2665. var mountedNode = vnode; // work around flow
  2666. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  2667. }
  2668. else {
  2669. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  2670. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  2671. }
  2672. },
  2673. prepatch: function (oldVnode, vnode) {
  2674. var options = vnode.componentOptions;
  2675. var child = (vnode.componentInstance = oldVnode.componentInstance);
  2676. updateChildComponent(child, options.propsData, // updated props
  2677. options.listeners, // updated listeners
  2678. vnode, // new parent vnode
  2679. options.children // new children
  2680. );
  2681. },
  2682. insert: function (vnode) {
  2683. var context = vnode.context, componentInstance = vnode.componentInstance;
  2684. if (!componentInstance._isMounted) {
  2685. componentInstance._isMounted = true;
  2686. callHook(componentInstance, 'mounted');
  2687. }
  2688. if (vnode.data.keepAlive) {
  2689. if (context._isMounted) {
  2690. // vue-router#1212
  2691. // During updates, a kept-alive component's child components may
  2692. // change, so directly walking the tree here may call activated hooks
  2693. // on incorrect children. Instead we push them into a queue which will
  2694. // be processed after the whole patch process ended.
  2695. queueActivatedComponent(componentInstance);
  2696. }
  2697. else {
  2698. activateChildComponent(componentInstance, true /* direct */);
  2699. }
  2700. }
  2701. },
  2702. destroy: function (vnode) {
  2703. var componentInstance = vnode.componentInstance;
  2704. if (!componentInstance._isDestroyed) {
  2705. if (!vnode.data.keepAlive) {
  2706. componentInstance.$destroy();
  2707. }
  2708. else {
  2709. deactivateChildComponent(componentInstance, true /* direct */);
  2710. }
  2711. }
  2712. }
  2713. };
  2714. var hooksToMerge = Object.keys(componentVNodeHooks);
  2715. function createComponent(Ctor, data, context, children, tag) {
  2716. if (isUndef(Ctor)) {
  2717. return;
  2718. }
  2719. var baseCtor = context.$options._base;
  2720. // plain options object: turn it into a constructor
  2721. if (isObject(Ctor)) {
  2722. Ctor = baseCtor.extend(Ctor);
  2723. }
  2724. // if at this stage it's not a constructor or an async component factory,
  2725. // reject.
  2726. if (typeof Ctor !== 'function') {
  2727. {
  2728. warn$2("Invalid Component definition: ".concat(String(Ctor)), context);
  2729. }
  2730. return;
  2731. }
  2732. // async component
  2733. var asyncFactory;
  2734. // @ts-expect-error
  2735. if (isUndef(Ctor.cid)) {
  2736. asyncFactory = Ctor;
  2737. Ctor = resolveAsyncComponent(asyncFactory);
  2738. if (Ctor === undefined) {
  2739. // return a placeholder node for async component, which is rendered
  2740. // as a comment node but preserves all the raw information for the node.
  2741. // the information will be used for async server-rendering and hydration.
  2742. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  2743. }
  2744. }
  2745. data = data || {};
  2746. // resolve constructor options in case global mixins are applied after
  2747. // component constructor creation
  2748. resolveConstructorOptions(Ctor);
  2749. // transform component v-model data into props & events
  2750. if (isDef(data.model)) {
  2751. // @ts-expect-error
  2752. transformModel(Ctor.options, data);
  2753. }
  2754. // extract props
  2755. // @ts-expect-error
  2756. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  2757. // functional component
  2758. // @ts-expect-error
  2759. if (isTrue(Ctor.options.functional)) {
  2760. return createFunctionalComponent(Ctor, propsData, data, context, children);
  2761. }
  2762. // extract listeners, since these needs to be treated as
  2763. // child component listeners instead of DOM listeners
  2764. var listeners = data.on;
  2765. // replace with listeners with .native modifier
  2766. // so it gets processed during parent component patch.
  2767. data.on = data.nativeOn;
  2768. // @ts-expect-error
  2769. if (isTrue(Ctor.options.abstract)) {
  2770. // abstract components do not keep anything
  2771. // other than props & listeners & slot
  2772. // work around flow
  2773. var slot = data.slot;
  2774. data = {};
  2775. if (slot) {
  2776. data.slot = slot;
  2777. }
  2778. }
  2779. // install component management hooks onto the placeholder node
  2780. installComponentHooks(data);
  2781. // return a placeholder vnode
  2782. // @ts-expect-error
  2783. var name = getComponentName(Ctor.options) || tag;
  2784. var vnode = new VNode(
  2785. // @ts-expect-error
  2786. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  2787. // @ts-expect-error
  2788. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  2789. return vnode;
  2790. }
  2791. function createComponentInstanceForVnode(
  2792. // we know it's MountedComponentVNode but flow doesn't
  2793. vnode,
  2794. // activeInstance in lifecycle state
  2795. parent) {
  2796. var options = {
  2797. _isComponent: true,
  2798. _parentVnode: vnode,
  2799. parent: parent
  2800. };
  2801. // check inline-template render functions
  2802. var inlineTemplate = vnode.data.inlineTemplate;
  2803. if (isDef(inlineTemplate)) {
  2804. options.render = inlineTemplate.render;
  2805. options.staticRenderFns = inlineTemplate.staticRenderFns;
  2806. }
  2807. return new vnode.componentOptions.Ctor(options);
  2808. }
  2809. function installComponentHooks(data) {
  2810. var hooks = data.hook || (data.hook = {});
  2811. for (var i = 0; i < hooksToMerge.length; i++) {
  2812. var key = hooksToMerge[i];
  2813. var existing = hooks[key];
  2814. var toMerge = componentVNodeHooks[key];
  2815. // @ts-expect-error
  2816. if (existing !== toMerge && !(existing && existing._merged)) {
  2817. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  2818. }
  2819. }
  2820. }
  2821. function mergeHook(f1, f2) {
  2822. var merged = function (a, b) {
  2823. // flow complains about extra args which is why we use any
  2824. f1(a, b);
  2825. f2(a, b);
  2826. };
  2827. merged._merged = true;
  2828. return merged;
  2829. }
  2830. // transform component v-model info (value and callback) into
  2831. // prop and event handler respectively.
  2832. function transformModel(options, data) {
  2833. var prop = (options.model && options.model.prop) || 'value';
  2834. var event = (options.model && options.model.event) || 'input';
  2835. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  2836. var on = data.on || (data.on = {});
  2837. var existing = on[event];
  2838. var callback = data.model.callback;
  2839. if (isDef(existing)) {
  2840. if (isArray(existing)
  2841. ? existing.indexOf(callback) === -1
  2842. : existing !== callback) {
  2843. on[event] = [callback].concat(existing);
  2844. }
  2845. }
  2846. else {
  2847. on[event] = callback;
  2848. }
  2849. }
  2850. var warn$2 = noop;
  2851. var tip = noop;
  2852. var generateComponentTrace; // work around flow check
  2853. var formatComponentName;
  2854. {
  2855. var hasConsole_1 = typeof console !== 'undefined';
  2856. var classifyRE_1 = /(?:^|[-_])(\w)/g;
  2857. var classify_1 = function (str) {
  2858. return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
  2859. };
  2860. warn$2 = function (msg, vm) {
  2861. if (vm === void 0) { vm = currentInstance; }
  2862. var trace = vm ? generateComponentTrace(vm) : '';
  2863. if (hasConsole_1 && !config.silent) {
  2864. console.error("[Vue warn]: ".concat(msg).concat(trace));
  2865. }
  2866. };
  2867. tip = function (msg, vm) {
  2868. if (hasConsole_1 && !config.silent) {
  2869. console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
  2870. }
  2871. };
  2872. formatComponentName = function (vm, includeFile) {
  2873. if (vm.$root === vm) {
  2874. return '<Root>';
  2875. }
  2876. var options = isFunction(vm) && vm.cid != null
  2877. ? vm.options
  2878. : vm._isVue
  2879. ? vm.$options || vm.constructor.options
  2880. : vm;
  2881. var name = getComponentName(options);
  2882. var file = options.__file;
  2883. if (!name && file) {
  2884. var match = file.match(/([^/\\]+)\.vue$/);
  2885. name = match && match[1];
  2886. }
  2887. return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
  2888. (file && includeFile !== false ? " at ".concat(file) : ''));
  2889. };
  2890. var repeat_1 = function (str, n) {
  2891. var res = '';
  2892. while (n) {
  2893. if (n % 2 === 1)
  2894. res += str;
  2895. if (n > 1)
  2896. str += str;
  2897. n >>= 1;
  2898. }
  2899. return res;
  2900. };
  2901. generateComponentTrace = function (vm) {
  2902. if (vm._isVue && vm.$parent) {
  2903. var tree = [];
  2904. var currentRecursiveSequence = 0;
  2905. while (vm) {
  2906. if (tree.length > 0) {
  2907. var last = tree[tree.length - 1];
  2908. if (last.constructor === vm.constructor) {
  2909. currentRecursiveSequence++;
  2910. vm = vm.$parent;
  2911. continue;
  2912. }
  2913. else if (currentRecursiveSequence > 0) {
  2914. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2915. currentRecursiveSequence = 0;
  2916. }
  2917. }
  2918. tree.push(vm);
  2919. vm = vm.$parent;
  2920. }
  2921. return ('\n\nfound in\n\n' +
  2922. tree
  2923. .map(function (vm, i) {
  2924. return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
  2925. ? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
  2926. : formatComponentName(vm));
  2927. })
  2928. .join('\n'));
  2929. }
  2930. else {
  2931. return "\n\n(found in ".concat(formatComponentName(vm), ")");
  2932. }
  2933. };
  2934. }
  2935. /**
  2936. * Option overwriting strategies are functions that handle
  2937. * how to merge a parent option value and a child option
  2938. * value into the final value.
  2939. */
  2940. var strats = config.optionMergeStrategies;
  2941. /**
  2942. * Options with restrictions
  2943. */
  2944. {
  2945. strats.el = strats.propsData = function (parent, child, vm, key) {
  2946. if (!vm) {
  2947. warn$2("option \"".concat(key, "\" can only be used during instance ") +
  2948. 'creation with the `new` keyword.');
  2949. }
  2950. return defaultStrat(parent, child);
  2951. };
  2952. }
  2953. /**
  2954. * Helper that recursively merges two data objects together.
  2955. */
  2956. function mergeData(to, from, recursive) {
  2957. if (recursive === void 0) { recursive = true; }
  2958. if (!from)
  2959. return to;
  2960. var key, toVal, fromVal;
  2961. var keys = hasSymbol
  2962. ? Reflect.ownKeys(from)
  2963. : Object.keys(from);
  2964. for (var i = 0; i < keys.length; i++) {
  2965. key = keys[i];
  2966. // in case the object is already observed...
  2967. if (key === '__ob__')
  2968. continue;
  2969. toVal = to[key];
  2970. fromVal = from[key];
  2971. if (!recursive || !hasOwn(to, key)) {
  2972. set(to, key, fromVal);
  2973. }
  2974. else if (toVal !== fromVal &&
  2975. isPlainObject(toVal) &&
  2976. isPlainObject(fromVal)) {
  2977. mergeData(toVal, fromVal);
  2978. }
  2979. }
  2980. return to;
  2981. }
  2982. /**
  2983. * Data
  2984. */
  2985. function mergeDataOrFn(parentVal, childVal, vm) {
  2986. if (!vm) {
  2987. // in a Vue.extend merge, both should be functions
  2988. if (!childVal) {
  2989. return parentVal;
  2990. }
  2991. if (!parentVal) {
  2992. return childVal;
  2993. }
  2994. // when parentVal & childVal are both present,
  2995. // we need to return a function that returns the
  2996. // merged result of both functions... no need to
  2997. // check if parentVal is a function here because
  2998. // it has to be a function to pass previous merges.
  2999. return function mergedDataFn() {
  3000. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  3001. };
  3002. }
  3003. else {
  3004. return function mergedInstanceDataFn() {
  3005. // instance merge
  3006. var instanceData = isFunction(childVal)
  3007. ? childVal.call(vm, vm)
  3008. : childVal;
  3009. var defaultData = isFunction(parentVal)
  3010. ? parentVal.call(vm, vm)
  3011. : parentVal;
  3012. if (instanceData) {
  3013. return mergeData(instanceData, defaultData);
  3014. }
  3015. else {
  3016. return defaultData;
  3017. }
  3018. };
  3019. }
  3020. }
  3021. strats.data = function (parentVal, childVal, vm) {
  3022. if (!vm) {
  3023. if (childVal && typeof childVal !== 'function') {
  3024. warn$2('The "data" option should be a function ' +
  3025. 'that returns a per-instance value in component ' +
  3026. 'definitions.', vm);
  3027. return parentVal;
  3028. }
  3029. return mergeDataOrFn(parentVal, childVal);
  3030. }
  3031. return mergeDataOrFn(parentVal, childVal, vm);
  3032. };
  3033. /**
  3034. * Hooks and props are merged as arrays.
  3035. */
  3036. function mergeLifecycleHook(parentVal, childVal) {
  3037. var res = childVal
  3038. ? parentVal
  3039. ? parentVal.concat(childVal)
  3040. : isArray(childVal)
  3041. ? childVal
  3042. : [childVal]
  3043. : parentVal;
  3044. return res ? dedupeHooks(res) : res;
  3045. }
  3046. function dedupeHooks(hooks) {
  3047. var res = [];
  3048. for (var i = 0; i < hooks.length; i++) {
  3049. if (res.indexOf(hooks[i]) === -1) {
  3050. res.push(hooks[i]);
  3051. }
  3052. }
  3053. return res;
  3054. }
  3055. LIFECYCLE_HOOKS.forEach(function (hook) {
  3056. strats[hook] = mergeLifecycleHook;
  3057. });
  3058. /**
  3059. * Assets
  3060. *
  3061. * When a vm is present (instance creation), we need to do
  3062. * a three-way merge between constructor options, instance
  3063. * options and parent options.
  3064. */
  3065. function mergeAssets(parentVal, childVal, vm, key) {
  3066. var res = Object.create(parentVal || null);
  3067. if (childVal) {
  3068. assertObjectType(key, childVal, vm);
  3069. return extend(res, childVal);
  3070. }
  3071. else {
  3072. return res;
  3073. }
  3074. }
  3075. ASSET_TYPES.forEach(function (type) {
  3076. strats[type + 's'] = mergeAssets;
  3077. });
  3078. /**
  3079. * Watchers.
  3080. *
  3081. * Watchers hashes should not overwrite one
  3082. * another, so we merge them as arrays.
  3083. */
  3084. strats.watch = function (parentVal, childVal, vm, key) {
  3085. // work around Firefox's Object.prototype.watch...
  3086. //@ts-expect-error work around
  3087. if (parentVal === nativeWatch)
  3088. parentVal = undefined;
  3089. //@ts-expect-error work around
  3090. if (childVal === nativeWatch)
  3091. childVal = undefined;
  3092. /* istanbul ignore if */
  3093. if (!childVal)
  3094. return Object.create(parentVal || null);
  3095. {
  3096. assertObjectType(key, childVal, vm);
  3097. }
  3098. if (!parentVal)
  3099. return childVal;
  3100. var ret = {};
  3101. extend(ret, parentVal);
  3102. for (var key_1 in childVal) {
  3103. var parent_1 = ret[key_1];
  3104. var child = childVal[key_1];
  3105. if (parent_1 && !isArray(parent_1)) {
  3106. parent_1 = [parent_1];
  3107. }
  3108. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  3109. }
  3110. return ret;
  3111. };
  3112. /**
  3113. * Other object hashes.
  3114. */
  3115. strats.props =
  3116. strats.methods =
  3117. strats.inject =
  3118. strats.computed =
  3119. function (parentVal, childVal, vm, key) {
  3120. if (childVal && true) {
  3121. assertObjectType(key, childVal, vm);
  3122. }
  3123. if (!parentVal)
  3124. return childVal;
  3125. var ret = Object.create(null);
  3126. extend(ret, parentVal);
  3127. if (childVal)
  3128. extend(ret, childVal);
  3129. return ret;
  3130. };
  3131. strats.provide = function (parentVal, childVal) {
  3132. if (!parentVal)
  3133. return childVal;
  3134. return function () {
  3135. var ret = Object.create(null);
  3136. mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
  3137. if (childVal) {
  3138. mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
  3139. );
  3140. }
  3141. return ret;
  3142. };
  3143. };
  3144. /**
  3145. * Default strategy.
  3146. */
  3147. var defaultStrat = function (parentVal, childVal) {
  3148. return childVal === undefined ? parentVal : childVal;
  3149. };
  3150. /**
  3151. * Validate component names
  3152. */
  3153. function checkComponents(options) {
  3154. for (var key in options.components) {
  3155. validateComponentName(key);
  3156. }
  3157. }
  3158. function validateComponentName(name) {
  3159. if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
  3160. warn$2('Invalid component name: "' +
  3161. name +
  3162. '". Component names ' +
  3163. 'should conform to valid custom element name in html5 specification.');
  3164. }
  3165. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3166. warn$2('Do not use built-in or reserved HTML elements as component ' +
  3167. 'id: ' +
  3168. name);
  3169. }
  3170. }
  3171. /**
  3172. * Ensure all props option syntax are normalized into the
  3173. * Object-based format.
  3174. */
  3175. function normalizeProps(options, vm) {
  3176. var props = options.props;
  3177. if (!props)
  3178. return;
  3179. var res = {};
  3180. var i, val, name;
  3181. if (isArray(props)) {
  3182. i = props.length;
  3183. while (i--) {
  3184. val = props[i];
  3185. if (typeof val === 'string') {
  3186. name = camelize(val);
  3187. res[name] = { type: null };
  3188. }
  3189. else {
  3190. warn$2('props must be strings when using array syntax.');
  3191. }
  3192. }
  3193. }
  3194. else if (isPlainObject(props)) {
  3195. for (var key in props) {
  3196. val = props[key];
  3197. name = camelize(key);
  3198. res[name] = isPlainObject(val) ? val : { type: val };
  3199. }
  3200. }
  3201. else {
  3202. warn$2("Invalid value for option \"props\": expected an Array or an Object, " +
  3203. "but got ".concat(toRawType(props), "."), vm);
  3204. }
  3205. options.props = res;
  3206. }
  3207. /**
  3208. * Normalize all injections into Object-based format
  3209. */
  3210. function normalizeInject(options, vm) {
  3211. var inject = options.inject;
  3212. if (!inject)
  3213. return;
  3214. var normalized = (options.inject = {});
  3215. if (isArray(inject)) {
  3216. for (var i = 0; i < inject.length; i++) {
  3217. normalized[inject[i]] = { from: inject[i] };
  3218. }
  3219. }
  3220. else if (isPlainObject(inject)) {
  3221. for (var key in inject) {
  3222. var val = inject[key];
  3223. normalized[key] = isPlainObject(val)
  3224. ? extend({ from: key }, val)
  3225. : { from: val };
  3226. }
  3227. }
  3228. else {
  3229. warn$2("Invalid value for option \"inject\": expected an Array or an Object, " +
  3230. "but got ".concat(toRawType(inject), "."), vm);
  3231. }
  3232. }
  3233. /**
  3234. * Normalize raw function directives into object format.
  3235. */
  3236. function normalizeDirectives(options) {
  3237. var dirs = options.directives;
  3238. if (dirs) {
  3239. for (var key in dirs) {
  3240. var def = dirs[key];
  3241. if (isFunction(def)) {
  3242. dirs[key] = { bind: def, update: def };
  3243. }
  3244. }
  3245. }
  3246. }
  3247. function assertObjectType(name, value, vm) {
  3248. if (!isPlainObject(value)) {
  3249. warn$2("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  3250. "but got ".concat(toRawType(value), "."), vm);
  3251. }
  3252. }
  3253. /**
  3254. * Merge two option objects into a new one.
  3255. * Core utility used in both instantiation and inheritance.
  3256. */
  3257. function mergeOptions(parent, child, vm) {
  3258. {
  3259. checkComponents(child);
  3260. }
  3261. if (isFunction(child)) {
  3262. // @ts-expect-error
  3263. child = child.options;
  3264. }
  3265. normalizeProps(child, vm);
  3266. normalizeInject(child, vm);
  3267. normalizeDirectives(child);
  3268. // Apply extends and mixins on the child options,
  3269. // but only if it is a raw options object that isn't
  3270. // the result of another mergeOptions call.
  3271. // Only merged options has the _base property.
  3272. if (!child._base) {
  3273. if (child.extends) {
  3274. parent = mergeOptions(parent, child.extends, vm);
  3275. }
  3276. if (child.mixins) {
  3277. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3278. parent = mergeOptions(parent, child.mixins[i], vm);
  3279. }
  3280. }
  3281. }
  3282. var options = {};
  3283. var key;
  3284. for (key in parent) {
  3285. mergeField(key);
  3286. }
  3287. for (key in child) {
  3288. if (!hasOwn(parent, key)) {
  3289. mergeField(key);
  3290. }
  3291. }
  3292. function mergeField(key) {
  3293. var strat = strats[key] || defaultStrat;
  3294. options[key] = strat(parent[key], child[key], vm, key);
  3295. }
  3296. return options;
  3297. }
  3298. /**
  3299. * Resolve an asset.
  3300. * This function is used because child instances need access
  3301. * to assets defined in its ancestor chain.
  3302. */
  3303. function resolveAsset(options, type, id, warnMissing) {
  3304. /* istanbul ignore if */
  3305. if (typeof id !== 'string') {
  3306. return;
  3307. }
  3308. var assets = options[type];
  3309. // check local registration variations first
  3310. if (hasOwn(assets, id))
  3311. return assets[id];
  3312. var camelizedId = camelize(id);
  3313. if (hasOwn(assets, camelizedId))
  3314. return assets[camelizedId];
  3315. var PascalCaseId = capitalize(camelizedId);
  3316. if (hasOwn(assets, PascalCaseId))
  3317. return assets[PascalCaseId];
  3318. // fallback to prototype chain
  3319. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3320. if (warnMissing && !res) {
  3321. warn$2('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
  3322. }
  3323. return res;
  3324. }
  3325. function validateProp(key, propOptions, propsData, vm) {
  3326. var prop = propOptions[key];
  3327. var absent = !hasOwn(propsData, key);
  3328. var value = propsData[key];
  3329. // boolean casting
  3330. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3331. if (booleanIndex > -1) {
  3332. if (absent && !hasOwn(prop, 'default')) {
  3333. value = false;
  3334. }
  3335. else if (value === '' || value === hyphenate(key)) {
  3336. // only cast empty string / same name to boolean if
  3337. // boolean has higher priority
  3338. var stringIndex = getTypeIndex(String, prop.type);
  3339. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3340. value = true;
  3341. }
  3342. }
  3343. }
  3344. // check default value
  3345. if (value === undefined) {
  3346. value = getPropDefaultValue(vm, prop, key);
  3347. // since the default value is a fresh copy,
  3348. // make sure to observe it.
  3349. var prevShouldObserve = shouldObserve;
  3350. toggleObserving(true);
  3351. observe(value);
  3352. toggleObserving(prevShouldObserve);
  3353. }
  3354. {
  3355. assertProp(prop, key, value, vm, absent);
  3356. }
  3357. return value;
  3358. }
  3359. /**
  3360. * Get the default value of a prop.
  3361. */
  3362. function getPropDefaultValue(vm, prop, key) {
  3363. // no default, return undefined
  3364. if (!hasOwn(prop, 'default')) {
  3365. return undefined;
  3366. }
  3367. var def = prop.default;
  3368. // warn against non-factory defaults for Object & Array
  3369. if (isObject(def)) {
  3370. warn$2('Invalid default value for prop "' +
  3371. key +
  3372. '": ' +
  3373. 'Props with type Object/Array must use a factory function ' +
  3374. 'to return the default value.', vm);
  3375. }
  3376. // the raw prop value was also undefined from previous render,
  3377. // return previous default value to avoid unnecessary watcher trigger
  3378. if (vm &&
  3379. vm.$options.propsData &&
  3380. vm.$options.propsData[key] === undefined &&
  3381. vm._props[key] !== undefined) {
  3382. return vm._props[key];
  3383. }
  3384. // call factory function for non-Function types
  3385. // a value is Function if its prototype is function even across different execution context
  3386. return isFunction(def) && getType(prop.type) !== 'Function'
  3387. ? def.call(vm)
  3388. : def;
  3389. }
  3390. /**
  3391. * Assert whether a prop is valid.
  3392. */
  3393. function assertProp(prop, name, value, vm, absent) {
  3394. if (prop.required && absent) {
  3395. warn$2('Missing required prop: "' + name + '"', vm);
  3396. return;
  3397. }
  3398. if (value == null && !prop.required) {
  3399. return;
  3400. }
  3401. var type = prop.type;
  3402. var valid = !type || type === true;
  3403. var expectedTypes = [];
  3404. if (type) {
  3405. if (!isArray(type)) {
  3406. type = [type];
  3407. }
  3408. for (var i = 0; i < type.length && !valid; i++) {
  3409. var assertedType = assertType(value, type[i], vm);
  3410. expectedTypes.push(assertedType.expectedType || '');
  3411. valid = assertedType.valid;
  3412. }
  3413. }
  3414. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  3415. if (!valid && haveExpectedTypes) {
  3416. warn$2(getInvalidTypeMessage(name, value, expectedTypes), vm);
  3417. return;
  3418. }
  3419. var validator = prop.validator;
  3420. if (validator) {
  3421. if (!validator(value)) {
  3422. warn$2('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
  3423. }
  3424. }
  3425. }
  3426. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  3427. function assertType(value, type, vm) {
  3428. var valid;
  3429. var expectedType = getType(type);
  3430. if (simpleCheckRE.test(expectedType)) {
  3431. var t = typeof value;
  3432. valid = t === expectedType.toLowerCase();
  3433. // for primitive wrapper objects
  3434. if (!valid && t === 'object') {
  3435. valid = value instanceof type;
  3436. }
  3437. }
  3438. else if (expectedType === 'Object') {
  3439. valid = isPlainObject(value);
  3440. }
  3441. else if (expectedType === 'Array') {
  3442. valid = isArray(value);
  3443. }
  3444. else {
  3445. try {
  3446. valid = value instanceof type;
  3447. }
  3448. catch (e) {
  3449. warn$2('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  3450. valid = false;
  3451. }
  3452. }
  3453. return {
  3454. valid: valid,
  3455. expectedType: expectedType
  3456. };
  3457. }
  3458. var functionTypeCheckRE = /^\s*function (\w+)/;
  3459. /**
  3460. * Use function string name to check built-in types,
  3461. * because a simple equality check will fail when running
  3462. * across different vms / iframes.
  3463. */
  3464. function getType(fn) {
  3465. var match = fn && fn.toString().match(functionTypeCheckRE);
  3466. return match ? match[1] : '';
  3467. }
  3468. function isSameType(a, b) {
  3469. return getType(a) === getType(b);
  3470. }
  3471. function getTypeIndex(type, expectedTypes) {
  3472. if (!isArray(expectedTypes)) {
  3473. return isSameType(expectedTypes, type) ? 0 : -1;
  3474. }
  3475. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3476. if (isSameType(expectedTypes[i], type)) {
  3477. return i;
  3478. }
  3479. }
  3480. return -1;
  3481. }
  3482. function getInvalidTypeMessage(name, value, expectedTypes) {
  3483. var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
  3484. " Expected ".concat(expectedTypes.map(capitalize).join(', '));
  3485. var expectedType = expectedTypes[0];
  3486. var receivedType = toRawType(value);
  3487. // check if we need to specify expected value
  3488. if (expectedTypes.length === 1 &&
  3489. isExplicable(expectedType) &&
  3490. isExplicable(typeof value) &&
  3491. !isBoolean(expectedType, receivedType)) {
  3492. message += " with value ".concat(styleValue(value, expectedType));
  3493. }
  3494. message += ", got ".concat(receivedType, " ");
  3495. // check if we need to specify received value
  3496. if (isExplicable(receivedType)) {
  3497. message += "with value ".concat(styleValue(value, receivedType), ".");
  3498. }
  3499. return message;
  3500. }
  3501. function styleValue(value, type) {
  3502. if (type === 'String') {
  3503. return "\"".concat(value, "\"");
  3504. }
  3505. else if (type === 'Number') {
  3506. return "".concat(Number(value));
  3507. }
  3508. else {
  3509. return "".concat(value);
  3510. }
  3511. }
  3512. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  3513. function isExplicable(value) {
  3514. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
  3515. }
  3516. function isBoolean() {
  3517. var args = [];
  3518. for (var _i = 0; _i < arguments.length; _i++) {
  3519. args[_i] = arguments[_i];
  3520. }
  3521. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
  3522. }
  3523. // these are reserved for web because they are directly compiled away
  3524. // during template compilation
  3525. makeMap('style,class');
  3526. // attributes that should be using props for binding
  3527. var acceptValue = makeMap('input,textarea,option,select,progress');
  3528. var mustUseProp = function (tag, type, attr) {
  3529. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  3530. (attr === 'selected' && tag === 'option') ||
  3531. (attr === 'checked' && tag === 'input') ||
  3532. (attr === 'muted' && tag === 'video'));
  3533. };
  3534. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  3535. makeMap('events,caret,typing,plaintext-only');
  3536. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  3537. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  3538. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  3539. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  3540. 'required,reversed,scoped,seamless,selected,sortable,' +
  3541. 'truespeed,typemustmatch,visible');
  3542. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  3543. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  3544. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  3545. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  3546. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  3547. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  3548. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  3549. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  3550. 'output,progress,select,textarea,' +
  3551. 'details,dialog,menu,menuitem,summary,' +
  3552. 'content,element,shadow,template,blockquote,iframe,tfoot');
  3553. // this map is intentionally selective, only covering SVG elements that may
  3554. // contain child elements.
  3555. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  3556. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  3557. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  3558. var isPreTag = function (tag) { return tag === 'pre'; };
  3559. var isReservedTag = function (tag) {
  3560. return isHTMLTag(tag) || isSVG(tag);
  3561. };
  3562. function getTagNamespace(tag) {
  3563. if (isSVG(tag)) {
  3564. return 'svg';
  3565. }
  3566. // basic support for MathML
  3567. // note it doesn't support other MathML elements being component roots
  3568. if (tag === 'math') {
  3569. return 'math';
  3570. }
  3571. }
  3572. makeMap('text,number,password,search,email,tel,url');
  3573. var validDivisionCharRE = /[\w).+\-_$\]]/;
  3574. function parseFilters(exp) {
  3575. var inSingle = false;
  3576. var inDouble = false;
  3577. var inTemplateString = false;
  3578. var inRegex = false;
  3579. var curly = 0;
  3580. var square = 0;
  3581. var paren = 0;
  3582. var lastFilterIndex = 0;
  3583. var c, prev, i, expression, filters;
  3584. for (i = 0; i < exp.length; i++) {
  3585. prev = c;
  3586. c = exp.charCodeAt(i);
  3587. if (inSingle) {
  3588. if (c === 0x27 && prev !== 0x5c)
  3589. inSingle = false;
  3590. }
  3591. else if (inDouble) {
  3592. if (c === 0x22 && prev !== 0x5c)
  3593. inDouble = false;
  3594. }
  3595. else if (inTemplateString) {
  3596. if (c === 0x60 && prev !== 0x5c)
  3597. inTemplateString = false;
  3598. }
  3599. else if (inRegex) {
  3600. if (c === 0x2f && prev !== 0x5c)
  3601. inRegex = false;
  3602. }
  3603. else if (c === 0x7c && // pipe
  3604. exp.charCodeAt(i + 1) !== 0x7c &&
  3605. exp.charCodeAt(i - 1) !== 0x7c &&
  3606. !curly &&
  3607. !square &&
  3608. !paren) {
  3609. if (expression === undefined) {
  3610. // first filter, end of expression
  3611. lastFilterIndex = i + 1;
  3612. expression = exp.slice(0, i).trim();
  3613. }
  3614. else {
  3615. pushFilter();
  3616. }
  3617. }
  3618. else {
  3619. switch (c) {
  3620. case 0x22:
  3621. inDouble = true;
  3622. break; // "
  3623. case 0x27:
  3624. inSingle = true;
  3625. break; // '
  3626. case 0x60:
  3627. inTemplateString = true;
  3628. break; // `
  3629. case 0x28:
  3630. paren++;
  3631. break; // (
  3632. case 0x29:
  3633. paren--;
  3634. break; // )
  3635. case 0x5b:
  3636. square++;
  3637. break; // [
  3638. case 0x5d:
  3639. square--;
  3640. break; // ]
  3641. case 0x7b:
  3642. curly++;
  3643. break; // {
  3644. case 0x7d:
  3645. curly--;
  3646. break; // }
  3647. }
  3648. if (c === 0x2f) {
  3649. // /
  3650. var j = i - 1;
  3651. var p
  3652. // find first non-whitespace prev char
  3653. = void 0;
  3654. // find first non-whitespace prev char
  3655. for (; j >= 0; j--) {
  3656. p = exp.charAt(j);
  3657. if (p !== ' ')
  3658. break;
  3659. }
  3660. if (!p || !validDivisionCharRE.test(p)) {
  3661. inRegex = true;
  3662. }
  3663. }
  3664. }
  3665. }
  3666. if (expression === undefined) {
  3667. expression = exp.slice(0, i).trim();
  3668. }
  3669. else if (lastFilterIndex !== 0) {
  3670. pushFilter();
  3671. }
  3672. function pushFilter() {
  3673. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  3674. lastFilterIndex = i + 1;
  3675. }
  3676. if (filters) {
  3677. for (i = 0; i < filters.length; i++) {
  3678. expression = wrapFilter(expression, filters[i]);
  3679. }
  3680. }
  3681. return expression;
  3682. }
  3683. function wrapFilter(exp, filter) {
  3684. var i = filter.indexOf('(');
  3685. if (i < 0) {
  3686. // _f: resolveFilter
  3687. return "_f(\"".concat(filter, "\")(").concat(exp, ")");
  3688. }
  3689. else {
  3690. var name_1 = filter.slice(0, i);
  3691. var args = filter.slice(i + 1);
  3692. return "_f(\"".concat(name_1, "\")(").concat(exp).concat(args !== ')' ? ',' + args : args);
  3693. }
  3694. }
  3695. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  3696. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  3697. var buildRegex = cached(function (delimiters) {
  3698. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  3699. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  3700. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g');
  3701. });
  3702. function parseText(text, delimiters) {
  3703. //@ts-expect-error
  3704. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  3705. if (!tagRE.test(text)) {
  3706. return;
  3707. }
  3708. var tokens = [];
  3709. var rawTokens = [];
  3710. var lastIndex = (tagRE.lastIndex = 0);
  3711. var match, index, tokenValue;
  3712. while ((match = tagRE.exec(text))) {
  3713. index = match.index;
  3714. // push text token
  3715. if (index > lastIndex) {
  3716. rawTokens.push((tokenValue = text.slice(lastIndex, index)));
  3717. tokens.push(JSON.stringify(tokenValue));
  3718. }
  3719. // tag token
  3720. var exp = parseFilters(match[1].trim());
  3721. tokens.push("_s(".concat(exp, ")"));
  3722. rawTokens.push({ '@binding': exp });
  3723. lastIndex = index + match[0].length;
  3724. }
  3725. if (lastIndex < text.length) {
  3726. rawTokens.push((tokenValue = text.slice(lastIndex)));
  3727. tokens.push(JSON.stringify(tokenValue));
  3728. }
  3729. return {
  3730. expression: tokens.join('+'),
  3731. tokens: rawTokens
  3732. };
  3733. }
  3734. /* eslint-disable no-unused-vars */
  3735. function baseWarn(msg, range) {
  3736. console.error("[Vue compiler]: ".concat(msg));
  3737. }
  3738. /* eslint-enable no-unused-vars */
  3739. function pluckModuleFunction(modules, key) {
  3740. return modules ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) : [];
  3741. }
  3742. function addProp(el, name, value, range, dynamic) {
  3743. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  3744. el.plain = false;
  3745. }
  3746. function addAttr(el, name, value, range, dynamic) {
  3747. var attrs = dynamic
  3748. ? el.dynamicAttrs || (el.dynamicAttrs = [])
  3749. : el.attrs || (el.attrs = []);
  3750. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  3751. el.plain = false;
  3752. }
  3753. // add a raw attr (use this in preTransforms)
  3754. function addRawAttr(el, name, value, range) {
  3755. el.attrsMap[name] = value;
  3756. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  3757. }
  3758. function addDirective(el, name, rawName, value, arg, isDynamicArg, modifiers, range) {
  3759. (el.directives || (el.directives = [])).push(rangeSetItem({
  3760. name: name,
  3761. rawName: rawName,
  3762. value: value,
  3763. arg: arg,
  3764. isDynamicArg: isDynamicArg,
  3765. modifiers: modifiers
  3766. }, range));
  3767. el.plain = false;
  3768. }
  3769. function prependModifierMarker(symbol, name, dynamic) {
  3770. return dynamic ? "_p(".concat(name, ",\"").concat(symbol, "\")") : symbol + name; // mark the event as captured
  3771. }
  3772. function addHandler(el, name, value, modifiers, important, warn, range, dynamic) {
  3773. modifiers = modifiers || emptyObject;
  3774. // warn prevent and passive modifier
  3775. /* istanbul ignore if */
  3776. if (warn && modifiers.prevent && modifiers.passive) {
  3777. warn("passive and prevent can't be used together. " +
  3778. "Passive handler can't prevent default event.", range);
  3779. }
  3780. // normalize click.right and click.middle since they don't actually fire
  3781. // this is technically browser-specific, but at least for now browsers are
  3782. // the only target envs that have right/middle clicks.
  3783. if (modifiers.right) {
  3784. if (dynamic) {
  3785. name = "(".concat(name, ")==='click'?'contextmenu':(").concat(name, ")");
  3786. }
  3787. else if (name === 'click') {
  3788. name = 'contextmenu';
  3789. delete modifiers.right;
  3790. }
  3791. }
  3792. else if (modifiers.middle) {
  3793. if (dynamic) {
  3794. name = "(".concat(name, ")==='click'?'mouseup':(").concat(name, ")");
  3795. }
  3796. else if (name === 'click') {
  3797. name = 'mouseup';
  3798. }
  3799. }
  3800. // check capture modifier
  3801. if (modifiers.capture) {
  3802. delete modifiers.capture;
  3803. name = prependModifierMarker('!', name, dynamic);
  3804. }
  3805. if (modifiers.once) {
  3806. delete modifiers.once;
  3807. name = prependModifierMarker('~', name, dynamic);
  3808. }
  3809. /* istanbul ignore if */
  3810. if (modifiers.passive) {
  3811. delete modifiers.passive;
  3812. name = prependModifierMarker('&', name, dynamic);
  3813. }
  3814. var events;
  3815. if (modifiers.native) {
  3816. delete modifiers.native;
  3817. events = el.nativeEvents || (el.nativeEvents = {});
  3818. }
  3819. else {
  3820. events = el.events || (el.events = {});
  3821. }
  3822. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  3823. if (modifiers !== emptyObject) {
  3824. newHandler.modifiers = modifiers;
  3825. }
  3826. var handlers = events[name];
  3827. /* istanbul ignore if */
  3828. if (Array.isArray(handlers)) {
  3829. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  3830. }
  3831. else if (handlers) {
  3832. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  3833. }
  3834. else {
  3835. events[name] = newHandler;
  3836. }
  3837. el.plain = false;
  3838. }
  3839. function getRawBindingAttr(el, name) {
  3840. return (el.rawAttrsMap[':' + name] ||
  3841. el.rawAttrsMap['v-bind:' + name] ||
  3842. el.rawAttrsMap[name]);
  3843. }
  3844. function getBindingAttr(el, name, getStatic) {
  3845. var dynamicValue = getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name);
  3846. if (dynamicValue != null) {
  3847. return parseFilters(dynamicValue);
  3848. }
  3849. else if (getStatic !== false) {
  3850. var staticValue = getAndRemoveAttr(el, name);
  3851. if (staticValue != null) {
  3852. return JSON.stringify(staticValue);
  3853. }
  3854. }
  3855. }
  3856. // note: this only removes the attr from the Array (attrsList) so that it
  3857. // doesn't get processed by processAttrs.
  3858. // By default it does NOT remove it from the map (attrsMap) because the map is
  3859. // needed during codegen.
  3860. function getAndRemoveAttr(el, name, removeFromMap) {
  3861. var val;
  3862. if ((val = el.attrsMap[name]) != null) {
  3863. var list = el.attrsList;
  3864. for (var i = 0, l = list.length; i < l; i++) {
  3865. if (list[i].name === name) {
  3866. list.splice(i, 1);
  3867. break;
  3868. }
  3869. }
  3870. }
  3871. if (removeFromMap) {
  3872. delete el.attrsMap[name];
  3873. }
  3874. return val;
  3875. }
  3876. function getAndRemoveAttrByRegex(el, name) {
  3877. var list = el.attrsList;
  3878. for (var i = 0, l = list.length; i < l; i++) {
  3879. var attr = list[i];
  3880. if (name.test(attr.name)) {
  3881. list.splice(i, 1);
  3882. return attr;
  3883. }
  3884. }
  3885. }
  3886. function rangeSetItem(item, range) {
  3887. if (range) {
  3888. if (range.start != null) {
  3889. item.start = range.start;
  3890. }
  3891. if (range.end != null) {
  3892. item.end = range.end;
  3893. }
  3894. }
  3895. return item;
  3896. }
  3897. function transformNode$1(el, options) {
  3898. var warn = options.warn || baseWarn;
  3899. var staticClass = getAndRemoveAttr(el, 'class');
  3900. if (staticClass) {
  3901. var res = parseText(staticClass, options.delimiters);
  3902. if (res) {
  3903. warn("class=\"".concat(staticClass, "\": ") +
  3904. 'Interpolation inside attributes has been removed. ' +
  3905. 'Use v-bind or the colon shorthand instead. For example, ' +
  3906. 'instead of <div class="{{ val }}">, use <div :class="val">.', el.rawAttrsMap['class']);
  3907. }
  3908. }
  3909. if (staticClass) {
  3910. el.staticClass = JSON.stringify(staticClass.replace(/\s+/g, ' ').trim());
  3911. }
  3912. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  3913. if (classBinding) {
  3914. el.classBinding = classBinding;
  3915. }
  3916. }
  3917. function genData$2(el) {
  3918. var data = '';
  3919. if (el.staticClass) {
  3920. data += "staticClass:".concat(el.staticClass, ",");
  3921. }
  3922. if (el.classBinding) {
  3923. data += "class:".concat(el.classBinding, ",");
  3924. }
  3925. return data;
  3926. }
  3927. var klass = {
  3928. staticKeys: ['staticClass'],
  3929. transformNode: transformNode$1,
  3930. genData: genData$2
  3931. };
  3932. var parseStyleText = cached(function (cssText) {
  3933. var res = {};
  3934. var listDelimiter = /;(?![^(]*\))/g;
  3935. var propertyDelimiter = /:(.+)/;
  3936. cssText.split(listDelimiter).forEach(function (item) {
  3937. if (item) {
  3938. var tmp = item.split(propertyDelimiter);
  3939. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  3940. }
  3941. });
  3942. return res;
  3943. });
  3944. function transformNode(el, options) {
  3945. var warn = options.warn || baseWarn;
  3946. var staticStyle = getAndRemoveAttr(el, 'style');
  3947. if (staticStyle) {
  3948. /* istanbul ignore if */
  3949. {
  3950. var res = parseText(staticStyle, options.delimiters);
  3951. if (res) {
  3952. warn("style=\"".concat(staticStyle, "\": ") +
  3953. 'Interpolation inside attributes has been removed. ' +
  3954. 'Use v-bind or the colon shorthand instead. For example, ' +
  3955. 'instead of <div style="{{ val }}">, use <div :style="val">.', el.rawAttrsMap['style']);
  3956. }
  3957. }
  3958. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  3959. }
  3960. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  3961. if (styleBinding) {
  3962. el.styleBinding = styleBinding;
  3963. }
  3964. }
  3965. function genData$1(el) {
  3966. var data = '';
  3967. if (el.staticStyle) {
  3968. data += "staticStyle:".concat(el.staticStyle, ",");
  3969. }
  3970. if (el.styleBinding) {
  3971. data += "style:(".concat(el.styleBinding, "),");
  3972. }
  3973. return data;
  3974. }
  3975. var style = {
  3976. staticKeys: ['staticStyle'],
  3977. transformNode: transformNode,
  3978. genData: genData$1
  3979. };
  3980. var he$1 = {exports: {}};
  3981. /*! https://mths.be/he v1.2.0 by @mathias | MIT license */
  3982. (function (module, exports) {
  3983. (function(root) {
  3984. // Detect free variables `exports`.
  3985. var freeExports = exports;
  3986. // Detect free variable `module`.
  3987. var freeModule = module &&
  3988. module.exports == freeExports && module;
  3989. // Detect free variable `global`, from Node.js or Browserified code,
  3990. // and use it as `root`.
  3991. var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
  3992. if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
  3993. root = freeGlobal;
  3994. }
  3995. /*--------------------------------------------------------------------------*/
  3996. // All astral symbols.
  3997. var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  3998. // All ASCII symbols (not just printable ASCII) except those listed in the
  3999. // first column of the overrides table.
  4000. // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides
  4001. var regexAsciiWhitelist = /[\x01-\x7F]/g;
  4002. // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or
  4003. // code points listed in the first column of the overrides table on
  4004. // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.
  4005. var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
  4006. var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;
  4007. var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\u25AB':'EmptyVerySmallSquare','\u25AD':'rect','\u25AE':'marker','\u25B1':'fltns','\u25B3':'xutri','\u25B4':'utrif','\u25B5':'utri','\u25B8':'rtrif','\u25B9':'rtri','\u25BD':'xdtri','\u25BE':'dtrif','\u25BF':'dtri','\u25C2':'ltrif','\u25C3':'ltri','\u25CA':'loz','\u25CB':'cir','\u25EC':'tridot','\u25EF':'xcirc','\u25F8':'ultri','\u25F9':'urtri','\u25FA':'lltri','\u25FB':'EmptySmallSquare','\u25FC':'FilledSmallSquare','\u2605':'starf','\u2606':'star','\u260E':'phone','\u2640':'female','\u2642':'male','\u2660':'spades','\u2663':'clubs','\u2665':'hearts','\u2666':'diams','\u266A':'sung','\u2713':'check','\u2717':'cross','\u2720':'malt','\u2736':'sext','\u2758':'VerticalSeparator','\u27C8':'bsolhsub','\u27C9':'suphsol','\u27F5':'xlarr','\u27F6':'xrarr','\u27F7':'xharr','\u27F8':'xlArr','\u27F9':'xrArr','\u27FA':'xhArr','\u27FC':'xmap','\u27FF':'dzigrarr','\u2902':'nvlArr','\u2903':'nvrArr','\u2904':'nvHarr','\u2905':'Map','\u290C':'lbarr','\u290D':'rbarr','\u290E':'lBarr','\u290F':'rBarr','\u2910':'RBarr','\u2911':'DDotrahd','\u2912':'UpArrowBar','\u2913':'DownArrowBar','\u2916':'Rarrtl','\u2919':'latail','\u291A':'ratail','\u291B':'lAtail','\u291C':'rAtail','\u291D':'larrfs','\u291E':'rarrfs','\u291F':'larrbfs','\u2920':'rarrbfs','\u2923':'nwarhk','\u2924':'nearhk','\u2925':'searhk','\u2926':'swarhk','\u2927':'nwnear','\u2928':'toea','\u2929':'tosa','\u292A':'swnwar','\u2933':'rarrc','\u2933\u0338':'nrarrc','\u2935':'cudarrr','\u2936':'ldca','\u2937':'rdca','\u2938':'cudarrl','\u2939':'larrpl','\u293C':'curarrm','\u293D':'cularrp','\u2945':'rarrpl','\u2948':'harrcir','\u2949':'Uarrocir','\u294A':'lurdshar','\u294B':'ldrushar','\u294E':'LeftRightVector','\u294F':'RightUpDownVector','\u2950':'DownLeftRightVector','\u2951':'LeftUpDownVector','\u2952':'LeftVectorBar','\u2953':'RightVectorBar','\u2954':'RightUpVectorBar','\u2955':'RightDownVectorBar','\u2956':'DownLeftVectorBar','\u2957':'DownRightVectorBar','\u2958':'LeftUpVectorBar','\u2959':'LeftDownVectorBar','\u295A':'LeftTeeVector','\u295B':'RightTeeVector','\u295C':'RightUpTeeVector','\u295D':'RightDownTeeVector','\u295E':'DownLeftTeeVector','\u295F':'DownRightTeeVector','\u2960':'LeftUpTeeVector','\u2961':'LeftDownTeeVector','\u2962':'lHar','\u2963':'uHar','\u2964':'rHar','\u2965':'dHar','\u2966':'luruhar','\u2967':'ldrdhar','\u2968':'ruluhar','\u2969':'rdldhar','\u296A':'lharul','\u296B':'llhard','\u296C':'rharul','\u296D':'lrhard','\u296E':'udhar','\u296F':'duhar','\u2970':'RoundImplies','\u2971':'erarr','\u2972':'simrarr','\u2973':'larrsim','\u2974':'rarrsim','\u2975':'rarrap','\u2976':'ltlarr','\u2978':'gtrarr','\u2979':'subrarr','\u297B':'suplarr','\u297C':'lfisht','\u297D':'rfisht','\u297E':'ufisht','\u297F':'dfisht','\u299A':'vzigzag','\u299C':'vangrt','\u299D':'angrtvbd','\u29A4':'ange','\u29A5':'range','\u29A6':'dwangle','\u29A7':'uwangle','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u29B0':'bemptyv','\u29B1':'demptyv','\u29B2':'cemptyv','\u29B3':'raemptyv','\u29B4':'laemptyv','\u29B5':'ohbar','\u29B6':'omid','\u29B7':'opar','\u29B9':'operp','\u29BB':'olcross','\u29BC':'odsold','\u29BE':'olcir','\u29BF':'ofcir','\u29C0':'olt','\u29C1':'ogt','\u29C2':'cirscir','\u29C3':'cirE','\u29C4':'solb','\u29C5':'bsolb','\u29C9':'boxbox','\u29CD':'trisb','\u29CE':'rtriltri','\u29CF':'LeftTriangleBar','\u29CF\u0338':'NotLeftTriangleBar','\u29D0':'RightTriangleBar','\u29D0\u0338':'NotRightTriangleBar','\u29DC':'iinfin','\u29DD':'infintie','\u29DE':'nvinfin','\u29E3':'eparsl','\u29E4':'smeparsl','\u29E5':'eqvparsl','\u29EB':'lozf','\u29F4':'RuleDelayed','\u29F6':'dsol','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A04':'xuplus','\u2A06':'xsqcup','\u2A0D':'fpartint','\u2A10':'cirfnint','\u2A11':'awint','\u2A12':'rppolint','\u2A13':'scpolint','\u2A14':'npolint','\u2A15':'pointint','\u2A16':'quatint','\u2A17':'intlarhk','\u2A22':'pluscir','\u2A23':'plusacir','\u2A24':'simplus','\u2A25':'plusdu','\u2A26':'plussim','\u2A27':'plustwo','\u2A29':'mcomma','\u2A2A':'minusdu','\u2A2D':'loplus','\u2A2E':'roplus','\u2A2F':'Cross','\u2A30':'timesd','\u2A31':'timesbar','\u2A33':'smashp','\u2A34':'lotimes','\u2A35':'rotimes','\u2A36':'otimesas','\u2A37':'Otimes','\u2A38':'odiv','\u2A39':'triplus','\u2A3A':'triminus','\u2A3B':'tritime','\u2A3C':'iprod','\u2A3F':'amalg','\u2A40':'capdot','\u2A42':'ncup','\u2A43':'ncap','\u2A44':'capand','\u2A45':'cupor','\u2A46':'cupcap','\u2A47':'capcup','\u2A48':'cupbrcap','\u2A49':'capbrcup','\u2A4A':'cupcup','\u2A4B':'capcap','\u2A4C':'ccups','\u2A4D':'ccaps','\u2A50':'ccupssm','\u2A53':'And','\u2A54':'Or','\u2A55':'andand','\u2A56':'oror','\u2A57':'orslope','\u2A58':'andslope','\u2A5A':'andv','\u2A5B':'orv','\u2A5C':'andd','\u2A5D':'ord','\u2A5F':'wedbar','\u2A66':'sdote','\u2A6A':'simdot','\u2A6D':'congdot','\u2A6D\u0338':'ncongdot','\u2A6E':'easter','\u2A6F':'apacir','\u2A70':'apE','\u2A70\u0338':'napE','\u2A71':'eplus','\u2A72':'pluse','\u2A73':'Esim','\u2A77':'eDDot','\u2A78':'equivDD','\u2A79':'ltcir','\u2A7A':'gtcir','\u2A7B':'ltquest','\u2A7C':'gtquest','\u2A7D':'les','\u2A7D\u0338':'nles','\u2A7E':'ges','\u2A7E\u0338':'nges','\u2A7F':'lesdot','\u2A80':'gesdot','\u2A81':'lesdoto','\u2A82':'gesdoto','\u2A83':'lesdotor','\u2A84':'gesdotol','\u2A85':'lap','\u2A86':'gap','\u2A87':'lne','\u2A88':'gne','\u2A89':'lnap','\u2A8A':'gnap','\u2A8B':'lEg','\u2A8C':'gEl','\u2A8D':'lsime','\u2A8E':'gsime','\u2A8F':'lsimg','\u2A90':'gsiml','\u2A91':'lgE','\u2A92':'glE','\u2A93':'lesges','\u2A94':'gesles','\u2A95':'els','\u2A96':'egs','\u2A97':'elsdot','\u2A98':'egsdot','\u2A99':'el','\u2A9A':'eg','\u2A9D':'siml','\u2A9E':'simg','\u2A9F':'simlE','\u2AA0':'simgE','\u2AA1':'LessLess','\u2AA1\u0338':'NotNestedLessLess','\u2AA2':'GreaterGreater','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA4':'glj','\u2AA5':'gla','\u2AA6':'ltcc','\u2AA7':'gtcc','\u2AA8':'lescc','\u2AA9':'gescc','\u2AAA':'smt','\u2AAB':'lat','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u2AAD':'late','\u2AAD\uFE00':'lates','\u2AAE':'bumpE','\u2AAF':'pre','\u2AAF\u0338':'npre','\u2AB0':'sce','\u2AB0\u0338':'nsce','\u2AB3':'prE','\u2AB4':'scE','\u2AB5':'prnE','\u2AB6':'scnE','\u2AB7':'prap','\u2AB8':'scap','\u2AB9':'prnap','\u2ABA':'scnap','\u2ABB':'Pr','\u2ABC':'Sc','\u2ABD':'subdot','\u2ABE':'supdot','\u2ABF':'subplus','\u2AC0':'supplus','\u2AC1':'submult','\u2AC2':'supmult','\u2AC3':'subedot','\u2AC4':'supedot','\u2AC5':'subE','\u2AC5\u0338':'nsubE','\u2AC6':'supE','\u2AC6\u0338':'nsupE','\u2AC7':'subsim','\u2AC8':'supsim','\u2ACB\uFE00':'vsubnE','\u2ACB':'subnE','\u2ACC\uFE00':'vsupnE','\u2ACC':'supnE','\u2ACF':'csub','\u2AD0':'csup','\u2AD1':'csube','\u2AD2':'csupe','\u2AD3':'subsup','\u2AD4':'supsub','\u2AD5':'subsub','\u2AD6':'supsup','\u2AD7':'suphsub','\u2AD8':'supdsub','\u2AD9':'forkv','\u2ADA':'topfork','\u2ADB':'mlcp','\u2AE4':'Dashv','\u2AE6':'Vdashl','\u2AE7':'Barv','\u2AE8':'vBar','\u2AE9':'vBarv','\u2AEB':'Vbar','\u2AEC':'Not','\u2AED':'bNot','\u2AEE':'rnmid','\u2AEF':'cirmid','\u2AF0':'midcir','\u2AF1':'topcir','\u2AF2':'nhpar','\u2AF3':'parsim','\u2AFD':'parsl','\u2AFD\u20E5':'nparsl','\u266D':'flat','\u266E':'natur','\u266F':'sharp','\xA4':'curren','\xA2':'cent','$':'dollar','\xA3':'pound','\xA5':'yen','\u20AC':'euro','\xB9':'sup1','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\xB2':'sup2','\u2154':'frac23','\u2156':'frac25','\xB3':'sup3','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\uD835\uDCB6':'ascr','\uD835\uDD52':'aopf','\uD835\uDD1E':'afr','\uD835\uDD38':'Aopf','\uD835\uDD04':'Afr','\uD835\uDC9C':'Ascr','\xAA':'ordf','\xE1':'aacute','\xC1':'Aacute','\xE0':'agrave','\xC0':'Agrave','\u0103':'abreve','\u0102':'Abreve','\xE2':'acirc','\xC2':'Acirc','\xE5':'aring','\xC5':'angst','\xE4':'auml','\xC4':'Auml','\xE3':'atilde','\xC3':'Atilde','\u0105':'aogon','\u0104':'Aogon','\u0101':'amacr','\u0100':'Amacr','\xE6':'aelig','\xC6':'AElig','\uD835\uDCB7':'bscr','\uD835\uDD53':'bopf','\uD835\uDD1F':'bfr','\uD835\uDD39':'Bopf','\u212C':'Bscr','\uD835\uDD05':'Bfr','\uD835\uDD20':'cfr','\uD835\uDCB8':'cscr','\uD835\uDD54':'copf','\u212D':'Cfr','\uD835\uDC9E':'Cscr','\u2102':'Copf','\u0107':'cacute','\u0106':'Cacute','\u0109':'ccirc','\u0108':'Ccirc','\u010D':'ccaron','\u010C':'Ccaron','\u010B':'cdot','\u010A':'Cdot','\xE7':'ccedil','\xC7':'Ccedil','\u2105':'incare','\uD835\uDD21':'dfr','\u2146':'dd','\uD835\uDD55':'dopf','\uD835\uDCB9':'dscr','\uD835\uDC9F':'Dscr','\uD835\uDD07':'Dfr','\u2145':'DD','\uD835\uDD3B':'Dopf','\u010F':'dcaron','\u010E':'Dcaron','\u0111':'dstrok','\u0110':'Dstrok','\xF0':'eth','\xD0':'ETH','\u2147':'ee','\u212F':'escr','\uD835\uDD22':'efr','\uD835\uDD56':'eopf','\u2130':'Escr','\uD835\uDD08':'Efr','\uD835\uDD3C':'Eopf','\xE9':'eacute','\xC9':'Eacute','\xE8':'egrave','\xC8':'Egrave','\xEA':'ecirc','\xCA':'Ecirc','\u011B':'ecaron','\u011A':'Ecaron','\xEB':'euml','\xCB':'Euml','\u0117':'edot','\u0116':'Edot','\u0119':'eogon','\u0118':'Eogon','\u0113':'emacr','\u0112':'Emacr','\uD835\uDD23':'ffr','\uD835\uDD57':'fopf','\uD835\uDCBB':'fscr','\uD835\uDD09':'Ffr','\uD835\uDD3D':'Fopf','\u2131':'Fscr','\uFB00':'fflig','\uFB03':'ffilig','\uFB04':'ffllig','\uFB01':'filig','fj':'fjlig','\uFB02':'fllig','\u0192':'fnof','\u210A':'gscr','\uD835\uDD58':'gopf','\uD835\uDD24':'gfr','\uD835\uDCA2':'Gscr','\uD835\uDD3E':'Gopf','\uD835\uDD0A':'Gfr','\u01F5':'gacute','\u011F':'gbreve','\u011E':'Gbreve','\u011D':'gcirc','\u011C':'Gcirc','\u0121':'gdot','\u0120':'Gdot','\u0122':'Gcedil','\uD835\uDD25':'hfr','\u210E':'planckh','\uD835\uDCBD':'hscr','\uD835\uDD59':'hopf','\u210B':'Hscr','\u210C':'Hfr','\u210D':'Hopf','\u0125':'hcirc','\u0124':'Hcirc','\u210F':'hbar','\u0127':'hstrok','\u0126':'Hstrok','\uD835\uDD5A':'iopf','\uD835\uDD26':'ifr','\uD835\uDCBE':'iscr','\u2148':'ii','\uD835\uDD40':'Iopf','\u2110':'Iscr','\u2111':'Im','\xED':'iacute','\xCD':'Iacute','\xEC':'igrave','\xCC':'Igrave','\xEE':'icirc','\xCE':'Icirc','\xEF':'iuml','\xCF':'Iuml','\u0129':'itilde','\u0128':'Itilde','\u0130':'Idot','\u012F':'iogon','\u012E':'Iogon','\u012B':'imacr','\u012A':'Imacr','\u0133':'ijlig','\u0132':'IJlig','\u0131':'imath','\uD835\uDCBF':'jscr','\uD835\uDD5B':'jopf','\uD835\uDD27':'jfr','\uD835\uDCA5':'Jscr','\uD835\uDD0D':'Jfr','\uD835\uDD41':'Jopf','\u0135':'jcirc','\u0134':'Jcirc','\u0237':'jmath','\uD835\uDD5C':'kopf','\uD835\uDCC0':'kscr','\uD835\uDD28':'kfr','\uD835\uDCA6':'Kscr','\uD835\uDD42':'Kopf','\uD835\uDD0E':'Kfr','\u0137':'kcedil','\u0136':'Kcedil','\uD835\uDD29':'lfr','\uD835\uDCC1':'lscr','\u2113':'ell','\uD835\uDD5D':'lopf','\u2112':'Lscr','\uD835\uDD0F':'Lfr','\uD835\uDD43':'Lopf','\u013A':'lacute','\u0139':'Lacute','\u013E':'lcaron','\u013D':'Lcaron','\u013C':'lcedil','\u013B':'Lcedil','\u0142':'lstrok','\u0141':'Lstrok','\u0140':'lmidot','\u013F':'Lmidot','\uD835\uDD2A':'mfr','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\uD835\uDD10':'Mfr','\uD835\uDD44':'Mopf','\u2133':'Mscr','\uD835\uDD2B':'nfr','\uD835\uDD5F':'nopf','\uD835\uDCC3':'nscr','\u2115':'Nopf','\uD835\uDCA9':'Nscr','\uD835\uDD11':'Nfr','\u0144':'nacute','\u0143':'Nacute','\u0148':'ncaron','\u0147':'Ncaron','\xF1':'ntilde','\xD1':'Ntilde','\u0146':'ncedil','\u0145':'Ncedil','\u2116':'numero','\u014B':'eng','\u014A':'ENG','\uD835\uDD60':'oopf','\uD835\uDD2C':'ofr','\u2134':'oscr','\uD835\uDCAA':'Oscr','\uD835\uDD12':'Ofr','\uD835\uDD46':'Oopf','\xBA':'ordm','\xF3':'oacute','\xD3':'Oacute','\xF2':'ograve','\xD2':'Ograve','\xF4':'ocirc','\xD4':'Ocirc','\xF6':'ouml','\xD6':'Ouml','\u0151':'odblac','\u0150':'Odblac','\xF5':'otilde','\xD5':'Otilde','\xF8':'oslash','\xD8':'Oslash','\u014D':'omacr','\u014C':'Omacr','\u0153':'oelig','\u0152':'OElig','\uD835\uDD2D':'pfr','\uD835\uDCC5':'pscr','\uD835\uDD61':'popf','\u2119':'Popf','\uD835\uDD13':'Pfr','\uD835\uDCAB':'Pscr','\uD835\uDD62':'qopf','\uD835\uDD2E':'qfr','\uD835\uDCC6':'qscr','\uD835\uDCAC':'Qscr','\uD835\uDD14':'Qfr','\u211A':'Qopf','\u0138':'kgreen','\uD835\uDD2F':'rfr','\uD835\uDD63':'ropf','\uD835\uDCC7':'rscr','\u211B':'Rscr','\u211C':'Re','\u211D':'Ropf','\u0155':'racute','\u0154':'Racute','\u0159':'rcaron','\u0158':'Rcaron','\u0157':'rcedil','\u0156':'Rcedil','\uD835\uDD64':'sopf','\uD835\uDCC8':'sscr','\uD835\uDD30':'sfr','\uD835\uDD4A':'Sopf','\uD835\uDD16':'Sfr','\uD835\uDCAE':'Sscr','\u24C8':'oS','\u015B':'sacute','\u015A':'Sacute','\u015D':'scirc','\u015C':'Scirc','\u0161':'scaron','\u0160':'Scaron','\u015F':'scedil','\u015E':'Scedil','\xDF':'szlig','\uD835\uDD31':'tfr','\uD835\uDCC9':'tscr','\uD835\uDD65':'topf','\uD835\uDCAF':'Tscr','\uD835\uDD17':'Tfr','\uD835\uDD4B':'Topf','\u0165':'tcaron','\u0164':'Tcaron','\u0163':'tcedil','\u0162':'Tcedil','\u2122':'trade','\u0167':'tstrok','\u0166':'Tstrok','\uD835\uDCCA':'uscr','\uD835\uDD66':'uopf','\uD835\uDD32':'ufr','\uD835\uDD4C':'Uopf','\uD835\uDD18':'Ufr','\uD835\uDCB0':'Uscr','\xFA':'uacute','\xDA':'Uacute','\xF9':'ugrave','\xD9':'Ugrave','\u016D':'ubreve','\u016C':'Ubreve','\xFB':'ucirc','\xDB':'Ucirc','\u016F':'uring','\u016E':'Uring','\xFC':'uuml','\xDC':'Uuml','\u0171':'udblac','\u0170':'Udblac','\u0169':'utilde','\u0168':'Utilde','\u0173':'uogon','\u0172':'Uogon','\u016B':'umacr','\u016A':'Umacr','\uD835\uDD33':'vfr','\uD835\uDD67':'vopf','\uD835\uDCCB':'vscr','\uD835\uDD19':'Vfr','\uD835\uDD4D':'Vopf','\uD835\uDCB1':'Vscr','\uD835\uDD68':'wopf','\uD835\uDCCC':'wscr','\uD835\uDD34':'wfr','\uD835\uDCB2':'Wscr','\uD835\uDD4E':'Wopf','\uD835\uDD1A':'Wfr','\u0175':'wcirc','\u0174':'Wcirc','\uD835\uDD35':'xfr','\uD835\uDCCD':'xscr','\uD835\uDD69':'xopf','\uD835\uDD4F':'Xopf','\uD835\uDD1B':'Xfr','\uD835\uDCB3':'Xscr','\uD835\uDD36':'yfr','\uD835\uDCCE':'yscr','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDD1C':'Yfr','\uD835\uDD50':'Yopf','\xFD':'yacute','\xDD':'Yacute','\u0177':'ycirc','\u0176':'Ycirc','\xFF':'yuml','\u0178':'Yuml','\uD835\uDCCF':'zscr','\uD835\uDD37':'zfr','\uD835\uDD6B':'zopf','\u2128':'Zfr','\u2124':'Zopf','\uD835\uDCB5':'Zscr','\u017A':'zacute','\u0179':'Zacute','\u017E':'zcaron','\u017D':'Zcaron','\u017C':'zdot','\u017B':'Zdot','\u01B5':'imped','\xFE':'thorn','\xDE':'THORN','\u0149':'napos','\u03B1':'alpha','\u0391':'Alpha','\u03B2':'beta','\u0392':'Beta','\u03B3':'gamma','\u0393':'Gamma','\u03B4':'delta','\u0394':'Delta','\u03B5':'epsi','\u03F5':'epsiv','\u0395':'Epsilon','\u03DD':'gammad','\u03DC':'Gammad','\u03B6':'zeta','\u0396':'Zeta','\u03B7':'eta','\u0397':'Eta','\u03B8':'theta','\u03D1':'thetav','\u0398':'Theta','\u03B9':'iota','\u0399':'Iota','\u03BA':'kappa','\u03F0':'kappav','\u039A':'Kappa','\u03BB':'lambda','\u039B':'Lambda','\u03BC':'mu','\xB5':'micro','\u039C':'Mu','\u03BD':'nu','\u039D':'Nu','\u03BE':'xi','\u039E':'Xi','\u03BF':'omicron','\u039F':'Omicron','\u03C0':'pi','\u03D6':'piv','\u03A0':'Pi','\u03C1':'rho','\u03F1':'rhov','\u03A1':'Rho','\u03C3':'sigma','\u03A3':'Sigma','\u03C2':'sigmaf','\u03C4':'tau','\u03A4':'Tau','\u03C5':'upsi','\u03A5':'Upsilon','\u03D2':'Upsi','\u03C6':'phi','\u03D5':'phiv','\u03A6':'Phi','\u03C7':'chi','\u03A7':'Chi','\u03C8':'psi','\u03A8':'Psi','\u03C9':'omega','\u03A9':'ohm','\u0430':'acy','\u0410':'Acy','\u0431':'bcy','\u0411':'Bcy','\u0432':'vcy','\u0412':'Vcy','\u0433':'gcy','\u0413':'Gcy','\u0453':'gjcy','\u0403':'GJcy','\u0434':'dcy','\u0414':'Dcy','\u0452':'djcy','\u0402':'DJcy','\u0435':'iecy','\u0415':'IEcy','\u0451':'iocy','\u0401':'IOcy','\u0454':'jukcy','\u0404':'Jukcy','\u0436':'zhcy','\u0416':'ZHcy','\u0437':'zcy','\u0417':'Zcy','\u0455':'dscy','\u0405':'DScy','\u0438':'icy','\u0418':'Icy','\u0456':'iukcy','\u0406':'Iukcy','\u0457':'yicy','\u0407':'YIcy','\u0439':'jcy','\u0419':'Jcy','\u0458':'jsercy','\u0408':'Jsercy','\u043A':'kcy','\u041A':'Kcy','\u045C':'kjcy','\u040C':'KJcy','\u043B':'lcy','\u041B':'Lcy','\u0459':'ljcy','\u0409':'LJcy','\u043C':'mcy','\u041C':'Mcy','\u043D':'ncy','\u041D':'Ncy','\u045A':'njcy','\u040A':'NJcy','\u043E':'ocy','\u041E':'Ocy','\u043F':'pcy','\u041F':'Pcy','\u0440':'rcy','\u0420':'Rcy','\u0441':'scy','\u0421':'Scy','\u0442':'tcy','\u0422':'Tcy','\u045B':'tshcy','\u040B':'TSHcy','\u0443':'ucy','\u0423':'Ucy','\u045E':'ubrcy','\u040E':'Ubrcy','\u0444':'fcy','\u0424':'Fcy','\u0445':'khcy','\u0425':'KHcy','\u0446':'tscy','\u0426':'TScy','\u0447':'chcy','\u0427':'CHcy','\u045F':'dzcy','\u040F':'DZcy','\u0448':'shcy','\u0428':'SHcy','\u0449':'shchcy','\u0429':'SHCHcy','\u044A':'hardcy','\u042A':'HARDcy','\u044B':'ycy','\u042B':'Ycy','\u044C':'softcy','\u042C':'SOFTcy','\u044D':'ecy','\u042D':'Ecy','\u044E':'yucy','\u042E':'YUcy','\u044F':'yacy','\u042F':'YAcy','\u2135':'aleph','\u2136':'beth','\u2137':'gimel','\u2138':'daleth'};
  4008. var regexEscape = /["&'<>`]/g;
  4009. var escapeMap = {
  4010. '"': '&quot;',
  4011. '&': '&amp;',
  4012. '\'': '&#x27;',
  4013. '<': '&lt;',
  4014. // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
  4015. // following is not strictly necessary unless it’s part of a tag or an
  4016. // unquoted attribute value. We’re only escaping it to support those
  4017. // situations, and for XML support.
  4018. '>': '&gt;',
  4019. // In Internet Explorer ≤ 8, the backtick character can be used
  4020. // to break out of (un)quoted attribute values or HTML comments.
  4021. // See http://html5sec.org/#102, http://html5sec.org/#108, and
  4022. // http://html5sec.org/#133.
  4023. '`': '&#x60;'
  4024. };
  4025. var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;
  4026. var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  4027. var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;
  4028. var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};
  4029. var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};
  4030. var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};
  4031. var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];
  4032. /*--------------------------------------------------------------------------*/
  4033. var stringFromCharCode = String.fromCharCode;
  4034. var object = {};
  4035. var hasOwnProperty = object.hasOwnProperty;
  4036. var has = function(object, propertyName) {
  4037. return hasOwnProperty.call(object, propertyName);
  4038. };
  4039. var contains = function(array, value) {
  4040. var index = -1;
  4041. var length = array.length;
  4042. while (++index < length) {
  4043. if (array[index] == value) {
  4044. return true;
  4045. }
  4046. }
  4047. return false;
  4048. };
  4049. var merge = function(options, defaults) {
  4050. if (!options) {
  4051. return defaults;
  4052. }
  4053. var result = {};
  4054. var key;
  4055. for (key in defaults) {
  4056. // A `hasOwnProperty` check is not needed here, since only recognized
  4057. // option names are used anyway. Any others are ignored.
  4058. result[key] = has(options, key) ? options[key] : defaults[key];
  4059. }
  4060. return result;
  4061. };
  4062. // Modified version of `ucs2encode`; see https://mths.be/punycode.
  4063. var codePointToSymbol = function(codePoint, strict) {
  4064. var output = '';
  4065. if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {
  4066. // See issue #4:
  4067. // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is
  4068. // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD
  4069. // REPLACEMENT CHARACTER.”
  4070. if (strict) {
  4071. parseError('character reference outside the permissible Unicode range');
  4072. }
  4073. return '\uFFFD';
  4074. }
  4075. if (has(decodeMapNumeric, codePoint)) {
  4076. if (strict) {
  4077. parseError('disallowed character reference');
  4078. }
  4079. return decodeMapNumeric[codePoint];
  4080. }
  4081. if (strict && contains(invalidReferenceCodePoints, codePoint)) {
  4082. parseError('disallowed character reference');
  4083. }
  4084. if (codePoint > 0xFFFF) {
  4085. codePoint -= 0x10000;
  4086. output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
  4087. codePoint = 0xDC00 | codePoint & 0x3FF;
  4088. }
  4089. output += stringFromCharCode(codePoint);
  4090. return output;
  4091. };
  4092. var hexEscape = function(codePoint) {
  4093. return '&#x' + codePoint.toString(16).toUpperCase() + ';';
  4094. };
  4095. var decEscape = function(codePoint) {
  4096. return '&#' + codePoint + ';';
  4097. };
  4098. var parseError = function(message) {
  4099. throw Error('Parse error: ' + message);
  4100. };
  4101. /*--------------------------------------------------------------------------*/
  4102. var encode = function(string, options) {
  4103. options = merge(options, encode.options);
  4104. var strict = options.strict;
  4105. if (strict && regexInvalidRawCodePoint.test(string)) {
  4106. parseError('forbidden code point');
  4107. }
  4108. var encodeEverything = options.encodeEverything;
  4109. var useNamedReferences = options.useNamedReferences;
  4110. var allowUnsafeSymbols = options.allowUnsafeSymbols;
  4111. var escapeCodePoint = options.decimal ? decEscape : hexEscape;
  4112. var escapeBmpSymbol = function(symbol) {
  4113. return escapeCodePoint(symbol.charCodeAt(0));
  4114. };
  4115. if (encodeEverything) {
  4116. // Encode ASCII symbols.
  4117. string = string.replace(regexAsciiWhitelist, function(symbol) {
  4118. // Use named references if requested & possible.
  4119. if (useNamedReferences && has(encodeMap, symbol)) {
  4120. return '&' + encodeMap[symbol] + ';';
  4121. }
  4122. return escapeBmpSymbol(symbol);
  4123. });
  4124. // Shorten a few escapes that represent two symbols, of which at least one
  4125. // is within the ASCII range.
  4126. if (useNamedReferences) {
  4127. string = string
  4128. .replace(/&gt;\u20D2/g, '&nvgt;')
  4129. .replace(/&lt;\u20D2/g, '&nvlt;')
  4130. .replace(/&#x66;&#x6A;/g, '&fjlig;');
  4131. }
  4132. // Encode non-ASCII symbols.
  4133. if (useNamedReferences) {
  4134. // Encode non-ASCII symbols that can be replaced with a named reference.
  4135. string = string.replace(regexEncodeNonAscii, function(string) {
  4136. // Note: there is no need to check `has(encodeMap, string)` here.
  4137. return '&' + encodeMap[string] + ';';
  4138. });
  4139. }
  4140. // Note: any remaining non-ASCII symbols are handled outside of the `if`.
  4141. } else if (useNamedReferences) {
  4142. // Apply named character references.
  4143. // Encode `<>"'&` using named character references.
  4144. if (!allowUnsafeSymbols) {
  4145. string = string.replace(regexEscape, function(string) {
  4146. return '&' + encodeMap[string] + ';'; // no need to check `has()` here
  4147. });
  4148. }
  4149. // Shorten escapes that represent two symbols, of which at least one is
  4150. // `<>"'&`.
  4151. string = string
  4152. .replace(/&gt;\u20D2/g, '&nvgt;')
  4153. .replace(/&lt;\u20D2/g, '&nvlt;');
  4154. // Encode non-ASCII symbols that can be replaced with a named reference.
  4155. string = string.replace(regexEncodeNonAscii, function(string) {
  4156. // Note: there is no need to check `has(encodeMap, string)` here.
  4157. return '&' + encodeMap[string] + ';';
  4158. });
  4159. } else if (!allowUnsafeSymbols) {
  4160. // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled
  4161. // using named character references.
  4162. string = string.replace(regexEscape, escapeBmpSymbol);
  4163. }
  4164. return string
  4165. // Encode astral symbols.
  4166. .replace(regexAstralSymbols, function($0) {
  4167. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  4168. var high = $0.charCodeAt(0);
  4169. var low = $0.charCodeAt(1);
  4170. var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
  4171. return escapeCodePoint(codePoint);
  4172. })
  4173. // Encode any remaining BMP symbols that are not printable ASCII symbols
  4174. // using a hexadecimal escape.
  4175. .replace(regexBmpWhitelist, escapeBmpSymbol);
  4176. };
  4177. // Expose default options (so they can be overridden globally).
  4178. encode.options = {
  4179. 'allowUnsafeSymbols': false,
  4180. 'encodeEverything': false,
  4181. 'strict': false,
  4182. 'useNamedReferences': false,
  4183. 'decimal' : false
  4184. };
  4185. var decode = function(html, options) {
  4186. options = merge(options, decode.options);
  4187. var strict = options.strict;
  4188. if (strict && regexInvalidEntity.test(html)) {
  4189. parseError('malformed character reference');
  4190. }
  4191. return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7, $8) {
  4192. var codePoint;
  4193. var semicolon;
  4194. var decDigits;
  4195. var hexDigits;
  4196. var reference;
  4197. var next;
  4198. if ($1) {
  4199. reference = $1;
  4200. // Note: there is no need to check `has(decodeMap, reference)`.
  4201. return decodeMap[reference];
  4202. }
  4203. if ($2) {
  4204. // Decode named character references without trailing `;`, e.g. `&amp`.
  4205. // This is only a parse error if it gets converted to `&`, or if it is
  4206. // followed by `=` in an attribute context.
  4207. reference = $2;
  4208. next = $3;
  4209. if (next && options.isAttributeValue) {
  4210. if (strict && next == '=') {
  4211. parseError('`&` did not start a character reference');
  4212. }
  4213. return $0;
  4214. } else {
  4215. if (strict) {
  4216. parseError(
  4217. 'named character reference was not terminated by a semicolon'
  4218. );
  4219. }
  4220. // Note: there is no need to check `has(decodeMapLegacy, reference)`.
  4221. return decodeMapLegacy[reference] + (next || '');
  4222. }
  4223. }
  4224. if ($4) {
  4225. // Decode decimal escapes, e.g. `&#119558;`.
  4226. decDigits = $4;
  4227. semicolon = $5;
  4228. if (strict && !semicolon) {
  4229. parseError('character reference was not terminated by a semicolon');
  4230. }
  4231. codePoint = parseInt(decDigits, 10);
  4232. return codePointToSymbol(codePoint, strict);
  4233. }
  4234. if ($6) {
  4235. // Decode hexadecimal escapes, e.g. `&#x1D306;`.
  4236. hexDigits = $6;
  4237. semicolon = $7;
  4238. if (strict && !semicolon) {
  4239. parseError('character reference was not terminated by a semicolon');
  4240. }
  4241. codePoint = parseInt(hexDigits, 16);
  4242. return codePointToSymbol(codePoint, strict);
  4243. }
  4244. // If we’re still here, `if ($7)` is implied; it’s an ambiguous
  4245. // ampersand for sure. https://mths.be/notes/ambiguous-ampersands
  4246. if (strict) {
  4247. parseError(
  4248. 'named character reference was not terminated by a semicolon'
  4249. );
  4250. }
  4251. return $0;
  4252. });
  4253. };
  4254. // Expose default options (so they can be overridden globally).
  4255. decode.options = {
  4256. 'isAttributeValue': false,
  4257. 'strict': false
  4258. };
  4259. var escape = function(string) {
  4260. return string.replace(regexEscape, function($0) {
  4261. // Note: there is no need to check `has(escapeMap, $0)` here.
  4262. return escapeMap[$0];
  4263. });
  4264. };
  4265. /*--------------------------------------------------------------------------*/
  4266. var he = {
  4267. 'version': '1.2.0',
  4268. 'encode': encode,
  4269. 'decode': decode,
  4270. 'escape': escape,
  4271. 'unescape': decode
  4272. };
  4273. // Some AMD build optimizers, like r.js, check for specific condition patterns
  4274. // like the following:
  4275. if (freeExports && !freeExports.nodeType) {
  4276. if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
  4277. freeModule.exports = he;
  4278. } else { // in Narwhal or RingoJS v0.7.0-
  4279. for (var key in he) {
  4280. has(he, key) && (freeExports[key] = he[key]);
  4281. }
  4282. }
  4283. } else { // in Rhino or a web browser
  4284. root.he = he;
  4285. }
  4286. }(commonjsGlobal));
  4287. } (he$1, he$1.exports));
  4288. var he = he$1.exports;
  4289. /**
  4290. * Cross-platform code generation for component v-model
  4291. */
  4292. function genComponentModel(el, value, modifiers) {
  4293. var _a = modifiers || {}, number = _a.number, trim = _a.trim;
  4294. var baseValueExpression = '$$v';
  4295. var valueExpression = baseValueExpression;
  4296. if (trim) {
  4297. valueExpression =
  4298. "(typeof ".concat(baseValueExpression, " === 'string'") +
  4299. "? ".concat(baseValueExpression, ".trim()") +
  4300. ": ".concat(baseValueExpression, ")");
  4301. }
  4302. if (number) {
  4303. valueExpression = "_n(".concat(valueExpression, ")");
  4304. }
  4305. var assignment = genAssignmentCode(value, valueExpression);
  4306. el.model = {
  4307. value: "(".concat(value, ")"),
  4308. expression: JSON.stringify(value),
  4309. callback: "function (".concat(baseValueExpression, ") {").concat(assignment, "}")
  4310. };
  4311. }
  4312. /**
  4313. * Cross-platform codegen helper for generating v-model value assignment code.
  4314. */
  4315. function genAssignmentCode(value, assignment) {
  4316. var res = parseModel(value);
  4317. if (res.key === null) {
  4318. return "".concat(value, "=").concat(assignment);
  4319. }
  4320. else {
  4321. return "$set(".concat(res.exp, ", ").concat(res.key, ", ").concat(assignment, ")");
  4322. }
  4323. }
  4324. /**
  4325. * Parse a v-model expression into a base path and a final key segment.
  4326. * Handles both dot-path and possible square brackets.
  4327. *
  4328. * Possible cases:
  4329. *
  4330. * - test
  4331. * - test[key]
  4332. * - test[test1[key]]
  4333. * - test["a"][key]
  4334. * - xxx.test[a[a].test1[key]]
  4335. * - test.xxx.a["asa"][test1[key]]
  4336. *
  4337. */
  4338. var len, str, chr, index, expressionPos, expressionEndPos;
  4339. function parseModel(val) {
  4340. // Fix https://github.com/vuejs/vue/pull/7730
  4341. // allow v-model="obj.val " (trailing whitespace)
  4342. val = val.trim();
  4343. len = val.length;
  4344. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  4345. index = val.lastIndexOf('.');
  4346. if (index > -1) {
  4347. return {
  4348. exp: val.slice(0, index),
  4349. key: '"' + val.slice(index + 1) + '"'
  4350. };
  4351. }
  4352. else {
  4353. return {
  4354. exp: val,
  4355. key: null
  4356. };
  4357. }
  4358. }
  4359. str = val;
  4360. index = expressionPos = expressionEndPos = 0;
  4361. while (!eof()) {
  4362. chr = next();
  4363. /* istanbul ignore if */
  4364. if (isStringStart(chr)) {
  4365. parseString(chr);
  4366. }
  4367. else if (chr === 0x5b) {
  4368. parseBracket(chr);
  4369. }
  4370. }
  4371. return {
  4372. exp: val.slice(0, expressionPos),
  4373. key: val.slice(expressionPos + 1, expressionEndPos)
  4374. };
  4375. }
  4376. function next() {
  4377. return str.charCodeAt(++index);
  4378. }
  4379. function eof() {
  4380. return index >= len;
  4381. }
  4382. function isStringStart(chr) {
  4383. return chr === 0x22 || chr === 0x27;
  4384. }
  4385. function parseBracket(chr) {
  4386. var inBracket = 1;
  4387. expressionPos = index;
  4388. while (!eof()) {
  4389. chr = next();
  4390. if (isStringStart(chr)) {
  4391. parseString(chr);
  4392. continue;
  4393. }
  4394. if (chr === 0x5b)
  4395. inBracket++;
  4396. if (chr === 0x5d)
  4397. inBracket--;
  4398. if (inBracket === 0) {
  4399. expressionEndPos = index;
  4400. break;
  4401. }
  4402. }
  4403. }
  4404. function parseString(chr) {
  4405. var stringQuote = chr;
  4406. while (!eof()) {
  4407. chr = next();
  4408. if (chr === stringQuote) {
  4409. break;
  4410. }
  4411. }
  4412. }
  4413. var onRE = /^@|^v-on:/;
  4414. var dirRE = /^v-|^@|^:|^#/;
  4415. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  4416. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  4417. var stripParensRE = /^\(|\)$/g;
  4418. var dynamicArgRE = /^\[.*\]$/;
  4419. var argRE = /:(.*)$/;
  4420. var bindRE = /^:|^\.|^v-bind:/;
  4421. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  4422. var slotRE = /^v-slot(:|$)|^#/;
  4423. var lineBreakRE = /[\r\n]/;
  4424. var whitespaceRE = /[ \f\t\r\n]+/g;
  4425. var invalidAttributeRE = /[\s"'<>\/=]/;
  4426. var decodeHTMLCached = cached(he.decode);
  4427. var emptySlotScopeToken = "_empty_";
  4428. // configurable state
  4429. var warn$1;
  4430. var delimiters;
  4431. var transforms;
  4432. var preTransforms;
  4433. var postTransforms;
  4434. var platformIsPreTag;
  4435. var platformMustUseProp;
  4436. var platformGetTagNamespace;
  4437. var maybeComponent;
  4438. function createASTElement(tag, attrs, parent) {
  4439. return {
  4440. type: 1,
  4441. tag: tag,
  4442. attrsList: attrs,
  4443. attrsMap: makeAttrsMap(attrs),
  4444. rawAttrsMap: {},
  4445. parent: parent,
  4446. children: []
  4447. };
  4448. }
  4449. /**
  4450. * Convert HTML string to AST.
  4451. */
  4452. function parse(template, options) {
  4453. warn$1 = options.warn || baseWarn;
  4454. platformIsPreTag = options.isPreTag || no;
  4455. platformMustUseProp = options.mustUseProp || no;
  4456. platformGetTagNamespace = options.getTagNamespace || no;
  4457. var isReservedTag = options.isReservedTag || no;
  4458. maybeComponent = function (el) {
  4459. return !!(el.component ||
  4460. el.attrsMap[':is'] ||
  4461. el.attrsMap['v-bind:is'] ||
  4462. !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag)));
  4463. };
  4464. transforms = pluckModuleFunction(options.modules, 'transformNode');
  4465. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  4466. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  4467. delimiters = options.delimiters;
  4468. var stack = [];
  4469. var preserveWhitespace = options.preserveWhitespace !== false;
  4470. var whitespaceOption = options.whitespace;
  4471. var root;
  4472. var currentParent;
  4473. var inVPre = false;
  4474. var inPre = false;
  4475. var warned = false;
  4476. function warnOnce(msg, range) {
  4477. if (!warned) {
  4478. warned = true;
  4479. warn$1(msg, range);
  4480. }
  4481. }
  4482. function closeElement(element) {
  4483. trimEndingWhitespace(element);
  4484. if (!inVPre && !element.processed) {
  4485. element = processElement(element, options);
  4486. }
  4487. // tree management
  4488. if (!stack.length && element !== root) {
  4489. // allow root elements with v-if, v-else-if and v-else
  4490. if (root.if && (element.elseif || element.else)) {
  4491. {
  4492. checkRootConstraints(element);
  4493. }
  4494. addIfCondition(root, {
  4495. exp: element.elseif,
  4496. block: element
  4497. });
  4498. }
  4499. else {
  4500. warnOnce("Component template should contain exactly one root element. " +
  4501. "If you are using v-if on multiple elements, " +
  4502. "use v-else-if to chain them instead.", { start: element.start });
  4503. }
  4504. }
  4505. if (currentParent && !element.forbidden) {
  4506. if (element.elseif || element.else) {
  4507. processIfConditions(element, currentParent);
  4508. }
  4509. else {
  4510. if (element.slotScope) {
  4511. // scoped slot
  4512. // keep it in the children list so that v-else(-if) conditions can
  4513. // find it as the prev node.
  4514. var name_1 = element.slotTarget || '"default"';
  4515. (currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name_1] = element;
  4516. }
  4517. currentParent.children.push(element);
  4518. element.parent = currentParent;
  4519. }
  4520. }
  4521. // final children cleanup
  4522. // filter out scoped slots
  4523. element.children = element.children.filter(function (c) { return !c.slotScope; });
  4524. // remove trailing whitespace node again
  4525. trimEndingWhitespace(element);
  4526. // check pre state
  4527. if (element.pre) {
  4528. inVPre = false;
  4529. }
  4530. if (platformIsPreTag(element.tag)) {
  4531. inPre = false;
  4532. }
  4533. // apply post-transforms
  4534. for (var i = 0; i < postTransforms.length; i++) {
  4535. postTransforms[i](element, options);
  4536. }
  4537. }
  4538. function trimEndingWhitespace(el) {
  4539. // remove trailing whitespace node
  4540. if (!inPre) {
  4541. var lastNode = void 0;
  4542. while ((lastNode = el.children[el.children.length - 1]) &&
  4543. lastNode.type === 3 &&
  4544. lastNode.text === ' ') {
  4545. el.children.pop();
  4546. }
  4547. }
  4548. }
  4549. function checkRootConstraints(el) {
  4550. if (el.tag === 'slot' || el.tag === 'template') {
  4551. warnOnce("Cannot use <".concat(el.tag, "> as component root element because it may ") +
  4552. 'contain multiple nodes.', { start: el.start });
  4553. }
  4554. if (el.attrsMap.hasOwnProperty('v-for')) {
  4555. warnOnce('Cannot use v-for on stateful component root element because ' +
  4556. 'it renders multiple elements.', el.rawAttrsMap['v-for']);
  4557. }
  4558. }
  4559. parseHTML(template, {
  4560. warn: warn$1,
  4561. expectHTML: options.expectHTML,
  4562. isUnaryTag: options.isUnaryTag,
  4563. canBeLeftOpenTag: options.canBeLeftOpenTag,
  4564. shouldDecodeNewlines: options.shouldDecodeNewlines,
  4565. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  4566. shouldKeepComment: options.comments,
  4567. outputSourceRange: options.outputSourceRange,
  4568. start: function (tag, attrs, unary, start, end) {
  4569. // check namespace.
  4570. // inherit parent ns if there is one
  4571. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  4572. // handle IE svg bug
  4573. /* istanbul ignore if */
  4574. if (isIE && ns === 'svg') {
  4575. attrs = guardIESVGBug(attrs);
  4576. }
  4577. var element = createASTElement(tag, attrs, currentParent);
  4578. if (ns) {
  4579. element.ns = ns;
  4580. }
  4581. {
  4582. if (options.outputSourceRange) {
  4583. element.start = start;
  4584. element.end = end;
  4585. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  4586. cumulated[attr.name] = attr;
  4587. return cumulated;
  4588. }, {});
  4589. }
  4590. attrs.forEach(function (attr) {
  4591. if (invalidAttributeRE.test(attr.name)) {
  4592. warn$1("Invalid dynamic argument expression: attribute names cannot contain " +
  4593. "spaces, quotes, <, >, / or =.", options.outputSourceRange
  4594. ? {
  4595. start: attr.start + attr.name.indexOf("["),
  4596. end: attr.start + attr.name.length
  4597. }
  4598. : undefined);
  4599. }
  4600. });
  4601. }
  4602. if (isForbiddenTag(element) && !isServerRendering()) {
  4603. element.forbidden = true;
  4604. warn$1('Templates should only be responsible for mapping the state to the ' +
  4605. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  4606. "<".concat(tag, ">") +
  4607. ', as they will not be parsed.', { start: element.start });
  4608. }
  4609. // apply pre-transforms
  4610. for (var i = 0; i < preTransforms.length; i++) {
  4611. element = preTransforms[i](element, options) || element;
  4612. }
  4613. if (!inVPre) {
  4614. processPre(element);
  4615. if (element.pre) {
  4616. inVPre = true;
  4617. }
  4618. }
  4619. if (platformIsPreTag(element.tag)) {
  4620. inPre = true;
  4621. }
  4622. if (inVPre) {
  4623. processRawAttrs(element);
  4624. }
  4625. else if (!element.processed) {
  4626. // structural directives
  4627. processFor(element);
  4628. processIf(element);
  4629. processOnce(element);
  4630. }
  4631. if (!root) {
  4632. root = element;
  4633. {
  4634. checkRootConstraints(root);
  4635. }
  4636. }
  4637. if (!unary) {
  4638. currentParent = element;
  4639. stack.push(element);
  4640. }
  4641. else {
  4642. closeElement(element);
  4643. }
  4644. },
  4645. end: function (tag, start, end) {
  4646. var element = stack[stack.length - 1];
  4647. // pop stack
  4648. stack.length -= 1;
  4649. currentParent = stack[stack.length - 1];
  4650. if (options.outputSourceRange) {
  4651. element.end = end;
  4652. }
  4653. closeElement(element);
  4654. },
  4655. chars: function (text, start, end) {
  4656. if (!currentParent) {
  4657. {
  4658. if (text === template) {
  4659. warnOnce('Component template requires a root element, rather than just text.', { start: start });
  4660. }
  4661. else if ((text = text.trim())) {
  4662. warnOnce("text \"".concat(text, "\" outside root element will be ignored."), {
  4663. start: start
  4664. });
  4665. }
  4666. }
  4667. return;
  4668. }
  4669. // IE textarea placeholder bug
  4670. /* istanbul ignore if */
  4671. if (isIE &&
  4672. currentParent.tag === 'textarea' &&
  4673. currentParent.attrsMap.placeholder === text) {
  4674. return;
  4675. }
  4676. var children = currentParent.children;
  4677. if (inPre || text.trim()) {
  4678. text = isTextTag(currentParent)
  4679. ? text
  4680. : decodeHTMLCached(text);
  4681. }
  4682. else if (!children.length) {
  4683. // remove the whitespace-only node right after an opening tag
  4684. text = '';
  4685. }
  4686. else if (whitespaceOption) {
  4687. if (whitespaceOption === 'condense') {
  4688. // in condense mode, remove the whitespace node if it contains
  4689. // line break, otherwise condense to a single space
  4690. text = lineBreakRE.test(text) ? '' : ' ';
  4691. }
  4692. else {
  4693. text = ' ';
  4694. }
  4695. }
  4696. else {
  4697. text = preserveWhitespace ? ' ' : '';
  4698. }
  4699. if (text) {
  4700. if (!inPre && whitespaceOption === 'condense') {
  4701. // condense consecutive whitespaces into single space
  4702. text = text.replace(whitespaceRE, ' ');
  4703. }
  4704. var res = void 0;
  4705. var child = void 0;
  4706. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  4707. child = {
  4708. type: 2,
  4709. expression: res.expression,
  4710. tokens: res.tokens,
  4711. text: text
  4712. };
  4713. }
  4714. else if (text !== ' ' ||
  4715. !children.length ||
  4716. children[children.length - 1].text !== ' ') {
  4717. child = {
  4718. type: 3,
  4719. text: text
  4720. };
  4721. }
  4722. if (child) {
  4723. if (options.outputSourceRange) {
  4724. child.start = start;
  4725. child.end = end;
  4726. }
  4727. children.push(child);
  4728. }
  4729. }
  4730. },
  4731. comment: function (text, start, end) {
  4732. // adding anything as a sibling to the root node is forbidden
  4733. // comments should still be allowed, but ignored
  4734. if (currentParent) {
  4735. var child = {
  4736. type: 3,
  4737. text: text,
  4738. isComment: true
  4739. };
  4740. if (options.outputSourceRange) {
  4741. child.start = start;
  4742. child.end = end;
  4743. }
  4744. currentParent.children.push(child);
  4745. }
  4746. }
  4747. });
  4748. return root;
  4749. }
  4750. function processPre(el) {
  4751. if (getAndRemoveAttr(el, 'v-pre') != null) {
  4752. el.pre = true;
  4753. }
  4754. }
  4755. function processRawAttrs(el) {
  4756. var list = el.attrsList;
  4757. var len = list.length;
  4758. if (len) {
  4759. var attrs = (el.attrs = new Array(len));
  4760. for (var i = 0; i < len; i++) {
  4761. attrs[i] = {
  4762. name: list[i].name,
  4763. value: JSON.stringify(list[i].value)
  4764. };
  4765. if (list[i].start != null) {
  4766. attrs[i].start = list[i].start;
  4767. attrs[i].end = list[i].end;
  4768. }
  4769. }
  4770. }
  4771. else if (!el.pre) {
  4772. // non root node in pre blocks with no attributes
  4773. el.plain = true;
  4774. }
  4775. }
  4776. function processElement(element, options) {
  4777. processKey(element);
  4778. // determine whether this is a plain element after
  4779. // removing structural attributes
  4780. element.plain =
  4781. !element.key && !element.scopedSlots && !element.attrsList.length;
  4782. processRef(element);
  4783. processSlotContent(element);
  4784. processSlotOutlet(element);
  4785. processComponent(element);
  4786. for (var i = 0; i < transforms.length; i++) {
  4787. element = transforms[i](element, options) || element;
  4788. }
  4789. processAttrs(element);
  4790. return element;
  4791. }
  4792. function processKey(el) {
  4793. var exp = getBindingAttr(el, 'key');
  4794. if (exp) {
  4795. {
  4796. if (el.tag === 'template') {
  4797. warn$1("<template> cannot be keyed. Place the key on real elements instead.", getRawBindingAttr(el, 'key'));
  4798. }
  4799. if (el.for) {
  4800. var iterator = el.iterator2 || el.iterator1;
  4801. var parent_1 = el.parent;
  4802. if (iterator &&
  4803. iterator === exp &&
  4804. parent_1 &&
  4805. parent_1.tag === 'transition-group') {
  4806. warn$1("Do not use v-for index as key on <transition-group> children, " +
  4807. "this is the same as not using keys.", getRawBindingAttr(el, 'key'), true /* tip */);
  4808. }
  4809. }
  4810. }
  4811. el.key = exp;
  4812. }
  4813. }
  4814. function processRef(el) {
  4815. var ref = getBindingAttr(el, 'ref');
  4816. if (ref) {
  4817. el.ref = ref;
  4818. el.refInFor = checkInFor(el);
  4819. }
  4820. }
  4821. function processFor(el) {
  4822. var exp;
  4823. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  4824. var res = parseFor(exp);
  4825. if (res) {
  4826. extend(el, res);
  4827. }
  4828. else {
  4829. warn$1("Invalid v-for expression: ".concat(exp), el.rawAttrsMap['v-for']);
  4830. }
  4831. }
  4832. }
  4833. function parseFor(exp) {
  4834. var inMatch = exp.match(forAliasRE);
  4835. if (!inMatch)
  4836. return;
  4837. var res = {};
  4838. res.for = inMatch[2].trim();
  4839. var alias = inMatch[1].trim().replace(stripParensRE, '');
  4840. var iteratorMatch = alias.match(forIteratorRE);
  4841. if (iteratorMatch) {
  4842. res.alias = alias.replace(forIteratorRE, '').trim();
  4843. res.iterator1 = iteratorMatch[1].trim();
  4844. if (iteratorMatch[2]) {
  4845. res.iterator2 = iteratorMatch[2].trim();
  4846. }
  4847. }
  4848. else {
  4849. res.alias = alias;
  4850. }
  4851. return res;
  4852. }
  4853. function processIf(el) {
  4854. var exp = getAndRemoveAttr(el, 'v-if');
  4855. if (exp) {
  4856. el.if = exp;
  4857. addIfCondition(el, {
  4858. exp: exp,
  4859. block: el
  4860. });
  4861. }
  4862. else {
  4863. if (getAndRemoveAttr(el, 'v-else') != null) {
  4864. el.else = true;
  4865. }
  4866. var elseif = getAndRemoveAttr(el, 'v-else-if');
  4867. if (elseif) {
  4868. el.elseif = elseif;
  4869. }
  4870. }
  4871. }
  4872. function processIfConditions(el, parent) {
  4873. var prev = findPrevElement(parent.children);
  4874. if (prev && prev.if) {
  4875. addIfCondition(prev, {
  4876. exp: el.elseif,
  4877. block: el
  4878. });
  4879. }
  4880. else {
  4881. warn$1("v-".concat(el.elseif ? 'else-if="' + el.elseif + '"' : 'else', " ") +
  4882. "used on element <".concat(el.tag, "> without corresponding v-if."), el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']);
  4883. }
  4884. }
  4885. function findPrevElement(children) {
  4886. var i = children.length;
  4887. while (i--) {
  4888. if (children[i].type === 1) {
  4889. return children[i];
  4890. }
  4891. else {
  4892. if (children[i].text !== ' ') {
  4893. warn$1("text \"".concat(children[i].text.trim(), "\" between v-if and v-else(-if) ") +
  4894. "will be ignored.", children[i]);
  4895. }
  4896. children.pop();
  4897. }
  4898. }
  4899. }
  4900. function addIfCondition(el, condition) {
  4901. if (!el.ifConditions) {
  4902. el.ifConditions = [];
  4903. }
  4904. el.ifConditions.push(condition);
  4905. }
  4906. function processOnce(el) {
  4907. var once = getAndRemoveAttr(el, 'v-once');
  4908. if (once != null) {
  4909. el.once = true;
  4910. }
  4911. }
  4912. // handle content being passed to a component as slot,
  4913. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  4914. function processSlotContent(el) {
  4915. var slotScope;
  4916. if (el.tag === 'template') {
  4917. slotScope = getAndRemoveAttr(el, 'scope');
  4918. /* istanbul ignore if */
  4919. if (slotScope) {
  4920. warn$1("the \"scope\" attribute for scoped slots have been deprecated and " +
  4921. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  4922. "can also be used on plain elements in addition to <template> to " +
  4923. "denote scoped slots.", el.rawAttrsMap['scope'], true);
  4924. }
  4925. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  4926. }
  4927. else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  4928. /* istanbul ignore if */
  4929. if (el.attrsMap['v-for']) {
  4930. warn$1("Ambiguous combined usage of slot-scope and v-for on <".concat(el.tag, "> ") +
  4931. "(v-for takes higher priority). Use a wrapper <template> for the " +
  4932. "scoped slot to make it clearer.", el.rawAttrsMap['slot-scope'], true);
  4933. }
  4934. el.slotScope = slotScope;
  4935. }
  4936. // slot="xxx"
  4937. var slotTarget = getBindingAttr(el, 'slot');
  4938. if (slotTarget) {
  4939. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  4940. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  4941. // preserve slot as an attribute for native shadow DOM compat
  4942. // only for non-scoped slots.
  4943. if (el.tag !== 'template' && !el.slotScope) {
  4944. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  4945. }
  4946. }
  4947. // 2.6 v-slot syntax
  4948. {
  4949. if (el.tag === 'template') {
  4950. // v-slot on <template>
  4951. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  4952. if (slotBinding) {
  4953. {
  4954. if (el.slotTarget || el.slotScope) {
  4955. warn$1("Unexpected mixed usage of different slot syntaxes.", el);
  4956. }
  4957. if (el.parent && !maybeComponent(el.parent)) {
  4958. warn$1("<template v-slot> can only appear at the root level inside " +
  4959. "the receiving component", el);
  4960. }
  4961. }
  4962. var _a = getSlotName(slotBinding), name_2 = _a.name, dynamic = _a.dynamic;
  4963. el.slotTarget = name_2;
  4964. el.slotTargetDynamic = dynamic;
  4965. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  4966. }
  4967. }
  4968. else {
  4969. // v-slot on component, denotes default slot
  4970. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  4971. if (slotBinding) {
  4972. {
  4973. if (!maybeComponent(el)) {
  4974. warn$1("v-slot can only be used on components or <template>.", slotBinding);
  4975. }
  4976. if (el.slotScope || el.slotTarget) {
  4977. warn$1("Unexpected mixed usage of different slot syntaxes.", el);
  4978. }
  4979. if (el.scopedSlots) {
  4980. warn$1("To avoid scope ambiguity, the default slot should also use " +
  4981. "<template> syntax when there are other named slots.", slotBinding);
  4982. }
  4983. }
  4984. // add the component's children to its default slot
  4985. var slots = el.scopedSlots || (el.scopedSlots = {});
  4986. var _b = getSlotName(slotBinding), name_3 = _b.name, dynamic = _b.dynamic;
  4987. var slotContainer_1 = (slots[name_3] = createASTElement('template', [], el));
  4988. slotContainer_1.slotTarget = name_3;
  4989. slotContainer_1.slotTargetDynamic = dynamic;
  4990. slotContainer_1.children = el.children.filter(function (c) {
  4991. if (!c.slotScope) {
  4992. c.parent = slotContainer_1;
  4993. return true;
  4994. }
  4995. });
  4996. slotContainer_1.slotScope = slotBinding.value || emptySlotScopeToken;
  4997. // remove children as they are returned from scopedSlots now
  4998. el.children = [];
  4999. // mark el non-plain so data gets generated
  5000. el.plain = false;
  5001. }
  5002. }
  5003. }
  5004. }
  5005. function getSlotName(binding) {
  5006. var name = binding.name.replace(slotRE, '');
  5007. if (!name) {
  5008. if (binding.name[0] !== '#') {
  5009. name = 'default';
  5010. }
  5011. else {
  5012. warn$1("v-slot shorthand syntax requires a slot name.", binding);
  5013. }
  5014. }
  5015. return dynamicArgRE.test(name)
  5016. ? // dynamic [name]
  5017. { name: name.slice(1, -1), dynamic: true }
  5018. : // static name
  5019. { name: "\"".concat(name, "\""), dynamic: false };
  5020. }
  5021. // handle <slot/> outlets
  5022. function processSlotOutlet(el) {
  5023. if (el.tag === 'slot') {
  5024. el.slotName = getBindingAttr(el, 'name');
  5025. if (el.key) {
  5026. warn$1("`key` does not work on <slot> because slots are abstract outlets " +
  5027. "and can possibly expand into multiple elements. " +
  5028. "Use the key on a wrapping element instead.", getRawBindingAttr(el, 'key'));
  5029. }
  5030. }
  5031. }
  5032. function processComponent(el) {
  5033. var binding;
  5034. if ((binding = getBindingAttr(el, 'is'))) {
  5035. el.component = binding;
  5036. }
  5037. if (getAndRemoveAttr(el, 'inline-template') != null) {
  5038. el.inlineTemplate = true;
  5039. }
  5040. }
  5041. function processAttrs(el) {
  5042. var list = el.attrsList;
  5043. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  5044. for (i = 0, l = list.length; i < l; i++) {
  5045. name = rawName = list[i].name;
  5046. value = list[i].value;
  5047. if (dirRE.test(name)) {
  5048. // mark element as dynamic
  5049. el.hasBindings = true;
  5050. // modifiers
  5051. modifiers = parseModifiers(name.replace(dirRE, ''));
  5052. // support .foo shorthand syntax for the .prop modifier
  5053. if (modifiers) {
  5054. name = name.replace(modifierRE, '');
  5055. }
  5056. if (bindRE.test(name)) {
  5057. // v-bind
  5058. name = name.replace(bindRE, '');
  5059. value = parseFilters(value);
  5060. isDynamic = dynamicArgRE.test(name);
  5061. if (isDynamic) {
  5062. name = name.slice(1, -1);
  5063. }
  5064. if (value.trim().length === 0) {
  5065. warn$1("The value for a v-bind expression cannot be empty. Found in \"v-bind:".concat(name, "\""));
  5066. }
  5067. if (modifiers) {
  5068. if (modifiers.prop && !isDynamic) {
  5069. name = camelize(name);
  5070. if (name === 'innerHtml')
  5071. name = 'innerHTML';
  5072. }
  5073. if (modifiers.camel && !isDynamic) {
  5074. name = camelize(name);
  5075. }
  5076. if (modifiers.sync) {
  5077. syncGen = genAssignmentCode(value, "$event");
  5078. if (!isDynamic) {
  5079. addHandler(el, "update:".concat(camelize(name)), syncGen, null, false, warn$1, list[i]);
  5080. if (hyphenate(name) !== camelize(name)) {
  5081. addHandler(el, "update:".concat(hyphenate(name)), syncGen, null, false, warn$1, list[i]);
  5082. }
  5083. }
  5084. else {
  5085. // handler w/ dynamic event name
  5086. addHandler(el, "\"update:\"+(".concat(name, ")"), syncGen, null, false, warn$1, list[i], true // dynamic
  5087. );
  5088. }
  5089. }
  5090. }
  5091. if ((modifiers && modifiers.prop) ||
  5092. (!el.component && platformMustUseProp(el.tag, el.attrsMap.type, name))) {
  5093. addProp(el, name, value, list[i], isDynamic);
  5094. }
  5095. else {
  5096. addAttr(el, name, value, list[i], isDynamic);
  5097. }
  5098. }
  5099. else if (onRE.test(name)) {
  5100. // v-on
  5101. name = name.replace(onRE, '');
  5102. isDynamic = dynamicArgRE.test(name);
  5103. if (isDynamic) {
  5104. name = name.slice(1, -1);
  5105. }
  5106. addHandler(el, name, value, modifiers, false, warn$1, list[i], isDynamic);
  5107. }
  5108. else {
  5109. // normal directives
  5110. name = name.replace(dirRE, '');
  5111. // parse arg
  5112. var argMatch = name.match(argRE);
  5113. var arg = argMatch && argMatch[1];
  5114. isDynamic = false;
  5115. if (arg) {
  5116. name = name.slice(0, -(arg.length + 1));
  5117. if (dynamicArgRE.test(arg)) {
  5118. arg = arg.slice(1, -1);
  5119. isDynamic = true;
  5120. }
  5121. }
  5122. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  5123. if (name === 'model') {
  5124. checkForAliasModel(el, value);
  5125. }
  5126. }
  5127. }
  5128. else {
  5129. // literal attribute
  5130. {
  5131. var res = parseText(value, delimiters);
  5132. if (res) {
  5133. warn$1("".concat(name, "=\"").concat(value, "\": ") +
  5134. 'Interpolation inside attributes has been removed. ' +
  5135. 'Use v-bind or the colon shorthand instead. For example, ' +
  5136. 'instead of <div id="{{ val }}">, use <div :id="val">.', list[i]);
  5137. }
  5138. }
  5139. addAttr(el, name, JSON.stringify(value), list[i]);
  5140. // #6887 firefox doesn't update muted state if set via attribute
  5141. // even immediately after element creation
  5142. if (!el.component &&
  5143. name === 'muted' &&
  5144. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  5145. addProp(el, name, 'true', list[i]);
  5146. }
  5147. }
  5148. }
  5149. }
  5150. function checkInFor(el) {
  5151. var parent = el;
  5152. while (parent) {
  5153. if (parent.for !== undefined) {
  5154. return true;
  5155. }
  5156. parent = parent.parent;
  5157. }
  5158. return false;
  5159. }
  5160. function parseModifiers(name) {
  5161. var match = name.match(modifierRE);
  5162. if (match) {
  5163. var ret_1 = {};
  5164. match.forEach(function (m) {
  5165. ret_1[m.slice(1)] = true;
  5166. });
  5167. return ret_1;
  5168. }
  5169. }
  5170. function makeAttrsMap(attrs) {
  5171. var map = {};
  5172. for (var i = 0, l = attrs.length; i < l; i++) {
  5173. if (map[attrs[i].name] && !isIE && !isEdge) {
  5174. warn$1('duplicate attribute: ' + attrs[i].name, attrs[i]);
  5175. }
  5176. map[attrs[i].name] = attrs[i].value;
  5177. }
  5178. return map;
  5179. }
  5180. // for script (e.g. type="x/template") or style, do not decode content
  5181. function isTextTag(el) {
  5182. return el.tag === 'script' || el.tag === 'style';
  5183. }
  5184. function isForbiddenTag(el) {
  5185. return (el.tag === 'style' ||
  5186. (el.tag === 'script' &&
  5187. (!el.attrsMap.type || el.attrsMap.type === 'text/javascript')));
  5188. }
  5189. var ieNSBug = /^xmlns:NS\d+/;
  5190. var ieNSPrefix = /^NS\d+:/;
  5191. /* istanbul ignore next */
  5192. function guardIESVGBug(attrs) {
  5193. var res = [];
  5194. for (var i = 0; i < attrs.length; i++) {
  5195. var attr = attrs[i];
  5196. if (!ieNSBug.test(attr.name)) {
  5197. attr.name = attr.name.replace(ieNSPrefix, '');
  5198. res.push(attr);
  5199. }
  5200. }
  5201. return res;
  5202. }
  5203. function checkForAliasModel(el, value) {
  5204. var _el = el;
  5205. while (_el) {
  5206. if (_el.for && _el.alias === value) {
  5207. warn$1("<".concat(el.tag, " v-model=\"").concat(value, "\">: ") +
  5208. "You are binding v-model directly to a v-for iteration alias. " +
  5209. "This will not be able to modify the v-for source array because " +
  5210. "writing to the alias is like modifying a function local variable. " +
  5211. "Consider using an array of objects and use v-model on an object property instead.", el.rawAttrsMap['v-model']);
  5212. }
  5213. _el = _el.parent;
  5214. }
  5215. }
  5216. /**
  5217. * Expand input[v-model] with dynamic type bindings into v-if-else chains
  5218. * Turn this:
  5219. * <input v-model="data[type]" :type="type">
  5220. * into this:
  5221. * <input v-if="type === 'checkbox'" type="checkbox" v-model="data[type]">
  5222. * <input v-else-if="type === 'radio'" type="radio" v-model="data[type]">
  5223. * <input v-else :type="type" v-model="data[type]">
  5224. */
  5225. function preTransformNode(el, options) {
  5226. if (el.tag === 'input') {
  5227. var map = el.attrsMap;
  5228. if (!map['v-model']) {
  5229. return;
  5230. }
  5231. var typeBinding = void 0;
  5232. if (map[':type'] || map['v-bind:type']) {
  5233. typeBinding = getBindingAttr(el, 'type');
  5234. }
  5235. if (!map.type && !typeBinding && map['v-bind']) {
  5236. typeBinding = "(".concat(map['v-bind'], ").type");
  5237. }
  5238. if (typeBinding) {
  5239. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  5240. var ifConditionExtra = ifCondition ? "&&(".concat(ifCondition, ")") : "";
  5241. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  5242. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  5243. // 1. checkbox
  5244. var branch0 = cloneASTElement(el);
  5245. // process for on the main node
  5246. processFor(branch0);
  5247. addRawAttr(branch0, 'type', 'checkbox');
  5248. processElement(branch0, options);
  5249. branch0.processed = true; // prevent it from double-processed
  5250. branch0.if = "(".concat(typeBinding, ")==='checkbox'") + ifConditionExtra;
  5251. addIfCondition(branch0, {
  5252. exp: branch0.if,
  5253. block: branch0
  5254. });
  5255. // 2. add radio else-if condition
  5256. var branch1 = cloneASTElement(el);
  5257. getAndRemoveAttr(branch1, 'v-for', true);
  5258. addRawAttr(branch1, 'type', 'radio');
  5259. processElement(branch1, options);
  5260. addIfCondition(branch0, {
  5261. exp: "(".concat(typeBinding, ")==='radio'") + ifConditionExtra,
  5262. block: branch1
  5263. });
  5264. // 3. other
  5265. var branch2 = cloneASTElement(el);
  5266. getAndRemoveAttr(branch2, 'v-for', true);
  5267. addRawAttr(branch2, ':type', typeBinding);
  5268. processElement(branch2, options);
  5269. addIfCondition(branch0, {
  5270. exp: ifCondition,
  5271. block: branch2
  5272. });
  5273. if (hasElse) {
  5274. branch0.else = true;
  5275. }
  5276. else if (elseIfCondition) {
  5277. branch0.elseif = elseIfCondition;
  5278. }
  5279. return branch0;
  5280. }
  5281. }
  5282. }
  5283. function cloneASTElement(el) {
  5284. return createASTElement(el.tag, el.attrsList.slice(), el.parent);
  5285. }
  5286. var model$1 = {
  5287. preTransformNode: preTransformNode
  5288. };
  5289. var modules = [klass, style, model$1];
  5290. var warn;
  5291. // in some cases, the event used has to be determined at runtime
  5292. // so we used some reserved tokens during compile.
  5293. var RANGE_TOKEN = '__r';
  5294. function model(el, dir, _warn) {
  5295. warn = _warn;
  5296. var value = dir.value;
  5297. var modifiers = dir.modifiers;
  5298. var tag = el.tag;
  5299. var type = el.attrsMap.type;
  5300. {
  5301. // inputs with type="file" are read only and setting the input's
  5302. // value will throw an error.
  5303. if (tag === 'input' && type === 'file') {
  5304. warn("<".concat(el.tag, " v-model=\"").concat(value, "\" type=\"file\">:\n") +
  5305. "File inputs are read only. Use a v-on:change listener instead.", el.rawAttrsMap['v-model']);
  5306. }
  5307. }
  5308. if (el.component) {
  5309. genComponentModel(el, value, modifiers);
  5310. // component v-model doesn't need extra runtime
  5311. return false;
  5312. }
  5313. else if (tag === 'select') {
  5314. genSelect(el, value, modifiers);
  5315. }
  5316. else if (tag === 'input' && type === 'checkbox') {
  5317. genCheckboxModel(el, value, modifiers);
  5318. }
  5319. else if (tag === 'input' && type === 'radio') {
  5320. genRadioModel(el, value, modifiers);
  5321. }
  5322. else if (tag === 'input' || tag === 'textarea') {
  5323. genDefaultModel(el, value, modifiers);
  5324. }
  5325. else {
  5326. genComponentModel(el, value, modifiers);
  5327. // component v-model doesn't need extra runtime
  5328. return false;
  5329. }
  5330. // ensure runtime directive metadata
  5331. return true;
  5332. }
  5333. function genCheckboxModel(el, value, modifiers) {
  5334. var number = modifiers && modifiers.number;
  5335. var valueBinding = getBindingAttr(el, 'value') || 'null';
  5336. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  5337. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  5338. addProp(el, 'checked', "Array.isArray(".concat(value, ")") +
  5339. "?_i(".concat(value, ",").concat(valueBinding, ")>-1") +
  5340. (trueValueBinding === 'true'
  5341. ? ":(".concat(value, ")")
  5342. : ":_q(".concat(value, ",").concat(trueValueBinding, ")")));
  5343. addHandler(el, 'change', "var $$a=".concat(value, ",") +
  5344. '$$el=$event.target,' +
  5345. "$$c=$$el.checked?(".concat(trueValueBinding, "):(").concat(falseValueBinding, ");") +
  5346. 'if(Array.isArray($$a)){' +
  5347. "var $$v=".concat(number ? '_n(' + valueBinding + ')' : valueBinding, ",") +
  5348. '$$i=_i($$a,$$v);' +
  5349. "if($$el.checked){$$i<0&&(".concat(genAssignmentCode(value, '$$a.concat([$$v])'), ")}") +
  5350. "else{$$i>-1&&(".concat(genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))'), ")}") +
  5351. "}else{".concat(genAssignmentCode(value, '$$c'), "}"), null, true);
  5352. }
  5353. function genRadioModel(el, value, modifiers) {
  5354. var number = modifiers && modifiers.number;
  5355. var valueBinding = getBindingAttr(el, 'value') || 'null';
  5356. valueBinding = number ? "_n(".concat(valueBinding, ")") : valueBinding;
  5357. addProp(el, 'checked', "_q(".concat(value, ",").concat(valueBinding, ")"));
  5358. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  5359. }
  5360. function genSelect(el, value, modifiers) {
  5361. var number = modifiers && modifiers.number;
  5362. var selectedVal = "Array.prototype.filter" +
  5363. ".call($event.target.options,function(o){return o.selected})" +
  5364. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  5365. "return ".concat(number ? '_n(val)' : 'val', "})");
  5366. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  5367. var code = "var $$selectedVal = ".concat(selectedVal, ";");
  5368. code = "".concat(code, " ").concat(genAssignmentCode(value, assignment));
  5369. addHandler(el, 'change', code, null, true);
  5370. }
  5371. function genDefaultModel(el, value, modifiers) {
  5372. var type = el.attrsMap.type;
  5373. // warn if v-bind:value conflicts with v-model
  5374. // except for inputs with v-bind:type
  5375. {
  5376. var value_1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  5377. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  5378. if (value_1 && !typeBinding) {
  5379. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  5380. warn("".concat(binding, "=\"").concat(value_1, "\" conflicts with v-model on the same element ") +
  5381. 'because the latter already expands to a value binding internally', el.rawAttrsMap[binding]);
  5382. }
  5383. }
  5384. var _a = modifiers || {}, lazy = _a.lazy, number = _a.number, trim = _a.trim;
  5385. var needCompositionGuard = !lazy && type !== 'range';
  5386. var event = lazy ? 'change' : type === 'range' ? RANGE_TOKEN : 'input';
  5387. var valueExpression = '$event.target.value';
  5388. if (trim) {
  5389. valueExpression = "$event.target.value.trim()";
  5390. }
  5391. if (number) {
  5392. valueExpression = "_n(".concat(valueExpression, ")");
  5393. }
  5394. var code = genAssignmentCode(value, valueExpression);
  5395. if (needCompositionGuard) {
  5396. code = "if($event.target.composing)return;".concat(code);
  5397. }
  5398. addProp(el, 'value', "(".concat(value, ")"));
  5399. addHandler(el, event, code, null, true);
  5400. if (trim || number) {
  5401. addHandler(el, 'blur', '$forceUpdate()');
  5402. }
  5403. }
  5404. function text(el, dir) {
  5405. if (dir.value) {
  5406. addProp(el, 'textContent', "_s(".concat(dir.value, ")"), dir);
  5407. }
  5408. }
  5409. function html(el, dir) {
  5410. if (dir.value) {
  5411. addProp(el, 'innerHTML', "_s(".concat(dir.value, ")"), dir);
  5412. }
  5413. }
  5414. var directives = {
  5415. model: model,
  5416. text: text,
  5417. html: html
  5418. };
  5419. var baseOptions = {
  5420. expectHTML: true,
  5421. modules: modules,
  5422. directives: directives,
  5423. isPreTag: isPreTag,
  5424. isUnaryTag: isUnaryTag,
  5425. mustUseProp: mustUseProp,
  5426. canBeLeftOpenTag: canBeLeftOpenTag,
  5427. isReservedTag: isReservedTag,
  5428. getTagNamespace: getTagNamespace,
  5429. staticKeys: genStaticKeys$1(modules)
  5430. };
  5431. var isStaticKey;
  5432. var isPlatformReservedTag$1;
  5433. var genStaticKeysCached = cached(genStaticKeys);
  5434. /**
  5435. * Goal of the optimizer: walk the generated template AST tree
  5436. * and detect sub-trees that are purely static, i.e. parts of
  5437. * the DOM that never needs to change.
  5438. *
  5439. * Once we detect these sub-trees, we can:
  5440. *
  5441. * 1. Hoist them into constants, so that we no longer need to
  5442. * create fresh nodes for them on each re-render;
  5443. * 2. Completely skip them in the patching process.
  5444. */
  5445. function optimize$1(root, options) {
  5446. if (!root)
  5447. return;
  5448. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  5449. isPlatformReservedTag$1 = options.isReservedTag || no;
  5450. // first pass: mark all non-static nodes.
  5451. markStatic(root);
  5452. // second pass: mark static roots.
  5453. markStaticRoots(root, false);
  5454. }
  5455. function genStaticKeys(keys) {
  5456. return makeMap('type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  5457. (keys ? ',' + keys : ''));
  5458. }
  5459. function markStatic(node) {
  5460. node.static = isStatic(node);
  5461. if (node.type === 1) {
  5462. // do not make component slot content static. this avoids
  5463. // 1. components not able to mutate slot nodes
  5464. // 2. static slot content fails for hot-reloading
  5465. if (!isPlatformReservedTag$1(node.tag) &&
  5466. node.tag !== 'slot' &&
  5467. node.attrsMap['inline-template'] == null) {
  5468. return;
  5469. }
  5470. for (var i = 0, l = node.children.length; i < l; i++) {
  5471. var child = node.children[i];
  5472. markStatic(child);
  5473. if (!child.static) {
  5474. node.static = false;
  5475. }
  5476. }
  5477. if (node.ifConditions) {
  5478. for (var i = 1, l = node.ifConditions.length; i < l; i++) {
  5479. var block = node.ifConditions[i].block;
  5480. markStatic(block);
  5481. if (!block.static) {
  5482. node.static = false;
  5483. }
  5484. }
  5485. }
  5486. }
  5487. }
  5488. function markStaticRoots(node, isInFor) {
  5489. if (node.type === 1) {
  5490. if (node.static || node.once) {
  5491. node.staticInFor = isInFor;
  5492. }
  5493. // For a node to qualify as a static root, it should have children that
  5494. // are not just static text. Otherwise the cost of hoisting out will
  5495. // outweigh the benefits and it's better off to just always render it fresh.
  5496. if (node.static &&
  5497. node.children.length &&
  5498. !(node.children.length === 1 && node.children[0].type === 3)) {
  5499. node.staticRoot = true;
  5500. return;
  5501. }
  5502. else {
  5503. node.staticRoot = false;
  5504. }
  5505. if (node.children) {
  5506. for (var i = 0, l = node.children.length; i < l; i++) {
  5507. markStaticRoots(node.children[i], isInFor || !!node.for);
  5508. }
  5509. }
  5510. if (node.ifConditions) {
  5511. for (var i = 1, l = node.ifConditions.length; i < l; i++) {
  5512. markStaticRoots(node.ifConditions[i].block, isInFor);
  5513. }
  5514. }
  5515. }
  5516. }
  5517. function isStatic(node) {
  5518. if (node.type === 2) {
  5519. // expression
  5520. return false;
  5521. }
  5522. if (node.type === 3) {
  5523. // text
  5524. return true;
  5525. }
  5526. return !!(node.pre ||
  5527. (!node.hasBindings && // no dynamic bindings
  5528. !node.if &&
  5529. !node.for && // not v-if or v-for or v-else
  5530. !isBuiltInTag(node.tag) && // not a built-in
  5531. isPlatformReservedTag$1(node.tag) && // not a component
  5532. !isDirectChildOfTemplateFor(node) &&
  5533. Object.keys(node).every(isStaticKey)));
  5534. }
  5535. function isDirectChildOfTemplateFor(node) {
  5536. while (node.parent) {
  5537. node = node.parent;
  5538. if (node.tag !== 'template') {
  5539. return false;
  5540. }
  5541. if (node.for) {
  5542. return true;
  5543. }
  5544. }
  5545. return false;
  5546. }
  5547. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  5548. var fnInvokeRE = /\([^)]*?\);*$/;
  5549. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  5550. // KeyboardEvent.keyCode aliases
  5551. var keyCodes = {
  5552. esc: 27,
  5553. tab: 9,
  5554. enter: 13,
  5555. space: 32,
  5556. up: 38,
  5557. left: 37,
  5558. right: 39,
  5559. down: 40,
  5560. delete: [8, 46]
  5561. };
  5562. // KeyboardEvent.key aliases
  5563. var keyNames = {
  5564. // #7880: IE11 and Edge use `Esc` for Escape key name.
  5565. esc: ['Esc', 'Escape'],
  5566. tab: 'Tab',
  5567. enter: 'Enter',
  5568. // #9112: IE11 uses `Spacebar` for Space key name.
  5569. space: [' ', 'Spacebar'],
  5570. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  5571. up: ['Up', 'ArrowUp'],
  5572. left: ['Left', 'ArrowLeft'],
  5573. right: ['Right', 'ArrowRight'],
  5574. down: ['Down', 'ArrowDown'],
  5575. // #9112: IE11 uses `Del` for Delete key name.
  5576. delete: ['Backspace', 'Delete', 'Del']
  5577. };
  5578. // #4868: modifiers that prevent the execution of the listener
  5579. // need to explicitly return null so that we can determine whether to remove
  5580. // the listener for .once
  5581. var genGuard = function (condition) { return "if(".concat(condition, ")return null;"); };
  5582. var modifierCode = {
  5583. stop: '$event.stopPropagation();',
  5584. prevent: '$event.preventDefault();',
  5585. self: genGuard("$event.target !== $event.currentTarget"),
  5586. ctrl: genGuard("!$event.ctrlKey"),
  5587. shift: genGuard("!$event.shiftKey"),
  5588. alt: genGuard("!$event.altKey"),
  5589. meta: genGuard("!$event.metaKey"),
  5590. left: genGuard("'button' in $event && $event.button !== 0"),
  5591. middle: genGuard("'button' in $event && $event.button !== 1"),
  5592. right: genGuard("'button' in $event && $event.button !== 2")
  5593. };
  5594. function genHandlers(events, isNative) {
  5595. var prefix = isNative ? 'nativeOn:' : 'on:';
  5596. var staticHandlers = "";
  5597. var dynamicHandlers = "";
  5598. for (var name_1 in events) {
  5599. var handlerCode = genHandler(events[name_1]);
  5600. //@ts-expect-error
  5601. if (events[name_1] && events[name_1].dynamic) {
  5602. dynamicHandlers += "".concat(name_1, ",").concat(handlerCode, ",");
  5603. }
  5604. else {
  5605. staticHandlers += "\"".concat(name_1, "\":").concat(handlerCode, ",");
  5606. }
  5607. }
  5608. staticHandlers = "{".concat(staticHandlers.slice(0, -1), "}");
  5609. if (dynamicHandlers) {
  5610. return prefix + "_d(".concat(staticHandlers, ",[").concat(dynamicHandlers.slice(0, -1), "])");
  5611. }
  5612. else {
  5613. return prefix + staticHandlers;
  5614. }
  5615. }
  5616. function genHandler(handler) {
  5617. if (!handler) {
  5618. return 'function(){}';
  5619. }
  5620. if (Array.isArray(handler)) {
  5621. return "[".concat(handler.map(function (handler) { return genHandler(handler); }).join(','), "]");
  5622. }
  5623. var isMethodPath = simplePathRE.test(handler.value);
  5624. var isFunctionExpression = fnExpRE.test(handler.value);
  5625. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  5626. if (!handler.modifiers) {
  5627. if (isMethodPath || isFunctionExpression) {
  5628. return handler.value;
  5629. }
  5630. return "function($event){".concat(isFunctionInvocation ? "return ".concat(handler.value) : handler.value, "}"); // inline statement
  5631. }
  5632. else {
  5633. var code = '';
  5634. var genModifierCode = '';
  5635. var keys = [];
  5636. var _loop_1 = function (key) {
  5637. if (modifierCode[key]) {
  5638. genModifierCode += modifierCode[key];
  5639. // left/right
  5640. if (keyCodes[key]) {
  5641. keys.push(key);
  5642. }
  5643. }
  5644. else if (key === 'exact') {
  5645. var modifiers_1 = handler.modifiers;
  5646. genModifierCode += genGuard(['ctrl', 'shift', 'alt', 'meta']
  5647. .filter(function (keyModifier) { return !modifiers_1[keyModifier]; })
  5648. .map(function (keyModifier) { return "$event.".concat(keyModifier, "Key"); })
  5649. .join('||'));
  5650. }
  5651. else {
  5652. keys.push(key);
  5653. }
  5654. };
  5655. for (var key in handler.modifiers) {
  5656. _loop_1(key);
  5657. }
  5658. if (keys.length) {
  5659. code += genKeyFilter(keys);
  5660. }
  5661. // Make sure modifiers like prevent and stop get executed after key filtering
  5662. if (genModifierCode) {
  5663. code += genModifierCode;
  5664. }
  5665. var handlerCode = isMethodPath
  5666. ? "return ".concat(handler.value, ".apply(null, arguments)")
  5667. : isFunctionExpression
  5668. ? "return (".concat(handler.value, ").apply(null, arguments)")
  5669. : isFunctionInvocation
  5670. ? "return ".concat(handler.value)
  5671. : handler.value;
  5672. return "function($event){".concat(code).concat(handlerCode, "}");
  5673. }
  5674. }
  5675. function genKeyFilter(keys) {
  5676. return (
  5677. // make sure the key filters only apply to KeyboardEvents
  5678. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  5679. // key events that do not have keyCode property...
  5680. "if(!$event.type.indexOf('key')&&" +
  5681. "".concat(keys.map(genFilterCode).join('&&'), ")return null;"));
  5682. }
  5683. function genFilterCode(key) {
  5684. var keyVal = parseInt(key, 10);
  5685. if (keyVal) {
  5686. return "$event.keyCode!==".concat(keyVal);
  5687. }
  5688. var keyCode = keyCodes[key];
  5689. var keyName = keyNames[key];
  5690. return ("_k($event.keyCode," +
  5691. "".concat(JSON.stringify(key), ",") +
  5692. "".concat(JSON.stringify(keyCode), ",") +
  5693. "$event.key," +
  5694. "".concat(JSON.stringify(keyName)) +
  5695. ")");
  5696. }
  5697. function on(el, dir) {
  5698. if (dir.modifiers) {
  5699. warn$2("v-on without argument does not support modifiers.");
  5700. }
  5701. el.wrapListeners = function (code) { return "_g(".concat(code, ",").concat(dir.value, ")"); };
  5702. }
  5703. function bind(el, dir) {
  5704. el.wrapData = function (code) {
  5705. return "_b(".concat(code, ",'").concat(el.tag, "',").concat(dir.value, ",").concat(dir.modifiers && dir.modifiers.prop ? 'true' : 'false').concat(dir.modifiers && dir.modifiers.sync ? ',true' : '', ")");
  5706. };
  5707. }
  5708. var baseDirectives = {
  5709. on: on,
  5710. bind: bind,
  5711. cloak: noop
  5712. };
  5713. var CodegenState = /** @class */ (function () {
  5714. function CodegenState(options) {
  5715. this.options = options;
  5716. this.warn = options.warn || baseWarn;
  5717. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  5718. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  5719. this.directives = extend(extend({}, baseDirectives), options.directives);
  5720. var isReservedTag = options.isReservedTag || no;
  5721. this.maybeComponent = function (el) {
  5722. return !!el.component || !isReservedTag(el.tag);
  5723. };
  5724. this.onceId = 0;
  5725. this.staticRenderFns = [];
  5726. this.pre = false;
  5727. }
  5728. return CodegenState;
  5729. }());
  5730. function generate$1(ast, options) {
  5731. var state = new CodegenState(options);
  5732. // fix #11483, Root level <script> tags should not be rendered.
  5733. var code = ast
  5734. ? ast.tag === 'script'
  5735. ? 'null'
  5736. : genElement(ast, state)
  5737. : '_c("div")';
  5738. return {
  5739. render: "with(this){return ".concat(code, "}"),
  5740. staticRenderFns: state.staticRenderFns
  5741. };
  5742. }
  5743. function genElement(el, state) {
  5744. if (el.parent) {
  5745. el.pre = el.pre || el.parent.pre;
  5746. }
  5747. if (el.staticRoot && !el.staticProcessed) {
  5748. return genStatic(el, state);
  5749. }
  5750. else if (el.once && !el.onceProcessed) {
  5751. return genOnce(el, state);
  5752. }
  5753. else if (el.for && !el.forProcessed) {
  5754. return genFor(el, state);
  5755. }
  5756. else if (el.if && !el.ifProcessed) {
  5757. return genIf(el, state);
  5758. }
  5759. else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  5760. return genChildren(el, state) || 'void 0';
  5761. }
  5762. else if (el.tag === 'slot') {
  5763. return genSlot(el, state);
  5764. }
  5765. else {
  5766. // component or element
  5767. var code = void 0;
  5768. if (el.component) {
  5769. code = genComponent(el.component, el, state);
  5770. }
  5771. else {
  5772. var data = void 0;
  5773. var maybeComponent = state.maybeComponent(el);
  5774. if (!el.plain || (el.pre && maybeComponent)) {
  5775. data = genData(el, state);
  5776. }
  5777. var tag
  5778. // check if this is a component in <script setup>
  5779. = void 0;
  5780. // check if this is a component in <script setup>
  5781. var bindings = state.options.bindings;
  5782. if (maybeComponent && bindings && bindings.__isScriptSetup !== false) {
  5783. tag = checkBindingType(bindings, el.tag);
  5784. }
  5785. if (!tag)
  5786. tag = "'".concat(el.tag, "'");
  5787. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  5788. code = "_c(".concat(tag).concat(data ? ",".concat(data) : '' // data
  5789. ).concat(children ? ",".concat(children) : '' // children
  5790. , ")");
  5791. }
  5792. // module transforms
  5793. for (var i = 0; i < state.transforms.length; i++) {
  5794. code = state.transforms[i](el, code);
  5795. }
  5796. return code;
  5797. }
  5798. }
  5799. function checkBindingType(bindings, key) {
  5800. var camelName = camelize(key);
  5801. var PascalName = capitalize(camelName);
  5802. var checkType = function (type) {
  5803. if (bindings[key] === type) {
  5804. return key;
  5805. }
  5806. if (bindings[camelName] === type) {
  5807. return camelName;
  5808. }
  5809. if (bindings[PascalName] === type) {
  5810. return PascalName;
  5811. }
  5812. };
  5813. var fromConst = checkType("setup-const" /* BindingTypes.SETUP_CONST */) ||
  5814. checkType("setup-reactive-const" /* BindingTypes.SETUP_REACTIVE_CONST */);
  5815. if (fromConst) {
  5816. return fromConst;
  5817. }
  5818. var fromMaybeRef = checkType("setup-let" /* BindingTypes.SETUP_LET */) ||
  5819. checkType("setup-ref" /* BindingTypes.SETUP_REF */) ||
  5820. checkType("setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
  5821. if (fromMaybeRef) {
  5822. return fromMaybeRef;
  5823. }
  5824. }
  5825. // hoist static sub-trees out
  5826. function genStatic(el, state) {
  5827. el.staticProcessed = true;
  5828. // Some elements (templates) need to behave differently inside of a v-pre
  5829. // node. All pre nodes are static roots, so we can use this as a location to
  5830. // wrap a state change and reset it upon exiting the pre node.
  5831. var originalPreState = state.pre;
  5832. if (el.pre) {
  5833. state.pre = el.pre;
  5834. }
  5835. state.staticRenderFns.push("with(this){return ".concat(genElement(el, state), "}"));
  5836. state.pre = originalPreState;
  5837. return "_m(".concat(state.staticRenderFns.length - 1).concat(el.staticInFor ? ',true' : '', ")");
  5838. }
  5839. // v-once
  5840. function genOnce(el, state) {
  5841. el.onceProcessed = true;
  5842. if (el.if && !el.ifProcessed) {
  5843. return genIf(el, state);
  5844. }
  5845. else if (el.staticInFor) {
  5846. var key = '';
  5847. var parent_1 = el.parent;
  5848. while (parent_1) {
  5849. if (parent_1.for) {
  5850. key = parent_1.key;
  5851. break;
  5852. }
  5853. parent_1 = parent_1.parent;
  5854. }
  5855. if (!key) {
  5856. state.warn("v-once can only be used inside v-for that is keyed. ", el.rawAttrsMap['v-once']);
  5857. return genElement(el, state);
  5858. }
  5859. return "_o(".concat(genElement(el, state), ",").concat(state.onceId++, ",").concat(key, ")");
  5860. }
  5861. else {
  5862. return genStatic(el, state);
  5863. }
  5864. }
  5865. function genIf(el, state, altGen, altEmpty) {
  5866. el.ifProcessed = true; // avoid recursion
  5867. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty);
  5868. }
  5869. function genIfConditions(conditions, state, altGen, altEmpty) {
  5870. if (!conditions.length) {
  5871. return altEmpty || '_e()';
  5872. }
  5873. var condition = conditions.shift();
  5874. if (condition.exp) {
  5875. return "(".concat(condition.exp, ")?").concat(genTernaryExp(condition.block), ":").concat(genIfConditions(conditions, state, altGen, altEmpty));
  5876. }
  5877. else {
  5878. return "".concat(genTernaryExp(condition.block));
  5879. }
  5880. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  5881. function genTernaryExp(el) {
  5882. return altGen
  5883. ? altGen(el, state)
  5884. : el.once
  5885. ? genOnce(el, state)
  5886. : genElement(el, state);
  5887. }
  5888. }
  5889. function genFor(el, state, altGen, altHelper) {
  5890. var exp = el.for;
  5891. var alias = el.alias;
  5892. var iterator1 = el.iterator1 ? ",".concat(el.iterator1) : '';
  5893. var iterator2 = el.iterator2 ? ",".concat(el.iterator2) : '';
  5894. if (state.maybeComponent(el) &&
  5895. el.tag !== 'slot' &&
  5896. el.tag !== 'template' &&
  5897. !el.key) {
  5898. state.warn("<".concat(el.tag, " v-for=\"").concat(alias, " in ").concat(exp, "\">: component lists rendered with ") +
  5899. "v-for should have explicit keys. " +
  5900. "See https://v2.vuejs.org/v2/guide/list.html#key for more info.", el.rawAttrsMap['v-for'], true /* tip */);
  5901. }
  5902. el.forProcessed = true; // avoid recursion
  5903. return ("".concat(altHelper || '_l', "((").concat(exp, "),") +
  5904. "function(".concat(alias).concat(iterator1).concat(iterator2, "){") +
  5905. "return ".concat((altGen || genElement)(el, state)) +
  5906. '})');
  5907. }
  5908. function genData(el, state) {
  5909. var data = '{';
  5910. // directives first.
  5911. // directives may mutate the el's other properties before they are generated.
  5912. var dirs = genDirectives(el, state);
  5913. if (dirs)
  5914. data += dirs + ',';
  5915. // key
  5916. if (el.key) {
  5917. data += "key:".concat(el.key, ",");
  5918. }
  5919. // ref
  5920. if (el.ref) {
  5921. data += "ref:".concat(el.ref, ",");
  5922. }
  5923. if (el.refInFor) {
  5924. data += "refInFor:true,";
  5925. }
  5926. // pre
  5927. if (el.pre) {
  5928. data += "pre:true,";
  5929. }
  5930. // record original tag name for components using "is" attribute
  5931. if (el.component) {
  5932. data += "tag:\"".concat(el.tag, "\",");
  5933. }
  5934. // module data generation functions
  5935. for (var i = 0; i < state.dataGenFns.length; i++) {
  5936. data += state.dataGenFns[i](el);
  5937. }
  5938. // attributes
  5939. if (el.attrs) {
  5940. data += "attrs:".concat(genProps(el.attrs), ",");
  5941. }
  5942. // DOM props
  5943. if (el.props) {
  5944. data += "domProps:".concat(genProps(el.props), ",");
  5945. }
  5946. // event handlers
  5947. if (el.events) {
  5948. data += "".concat(genHandlers(el.events, false), ",");
  5949. }
  5950. if (el.nativeEvents) {
  5951. data += "".concat(genHandlers(el.nativeEvents, true), ",");
  5952. }
  5953. // slot target
  5954. // only for non-scoped slots
  5955. if (el.slotTarget && !el.slotScope) {
  5956. data += "slot:".concat(el.slotTarget, ",");
  5957. }
  5958. // scoped slots
  5959. if (el.scopedSlots) {
  5960. data += "".concat(genScopedSlots(el, el.scopedSlots, state), ",");
  5961. }
  5962. // component v-model
  5963. if (el.model) {
  5964. data += "model:{value:".concat(el.model.value, ",callback:").concat(el.model.callback, ",expression:").concat(el.model.expression, "},");
  5965. }
  5966. // inline-template
  5967. if (el.inlineTemplate) {
  5968. var inlineTemplate = genInlineTemplate(el, state);
  5969. if (inlineTemplate) {
  5970. data += "".concat(inlineTemplate, ",");
  5971. }
  5972. }
  5973. data = data.replace(/,$/, '') + '}';
  5974. // v-bind dynamic argument wrap
  5975. // v-bind with dynamic arguments must be applied using the same v-bind object
  5976. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  5977. if (el.dynamicAttrs) {
  5978. data = "_b(".concat(data, ",\"").concat(el.tag, "\",").concat(genProps(el.dynamicAttrs), ")");
  5979. }
  5980. // v-bind data wrap
  5981. if (el.wrapData) {
  5982. data = el.wrapData(data);
  5983. }
  5984. // v-on data wrap
  5985. if (el.wrapListeners) {
  5986. data = el.wrapListeners(data);
  5987. }
  5988. return data;
  5989. }
  5990. function genDirectives(el, state) {
  5991. var dirs = el.directives;
  5992. if (!dirs)
  5993. return;
  5994. var res = 'directives:[';
  5995. var hasRuntime = false;
  5996. var i, l, dir, needRuntime;
  5997. for (i = 0, l = dirs.length; i < l; i++) {
  5998. dir = dirs[i];
  5999. needRuntime = true;
  6000. var gen = state.directives[dir.name];
  6001. if (gen) {
  6002. // compile-time directive that manipulates AST.
  6003. // returns true if it also needs a runtime counterpart.
  6004. needRuntime = !!gen(el, dir, state.warn);
  6005. }
  6006. if (needRuntime) {
  6007. hasRuntime = true;
  6008. res += "{name:\"".concat(dir.name, "\",rawName:\"").concat(dir.rawName, "\"").concat(dir.value
  6009. ? ",value:(".concat(dir.value, "),expression:").concat(JSON.stringify(dir.value))
  6010. : '').concat(dir.arg ? ",arg:".concat(dir.isDynamicArg ? dir.arg : "\"".concat(dir.arg, "\"")) : '').concat(dir.modifiers ? ",modifiers:".concat(JSON.stringify(dir.modifiers)) : '', "},");
  6011. }
  6012. }
  6013. if (hasRuntime) {
  6014. return res.slice(0, -1) + ']';
  6015. }
  6016. }
  6017. function genInlineTemplate(el, state) {
  6018. var ast = el.children[0];
  6019. if ((el.children.length !== 1 || ast.type !== 1)) {
  6020. state.warn('Inline-template components must have exactly one child element.', { start: el.start });
  6021. }
  6022. if (ast && ast.type === 1) {
  6023. var inlineRenderFns = generate$1(ast, state.options);
  6024. return "inlineTemplate:{render:function(){".concat(inlineRenderFns.render, "},staticRenderFns:[").concat(inlineRenderFns.staticRenderFns
  6025. .map(function (code) { return "function(){".concat(code, "}"); })
  6026. .join(','), "]}");
  6027. }
  6028. }
  6029. function genScopedSlots(el, slots, state) {
  6030. // by default scoped slots are considered "stable", this allows child
  6031. // components with only scoped slots to skip forced updates from parent.
  6032. // but in some cases we have to bail-out of this optimization
  6033. // for example if the slot contains dynamic names, has v-if or v-for on them...
  6034. var needsForceUpdate = el.for ||
  6035. Object.keys(slots).some(function (key) {
  6036. var slot = slots[key];
  6037. return (slot.slotTargetDynamic || slot.if || slot.for || containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  6038. );
  6039. });
  6040. // #9534: if a component with scoped slots is inside a conditional branch,
  6041. // it's possible for the same component to be reused but with different
  6042. // compiled slot content. To avoid that, we generate a unique key based on
  6043. // the generated code of all the slot contents.
  6044. var needsKey = !!el.if;
  6045. // OR when it is inside another scoped slot or v-for (the reactivity may be
  6046. // disconnected due to the intermediate scope variable)
  6047. // #9438, #9506
  6048. // TODO: this can be further optimized by properly analyzing in-scope bindings
  6049. // and skip force updating ones that do not actually use scope variables.
  6050. if (!needsForceUpdate) {
  6051. var parent_2 = el.parent;
  6052. while (parent_2) {
  6053. if ((parent_2.slotScope && parent_2.slotScope !== emptySlotScopeToken) ||
  6054. parent_2.for) {
  6055. needsForceUpdate = true;
  6056. break;
  6057. }
  6058. if (parent_2.if) {
  6059. needsKey = true;
  6060. }
  6061. parent_2 = parent_2.parent;
  6062. }
  6063. }
  6064. var generatedSlots = Object.keys(slots)
  6065. .map(function (key) { return genScopedSlot(slots[key], state); })
  6066. .join(',');
  6067. return "scopedSlots:_u([".concat(generatedSlots, "]").concat(needsForceUpdate ? ",null,true" : "").concat(!needsForceUpdate && needsKey ? ",null,false,".concat(hash(generatedSlots)) : "", ")");
  6068. }
  6069. function hash(str) {
  6070. var hash = 5381;
  6071. var i = str.length;
  6072. while (i) {
  6073. hash = (hash * 33) ^ str.charCodeAt(--i);
  6074. }
  6075. return hash >>> 0;
  6076. }
  6077. function containsSlotChild(el) {
  6078. if (el.type === 1) {
  6079. if (el.tag === 'slot') {
  6080. return true;
  6081. }
  6082. return el.children.some(containsSlotChild);
  6083. }
  6084. return false;
  6085. }
  6086. function genScopedSlot(el, state) {
  6087. var isLegacySyntax = el.attrsMap['slot-scope'];
  6088. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  6089. return genIf(el, state, genScopedSlot, "null");
  6090. }
  6091. if (el.for && !el.forProcessed) {
  6092. return genFor(el, state, genScopedSlot);
  6093. }
  6094. var slotScope = el.slotScope === emptySlotScopeToken ? "" : String(el.slotScope);
  6095. var fn = "function(".concat(slotScope, "){") +
  6096. "return ".concat(el.tag === 'template'
  6097. ? el.if && isLegacySyntax
  6098. ? "(".concat(el.if, ")?").concat(genChildren(el, state) || 'undefined', ":undefined")
  6099. : genChildren(el, state) || 'undefined'
  6100. : genElement(el, state), "}");
  6101. // reverse proxy v-slot without scope on this.$slots
  6102. var reverseProxy = slotScope ? "" : ",proxy:true";
  6103. return "{key:".concat(el.slotTarget || "\"default\"", ",fn:").concat(fn).concat(reverseProxy, "}");
  6104. }
  6105. function genChildren(el, state, checkSkip, altGenElement, altGenNode) {
  6106. var children = el.children;
  6107. if (children.length) {
  6108. var el_1 = children[0];
  6109. // optimize single v-for
  6110. if (children.length === 1 &&
  6111. el_1.for &&
  6112. el_1.tag !== 'template' &&
  6113. el_1.tag !== 'slot') {
  6114. var normalizationType_1 = checkSkip
  6115. ? state.maybeComponent(el_1)
  6116. ? ",1"
  6117. : ",0"
  6118. : "";
  6119. return "".concat((altGenElement || genElement)(el_1, state)).concat(normalizationType_1);
  6120. }
  6121. var normalizationType = checkSkip
  6122. ? getNormalizationType(children, state.maybeComponent)
  6123. : 0;
  6124. var gen_1 = altGenNode || genNode;
  6125. return "[".concat(children.map(function (c) { return gen_1(c, state); }).join(','), "]").concat(normalizationType ? ",".concat(normalizationType) : '');
  6126. }
  6127. }
  6128. // determine the normalization needed for the children array.
  6129. // 0: no normalization needed
  6130. // 1: simple normalization needed (possible 1-level deep nested array)
  6131. // 2: full normalization needed
  6132. function getNormalizationType(children, maybeComponent) {
  6133. var res = 0;
  6134. for (var i = 0; i < children.length; i++) {
  6135. var el = children[i];
  6136. if (el.type !== 1) {
  6137. continue;
  6138. }
  6139. if (needsNormalization(el) ||
  6140. (el.ifConditions &&
  6141. el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  6142. res = 2;
  6143. break;
  6144. }
  6145. if (maybeComponent(el) ||
  6146. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  6147. res = 1;
  6148. }
  6149. }
  6150. return res;
  6151. }
  6152. function needsNormalization(el) {
  6153. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot';
  6154. }
  6155. function genNode(node, state) {
  6156. if (node.type === 1) {
  6157. return genElement(node, state);
  6158. }
  6159. else if (node.type === 3 && node.isComment) {
  6160. return genComment(node);
  6161. }
  6162. else {
  6163. return genText(node);
  6164. }
  6165. }
  6166. function genText(text) {
  6167. return "_v(".concat(text.type === 2
  6168. ? text.expression // no need for () because already wrapped in _s()
  6169. : transformSpecialNewlines(JSON.stringify(text.text)), ")");
  6170. }
  6171. function genComment(comment) {
  6172. return "_e(".concat(JSON.stringify(comment.text), ")");
  6173. }
  6174. function genSlot(el, state) {
  6175. var slotName = el.slotName || '"default"';
  6176. var children = genChildren(el, state);
  6177. var res = "_t(".concat(slotName).concat(children ? ",function(){return ".concat(children, "}") : '');
  6178. var attrs = el.attrs || el.dynamicAttrs
  6179. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  6180. // slot props are camelized
  6181. name: camelize(attr.name),
  6182. value: attr.value,
  6183. dynamic: attr.dynamic
  6184. }); }))
  6185. : null;
  6186. var bind = el.attrsMap['v-bind'];
  6187. if ((attrs || bind) && !children) {
  6188. res += ",null";
  6189. }
  6190. if (attrs) {
  6191. res += ",".concat(attrs);
  6192. }
  6193. if (bind) {
  6194. res += "".concat(attrs ? '' : ',null', ",").concat(bind);
  6195. }
  6196. return res + ')';
  6197. }
  6198. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  6199. function genComponent(componentName, el, state) {
  6200. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  6201. return "_c(".concat(componentName, ",").concat(genData(el, state)).concat(children ? ",".concat(children) : '', ")");
  6202. }
  6203. function genProps(props) {
  6204. var staticProps = "";
  6205. var dynamicProps = "";
  6206. for (var i = 0; i < props.length; i++) {
  6207. var prop = props[i];
  6208. var value = transformSpecialNewlines(prop.value);
  6209. if (prop.dynamic) {
  6210. dynamicProps += "".concat(prop.name, ",").concat(value, ",");
  6211. }
  6212. else {
  6213. staticProps += "\"".concat(prop.name, "\":").concat(value, ",");
  6214. }
  6215. }
  6216. staticProps = "{".concat(staticProps.slice(0, -1), "}");
  6217. if (dynamicProps) {
  6218. return "_d(".concat(staticProps, ",[").concat(dynamicProps.slice(0, -1), "])");
  6219. }
  6220. else {
  6221. return staticProps;
  6222. }
  6223. }
  6224. // #3895, #4268
  6225. function transformSpecialNewlines(text) {
  6226. return text.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
  6227. }
  6228. // these keywords should not appear inside expressions, but operators like
  6229. // typeof, instanceof and in are allowed
  6230. var prohibitedKeywordRE = new RegExp('\\b' +
  6231. ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  6232. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  6233. 'extends,finally,continue,debugger,function,arguments')
  6234. .split(',')
  6235. .join('\\b|\\b') +
  6236. '\\b');
  6237. // these unary operators should not be used as property/method names
  6238. var unaryOperatorsRE = new RegExp('\\b' +
  6239. 'delete,typeof,void'.split(',').join('\\s*\\([^\\)]*\\)|\\b') +
  6240. '\\s*\\([^\\)]*\\)');
  6241. // strip strings in expressions
  6242. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  6243. // detect problematic expressions in a template
  6244. function detectErrors(ast, warn) {
  6245. if (ast) {
  6246. checkNode(ast, warn);
  6247. }
  6248. }
  6249. function checkNode(node, warn) {
  6250. if (node.type === 1) {
  6251. for (var name_1 in node.attrsMap) {
  6252. if (dirRE.test(name_1)) {
  6253. var value = node.attrsMap[name_1];
  6254. if (value) {
  6255. var range = node.rawAttrsMap[name_1];
  6256. if (name_1 === 'v-for') {
  6257. checkFor(node, "v-for=\"".concat(value, "\""), warn, range);
  6258. }
  6259. else if (name_1 === 'v-slot' || name_1[0] === '#') {
  6260. checkFunctionParameterExpression(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  6261. }
  6262. else if (onRE.test(name_1)) {
  6263. checkEvent(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  6264. }
  6265. else {
  6266. checkExpression(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  6267. }
  6268. }
  6269. }
  6270. }
  6271. if (node.children) {
  6272. for (var i = 0; i < node.children.length; i++) {
  6273. checkNode(node.children[i], warn);
  6274. }
  6275. }
  6276. }
  6277. else if (node.type === 2) {
  6278. checkExpression(node.expression, node.text, warn, node);
  6279. }
  6280. }
  6281. function checkEvent(exp, text, warn, range) {
  6282. var stripped = exp.replace(stripStringRE, '');
  6283. var keywordMatch = stripped.match(unaryOperatorsRE);
  6284. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  6285. warn("avoid using JavaScript unary operator as property name: " +
  6286. "\"".concat(keywordMatch[0], "\" in expression ").concat(text.trim()), range);
  6287. }
  6288. checkExpression(exp, text, warn, range);
  6289. }
  6290. function checkFor(node, text, warn, range) {
  6291. checkExpression(node.for || '', text, warn, range);
  6292. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  6293. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  6294. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  6295. }
  6296. function checkIdentifier(ident, type, text, warn, range) {
  6297. if (typeof ident === 'string') {
  6298. try {
  6299. new Function("var ".concat(ident, "=_"));
  6300. }
  6301. catch (e) {
  6302. warn("invalid ".concat(type, " \"").concat(ident, "\" in expression: ").concat(text.trim()), range);
  6303. }
  6304. }
  6305. }
  6306. function checkExpression(exp, text, warn, range) {
  6307. try {
  6308. new Function("return ".concat(exp));
  6309. }
  6310. catch (e) {
  6311. var keywordMatch = exp
  6312. .replace(stripStringRE, '')
  6313. .match(prohibitedKeywordRE);
  6314. if (keywordMatch) {
  6315. warn("avoid using JavaScript keyword as property name: " +
  6316. "\"".concat(keywordMatch[0], "\"\n Raw expression: ").concat(text.trim()), range);
  6317. }
  6318. else {
  6319. warn("invalid expression: ".concat(e.message, " in\n\n") +
  6320. " ".concat(exp, "\n\n") +
  6321. " Raw expression: ".concat(text.trim(), "\n"), range);
  6322. }
  6323. }
  6324. }
  6325. function checkFunctionParameterExpression(exp, text, warn, range) {
  6326. try {
  6327. new Function(exp, '');
  6328. }
  6329. catch (e) {
  6330. warn("invalid function parameter expression: ".concat(e.message, " in\n\n") +
  6331. " ".concat(exp, "\n\n") +
  6332. " Raw expression: ".concat(text.trim(), "\n"), range);
  6333. }
  6334. }
  6335. var range = 2;
  6336. function generateCodeFrame(source, start, end) {
  6337. if (start === void 0) { start = 0; }
  6338. if (end === void 0) { end = source.length; }
  6339. var lines = source.split(/\r?\n/);
  6340. var count = 0;
  6341. var res = [];
  6342. for (var i = 0; i < lines.length; i++) {
  6343. count += lines[i].length + 1;
  6344. if (count >= start) {
  6345. for (var j = i - range; j <= i + range || end > count; j++) {
  6346. if (j < 0 || j >= lines.length)
  6347. continue;
  6348. res.push("".concat(j + 1).concat(repeat(" ", 3 - String(j + 1).length), "| ").concat(lines[j]));
  6349. var lineLength = lines[j].length;
  6350. if (j === i) {
  6351. // push underline
  6352. var pad = start - (count - lineLength) + 1;
  6353. var length_1 = end > count ? lineLength - pad : end - start;
  6354. res.push(" | " + repeat(" ", pad) + repeat("^", length_1));
  6355. }
  6356. else if (j > i) {
  6357. if (end > count) {
  6358. var length_2 = Math.min(end - count, lineLength);
  6359. res.push(" | " + repeat("^", length_2));
  6360. }
  6361. count += lineLength + 1;
  6362. }
  6363. }
  6364. break;
  6365. }
  6366. }
  6367. return res.join('\n');
  6368. }
  6369. function repeat(str, n) {
  6370. var result = '';
  6371. if (n > 0) {
  6372. // eslint-disable-next-line no-constant-condition
  6373. while (true) {
  6374. // eslint-disable-line
  6375. if (n & 1)
  6376. result += str;
  6377. n >>>= 1;
  6378. if (n <= 0)
  6379. break;
  6380. str += str;
  6381. }
  6382. }
  6383. return result;
  6384. }
  6385. function createFunction(code, errors) {
  6386. try {
  6387. return new Function(code);
  6388. }
  6389. catch (err) {
  6390. errors.push({ err: err, code: code });
  6391. return noop;
  6392. }
  6393. }
  6394. function createCompileToFunctionFn(compile) {
  6395. var cache = Object.create(null);
  6396. return function compileToFunctions(template, options, vm) {
  6397. options = extend({}, options);
  6398. var warn = options.warn || warn$2;
  6399. delete options.warn;
  6400. /* istanbul ignore if */
  6401. {
  6402. // detect possible CSP restriction
  6403. try {
  6404. new Function('return 1');
  6405. }
  6406. catch (e) {
  6407. if (e.toString().match(/unsafe-eval|CSP/)) {
  6408. warn('It seems you are using the standalone build of Vue.js in an ' +
  6409. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  6410. 'The template compiler cannot work in this environment. Consider ' +
  6411. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  6412. 'templates into render functions.');
  6413. }
  6414. }
  6415. }
  6416. // check cache
  6417. var key = options.delimiters
  6418. ? String(options.delimiters) + template
  6419. : template;
  6420. if (cache[key]) {
  6421. return cache[key];
  6422. }
  6423. // compile
  6424. var compiled = compile(template, options);
  6425. // check compilation errors/tips
  6426. {
  6427. if (compiled.errors && compiled.errors.length) {
  6428. if (options.outputSourceRange) {
  6429. compiled.errors.forEach(function (e) {
  6430. warn("Error compiling template:\n\n".concat(e.msg, "\n\n") +
  6431. generateCodeFrame(template, e.start, e.end), vm);
  6432. });
  6433. }
  6434. else {
  6435. warn("Error compiling template:\n\n".concat(template, "\n\n") +
  6436. compiled.errors.map(function (e) { return "- ".concat(e); }).join('\n') +
  6437. '\n', vm);
  6438. }
  6439. }
  6440. if (compiled.tips && compiled.tips.length) {
  6441. if (options.outputSourceRange) {
  6442. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  6443. }
  6444. else {
  6445. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  6446. }
  6447. }
  6448. }
  6449. // turn code into functions
  6450. var res = {};
  6451. var fnGenErrors = [];
  6452. res.render = createFunction(compiled.render, fnGenErrors);
  6453. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  6454. return createFunction(code, fnGenErrors);
  6455. });
  6456. // check function generation errors.
  6457. // this should only happen if there is a bug in the compiler itself.
  6458. // mostly for codegen development use
  6459. /* istanbul ignore if */
  6460. {
  6461. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  6462. warn("Failed to generate render function:\n\n" +
  6463. fnGenErrors
  6464. .map(function (_a) {
  6465. var err = _a.err, code = _a.code;
  6466. return "".concat(err.toString(), " in\n\n").concat(code, "\n");
  6467. })
  6468. .join('\n'), vm);
  6469. }
  6470. }
  6471. return (cache[key] = res);
  6472. };
  6473. }
  6474. function createCompilerCreator(baseCompile) {
  6475. return function createCompiler(baseOptions) {
  6476. function compile(template, options) {
  6477. var finalOptions = Object.create(baseOptions);
  6478. var errors = [];
  6479. var tips = [];
  6480. var warn = function (msg, range, tip) {
  6481. (tip ? tips : errors).push(msg);
  6482. };
  6483. if (options) {
  6484. if (options.outputSourceRange) {
  6485. // $flow-disable-line
  6486. var leadingSpaceLength_1 = template.match(/^\s*/)[0].length;
  6487. warn = function (msg, range, tip) {
  6488. var data = typeof msg === 'string' ? { msg: msg } : msg;
  6489. if (range) {
  6490. if (range.start != null) {
  6491. data.start = range.start + leadingSpaceLength_1;
  6492. }
  6493. if (range.end != null) {
  6494. data.end = range.end + leadingSpaceLength_1;
  6495. }
  6496. }
  6497. (tip ? tips : errors).push(data);
  6498. };
  6499. }
  6500. // merge custom modules
  6501. if (options.modules) {
  6502. finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
  6503. }
  6504. // merge custom directives
  6505. if (options.directives) {
  6506. finalOptions.directives = extend(Object.create(baseOptions.directives || null), options.directives);
  6507. }
  6508. // copy other options
  6509. for (var key in options) {
  6510. if (key !== 'modules' && key !== 'directives') {
  6511. finalOptions[key] = options[key];
  6512. }
  6513. }
  6514. }
  6515. finalOptions.warn = warn;
  6516. var compiled = baseCompile(template.trim(), finalOptions);
  6517. {
  6518. detectErrors(compiled.ast, warn);
  6519. }
  6520. compiled.errors = errors;
  6521. compiled.tips = tips;
  6522. return compiled;
  6523. }
  6524. return {
  6525. compile: compile,
  6526. compileToFunctions: createCompileToFunctionFn(compile)
  6527. };
  6528. };
  6529. }
  6530. // `createCompilerCreator` allows creating compilers that use alternative
  6531. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  6532. // Here we just export a default compiler using the default parts.
  6533. var createCompiler$1 = createCompilerCreator(function baseCompile(template, options) {
  6534. var ast = parse(template.trim(), options);
  6535. if (options.optimize !== false) {
  6536. optimize$1(ast, options);
  6537. }
  6538. var code = generate$1(ast, options);
  6539. return {
  6540. ast: ast,
  6541. render: code.render,
  6542. staticRenderFns: code.staticRenderFns
  6543. };
  6544. });
  6545. var _a$1 = createCompiler$1(baseOptions), compile$1 = _a$1.compile, compileToFunctions$1 = _a$1.compileToFunctions;
  6546. var isAttr = makeMap('accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
  6547. 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
  6548. 'checked,cite,class,code,codebase,color,cols,colspan,content,' +
  6549. 'contenteditable,contextmenu,controls,coords,data,datetime,default,' +
  6550. 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,for,' +
  6551. 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' +
  6552. 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
  6553. 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
  6554. 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
  6555. 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
  6556. 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
  6557. 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
  6558. 'target,title,usemap,value,width,wrap');
  6559. /* istanbul ignore next */
  6560. var isRenderableAttr = function (name) {
  6561. return (isAttr(name) || name.indexOf('data-') === 0 || name.indexOf('aria-') === 0);
  6562. };
  6563. var propsToAttrMap = {
  6564. acceptCharset: 'accept-charset',
  6565. className: 'class',
  6566. htmlFor: 'for',
  6567. httpEquiv: 'http-equiv'
  6568. };
  6569. var ESC = {
  6570. '<': '&lt;',
  6571. '>': '&gt;',
  6572. '"': '&quot;',
  6573. '&': '&amp;'
  6574. };
  6575. function escape(s) {
  6576. return s.replace(/[<>"&]/g, escapeChar);
  6577. }
  6578. function escapeChar(a) {
  6579. return ESC[a] || a;
  6580. }
  6581. var plainStringRE = /^"(?:[^"\\]|\\.)*"$|^'(?:[^'\\]|\\.)*'$/;
  6582. // let the model AST transform translate v-model into appropriate
  6583. // props bindings
  6584. function applyModelTransform(el, state) {
  6585. if (el.directives) {
  6586. for (var i = 0; i < el.directives.length; i++) {
  6587. var dir = el.directives[i];
  6588. if (dir.name === 'model') {
  6589. state.directives.model(el, dir, state.warn);
  6590. // remove value for textarea as its converted to text
  6591. if (el.tag === 'textarea' && el.props) {
  6592. el.props = el.props.filter(function (p) { return p.name !== 'value'; });
  6593. }
  6594. break;
  6595. }
  6596. }
  6597. }
  6598. }
  6599. function genAttrSegments(attrs) {
  6600. return attrs.map(function (_a) {
  6601. var name = _a.name, value = _a.value;
  6602. return genAttrSegment(name, value);
  6603. });
  6604. }
  6605. function genDOMPropSegments(props, attrs) {
  6606. var segments = [];
  6607. props.forEach(function (_a) {
  6608. var name = _a.name, value = _a.value;
  6609. name = propsToAttrMap[name] || name.toLowerCase();
  6610. if (isRenderableAttr(name) &&
  6611. !(attrs && attrs.some(function (a) { return a.name === name; }))) {
  6612. segments.push(genAttrSegment(name, value));
  6613. }
  6614. });
  6615. return segments;
  6616. }
  6617. function genAttrSegment(name, value) {
  6618. if (plainStringRE.test(value)) {
  6619. // force double quote
  6620. value = value.replace(/^'|'$/g, '"');
  6621. // force enumerated attr to "true"
  6622. if (isEnumeratedAttr(name) && value !== "\"false\"") {
  6623. value = "\"true\"";
  6624. }
  6625. return {
  6626. type: RAW,
  6627. value: isBooleanAttr(name)
  6628. ? " ".concat(name, "=\"").concat(name, "\"")
  6629. : value === '""'
  6630. ? " ".concat(name)
  6631. : " ".concat(name, "=\"").concat(JSON.parse(value), "\"")
  6632. };
  6633. }
  6634. else {
  6635. return {
  6636. type: EXPRESSION,
  6637. value: "_ssrAttr(".concat(JSON.stringify(name), ",").concat(value, ")")
  6638. };
  6639. }
  6640. }
  6641. function genClassSegments(staticClass, classBinding) {
  6642. if (staticClass && !classBinding) {
  6643. return [{ type: RAW, value: " class=\"".concat(JSON.parse(staticClass), "\"") }];
  6644. }
  6645. else {
  6646. return [
  6647. {
  6648. type: EXPRESSION,
  6649. value: "_ssrClass(".concat(staticClass || 'null', ",").concat(classBinding || 'null', ")")
  6650. }
  6651. ];
  6652. }
  6653. }
  6654. function genStyleSegments(staticStyle, parsedStaticStyle, styleBinding, vShowExpression) {
  6655. if (staticStyle && !styleBinding && !vShowExpression) {
  6656. return [{ type: RAW, value: " style=".concat(JSON.stringify(staticStyle)) }];
  6657. }
  6658. else {
  6659. return [
  6660. {
  6661. type: EXPRESSION,
  6662. value: "_ssrStyle(".concat(parsedStaticStyle || 'null', ",").concat(styleBinding || 'null', ", ").concat(vShowExpression
  6663. ? "{ display: (".concat(vShowExpression, ") ? '' : 'none' }")
  6664. : 'null', ")")
  6665. }
  6666. ];
  6667. }
  6668. }
  6669. /**
  6670. * In SSR, the vdom tree is generated only once and never patched, so
  6671. * we can optimize most element / trees into plain string render functions.
  6672. * The SSR optimizer walks the AST tree to detect optimizable elements and trees.
  6673. *
  6674. * The criteria for SSR optimizability is quite a bit looser than static tree
  6675. * detection (which is designed for client re-render). In SSR we bail only for
  6676. * components/slots/custom directives.
  6677. */
  6678. // optimizability constants
  6679. var optimizability = {
  6680. FALSE: 0,
  6681. FULL: 1,
  6682. SELF: 2,
  6683. CHILDREN: 3,
  6684. PARTIAL: 4 // self un-optimizable with some un-optimizable children
  6685. };
  6686. var isPlatformReservedTag;
  6687. function optimize(root, options) {
  6688. if (!root)
  6689. return;
  6690. isPlatformReservedTag = options.isReservedTag || no;
  6691. walk(root, true);
  6692. }
  6693. function walk(node, isRoot) {
  6694. if (isUnOptimizableTree(node)) {
  6695. node.ssrOptimizability = optimizability.FALSE;
  6696. return;
  6697. }
  6698. // root node or nodes with custom directives should always be a VNode
  6699. var selfUnoptimizable = isRoot || hasCustomDirective(node);
  6700. var check = function (child) {
  6701. if (child.ssrOptimizability !== optimizability.FULL) {
  6702. node.ssrOptimizability = selfUnoptimizable
  6703. ? optimizability.PARTIAL
  6704. : optimizability.SELF;
  6705. }
  6706. };
  6707. if (selfUnoptimizable) {
  6708. node.ssrOptimizability = optimizability.CHILDREN;
  6709. }
  6710. if (node.type === 1) {
  6711. for (var i = 0, l = node.children.length; i < l; i++) {
  6712. var child = node.children[i];
  6713. walk(child);
  6714. check(child);
  6715. }
  6716. if (node.ifConditions) {
  6717. for (var i = 1, l = node.ifConditions.length; i < l; i++) {
  6718. var block = node.ifConditions[i].block;
  6719. walk(block, isRoot);
  6720. check(block);
  6721. }
  6722. }
  6723. if (node.ssrOptimizability == null ||
  6724. (!isRoot && (node.attrsMap['v-html'] || node.attrsMap['v-text']))) {
  6725. node.ssrOptimizability = optimizability.FULL;
  6726. }
  6727. else {
  6728. node.children = optimizeSiblings(node);
  6729. }
  6730. }
  6731. else {
  6732. node.ssrOptimizability = optimizability.FULL;
  6733. }
  6734. }
  6735. function optimizeSiblings(el) {
  6736. var children = el.children;
  6737. var optimizedChildren = [];
  6738. var currentOptimizableGroup = [];
  6739. var pushGroup = function () {
  6740. if (currentOptimizableGroup.length) {
  6741. optimizedChildren.push({
  6742. type: 1,
  6743. parent: el,
  6744. tag: 'template',
  6745. attrsList: [],
  6746. attrsMap: {},
  6747. rawAttrsMap: {},
  6748. children: currentOptimizableGroup,
  6749. ssrOptimizability: optimizability.FULL
  6750. });
  6751. }
  6752. currentOptimizableGroup = [];
  6753. };
  6754. for (var i = 0; i < children.length; i++) {
  6755. var c = children[i];
  6756. if (c.ssrOptimizability === optimizability.FULL) {
  6757. currentOptimizableGroup.push(c);
  6758. }
  6759. else {
  6760. // wrap fully-optimizable adjacent siblings inside a template tag
  6761. // so that they can be optimized into a single ssrNode by codegen
  6762. pushGroup();
  6763. optimizedChildren.push(c);
  6764. }
  6765. }
  6766. pushGroup();
  6767. return optimizedChildren;
  6768. }
  6769. function isUnOptimizableTree(node) {
  6770. if (node.type === 2 || node.type === 3) {
  6771. // text or expression
  6772. return false;
  6773. }
  6774. return (isBuiltInTag(node.tag) || // built-in (slot, component)
  6775. !isPlatformReservedTag(node.tag) || // custom component
  6776. !!node.component || // "is" component
  6777. isSelectWithModel(node) // <select v-model> requires runtime inspection
  6778. );
  6779. }
  6780. var isBuiltInDir = makeMap('text,html,show,on,bind,model,pre,cloak,once');
  6781. function hasCustomDirective(node) {
  6782. return (node.type === 1 &&
  6783. node.directives &&
  6784. node.directives.some(function (d) { return !isBuiltInDir(d.name); }));
  6785. }
  6786. // <select v-model> cannot be optimized because it requires a runtime check
  6787. // to determine proper selected option
  6788. function isSelectWithModel(node) {
  6789. return (node.type === 1 &&
  6790. node.tag === 'select' &&
  6791. node.directives != null &&
  6792. node.directives.some(function (d) { return d.name === 'model'; }));
  6793. }
  6794. // The SSR codegen is essentially extending the default codegen to handle
  6795. // segment types
  6796. var RAW = 0;
  6797. var INTERPOLATION = 1;
  6798. var EXPRESSION = 2;
  6799. function generate(ast, options) {
  6800. var state = new CodegenState(options);
  6801. var code = ast ? genSSRElement(ast, state) : '_c("div")';
  6802. return {
  6803. render: "with(this){return ".concat(code, "}"),
  6804. staticRenderFns: state.staticRenderFns
  6805. };
  6806. }
  6807. function genSSRElement(el, state) {
  6808. if (el.for && !el.forProcessed) {
  6809. return genFor(el, state, genSSRElement);
  6810. }
  6811. else if (el.if && !el.ifProcessed) {
  6812. return genIf(el, state, genSSRElement);
  6813. }
  6814. else if (el.tag === 'template' && !el.slotTarget) {
  6815. return el.ssrOptimizability === optimizability.FULL
  6816. ? genChildrenAsStringNode(el, state)
  6817. : genSSRChildren(el, state) || 'void 0';
  6818. }
  6819. switch (el.ssrOptimizability) {
  6820. case optimizability.FULL:
  6821. // stringify whole tree
  6822. return genStringElement(el, state);
  6823. case optimizability.SELF:
  6824. // stringify self and check children
  6825. return genStringElementWithChildren(el, state);
  6826. case optimizability.CHILDREN:
  6827. // generate self as VNode and stringify children
  6828. return genNormalElement(el, state, true);
  6829. case optimizability.PARTIAL:
  6830. // generate self as VNode and check children
  6831. return genNormalElement(el, state, false);
  6832. default:
  6833. // bail whole tree
  6834. return genElement(el, state);
  6835. }
  6836. }
  6837. function genNormalElement(el, state, stringifyChildren) {
  6838. var data = el.plain ? undefined : genData(el, state);
  6839. var children = stringifyChildren
  6840. ? "[".concat(genChildrenAsStringNode(el, state), "]")
  6841. : genSSRChildren(el, state, true);
  6842. return "_c('".concat(el.tag, "'").concat(data ? ",".concat(data) : '').concat(children ? ",".concat(children) : '', ")");
  6843. }
  6844. function genSSRChildren(el, state, checkSkip) {
  6845. return genChildren(el, state, checkSkip, genSSRElement, genSSRNode);
  6846. }
  6847. function genSSRNode(el, state) {
  6848. return el.type === 1 ? genSSRElement(el, state) : genText(el);
  6849. }
  6850. function genChildrenAsStringNode(el, state) {
  6851. return el.children.length
  6852. ? "_ssrNode(".concat(flattenSegments(childrenToSegments(el, state)), ")")
  6853. : '';
  6854. }
  6855. function genStringElement(el, state) {
  6856. return "_ssrNode(".concat(elementToString(el, state), ")");
  6857. }
  6858. function genStringElementWithChildren(el, state) {
  6859. var children = genSSRChildren(el, state, true);
  6860. return "_ssrNode(".concat(flattenSegments(elementToOpenTagSegments(el, state)), ",\"</").concat(el.tag, ">\"").concat(children ? ",".concat(children) : '', ")");
  6861. }
  6862. function elementToString(el, state) {
  6863. return "(".concat(flattenSegments(elementToSegments(el, state)), ")");
  6864. }
  6865. function elementToSegments(el, state) {
  6866. // v-for / v-if
  6867. if (el.for && !el.forProcessed) {
  6868. el.forProcessed = true;
  6869. return [
  6870. {
  6871. type: EXPRESSION,
  6872. value: genFor(el, state, elementToString, '_ssrList')
  6873. }
  6874. ];
  6875. }
  6876. else if (el.if && !el.ifProcessed) {
  6877. el.ifProcessed = true;
  6878. return [
  6879. {
  6880. type: EXPRESSION,
  6881. value: genIf(el, state, elementToString, '"<!---->"')
  6882. }
  6883. ];
  6884. }
  6885. else if (el.tag === 'template') {
  6886. return childrenToSegments(el, state);
  6887. }
  6888. var openSegments = elementToOpenTagSegments(el, state);
  6889. var childrenSegments = childrenToSegments(el, state);
  6890. var isUnaryTag = state.options.isUnaryTag;
  6891. var close = isUnaryTag && isUnaryTag(el.tag)
  6892. ? []
  6893. : [{ type: RAW, value: "</".concat(el.tag, ">") }];
  6894. return openSegments.concat(childrenSegments, close);
  6895. }
  6896. function elementToOpenTagSegments(el, state) {
  6897. applyModelTransform(el, state);
  6898. var binding;
  6899. var segments = [{ type: RAW, value: "<".concat(el.tag) }];
  6900. // attrs
  6901. if (el.attrs) {
  6902. segments.push.apply(segments, genAttrSegments(el.attrs));
  6903. }
  6904. // domProps
  6905. if (el.props) {
  6906. segments.push.apply(segments, genDOMPropSegments(el.props, el.attrs));
  6907. }
  6908. // v-bind="object"
  6909. if ((binding = el.attrsMap['v-bind'])) {
  6910. segments.push({ type: EXPRESSION, value: "_ssrAttrs(".concat(binding, ")") });
  6911. }
  6912. // v-bind.prop="object"
  6913. if ((binding = el.attrsMap['v-bind.prop'])) {
  6914. segments.push({ type: EXPRESSION, value: "_ssrDOMProps(".concat(binding, ")") });
  6915. }
  6916. // class
  6917. if (el.staticClass || el.classBinding) {
  6918. segments.push.apply(segments, genClassSegments(el.staticClass, el.classBinding));
  6919. }
  6920. // style & v-show
  6921. if (el.staticStyle || el.styleBinding || el.attrsMap['v-show']) {
  6922. segments.push.apply(segments, genStyleSegments(el.attrsMap.style, el.staticStyle, el.styleBinding, el.attrsMap['v-show']));
  6923. }
  6924. // _scopedId
  6925. if (state.options.scopeId) {
  6926. segments.push({ type: RAW, value: " ".concat(state.options.scopeId) });
  6927. }
  6928. segments.push({ type: RAW, value: ">" });
  6929. return segments;
  6930. }
  6931. function childrenToSegments(el, state) {
  6932. var binding;
  6933. if ((binding = el.attrsMap['v-html'])) {
  6934. return [{ type: EXPRESSION, value: "_s(".concat(binding, ")") }];
  6935. }
  6936. if ((binding = el.attrsMap['v-text'])) {
  6937. return [{ type: INTERPOLATION, value: "_s(".concat(binding, ")") }];
  6938. }
  6939. if (el.tag === 'textarea' && (binding = el.attrsMap['v-model'])) {
  6940. return [{ type: INTERPOLATION, value: "_s(".concat(binding, ")") }];
  6941. }
  6942. return el.children ? nodesToSegments(el.children, state) : [];
  6943. }
  6944. function nodesToSegments(children, state) {
  6945. var segments = [];
  6946. for (var i = 0; i < children.length; i++) {
  6947. var c = children[i];
  6948. if (c.type === 1) {
  6949. segments.push.apply(segments, elementToSegments(c, state));
  6950. }
  6951. else if (c.type === 2) {
  6952. segments.push({ type: INTERPOLATION, value: c.expression });
  6953. }
  6954. else if (c.type === 3) {
  6955. var text = escape(c.text);
  6956. if (c.isComment) {
  6957. text = '<!--' + text + '-->';
  6958. }
  6959. segments.push({ type: RAW, value: text });
  6960. }
  6961. }
  6962. return segments;
  6963. }
  6964. function flattenSegments(segments) {
  6965. var mergedSegments = [];
  6966. var textBuffer = '';
  6967. var pushBuffer = function () {
  6968. if (textBuffer) {
  6969. mergedSegments.push(JSON.stringify(textBuffer));
  6970. textBuffer = '';
  6971. }
  6972. };
  6973. for (var i = 0; i < segments.length; i++) {
  6974. var s = segments[i];
  6975. if (s.type === RAW) {
  6976. textBuffer += s.value;
  6977. }
  6978. else if (s.type === INTERPOLATION) {
  6979. pushBuffer();
  6980. mergedSegments.push("_ssrEscape(".concat(s.value, ")"));
  6981. }
  6982. else if (s.type === EXPRESSION) {
  6983. pushBuffer();
  6984. mergedSegments.push("(".concat(s.value, ")"));
  6985. }
  6986. }
  6987. pushBuffer();
  6988. return mergedSegments.join('+');
  6989. }
  6990. var createCompiler = createCompilerCreator(function baseCompile(template, options) {
  6991. var ast = parse(template.trim(), options);
  6992. optimize(ast, options);
  6993. var code = generate(ast, options);
  6994. return {
  6995. ast: ast,
  6996. render: code.render,
  6997. staticRenderFns: code.staticRenderFns
  6998. };
  6999. });
  7000. var _a = createCompiler(baseOptions), compile = _a.compile, compileToFunctions = _a.compileToFunctions;
  7001. exports.compile = compile$1;
  7002. exports.compileToFunctions = compileToFunctions$1;
  7003. exports.generateCodeFrame = generateCodeFrame;
  7004. exports.parseComponent = parseComponent;
  7005. exports.ssrCompile = compile;
  7006. exports.ssrCompileToFunctions = compileToFunctions;
  7007. Object.defineProperty(exports, '__esModule', { value: true });
  7008. }));