vue.js 247 KB

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