vendor.js 262 KB

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