vendor.js 260 KB

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